@libxai/board 0.17.93 → 0.17.94

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 CHANGED
@@ -320,7 +320,7 @@ If ambiguous, ask for clarification in the message field.`;function ed(e){return
320
320
  ${td(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",d=r.dependencies?.length?`deps: [${r.dependencies.join(", ")}]`:"";return `- ${r.id}: "${r.name}" (${o} to ${s}, ${r.progress}%, ${r.status||"todo"}) ${d}`}).join(`
321
321
  `)}
322
322
 
323
- Today's date: ${new Date().toISOString().split("T")[0]}`}function td(e){let t=[],a=r=>{for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);};return a(e),t}function Pa(e,t){let a=td(e),r=t.toLowerCase().trim(),o=a.find(c=>c.name.toLowerCase()===r);if(o)return o;let s=a.find(c=>c.name.toLowerCase().includes(r));if(s)return s;let d=r.split(/\s+/);return a.find(c=>{let p=c.name.toLowerCase();return d.every(n=>p.includes(n))})}function ms(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 l=new Date(r);return l.setDate(l.getDate()+1),l}if(a==="yesterday"||a==="ayer"){let l=new Date(r);return l.setDate(l.getDate()-1),l}if(a==="next week"||a==="la pr\xF3xima semana"){let l=new Date(r);return l.setDate(l.getDate()+7),l}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 u={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(u!==void 0){let y=new Date(r),g=y.getDay(),v=u-g;return v<=0&&(v+=7),y.setDate(y.getDate()+v),y}}let s=a.match(/in\s+(\d+)\s+(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(s&&s[1]&&s[2]){let l=parseInt(s[1],10),u=s[2].toLowerCase(),y=new Date(r);return u==="day"||u==="d\xEDa"||u==="dias"?y.setDate(y.getDate()+l):u==="week"||u==="semana"||u==="semanas"?y.setDate(y.getDate()+l*7):(u==="month"||u==="mes"||u==="meses")&&y.setMonth(y.getMonth()+l),y}if(a.match(/(\d{4})-(\d{2})-(\d{2})/))return new Date(a);let c=a.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})/);if(c&&c[1]&&c[2]&&c[3]){let l=parseInt(c[1],10),u=parseInt(c[2],10)-1,y=parseInt(c[3],10);return new Date(y,u,l)}let p={enero:0,febrero:1,marzo:2,abril:3,mayo:4,junio:5,julio:6,agosto:7,septiembre:8,octubre:9,noviembre:10,diciembre:11},n=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(n&&n[1]&&n[2]){let l=parseInt(n[1],10),u=p[n[2].toLowerCase()],y=n[3]?parseInt(n[3],10):r.getFullYear();if(u!==void 0)return new Date(y,u,l)}let m={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},i=a.match(/(january|february|march|april|may|june|july|august|september|october|november|december)\s+(\d{1,2})(?:,?\s+(\d{4}))?/i);if(i&&i[1]&&i[2]){let l=m[i[1].toLowerCase()],u=parseInt(i[2],10),y=i[3]?parseInt(i[3],10):r.getFullYear();if(l!==void 0)return new Date(y,l,u)}return null}function us(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 gs(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 ad(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 rd(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 n=r[1].trim(),m=r[2].trim(),i=Pa(t,n),l=ms(m);if(!i)return {type:"move_task",taskName:n,message:`Could not find a task named "${n}". Please check the task name and try again.`,success:false,error:"Task not found"};if(!l)return {type:"move_task",taskId:i.id,taskName:i.name,message:`Could not parse the date "${m}". Try using formats like "next Monday", "in 3 days", or "2024-01-15".`,success:false,error:"Invalid date"};let u=i.startDate&&i.endDate?Math.round((i.endDate.getTime()-i.startDate.getTime())/(1e3*60*60*24)):1,y=new Date(l);return y.setDate(y.getDate()+u),{type:"move_task",taskId:i.id,taskName:i.name,updates:{startDate:l,endDate:y},message:`Moved "${i.name}" to ${l.toLocaleDateString()}.`,success:true}}let o=a.match(/(?:extend|extender|extiende|alargar)\s+["""]?(.+?)["""]?\s+(?:by|por)\s+(.+)/i);if(o&&o[1]&&o[2]){let n=o[1].trim(),m=o[2].trim(),i=Pa(t,n),l=us(m);if(!i)return {type:"resize_task",taskName:n,message:`Could not find a task named "${n}".`,success:false,error:"Task not found"};if(!l||!i.endDate)return {type:"resize_task",taskId:i.id,taskName:i.name,message:`Could not parse the duration "${m}".`,success:false,error:"Invalid duration"};let u=new Date(i.endDate);return u.setDate(u.getDate()+l),{type:"resize_task",taskId:i.id,taskName:i.name,updates:{endDate:u},message:`Extended "${i.name}" by ${l} days. New end date: ${u.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 n=s[1].trim(),m=s[2].trim(),i=Pa(t,n),l=gs(m);return i?l===null?{type:"set_progress",taskId:i.id,taskName:i.name,message:`Could not parse the progress value "${m}".`,success:false,error:"Invalid progress"}:{type:"set_progress",taskId:i.id,taskName:i.name,updates:{progress:l},message:`Set "${i.name}" progress to ${l}%.`,success:true}:{type:"set_progress",taskName:n,message:`Could not find a task named "${n}".`,success:false,error:"Task not found"}}let d=a.match(/(?:rename|renombrar|cambiar nombre de)\s+["""]?(.+?)["""]?\s+(?:to|a|por)\s+["""]?(.+?)["""]?$/i);if(d&&d[1]&&d[2]){let n=d[1].trim(),m=d[2].trim(),i=Pa(t,n);return i?{type:"rename_task",taskId:i.id,taskName:i.name,updates:{name:m},message:`Renamed "${i.name}" to "${m}".`,success:true}:{type:"rename_task",taskName:n,message:`Could not find a task named "${n}".`,success:false,error:"Task not found"}}let c=a.match(/(?:link|vincular|conectar)\s+["""]?(.+?)["""]?\s+(?:to|a|con)\s+["""]?(.+?)["""]?$/i);if(c&&c[1]&&c[2]){let n=c[1].trim(),m=c[2].trim(),i=Pa(t,n),l=Pa(t,m);return i?l?{type:"link_tasks",taskId:l.id,taskName:l.name,dependencyFrom:i.id,dependencyTo:l.id,message:`Linked "${i.name}" \u2192 "${l.name}".`,success:true}:{type:"link_tasks",taskName:m,message:`Could not find a task named "${m}".`,success:false,error:"Target task not found"}:{type:"link_tasks",taskName:n,message:`Could not find a task named "${n}".`,success:false,error:"Source task not found"}}let p=a.match(/(?:delete|eliminar|borrar|remove|quitar)\s+["""]?(.+?)["""]?$/i);if(p&&p[1]){let n=p[1].trim(),m=Pa(t,n);return m?{type:"delete_task",taskId:m.id,taskName:m.name,message:`Deleted "${m.name}".`,success:true}:{type:"delete_task",taskName:n,message:`Could not find a task named "${n}".`,success:false,error:"Task not found"}}return null}function od(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 Kg(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 Yg(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return e||"TODO"}}function Ro(e,t=[],a=[]){let r=e.assignedUserIds?.map(m=>{let i=a.find(l=>l.id===m);return i?{name:i.name,initials:i.initials,color:i.color}:null}).filter(m=>m!==null),o=t.filter(m=>m.metadata?.parentCardId===e.id).map(m=>Ro(m,t,a)),s;e.dependencies&&(typeof e.dependencies[0]=="string"?s=e.dependencies:s=e.dependencies.filter(m=>m.type==="finish-to-start").map(m=>m.taskId));let d=m=>{if(m)return typeof m=="string"?new Date(m):m},c=d(e.startDate),p=d(e.endDate),n=e.metadata?.isMilestone===true||c&&p&&Math.abs(p.getTime()-c.getTime())<=864e5;return {id:e.id,name:e.title,startDate:c,endDate:p,progress:e.progress||0,status:Kg(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:n,isCriticalPath:e.metadata?.isCriticalPath===true}}function nd(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:Yg(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function sd(e,t=[]){return e.filter(r=>!r.metadata?.parentCardId).map(r=>Ro(r,e,t))}var fs={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"}},bs={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"}},Oo={en:fs,es:bs};function hs(e){return Oo[e]||Oo.en}function $o(e,t){let a=hs(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}function cd(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(...cd(r.subtasks,t+1));return a}function nf({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 pd({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:o,className:s,style:d}){let{theme:c="dark",locale:p="en",customTranslations:n,showSearch:m=true,showHierarchy:i=true}=t,l=$o(p,n),u=c==="dark",[y,g]=react.useState(new Set),[v,k]=react.useState("startDate"),[b,f]=react.useState("asc"),[T,D]=react.useState("");react.useMemo(()=>{let C=new Set;function B(z){for(let R of z)R.subtasks?.length&&(C.add(R.id),B(R.subtasks));}B(e),g(C);},[e]);let h=react.useCallback(C=>{g(B=>{let z=new Set(B);return z.has(C)?z.delete(C):z.add(C),z}),a.onTaskToggleExpand?.(C);},[a]),x=react.useCallback(C=>{v===C?f(B=>B==="asc"?"desc":"asc"):(k(C),f("asc")),a.onSortChange?.({column:C,direction:b==="asc"?"desc":"asc"});},[v,b,a]),w=react.useMemo(()=>{let C=cd(e);if(T.trim()){let z=T.toLowerCase();C=C.filter(R=>R.name.toLowerCase().includes(z));}let B=[];for(let z of C){let R=z.level===0;z.level>0&&(R=true),(R||T.trim())&&B.push(z);}return T.trim()&&B.sort((z,R)=>{let $,K;switch(v){case "name":$=z.name.toLowerCase(),K=R.name.toLowerCase();break;case "startDate":$=z.startDate?.getTime()||0,K=R.startDate?.getTime()||0;break;case "endDate":$=z.endDate?.getTime()||0,K=R.endDate?.getTime()||0;break;case "progress":$=z.progress||0,K=R.progress||0;break;case "status":$=z.status||"todo",K=R.status||"todo";break;default:return 0}return $<K?b==="asc"?-1:1:$>K?b==="asc"?1:-1:0}),B},[e,T,v,b]),M=C=>C?(C instanceof Date?C:new Date(C)).toLocaleDateString(p==="es"?"es-ES":"en-US",{day:"numeric",month:"short"}):"-";return r?jsxRuntime.jsx("div",{className:S("flex-1 flex items-center justify-center",u?"bg-[#0F1117]":"bg-white",s),style:d,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:S("text-sm",u?"text-[#9CA3AF]":"text-gray-600"),children:[l.empty.noTasks,"..."]})]})}):o?jsxRuntime.jsx("div",{className:S("flex-1 flex items-center justify-center",u?"bg-[#0F1117]":"bg-white",s),style:d,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:S("text-lg font-semibold mb-2",u?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:S("text-sm",u?"text-[#9CA3AF]":"text-gray-600"),children:typeof o=="string"?o:o.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:S("flex-1 flex items-center justify-center",u?"bg-[#0F1117]":"bg-white",s),style:d,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:S("text-lg font-semibold mb-2",u?"text-white":"text-gray-900"),children:l.empty.noTasks}),jsxRuntime.jsx("p",{className:S("text-sm",u?"text-[#9CA3AF]":"text-gray-600"),children:l.empty.addFirstTask})]})}):jsxRuntime.jsxs("div",{className:S("flex-1 flex flex-col w-full h-full overflow-hidden",u?"bg-[#0F1117]":"bg-white",s),style:d,children:[jsxRuntime.jsx("div",{className:S("flex-shrink-0 px-6 py-4 border-b",u?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[m&&jsxRuntime.jsxs("div",{className:"relative flex-1 max-w-md",children:[jsxRuntime.jsx(lucideReact.Search,{className:S("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",u?"text-[#9CA3AF]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:T,onChange:C=>D(C.target.value),placeholder:l.toolbar.searchPlaceholder,className:S("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",u?"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:S("text-sm",u?"text-[#9CA3AF]":"text-gray-600"),children:[w.length," ",l.pagination.tasks]})]})}),jsxRuntime.jsxs("div",{className:S("flex-shrink-0 grid grid-cols-12 gap-4 px-6 py-3 border-b text-xs font-medium uppercase tracking-wider",u?"border-white/10 bg-white/5 text-[#9CA3AF]":"border-gray-200 bg-gray-50 text-gray-500"),children:[jsxRuntime.jsx("div",{className:"col-span-5 flex items-center gap-2",children:jsxRuntime.jsxs("button",{onClick:()=>x("name"),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[l.columns.name,jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3"})]})}),jsxRuntime.jsx("div",{className:"col-span-2 flex items-center gap-1",children:jsxRuntime.jsxs("button",{onClick:()=>x("status"),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[l.columns.status,jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3"})]})}),jsxRuntime.jsx("div",{className:"col-span-2 flex items-center gap-1",children:jsxRuntime.jsxs("button",{onClick:()=>x("startDate"),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[l.columns.startDate,jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3"})]})}),jsxRuntime.jsx("div",{className:"col-span-2 flex items-center gap-1",children:jsxRuntime.jsxs("button",{onClick:()=>x("endDate"),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[l.columns.endDate,jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3"})]})}),jsxRuntime.jsx("div",{className:"col-span-1 flex items-center gap-1",children:jsxRuntime.jsxs("button",{onClick:()=>x("progress"),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:["%",jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3"})]})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-auto",children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{children:w.map((C,B)=>{let z=y.has(C.id);return jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{delay:B*.02},className:S("grid grid-cols-12 gap-4 px-6 py-3 border-b transition-colors cursor-pointer",u?"border-white/5 hover:bg-white/5":"border-gray-100 hover:bg-gray-50"),style:{paddingLeft:i?`${24+C.level*24}px`:void 0},onClick:()=>a.onTaskClick?.(C),onDoubleClick:()=>a.onTaskDoubleClick?.(C),children:[jsxRuntime.jsxs("div",{className:"col-span-5 flex items-center gap-2 min-w-0",children:[i&&C.hasChildren&&jsxRuntime.jsx("button",{onClick:R=>{R.stopPropagation(),h(C.id);},className:S("p-0.5 rounded",u?"hover:bg-white/10":"hover:bg-gray-200"),children:z?jsxRuntime.jsx(lucideReact.ChevronDown,{className:S("w-4 h-4",u?"text-[#9CA3AF]":"text-gray-400")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:S("w-4 h-4",u?"text-[#9CA3AF]":"text-gray-400")})}),i&&!C.hasChildren&&jsxRuntime.jsx("div",{className:"w-5"}),jsxRuntime.jsx("button",{onClick:R=>{R.stopPropagation(),a.onTaskUpdate?.({...C,progress:C.progress===100?0:100,status:C.progress===100?"todo":"completed"});},className:"flex-shrink-0",children:jsxRuntime.jsx(nf,{status:C.status,progress:C.progress})}),jsxRuntime.jsx("span",{className:S("truncate",u?"text-white":"text-gray-900",C.progress===100&&(u?"line-through text-[#6B7280]":"line-through text-gray-400")),children:C.name})]}),jsxRuntime.jsx("div",{className:"col-span-2 flex items-center",children:jsxRuntime.jsx("span",{className:S("px-2 py-1 rounded-full text-xs font-medium",C.progress===100||C.status==="completed"?"bg-green-500/10 text-green-500":C.progress&&C.progress>0||C.status==="in-progress"?"bg-blue-500/10 text-blue-500":u?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:C.progress===100||C.status==="completed"?l.status.completed:C.progress&&C.progress>0||C.status==="in-progress"?l.status.inProgress:l.status.todo})}),jsxRuntime.jsxs("div",{className:S("col-span-2 flex items-center gap-1 text-sm",u?"text-[#9CA3AF]":"text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),M(C.startDate)]}),jsxRuntime.jsxs("div",{className:S("col-span-2 flex items-center gap-1 text-sm",u?"text-[#9CA3AF]":"text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),M(C.endDate)]}),jsxRuntime.jsx("div",{className:"col-span-1 flex items-center",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{className:S("flex-1 h-1.5 rounded-full overflow-hidden",u?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:S("h-full rounded-full transition-all",C.progress===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${C.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:S("text-xs w-8",u?"text-[#9CA3AF]":"text-gray-500"),children:[C.progress||0,"%"]})]})})]},C.id)})}),w.length===0&&T&&jsxRuntime.jsx("div",{className:"flex items-center justify-center py-12",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(lucideReact.List,{className:S("w-12 h-12 mx-auto mb-4",u?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:S(u?"text-[#9CA3AF]":"text-gray-600"),children:l.empty.noResults})]})})]})]})}var vs={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"},ys={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"},xs={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"},Uo={dark:vs,light:ys,neutral:xs};function md(e){return Uo[e]||Uo.dark}var ks={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"}},ws={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"}},Wo={en:ks,es:ws};function jr(e){return Wo[e]||Wo.en}function Go(e,t){let a=jr(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 ud(e){let t=jr(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 gd(e,t=0,a=true){let r=jr(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 yf(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 Cs(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 vd({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 yd({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:o=false,error:s,className:d,style:c}){let{theme:p="dark",locale:n="en",customTranslations:m}=t,i=Go(n,m),l=p==="dark",[u,y]=react.useState(r||new Date),[g,v]=react.useState(null),[k,b]=react.useState(null),[f,T]=react.useState(null),[D,h]=react.useState(new Date),[x,w]=react.useState({}),M=4,C=3,[B,z]=react.useState(false),[R,$]=react.useState(false),[K,le]=react.useState(false),be=react.useCallback(()=>{y(new Date(u.getFullYear(),u.getMonth()-1,1));},[u]),Ge=react.useCallback(()=>{y(new Date(u.getFullYear(),u.getMonth()+1,1));},[u]),Le=react.useCallback(()=>{y(new Date);},[]),xe=react.useMemo(()=>{let F=u.getFullYear(),oe=u.getMonth(),q=new Date(F,oe,1),Fe=new Date(F,oe+1,0),Re=q.getDay(),tt=Fe.getDate(),Oe=yf(e),dt=new Date;dt.setHours(0,0,0,0);let pe=[],vt=Re,rt=new Date(F,oe,0).getDate();for(let ze=vt-1;ze>=0;ze--){let Pe=new Date(F,oe-1,rt-ze);pe.push({date:Pe,isCurrentMonth:false,isToday:false,isWeekend:Pe.getDay()===0||Pe.getDay()===6,events:Oe.filter(Ue=>Cs(Pe,Ue)).map(Ue=>({id:Ue.id,title:Ue.name,start:Ue.startDate,end:Ue.endDate,task:Ue}))});}for(let ze=1;ze<=tt;ze++){let Pe=new Date(F,oe,ze),Ue=Pe.getTime()===dt.getTime();pe.push({date:Pe,isCurrentMonth:true,isToday:Ue,isWeekend:Pe.getDay()===0||Pe.getDay()===6,events:Oe.filter(ct=>Cs(Pe,ct)).map(ct=>({id:ct.id,title:ct.name,start:ct.startDate,end:ct.endDate,task:ct}))});}let Ot=42-pe.length;for(let ze=1;ze<=Ot;ze++){let Pe=new Date(F,oe+1,ze);pe.push({date:Pe,isCurrentMonth:false,isToday:false,isWeekend:Pe.getDay()===0||Pe.getDay()===6,events:Oe.filter(Ue=>Cs(Pe,Ue)).map(Ue=>({id:Ue.id,title:Ue.name,start:Ue.startDate,end:Ue.endDate,task:Ue}))});}return pe},[u,e]),E=n==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],I=u.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"long",year:"numeric"}),P=react.useCallback(F=>{let oe=F.progress===100?0:100,q=oe===100?"completed":"todo";a.onTaskUpdate?.({...F,status:q,progress:oe});},[a]),_=react.useCallback((F,oe)=>{if(!g)return;let q={...g,[F]:oe};v(q),a.onTaskUpdate?.(q);},[g,a]),Y=react.useCallback(F=>{if(!g)return;let oe=g.progress||0;F==="completed"?oe=100:F==="todo"&&(oe=0);let q={...g,status:F,progress:oe};v(q),a.onTaskUpdate?.(q),z(false);},[g,a]),j=react.useCallback((F,oe)=>{if(!g)return;let q={...g,startDate:F,endDate:oe};v(q),a.onTaskUpdate?.(q);},[g,a]),ye=react.useCallback(()=>{z(false),$(false),T(null);},[]);return o?jsxRuntime.jsx("div",{className:S("flex-1 flex items-center justify-center",l?"bg-[#0F1117]":"bg-white",d),style:c,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:S("text-sm",l?"text-[#9CA3AF]":"text-gray-600"),children:[i.labels.noEvents,"..."]})]})}):s?jsxRuntime.jsx("div",{className:S("flex-1 flex items-center justify-center",l?"bg-[#0F1117]":"bg-white",d),style:c,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:S("text-lg font-semibold mb-2",l?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:S("text-sm",l?"text-[#9CA3AF]":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:S("flex-1 flex items-center justify-center",l?"bg-[#0F1117]":"bg-white",d),style:c,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:S("text-lg font-semibold mb-2",l?"text-white":"text-gray-900"),children:i.labels.noEvents}),jsxRuntime.jsx("p",{className:S("text-sm",l?"text-[#9CA3AF]":"text-gray-600"),children:i.labels.newTask})]})}):jsxRuntime.jsxs("div",{className:S("flex-1 flex flex-col w-full h-full overflow-hidden",l?"bg-[#0F1117]":"bg-white",d),style:c,children:[jsxRuntime.jsx("div",{className:S("flex-shrink-0 px-6 py-4 border-b",l?"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:S("text-xl font-semibold capitalize",l?"text-white":"text-gray-900"),children:I}),jsxRuntime.jsx("button",{onClick:Le,className:S("px-3 py-1.5 text-sm rounded-lg transition-colors",l?"bg-white/5 text-white hover:bg-white/10":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:i.navigation.today})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("button",{onClick:be,className:S("p-2 rounded-lg transition-colors",l?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:S("w-5 h-5",l?"text-[#9CA3AF]":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:Ge,className:S("p-2 rounded-lg transition-colors",l?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:S("w-5 h-5",l?"text-[#9CA3AF]":"text-gray-600")})})]})]})}),jsxRuntime.jsx("div",{className:"flex-1 p-6 overflow-auto",children:jsxRuntime.jsxs("div",{className:"h-full flex flex-col",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-px mb-2",children:E.map(F=>jsxRuntime.jsx("div",{className:S("py-2 text-center text-xs font-medium uppercase",l?"text-[#9CA3AF]":"text-gray-500"),children:F},F))}),jsxRuntime.jsx("div",{className:S("grid grid-cols-7 auto-rows-min gap-px rounded-lg overflow-hidden",l?"bg-white/5":"bg-gray-200"),children:xe.map((F,oe)=>{let q=F.date.getDay()===0||F.date.getDay()===6;return jsxRuntime.jsxs("div",{className:S("min-h-[120px] p-2 transition-colors flex flex-col relative",l?q?"bg-[#1A1D21]":F.isCurrentMonth?"bg-[#0F1117]":"bg-[#0A0C10]":q?"bg-gray-100":F.isCurrentMonth?"bg-white":"bg-gray-50",F.isToday&&"ring-2 ring-[#3B82F6] ring-inset"),children:[(()=>{let Fe=x[oe]||M,Re=F.events.slice(0,Fe),tt=F.events.length-Fe;return jsxRuntime.jsxs("div",{className:"space-y-1 flex-1",children:[Re.map(Oe=>jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{v(Oe.task),a.onEventClick?.(Oe);},whileHover:{scale:1.02},className:S("w-full flex items-center gap-1 px-1.5 py-0.5 rounded text-xs truncate",Oe.task.progress===100?l?"bg-green-500/20 text-green-400":"bg-green-500/10 text-green-600":l?"bg-[#3B82F6]/20 text-[#3B82F6]":"bg-[#3B82F6]/10 text-[#3B82F6]"),children:[jsxRuntime.jsx(vd,{task:Oe.task}),jsxRuntime.jsx("span",{className:"truncate",children:Oe.title})]}),jsxRuntime.jsx("div",{className:S("absolute left-0 bottom-full mb-1 px-2 py-1 rounded text-xs whitespace-nowrap z-50 opacity-0 group-hover:opacity-100 pointer-events-none transition-opacity shadow-lg",l?"bg-[#1A1D25] text-white border border-white/10":"bg-gray-900 text-white"),children:Oe.title})]},Oe.id)),tt>0&&jsxRuntime.jsxs("button",{onClick:Oe=>{Oe.stopPropagation(),w(dt=>({...dt,[oe]:Fe+C}));},className:S("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",l?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:["+",tt," ",n==="es"?"M\xC1S":"MORE"]}),Fe>M&&F.events.length>M&&jsxRuntime.jsx("button",{onClick:Oe=>{Oe.stopPropagation(),w(dt=>({...dt,[oe]:M}));},className:S("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",l?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:n==="es"?"MENOS":"LESS"})]})})(),jsxRuntime.jsx("div",{className:S("text-sm font-medium mt-1 text-right",F.isToday?"text-[#3B82F6]":F.isCurrentMonth?l?"text-white":"text-gray-900":l?"text-[#6B7280]":"text-gray-400"),children:F.date.getDate()})]},oe)})})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:g&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>v(null),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:S("fixed inset-4 md:inset-8 lg:inset-12 rounded-xl shadow-2xl z-50 flex overflow-hidden",l?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxRuntime.jsxs("div",{className:S("px-6 py-4 border-b flex items-center gap-3",l?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:S("text-xs px-2 py-0.5 rounded",l?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:n==="es"?"Tarea":"Task"}),jsxRuntime.jsx("span",{className:S("text-xs",l?"text-[#6B7280]":"text-gray-400"),children:g.id.slice(0,8)})]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:S("p-1.5 rounded hover:bg-white/10",l?"text-[#9CA3AF]":"text-gray-500"),children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{onClick:()=>v(null),className:S("p-1.5 rounded hover:bg-white/10",l?"text-[#9CA3AF]":"text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsx("h2",{className:S("text-xl font-semibold",l?"text-white":"text-gray-900"),children:g.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:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Estado":"Status"}),jsxRuntime.jsx("button",{onClick:()=>{ye(),z(!B);},className:S("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",g.progress===100||g.status==="completed"?"bg-green-500/20 text-green-400":g.progress&&g.progress>0||g.status==="in-progress"?"bg-blue-500/20 text-blue-400":l?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:g.progress===100||g.status==="completed"?n==="es"?"COMPLETADO":"DONE":g.progress&&g.progress>0||g.status==="in-progress"?n==="es"?"EN PROGRESO":"IN PROGRESS":n==="es"?"POR HACER":"TO DO"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:B&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:S("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",l?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"todo",label:n==="es"?"Por hacer":"To Do",color:"bg-white/10 text-white"},{id:"in-progress",label:n==="es"?"En progreso":"In Progress",color:"bg-blue-500/20 text-blue-400"},{id:"completed",label:n==="es"?"Completado":"Done",color:"bg-green-500/20 text-green-400"}].map(F=>jsxRuntime.jsxs("button",{onClick:()=>Y(F.id),className:S("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",l?"hover:bg-white/5":"hover:bg-gray-50",(g.status===F.id||F.id==="completed"&&g.progress===100||F.id==="in-progress"&&g.progress&&g.progress>0&&g.progress<100||F.id==="todo"&&(!g.progress||g.progress===0)&&g.status!=="in-progress"&&g.status!=="completed")&&(l?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:S("w-2 h-2 rounded-full",F.id==="completed"?"bg-green-500":F.id==="in-progress"?"bg-blue-500":"bg-gray-400")}),jsxRuntime.jsx("span",{className:l?"text-white":"text-gray-900",children:F.label})]},F.id))})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.User,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Asignados":"Assignees"}),g.assignees&&g.assignees.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[g.assignees.slice(0,3).map((F,oe)=>jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full bg-purple-500 flex items-center justify-center text-white text-xs font-medium",title:F.name,children:F.name.charAt(0).toUpperCase()},oe)),g.assignees.length>3&&jsxRuntime.jsxs("span",{className:S("text-xs",l?"text-[#6B7280]":"text-gray-400"),children:["+",g.assignees.length-3]})]}):jsxRuntime.jsx("span",{className:S("text-sm",l?"text-[#6B7280]":"text-gray-400"),children:n==="es"?"Sin asignar":"Unassigned"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Fechas":"Dates"}),jsxRuntime.jsxs("button",{onClick:()=>{T(f?null:"start"),h(g.startDate||new Date);},className:S("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",l?"bg-white/5 hover:bg-white/10 text-white":"bg-gray-100 hover:bg-gray-200 text-gray-900"),children:[g.startDate?.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(n==="es"?"Inicio":"Start"),jsxRuntime.jsx("span",{className:S("mx-1",l?"text-[#6B7280]":"text-gray-400"),children:"\u2192"}),g.endDate?.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(n==="es"?"Fin":"End"),(g.startDate||g.endDate)&&jsxRuntime.jsx(lucideReact.X,{className:"w-3.5 h-3.5 ml-1 opacity-50 hover:opacity-100",onClick:F=>{F.stopPropagation();}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>T(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:S("absolute left-0 top-full mt-2 z-50 rounded-xl shadow-2xl overflow-hidden flex",l?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:F=>F.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:S("w-44 py-2 border-r",l?"border-white/10":"border-gray-200"),children:[(()=>{let F=new Date,oe=new Date(F);oe.setDate(F.getDate()+1);let q=new Date(F);q.setDate(F.getDate()+((6-F.getDay()+7)%7||7));let Fe=new Date(F);Fe.setDate(F.getDate()+((1-F.getDay()+7)%7||7));let Re=new Date(F);Re.setDate(F.getDate()+(6-F.getDay()+7)%7+7);let tt=new Date(F);tt.setDate(F.getDate()+14);let Oe=new Date(F);return Oe.setDate(F.getDate()+28),[{label:n==="es"?"Hoy":"Today",date:F,display:F.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Ma\xF1ana":"Tomorrow",date:oe,display:oe.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Este fin de semana":"This weekend",date:q,display:n==="es"?"s\xE1b.":"sat."},{label:n==="es"?"Pr\xF3xima semana":"Next week",date:Fe,display:n==="es"?"lun.":"mon."},{label:n==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:Re,display:Re.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"2 semanas":"2 weeks",date:tt,display:tt.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"4 semanas":"4 weeks",date:Oe,display:Oe.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((pe,vt)=>jsxRuntime.jsxs("button",{className:S("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",l?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{if(f==="start"){let rt=g.endDate&&pe.date>g.endDate?pe.date:g.endDate;j(pe.date,rt),T("end");}else {let rt=g.startDate&&pe.date<g.startDate?pe.date:g.startDate;j(rt,pe.date),T(null);}},children:[jsxRuntime.jsx("span",{children:pe.label}),jsxRuntime.jsx("span",{className:S("text-xs",l?"text-[#6B7280]":"text-gray-400"),children:pe.display})]},vt))})(),jsxRuntime.jsx("div",{className:S("border-t mt-2 pt-2",l?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{j(void 0,void 0),T(null);},className:S("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",l?"hover:bg-white/5 text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:n==="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:S("text-xs mb-3 px-2 py-1 rounded",l?"bg-white/5 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:f==="start"?n==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":n==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:S("font-medium",l?"text-white":"text-gray-900"),children:D.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>h(new Date),className:S("p-1 rounded text-sm transition-colors",l?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:n==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>h(new Date(D.getFullYear(),D.getMonth()-1)),className:S("p-1 rounded",l?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{onClick:()=>h(new Date(D.getFullYear(),D.getMonth()+1)),className:S("p-1 rounded",l?"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:(n==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(F=>jsxRuntime.jsx("div",{className:S("w-8 h-8 flex items-center justify-center text-xs",l?"text-[#6B7280]":"text-gray-400"),children:F},F))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:(()=>{let F=D.getFullYear(),oe=D.getMonth(),q=new Date(F,oe,1).getDay(),Fe=new Date(F,oe+1,0).getDate(),Re=new Date(F,oe,0).getDate(),tt=new Date,Oe=[];for(let pe=q-1;pe>=0;pe--)Oe.push({day:Re-pe,isCurrentMonth:false,date:new Date(F,oe-1,Re-pe)});for(let pe=1;pe<=Fe;pe++)Oe.push({day:pe,isCurrentMonth:true,date:new Date(F,oe,pe)});let dt=42-Oe.length;for(let pe=1;pe<=dt;pe++)Oe.push({day:pe,isCurrentMonth:false,date:new Date(F,oe+1,pe)});return Oe.map((pe,vt)=>{let rt=pe.date.toDateString()===tt.toDateString(),Ot=g.startDate?.toDateString()===pe.date.toDateString(),ze=g.endDate?.toDateString()===pe.date.toDateString(),Pe=Ot||ze,Ue=g.startDate&&g.endDate&&pe.date>=g.startDate&&pe.date<=g.endDate;return jsxRuntime.jsx("button",{className:S("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!pe.isCurrentMonth&&(l?"text-[#4B5563]":"text-gray-300"),pe.isCurrentMonth&&(l?"text-white":"text-gray-900"),rt&&"ring-2 ring-[#3B82F6]",Ot&&"bg-[#3B82F6] text-white",ze&&!Ot&&"bg-[#7C3AED] text-white",Ue&&!Pe&&(l?"bg-[#7C3AED]/20":"bg-purple-100"),!Pe&&(l?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{let ct=new Date(pe.date);if(f==="start"){let de=g.endDate&&ct>g.endDate?ct:g.endDate;j(ct,de),T("end");}else {let de=g.startDate&&ct<g.startDate?ct:g.startDate;j(de,ct),T(null);}},children:pe.day},vt)})})()})]})]})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Flag,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Prioridad":"Priority"}),jsxRuntime.jsx("button",{onClick:()=>{ye(),$(!R);},className:S("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",g.priority==="high"||g.priority==="urgent"?"bg-red-500/20 text-red-400":g.priority==="medium"?"bg-yellow-500/20 text-yellow-400":g.priority==="low"?"bg-green-500/20 text-green-400":l?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:g.priority?g.priority==="high"||g.priority==="urgent"?n==="es"?"Urgente":"Urgent":g.priority==="medium"?n==="es"?"Media":"Medium":n==="es"?"Baja":"Low":n==="es"?"Sin prioridad":"No priority"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:R&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:S("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",l?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"urgent",label:n==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:n==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:n==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:n==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:n==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(F=>jsxRuntime.jsxs("button",{onClick:()=>{_("priority",F.id),$(false);},className:S("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",l?"hover:bg-white/5":"hover:bg-gray-50",g.priority===F.id&&(l?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:S("w-2 h-2 rounded-full",F.color)}),jsxRuntime.jsx("span",{className:l?"text-white":"text-gray-900",children:F.label})]},F.id||"none"))})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Clock,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Duraci\xF3n":"Duration"}),jsxRuntime.jsx("span",{className:S("text-sm",l?"text-white":"text-gray-900"),children:g.startDate&&g.endDate?`${Math.ceil((g.endDate.getTime()-g.startDate.getTime())/(1e3*60*60*24))} ${n==="es"?"d\xEDas":"days"}`:n==="es"?"Sin definir":"Not set"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:S("w-4 h-4 rounded-full border-2",l?"border-[#6B7280]":"border-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Progreso":"Progress"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[K?jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:g.progress||0,onChange:F=>{let oe=parseInt(F.target.value),q=g.status;oe===100?q="completed":oe>0?q="in-progress":q="todo";let Fe={...g,progress:oe,status:q};v(Fe),a.onTaskUpdate?.(Fe);},onBlur:()=>le(false),className:S("flex-1 max-w-[120px] h-2 rounded-full appearance-none cursor-pointer",l?"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:()=>le(true),className:S("flex-1 h-2 rounded-full overflow-hidden max-w-[120px] cursor-pointer hover:ring-2 hover:ring-white/20 transition-all",l?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:S("h-full rounded-full transition-all",g.progress===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${g.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:S("text-sm font-medium min-w-[40px]",l?"text-white":"text-gray-900"),children:[g.progress||0,"%"]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Tag,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Etiquetas":"Tags"}),jsxRuntime.jsx("span",{className:S("text-sm",l?"text-[#6B7280]":"text-gray-400"),children:n==="es"?"Vac\xEDo":"Empty"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Link2,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Relaciones":"Relations"}),jsxRuntime.jsx("span",{className:S("text-sm",l?"text-[#6B7280]":"text-gray-400"),children:g.dependencies&&g.dependencies.length>0?`${g.dependencies.length} ${n==="es"?"dependencias":"dependencies"}`:n==="es"?"Vac\xEDo":"Empty"})]})]}),jsxRuntime.jsxs("div",{className:S("mt-6 pt-4 border-t",l?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[jsxRuntime.jsx(lucideReact.FileText,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm font-medium",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Descripci\xF3n":"Description"})]}),jsxRuntime.jsx("div",{className:S("min-h-[60px] p-3 rounded-lg text-sm",l?"bg-white/5 text-[#9CA3AF]":"bg-gray-50 text-gray-600"),children:g.description||(n==="es"?"Sin descripci\xF3n":"No description")})]}),g.subtasks&&g.subtasks.length>0&&jsxRuntime.jsxs("div",{className:S("mt-4 pt-4 border-t",l?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[jsxRuntime.jsx(lucideReact.CheckCircle2,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsxs("span",{className:S("text-sm font-medium",l?"text-[#9CA3AF]":"text-gray-500"),children:[n==="es"?"Subtareas":"Subtasks"," (",g.subtasks.length,")"]})]}),jsxRuntime.jsx("div",{className:"space-y-2",children:g.subtasks.slice(0,5).map(F=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:S("w-4 h-4 rounded border flex items-center justify-center",F.progress===100?"bg-green-500 border-green-500":l?"border-white/20":"border-gray-300"),children:F.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:S("text-sm",F.progress===100?"line-through text-[#6B7280]":l?"text-white":"text-gray-900"),children:F.name})]},F.id))})]})]}),jsxRuntime.jsx("div",{className:S("px-6 py-4 border-t flex items-center gap-3",l?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("button",{onClick:()=>{P(g),v(null);},className:S("px-4 py-2 rounded-lg font-medium transition-colors",g.progress===100?"bg-gray-500/10 text-gray-500 hover:bg-gray-500/20":"bg-green-500/10 text-green-500 hover:bg-green-500/20"),children:g.progress===100?n==="es"?"Reabrir tarea":"Reopen task":n==="es"?"Completar tarea":"Complete task"})})]}),jsxRuntime.jsxs("div",{className:S("w-[280px] border-l flex flex-col",l?"border-white/10 bg-[#141619]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsx("div",{className:S("px-4 py-3 border-b flex items-center justify-between",l?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("span",{className:S("font-medium",l?"text-white":"text-gray-900"),children:n==="es"?"Actividad":"Activity"})}),jsxRuntime.jsx("div",{className:"flex-1 p-4 overflow-y-auto",children:jsxRuntime.jsxs("div",{className:S("text-sm text-center py-8",l?"text-[#6B7280]":"text-gray-400"),children:[jsxRuntime.jsx(lucideReact.MessageSquare,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),n==="es"?"Sin actividad reciente":"No recent activity"]})}),jsxRuntime.jsx("div",{className:S("p-3 border-t",l?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("div",{className:S("flex items-center gap-2 px-3 py-2 rounded-lg",l?"bg-white/5":"bg-white border border-gray-200"),children:jsxRuntime.jsx("input",{type:"text",placeholder:n==="es"?"Escribe un comentario...":"Write a comment...",className:S("flex-1 bg-transparent text-sm outline-none",l?"text-white placeholder-[#6B7280]":"text-gray-900 placeholder-gray-400")})})})]})]})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:k&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>b(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:S("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",l?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:S("px-4 py-3 border-b flex items-center justify-between",l?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("span",{className:S("font-medium",l?"text-white":"text-gray-900"),children:k.date.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>b(null),className:S("p-1 rounded",l?"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:k.events.map(F=>jsxRuntime.jsxs("button",{onClick:()=>{b(null),v(F.task);},className:S("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",l?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx(vd,{task:F.task}),jsxRuntime.jsx("span",{className:S("text-sm truncate flex-1",l?"text-white":"text-gray-900"),children:F.title}),F.task.priority==="high"||F.task.priority==="urgent"?jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5 text-red-400"}):null]},F.id))})]})]})})]})}var Ds={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"},Ns={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"},Ss={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"},Vo={dark:Ds,light:Ns,neutral:Ss};function xd(e){return Vo[e]||Vo.dark}function kf({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:o,onUnstack:s,onDeleteStack:d,className:c}){let[p,n]=react.useState(false),m=react.useMemo(()=>t.filter(u=>e.cardIds.includes(u.id)),[t,e.cardIds]),i=react.useMemo(()=>{let u=m.length,y=new Set(m.flatMap(k=>k.assignedUserIds||[])).size,g=m.map(k=>k.priority).filter(Boolean),v=new Set(m.flatMap(k=>k.labels||[])).size;return {totalCards:u,uniqueAssignees:y,priorities:g,labels:v}},[m]),l=()=>{o?.(e.id);};return jsxRuntime.jsxs("div",{className:S("card-stack",!e.isExpanded&&"card-stack-collapsed",c),onMouseEnter:()=>n(true),onMouseLeave:()=>n(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:l,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:S("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:i.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"]})]}),p&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:u=>{u.stopPropagation(),d?.(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:[i.uniqueAssignees," assignees"]})]}),i.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:[i.labels," labels"]})]}),e.confidence&&jsxRuntime.jsx("div",{className:"card-stack-summary-item",children:jsxRuntime.jsxs("span",{className:"card-stack-confidence",children:[Math.round(e.confidence*100),"% match"]})})]}),e.isExpanded&&jsxRuntime.jsx("div",{className:"card-stack-content",children:m.length===0?jsxRuntime.jsxs("div",{className:"card-stack-empty",children:[jsxRuntime.jsx("p",{children:"No cards in this stack"}),jsxRuntime.jsx("span",{children:"Drag cards here or delete this stack"})]}):jsxRuntime.jsx("div",{className:"card-stack-cards",children:m.map(u=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsxRuntime.jsx("div",{onClick:()=>r?.(u),children:a(u)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(u),children:[jsxRuntime.jsx("h4",{children:u.title}),u.description&&jsxRuntime.jsxs("p",{children:[u.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:y=>{y.stopPropagation(),s?.(e.id,u.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"})]})})]},u.id))})})]})}var wd={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function Yr(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 qr(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 Cd(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 Td({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:o,selectedEventId:s,config:d,className:c}){let p=react.useMemo(()=>({...wd,...d}),[d]),[n,m]=react.useState(new Set),i=react.useRef(null),l=react.useMemo(()=>{if(!p.groupByDay)return [{date:null,events:e}];let b=new Map;return e.forEach(f=>{let T=f.timestamp.toISOString().split("T")[0],D=b.get(T);D?D.push(f):b.set(T,[f]);}),Array.from(b.entries()).sort((f,T)=>T[0].localeCompare(f[0])).map(([f,T])=>({date:new Date(f),events:T.sort((D,h)=>h.timestamp.getTime()-D.timestamp.getTime())}))},[e,p.groupByDay]),{uniqueUsers:u,uniqueTypes:y}=react.useMemo(()=>{let b=new Set,f=new Set;return e.forEach(T=>{b.add(T.userId),f.add(T.type);}),{uniqueUsers:Array.from(b),uniqueTypes:Array.from(f)}},[e]),g=b=>{m(f=>{let T=new Set(f);return T.has(b)?T.delete(b):T.add(b),T});},v=b=>{let T=new Date().getTime()-b.getTime(),D=Math.floor(T/6e4),h=Math.floor(T/36e5),x=Math.floor(T/864e5);return D<1?"just now":D<60?`${D}m ago`:h<24?`${h}h ago`:x<7?`${x}d ago`:b.toLocaleDateString()},k=react.useMemo(()=>{let b=0;return t.types&&t.types.length>0&&b++,t.users&&t.users.length>0&&b++,t.dateRange&&b++,t.searchTerm&&b++,b},[t]);return react.useEffect(()=>{if(s&&i.current){let b=i.current.querySelector(`[data-event-id="${s}"]`);b&&b.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxRuntime.jsxs("div",{className:S("history-timeline-empty",c),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:S("history-timeline",p.compact&&"compact",c),children:[jsxRuntime.jsxs("div",{className:"history-timeline-filters",children:[jsxRuntime.jsxs("div",{className:"history-timeline-filter-group",children:[jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.types?.[0]||"",onChange:b=>{let f=b.target.value;a({...t,types:f?[f]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),y.map(b=>jsxRuntime.jsxs("option",{value:b,children:[qr(b)," ",b.replace("_"," ")]},b))]}),u.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:b=>{let f=b.target.value;a({...t,users:f?[f]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),u.map(b=>jsxRuntime.jsx("option",{value:b,children:b},b))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:b=>a({...t,searchTerm:b.target.value})})]}),k>0&&jsxRuntime.jsxs("button",{className:"history-timeline-filter-clear",onClick:r,children:["Clear filters (",k,")"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-container",ref:i,children:l.map(b=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[p.groupByDay&&b.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:b.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[b.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:b.events.map((f,T)=>{let D=n.has(f.id),h=s===f.id,x=Cd(f.type);return jsxRuntime.jsxs("div",{"data-event-id":f.id,className:S("history-timeline-event",D&&"expanded",h&&"selected"),onClick:()=>o?.(f),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:x},children:p.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:qr(f.type)})}),T<b.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:x}})]}),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:[p.showAvatars&&f.userAvatar&&jsxRuntime.jsx("img",{src:f.userAvatar,alt:f.userName||f.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:f.userName||f.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:Yr(f)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:p.useRelativeTime?v(f.timestamp):f.timestamp.toLocaleString()})]}),Object.keys(f.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:w=>{w.stopPropagation(),g(f.id);},children:[D?"\u25BC":"\u25B6"," Show changes"]}),D&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(f.changes).map(([w,M])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[w,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(M.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(M.to)})]})]},w)),f.metadata&&Object.keys(f.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(f.metadata).map(([w,M])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[w,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(M)})]},w))]})]})]})]},f.id)})})]},b.date?.toISOString()||"all"))})]})}function Nd({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:o,onPrevious:s,onNext:d,onGoToEvent:c,onSpeedChange:p,className:n}){let m=[.5,1,1.5,2,3],i=react.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),l=react.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:S("history-replay-empty",n),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:S("history-replay",n),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:i&&qr(i.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:i&&Yr(i)}),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:i&&i.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:u=>c(parseInt(u.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${l}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((u,y)=>jsxRuntime.jsx("div",{className:S("history-replay-progress-marker",y===e.currentIndex&&"active"),style:{left:`${y/(e.totalEvents-1)*100}%`},onClick:()=>c(y),title:Yr(u)},u.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:d,disabled:!e.canGoForward,title:"Next event (\u2192)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"5 4 15 12 5 20 5 4"}),jsxRuntime.jsx("line",{x1:"19",y1:"5",x2:"19",y2:"19"})]})}),jsxRuntime.jsxs("div",{className:"history-replay-speed",children:[jsxRuntime.jsx("label",{className:"history-replay-speed-label",children:"Speed:"}),jsxRuntime.jsx("div",{className:"history-replay-speed-buttons",children:m.map(u=>jsxRuntime.jsxs("button",{className:S("history-replay-speed-btn",e.speed===u&&"active"),onClick:()=>p(u),children:[u,"x"]},u))})]}),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:i&&i.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(u=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:u},u))})]})]})]})]}):jsxRuntime.jsxs("div",{className:S("history-replay-start",n),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 Es(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 Ps(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 Sd(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 Ed(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function Sf(e,t,a,r,o,s=100){let d=e.map(p=>({...p,x:p.x??a/2+Math.random()*100-50,y:p.y??r/2+Math.random()*100-50,vx:0,vy:0})),c=new Map(d.map(p=>[p.id,p]));for(let p=0;p<s;p++){let n=1-p/s;d.forEach(m=>{let i=a/2,l=r/2;m.vx+=(i-m.x)*o.centerForce*n,m.vy+=(l-m.y)*o.centerForce*n,d.forEach(u=>{if(m.id===u.id)return;let y=m.x-u.x,g=m.y-u.y,v=Math.sqrt(y*y+g*g)||1,k=o.chargeStrength*n/(v*v);m.vx+=y/v*k,m.vy+=g/v*k;});}),t.forEach(m=>{let i=c.get(typeof m.source=="string"?m.source:m.source.id),l=c.get(typeof m.target=="string"?m.target:m.target.id);if(!i||!l)return;let u=l.x-i.x,y=l.y-i.y,g=Math.sqrt(u*u+y*y)||1,v=(g-o.linkDistance)/g*o.forceStrength*n;i.vx+=u*v,i.vy+=y*v,l.vx-=u*v,l.vy-=y*v;}),d.forEach(m=>{m.fx!==null&&m.fx!==void 0?(m.x=m.fx,m.vx=0):m.x+=m.vx,m.fy!==null&&m.fy!==void 0?(m.y=m.fy,m.vy=0):m.y+=m.vy,m.x=Math.max(o.nodeSize,Math.min(a-o.nodeSize,m.x)),m.y=Math.max(o.nodeSize,Math.min(r-o.nodeSize,m.y)),m.vx*=.9,m.vy*=.9;});}return d}function Pd({nodes:e,edges:t,config:a,filter:r,onFilterChange:o,criticalPath:s,stats:d,onInteraction:c,className:p}){let n=react.useRef(null),[m,i]=react.useState([]),[l,u]=react.useState(null),[y,g]=react.useState(null),[v,k]=react.useState(null),[b,f]=react.useState(1),[T,D]=react.useState({x:0,y:0});react.useEffect(()=>{if(e.length===0)return;let R=Sf(e,t,a.width,a.height,a,150);i(R);},[e,t,a]);let h=react.useCallback((R,$)=>{a.enableDragging&&($.stopPropagation(),u(R));},[a.enableDragging]),x=react.useCallback(R=>{if(!l||!n.current)return;let K=n.current.getBoundingClientRect(),le=(R.clientX-K.left-T.x)/b,be=(R.clientY-K.top-T.y)/b;i(Ge=>Ge.map(Le=>Le.id===l?{...Le,x:le,y:be,fx:le,fy:be}:Le));},[l,b,T]),w=react.useCallback(()=>{u(null);},[]),M=react.useCallback((R,$)=>{$.stopPropagation(),c?.({type:"node-click",node:R,position:{x:$.clientX,y:$.clientY}});},[c]),C=react.useCallback((R,$)=>{$.stopPropagation(),c?.({type:"edge-click",edge:R,position:{x:$.clientX,y:$.clientY}});},[c]),B=react.useCallback(R=>{let $=m.find(K=>K.id===R);return $?{x:$.x,y:$.y}:{x:0,y:0}},[m]),z=react.useCallback(R=>{if(R.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return R.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let $=R.card.priority;return $==="URGENT"?"#ef4444":$==="HIGH"?"#f59e0b":$==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return R.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[a.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:S("relationships-graph-empty",p),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:S("relationships-graph",p),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:d.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:d.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:()=>f(R=>Math.min(R+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(b*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>f(R=>Math.max(R-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{f(1),D({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(R=>R.type))).map(R=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:Es(R)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[Sd(R)," ",Ps(R)]})]},R))}),jsxRuntime.jsxs("svg",{ref:n,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:x,onMouseUp:w,onMouseLeave:w,children:[jsxRuntime.jsxs("g",{transform:`translate(${T.x}, ${T.y}) scale(${b})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map(R=>{let $=B(typeof R.source=="string"?R.source:R.source.id),K=B(typeof R.target=="string"?R.target:R.target.id),le=Ed(R.type),be=v===R.id,Ge=R.onCriticalPath;return jsxRuntime.jsxs("g",{className:S("relationships-graph-edge",be&&"hovered",Ge&&"critical"),onMouseEnter:()=>k(R.id),onMouseLeave:()=>k(null),onClick:Le=>C(R,Le),children:[jsxRuntime.jsx("line",{x1:$.x,y1:$.y,x2:K.x,y2:K.y,stroke:Es(R.type),strokeWidth:Ge?a.edgeWidth*2:a.edgeWidth,strokeOpacity:be?1:.6,markerEnd:le?"url(#arrowhead)":void 0}),a.showEdgeLabels&&be&&jsxRuntime.jsx("text",{x:($.x+K.x)/2,y:($.y+K.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:Ps(R.type)})]},R.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:m.map(R=>{let $=y===R.id,K=R.onCriticalPath;return jsxRuntime.jsxs("g",{className:S("relationships-graph-node",$&&"hovered",K&&"critical"),transform:`translate(${R.x}, ${R.y})`,onMouseDown:le=>h(R.id,le),onMouseEnter:()=>g(R.id),onMouseLeave:()=>g(null),onClick:le=>M(R,le),children:[jsxRuntime.jsx("circle",{r:K?a.nodeSize*1.2:a.nodeSize,fill:z(R),stroke:K?"#fbbf24":"#ffffff",strokeWidth:K?3:2,opacity:$?1:.9}),a.showLabels&&jsxRuntime.jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:R.card.title.length>20?R.card.title.substring(0,20)+"...":R.card.title})]},R.id)})})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:jsxRuntime.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#6b7280"})})})]})]})}function Ad({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:o}){let[s,d]=react.useState(""),[c,p]=react.useState(false),[n,m]=react.useState(null),[i,l]=react.useState(null),u=react.useRef(null),y=c||o;react.useEffect(()=>{e&&u.current&&u.current.focus();},[e]),react.useEffect(()=>{let b=f=>{f.key==="Escape"&&!y&&g();};if(e)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,y]);let g=()=>{y||(d(""),m(null),l(null),t());},v=async()=>{if(!(!s.trim()||y)){p(true),m(null),l(null);try{let b=await r(s.trim());l(b);}catch(b){m(b instanceof Error?b.message:"Failed to generate plan");}finally{p(false);}}},k=()=>{i&&(a(i),g());};return e?jsxRuntime.jsxs(Ke,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:g}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-2xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:b=>b.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Generate Project Plan with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete Kanban board"})]}),jsxRuntime.jsx("button",{onClick:g,disabled:y,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:i?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!"})]}),i.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:i.explanation})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",i.columns.length,")"]}),jsxRuntime.jsx("div",{className:"flex gap-2 flex-wrap",children:i.columns.map((b,f)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:b.title},f))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",i.cards.length,")"]}),jsxRuntime.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[i.cards.slice(0,10).map((b,f)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:b.title}),b.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:b.description})]}),b.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${b.priority==="URGENT"?"bg-red-500/20 text-red-400":b.priority==="HIGH"?"bg-orange-500/20 text-orange-400":b.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:b.priority})]})},f)),i.cards.length>10&&jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",i.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:u,value:s,onChange:b=>d(b.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:y}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),n&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:n}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((b,f)=>jsxRuntime.jsx("button",{onClick:()=>d(b),disabled:y,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:b},f))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:y&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:g,disabled:y,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),i?jsxRuntime.jsx("button",{onClick:k,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Plan to Board"}):jsxRuntime.jsx("button",{onClick:v,disabled:!s.trim()||y,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:y?"Generating...":"Generate Plan"})]})]})]})})]}):null}var Ms={"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 Pf={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},Mf={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 If(e,t,a){let r=Ms[e];if(!r)throw new Error(`Unknown model: ${e}`);let o=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return o+s}function Xr(e){return `$${e.toFixed(4)}`}var Is=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=If(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(i=>i.timestamp>=t.start&&i.timestamp<=t.end));let r=a.length,o=a.reduce((i,l)=>i+l.cost,0),s=a.reduce((i,l)=>i+l.inputTokens,0),d=a.reduce((i,l)=>i+l.outputTokens,0),c=a.filter(i=>i.success),p=a.reduce((i,l)=>i+l.duration,0),n={},m={};return a.forEach(i=>{n[i.feature]=(n[i.feature]||0)+1,m[i.feature]=(m[i.feature]||0)+i.cost;}),{totalOperations:r,totalCost:o,totalInputTokens:s,totalOutputTokens:d,operationsByFeature:n,costsByFeature:m,averageDuration:r>0?p/r:0,successRate:r>0?c.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,d=new Date;a==="month"?d.setMonth(s.getMonth()-1):d.setDate(s.getDate()-1);let c=this.operations.filter(m=>m.timestamp>=d).length,p=Math.max(0,o-c),n=c/o*100;return {used:c,limit:o,remaining:p,percentUsed:n,isExceeded:c>=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)}},ar=new Is;function Bd({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,o]=react.useState(ar.getStats()),[s,d]=react.useState(ar.checkLimit(a));if(react.useEffect(()=>{if(!e)return;let p=setInterval(()=>{o(ar.getStats()),d(ar.checkLimit(a));},1e3);return ()=>clearInterval(p)},[e,a]),react.useEffect(()=>{let p=n=>{n.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e,t]),!e)return null;let c=ar.getRecentOperations(5);return jsxRuntime.jsxs(Ke,{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: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.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:Xr(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(([p,n])=>{let m=r.costsByFeature[p]||0,i=r.totalOperations>0?n/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:p.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:[n," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Xr(m)})]})]}),jsxRuntime.jsx("div",{className:"w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full bg-blue-500",style:{width:`${i}%`}})})]},p)})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),c.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:c.map(p=>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:p.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(p.timestamp).toLocaleTimeString()," \u2022"," ",p.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[p.inputTokens+p.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Xr(p.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${p.success?"bg-green-400":"bg-red-400"}`})]})]},p.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 $d({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:o,projectName:s}){let[d,c]=react.useState(""),[p,n]=react.useState(""),[m,i]=react.useState(""),[l,u]=react.useState(false),[y,g]=react.useState(null),[v,k]=react.useState(null),[b,f]=react.useState(null),T=react.useRef(null),D=l||o;react.useEffect(()=>{e&&T.current&&T.current.focus();},[e]),react.useEffect(()=>{let C=B=>{B.key==="Escape"&&!D&&h();};if(e)return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[e,D]);let h=()=>{D||(c(""),n(""),i(""),g(null),k(null),f(null),t());},x=async()=>{if(!(!d.trim()||D)){u(true),g(null),k(null),f(null);try{let C=await r({prompt:d.trim(),projectName:s||"Mi Proyecto",startDate:p||void 0,endDate:m||void 0});k(C.tasks.tasks),f({from_cache:C.from_cache,tokens_used:C.tokens_used,mock_mode:C.mock_mode,similarity:C.similarity,tokens_saved:C.tokens_saved});}catch(C){g(C instanceof Error?C.message:"Failed to generate tasks");}finally{u(false);}}},w=()=>{v&&(a(v),h());};if(!e)return null;let M=b?.similarity?((b.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(Ke,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:h}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:C=>C.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.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:h,disabled:D,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:v?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Tasks Generated Successfully!"})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[b?.mock_mode&&jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",children:"Mock Mode"}),b?.from_cache?jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-blue-500/20 text-blue-400 border border-blue-500/30",children:["From Cache (",M,"% similar)"]}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-green-500/20 text-green-400 border border-green-500/30",children:"AI Generated"}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-purple-500/20 text-purple-400 border border-purple-500/30",children:[b?.tokens_used||0," tokens"]}),b?.tokens_saved&&jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:[b.tokens_saved," tokens saved"]}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-pink-500/20 text-pink-400 border border-pink-500/30",children:[v.length," tasks"]})]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:v.map((C,B)=>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:["#",B+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:C.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"})]}),C.start," \u2192 ",C.end]}),jsxRuntime.jsxs("span",{children:[C.duration," days"]}),C.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-blue-400",children:["Depends: ",C.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${C.priority==="high"?"bg-red-500/20 text-red-400":C.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:C.priority})]})},C.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:T,value:d,onChange:C=>c(C.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:D}),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:p,onChange:C=>n(C.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:D})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"End Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:m,onChange:C=>i(C.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:D})]})]}),y&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:y}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((C,B)=>jsxRuntime.jsx("button",{onClick:()=>c(C),disabled:D,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:C},B))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:D&&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:h,disabled:D,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"}),v?jsxRuntime.jsx("button",{onClick:w,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:x,disabled:!d.trim()||D,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:D?"Generating...":"Generate Tasks"})]})]})]})})]})}function Yo({initialBoard:e,onPersist:t}){let[a,r]=react.useState(e),o=react.useCallback(v=>{t&&oo(()=>Promise.resolve(t(v)),{maxAttempts:3,initialDelay:1e3,onRetry:(k,b,f)=>{console.warn(`Retry attempt ${b} after ${f}ms: ${k.message}`);}}).then(k=>{k.success||console.error(`Failed to persist board after ${k.attempts} attempts:`,k.error);});},[t]),s=react.useCallback(async(v,k,b)=>{r(f=>{let T=f.cards.find(C=>C.id===v);if(!T)return f;let D=T.columnId,h={...T,columnId:k,position:b},x=f.cards.map(C=>C.id===v?h:C),w=f.columns.map(C=>{if(C.id===D)return {...C,cardIds:C.cardIds.filter(B=>B!==v)};if(C.id===k){let B=x.filter(z=>z.columnId===k).sort((z,R)=>z.position-R.position);return {...C,cardIds:B.map(z=>z.id)}}return C}),M={...f,cards:x,columns:w};return o(M),M});},[o]),d=react.useCallback(async(v,k)=>{r(b=>{let f=b.cards.map(D=>D.id===v?{...D,...k}:D),T={...b,cards:f};return o(T),T});},[o]),c=react.useCallback(async v=>{let k=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(b=>{let f={...v,id:k},T=b.columns.map(h=>h.id===v.columnId?{...h,cardIds:[...h.cardIds,k]}:h),D={...b,cards:[...b.cards,f],columns:T};return o(D),D});},[o]),p=react.useCallback(async v=>{r(k=>{let b=k.cards.find(h=>h.id===v);if(!b)return k;let f=k.cards.filter(h=>h.id!==v),T=k.columns.map(h=>h.id===b.columnId?{...h,cardIds:h.cardIds.filter(x=>x!==v)}:h),D={...k,cards:f,columns:T};return o(D),D});},[o]),n=react.useCallback(async v=>{let k=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(b=>{let f={...v,id:k,cardIds:[]},T={...b,columns:[...b.columns,f]};return o(T),T});},[o]),m=react.useCallback(async(v,k)=>{r(b=>{let f=b.columns.map(D=>D.id===v?{...D,...k}:D),T={...b,columns:f};return o(T),T});},[o]),i=react.useCallback(async v=>{r(k=>{let b=k.cards.filter(D=>D.columnId!==v),f=k.columns.filter(D=>D.id!==v),T={...k,cards:b,columns:f};return o(T),T});},[o]),l=react.useCallback(v=>{let k=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return c(v),k},[c]),u=react.useCallback(v=>{let k=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return n(v),k},[n]),y=react.useCallback(()=>{r(v=>{let k={...v,cards:[],columns:[]};return o(k),k});},[o]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:d,onCardCreate:c,onCardDelete:p,onColumnCreate:n,onColumnUpdate:m,onColumnDelete:i},setBoard:r,helpers:{addCard:l,addColumn:u,deleteCard:p,deleteColumn:i,clearBoard:y}}}function Ud({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:o,helpers:s}=Yo({initialBoard:e,onPersist:a}),d=react.useMemo(()=>({addCard:(p,n,m={})=>{s.addCard({title:n,columnId:p,position:r.cards.filter(i=>i.columnId===p).length,...m});},addColumn:(p,n)=>{let m=r.columns.length>0?Math.max(...r.columns.map(i=>i.position)):0;s.addColumn({title:p,position:n??m+1e3});},reset:s.clearBoard}),[r.cards,r.columns,s]);return {props:react.useMemo(()=>({board:r,callbacks:o,availableUsers:t}),[r,o,t]),board:r,callbacks:o,utils:d}}var Jr={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},Gd={by:"none",order:"asc"};function Hd({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,o]=react.useState({...Jr,...e}),[s,d]=react.useState({...Gd,...t}),c=react.useCallback(g=>{o(v=>({...v,...g}));},[]),p=react.useCallback(g=>{d(v=>({...v,...g}));},[]),n=react.useCallback(()=>{o(Jr),d(Gd);},[]),m=react.useCallback(()=>{a&&o({...Jr,assignees:[a]});},[a]),i=react.useCallback(()=>{o({...Jr,dateFilter:"overdue"});},[]),l=react.useCallback(()=>{o({...Jr,priorities:["HIGH","URGENT"]});},[]),u=react.useMemo(()=>r.dateFilter!=="all"||r.priorities.length>0||r.assignees.length>0||r.labels.length>0||r.columns.length>0||r.search!==""||s.by!=="none",[r,s]),y=react.useCallback(g=>{let v=[...g];if(r.search){let k=r.search.toLowerCase();v=v.filter(b=>b.title.toLowerCase().includes(k)||b.description?.toLowerCase().includes(k));}if(r.dateFilter!=="all"){let k=new Date,b=k.getFullYear(),f=String(k.getMonth()+1).padStart(2,"0"),T=String(k.getDate()).padStart(2,"0"),D=`${b}-${f}-${T}`;v=v.filter(h=>{if(!h.endDate&&!h.dueDate)return false;let x=h.endDate||h.dueDate;if(!x)return false;let w;if(typeof x=="string")w=x.split("T")[0]||x;else {let M=x.getUTCFullYear(),C=String(x.getUTCMonth()+1).padStart(2,"0"),B=String(x.getUTCDate()).padStart(2,"0");w=`${M}-${C}-${B}`;}switch(r.dateFilter){case "overdue":return w<D;case "today":return w===D;case "this-week":let M=new Date(D+"T00:00:00"),C=new Date(w+"T00:00:00"),B=new Date(M);return B.setDate(B.getDate()+7),C>=M&&C<=B;case "custom":if(r.dateRange){let z=typeof x=="string"?new Date(x):x;return z>=r.dateRange.start&&z<=r.dateRange.end}return true;default:return true}});}return r.priorities.length>0&&(v=v.filter(k=>k.priority&&r.priorities.includes(k.priority))),r.assignees.length>0&&(v=v.filter(k=>(k.assignedUserIds||(k.assigneeId?[k.assigneeId]:[])).some(f=>r.assignees.includes(f)))),r.labels.length>0&&(v=v.filter(k=>k.labels&&k.labels.some(b=>r.labels.includes(b)))),r.columns.length>0&&(v=v.filter(k=>r.columns.includes(k.columnId))),s.by!=="none"&&v.sort((k,b)=>{let f=0;switch(s.by){case "created":let T=k.createdAt?new Date(k.createdAt).getTime():0,D=b.createdAt?new Date(b.createdAt).getTime():0;f=T-D;break;case "priority":let h={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},x=h[k.priority||"LOW"],w=h[b.priority||"LOW"];f=x-w;break;case "dueDate":let M=k.endDate||k.dueDate,C=b.endDate||b.dueDate;if(!M)return 1;if(!C)return -1;let B=typeof M=="string"?new Date(M).getTime():M.getTime(),z=typeof C=="string"?new Date(C).getTime():C.getTime();f=B-z;break;case "title":f=k.title.localeCompare(b.title);break;case "estimate":let R=k.estimatedTime||0,$=b.estimatedTime||0;f=R-$;break;default:f=0;}return s.order==="asc"?f:-f}),v},[r,s]);return {filters:r,sort:s,setFilters:c,setSort:p,resetFilters:n,filterMyTasks:m,filterOverdue:i,filterHighPriority:l,applyFilters:y,hasActiveFilters:u}}var Vd,jd;if(typeof window<"u")try{let e=to("ai");Vd=e.generateObject,jd=e.generateText;}catch{}function Kd(e={}){let[t,a]=react.useState(false),[r,o]=react.useState(null),s=!!(Vd&&jd&&e.apiKey),d=react.useCallback(async i=>{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:",i),{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: ${i}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(l){let u=l instanceof Error?l:new Error("Failed to generate plan");throw o(u),u}finally{a(false);}},[s]),c=react.useCallback(async i=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Suggesting assignee for:",i.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(l){let u=l instanceof Error?l:new Error("Failed to suggest assignee");throw o(u),u}finally{a(false);}},[s]),p=react.useCallback(async i=>{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(l){let u=l instanceof Error?l:new Error("Failed to predict risks");throw o(u),u}finally{a(false);}},[s]),n=react.useCallback(async i=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Generating subtasks for:",i.title),[{title:`Subtask 1 for: ${i.title}`,position:i.position+.1,columnId:i.columnId},{title:`Subtask 2 for: ${i.title}`,position:i.position+.2,columnId:i.columnId}]}catch(l){let u=l instanceof Error?l:new Error("Failed to generate subtasks");throw o(u),u}finally{a(false);}},[s]),m=react.useCallback(async i=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Estimating effort for:",i.title),{hours:8,confidence:.75}}catch(l){let u=l instanceof Error?l:new Error("Failed to estimate effort");throw o(u),u}finally{a(false);}},[s]);return {onGeneratePlan:d,onSuggestAssignee:c,onPredictRisks:p,onGenerateSubtasks:n,onEstimateEffort:m,isAvailable:s,isLoading:t,error:r}}function Ls(){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 Yd(e){let{cards:t}=e,[a,r]=Ls(),o=react.useCallback(i=>a.selectedCardIds.includes(i),[a.selectedCardIds]),s=react.useCallback((i,l)=>{if(!l){r({selectedCardIds:[i],lastSelectedCardId:i});return}let u=l.ctrlKey||l.metaKey,y=l.shiftKey;if(u)a.selectedCardIds.includes(i)?r({selectedCardIds:a.selectedCardIds.filter(g=>g!==i),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,i],lastSelectedCardId:i});else if(y&&a.lastSelectedCardId){let g=t.find(k=>k.id===i),v=t.find(k=>k.id===a.lastSelectedCardId);if(g&&v&&g.columnId===v.columnId){let k=t.filter(w=>w.columnId===g.columnId).sort((w,M)=>w.position-M.position),b=k.findIndex(w=>w.id===a.lastSelectedCardId),f=k.findIndex(w=>w.id===i),[T,D]=b<f?[b,f]:[f,b],h=k.slice(T,D+1).map(w=>w.id),x=Array.from(new Set([...a.selectedCardIds,...h]));r({selectedCardIds:x,lastSelectedCardId:i});}else r({selectedCardIds:[i],lastSelectedCardId:i});}else r({selectedCardIds:[i],lastSelectedCardId:i});},[t,a,r]),d=react.useCallback(i=>{r({selectedCardIds:a.selectedCardIds.filter(l=>l!==i),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),c=react.useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),p=react.useCallback(()=>{r({selectedCardIds:t.map(i=>i.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),n=react.useCallback(i=>{a.selectedCardIds.includes(i)?d(i):r({selectedCardIds:[...a.selectedCardIds,i],lastSelectedCardId:i});},[a,d,r]),m=react.useCallback(()=>t.filter(i=>a.selectedCardIds.includes(i.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:o,selectCard:s,deselectCard:d,clearSelection:c,selectAll:p,toggleCard:n,getSelectedCards:m}}var qd={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function Xd(e){let{cards:t,config:a,aiService:r}=e,o=react.useMemo(()=>({...qd,...a}),[a]),[s,d]=react.useState([]),c=react.useCallback((g,v,k,b,f)=>{if(v.length<o.minCardsPerStack){console.warn(`Cannot create stack: minimum ${o.minCardsPerStack} cards required`);return}let T={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:g,cardIds:v,columnId:k,strategy:b,color:f,isExpanded:true,position:s.filter(D=>D.columnId===k).length,createdAt:new Date};d(D=>[...D,T]);},[o.minCardsPerStack,s]),p=react.useCallback(g=>{d(v=>v.filter(k=>k.id!==g));},[]),n=react.useCallback(g=>{d(v=>v.map(k=>k.id===g?{...k,isExpanded:!k.isExpanded}:k));},[]),m=react.useCallback((g,v)=>{d(k=>k.map(b=>b.id===g&&!b.cardIds.includes(v)?{...b,cardIds:[...b.cardIds,v]}:b));},[]),i=react.useCallback((g,v)=>{d(k=>k.map(b=>{if(b.id===g){let f=b.cardIds.filter(T=>T!==v);return f.length<o.minCardsPerStack?null:{...b,cardIds:f}}return b}).filter(b=>b!==null));},[o.minCardsPerStack]),l=react.useCallback(g=>s.filter(v=>v.columnId===g).sort((v,k)=>v.position-k.position),[s]),u=react.useCallback(async g=>{let v=t.filter(D=>D.columnId===g);if(v.length<o.minCardsPerStack*2)return [];let k=[],b=new Map;v.forEach(D=>{D.labels&&D.labels.length>0&&D.labels.forEach(h=>{b.has(h)||b.set(h,[]),b.get(h).push(D);});}),b.forEach((D,h)=>{D.length>=o.minCardsPerStack&&k.push({stack:{title:`\u{1F4CC} ${h}`,cardIds:D.map(x=>x.id),columnId:g,strategy:"labels",color:"#3b82f6"},reason:`${D.length} cards with label "${h}"`,confidence:.85});});let f=new Map;v.forEach(D=>{D.assignedUserIds&&D.assignedUserIds.length>0&&D.assignedUserIds.forEach(h=>{f.has(h)||f.set(h,[]),f.get(h).push(D);});}),f.forEach((D,h)=>{D.length>=o.minCardsPerStack&&k.push({stack:{title:`\u{1F464} Assigned to user-${h.slice(-4)}`,cardIds:D.map(x=>x.id),columnId:g,strategy:"assignee",color:"#8b5cf6"},reason:`${D.length} cards assigned to the same user`,confidence:.8});});let T=new Map;if(v.forEach(D=>{D.priority&&(T.has(D.priority)||T.set(D.priority,[]),T.get(D.priority).push(D));}),T.forEach((D,h)=>{if(D.length>=o.minCardsPerStack){let x={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[h.toLowerCase()]||"\u26AA";k.push({stack:{title:`${x} ${h} Priority`,cardIds:D.map(w=>w.id),columnId:g,strategy:"priority",color:h==="high"||h==="urgent"?"#ef4444":"#10b981"},reason:`${D.length} cards with ${h} priority`,confidence:.75});}}),r&&o.enableAutoStacking)for(let D of v){let x=(await r.findSimilar(D,v)).filter(w=>w.similarity>=o.autoStackConfidenceThreshold);if(x.length>=o.minCardsPerStack-1){let w=[D.id,...x.map(C=>C.card.id)],M=x.reduce((C,B)=>C+B.similarity,0)/x.length;k.push({stack:{title:`\u2728 Similar to "${D.title.substring(0,30)}${D.title.length>30?"...":""}"`,cardIds:w,columnId:g,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${x.length+1} similar tasks`,confidence:M});}}return k.filter(D=>D.confidence>=o.autoStackConfidenceThreshold).sort((D,h)=>h.confidence-D.confidence).slice(0,5)},[t,o,r]),y=react.useCallback(g=>{c(g.stack.title,g.stack.cardIds,g.stack.columnId,g.stack.strategy,g.stack.color);},[c]);return react.useEffect(()=>{o.enableAutoStacking&&s.length===0&&new Set(t.map(v=>v.columnId)).forEach(async v=>{let k=await u(v),b=k[0];k.length>0&&b&&b.confidence>=.9&&y(b);});},[]),{stacks:s,createStack:c,deleteStack:p,toggleStack:n,addToStack:m,removeFromStack:i,getStacksForColumn:l,getSuggestions:u,applySuggestion:y,config:o}}var Jd=react.createContext(null);function Zd({children:e,initialData:t,onStateChange:a}){let r=react.useRef();if(!r.current){let s=new Map,d=new Map;t?.columns?.forEach(p=>{let{Column:n}=to("@libxai/core");s.set(p.id,new n(p));}),t?.cards?.forEach(p=>{let{Card:n}=to("@libxai/core");d.set(p.id,new n(p));});let c=null;if(t?.board){let{Board:p}=to("@libxai/core");c=new p(t.board);}r.current=new core.BoardStore({board:c,columns:s,cards:d});}let o=r.current;return react.useEffect(()=>{if(a)return o.subscribeAll(s=>{a(o.getState());})},[o,a]),jsxRuntime.jsx(Jd.Provider,{value:{store:o},children:e})}function qo(){let e=react.useContext(Jd);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function Qr(){let e=qo(),[t,a]=react.useState(e.getBoard()),[r,o]=react.useState(e.getAllColumns()),[s,d]=react.useState(e.getAllCards());react.useEffect(()=>e.subscribeAll(()=>{a(e.getBoard()),o(e.getAllColumns()),d(e.getAllCards());}),[e]);let c=react.useCallback(b=>{e.updateBoard(b);},[e]),p=react.useCallback(b=>{e.addColumn(b);},[e]),n=react.useCallback((b,f)=>{e.updateColumn(b,f);},[e]),m=react.useCallback(b=>{e.deleteColumn(b);},[e]),i=react.useCallback(b=>e.getColumn(b),[e]),l=react.useCallback(b=>{e.addCard(b);},[e]),u=react.useCallback((b,f)=>{e.updateCard(b,f);},[e]),y=react.useCallback(b=>{e.deleteCard(b);},[e]),g=react.useCallback((b,f,T)=>{e.moveCard(b,f,T);},[e]),v=react.useCallback(b=>e.getCard(b),[e]),k=react.useCallback(b=>e.getCardsByColumn(b),[e]);return {board:t,columns:r,cards:s,updateBoard:c,addColumn:p,updateColumn:n,deleteColumn:m,getColumn:i,addCard:l,updateCard:u,deleteCard:y,moveCard:g,getCard:v,getCardsByColumn:k}}function ec(e){let{cards:t}=Qr();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 tc(e="position",t="asc"){let{cards:a}=Qr();return react.useMemo(()=>[...a].sort((o,s)=>{let d=0;switch(e){case "title":d=o.title.localeCompare(s.title);break;case "priority":{let c={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},p=o.priority?c[o.priority]:0,n=s.priority?c[s.priority]:0;d=p-n;break}case "createdAt":d=o.createdAt.getTime()-s.createdAt.getTime();break;case "updatedAt":d=o.updatedAt.getTime()-s.updatedAt.getTime();break;case "position":d=o.position-s.position;break}return t==="asc"?d:-d}),[a,e,t])}var Xo=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=ii.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 d=s[t];if(typeof d=="function")try{let c=await Promise.resolve(d.apply(s,a));c!==void 0&&(o=c,a[0]=c);}catch(c){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,c,{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(d=>{this.pluginLogger.error(`Plugin hook failed: ${o.id}.${t}`,d,{plugin:o.id,hook:t});}));}await Promise.all(r);}},Yf=new Xo;function rc({items:e,height:t,estimateSize:a,renderItem:r,className:o="",overscan:s=5,horizontal:d=false,gap:c=0,getItemKey:p}){let n=react.useRef(null),m=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>n.current,estimateSize:()=>a,overscan:s,horizontal:d,gap:c}),i=m.getVirtualItems(),l={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},u=d?{width:`${m.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${m.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:n,style:l,className:o,children:jsxRuntime.jsx("div",{style:u,children:i.map(y=>{let g=e[y.index];if(!g)return null;let v=p?p(g,y.index):y.index,k={position:"absolute",top:d?0:y.start,left:d?y.start:0,width:d?y.size:"100%",height:d?"100%":y.size};return jsxRuntime.jsx("div",{style:k,"data-index":y.index,children:r(g,y.index)},v)})})})}function oc(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 sc({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:o,className:s="",overscan:d=3,gap:c=16,getItemKey:p,horizontal:n=true}){let m=react.useRef(null),i=reactVirtual.useVirtualizer({horizontal:n,count:e.length,getScrollElement:()=>m.current,estimateSize:()=>r,overscan:d,gap:c}),l=i.getVirtualItems(),u={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},y={width:`${i.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:m,style:u,className:s,children:jsxRuntime.jsx("div",{style:y,children:l.map(g=>{let v=e[g.index];if(!v)return null;let k=p?p(v,g.index):g.index,b={position:"absolute",top:0,left:g.start,width:g.size,height:"100%"};return jsxRuntime.jsx("div",{style:b,"data-index":g.index,children:o(v,g.index)},k)})})})}function ic(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 lc(e,t=10){return e>t}var Os={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},$s={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},zs={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},Us={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Ws={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},Gs={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},Hs={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},_s={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)"},Vs={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)"},js={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Ks={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}},Ys={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}},Jo={spacing:Os,borderRadius:$s,fontSize:zs,fontWeight:Us,lineHeight:Ws,zIndex:Gs,duration:Hs,easing:_s,shadows:Vs,opacity:js,kanban:Ks,gantt:Ys};function dc(e,t,a){return e[t]??a}function qs(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)?qs(o,s,a):(typeof o=="string"||typeof o=="number")&&(a[s]=o);}return a}function Jf(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function Xs(e="asakaa"){let t=qs(Jo),a=[];for(let[r,o]of Object.entries(t)){let s=`--${e}-${r}`,d=Jf(o);a.push(` ${s}: ${d};`);}return `:root {
323
+ Today's date: ${new Date().toISOString().split("T")[0]}`}function td(e){let t=[],a=r=>{for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);};return a(e),t}function Pa(e,t){let a=td(e),r=t.toLowerCase().trim(),o=a.find(c=>c.name.toLowerCase()===r);if(o)return o;let s=a.find(c=>c.name.toLowerCase().includes(r));if(s)return s;let d=r.split(/\s+/);return a.find(c=>{let p=c.name.toLowerCase();return d.every(n=>p.includes(n))})}function ms(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 l=new Date(r);return l.setDate(l.getDate()+1),l}if(a==="yesterday"||a==="ayer"){let l=new Date(r);return l.setDate(l.getDate()-1),l}if(a==="next week"||a==="la pr\xF3xima semana"){let l=new Date(r);return l.setDate(l.getDate()+7),l}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 u={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(u!==void 0){let y=new Date(r),g=y.getDay(),v=u-g;return v<=0&&(v+=7),y.setDate(y.getDate()+v),y}}let s=a.match(/in\s+(\d+)\s+(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(s&&s[1]&&s[2]){let l=parseInt(s[1],10),u=s[2].toLowerCase(),y=new Date(r);return u==="day"||u==="d\xEDa"||u==="dias"?y.setDate(y.getDate()+l):u==="week"||u==="semana"||u==="semanas"?y.setDate(y.getDate()+l*7):(u==="month"||u==="mes"||u==="meses")&&y.setMonth(y.getMonth()+l),y}if(a.match(/(\d{4})-(\d{2})-(\d{2})/))return new Date(a);let c=a.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})/);if(c&&c[1]&&c[2]&&c[3]){let l=parseInt(c[1],10),u=parseInt(c[2],10)-1,y=parseInt(c[3],10);return new Date(y,u,l)}let p={enero:0,febrero:1,marzo:2,abril:3,mayo:4,junio:5,julio:6,agosto:7,septiembre:8,octubre:9,noviembre:10,diciembre:11},n=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(n&&n[1]&&n[2]){let l=parseInt(n[1],10),u=p[n[2].toLowerCase()],y=n[3]?parseInt(n[3],10):r.getFullYear();if(u!==void 0)return new Date(y,u,l)}let m={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},i=a.match(/(january|february|march|april|may|june|july|august|september|october|november|december)\s+(\d{1,2})(?:,?\s+(\d{4}))?/i);if(i&&i[1]&&i[2]){let l=m[i[1].toLowerCase()],u=parseInt(i[2],10),y=i[3]?parseInt(i[3],10):r.getFullYear();if(l!==void 0)return new Date(y,l,u)}return null}function us(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 gs(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 ad(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 rd(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 n=r[1].trim(),m=r[2].trim(),i=Pa(t,n),l=ms(m);if(!i)return {type:"move_task",taskName:n,message:`Could not find a task named "${n}". Please check the task name and try again.`,success:false,error:"Task not found"};if(!l)return {type:"move_task",taskId:i.id,taskName:i.name,message:`Could not parse the date "${m}". Try using formats like "next Monday", "in 3 days", or "2024-01-15".`,success:false,error:"Invalid date"};let u=i.startDate&&i.endDate?Math.round((i.endDate.getTime()-i.startDate.getTime())/(1e3*60*60*24)):1,y=new Date(l);return y.setDate(y.getDate()+u),{type:"move_task",taskId:i.id,taskName:i.name,updates:{startDate:l,endDate:y},message:`Moved "${i.name}" to ${l.toLocaleDateString()}.`,success:true}}let o=a.match(/(?:extend|extender|extiende|alargar)\s+["""]?(.+?)["""]?\s+(?:by|por)\s+(.+)/i);if(o&&o[1]&&o[2]){let n=o[1].trim(),m=o[2].trim(),i=Pa(t,n),l=us(m);if(!i)return {type:"resize_task",taskName:n,message:`Could not find a task named "${n}".`,success:false,error:"Task not found"};if(!l||!i.endDate)return {type:"resize_task",taskId:i.id,taskName:i.name,message:`Could not parse the duration "${m}".`,success:false,error:"Invalid duration"};let u=new Date(i.endDate);return u.setDate(u.getDate()+l),{type:"resize_task",taskId:i.id,taskName:i.name,updates:{endDate:u},message:`Extended "${i.name}" by ${l} days. New end date: ${u.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 n=s[1].trim(),m=s[2].trim(),i=Pa(t,n),l=gs(m);return i?l===null?{type:"set_progress",taskId:i.id,taskName:i.name,message:`Could not parse the progress value "${m}".`,success:false,error:"Invalid progress"}:{type:"set_progress",taskId:i.id,taskName:i.name,updates:{progress:l},message:`Set "${i.name}" progress to ${l}%.`,success:true}:{type:"set_progress",taskName:n,message:`Could not find a task named "${n}".`,success:false,error:"Task not found"}}let d=a.match(/(?:rename|renombrar|cambiar nombre de)\s+["""]?(.+?)["""]?\s+(?:to|a|por)\s+["""]?(.+?)["""]?$/i);if(d&&d[1]&&d[2]){let n=d[1].trim(),m=d[2].trim(),i=Pa(t,n);return i?{type:"rename_task",taskId:i.id,taskName:i.name,updates:{name:m},message:`Renamed "${i.name}" to "${m}".`,success:true}:{type:"rename_task",taskName:n,message:`Could not find a task named "${n}".`,success:false,error:"Task not found"}}let c=a.match(/(?:link|vincular|conectar)\s+["""]?(.+?)["""]?\s+(?:to|a|con)\s+["""]?(.+?)["""]?$/i);if(c&&c[1]&&c[2]){let n=c[1].trim(),m=c[2].trim(),i=Pa(t,n),l=Pa(t,m);return i?l?{type:"link_tasks",taskId:l.id,taskName:l.name,dependencyFrom:i.id,dependencyTo:l.id,message:`Linked "${i.name}" \u2192 "${l.name}".`,success:true}:{type:"link_tasks",taskName:m,message:`Could not find a task named "${m}".`,success:false,error:"Target task not found"}:{type:"link_tasks",taskName:n,message:`Could not find a task named "${n}".`,success:false,error:"Source task not found"}}let p=a.match(/(?:delete|eliminar|borrar|remove|quitar)\s+["""]?(.+?)["""]?$/i);if(p&&p[1]){let n=p[1].trim(),m=Pa(t,n);return m?{type:"delete_task",taskId:m.id,taskName:m.name,message:`Deleted "${m.name}".`,success:true}:{type:"delete_task",taskName:n,message:`Could not find a task named "${n}".`,success:false,error:"Task not found"}}return null}function od(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 Kg(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 Yg(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return e||"TODO"}}function Ro(e,t=[],a=[]){let r=e.assignedUserIds?.map(m=>{let i=a.find(l=>l.id===m);return i?{name:i.name,initials:i.initials,color:i.color}:null}).filter(m=>m!==null),o=t.filter(m=>m.metadata?.parentCardId===e.id).map(m=>Ro(m,t,a)),s;e.dependencies&&(typeof e.dependencies[0]=="string"?s=e.dependencies:s=e.dependencies.filter(m=>m.type==="finish-to-start").map(m=>m.taskId));let d=m=>{if(m)return typeof m=="string"?new Date(m):m},c=d(e.startDate),p=d(e.endDate),n=e.metadata?.isMilestone===true||c&&p&&Math.abs(p.getTime()-c.getTime())<=864e5;return {id:e.id,name:e.title,startDate:c,endDate:p,progress:e.progress||0,status:Kg(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:n,isCriticalPath:e.metadata?.isCriticalPath===true}}function nd(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:Yg(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function sd(e,t=[]){return e.filter(r=>!r.metadata?.parentCardId).map(r=>Ro(r,e,t))}var fs={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"}},bs={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"}},Oo={en:fs,es:bs};function hs(e){return Oo[e]||Oo.en}function $o(e,t){let a=hs(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}function cd(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(...cd(r.subtasks,t+1));return a}function nf({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 pd({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:o,className:s,style:d}){let{theme:c="dark",locale:p="en",customTranslations:n,showSearch:m=true,showHierarchy:i=true}=t,l=$o(p,n),u=c==="dark",[y,g]=react.useState(new Set),[v,k]=react.useState("startDate"),[b,f]=react.useState("asc"),[T,D]=react.useState("");react.useMemo(()=>{let C=new Set;function B(z){for(let R of z)R.subtasks?.length&&(C.add(R.id),B(R.subtasks));}B(e),g(C);},[e]);let h=react.useCallback(C=>{g(B=>{let z=new Set(B);return z.has(C)?z.delete(C):z.add(C),z}),a.onTaskToggleExpand?.(C);},[a]),x=react.useCallback(C=>{v===C?f(B=>B==="asc"?"desc":"asc"):(k(C),f("asc")),a.onSortChange?.({column:C,direction:b==="asc"?"desc":"asc"});},[v,b,a]),w=react.useMemo(()=>{let C=cd(e);if(T.trim()){let z=T.toLowerCase();C=C.filter(R=>R.name.toLowerCase().includes(z));}let B=[];for(let z of C){let R=z.level===0;z.level>0&&(R=true),(R||T.trim())&&B.push(z);}return T.trim()&&B.sort((z,R)=>{let $,K;switch(v){case "name":$=z.name.toLowerCase(),K=R.name.toLowerCase();break;case "startDate":$=z.startDate?.getTime()||0,K=R.startDate?.getTime()||0;break;case "endDate":$=z.endDate?.getTime()||0,K=R.endDate?.getTime()||0;break;case "progress":$=z.progress||0,K=R.progress||0;break;case "status":$=z.status||"todo",K=R.status||"todo";break;default:return 0}return $<K?b==="asc"?-1:1:$>K?b==="asc"?1:-1:0}),B},[e,T,v,b]),M=C=>C?(C instanceof Date?C:new Date(C)).toLocaleDateString(p==="es"?"es-ES":"en-US",{day:"numeric",month:"short"}):"-";return r?jsxRuntime.jsx("div",{className:S("flex-1 flex items-center justify-center",u?"bg-[#0F1117]":"bg-white",s),style:d,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:S("text-sm",u?"text-[#9CA3AF]":"text-gray-600"),children:[l.empty.noTasks,"..."]})]})}):o?jsxRuntime.jsx("div",{className:S("flex-1 flex items-center justify-center",u?"bg-[#0F1117]":"bg-white",s),style:d,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:S("text-lg font-semibold mb-2",u?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:S("text-sm",u?"text-[#9CA3AF]":"text-gray-600"),children:typeof o=="string"?o:o.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:S("flex-1 flex items-center justify-center",u?"bg-[#0F1117]":"bg-white",s),style:d,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:S("text-lg font-semibold mb-2",u?"text-white":"text-gray-900"),children:l.empty.noTasks}),jsxRuntime.jsx("p",{className:S("text-sm",u?"text-[#9CA3AF]":"text-gray-600"),children:l.empty.addFirstTask})]})}):jsxRuntime.jsxs("div",{className:S("flex-1 flex flex-col w-full h-full overflow-hidden",u?"bg-[#0F1117]":"bg-white",s),style:d,children:[jsxRuntime.jsx("div",{className:S("flex-shrink-0 px-6 py-4 border-b",u?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[m&&jsxRuntime.jsxs("div",{className:"relative flex-1 max-w-md",children:[jsxRuntime.jsx(lucideReact.Search,{className:S("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",u?"text-[#9CA3AF]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:T,onChange:C=>D(C.target.value),placeholder:l.toolbar.searchPlaceholder,className:S("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",u?"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:S("text-sm",u?"text-[#9CA3AF]":"text-gray-600"),children:[w.length," ",l.pagination.tasks]})]})}),jsxRuntime.jsxs("div",{className:S("flex-shrink-0 grid grid-cols-12 gap-4 px-6 py-3 border-b text-xs font-medium uppercase tracking-wider",u?"border-white/10 bg-white/5 text-[#9CA3AF]":"border-gray-200 bg-gray-50 text-gray-500"),children:[jsxRuntime.jsx("div",{className:"col-span-5 flex items-center gap-2",children:jsxRuntime.jsxs("button",{onClick:()=>x("name"),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[l.columns.name,jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3"})]})}),jsxRuntime.jsx("div",{className:"col-span-2 flex items-center gap-1",children:jsxRuntime.jsxs("button",{onClick:()=>x("status"),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[l.columns.status,jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3"})]})}),jsxRuntime.jsx("div",{className:"col-span-2 flex items-center gap-1",children:jsxRuntime.jsxs("button",{onClick:()=>x("startDate"),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[l.columns.startDate,jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3"})]})}),jsxRuntime.jsx("div",{className:"col-span-2 flex items-center gap-1",children:jsxRuntime.jsxs("button",{onClick:()=>x("endDate"),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[l.columns.endDate,jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3"})]})}),jsxRuntime.jsx("div",{className:"col-span-1 flex items-center gap-1",children:jsxRuntime.jsxs("button",{onClick:()=>x("progress"),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:["%",jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3"})]})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-auto",children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{children:w.map((C,B)=>{let z=y.has(C.id);return jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{delay:B*.02},className:S("grid grid-cols-12 gap-4 px-6 py-3 border-b transition-colors cursor-pointer",u?"border-white/5 hover:bg-white/5":"border-gray-100 hover:bg-gray-50"),style:{paddingLeft:i?`${24+C.level*24}px`:void 0},onClick:()=>a.onTaskClick?.(C),onDoubleClick:()=>a.onTaskDoubleClick?.(C),children:[jsxRuntime.jsxs("div",{className:"col-span-5 flex items-center gap-2 min-w-0",children:[i&&C.hasChildren&&jsxRuntime.jsx("button",{onClick:R=>{R.stopPropagation(),h(C.id);},className:S("p-0.5 rounded",u?"hover:bg-white/10":"hover:bg-gray-200"),children:z?jsxRuntime.jsx(lucideReact.ChevronDown,{className:S("w-4 h-4",u?"text-[#9CA3AF]":"text-gray-400")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:S("w-4 h-4",u?"text-[#9CA3AF]":"text-gray-400")})}),i&&!C.hasChildren&&jsxRuntime.jsx("div",{className:"w-5"}),jsxRuntime.jsx("button",{onClick:R=>{R.stopPropagation(),a.onTaskUpdate?.({...C,progress:C.progress===100?0:100,status:C.progress===100?"todo":"completed"});},className:"flex-shrink-0",children:jsxRuntime.jsx(nf,{status:C.status,progress:C.progress})}),jsxRuntime.jsx("span",{className:S("truncate",u?"text-white":"text-gray-900",C.progress===100&&(u?"line-through text-[#6B7280]":"line-through text-gray-400")),children:C.name})]}),jsxRuntime.jsx("div",{className:"col-span-2 flex items-center",children:jsxRuntime.jsx("span",{className:S("px-2 py-1 rounded-full text-xs font-medium",C.progress===100||C.status==="completed"?"bg-green-500/10 text-green-500":C.progress&&C.progress>0||C.status==="in-progress"?"bg-blue-500/10 text-blue-500":u?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:C.progress===100||C.status==="completed"?l.status.completed:C.progress&&C.progress>0||C.status==="in-progress"?l.status.inProgress:l.status.todo})}),jsxRuntime.jsxs("div",{className:S("col-span-2 flex items-center gap-1 text-sm",u?"text-[#9CA3AF]":"text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),M(C.startDate)]}),jsxRuntime.jsxs("div",{className:S("col-span-2 flex items-center gap-1 text-sm",u?"text-[#9CA3AF]":"text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),M(C.endDate)]}),jsxRuntime.jsx("div",{className:"col-span-1 flex items-center",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{className:S("flex-1 h-1.5 rounded-full overflow-hidden",u?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:S("h-full rounded-full transition-all",C.progress===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${C.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:S("text-xs w-8",u?"text-[#9CA3AF]":"text-gray-500"),children:[C.progress||0,"%"]})]})})]},C.id)})}),w.length===0&&T&&jsxRuntime.jsx("div",{className:"flex items-center justify-center py-12",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(lucideReact.List,{className:S("w-12 h-12 mx-auto mb-4",u?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:S(u?"text-[#9CA3AF]":"text-gray-600"),children:l.empty.noResults})]})})]})]})}var vs={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"},ys={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"},xs={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"},Uo={dark:vs,light:ys,neutral:xs};function md(e){return Uo[e]||Uo.dark}var ks={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"}},ws={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"}},Wo={en:ks,es:ws};function jr(e){return Wo[e]||Wo.en}function Go(e,t){let a=jr(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 ud(e){let t=jr(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 gd(e,t=0,a=true){let r=jr(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 yf(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 Cs(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 vd({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 yd({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:o=false,error:s,className:d,style:c}){let{theme:p="dark",locale:n="en",customTranslations:m}=t,i=Go(n,m),l=p==="dark",[u,y]=react.useState(r||new Date),[g,v]=react.useState(null),[k,b]=react.useState(null),[f,T]=react.useState(null),[D,h]=react.useState(new Date),[x,w]=react.useState({}),M=4,C=3,[B,z]=react.useState(false),[R,$]=react.useState(false),[K,le]=react.useState(false),be=react.useCallback(()=>{y(new Date(u.getFullYear(),u.getMonth()-1,1));},[u]),Ge=react.useCallback(()=>{y(new Date(u.getFullYear(),u.getMonth()+1,1));},[u]),Le=react.useCallback(()=>{y(new Date);},[]),xe=react.useMemo(()=>{let F=u.getFullYear(),oe=u.getMonth(),q=new Date(F,oe,1),Fe=new Date(F,oe+1,0),Re=q.getDay(),tt=Fe.getDate(),Oe=yf(e),dt=new Date;dt.setHours(0,0,0,0);let pe=[],vt=Re,rt=new Date(F,oe,0).getDate();for(let ze=vt-1;ze>=0;ze--){let Pe=new Date(F,oe-1,rt-ze);pe.push({date:Pe,isCurrentMonth:false,isToday:false,isWeekend:Pe.getDay()===0||Pe.getDay()===6,events:Oe.filter(Ue=>Cs(Pe,Ue)).map(Ue=>({id:Ue.id,title:Ue.name,start:Ue.startDate,end:Ue.endDate,task:Ue}))});}for(let ze=1;ze<=tt;ze++){let Pe=new Date(F,oe,ze),Ue=Pe.getTime()===dt.getTime();pe.push({date:Pe,isCurrentMonth:true,isToday:Ue,isWeekend:Pe.getDay()===0||Pe.getDay()===6,events:Oe.filter(ct=>Cs(Pe,ct)).map(ct=>({id:ct.id,title:ct.name,start:ct.startDate,end:ct.endDate,task:ct}))});}let Ot=42-pe.length;for(let ze=1;ze<=Ot;ze++){let Pe=new Date(F,oe+1,ze);pe.push({date:Pe,isCurrentMonth:false,isToday:false,isWeekend:Pe.getDay()===0||Pe.getDay()===6,events:Oe.filter(Ue=>Cs(Pe,Ue)).map(Ue=>({id:Ue.id,title:Ue.name,start:Ue.startDate,end:Ue.endDate,task:Ue}))});}return pe},[u,e]),E=n==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],I=u.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"long",year:"numeric"}),P=react.useCallback(F=>{let oe=F.progress===100?0:100,q=oe===100?"completed":"todo";a.onTaskUpdate?.({...F,status:q,progress:oe});},[a]),_=react.useCallback((F,oe)=>{if(!g)return;let q={...g,[F]:oe};v(q),a.onTaskUpdate?.(q);},[g,a]),Y=react.useCallback(F=>{if(!g)return;let oe=g.progress||0;F==="completed"?oe=100:F==="todo"&&(oe=0);let q={...g,status:F,progress:oe};v(q),a.onTaskUpdate?.(q),z(false);},[g,a]),j=react.useCallback((F,oe)=>{if(!g)return;let q={...g,startDate:F,endDate:oe};v(q),a.onTaskUpdate?.(q);},[g,a]),ye=react.useCallback(()=>{z(false),$(false),T(null);},[]);return o?jsxRuntime.jsx("div",{className:S("flex-1 flex items-center justify-center",l?"bg-[#0F1117]":"bg-white",d),style:c,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:S("text-sm",l?"text-[#9CA3AF]":"text-gray-600"),children:[i.labels.noEvents,"..."]})]})}):s?jsxRuntime.jsx("div",{className:S("flex-1 flex items-center justify-center",l?"bg-[#0F1117]":"bg-white",d),style:c,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:S("text-lg font-semibold mb-2",l?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:S("text-sm",l?"text-[#9CA3AF]":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:S("flex-1 flex items-center justify-center",l?"bg-[#0F1117]":"bg-white",d),style:c,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:S("text-lg font-semibold mb-2",l?"text-white":"text-gray-900"),children:i.labels.noEvents}),jsxRuntime.jsx("p",{className:S("text-sm",l?"text-[#9CA3AF]":"text-gray-600"),children:i.labels.newTask})]})}):jsxRuntime.jsxs("div",{className:S("flex-1 flex flex-col w-full h-full overflow-hidden",l?"bg-[#0F1117]":"bg-white",d),style:c,children:[jsxRuntime.jsx("div",{className:S("flex-shrink-0 px-6 py-4 border-b",l?"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:S("text-xl font-semibold capitalize",l?"text-white":"text-gray-900"),children:I}),jsxRuntime.jsx("button",{onClick:Le,className:S("px-3 py-1.5 text-sm rounded-lg transition-colors",l?"bg-white/5 text-white hover:bg-white/10":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:i.navigation.today})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("button",{onClick:be,className:S("p-2 rounded-lg transition-colors",l?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:S("w-5 h-5",l?"text-[#9CA3AF]":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:Ge,className:S("p-2 rounded-lg transition-colors",l?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:S("w-5 h-5",l?"text-[#9CA3AF]":"text-gray-600")})})]})]})}),jsxRuntime.jsx("div",{className:"flex-1 p-6 overflow-auto",children:jsxRuntime.jsxs("div",{className:"h-full flex flex-col",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-px mb-2",children:E.map(F=>jsxRuntime.jsx("div",{className:S("py-2 text-center text-xs font-medium uppercase",l?"text-[#9CA3AF]":"text-gray-500"),children:F},F))}),jsxRuntime.jsx("div",{className:S("grid grid-cols-7 auto-rows-min gap-px rounded-lg overflow-hidden",l?"bg-white/5":"bg-gray-200"),children:xe.map((F,oe)=>{let q=F.date.getDay()===0||F.date.getDay()===6;return jsxRuntime.jsxs("div",{className:S("min-h-[120px] p-2 transition-colors flex flex-col relative",l?q?"bg-[#1A1D21]":F.isCurrentMonth?"bg-[#0F1117]":"bg-[#0A0C10]":q?"bg-gray-100":F.isCurrentMonth?"bg-white":"bg-gray-50",F.isToday&&"ring-2 ring-[#3B82F6] ring-inset"),children:[(()=>{let Fe=x[oe]||M,Re=F.events.slice(0,Fe),tt=F.events.length-Fe;return jsxRuntime.jsxs("div",{className:"space-y-1 flex-1",children:[Re.map(Oe=>jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{v(Oe.task),a.onEventClick?.(Oe);},whileHover:{scale:1.02},className:S("w-full flex items-center gap-1 px-1.5 py-0.5 rounded text-xs truncate",Oe.task.progress===100?l?"bg-green-500/20 text-green-400":"bg-green-500/10 text-green-600":l?"bg-[#3B82F6]/20 text-[#3B82F6]":"bg-[#3B82F6]/10 text-[#3B82F6]"),children:[jsxRuntime.jsx(vd,{task:Oe.task}),jsxRuntime.jsx("span",{className:"truncate",children:Oe.title})]}),jsxRuntime.jsx("div",{className:S("absolute left-0 bottom-full mb-1 px-2 py-1 rounded text-xs whitespace-nowrap z-50 opacity-0 group-hover:opacity-100 pointer-events-none transition-opacity shadow-lg",l?"bg-[#1A1D25] text-white border border-white/10":"bg-gray-900 text-white"),children:Oe.title})]},Oe.id)),tt>0&&jsxRuntime.jsxs("button",{onClick:Oe=>{Oe.stopPropagation(),w(dt=>({...dt,[oe]:Fe+C}));},className:S("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",l?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:["+",tt," ",n==="es"?"M\xC1S":"MORE"]}),Fe>M&&F.events.length>M&&jsxRuntime.jsx("button",{onClick:Oe=>{Oe.stopPropagation(),w(dt=>({...dt,[oe]:M}));},className:S("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",l?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:n==="es"?"MENOS":"LESS"})]})})(),jsxRuntime.jsx("div",{className:S("text-sm font-medium mt-1 text-right",F.isToday?"text-[#3B82F6]":F.isCurrentMonth?l?"text-white":"text-gray-900":l?"text-[#6B7280]":"text-gray-400"),children:F.date.getDate()})]},oe)})})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:g&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>v(null),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:S("fixed inset-4 md:inset-8 lg:inset-12 rounded-xl shadow-2xl z-50 flex overflow-hidden",l?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxRuntime.jsxs("div",{className:S("px-6 py-4 border-b flex items-center gap-3",l?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:S("text-xs px-2 py-0.5 rounded",l?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:n==="es"?"Tarea":"Task"}),jsxRuntime.jsx("span",{className:S("text-xs",l?"text-[#6B7280]":"text-gray-400"),children:g.id.slice(0,8)})]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:S("p-1.5 rounded hover:bg-white/10",l?"text-[#9CA3AF]":"text-gray-500"),children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{onClick:()=>v(null),className:S("p-1.5 rounded hover:bg-white/10",l?"text-[#9CA3AF]":"text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsx("h2",{className:S("text-xl font-semibold",l?"text-white":"text-gray-900"),children:g.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:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Estado":"Status"}),jsxRuntime.jsx("button",{onClick:()=>{ye(),z(!B);},className:S("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",g.progress===100||g.status==="completed"?"bg-green-500/20 text-green-400":g.progress&&g.progress>0||g.status==="in-progress"?"bg-blue-500/20 text-blue-400":l?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:g.progress===100||g.status==="completed"?n==="es"?"COMPLETADO":"DONE":g.progress&&g.progress>0||g.status==="in-progress"?n==="es"?"EN PROGRESO":"IN PROGRESS":n==="es"?"POR HACER":"TO DO"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:B&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:S("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",l?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"todo",label:n==="es"?"Por hacer":"To Do",color:"bg-white/10 text-white"},{id:"in-progress",label:n==="es"?"En progreso":"In Progress",color:"bg-blue-500/20 text-blue-400"},{id:"completed",label:n==="es"?"Completado":"Done",color:"bg-green-500/20 text-green-400"}].map(F=>jsxRuntime.jsxs("button",{onClick:()=>Y(F.id),className:S("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",l?"hover:bg-white/5":"hover:bg-gray-50",(g.status===F.id||F.id==="completed"&&g.progress===100||F.id==="in-progress"&&g.progress&&g.progress>0&&g.progress<100||F.id==="todo"&&(!g.progress||g.progress===0)&&g.status!=="in-progress"&&g.status!=="completed")&&(l?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:S("w-2 h-2 rounded-full",F.id==="completed"?"bg-green-500":F.id==="in-progress"?"bg-blue-500":"bg-gray-400")}),jsxRuntime.jsx("span",{className:l?"text-white":"text-gray-900",children:F.label})]},F.id))})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.User,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Asignados":"Assignees"}),g.assignees&&g.assignees.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[g.assignees.slice(0,3).map((F,oe)=>jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:F.color||"#8B5CF6"},title:F.name,children:F.initials||F.name.slice(0,2).toUpperCase()},oe)),g.assignees.length>3&&jsxRuntime.jsxs("span",{className:S("text-xs",l?"text-[#6B7280]":"text-gray-400"),children:["+",g.assignees.length-3]})]}):jsxRuntime.jsx("span",{className:S("text-sm",l?"text-[#6B7280]":"text-gray-400"),children:n==="es"?"Sin asignar":"Unassigned"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Fechas":"Dates"}),jsxRuntime.jsxs("button",{onClick:()=>{T(f?null:"start"),h(g.startDate||new Date);},className:S("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",l?"bg-white/5 hover:bg-white/10 text-white":"bg-gray-100 hover:bg-gray-200 text-gray-900"),children:[g.startDate?.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(n==="es"?"Inicio":"Start"),jsxRuntime.jsx("span",{className:S("mx-1",l?"text-[#6B7280]":"text-gray-400"),children:"\u2192"}),g.endDate?.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(n==="es"?"Fin":"End"),(g.startDate||g.endDate)&&jsxRuntime.jsx(lucideReact.X,{className:"w-3.5 h-3.5 ml-1 opacity-50 hover:opacity-100",onClick:F=>{F.stopPropagation();}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>T(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:S("absolute left-0 top-full mt-2 z-50 rounded-xl shadow-2xl overflow-hidden flex",l?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:F=>F.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:S("w-44 py-2 border-r",l?"border-white/10":"border-gray-200"),children:[(()=>{let F=new Date,oe=new Date(F);oe.setDate(F.getDate()+1);let q=new Date(F);q.setDate(F.getDate()+((6-F.getDay()+7)%7||7));let Fe=new Date(F);Fe.setDate(F.getDate()+((1-F.getDay()+7)%7||7));let Re=new Date(F);Re.setDate(F.getDate()+(6-F.getDay()+7)%7+7);let tt=new Date(F);tt.setDate(F.getDate()+14);let Oe=new Date(F);return Oe.setDate(F.getDate()+28),[{label:n==="es"?"Hoy":"Today",date:F,display:F.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Ma\xF1ana":"Tomorrow",date:oe,display:oe.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Este fin de semana":"This weekend",date:q,display:n==="es"?"s\xE1b.":"sat."},{label:n==="es"?"Pr\xF3xima semana":"Next week",date:Fe,display:n==="es"?"lun.":"mon."},{label:n==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:Re,display:Re.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"2 semanas":"2 weeks",date:tt,display:tt.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"4 semanas":"4 weeks",date:Oe,display:Oe.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((pe,vt)=>jsxRuntime.jsxs("button",{className:S("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",l?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{if(f==="start"){let rt=g.endDate&&pe.date>g.endDate?pe.date:g.endDate;j(pe.date,rt),T("end");}else {let rt=g.startDate&&pe.date<g.startDate?pe.date:g.startDate;j(rt,pe.date),T(null);}},children:[jsxRuntime.jsx("span",{children:pe.label}),jsxRuntime.jsx("span",{className:S("text-xs",l?"text-[#6B7280]":"text-gray-400"),children:pe.display})]},vt))})(),jsxRuntime.jsx("div",{className:S("border-t mt-2 pt-2",l?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{j(void 0,void 0),T(null);},className:S("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",l?"hover:bg-white/5 text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:n==="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:S("text-xs mb-3 px-2 py-1 rounded",l?"bg-white/5 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:f==="start"?n==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":n==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:S("font-medium",l?"text-white":"text-gray-900"),children:D.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>h(new Date),className:S("p-1 rounded text-sm transition-colors",l?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:n==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>h(new Date(D.getFullYear(),D.getMonth()-1)),className:S("p-1 rounded",l?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{onClick:()=>h(new Date(D.getFullYear(),D.getMonth()+1)),className:S("p-1 rounded",l?"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:(n==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(F=>jsxRuntime.jsx("div",{className:S("w-8 h-8 flex items-center justify-center text-xs",l?"text-[#6B7280]":"text-gray-400"),children:F},F))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:(()=>{let F=D.getFullYear(),oe=D.getMonth(),q=new Date(F,oe,1).getDay(),Fe=new Date(F,oe+1,0).getDate(),Re=new Date(F,oe,0).getDate(),tt=new Date,Oe=[];for(let pe=q-1;pe>=0;pe--)Oe.push({day:Re-pe,isCurrentMonth:false,date:new Date(F,oe-1,Re-pe)});for(let pe=1;pe<=Fe;pe++)Oe.push({day:pe,isCurrentMonth:true,date:new Date(F,oe,pe)});let dt=42-Oe.length;for(let pe=1;pe<=dt;pe++)Oe.push({day:pe,isCurrentMonth:false,date:new Date(F,oe+1,pe)});return Oe.map((pe,vt)=>{let rt=pe.date.toDateString()===tt.toDateString(),Ot=g.startDate?.toDateString()===pe.date.toDateString(),ze=g.endDate?.toDateString()===pe.date.toDateString(),Pe=Ot||ze,Ue=g.startDate&&g.endDate&&pe.date>=g.startDate&&pe.date<=g.endDate;return jsxRuntime.jsx("button",{className:S("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!pe.isCurrentMonth&&(l?"text-[#4B5563]":"text-gray-300"),pe.isCurrentMonth&&(l?"text-white":"text-gray-900"),rt&&"ring-2 ring-[#3B82F6]",Ot&&"bg-[#3B82F6] text-white",ze&&!Ot&&"bg-[#7C3AED] text-white",Ue&&!Pe&&(l?"bg-[#7C3AED]/20":"bg-purple-100"),!Pe&&(l?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{let ct=new Date(pe.date);if(f==="start"){let de=g.endDate&&ct>g.endDate?ct:g.endDate;j(ct,de),T("end");}else {let de=g.startDate&&ct<g.startDate?ct:g.startDate;j(de,ct),T(null);}},children:pe.day},vt)})})()})]})]})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Flag,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Prioridad":"Priority"}),jsxRuntime.jsx("button",{onClick:()=>{ye(),$(!R);},className:S("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",g.priority==="high"||g.priority==="urgent"?"bg-red-500/20 text-red-400":g.priority==="medium"?"bg-yellow-500/20 text-yellow-400":g.priority==="low"?"bg-green-500/20 text-green-400":l?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:g.priority?g.priority==="high"||g.priority==="urgent"?n==="es"?"Urgente":"Urgent":g.priority==="medium"?n==="es"?"Media":"Medium":n==="es"?"Baja":"Low":n==="es"?"Sin prioridad":"No priority"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:R&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:S("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",l?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"urgent",label:n==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:n==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:n==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:n==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:n==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(F=>jsxRuntime.jsxs("button",{onClick:()=>{_("priority",F.id),$(false);},className:S("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",l?"hover:bg-white/5":"hover:bg-gray-50",g.priority===F.id&&(l?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:S("w-2 h-2 rounded-full",F.color)}),jsxRuntime.jsx("span",{className:l?"text-white":"text-gray-900",children:F.label})]},F.id||"none"))})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Clock,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Duraci\xF3n":"Duration"}),jsxRuntime.jsx("span",{className:S("text-sm",l?"text-white":"text-gray-900"),children:g.startDate&&g.endDate?`${Math.ceil((g.endDate.getTime()-g.startDate.getTime())/(1e3*60*60*24))} ${n==="es"?"d\xEDas":"days"}`:n==="es"?"Sin definir":"Not set"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:S("w-4 h-4 rounded-full border-2",l?"border-[#6B7280]":"border-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Progreso":"Progress"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[K?jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:g.progress||0,onChange:F=>{let oe=parseInt(F.target.value),q=g.status;oe===100?q="completed":oe>0?q="in-progress":q="todo";let Fe={...g,progress:oe,status:q};v(Fe),a.onTaskUpdate?.(Fe);},onBlur:()=>le(false),className:S("flex-1 max-w-[120px] h-2 rounded-full appearance-none cursor-pointer",l?"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:()=>le(true),className:S("flex-1 h-2 rounded-full overflow-hidden max-w-[120px] cursor-pointer hover:ring-2 hover:ring-white/20 transition-all",l?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:S("h-full rounded-full transition-all",g.progress===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${g.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:S("text-sm font-medium min-w-[40px]",l?"text-white":"text-gray-900"),children:[g.progress||0,"%"]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Tag,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Etiquetas":"Tags"}),jsxRuntime.jsx("span",{className:S("text-sm",l?"text-[#6B7280]":"text-gray-400"),children:n==="es"?"Vac\xEDo":"Empty"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Link2,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm w-24",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Relaciones":"Relations"}),jsxRuntime.jsx("span",{className:S("text-sm",l?"text-[#6B7280]":"text-gray-400"),children:g.dependencies&&g.dependencies.length>0?`${g.dependencies.length} ${n==="es"?"dependencias":"dependencies"}`:n==="es"?"Vac\xEDo":"Empty"})]})]}),jsxRuntime.jsxs("div",{className:S("mt-6 pt-4 border-t",l?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[jsxRuntime.jsx(lucideReact.FileText,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:S("text-sm font-medium",l?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Descripci\xF3n":"Description"})]}),jsxRuntime.jsx("div",{className:S("min-h-[60px] p-3 rounded-lg text-sm",l?"bg-white/5 text-[#9CA3AF]":"bg-gray-50 text-gray-600"),children:g.description||(n==="es"?"Sin descripci\xF3n":"No description")})]}),g.subtasks&&g.subtasks.length>0&&jsxRuntime.jsxs("div",{className:S("mt-4 pt-4 border-t",l?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[jsxRuntime.jsx(lucideReact.CheckCircle2,{className:S("w-4 h-4",l?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsxs("span",{className:S("text-sm font-medium",l?"text-[#9CA3AF]":"text-gray-500"),children:[n==="es"?"Subtareas":"Subtasks"," (",g.subtasks.length,")"]})]}),jsxRuntime.jsx("div",{className:"space-y-2",children:g.subtasks.slice(0,5).map(F=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:S("w-4 h-4 rounded border flex items-center justify-center",F.progress===100?"bg-green-500 border-green-500":l?"border-white/20":"border-gray-300"),children:F.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:S("text-sm",F.progress===100?"line-through text-[#6B7280]":l?"text-white":"text-gray-900"),children:F.name})]},F.id))})]})]}),jsxRuntime.jsx("div",{className:S("px-6 py-4 border-t flex items-center gap-3",l?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("button",{onClick:()=>{P(g),v(null);},className:S("px-4 py-2 rounded-lg font-medium transition-colors",g.progress===100?"bg-gray-500/10 text-gray-500 hover:bg-gray-500/20":"bg-green-500/10 text-green-500 hover:bg-green-500/20"),children:g.progress===100?n==="es"?"Reabrir tarea":"Reopen task":n==="es"?"Completar tarea":"Complete task"})})]}),jsxRuntime.jsxs("div",{className:S("w-[280px] border-l flex flex-col",l?"border-white/10 bg-[#141619]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsx("div",{className:S("px-4 py-3 border-b flex items-center justify-between",l?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("span",{className:S("font-medium",l?"text-white":"text-gray-900"),children:n==="es"?"Actividad":"Activity"})}),jsxRuntime.jsx("div",{className:"flex-1 p-4 overflow-y-auto",children:jsxRuntime.jsxs("div",{className:S("text-sm text-center py-8",l?"text-[#6B7280]":"text-gray-400"),children:[jsxRuntime.jsx(lucideReact.MessageSquare,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),n==="es"?"Sin actividad reciente":"No recent activity"]})}),jsxRuntime.jsx("div",{className:S("p-3 border-t",l?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("div",{className:S("flex items-center gap-2 px-3 py-2 rounded-lg",l?"bg-white/5":"bg-white border border-gray-200"),children:jsxRuntime.jsx("input",{type:"text",placeholder:n==="es"?"Escribe un comentario...":"Write a comment...",className:S("flex-1 bg-transparent text-sm outline-none",l?"text-white placeholder-[#6B7280]":"text-gray-900 placeholder-gray-400")})})})]})]})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:k&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>b(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:S("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",l?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:S("px-4 py-3 border-b flex items-center justify-between",l?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("span",{className:S("font-medium",l?"text-white":"text-gray-900"),children:k.date.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>b(null),className:S("p-1 rounded",l?"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:k.events.map(F=>jsxRuntime.jsxs("button",{onClick:()=>{b(null),v(F.task);},className:S("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",l?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx(vd,{task:F.task}),jsxRuntime.jsx("span",{className:S("text-sm truncate flex-1",l?"text-white":"text-gray-900"),children:F.title}),F.task.priority==="high"||F.task.priority==="urgent"?jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5 text-red-400"}):null]},F.id))})]})]})})]})}var Ds={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"},Ns={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"},Ss={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"},Vo={dark:Ds,light:Ns,neutral:Ss};function xd(e){return Vo[e]||Vo.dark}function kf({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:o,onUnstack:s,onDeleteStack:d,className:c}){let[p,n]=react.useState(false),m=react.useMemo(()=>t.filter(u=>e.cardIds.includes(u.id)),[t,e.cardIds]),i=react.useMemo(()=>{let u=m.length,y=new Set(m.flatMap(k=>k.assignedUserIds||[])).size,g=m.map(k=>k.priority).filter(Boolean),v=new Set(m.flatMap(k=>k.labels||[])).size;return {totalCards:u,uniqueAssignees:y,priorities:g,labels:v}},[m]),l=()=>{o?.(e.id);};return jsxRuntime.jsxs("div",{className:S("card-stack",!e.isExpanded&&"card-stack-collapsed",c),onMouseEnter:()=>n(true),onMouseLeave:()=>n(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:l,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:S("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:i.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"]})]}),p&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:u=>{u.stopPropagation(),d?.(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:[i.uniqueAssignees," assignees"]})]}),i.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:[i.labels," labels"]})]}),e.confidence&&jsxRuntime.jsx("div",{className:"card-stack-summary-item",children:jsxRuntime.jsxs("span",{className:"card-stack-confidence",children:[Math.round(e.confidence*100),"% match"]})})]}),e.isExpanded&&jsxRuntime.jsx("div",{className:"card-stack-content",children:m.length===0?jsxRuntime.jsxs("div",{className:"card-stack-empty",children:[jsxRuntime.jsx("p",{children:"No cards in this stack"}),jsxRuntime.jsx("span",{children:"Drag cards here or delete this stack"})]}):jsxRuntime.jsx("div",{className:"card-stack-cards",children:m.map(u=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsxRuntime.jsx("div",{onClick:()=>r?.(u),children:a(u)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(u),children:[jsxRuntime.jsx("h4",{children:u.title}),u.description&&jsxRuntime.jsxs("p",{children:[u.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:y=>{y.stopPropagation(),s?.(e.id,u.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"})]})})]},u.id))})})]})}var wd={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function Yr(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 qr(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 Cd(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 Td({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:o,selectedEventId:s,config:d,className:c}){let p=react.useMemo(()=>({...wd,...d}),[d]),[n,m]=react.useState(new Set),i=react.useRef(null),l=react.useMemo(()=>{if(!p.groupByDay)return [{date:null,events:e}];let b=new Map;return e.forEach(f=>{let T=f.timestamp.toISOString().split("T")[0],D=b.get(T);D?D.push(f):b.set(T,[f]);}),Array.from(b.entries()).sort((f,T)=>T[0].localeCompare(f[0])).map(([f,T])=>({date:new Date(f),events:T.sort((D,h)=>h.timestamp.getTime()-D.timestamp.getTime())}))},[e,p.groupByDay]),{uniqueUsers:u,uniqueTypes:y}=react.useMemo(()=>{let b=new Set,f=new Set;return e.forEach(T=>{b.add(T.userId),f.add(T.type);}),{uniqueUsers:Array.from(b),uniqueTypes:Array.from(f)}},[e]),g=b=>{m(f=>{let T=new Set(f);return T.has(b)?T.delete(b):T.add(b),T});},v=b=>{let T=new Date().getTime()-b.getTime(),D=Math.floor(T/6e4),h=Math.floor(T/36e5),x=Math.floor(T/864e5);return D<1?"just now":D<60?`${D}m ago`:h<24?`${h}h ago`:x<7?`${x}d ago`:b.toLocaleDateString()},k=react.useMemo(()=>{let b=0;return t.types&&t.types.length>0&&b++,t.users&&t.users.length>0&&b++,t.dateRange&&b++,t.searchTerm&&b++,b},[t]);return react.useEffect(()=>{if(s&&i.current){let b=i.current.querySelector(`[data-event-id="${s}"]`);b&&b.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxRuntime.jsxs("div",{className:S("history-timeline-empty",c),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:S("history-timeline",p.compact&&"compact",c),children:[jsxRuntime.jsxs("div",{className:"history-timeline-filters",children:[jsxRuntime.jsxs("div",{className:"history-timeline-filter-group",children:[jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.types?.[0]||"",onChange:b=>{let f=b.target.value;a({...t,types:f?[f]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),y.map(b=>jsxRuntime.jsxs("option",{value:b,children:[qr(b)," ",b.replace("_"," ")]},b))]}),u.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:b=>{let f=b.target.value;a({...t,users:f?[f]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),u.map(b=>jsxRuntime.jsx("option",{value:b,children:b},b))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:b=>a({...t,searchTerm:b.target.value})})]}),k>0&&jsxRuntime.jsxs("button",{className:"history-timeline-filter-clear",onClick:r,children:["Clear filters (",k,")"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-container",ref:i,children:l.map(b=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[p.groupByDay&&b.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:b.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[b.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:b.events.map((f,T)=>{let D=n.has(f.id),h=s===f.id,x=Cd(f.type);return jsxRuntime.jsxs("div",{"data-event-id":f.id,className:S("history-timeline-event",D&&"expanded",h&&"selected"),onClick:()=>o?.(f),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:x},children:p.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:qr(f.type)})}),T<b.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:x}})]}),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:[p.showAvatars&&f.userAvatar&&jsxRuntime.jsx("img",{src:f.userAvatar,alt:f.userName||f.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:f.userName||f.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:Yr(f)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:p.useRelativeTime?v(f.timestamp):f.timestamp.toLocaleString()})]}),Object.keys(f.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:w=>{w.stopPropagation(),g(f.id);},children:[D?"\u25BC":"\u25B6"," Show changes"]}),D&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(f.changes).map(([w,M])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[w,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(M.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(M.to)})]})]},w)),f.metadata&&Object.keys(f.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(f.metadata).map(([w,M])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[w,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(M)})]},w))]})]})]})]},f.id)})})]},b.date?.toISOString()||"all"))})]})}function Nd({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:o,onPrevious:s,onNext:d,onGoToEvent:c,onSpeedChange:p,className:n}){let m=[.5,1,1.5,2,3],i=react.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),l=react.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:S("history-replay-empty",n),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:S("history-replay",n),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:i&&qr(i.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:i&&Yr(i)}),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:i&&i.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:u=>c(parseInt(u.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${l}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((u,y)=>jsxRuntime.jsx("div",{className:S("history-replay-progress-marker",y===e.currentIndex&&"active"),style:{left:`${y/(e.totalEvents-1)*100}%`},onClick:()=>c(y),title:Yr(u)},u.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:d,disabled:!e.canGoForward,title:"Next event (\u2192)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"5 4 15 12 5 20 5 4"}),jsxRuntime.jsx("line",{x1:"19",y1:"5",x2:"19",y2:"19"})]})}),jsxRuntime.jsxs("div",{className:"history-replay-speed",children:[jsxRuntime.jsx("label",{className:"history-replay-speed-label",children:"Speed:"}),jsxRuntime.jsx("div",{className:"history-replay-speed-buttons",children:m.map(u=>jsxRuntime.jsxs("button",{className:S("history-replay-speed-btn",e.speed===u&&"active"),onClick:()=>p(u),children:[u,"x"]},u))})]}),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:i&&i.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(u=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:u},u))})]})]})]})]}):jsxRuntime.jsxs("div",{className:S("history-replay-start",n),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 Es(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 Ps(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 Sd(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 Ed(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function Sf(e,t,a,r,o,s=100){let d=e.map(p=>({...p,x:p.x??a/2+Math.random()*100-50,y:p.y??r/2+Math.random()*100-50,vx:0,vy:0})),c=new Map(d.map(p=>[p.id,p]));for(let p=0;p<s;p++){let n=1-p/s;d.forEach(m=>{let i=a/2,l=r/2;m.vx+=(i-m.x)*o.centerForce*n,m.vy+=(l-m.y)*o.centerForce*n,d.forEach(u=>{if(m.id===u.id)return;let y=m.x-u.x,g=m.y-u.y,v=Math.sqrt(y*y+g*g)||1,k=o.chargeStrength*n/(v*v);m.vx+=y/v*k,m.vy+=g/v*k;});}),t.forEach(m=>{let i=c.get(typeof m.source=="string"?m.source:m.source.id),l=c.get(typeof m.target=="string"?m.target:m.target.id);if(!i||!l)return;let u=l.x-i.x,y=l.y-i.y,g=Math.sqrt(u*u+y*y)||1,v=(g-o.linkDistance)/g*o.forceStrength*n;i.vx+=u*v,i.vy+=y*v,l.vx-=u*v,l.vy-=y*v;}),d.forEach(m=>{m.fx!==null&&m.fx!==void 0?(m.x=m.fx,m.vx=0):m.x+=m.vx,m.fy!==null&&m.fy!==void 0?(m.y=m.fy,m.vy=0):m.y+=m.vy,m.x=Math.max(o.nodeSize,Math.min(a-o.nodeSize,m.x)),m.y=Math.max(o.nodeSize,Math.min(r-o.nodeSize,m.y)),m.vx*=.9,m.vy*=.9;});}return d}function Pd({nodes:e,edges:t,config:a,filter:r,onFilterChange:o,criticalPath:s,stats:d,onInteraction:c,className:p}){let n=react.useRef(null),[m,i]=react.useState([]),[l,u]=react.useState(null),[y,g]=react.useState(null),[v,k]=react.useState(null),[b,f]=react.useState(1),[T,D]=react.useState({x:0,y:0});react.useEffect(()=>{if(e.length===0)return;let R=Sf(e,t,a.width,a.height,a,150);i(R);},[e,t,a]);let h=react.useCallback((R,$)=>{a.enableDragging&&($.stopPropagation(),u(R));},[a.enableDragging]),x=react.useCallback(R=>{if(!l||!n.current)return;let K=n.current.getBoundingClientRect(),le=(R.clientX-K.left-T.x)/b,be=(R.clientY-K.top-T.y)/b;i(Ge=>Ge.map(Le=>Le.id===l?{...Le,x:le,y:be,fx:le,fy:be}:Le));},[l,b,T]),w=react.useCallback(()=>{u(null);},[]),M=react.useCallback((R,$)=>{$.stopPropagation(),c?.({type:"node-click",node:R,position:{x:$.clientX,y:$.clientY}});},[c]),C=react.useCallback((R,$)=>{$.stopPropagation(),c?.({type:"edge-click",edge:R,position:{x:$.clientX,y:$.clientY}});},[c]),B=react.useCallback(R=>{let $=m.find(K=>K.id===R);return $?{x:$.x,y:$.y}:{x:0,y:0}},[m]),z=react.useCallback(R=>{if(R.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return R.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let $=R.card.priority;return $==="URGENT"?"#ef4444":$==="HIGH"?"#f59e0b":$==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return R.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[a.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:S("relationships-graph-empty",p),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:S("relationships-graph",p),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:d.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:d.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:()=>f(R=>Math.min(R+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(b*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>f(R=>Math.max(R-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{f(1),D({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(R=>R.type))).map(R=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:Es(R)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[Sd(R)," ",Ps(R)]})]},R))}),jsxRuntime.jsxs("svg",{ref:n,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:x,onMouseUp:w,onMouseLeave:w,children:[jsxRuntime.jsxs("g",{transform:`translate(${T.x}, ${T.y}) scale(${b})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map(R=>{let $=B(typeof R.source=="string"?R.source:R.source.id),K=B(typeof R.target=="string"?R.target:R.target.id),le=Ed(R.type),be=v===R.id,Ge=R.onCriticalPath;return jsxRuntime.jsxs("g",{className:S("relationships-graph-edge",be&&"hovered",Ge&&"critical"),onMouseEnter:()=>k(R.id),onMouseLeave:()=>k(null),onClick:Le=>C(R,Le),children:[jsxRuntime.jsx("line",{x1:$.x,y1:$.y,x2:K.x,y2:K.y,stroke:Es(R.type),strokeWidth:Ge?a.edgeWidth*2:a.edgeWidth,strokeOpacity:be?1:.6,markerEnd:le?"url(#arrowhead)":void 0}),a.showEdgeLabels&&be&&jsxRuntime.jsx("text",{x:($.x+K.x)/2,y:($.y+K.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:Ps(R.type)})]},R.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:m.map(R=>{let $=y===R.id,K=R.onCriticalPath;return jsxRuntime.jsxs("g",{className:S("relationships-graph-node",$&&"hovered",K&&"critical"),transform:`translate(${R.x}, ${R.y})`,onMouseDown:le=>h(R.id,le),onMouseEnter:()=>g(R.id),onMouseLeave:()=>g(null),onClick:le=>M(R,le),children:[jsxRuntime.jsx("circle",{r:K?a.nodeSize*1.2:a.nodeSize,fill:z(R),stroke:K?"#fbbf24":"#ffffff",strokeWidth:K?3:2,opacity:$?1:.9}),a.showLabels&&jsxRuntime.jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:R.card.title.length>20?R.card.title.substring(0,20)+"...":R.card.title})]},R.id)})})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:jsxRuntime.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#6b7280"})})})]})]})}function Ad({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:o}){let[s,d]=react.useState(""),[c,p]=react.useState(false),[n,m]=react.useState(null),[i,l]=react.useState(null),u=react.useRef(null),y=c||o;react.useEffect(()=>{e&&u.current&&u.current.focus();},[e]),react.useEffect(()=>{let b=f=>{f.key==="Escape"&&!y&&g();};if(e)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,y]);let g=()=>{y||(d(""),m(null),l(null),t());},v=async()=>{if(!(!s.trim()||y)){p(true),m(null),l(null);try{let b=await r(s.trim());l(b);}catch(b){m(b instanceof Error?b.message:"Failed to generate plan");}finally{p(false);}}},k=()=>{i&&(a(i),g());};return e?jsxRuntime.jsxs(Ke,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:g}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-2xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:b=>b.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Generate Project Plan with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete Kanban board"})]}),jsxRuntime.jsx("button",{onClick:g,disabled:y,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:i?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!"})]}),i.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:i.explanation})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",i.columns.length,")"]}),jsxRuntime.jsx("div",{className:"flex gap-2 flex-wrap",children:i.columns.map((b,f)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:b.title},f))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",i.cards.length,")"]}),jsxRuntime.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[i.cards.slice(0,10).map((b,f)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:b.title}),b.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:b.description})]}),b.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${b.priority==="URGENT"?"bg-red-500/20 text-red-400":b.priority==="HIGH"?"bg-orange-500/20 text-orange-400":b.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:b.priority})]})},f)),i.cards.length>10&&jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",i.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:u,value:s,onChange:b=>d(b.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:y}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),n&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:n}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((b,f)=>jsxRuntime.jsx("button",{onClick:()=>d(b),disabled:y,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:b},f))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:y&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:g,disabled:y,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),i?jsxRuntime.jsx("button",{onClick:k,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Plan to Board"}):jsxRuntime.jsx("button",{onClick:v,disabled:!s.trim()||y,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:y?"Generating...":"Generate Plan"})]})]})]})})]}):null}var Ms={"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 Pf={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},Mf={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 If(e,t,a){let r=Ms[e];if(!r)throw new Error(`Unknown model: ${e}`);let o=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return o+s}function Xr(e){return `$${e.toFixed(4)}`}var Is=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=If(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(i=>i.timestamp>=t.start&&i.timestamp<=t.end));let r=a.length,o=a.reduce((i,l)=>i+l.cost,0),s=a.reduce((i,l)=>i+l.inputTokens,0),d=a.reduce((i,l)=>i+l.outputTokens,0),c=a.filter(i=>i.success),p=a.reduce((i,l)=>i+l.duration,0),n={},m={};return a.forEach(i=>{n[i.feature]=(n[i.feature]||0)+1,m[i.feature]=(m[i.feature]||0)+i.cost;}),{totalOperations:r,totalCost:o,totalInputTokens:s,totalOutputTokens:d,operationsByFeature:n,costsByFeature:m,averageDuration:r>0?p/r:0,successRate:r>0?c.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,d=new Date;a==="month"?d.setMonth(s.getMonth()-1):d.setDate(s.getDate()-1);let c=this.operations.filter(m=>m.timestamp>=d).length,p=Math.max(0,o-c),n=c/o*100;return {used:c,limit:o,remaining:p,percentUsed:n,isExceeded:c>=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)}},ar=new Is;function Bd({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,o]=react.useState(ar.getStats()),[s,d]=react.useState(ar.checkLimit(a));if(react.useEffect(()=>{if(!e)return;let p=setInterval(()=>{o(ar.getStats()),d(ar.checkLimit(a));},1e3);return ()=>clearInterval(p)},[e,a]),react.useEffect(()=>{let p=n=>{n.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e,t]),!e)return null;let c=ar.getRecentOperations(5);return jsxRuntime.jsxs(Ke,{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: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.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:Xr(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(([p,n])=>{let m=r.costsByFeature[p]||0,i=r.totalOperations>0?n/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:p.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:[n," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Xr(m)})]})]}),jsxRuntime.jsx("div",{className:"w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full bg-blue-500",style:{width:`${i}%`}})})]},p)})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),c.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:c.map(p=>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:p.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(p.timestamp).toLocaleTimeString()," \u2022"," ",p.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[p.inputTokens+p.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Xr(p.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${p.success?"bg-green-400":"bg-red-400"}`})]})]},p.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 $d({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:o,projectName:s}){let[d,c]=react.useState(""),[p,n]=react.useState(""),[m,i]=react.useState(""),[l,u]=react.useState(false),[y,g]=react.useState(null),[v,k]=react.useState(null),[b,f]=react.useState(null),T=react.useRef(null),D=l||o;react.useEffect(()=>{e&&T.current&&T.current.focus();},[e]),react.useEffect(()=>{let C=B=>{B.key==="Escape"&&!D&&h();};if(e)return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[e,D]);let h=()=>{D||(c(""),n(""),i(""),g(null),k(null),f(null),t());},x=async()=>{if(!(!d.trim()||D)){u(true),g(null),k(null),f(null);try{let C=await r({prompt:d.trim(),projectName:s||"Mi Proyecto",startDate:p||void 0,endDate:m||void 0});k(C.tasks.tasks),f({from_cache:C.from_cache,tokens_used:C.tokens_used,mock_mode:C.mock_mode,similarity:C.similarity,tokens_saved:C.tokens_saved});}catch(C){g(C instanceof Error?C.message:"Failed to generate tasks");}finally{u(false);}}},w=()=>{v&&(a(v),h());};if(!e)return null;let M=b?.similarity?((b.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(Ke,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:h}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:C=>C.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.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:h,disabled:D,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:v?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Tasks Generated Successfully!"})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[b?.mock_mode&&jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",children:"Mock Mode"}),b?.from_cache?jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-blue-500/20 text-blue-400 border border-blue-500/30",children:["From Cache (",M,"% similar)"]}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-green-500/20 text-green-400 border border-green-500/30",children:"AI Generated"}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-purple-500/20 text-purple-400 border border-purple-500/30",children:[b?.tokens_used||0," tokens"]}),b?.tokens_saved&&jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:[b.tokens_saved," tokens saved"]}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-pink-500/20 text-pink-400 border border-pink-500/30",children:[v.length," tasks"]})]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:v.map((C,B)=>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:["#",B+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:C.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"})]}),C.start," \u2192 ",C.end]}),jsxRuntime.jsxs("span",{children:[C.duration," days"]}),C.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-blue-400",children:["Depends: ",C.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${C.priority==="high"?"bg-red-500/20 text-red-400":C.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:C.priority})]})},C.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:T,value:d,onChange:C=>c(C.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:D}),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:p,onChange:C=>n(C.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:D})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"End Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:m,onChange:C=>i(C.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:D})]})]}),y&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:y}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((C,B)=>jsxRuntime.jsx("button",{onClick:()=>c(C),disabled:D,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:C},B))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:D&&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:h,disabled:D,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"}),v?jsxRuntime.jsx("button",{onClick:w,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:x,disabled:!d.trim()||D,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:D?"Generating...":"Generate Tasks"})]})]})]})})]})}function Yo({initialBoard:e,onPersist:t}){let[a,r]=react.useState(e),o=react.useCallback(v=>{t&&oo(()=>Promise.resolve(t(v)),{maxAttempts:3,initialDelay:1e3,onRetry:(k,b,f)=>{console.warn(`Retry attempt ${b} after ${f}ms: ${k.message}`);}}).then(k=>{k.success||console.error(`Failed to persist board after ${k.attempts} attempts:`,k.error);});},[t]),s=react.useCallback(async(v,k,b)=>{r(f=>{let T=f.cards.find(C=>C.id===v);if(!T)return f;let D=T.columnId,h={...T,columnId:k,position:b},x=f.cards.map(C=>C.id===v?h:C),w=f.columns.map(C=>{if(C.id===D)return {...C,cardIds:C.cardIds.filter(B=>B!==v)};if(C.id===k){let B=x.filter(z=>z.columnId===k).sort((z,R)=>z.position-R.position);return {...C,cardIds:B.map(z=>z.id)}}return C}),M={...f,cards:x,columns:w};return o(M),M});},[o]),d=react.useCallback(async(v,k)=>{r(b=>{let f=b.cards.map(D=>D.id===v?{...D,...k}:D),T={...b,cards:f};return o(T),T});},[o]),c=react.useCallback(async v=>{let k=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(b=>{let f={...v,id:k},T=b.columns.map(h=>h.id===v.columnId?{...h,cardIds:[...h.cardIds,k]}:h),D={...b,cards:[...b.cards,f],columns:T};return o(D),D});},[o]),p=react.useCallback(async v=>{r(k=>{let b=k.cards.find(h=>h.id===v);if(!b)return k;let f=k.cards.filter(h=>h.id!==v),T=k.columns.map(h=>h.id===b.columnId?{...h,cardIds:h.cardIds.filter(x=>x!==v)}:h),D={...k,cards:f,columns:T};return o(D),D});},[o]),n=react.useCallback(async v=>{let k=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(b=>{let f={...v,id:k,cardIds:[]},T={...b,columns:[...b.columns,f]};return o(T),T});},[o]),m=react.useCallback(async(v,k)=>{r(b=>{let f=b.columns.map(D=>D.id===v?{...D,...k}:D),T={...b,columns:f};return o(T),T});},[o]),i=react.useCallback(async v=>{r(k=>{let b=k.cards.filter(D=>D.columnId!==v),f=k.columns.filter(D=>D.id!==v),T={...k,cards:b,columns:f};return o(T),T});},[o]),l=react.useCallback(v=>{let k=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return c(v),k},[c]),u=react.useCallback(v=>{let k=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return n(v),k},[n]),y=react.useCallback(()=>{r(v=>{let k={...v,cards:[],columns:[]};return o(k),k});},[o]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:d,onCardCreate:c,onCardDelete:p,onColumnCreate:n,onColumnUpdate:m,onColumnDelete:i},setBoard:r,helpers:{addCard:l,addColumn:u,deleteCard:p,deleteColumn:i,clearBoard:y}}}function Ud({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:o,helpers:s}=Yo({initialBoard:e,onPersist:a}),d=react.useMemo(()=>({addCard:(p,n,m={})=>{s.addCard({title:n,columnId:p,position:r.cards.filter(i=>i.columnId===p).length,...m});},addColumn:(p,n)=>{let m=r.columns.length>0?Math.max(...r.columns.map(i=>i.position)):0;s.addColumn({title:p,position:n??m+1e3});},reset:s.clearBoard}),[r.cards,r.columns,s]);return {props:react.useMemo(()=>({board:r,callbacks:o,availableUsers:t}),[r,o,t]),board:r,callbacks:o,utils:d}}var Jr={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},Gd={by:"none",order:"asc"};function Hd({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,o]=react.useState({...Jr,...e}),[s,d]=react.useState({...Gd,...t}),c=react.useCallback(g=>{o(v=>({...v,...g}));},[]),p=react.useCallback(g=>{d(v=>({...v,...g}));},[]),n=react.useCallback(()=>{o(Jr),d(Gd);},[]),m=react.useCallback(()=>{a&&o({...Jr,assignees:[a]});},[a]),i=react.useCallback(()=>{o({...Jr,dateFilter:"overdue"});},[]),l=react.useCallback(()=>{o({...Jr,priorities:["HIGH","URGENT"]});},[]),u=react.useMemo(()=>r.dateFilter!=="all"||r.priorities.length>0||r.assignees.length>0||r.labels.length>0||r.columns.length>0||r.search!==""||s.by!=="none",[r,s]),y=react.useCallback(g=>{let v=[...g];if(r.search){let k=r.search.toLowerCase();v=v.filter(b=>b.title.toLowerCase().includes(k)||b.description?.toLowerCase().includes(k));}if(r.dateFilter!=="all"){let k=new Date,b=k.getFullYear(),f=String(k.getMonth()+1).padStart(2,"0"),T=String(k.getDate()).padStart(2,"0"),D=`${b}-${f}-${T}`;v=v.filter(h=>{if(!h.endDate&&!h.dueDate)return false;let x=h.endDate||h.dueDate;if(!x)return false;let w;if(typeof x=="string")w=x.split("T")[0]||x;else {let M=x.getUTCFullYear(),C=String(x.getUTCMonth()+1).padStart(2,"0"),B=String(x.getUTCDate()).padStart(2,"0");w=`${M}-${C}-${B}`;}switch(r.dateFilter){case "overdue":return w<D;case "today":return w===D;case "this-week":let M=new Date(D+"T00:00:00"),C=new Date(w+"T00:00:00"),B=new Date(M);return B.setDate(B.getDate()+7),C>=M&&C<=B;case "custom":if(r.dateRange){let z=typeof x=="string"?new Date(x):x;return z>=r.dateRange.start&&z<=r.dateRange.end}return true;default:return true}});}return r.priorities.length>0&&(v=v.filter(k=>k.priority&&r.priorities.includes(k.priority))),r.assignees.length>0&&(v=v.filter(k=>(k.assignedUserIds||(k.assigneeId?[k.assigneeId]:[])).some(f=>r.assignees.includes(f)))),r.labels.length>0&&(v=v.filter(k=>k.labels&&k.labels.some(b=>r.labels.includes(b)))),r.columns.length>0&&(v=v.filter(k=>r.columns.includes(k.columnId))),s.by!=="none"&&v.sort((k,b)=>{let f=0;switch(s.by){case "created":let T=k.createdAt?new Date(k.createdAt).getTime():0,D=b.createdAt?new Date(b.createdAt).getTime():0;f=T-D;break;case "priority":let h={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},x=h[k.priority||"LOW"],w=h[b.priority||"LOW"];f=x-w;break;case "dueDate":let M=k.endDate||k.dueDate,C=b.endDate||b.dueDate;if(!M)return 1;if(!C)return -1;let B=typeof M=="string"?new Date(M).getTime():M.getTime(),z=typeof C=="string"?new Date(C).getTime():C.getTime();f=B-z;break;case "title":f=k.title.localeCompare(b.title);break;case "estimate":let R=k.estimatedTime||0,$=b.estimatedTime||0;f=R-$;break;default:f=0;}return s.order==="asc"?f:-f}),v},[r,s]);return {filters:r,sort:s,setFilters:c,setSort:p,resetFilters:n,filterMyTasks:m,filterOverdue:i,filterHighPriority:l,applyFilters:y,hasActiveFilters:u}}var Vd,jd;if(typeof window<"u")try{let e=to("ai");Vd=e.generateObject,jd=e.generateText;}catch{}function Kd(e={}){let[t,a]=react.useState(false),[r,o]=react.useState(null),s=!!(Vd&&jd&&e.apiKey),d=react.useCallback(async i=>{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:",i),{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: ${i}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(l){let u=l instanceof Error?l:new Error("Failed to generate plan");throw o(u),u}finally{a(false);}},[s]),c=react.useCallback(async i=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Suggesting assignee for:",i.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(l){let u=l instanceof Error?l:new Error("Failed to suggest assignee");throw o(u),u}finally{a(false);}},[s]),p=react.useCallback(async i=>{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(l){let u=l instanceof Error?l:new Error("Failed to predict risks");throw o(u),u}finally{a(false);}},[s]),n=react.useCallback(async i=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Generating subtasks for:",i.title),[{title:`Subtask 1 for: ${i.title}`,position:i.position+.1,columnId:i.columnId},{title:`Subtask 2 for: ${i.title}`,position:i.position+.2,columnId:i.columnId}]}catch(l){let u=l instanceof Error?l:new Error("Failed to generate subtasks");throw o(u),u}finally{a(false);}},[s]),m=react.useCallback(async i=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Estimating effort for:",i.title),{hours:8,confidence:.75}}catch(l){let u=l instanceof Error?l:new Error("Failed to estimate effort");throw o(u),u}finally{a(false);}},[s]);return {onGeneratePlan:d,onSuggestAssignee:c,onPredictRisks:p,onGenerateSubtasks:n,onEstimateEffort:m,isAvailable:s,isLoading:t,error:r}}function Ls(){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 Yd(e){let{cards:t}=e,[a,r]=Ls(),o=react.useCallback(i=>a.selectedCardIds.includes(i),[a.selectedCardIds]),s=react.useCallback((i,l)=>{if(!l){r({selectedCardIds:[i],lastSelectedCardId:i});return}let u=l.ctrlKey||l.metaKey,y=l.shiftKey;if(u)a.selectedCardIds.includes(i)?r({selectedCardIds:a.selectedCardIds.filter(g=>g!==i),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,i],lastSelectedCardId:i});else if(y&&a.lastSelectedCardId){let g=t.find(k=>k.id===i),v=t.find(k=>k.id===a.lastSelectedCardId);if(g&&v&&g.columnId===v.columnId){let k=t.filter(w=>w.columnId===g.columnId).sort((w,M)=>w.position-M.position),b=k.findIndex(w=>w.id===a.lastSelectedCardId),f=k.findIndex(w=>w.id===i),[T,D]=b<f?[b,f]:[f,b],h=k.slice(T,D+1).map(w=>w.id),x=Array.from(new Set([...a.selectedCardIds,...h]));r({selectedCardIds:x,lastSelectedCardId:i});}else r({selectedCardIds:[i],lastSelectedCardId:i});}else r({selectedCardIds:[i],lastSelectedCardId:i});},[t,a,r]),d=react.useCallback(i=>{r({selectedCardIds:a.selectedCardIds.filter(l=>l!==i),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),c=react.useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),p=react.useCallback(()=>{r({selectedCardIds:t.map(i=>i.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),n=react.useCallback(i=>{a.selectedCardIds.includes(i)?d(i):r({selectedCardIds:[...a.selectedCardIds,i],lastSelectedCardId:i});},[a,d,r]),m=react.useCallback(()=>t.filter(i=>a.selectedCardIds.includes(i.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:o,selectCard:s,deselectCard:d,clearSelection:c,selectAll:p,toggleCard:n,getSelectedCards:m}}var qd={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function Xd(e){let{cards:t,config:a,aiService:r}=e,o=react.useMemo(()=>({...qd,...a}),[a]),[s,d]=react.useState([]),c=react.useCallback((g,v,k,b,f)=>{if(v.length<o.minCardsPerStack){console.warn(`Cannot create stack: minimum ${o.minCardsPerStack} cards required`);return}let T={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:g,cardIds:v,columnId:k,strategy:b,color:f,isExpanded:true,position:s.filter(D=>D.columnId===k).length,createdAt:new Date};d(D=>[...D,T]);},[o.minCardsPerStack,s]),p=react.useCallback(g=>{d(v=>v.filter(k=>k.id!==g));},[]),n=react.useCallback(g=>{d(v=>v.map(k=>k.id===g?{...k,isExpanded:!k.isExpanded}:k));},[]),m=react.useCallback((g,v)=>{d(k=>k.map(b=>b.id===g&&!b.cardIds.includes(v)?{...b,cardIds:[...b.cardIds,v]}:b));},[]),i=react.useCallback((g,v)=>{d(k=>k.map(b=>{if(b.id===g){let f=b.cardIds.filter(T=>T!==v);return f.length<o.minCardsPerStack?null:{...b,cardIds:f}}return b}).filter(b=>b!==null));},[o.minCardsPerStack]),l=react.useCallback(g=>s.filter(v=>v.columnId===g).sort((v,k)=>v.position-k.position),[s]),u=react.useCallback(async g=>{let v=t.filter(D=>D.columnId===g);if(v.length<o.minCardsPerStack*2)return [];let k=[],b=new Map;v.forEach(D=>{D.labels&&D.labels.length>0&&D.labels.forEach(h=>{b.has(h)||b.set(h,[]),b.get(h).push(D);});}),b.forEach((D,h)=>{D.length>=o.minCardsPerStack&&k.push({stack:{title:`\u{1F4CC} ${h}`,cardIds:D.map(x=>x.id),columnId:g,strategy:"labels",color:"#3b82f6"},reason:`${D.length} cards with label "${h}"`,confidence:.85});});let f=new Map;v.forEach(D=>{D.assignedUserIds&&D.assignedUserIds.length>0&&D.assignedUserIds.forEach(h=>{f.has(h)||f.set(h,[]),f.get(h).push(D);});}),f.forEach((D,h)=>{D.length>=o.minCardsPerStack&&k.push({stack:{title:`\u{1F464} Assigned to user-${h.slice(-4)}`,cardIds:D.map(x=>x.id),columnId:g,strategy:"assignee",color:"#8b5cf6"},reason:`${D.length} cards assigned to the same user`,confidence:.8});});let T=new Map;if(v.forEach(D=>{D.priority&&(T.has(D.priority)||T.set(D.priority,[]),T.get(D.priority).push(D));}),T.forEach((D,h)=>{if(D.length>=o.minCardsPerStack){let x={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[h.toLowerCase()]||"\u26AA";k.push({stack:{title:`${x} ${h} Priority`,cardIds:D.map(w=>w.id),columnId:g,strategy:"priority",color:h==="high"||h==="urgent"?"#ef4444":"#10b981"},reason:`${D.length} cards with ${h} priority`,confidence:.75});}}),r&&o.enableAutoStacking)for(let D of v){let x=(await r.findSimilar(D,v)).filter(w=>w.similarity>=o.autoStackConfidenceThreshold);if(x.length>=o.minCardsPerStack-1){let w=[D.id,...x.map(C=>C.card.id)],M=x.reduce((C,B)=>C+B.similarity,0)/x.length;k.push({stack:{title:`\u2728 Similar to "${D.title.substring(0,30)}${D.title.length>30?"...":""}"`,cardIds:w,columnId:g,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${x.length+1} similar tasks`,confidence:M});}}return k.filter(D=>D.confidence>=o.autoStackConfidenceThreshold).sort((D,h)=>h.confidence-D.confidence).slice(0,5)},[t,o,r]),y=react.useCallback(g=>{c(g.stack.title,g.stack.cardIds,g.stack.columnId,g.stack.strategy,g.stack.color);},[c]);return react.useEffect(()=>{o.enableAutoStacking&&s.length===0&&new Set(t.map(v=>v.columnId)).forEach(async v=>{let k=await u(v),b=k[0];k.length>0&&b&&b.confidence>=.9&&y(b);});},[]),{stacks:s,createStack:c,deleteStack:p,toggleStack:n,addToStack:m,removeFromStack:i,getStacksForColumn:l,getSuggestions:u,applySuggestion:y,config:o}}var Jd=react.createContext(null);function Zd({children:e,initialData:t,onStateChange:a}){let r=react.useRef();if(!r.current){let s=new Map,d=new Map;t?.columns?.forEach(p=>{let{Column:n}=to("@libxai/core");s.set(p.id,new n(p));}),t?.cards?.forEach(p=>{let{Card:n}=to("@libxai/core");d.set(p.id,new n(p));});let c=null;if(t?.board){let{Board:p}=to("@libxai/core");c=new p(t.board);}r.current=new core.BoardStore({board:c,columns:s,cards:d});}let o=r.current;return react.useEffect(()=>{if(a)return o.subscribeAll(s=>{a(o.getState());})},[o,a]),jsxRuntime.jsx(Jd.Provider,{value:{store:o},children:e})}function qo(){let e=react.useContext(Jd);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function Qr(){let e=qo(),[t,a]=react.useState(e.getBoard()),[r,o]=react.useState(e.getAllColumns()),[s,d]=react.useState(e.getAllCards());react.useEffect(()=>e.subscribeAll(()=>{a(e.getBoard()),o(e.getAllColumns()),d(e.getAllCards());}),[e]);let c=react.useCallback(b=>{e.updateBoard(b);},[e]),p=react.useCallback(b=>{e.addColumn(b);},[e]),n=react.useCallback((b,f)=>{e.updateColumn(b,f);},[e]),m=react.useCallback(b=>{e.deleteColumn(b);},[e]),i=react.useCallback(b=>e.getColumn(b),[e]),l=react.useCallback(b=>{e.addCard(b);},[e]),u=react.useCallback((b,f)=>{e.updateCard(b,f);},[e]),y=react.useCallback(b=>{e.deleteCard(b);},[e]),g=react.useCallback((b,f,T)=>{e.moveCard(b,f,T);},[e]),v=react.useCallback(b=>e.getCard(b),[e]),k=react.useCallback(b=>e.getCardsByColumn(b),[e]);return {board:t,columns:r,cards:s,updateBoard:c,addColumn:p,updateColumn:n,deleteColumn:m,getColumn:i,addCard:l,updateCard:u,deleteCard:y,moveCard:g,getCard:v,getCardsByColumn:k}}function ec(e){let{cards:t}=Qr();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 tc(e="position",t="asc"){let{cards:a}=Qr();return react.useMemo(()=>[...a].sort((o,s)=>{let d=0;switch(e){case "title":d=o.title.localeCompare(s.title);break;case "priority":{let c={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},p=o.priority?c[o.priority]:0,n=s.priority?c[s.priority]:0;d=p-n;break}case "createdAt":d=o.createdAt.getTime()-s.createdAt.getTime();break;case "updatedAt":d=o.updatedAt.getTime()-s.updatedAt.getTime();break;case "position":d=o.position-s.position;break}return t==="asc"?d:-d}),[a,e,t])}var Xo=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=ii.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 d=s[t];if(typeof d=="function")try{let c=await Promise.resolve(d.apply(s,a));c!==void 0&&(o=c,a[0]=c);}catch(c){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,c,{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(d=>{this.pluginLogger.error(`Plugin hook failed: ${o.id}.${t}`,d,{plugin:o.id,hook:t});}));}await Promise.all(r);}},Yf=new Xo;function rc({items:e,height:t,estimateSize:a,renderItem:r,className:o="",overscan:s=5,horizontal:d=false,gap:c=0,getItemKey:p}){let n=react.useRef(null),m=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>n.current,estimateSize:()=>a,overscan:s,horizontal:d,gap:c}),i=m.getVirtualItems(),l={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},u=d?{width:`${m.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${m.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:n,style:l,className:o,children:jsxRuntime.jsx("div",{style:u,children:i.map(y=>{let g=e[y.index];if(!g)return null;let v=p?p(g,y.index):y.index,k={position:"absolute",top:d?0:y.start,left:d?y.start:0,width:d?y.size:"100%",height:d?"100%":y.size};return jsxRuntime.jsx("div",{style:k,"data-index":y.index,children:r(g,y.index)},v)})})})}function oc(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 sc({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:o,className:s="",overscan:d=3,gap:c=16,getItemKey:p,horizontal:n=true}){let m=react.useRef(null),i=reactVirtual.useVirtualizer({horizontal:n,count:e.length,getScrollElement:()=>m.current,estimateSize:()=>r,overscan:d,gap:c}),l=i.getVirtualItems(),u={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},y={width:`${i.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:m,style:u,className:s,children:jsxRuntime.jsx("div",{style:y,children:l.map(g=>{let v=e[g.index];if(!v)return null;let k=p?p(v,g.index):g.index,b={position:"absolute",top:0,left:g.start,width:g.size,height:"100%"};return jsxRuntime.jsx("div",{style:b,"data-index":g.index,children:o(v,g.index)},k)})})})}function ic(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 lc(e,t=10){return e>t}var Os={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},$s={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},zs={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},Us={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Ws={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},Gs={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},Hs={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},_s={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)"},Vs={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)"},js={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Ks={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}},Ys={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}},Jo={spacing:Os,borderRadius:$s,fontSize:zs,fontWeight:Us,lineHeight:Ws,zIndex:Gs,duration:Hs,easing:_s,shadows:Vs,opacity:js,kanban:Ks,gantt:Ys};function dc(e,t,a){return e[t]??a}function qs(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)?qs(o,s,a):(typeof o=="string"||typeof o=="number")&&(a[s]=o);}return a}function Jf(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function Xs(e="asakaa"){let t=qs(Jo),a=[];for(let[r,o]of Object.entries(t)){let s=`--${e}-${r}`,d=Jf(o);a.push(` ${s}: ${d};`);}return `:root {
324
324
  ${a.join(`
325
325
  `)}
326
326
  }`}function eo(e,t="asakaa"){let a=[],r=qs(e);for(let[o,s]of Object.entries(r)){let d=`--${t}-color-${o}`;a.push(` ${d}: ${s};`);}return `:root {