@libxai/board 0.17.231 → 0.17.232

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
@@ -1,7 +1,7 @@
1
1
  'use strict';var client=require('react-dom/client'),core=require('@libxai/core'),react=require('react'),core$1=require('@dnd-kit/core'),sortable=require('@dnd-kit/sortable'),reactVirtual=require('@tanstack/react-virtual'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jspdf=require('jspdf'),pc=require('html2canvas'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime'),framerMotion=require('framer-motion'),lucideReact=require('lucide-react'),cmdk=require('cmdk'),vu=require('react-markdown'),xu=require('remark-gfm'),ku=require('rehype-sanitize'),recharts=require('recharts');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var pc__default=/*#__PURE__*/_interopDefault(pc);var vu__default=/*#__PURE__*/_interopDefault(vu);var xu__default=/*#__PURE__*/_interopDefault(xu);var ku__default=/*#__PURE__*/_interopDefault(ku);var Ho=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,a)=>(typeof require<"u"?require:t)[a]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Go=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:a}=e;return "translate3d("+(t?Math.round(t):0)+"px, "+(a?Math.round(a):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:a}=e;return "scaleX("+t+") scaleY("+a+")"}},Transform:{toString(e){if(e)return [Go.Translate.toString(e),Go.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:a,easing:r}=e;return t+" "+a+"ms "+r}}});function y(...e){return tailwindMerge.twMerge(clsx.clsx(e))}function _o(e,t){return e===null&&t===null?1e3:e===null&&t!==null?t/2:e!==null&&t===null?e+1e3:e!==null&&t!==null?(e+t)/2:1e3}function $p(e){return Array.from({length:e},(t,a)=>(a+1)*1e3)}function Zn(e,t){return e.length===0?1e3:t===0?_o(null,e[0].position):t>=e.length?_o(e[e.length-1].position,null):_o(e[t-1].position,e[t].position)}function ul(e,t=100){return e>t}var Up=e=>{if(e.message.includes("network")||e.message.includes("fetch"))return true;if("status"in e){let t=e.status;return t>=500||t===429}return false};function Wp(e,t,a,r){let o=t*Math.pow(a,e-1),s=o*.2*Math.random();return Math.min(o+s,r)}async function Vo(e,t={}){let{maxAttempts:a=3,initialDelay:r=1e3,backoffMultiplier:o=2,maxDelay:s=1e4,shouldRetry:d=Up,onRetry:p}=t,c,n=0;for(let m=1;m<=a;m++){n=m;try{return {data:await e(),attempts:n,success:!0}}catch(l){if(c=l,m===a||!d(c,m))return {error:c,attempts:n,success:false};let u=Wp(m,r,o,s);if(p)try{p(c,m,u);}catch(w){console.error("Error in retry callback:",w);}await new Promise(w=>setTimeout(w,u));}}return {error:c||new Error("Unknown error"),attempts:n,success:false}}function Hp(e,t=3){let a;for(let r=1;r<=t;r++)try{return {data:e(),success:!0}}catch(o){if(a=o,r===t)return {error:a,success:false}}return {error:a||new Error("Unknown error"),success:false}}function Gp(e,t={}){return async(...a)=>Vo(()=>e(...a),t)}var Qn=class{constructor(t=5,a=6e4){this.threshold=t;this.resetTimeout=a;this.failures=0;this.lastFailureTime=0;this.isOpen=false;}async execute(t){if(this.isOpen)if(Date.now()-this.lastFailureTime>=this.resetTimeout)this.reset();else throw new Error("Circuit breaker is open - too many failures");try{let a=await t();return this.onSuccess(),a}catch(a){throw this.onFailure(),a}}onSuccess(){this.failures=0,this.isOpen=false;}onFailure(){this.failures++,this.lastFailureTime=Date.now(),this.failures>=this.threshold&&(this.isOpen=true);}reset(){this.failures=0,this.isOpen=false;}getStatus(){return {failures:this.failures,isOpen:this.isOpen}}};var gl=(s=>(s[s.DEBUG=0]="DEBUG",s[s.INFO=1]="INFO",s[s.WARN=2]="WARN",s[s.ERROR=3]="ERROR",s[s.NONE=4]="NONE",s))(gl||{}),xr=class xr{constructor(t={}){this.defaultLogHandler=t=>{let{timestamp:a,level:r,message:o,component:s,...d}=t,p=`[${a}] [${r}] [${s}]`,c=Object.keys(d).length>0;switch(r){case "DEBUG":console.debug(p,o,c?d:"");break;case "INFO":console.info(p,o,c?d:"");break;case "WARN":console.warn(p,o,c?d:"");break;case "ERROR":console.error(p,o,c?d:""),t.error?.stack&&console.error(t.error.stack);break}};let a=process.env.NODE_ENV==="development";this.options={minLevel:t.minLevel??(a?0:1),enabled:t.enabled??true,onLog:t.onLog??this.defaultLogHandler,enableTiming:t.enableTiming??true,componentName:t.componentName??"ASAKAA",...xr.globalOptions};}static configure(t){xr.globalOptions={...xr.globalOptions,...t};}child(t){return new xr({...this.options,componentName:`${this.options.componentName}:${t}`})}debug(t,a){this.log(0,t,a);}info(t,a){this.log(1,t,a);}warn(t,a){this.log(2,t,a);}error(t,a,r){this.log(3,t,{...r,error:a?{message:a.message,stack:a.stack,name:a.name}:void 0});}startTimer(t){return this.options.enableTiming?new jo((a,r)=>{this.log(0,`${t} completed`,{...r,action:t,duration:a});},true):new jo(()=>{},false)}log(t,a,r){if(!this.options.enabled||t<this.options.minLevel)return;let o={timestamp:new Date().toISOString(),level:gl[t],message:a,component:this.options.componentName,...r};this.options.onLog(o);}};xr.globalOptions={};var es=xr,jo=class{constructor(t,a){this.onEnd=t;this.enabled=a;this.startTime=a?performance.now():0;}end(t){if(!this.enabled)return 0;let a=Math.round(performance.now()-this.startTime);return this.onEnd(a,t),a}elapsed(){return this.enabled?Math.round(performance.now()-this.startTime):0}},fl=new es;function Vp(e,t){let a={board:{id:e.id,title:e.title,metadata:e.metadata,exportedAt:new Date().toISOString()},columns:e.columns,cards:e.cards,options:t};return JSON.stringify(a,null,2)}function jp(e,t){let a=["Card ID","Title","Description","Column","Priority","Labels","Assigned Users","Start Date","End Date","Created At","Updated At"],r=e.cards.map(s=>{let d=e.columns.find(p=>p.id===s.columnId);return [s.id,ts(s.title),ts(s.description||""),ts(d?.title||""),s.priority||"",(s.labels||[]).join(";"),(s.assignedUserIds||[]).join(";"),s.startDate||"",s.endDate||"",s.createdAt||"",s.updatedAt||""]});return [a.join(","),...r.map(s=>s.join(","))].join(`
2
2
  `)}async function Kp(e,t,a){let r=t;if(!r){let d=document.querySelector(".asakaa-board");d&&(r=d.parentElement||d);}if(r)try{let d=await pc__default.default(r,{backgroundColor:"#0a0a0a",scale:1.5,logging:!1,useCORS:!0,allowTaint:!0,windowWidth:r.scrollWidth,windowHeight:r.scrollHeight}),p=d.toDataURL("image/png"),c=297,n=210,m=d.width/d.height,l=c-20,i=l/m;i>n-20&&(i=n-20,l=i*m);let u=new jspdf.jsPDF({orientation:"landscape",unit:"mm",format:"a4"});u.setFontSize(16),u.setTextColor(255,255,255),u.setFillColor(10,10,10),u.rect(0,0,c,15,"F"),u.text(e.title||"Kanban Board",10,10);let w=(c-l)/2;return u.addImage(p,"PNG",w,20,l,i),u}catch(d){console.error("Error capturing board:",d);}let o=new jspdf.jsPDF,s=20;return o.setFontSize(20),o.text(e.title||"Kanban Board",20,s),s+=10,o.setFontSize(10),o.setTextColor(128,128,128),o.text(`Exported on ${new Date().toLocaleString()}`,20,s),s+=15,o.setTextColor(0,0,0),e.columns.forEach(d=>{let p=e.cards.filter(c=>c.columnId===d.id);s>250&&(o.addPage(),s=20),o.setFontSize(16),o.setFont("helvetica","bold"),o.text(d.title,20,s),s+=8,p.length===0?(o.setFontSize(10),o.setFont("helvetica","italic"),o.setTextColor(128,128,128),o.text("No cards in this column",20,s),o.setTextColor(0,0,0),s+=10):p.forEach(c=>{if(s>260&&(o.addPage(),s=20),o.setFontSize(12),o.setFont("helvetica","bold"),o.text(c.title,25,s),s+=6,c.description){o.setFontSize(9),o.setFont("helvetica","normal");let m=o.splitTextToSize(c.description,160);o.text(m,25,s),s+=m.length*5;}let n=[];if(c.priority&&n.push(`Priority: ${c.priority}`),c.labels&&c.labels.length>0&&n.push(`Labels: ${c.labels.join(", ")}`),c.assignedUserIds&&c.assignedUserIds.length>0&&n.push(`Assigned: ${c.assignedUserIds.length} user(s)`),c.startDate||c.endDate){let m=[];c.startDate&&m.push(`Start: ${c.startDate}`),c.endDate&&m.push(`End: ${c.endDate}`),n.push(m.join(" \u2192 "));}n.length>0&&(o.setFontSize(8),o.setTextColor(100,100,100),o.text(n.join(" \u2022 "),25,s),o.setTextColor(0,0,0),s+=5),s+=5;}),s+=5;}),o}function ts(e){return e.includes(",")||e.includes('"')||e.includes(`
3
3
  `)?`"${e.replace(/"/g,'""')}"`:e}async function bl(e,t,a,r){switch(t){case "json":return Vp(e,r);case "csv":return jp(e);case "pdf":return await Kp(e,a);default:throw new Error(`Unsupported export format: ${t}`)}}function yl(e,t,a){let r=`board-export-${new Date().getTime()}`;if(t==="pdf"&&typeof e=="object"&&e!==null&&"save"in e){let m=`${r}.pdf`;e.save(m);return}if(typeof e!="string")throw new Error("Invalid content type for non-PDF export");let s=`${r}.${{json:"json",csv:"csv",pdf:"pdf"}[t]}`,d={json:"application/json",csv:"text/csv",pdf:"application/pdf"},p=new Blob([e],{type:d[t]}),c=URL.createObjectURL(p),n=document.createElement("a");n.href=c,n.download=s,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(c);}function Yp(e){try{let t=JSON.parse(e);if(!t.board||!t.columns||!t.cards)return {success:!1,errors:["Invalid JSON format: missing required fields (board, columns, cards)"]};let a={id:t.board.id,title:t.board.title,columns:t.columns,cards:t.cards,metadata:t.board.metadata};return {success:!0,cardsImported:a.cards.length,columnsImported:a.columns.length}}catch(t){return {success:false,errors:[`Failed to parse JSON: ${t instanceof Error?t.message:"Unknown error"}`]}}}function qp(e){try{let t=e.trim().split(`
4
- `);if(t.length<1||!t[0])return {success:!1,errors:["CSV file is empty or invalid"]};let a=vl(t[0]),r=[],o=new Map,s=[];for(let d=1;d<t.length;d++)try{let p=vl(t[d]||"");if(p.length>a.length){s.push(`Line ${d+1}: Too many columns`);continue}if(a.length-p.length>3){s.push(`Line ${d+1}: Column count mismatch (expected ${a.length}, got ${p.length})`);continue}for(;p.length<a.length;)p.push("");let n={};a.forEach((u,w)=>{n[u]=p[w]||"";});let m=n.Column||"Unnamed";o.has(m)||o.set(m,{id:`col-${o.size+1}`,title:m,position:o.size+1,cardIds:[]});let l=o.get(m),i={id:n["Card ID"]||`card-${d}`,title:n.Title||"Untitled",description:n.Description?n.Description:void 0,columnId:l.id,position:l.cardIds.length+1,priority:n.Priority||void 0,labels:n.Labels?n.Labels.split(";").filter(Boolean):void 0,assignedUserIds:n["Assigned Users"]?n["Assigned Users"].split(";").filter(Boolean):void 0,startDate:n["Start Date"]?n["Start Date"]:void 0,endDate:n["End Date"]?n["End Date"]:void 0,createdAt:n["Created At"]?n["Created At"]:void 0,updatedAt:n["Updated At"]?n["Updated At"]:void 0};r.push(i),l.cardIds.push(i.id);}catch(p){s.push(`Line ${d+1}: ${p instanceof Error?p.message:"Unknown error"}`);}return r.length===0?{success:!1,errors:["No valid cards found in CSV",...s]}:{success:!0,cardsImported:r.length,columnsImported:o.size,errors:s.length>0?s:void 0}}catch(t){return {success:false,errors:[`Failed to parse CSV: ${t instanceof Error?t.message:"Unknown error"}`]}}}function vl(e){let t=[],a="",r=false;for(let o=0;o<e.length;o++){let s=e[o],d=e[o+1];s==='"'&&r&&d==='"'?(a+='"',o++):s==='"'?r=!r:s===","&&!r?(t.push(a),a=""):a+=s;}return t.push(a),t}function xl(e,t){switch(t){case "json":return Yp(e);case "csv":return qp(e);default:return {success:false,errors:[`Unsupported import format: ${t}`]}}}function kl(e){return new Promise((t,a)=>{let r=new FileReader;r.onload=o=>{o.target?.result?t(o.target.result):a(new Error("Failed to read file"));},r.onerror=()=>a(new Error("Failed to read file")),r.readAsText(e);})}var as=react.createContext(null);function wl(){return react.useContext(as)}var Cl=react.createContext(null);function Tl({children:e,themeName:t}){return jsxRuntime.jsx(Cl.Provider,{value:{themeName:t},children:e})}function Wr(){return react.useContext(Cl)}function nt({children:e,container:t}){let[a,r]=react.useState(false),o=wl(),s=Wr();if(react.useEffect(()=>(r(true),()=>r(false)),[]),!a)return null;let d=t||(typeof document<"u"?document.body:null);if(!d)return null;if(o){let{theme:p,themeName:c}=o,n={"--asakaa-color-background-primary":p.bgPrimary,"--asakaa-color-background-secondary":p.bgSecondary,"--asakaa-color-background-card":p.bgGrid,"--asakaa-color-background-hover":p.hoverBg,"--asakaa-color-text-primary":p.textPrimary,"--asakaa-color-text-secondary":p.textSecondary,"--asakaa-color-text-tertiary":p.textTertiary,"--asakaa-color-text-inverse":p.taskBarHandle||"#FFFFFF","--asakaa-color-border-default":p.border,"--asakaa-color-border-hover":p.borderLight,"--asakaa-color-border-subtle":p.borderLight,"--asakaa-color-interactive-primary":p.accent,"--asakaa-color-interactive-primaryHover":p.accentHover,"--asakaa-color-interactive-primaryBorder":`${p.accent}4D`,"--asakaa-color-interactive-primaryBackground":`${p.accent}1A`,"--asakaa-color-interactive-primaryBackgroundHover":`${p.accent}33`,"--asakaa-color-status-success":p.statusCompleted,"--asakaa-color-status-warning":p.milestone,"--asakaa-color-status-error":p.criticalPath,"--asakaa-color-danger":p.criticalPath,"--asakaa-color-danger-border":`${p.criticalPath}4D`,"--asakaa-color-danger-background":`${p.criticalPath}14`,"--asakaa-color-danger-backgroundHover":`${p.criticalPath}26`};return reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":c,"data-gantt-portal":"true",style:n,children:e}),d)}return s?reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":s.themeName,"data-kanban-portal":"true",children:e}),d):reactDom.createPortal(e,d)}var Pl={URGENT:{label:"Urgent",color:"#E74C3C"},HIGH:{label:"High",color:"#E67E22"},MEDIUM:{label:"Normal",color:"#F1C40F"},LOW:{label:"Low",color:"#2ECC71"}},rm="#BDC3C7",om=({color:e})=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",fill:e,opacity:"0.9"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"1.5",opacity:"0.3"})]});function kr({priority:e,onChange:t,className:a}){let[r,o]=react.useState(false),[s,d]=react.useState({top:0,left:0}),p=react.useRef(null),c=react.useRef(null),n=()=>{if(!c.current)return;let u=c.current.getBoundingClientRect(),w=window.innerHeight,f=window.innerWidth,g=160,C=220,h=4,b=u.right-g;b<10&&(b=u.left),b+g>f-10&&(b=f-g-10);let v=w-u.bottom,D=u.top,N;v>=C+h?N=u.bottom+h:D>=C+h?N=u.top-C-h:N=v>=D?u.bottom+h:Math.max(10,u.top-C-h),d({top:N,left:b}),o(true);};react.useEffect(()=>{let u=w=>{p.current&&!p.current.contains(w.target)&&!c.current?.contains(w.target)&&o(false);};if(r)return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[r]),react.useEffect(()=>{let u=w=>{w.key==="Escape"&&o(false);};if(r)return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[r]);let m=u=>{t(u),o(false);},l=e?Pl[e]:null,i=l?.color||rm;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:c,onClick:()=>r?o(false):n(),className:"flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95",style:{background:e?`${i}10`:"transparent",boxShadow:e?`0 0 0 2px ${i}30 inset`:"none"},title:l?.label||"Set priority",children:jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M3 2L3 14M3 2L13 6L3 8V2Z",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:i,fillOpacity:e?"0.6":"0.4"})})}),r&&jsxRuntime.jsx(nt,{children:jsxRuntime.jsxs("div",{ref:p,className:"priority-selector-menu",style:{position:"fixed",top:`${s.top}px`,left:`${s.left}px`,zIndex:99999,minWidth:"160px",maxHeight:"calc(100vh - 40px)",borderRadius:"8px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-1.5 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Priority"})}),jsxRuntime.jsxs("div",{className:"py-1",children:[Object.entries(Pl).map(([u,w])=>jsxRuntime.jsxs("button",{onClick:()=>m(u),className:"w-full px-3 py-1.5 flex items-center gap-2 text-xs font-medium transition-all active:scale-[0.98] priority-option",style:{color:w.color,background:"transparent"},onMouseEnter:f=>{f.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:f=>{f.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(om,{color:w.color}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:w.label}),e===u&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},u)),jsxRuntime.jsx("div",{className:"mt-0.5 pt-0.5 border-t",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsxs("button",{onClick:()=>m(void 0),className:"w-full px-3 py-1.5 flex items-center gap-2 text-xs font-medium transition-all active:scale-[0.98]",style:{color:"var(--modal-v2-text-primary, #e5e5e5)",background:"transparent"},onMouseEnter:u=>{u.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:u=>{u.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"#9CA3AF",strokeWidth:"1.5",strokeDasharray:"2 2",opacity:"0.6"})}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:"Clear"}),!e&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})]})})]})}var nm=[{label:"Today",days:0},{label:"Tomorrow",days:1},{label:"Next Week",days:7},{label:"2 Weeks",days:14},{label:"4 Weeks",days:28},{label:"8 Weeks",days:56}];function uo({startDate:e,endDate:t,onChange:a,className:r}){let[o,s]=react.useState(false),[d,p]=react.useState({top:0,left:0}),c=react.useRef(null),n=react.useRef(null),i=(Wr()?.themeName||"dark")==="dark",u=()=>{if(!n.current)return;let b=n.current.getBoundingClientRect(),v=window.innerHeight,D=window.innerWidth,N=320,A=380,x=4,B=b.left;B+N>D-10&&(B=D-N-10),B<10&&(B=10);let E=v-b.bottom,T=b.top,H;E>=A+x?H=b.bottom+x:T>=A+x?H=b.top-A-x:H=E>=T?b.bottom+x:Math.max(10,b.top-A-x),p({top:H,left:B}),s(true);};react.useEffect(()=>{let b=v=>{c.current&&!c.current.contains(v.target)&&!n.current?.contains(v.target)&&s(false);};if(o)return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[o]),react.useEffect(()=>{let b=v=>{v.key==="Escape"&&s(false);};if(o)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[o]);let w=b=>{let v=new Date,D=B=>{let E=B.getFullYear(),T=String(B.getMonth()+1).padStart(2,"0"),H=String(B.getDate()).padStart(2,"0");return `${E}-${T}-${H}`},N=D(v),A=new Date(v);A.setDate(A.getDate()+b);let x=D(A);a(N,x),s(false);},f=()=>{if(!e||!t)return "Set date";let b=A=>{if(A instanceof Date)return A;if(typeof A!="string"||!A.match(/^\d{4}-\d{2}-\d{2}$/))return null;let x=A.split("-").map(Number);if(x.length!==3||x.some(H=>isNaN(H)))return null;let B=x[0],E=x[1],T=x[2];return B===void 0||E===void 0||T===void 0?null:new Date(B,E-1,T)},v=b(e),D=b(t);if(!v||!D||isNaN(v.getTime())||isNaN(D.getTime()))return "Set date";let N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return `${N[v.getMonth()]} ${v.getDate()} \u2013 ${N[D.getMonth()]} ${D.getDate()}`},g=e&&t,h=(()=>{if(!t)return false;let b=typeof t=="string"?new Date(t):t,v=new Date;return v.setHours(0,0,0,0),b<v})();return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsxs("button",{ref:n,onClick:()=>o?s(false):u(),className:`flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-all hover:bg-white/5 ${h?"asakaa-date-overdue":"asakaa-date"}`,title:g?`${f()}`:"Set date range",children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"2",y:"3",width:"12",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M2 6H14",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M5 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M11 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e&&t&&jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:f()})]}),o&&jsxRuntime.jsx(nt,{children:jsxRuntime.jsxs("div",{ref:c,className:"date-picker-menu rounded-xl shadow-2xl border min-w-[320px]",style:{position:"fixed",top:`${d.top}px`,left:`${d.left}px`,background:i?"#1A1D25":"#FFFFFF",border:`1px solid ${i?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.12)"}`,boxShadow:i?"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)":"0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.08)",zIndex:99999},children:[jsxRuntime.jsxs("div",{className:"p-4 border-b",style:{borderColor:i?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.08)"},children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:i?"rgba(255, 255, 255, 0.85)":"rgba(0, 0, 0, 0.7)"},children:"Quick Select"}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:nm.map(b=>jsxRuntime.jsx("button",{onClick:()=>w(b.days),className:"px-3 py-2.5 rounded-lg text-xs font-semibold transition-all active:scale-95",style:{color:i?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",border:`1px solid ${i?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)"}`,backgroundColor:i?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)"},onMouseEnter:v=>{v.currentTarget.style.backgroundColor=i?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.1)",v.currentTarget.style.border=`1px solid ${i?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.25)"}`;},onMouseLeave:v=>{v.currentTarget.style.backgroundColor=i?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",v.currentTarget.style.border=`1px solid ${i?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)"}`;},children:b.label},b.label))})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:i?"rgba(255, 255, 255, 0.85)":"rgba(0, 0, 0, 0.7)"},children:"Custom Range"}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("input",{type:"date",value:e||"",onChange:b=>a(b.target.value,t),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:i?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",borderColor:i?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)",color:i?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",colorScheme:i?"dark":"light"}}),jsxRuntime.jsx("input",{type:"date",value:t||"",onChange:b=>a(e,b.target.value),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:i?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",borderColor:i?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)",color:i?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",colorScheme:i?"dark":"light"}})]}),(e||t)&&jsxRuntime.jsx("button",{onClick:()=>{a(void 0,void 0),s(false);},className:"mt-4 w-full px-3 py-2.5 rounded-lg text-sm font-semibold transition-all active:scale-95 border",style:{color:"#ef4444",borderColor:"rgba(239, 68, 68, 0.3)",background:"rgba(239, 68, 68, 0.1)"},onMouseEnter:b=>{b.currentTarget.style.background="rgba(239, 68, 68, 0.2)";},onMouseLeave:b=>{b.currentTarget.style.background="rgba(239, 68, 68, 0.1)";},children:"Clear Dates"})]})]})})]})}function Cr({assignedUsers:e=[],availableUsers:t,onChange:a,className:r,maxVisibleAvatars:o=3}){let[s,d]=react.useState(false),[p,c]=react.useState(""),[n,m]=react.useState({top:0,left:0}),l=react.useRef(null),i=react.useRef(null),u=()=>{if(!i.current)return;let h=i.current.getBoundingClientRect(),b=window.innerHeight,v=window.innerWidth,D=300,N=380,A=4,x=h.right-D;x<10&&(x=h.left),x+D>v-10&&(x=v-D-10);let B=b-h.bottom,E=h.top,T;B>=N+A?T=h.bottom+A:E>=N+A?T=h.top-N-A:T=B>=E?h.bottom+A:Math.max(10,h.top-N-A),m({top:T,left:x}),d(true);};react.useEffect(()=>{let h=b=>{l.current&&!l.current.contains(b.target)&&!i.current?.contains(b.target)&&(d(false),c(""));};if(s)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s]),react.useEffect(()=>{let h=b=>{b.key==="Escape"&&(d(false),c(""));};if(s)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[s]);let w=h=>{let b=e.some(v=>v.id===h.id);a(b?e.filter(v=>v.id!==h.id):[...e,h]);},f=t.filter(h=>h.name.toLowerCase().includes(p.toLowerCase())),g=e.slice(0,o),C=e.length-o;return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:i,onClick:()=>s?d(false):u(),className:"flex items-center gap-1 p-0.5 rounded transition-all hover:bg-white/10 hover:scale-105 active:scale-95",title:e.length>0?`${e.length} assigned`:"Assign users",children:e.length>0?jsxRuntime.jsxs("div",{className:"asakaa-avatar-group",children:[g.map(h=>jsxRuntime.jsx("div",{className:"asakaa-avatar",title:h.name,children:h.avatar?jsxRuntime.jsx("img",{src:h.avatar,alt:h.name,className:"asakaa-avatar-img"}):h.initials},h.id)),C>0&&jsxRuntime.jsxs("div",{className:"asakaa-avatar",children:["+",C]})]}):jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center transition-all",style:{background:"rgba(96, 165, 250, 0.15)",border:"1.5px solid rgba(96, 165, 250, 0.4)",color:"#60a5fa"},children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM4 14c0-2.21 1.79-4 4-4s4 1.79 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"13",y1:"5",x2:"13",y2:"9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"11",y1:"7",x2:"15",y2:"7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}),s&&jsxRuntime.jsx(nt,{children:jsxRuntime.jsxs("div",{ref:l,className:"user-selector-menu rounded-xl shadow-2xl border min-w-[300px]",style:{position:"fixed",top:`${n.top}px`,left:`${n.left}px`,maxHeight:"calc(100vh - 40px)",overflow:"hidden",display:"flex",flexDirection:"column",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, 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)",zIndex:99999},children:[jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.8))"},children:"Assign Users"})}),jsxRuntime.jsx("div",{className:"px-3 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("input",{type:"text",value:p,onChange:h=>c(h.target.value),placeholder:"Search users...",className:"w-full px-3 py-2.5 rounded-lg text-sm border outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.2))",color:"var(--modal-v2-text-primary, #ffffff)"},autoFocus:true})}),jsxRuntime.jsx("div",{className:"py-2 max-h-[300px] overflow-y-auto",children:f.length===0?jsxRuntime.jsx("div",{className:"px-4 py-3 text-sm text-center",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.6))"},children:"No users found"}):f.map(h=>{let b=e.some(v=>v.id===h.id);return jsxRuntime.jsxs("button",{onClick:()=>w(h),className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm transition-all active:scale-98",style:{background:"transparent"},onMouseEnter:v=>{v.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.1))";},onMouseLeave:v=>{v.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-[11px] font-bold flex-shrink-0 shadow-sm",style:{backgroundColor:h.color,color:"#fff"},children:h.avatar?jsxRuntime.jsx("img",{src:h.avatar,alt:h.name,className:"w-full h-full rounded-full object-cover"}):h.initials}),jsxRuntime.jsx("span",{className:"font-semibold flex-1 text-left truncate",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.95))"},children:h.name}),jsxRuntime.jsx("span",{className:"w-5 text-lg flex-shrink-0 text-right",style:{color:b?"#3b82f6":"transparent"},children:b?"\u2713":""})]},h.id)})}),e.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-3 border-t border-white/10",children:jsxRuntime.jsx("button",{onClick:()=>{a([]),d(false);},className:"w-full px-3 py-2.5 rounded-lg text-sm font-semibold transition-all hover:bg-red-600/30 active:scale-95 border",style:{color:"#f87171",borderColor:"rgba(248, 113, 113, 0.3)",background:"rgba(248, 113, 113, 0.08)"},children:"Clear All"})})]})})]})}function Ko(e,t,a){let r=new Map;e.forEach(c=>{if(c.dependencies&&Array.isArray(c.dependencies)){let n=c.dependencies.map(m=>{if(typeof m=="string")return m;let l=m;return l.taskId||l.targetId||""}).filter(Boolean);r.set(c.id,n);}});let o=r.get(a)||[];r.set(a,[...o,t]);let s=new Set,d=new Set,p=c=>{if(!s.has(c)){s.add(c),d.add(c);let n=r.get(c)||[];for(let m of n){if(!s.has(m)&&p(m))return true;if(d.has(m))return true}}return d.delete(c),false};return p(a)}function fo({currentCardId:e,dependencies:t=[],availableTasks:a,onChange:r,className:o,validateCircular:s=true,onCircularDependencyError:d}){let[p,c]=react.useState(false),[n,m]=react.useState(""),[l,i]=react.useState(t.length>0),[u,w]=react.useState({top:0,left:0}),[f,g]=react.useState(null),C=react.useRef(null),h=react.useRef(null),b=()=>{if(!h.current)return;let x=h.current.getBoundingClientRect(),B=window.innerHeight,E=window.innerWidth,T=300,H=l?380:120,k=4,O=x.right-T;O<10&&(O=x.left),O+T>E-10&&(O=E-T-10);let _=B-x.bottom,re=x.top,de;_>=H+k?de=x.bottom+k:re>=H+k?de=x.top-H-k:de=_>=re?x.bottom+k:Math.max(10,x.top-H-k),w({top:de,left:O}),c(true);};react.useEffect(()=>{if(!p||!h.current)return;let x=h.current.getBoundingClientRect(),B=window.innerHeight,E=window.innerWidth,T=300,H=l?380:120,k=4,O=x.right-T;O<10&&(O=x.left),O+T>E-10&&(O=E-T-10);let _=B-x.bottom,re=x.top,de;_>=H+k?de=x.bottom+k:re>=H+k?de=x.top-H-k:de=_>=re?x.bottom+k:Math.max(10,x.top-H-k),w({top:de,left:O});},[l,p]),react.useEffect(()=>{let x=B=>{C.current&&!C.current.contains(B.target)&&!h.current?.contains(B.target)&&(c(false),m(""));};if(p)return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[p]),react.useEffect(()=>{let x=B=>{B.key==="Escape"&&(c(false),m(""));};if(p)return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[p]);let v=x=>{let B=t.includes(x),E=a.find(T=>T.id===x);if(g(null),B){let T=t.filter(H=>H!==x);r(T),T.length===0&&i(false);}else {if(s&&Ko(a,x,e)){let H=`Cannot add "${E?.title||x}" as dependency - would create circular reference`;g(H),d?.(x,E?.title||x),setTimeout(()=>g(null),3e3);return}r([...t,x]),i(true);}},D=()=>{let x=!l;i(x),x||r([]);},N=a.filter(x=>x.id!==e).filter(x=>x.title.toLowerCase().includes(n.toLowerCase())||x.id.toLowerCase().includes(n.toLowerCase())),A=t.length>0?"#3B82F6":"#BDC3C7";return jsxRuntime.jsxs("div",{className:`relative ${o||""}`,children:[jsxRuntime.jsxs("button",{ref:h,onClick:()=>p?c(false):b(),className:"flex items-center gap-1 px-2 py-1 rounded transition-all hover:bg-white/5",title:t.length>0?`${t.length} dependencies`:"Add dependencies",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M7 9L9 7M11.5 3.5L10 2C8.89543 0.89543 7.10457 0.89543 6 2C4.89543 3.10457 4.89543 4.89543 6 6L7.5 7.5M4.5 12.5L6 14C7.10457 15.1046 8.89543 15.1046 10 14C11.1046 12.8954 11.1046 11.1046 10 10L8.5 8.5",stroke:A,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),t.length>0&&jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:A},children:t.length})]}),p&&jsxRuntime.jsx(nt,{children:jsxRuntime.jsxs("div",{ref:C,className:"dependencies-selector-menu rounded-xl shadow-2xl border min-w-[300px]",style:{position:"fixed",top:`${u.top}px`,left:`${u.left}px`,maxHeight:"calc(100vh - 40px)",overflow:"hidden",display:"flex",flexDirection:"column",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, 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)",zIndex:99999},children:[f&&jsxRuntime.jsxs("div",{className:"px-4 py-3 flex items-center gap-2",style:{background:"rgba(239, 68, 68, 0.15)",borderBottom:"1px solid rgba(239, 68, 68, 0.3)"},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M8 5V8M8 11H8.01M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z",stroke:"#ef4444",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:"#ef4444"},children:f})]}),jsxRuntime.jsx("div",{className:"px-4 py-2 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Task Dependencies"})}),jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",onClick:D,children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center transition-all",style:{background:l?"#3b82f6":"transparent",borderColor:l?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:l&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsx("span",{className:"text-sm font-medium",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.8))"},children:"Has dependencies"})]})}),l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsx("input",{type:"text",value:n,onChange:x=>m(x.target.value),placeholder:"Search by name or ID...",className:"w-full px-3 py-2 rounded-md text-xs border outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))",color:"var(--modal-v2-text-primary, #ffffff)"},autoFocus:true})}),jsxRuntime.jsx("div",{className:"py-2 max-h-[280px] overflow-y-auto",children:N.length===0?jsxRuntime.jsx("div",{className:"px-4 py-3 text-xs text-center",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:"No tasks found"}):N.map(x=>{let B=t.includes(x.id);return jsxRuntime.jsxs("button",{onClick:()=>v(x.id),className:"w-full px-4 py-2 flex items-start gap-3 text-sm transition-colors",style:{background:"transparent"},onMouseEnter:E=>{E.currentTarget.style.background="var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))";},onMouseLeave:E=>{E.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0 mt-0.5 transition-all",style:{background:B?"#3b82f6":"transparent",borderColor:B?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:B&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsxs("div",{className:"flex-1 text-left",children:[jsxRuntime.jsx("div",{className:"font-medium",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.9))"},children:x.title}),jsxRuntime.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:x.id})]})]},x.id)})})]}),t.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-2 border-t border-white/5",children:jsxRuntime.jsx("button",{onClick:()=>{r([]),i(false),c(false);},className:"w-full px-3 py-2 rounded-md text-xs font-medium transition-all hover:bg-red-600/20 border border-red-500/30",style:{color:"#E74C3C"},children:"Clear All Dependencies"})})]})})]})}var ja=react.memo(({card:e,render:t,onClick:a,isSelected:r,disableDrag:o,className:s,onUpdate:d,availableUsers:p=[],allCards:c=[]})=>{let{attributes:n,listeners:m,setNodeRef:l,transform:i,transition:u,isDragging:w}=sortable.useSortable({id:e.id,disabled:o,data:{type:"card",card:e}}),f={transform:Go.Transform.toString(i),transition:u};if(t)return jsxRuntime.jsx("div",{ref:l,style:f,...n,...m,onClick:()=>a?.(e),children:t(e)});let g=p.filter(v=>e.assignedUserIds?.includes(v.id)),C=e.progress===100,h=(e.attachments||[]).filter(v=>v.type.startsWith("image/")),b={...f,...e.color&&{borderTopWidth:"3px",borderTopStyle:"solid",borderTopColor:e.color}};return jsxRuntime.jsxs("div",{ref:l,style:b,className:y("asakaa-card",w&&"asakaa-card-dragging",r&&"ring-2 ring-asakaa-accent-blue",s),...n,...m,onClick:v=>{v.target.closest(".priority-selector, .date-picker, .user-selector, .dependencies-selector")||a?.(e);},children:[e.coverImage&&jsxRuntime.jsx("div",{className:"asakaa-card-cover mb-3",children:jsxRuntime.jsx("img",{src:e.coverImage,alt:`Cover for ${e.title}`,className:"w-full h-32 object-cover rounded-md",loading:"lazy",onError:v=>{v.currentTarget.style.display="none";}})}),h.length>0&&!e.coverImage&&jsxRuntime.jsx("div",{className:"asakaa-card-attachments mb-3",children:h.length===1&&h[0]?jsxRuntime.jsx("img",{src:h[0].url,alt:h[0].name,className:"w-full h-32 object-cover rounded-md",loading:"lazy",decoding:"async",style:{imageRendering:"auto",WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",transform:"translateZ(0)"},onError:v=>{v.currentTarget.style.display="none";}}):jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1",children:h.slice(0,4).map((v,D)=>jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("img",{src:v.url,alt:v.name,className:"w-full h-16 object-cover rounded",loading:"lazy",decoding:"async",style:{imageRendering:"auto",WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",transform:"translateZ(0)"},onError:N=>{N.currentTarget.style.display="none";}}),D===3&&h.length>4&&jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 rounded flex items-center justify-center",children:jsxRuntime.jsxs("span",{className:"text-white text-sm font-medium",children:["+",h.length-4]})})]},v.id))})}),jsxRuntime.jsx("h3",{className:"asakaa-card-title mb-2",style:{textDecoration:C?"line-through":"none",opacity:C?.6:1},children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"asakaa-card-description mb-3",children:e.description}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 mb-3 pt-1",children:[jsxRuntime.jsx("div",{onClick:v=>v.stopPropagation(),className:"priority-selector",children:jsxRuntime.jsx(kr,{priority:e.priority,onChange:v=>d?.(e.id,{priority:v})})}),jsxRuntime.jsx("div",{onClick:v=>v.stopPropagation(),className:"date-picker",children:jsxRuntime.jsx(uo,{startDate:e.startDate?typeof e.startDate=="string"?e.startDate:e.startDate.toISOString().split("T")[0]:void 0,endDate:e.endDate?typeof e.endDate=="string"?e.endDate:e.endDate.toISOString().split("T")[0]:void 0,onChange:(v,D)=>d?.(e.id,{startDate:v,endDate:D})})}),p.length>0&&jsxRuntime.jsx("div",{onClick:v=>v.stopPropagation(),className:"user-selector",children:jsxRuntime.jsx(Cr,{assignedUsers:g,availableUsers:p,onChange:v=>d?.(e.id,{assignedUserIds:v.map(D=>D.id)})})}),jsxRuntime.jsx("div",{onClick:v=>v.stopPropagation(),className:"dependencies-selector",children:jsxRuntime.jsx(fo,{currentCardId:e.id,dependencies:Array.isArray(e.dependencies)?e.dependencies.map(v=>typeof v=="string"?v:v.taskId):[],availableTasks:c,onChange:v=>d?.(e.id,{dependencies:v})})})]}),e.labels&&e.labels.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.labels.slice(0,3).map(v=>jsxRuntime.jsx("span",{className:"asakaa-label",children:v},v))}),typeof e.progress=="number"&&jsxRuntime.jsxs("div",{className:"mt-3 pt-2 border-t border-white/5",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-[#6B7280]",children:"Progreso"}),jsxRuntime.jsxs("span",{className:"text-[10px] font-medium",style:{color:"#3B82F6"},children:[Math.round(e.progress),"%"]})]}),jsxRuntime.jsx("div",{className:"h-1.5 rounded-full bg-white/5 overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(100,Math.max(0,e.progress))}%`,backgroundColor:"#3B82F6"}})})]})]})},(e,t)=>e.card.id===t.card.id&&e.card.title===t.card.title&&e.card.description===t.card.description&&e.card.position===t.card.position&&e.card.columnId===t.card.columnId&&e.card.priority===t.card.priority&&e.card.color===t.card.color&&e.card.progress===t.card.progress&&e.card.startDate===t.card.startDate&&e.card.endDate===t.card.endDate&&e.isSelected===t.isSelected&&JSON.stringify(e.card.labels)===JSON.stringify(t.card.labels)&&JSON.stringify(e.card.assignedUserIds)===JSON.stringify(t.card.assignedUserIds)&&JSON.stringify(e.card.dependencies)===JSON.stringify(t.card.dependencies)&&JSON.stringify(e.card.attachments?.map(a=>a.id))===JSON.stringify(t.card.attachments?.map(a=>a.id)));ja.displayName="Card";var Yo={todo:{label:"To Do",color:"#94a3b8",icon:"circle"},"in-progress":{label:"In Progress",color:"#60a5fa",icon:"circle-dot"},completed:{label:"Completed",color:"#34d399",icon:"check-circle"}},$l=({icon:e,color:t})=>e==="circle"?jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:"none"})}):e==="circle-dot"?jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:"none"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"3",fill:t})]}):jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:t,fillOpacity:"0.2"}),jsxRuntime.jsx("path",{d:"M5 8L7 10L11 6",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});function Ul({status:e="todo",onChange:t,className:a,customStatuses:r=[]}){let[o,s]=react.useState(false),[d,p]=react.useState({top:0,left:0}),c=react.useRef(null),n=react.useRef(null),m=[...Object.entries(Yo).map(([g,C])=>({id:g,label:C.label,color:C.color,icon:C.icon})),...r.filter(g=>!Object.keys(Yo).includes(g.id)).map(g=>({id:g.id,label:g.title,color:g.color||"#8B5CF6",icon:"circle-dot"}))],l=()=>{let g=Yo[e];if(g)return {...g,id:e};let C=r.find(h=>h.id===e);return C?{id:C.id,label:C.title,color:C.color||"#8B5CF6",icon:"circle-dot"}:{...Yo.todo,id:"todo"}},i=()=>{if(!n.current)return;let g=n.current.getBoundingClientRect(),C=window.innerHeight,h=window.innerWidth,b=180,v=280,D=4,N=g.right-b;N<10&&(N=g.left),N+b>h-10&&(N=h-b-10);let A=C-g.bottom,x=g.top,B;A>=v+D?B=g.bottom+D:x>=v+D?B=g.top-v-D:B=A>=x?g.bottom+D:Math.max(10,g.top-v-D),p({top:B,left:N}),s(true);};react.useEffect(()=>{let g=C=>{c.current&&!c.current.contains(C.target)&&!n.current?.contains(C.target)&&s(false);};if(o)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o]),react.useEffect(()=>{let g=C=>{C.key==="Escape"&&s(false);};if(o)return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[o]);let u=g=>{t(g),s(false);},w=l(),f=w.color;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:n,onClick:()=>o?s(false):i(),className:"flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95",style:{background:`${f}10`,boxShadow:`0 0 0 2px ${f}30 inset`},title:w.label,children:jsxRuntime.jsx($l,{icon:w.icon,color:f})}),o&&jsxRuntime.jsx(nt,{children:jsxRuntime.jsxs("div",{ref:c,className:"status-selector-menu",style:{position:"fixed",top:`${d.top}px`,left:`${d.left}px`,zIndex:99999,minWidth:"180px",maxHeight:"calc(100vh - 40px)",overflowY:"auto",borderRadius:"8px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-1.5 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Status"})}),jsxRuntime.jsx("div",{className:"py-1",children:m.map(g=>jsxRuntime.jsxs("button",{onClick:()=>u(g.id),className:"w-full px-3 py-2 flex items-center gap-2.5 text-sm font-medium transition-all active:scale-[0.98] status-option",style:{color:g.color,background:"transparent"},onMouseEnter:C=>{C.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:C=>{C.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx($l,{icon:g.icon,color:g.color}),jsxRuntime.jsx("span",{className:"font-semibold",children:g.label}),e===g.id&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},g.id))})]})})]})}function Wl({columnTitle:e,onRename:t,onDelete:a,isDeletable:r=false,className:o}){let[s,d]=react.useState(false),[p,c]=react.useState(false),[n,m]=react.useState(e),[l,i]=react.useState({top:0,left:0}),u=react.useRef(null),w=react.useRef(null),f=react.useRef(null);react.useEffect(()=>{if(s&&w.current){let b=w.current.getBoundingClientRect();i({top:b.bottom+window.scrollY+8,left:b.left+window.scrollX});}},[s]),react.useEffect(()=>{let b=v=>{u.current&&!u.current.contains(v.target)&&!w.current?.contains(v.target)&&(d(false),c(false));};if(s)return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[s]),react.useEffect(()=>{let b=v=>{v.key==="Escape"&&(d(false),c(false),m(e));};if(s)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[s,e]),react.useEffect(()=>{p&&f.current&&(f.current.focus(),f.current.select());},[p]);let g=()=>{c(true),m(e);},C=()=>{let b=n.trim();b&&b!==e&&t(b),c(false),d(false),m(e);},h=b=>{b.key==="Enter"?C():b.key==="Escape"&&(c(false),m(e));};return jsxRuntime.jsxs("div",{className:`relative ${o||""}`,children:[jsxRuntime.jsx("button",{ref:w,onClick:()=>d(!s),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-white/10",title:"Column options","aria-label":"Column menu",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"3",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"13",r:"1.5",fill:"currentColor"})]})}),s&&jsxRuntime.jsx(nt,{children:jsxRuntime.jsx("div",{ref:u,className:"fixed rounded-xl shadow-2xl border min-w-[200px]",style:{top:`${l.top}px`,left:`${l.left}px`,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)",zIndex:99999},children:p?jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsx("label",{className:"text-xs font-bold text-white/80 uppercase tracking-wider block mb-2",children:"Rename Column"}),jsxRuntime.jsx("input",{ref:f,type:"text",value:n,onChange:b=>m(b.target.value),onKeyDown:h,onBlur:C,className:"w-full px-3 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/50 outline-none focus:border-blue-500/50 transition-all",placeholder:"Column name",maxLength:50})]}):jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsxs("button",{onClick:g,className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm text-white/90 hover:bg-white/10 transition-all",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M11.5 1.5L14.5 4.5L5 14H2V11L11.5 1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-medium",children:"Rename"})]}),r&&a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"h-px bg-white/10 mx-2 my-1"}),jsxRuntime.jsxs("button",{onClick:()=>{a(),d(false);},className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm text-red-400 hover:bg-red-500/10 transition-all",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M2 4H14M5 4V2.5C5 2.22386 5.22386 2 5.5 2H10.5C10.7761 2 11 2.22386 11 2.5V4M12.5 4V13.5C12.5 13.7761 12.2761 14 12 14H4C3.72386 14 3.5 13.7761 3.5 13.5V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M6.5 7V11M9.5 7V11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),jsxRuntime.jsx("span",{className:"font-medium",children:"Delete"})]})]})]})})})]})}var _r=react.memo(({column:e,cards:t,renderColumn:a,renderCard:r,renderHeader:o,renderEmptyState:s,onCardClick:d,onCardUpdate:p,availableUsers:c,allCards:n,enableVirtualization:m,cardHeight:l=120,isCollapsed:i,onToggleCollapse:u,onColumnRename:w,onColumnDelete:f,isDeletable:g=false,className:C})=>{let{setNodeRef:h,isOver:b}=core$1.useDroppable({id:e.id,data:{type:"column",column:e}}),v=react.useRef(null),D=m??ul(t.length),N=reactVirtual.useVirtualizer({count:t.length,getScrollElement:()=>v.current,estimateSize:()=>l,enabled:D});if(a)return jsxRuntime.jsx("div",{ref:h,className:C,children:a(e,t)});let x=(()=>{if(!e.wipLimit)return {state:"none",percentage:0};let T=t.length/e.wipLimit*100;return t.length>e.wipLimit?{state:"exceeded",percentage:T}:T>=80?{state:"warning",percentage:T}:T>=60?{state:"approaching",percentage:T}:{state:"ok",percentage:T}})(),B=x.state==="exceeded",E=()=>"asakaa-column-count";return jsxRuntime.jsxs("div",{ref:h,className:y("asakaa-column",b&&"ring-2 ring-asakaa-accent-blue",B&&"ring-2 ring-asakaa-accent-red",C),children:[o?o(e,t.length):jsxRuntime.jsxs("div",{className:"asakaa-column-header group",children:[jsxRuntime.jsx("h2",{className:"asakaa-column-title",children:e.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:y(E()),children:[t.length,e.wipLimit&&` / ${e.wipLimit}`]}),e.wipLimit&&x.state!=="none"&&jsxRuntime.jsxs("span",{className:"text-xs font-medium flex items-center",title:`${x.percentage.toFixed(0)}% capacity${e.wipLimitType==="hard"?" (Hard limit - blocks new cards)":" (Soft limit - shows warning)"}`,children:[x.state==="exceeded"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"#EF4444",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M5 5L11 11M11 5L5 11",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}),x.state==="warning"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M8 1L15 14H1L8 1Z",fill:"#F59E0B",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M8 6V9M8 11V11.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})]}),x.state==="approaching"&&jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M8 1L10 7H14L10 10L12 16L8 12L4 16L6 10L2 7H6L8 1Z",fill:"#FB923C",opacity:"0.9"})}),x.state==="ok"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"#10B981",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M5 8L7 10L11 6",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})]}),(w||f)&&jsxRuntime.jsx(Wl,{columnTitle:e.title,onRename:T=>w?.(e.id,T),onDelete:f?()=>f(e.id):void 0,isDeletable:g}),u&&jsxRuntime.jsx("button",{onClick:u,className:"text-asakaa-text-tertiary hover:text-asakaa-text-primary","aria-label":i?"Expand column":"Collapse column",children:i?"\u25B6":"\u25BC"})]})]}),!i&&jsxRuntime.jsx("div",{ref:v,className:"asakaa-column-cards",style:{maxHeight:D?"600px":void 0},children:jsxRuntime.jsx(sortable.SortableContext,{items:t.map(T=>T.id),strategy:sortable.verticalListSortingStrategy,children:t.length===0?s?s(e):jsxRuntime.jsx("div",{className:"asakaa-drop-zone asakaa-empty",children:jsxRuntime.jsx("p",{children:"Drop cards here"})}):D?jsxRuntime.jsx("div",{style:{height:`${N.getTotalSize()}px`,position:"relative"},children:N.getVirtualItems().map(T=>{let H=t[T.index];return H?jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${T.start}px)`},children:jsxRuntime.jsx(ja,{card:H,render:r,onClick:d,onUpdate:p,availableUsers:c,allCards:n})},H.id):null})}):t.map(T=>jsxRuntime.jsx(ja,{card:T,render:r,onClick:d,onUpdate:p,availableUsers:c,allCards:n},T.id))})})]})});_r.displayName="Column";function is({title:e,onSave:t,className:a}){let[r,o]=react.useState(false),[s,d]=react.useState(e),p=react.useRef(null);react.useEffect(()=>{r&&p.current&&(p.current.focus(),p.current.select());},[r]);let c=()=>{let m=s.trim();m&&m!==e?t(m):d(e),o(false);},n=m=>{m.key==="Enter"?c():m.key==="Escape"&&(d(e),o(false));};return r?jsxRuntime.jsx("input",{ref:p,type:"text",value:s,onChange:m=>d(m.target.value),onBlur:c,onKeyDown:n,className:y("asakaa-column-title bg-transparent border-b-2 border-blue-500","outline-none px-1 -ml-1",a),maxLength:50}):jsxRuntime.jsx("h2",{className:y("asakaa-column-title cursor-pointer",a),onClick:()=>o(true),title:"Click to edit",children:e})}function jl(e){if("title"in e&&!("name"in e)){let t=e;return {id:t.id,name:t.title,startDate:t.startDate?new Date(t.startDate):void 0,endDate:t.endDate?new Date(t.endDate):void 0,progress:t.progress||0,status:t.columnId,priority:t.priority?.toLowerCase(),assignees:[],dependencies:Array.isArray(t.dependencies)?t.dependencies.map(a=>typeof a=="string"?a:a.taskId):[],tags:t.tags,subtasks:t.subtasks?.map(a=>({id:a.id,name:a.title,progress:a.completed?100:0,startDate:new Date,endDate:new Date})),color:t.color}}return e}function Mm(e,t){return {...t,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,priority:e.priority?.toUpperCase(),tags:e.tags}}function ds({task:e,isOpen:t,onClose:a,onTaskUpdate:r,onCardUpdate:o,theme:s="dark",locale:d="es",availableUsers:p=[]}){let c=s==="dark",n=e&&"title"in e&&!("name"in e),m=e,[l,i]=react.useState(e?jl(e):null),[u,w]=react.useState(false),[f,g]=react.useState(false),[C,h]=react.useState(null),[b,v]=react.useState(new Date),[D,N]=react.useState(false);react.useEffect(()=>{e&&i(jl(e));},[e?.id]);let A=react.useCallback(k=>{i(k),n&&o&&m?o(Mm(k,m)):r&&r(k);},[n,m,o,r]),x=react.useCallback(()=>{w(false),g(false),h(null);},[]),B=react.useCallback((k,O)=>{if(!l)return;let _={...l,[k]:O};A(_);},[l,A]),E=react.useCallback(k=>{if(!l)return;let O=l.progress||0;k==="completed"?O=100:k==="in-progress"&&O===0?O=10:k==="todo"&&(O=0);let _={...l,status:k,progress:O};A(_),w(false);},[l,A]),T=react.useCallback((k,O)=>{if(!l)return;let _={...l,startDate:k,endDate:O};A(_);},[l,A]),H=react.useCallback(()=>{let k=b.getFullYear(),O=b.getMonth(),_=new Date(k,O,1),de=new Date(k,O+1,0).getDate(),we=_.getDay(),Ne=[],R=new Date(k,O,0).getDate();for(let z=we-1;z>=0;z--)Ne.push({date:new Date(k,O-1,R-z),isCurrentMonth:false});for(let z=1;z<=de;z++)Ne.push({date:new Date(k,O,z),isCurrentMonth:true});let F=42-Ne.length;for(let z=1;z<=F;z++)Ne.push({date:new Date(k,O+1,z),isCurrentMonth:false});return Ne},[b]);return !t||!l?null:jsxRuntime.jsx(framerMotion.AnimatePresence,{children:t&&l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:a,className:"fixed inset-0 bg-black/50 z-40"}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},className:y("fixed inset-4 md:inset-8 lg:inset-12 rounded-xl shadow-2xl z-50 flex overflow-hidden",c?"bg-[#1A1D25]":"bg-white"),children:jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxRuntime.jsxs("div",{className:y("px-6 py-3 border-b flex items-center gap-3",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Circle,{className:y("w-4 h-4",c?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("span",{className:y("text-xs px-2 py-0.5 rounded",c?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:[d==="es"?"Tarea":"Task"," \u2228"]}),jsxRuntime.jsx("span",{className:y("text-xs font-mono",c?"text-[#6B7280]":"text-gray-400"),children:l.id.slice(0,8)}),jsxRuntime.jsxs("button",{className:y("flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-colors",c?"bg-purple-500/20 text-purple-400 hover:bg-purple-500/30":"bg-purple-100 text-purple-700 hover:bg-purple-200"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-3 h-3"}),"Ask AI"]})]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:y("p-1.5 rounded transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.Maximize2,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{className:y("p-1.5 rounded transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{onClick:a,className:y("p-1.5 rounded transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{let k=l.progress===100?0:100,_={...l,progress:k,status:k===100?"completed":"todo"};A(_);},className:y("mt-1 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors",l.progress===100?"bg-green-500 border-green-500":c?"border-white/30 hover:border-white/50":"border-gray-300 hover:border-gray-400"),children:l.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("h2",{className:y("text-xl font-semibold flex-1",l.progress===100?"line-through text-[#6B7280]":c?"text-white":"text-gray-900"),children:l.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:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Estado":"Status"}),jsxRuntime.jsx("button",{onClick:()=>{x(),w(!u);},className:y("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",l.progress===100||l.status==="completed"?"bg-green-500/20 text-green-400":l.progress&&l.progress>0||l.status==="in-progress"?"bg-blue-500/20 text-blue-400":c?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:l.progress===100||l.status==="completed"?d==="es"?"COMPLETADO":"DONE":l.progress&&l.progress>0||l.status==="in-progress"?d==="es"?"EN PROGRESO":"IN PROGRESS":d==="es"?"POR HACER":"TO DO"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:u&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>w(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:y("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"todo",label:d==="es"?"Por hacer":"To Do",color:"bg-gray-400"},{id:"in-progress",label:d==="es"?"En progreso":"In Progress",color:"bg-blue-500"},{id:"completed",label:d==="es"?"Completado":"Done",color:"bg-green-500"}].map(k=>jsxRuntime.jsxs("button",{onClick:()=>E(k.id),className:y("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",l.status===k.id&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:y("w-2 h-2 rounded-full",k.color)}),jsxRuntime.jsx("span",{className:c?"text-white":"text-gray-900",children:k.label})]},k.id))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.User,{className:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Asignados":"Assignees"}),l.assignees&&l.assignees.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[l.assignees.slice(0,3).map((k,O)=>jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:k.color||"#8B5CF6"},title:k.name,children:k.initials||k.name.slice(0,2).toUpperCase()},O)),l.assignees.length>3&&jsxRuntime.jsxs("span",{className:y("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:["+",l.assignees.length-3]})]}):jsxRuntime.jsx("span",{className:y("text-sm",c?"text-[#6B7280]":"text-gray-400"),children:d==="es"?"Sin asignar":"Unassigned"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Fechas":"Dates"}),jsxRuntime.jsxs("button",{onClick:()=>{h(C?null:"start"),v(l.startDate||new Date);},className:y("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-white":"bg-gray-100 hover:bg-gray-200 text-gray-900"),children:[l.startDate?.toLocaleDateString(d==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(d==="es"?"Inicio":"Start"),jsxRuntime.jsx("span",{className:y("mx-1",c?"text-[#6B7280]":"text-gray-400"),children:"\u2192"}),l.endDate?.toLocaleDateString(d==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(d==="es"?"Fin":"End")]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:C&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>h(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:y("absolute left-0 top-full mt-2 z-50 rounded-xl shadow-2xl overflow-hidden flex",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:k=>k.stopPropagation(),children:[jsxRuntime.jsx("div",{className:y("w-44 py-2 border-r",c?"border-white/10":"border-gray-200"),children:(()=>{let k=new Date,O=new Date(k);O.setDate(k.getDate()+1);let _=new Date(k);_.setDate(k.getDate()+7);let re=new Date(k);return re.setDate(k.getDate()+14),[{label:d==="es"?"Hoy":"Today",date:k},{label:d==="es"?"Ma\xF1ana":"Tomorrow",date:O},{label:d==="es"?"Pr\xF3xima semana":"Next week",date:_},{label:d==="es"?"2 semanas":"2 weeks",date:re}].map((de,we)=>jsxRuntime.jsxs("button",{className:y("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",c?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{C==="start"?(T(de.date,l.endDate),h("end")):(T(l.startDate,de.date),h(null));},children:[jsxRuntime.jsx("span",{children:de.label}),jsxRuntime.jsx("span",{className:y("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:de.date.toLocaleDateString(d==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})})]},we))})()}),jsxRuntime.jsxs("div",{className:"p-4 w-[280px]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:y("text-sm font-medium",c?"text-white":"text-gray-900"),children:C==="start"?d==="es"?"Fecha inicio":"Start date":d==="es"?"Fecha fin":"End date"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>v(new Date(b.getFullYear(),b.getMonth()-1)),className:y("p-1 rounded",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),jsxRuntime.jsx("span",{className:y("text-sm min-w-[100px] text-center",c?"text-white":"text-gray-900"),children:b.toLocaleDateString(d==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>v(new Date(b.getFullYear(),b.getMonth()+1)),className:y("p-1 rounded",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(d==="es"?["L","M","M","J","V","S","D"]:["S","M","T","W","T","F","S"]).map((k,O)=>jsxRuntime.jsx("div",{className:y("text-xs text-center py-1",c?"text-[#6B7280]":"text-gray-400"),children:k},O))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:H().map((k,O)=>{let _=k.date.toDateString()===new Date().toDateString(),re=l.startDate?.toDateString()===k.date.toDateString(),de=l.endDate?.toDateString()===k.date.toDateString(),we=l.startDate&&l.endDate&&k.date>=l.startDate&&k.date<=l.endDate;return jsxRuntime.jsx("button",{onClick:()=>{C==="start"?(T(k.date,l.endDate&&k.date>l.endDate?k.date:l.endDate),h("end")):(T(l.startDate&&k.date<l.startDate?k.date:l.startDate,k.date),h(null));},className:y("w-8 h-8 text-xs rounded-lg transition-colors",!k.isCurrentMonth&&(c?"text-[#4B5563]":"text-gray-300"),k.isCurrentMonth&&(c?"text-white":"text-gray-900"),_&&"ring-1 ring-blue-500",(re||de)&&"bg-blue-500 text-white",we&&!re&&!de&&(c?"bg-blue-500/20":"bg-blue-100"),c?"hover:bg-white/10":"hover:bg-gray-100"),children:k.date.getDate()},O)})})]})]})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Flag,{className:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Prioridad":"Priority"}),jsxRuntime.jsx("button",{onClick:()=>{x(),g(!f);},className:y("text-xs px-2 py-1 rounded font-medium transition-all hover:ring-2 hover:ring-white/20",l.priority==="high"||l.priority==="urgent"?"bg-red-500/20 text-red-400":l.priority==="medium"?"bg-yellow-500/20 text-yellow-400":l.priority==="low"?"bg-green-500/20 text-green-400":c?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:l.priority?l.priority==="high"||l.priority==="urgent"?d==="es"?"Alta":"High":l.priority==="medium"?d==="es"?"Media":"Medium":d==="es"?"Baja":"Low":d==="es"?"Sin prioridad":"No priority"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>g(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:y("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"urgent",label:d==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:d==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:d==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:d==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:d==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(k=>jsxRuntime.jsxs("button",{onClick:()=>{B("priority",k.id),g(false);},className:y("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",l.priority===k.id&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:y("w-2 h-2 rounded-full",k.color)}),jsxRuntime.jsx("span",{className:c?"text-white":"text-gray-900",children:k.label})]},k.id||"none"))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Clock,{className:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Duraci\xF3n":"Duration"}),jsxRuntime.jsx("span",{className:y("text-sm",c?"text-white":"text-gray-900"),children:l.startDate&&l.endDate?`${Math.ceil((l.endDate.getTime()-l.startDate.getTime())/(1e3*60*60*24))} ${d==="es"?"d\xEDas":"days"}`:d==="es"?"Sin definir":"Not set"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:y("w-4 h-4 rounded-full border-2",c?"border-[#6B7280]":"border-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Progreso":"Progress"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[D?jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:l.progress||0,onChange:k=>{let O=parseInt(k.target.value),_=l.status;O===100?_="completed":O>0?_="in-progress":_="todo";let re={...l,progress:O,status:_};A(re);},onBlur:()=>N(false),className:y("flex-1 max-w-[120px] h-2 rounded-full appearance-none cursor-pointer",c?"bg-white/10":"bg-gray-200","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[#3B82F6] [&::-webkit-slider-thumb]:cursor-pointer"),autoFocus:true}):jsxRuntime.jsx("button",{onClick:()=>N(true),className:y("flex-1 h-2 rounded-full overflow-hidden max-w-[120px] cursor-pointer hover:ring-2 hover:ring-white/20 transition-all",c?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:y("h-full rounded-full transition-all",l.progress===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${l.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:y("text-sm font-medium min-w-[40px]",c?"text-white":"text-gray-900"),children:[l.progress||0,"%"]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Tag,{className:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Etiquetas":"Tags"}),l.tags&&l.tags.length>0?jsxRuntime.jsx("div",{className:"flex gap-1 flex-wrap",children:l.tags.map((k,O)=>jsxRuntime.jsx("span",{className:"text-xs px-2 py-0.5 rounded",style:{backgroundColor:`${k.color}20`,color:k.color},children:k.name},O))}):jsxRuntime.jsx("span",{className:y("text-sm",c?"text-[#6B7280]":"text-gray-400"),children:d==="es"?"Vac\xEDo":"Empty"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Link2,{className:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Relaciones":"Relations"}),jsxRuntime.jsx("span",{className:y("text-sm",c?"text-[#6B7280]":"text-gray-400"),children:l.dependencies&&l.dependencies.length>0?`${l.dependencies.length} ${d==="es"?"dependencias":"dependencies"}`:d==="es"?"Vac\xEDo":"Empty"})]})]}),jsxRuntime.jsxs("div",{className:y("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("button",{className:y("flex items-center gap-2 text-sm transition-colors",c?"text-[#9CA3AF] hover:text-white":"text-gray-500 hover:text-gray-900"),children:[jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),d==="es"?"Agregar descripci\xF3n":"Add description"]}),jsxRuntime.jsxs("button",{className:y("flex items-center gap-2 text-sm mt-2 transition-colors",c?"text-purple-400 hover:text-purple-300":"text-purple-600 hover:text-purple-700"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4"}),d==="es"?"Escribe con IA":"Write with AI"]})]}),jsxRuntime.jsxs("div",{className:y("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:y("text-sm font-semibold mb-3",c?"text-white":"text-gray-900"),children:d==="es"?"Campos personalizados":"Custom fields"}),jsxRuntime.jsxs("button",{className:y("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),d==="es"?"Crea un campo en esta lista":"Create a field in this list"]})]}),jsxRuntime.jsxs("div",{className:y("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:y("text-sm font-semibold mb-3",c?"text-white":"text-gray-900"),children:d==="es"?"Subtareas":"Subtasks"}),l.subtasks&&l.subtasks.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-3",children:l.subtasks.map(k=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:y("w-4 h-4 rounded border flex items-center justify-center cursor-pointer",k.progress===100?"bg-green-500 border-green-500":c?"border-white/20 hover:border-white/40":"border-gray-300 hover:border-gray-400"),children:k.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:y("text-sm",k.progress===100?"line-through text-[#6B7280]":c?"text-white":"text-gray-900"),children:k.name})]},k.id))}),jsxRuntime.jsxs("button",{className:y("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),d==="es"?"Agregar subtarea":"Add subtask"]})]})]})]})})]})})}function ps(){let[e,t]=react.useState(()=>core.dragStore.getState());react.useEffect(()=>core.dragStore.subscribe(o=>{t(o);}),[]);let a=react.useCallback(r=>{core.dragStore.setState(r);},[]);return [e,a]}function ir({board:e,callbacks:t,onCardClick:a,renderProps:r,config:o,availableUsers:s=[],className:d,style:p,isLoading:c,error:n,children:m}){let[l,i]=ps(),[u,w]=react.useState(null),f=o?.theme||"dark",g=f==="dark"||f==="neutral",C=g?"dark":"",h=react.useCallback((k,O)=>{t.onCardUpdate?.(k,O);},[t]),b=react.useCallback((k,O)=>{t.onColumnUpdate?.(k,{title:O});},[t]),v=react.useCallback(k=>{t.onColumnDelete?.(k);},[t]),D=["todo","in-progress","completed"],N=core$1.useSensors(core$1.useSensor(core$1.PointerSensor,{activationConstraint:{distance:8}}),core$1.useSensor(core$1.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),A=react.useMemo(()=>{let k=new Map;return e.columns.forEach(O=>{let _=O.cardIds.map(re=>e.cards.find(de=>de.id===re)).filter(re=>re!==void 0).sort((re,de)=>re.position-de.position);k.set(O.id,_);}),k},[e.cards,e.columns]),x=react.useCallback(k=>{let{active:O}=k,_=e.cards.find(re=>re.id===O.id);_&&i({isDragging:true,draggedCardId:_.id,sourceColumnId:_.columnId,targetColumnId:_.columnId});},[e.cards,i]),B=react.useCallback(k=>{let{active:O,over:_}=k;if(!_||!e.cards.find(we=>we.id===O.id))return;let de=null;_.data.current?.type==="column"?de=_.id:_.data.current?.type==="card"&&(de=e.cards.find(Ne=>Ne.id===_.id)?.columnId||null),de&&de!==l.targetColumnId&&i({...l,targetColumnId:de});},[e.cards,l,i]),E=react.useCallback(async k=>{let{active:O,over:_}=k;if(i({isDragging:false,draggedCardId:null,sourceColumnId:null,targetColumnId:null}),!_)return;let re=e.cards.find(R=>R.id===O.id);if(!re)return;let de,we;if(_.data.current?.type==="column"){de=_.id;let R=A.get(de)||[];we=Zn(R,0);}else {let R=e.cards.find(M=>M.id===_.id);if(!R)return;de=R.columnId;let F=A.get(de)||[],z=F.findIndex(M=>M.id===_.id);we=Zn(F,z);}let Ne=e.columns.find(R=>R.id===de);if(Ne&&Ne.wipLimit&&Ne.wipLimitType==="hard"){let R=A.get(de)||[];if(re.columnId!==de&&R.length>=Ne.wipLimit){t.onWipLimitExceeded?.(Ne,re);return}}(re.columnId!==de||re.position!==we)&&await t.onCardMove?.(re.id,de,we);},[e.cards,e.columns,A,t,i]),T=react.useCallback(k=>{w(k),a?.(k);},[a]),H=react.useCallback(k=>{t.onCardUpdate?.(k.id,k),w(k);},[t]);return c?jsxRuntime.jsx("div",{className:y("asakaa-board",C,d),style:p,children:jsxRuntime.jsx(Gm,{columnCount:3})}):n?jsxRuntime.jsx("div",{className:y("asakaa-board",C,d),style:p,children:jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full h-64",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-asakaa-accent-red text-lg font-semibold mb-2",children:"Error loading board"}),jsxRuntime.jsx("p",{className:"text-asakaa-text-secondary text-sm",children:typeof n=="string"?n:n.message})]})})}):jsxRuntime.jsxs(Tl,{themeName:f,children:[jsxRuntime.jsxs(core$1.DndContext,{sensors:N,collisionDetection:core$1.closestCorners,onDragStart:x,onDragOver:B,onDragEnd:E,children:[jsxRuntime.jsxs("div",{className:y("asakaa-board",C,d),style:p,"data-theme":f,children:[e.columns.sort((k,O)=>k.position-O.position).map(k=>{let O=A.get(k.id)||[],_=!D.includes(k.id);return jsxRuntime.jsx(_r,{column:k,cards:O,renderCard:r?.renderCard,renderColumn:r?.renderColumn,renderHeader:r?.renderColumnHeader,renderEmptyState:r?.renderEmptyState,onCardClick:T,onCardUpdate:h,onColumnRename:b,onColumnDelete:v,isDeletable:_,availableUsers:s,allCards:e.cards,enableVirtualization:o?.enableVirtualization,cardHeight:o?.cardHeight},k.id)}),m]}),jsxRuntime.jsx(core$1.DragOverlay,{children:l.draggedCardId?jsxRuntime.jsx(ja,{card:e.cards.find(k=>k.id===l.draggedCardId),render:r?.renderCardOverlay||r?.renderCard,disableDrag:true,className:"opacity-90 rotate-3 shadow-2xl"}):null})]}),jsxRuntime.jsx(ds,{task:u,isOpen:!!u,onClose:()=>w(null),onCardUpdate:H,theme:g?"dark":"light",locale:o?.locale==="es"?"es":"en"})]})}function Gm({columnCount:e}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((t,a)=>jsxRuntime.jsxs("div",{className:"asakaa-column",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-8 mb-3"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-24"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-32"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-28"})]})]},a))})}var Ym={bgGrid:"#0F1117",bgSecondary:"#1A1D25",border:"rgba(255, 255, 255, 0.1)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"#E5E7EB",textSecondary:"#9CA3AF",textTertiary:"#6B7280",accent:"#3B82F6",accentLight:"rgba(59, 130, 246, 0.15)",hoverBg:"rgba(255, 255, 255, 0.05)"},qm={bgGrid:"#FFFFFF",bgSecondary:"#F9FAFB",border:"rgba(0, 0, 0, 0.1)",borderLight:"rgba(0, 0, 0, 0.05)",textPrimary:"#111827",textSecondary:"#6B7280",textTertiary:"#9CA3AF",accent:"#3B82F6",accentLight:"rgba(59, 130, 246, 0.1)",hoverBg:"rgba(0, 0, 0, 0.05)"},Xm={newTask:"Nueva Tarea",selectColumn:"Seleccionar columna",export:"Exportar",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"},Jm={newTask:"New Task",selectColumn:"Select column",export:"Export",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"};function Zm({columns:e,onSelect:t,theme:a,t:r,createTaskLabel:o}){let[s,d]=react.useState(false),p=react.useRef(null);react.useEffect(()=>{let n=m=>{p.current&&!p.current.contains(m.target)&&d(false);};return s&&document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[s]);let c=n=>{t(n),d(false);};return jsxRuntime.jsxs("div",{ref:p,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>d(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(59, 130, 246, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:o||r.newTask}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-48 rounded-lg overflow-hidden z-50",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wider",style:{color:a.textTertiary},children:r.selectColumn}),e.sort((n,m)=>n.position-m.position).map((n,m)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>c(n.id),className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:m<e.length-1?`1px solid ${a.borderLight}`:"none"},whileHover:{backgroundColor:a.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:m*.03},children:[jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:n.color||a.accent}}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:a.textPrimary},children:n.title}),jsxRuntime.jsxs("div",{className:"text-[10px] truncate",style:{color:a.textTertiary},children:[n.cardIds.length," ",n.cardIds.length===1?"tarea":"tareas"]})]})]},n.id))]})})})]})}function Qm({theme:e,t,onExportCSV:a,onExportJSON:r,onExportExcel:o}){let[s,d]=react.useState(false),[p,c]=react.useState(null),n=react.useRef(null);if(react.useEffect(()=>{let u=w=>{n.current&&!n.current.contains(w.target)&&d(false);};return s&&document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[s]),!(a||r||o))return null;let l=[{id:"csv",label:t.exportCSV,description:"Comma-separated",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:a},{id:"json",label:t.exportJSON,description:"Data",icon:jsxRuntime.jsx(lucideReact.FileJson,{className:"w-4 h-4"}),handler:r},{id:"excel",label:t.exportExcel,description:"Spreadsheet",icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-4 h-4"}),handler:o}].filter(u=>u.handler),i=async(u,w)=>{if(w){c(u);try{await w();}catch(f){console.error(`Export ${u} failed:`,f);}finally{c(null),d(false);}}};return jsxRuntime.jsxs("div",{ref:n,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>d(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{backgroundColor:s?e.accent:e.bgSecondary,border:`1px solid ${s?e.accent:e.borderLight}`,color:s?"#FFFFFF":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{scale:1.02,backgroundColor:e.accent,color:"#FFFFFF"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:t.export}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-44 rounded-lg overflow-hidden z-50",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxRuntime.jsx("div",{className:"py-1",children:l.map((u,w)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>i(u.id,u.handler),disabled:p!==null,className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:w<l.length-1?`1px solid ${e.borderLight}`:"none"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:w*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:p===u.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-4 h-4"})}):u.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:e.textPrimary},children:u.label}),jsxRuntime.jsx("div",{className:"text-[10px] truncate",style:{color:e.textTertiary},children:u.description})]})]},u.id))})})})]})}function eu({onClick:e,label:t}){return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:e,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(59, 130, 246, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:t})]})}function us({columns:e,onCreateTask:t,createTaskLabel:a,theme:r="dark",locale:o="es",useColumnSelector:s=false,onExportCSV:d,onExportJSON:p,onExportExcel:c,translations:n}){let m=r==="dark"?Ym:qm,l={...o==="es"?Xm:Jm,...n},i=d||p||c;return jsxRuntime.jsx("div",{className:"h-12 px-4 flex items-center justify-end border-b sticky top-0 z-10",style:{backgroundColor:m.bgGrid,borderColor:m.border},children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[i&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Qm,{theme:m,t:l,onExportCSV:d,onExportJSON:p,onExportExcel:c}),t&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:m.borderLight}})]}),t&&(s?jsxRuntime.jsx(Zm,{columns:e,onSelect:t,theme:m,t:l,createTaskLabel:a}):jsxRuntime.jsx(eu,{onClick:()=>t(),label:a||l.newTask}))]})})}function fs({onAddColumn:e,className:t,placeholder:a="Nombre de la columna...",buttonLabel:r="Agregar Columna",disabled:o=false}){let[s,d]=react.useState(false),[p,c]=react.useState(""),n=react.useCallback(()=>{let i=p.trim();i&&(e(i),c(""),d(false));},[p,e]),m=react.useCallback(i=>{i.key==="Enter"?(i.preventDefault(),n()):i.key==="Escape"&&(c(""),d(false));},[n]),l=react.useCallback(()=>{setTimeout(()=>{p.trim()||d(false);},150);},[p]);return s?jsxRuntime.jsx("div",{className:y("asakaa-add-column asakaa-add-column--editing",t),children:jsxRuntime.jsxs("div",{className:"asakaa-add-column__input-wrapper",children:[jsxRuntime.jsx("input",{type:"text",value:p,onChange:i=>c(i.target.value),onKeyDown:m,onBlur:l,placeholder:a,autoFocus:true,className:"asakaa-add-column__input"}),jsxRuntime.jsxs("div",{className:"asakaa-add-column__actions",children:[jsxRuntime.jsx("button",{onClick:n,disabled:!p.trim(),className:"asakaa-add-column__submit",type:"button",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})}),jsxRuntime.jsx("button",{onClick:()=>{c(""),d(false);},className:"asakaa-add-column__cancel",type:"button",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})}):jsxRuntime.jsx("div",{className:y("asakaa-add-column",t),children:jsxRuntime.jsxs("button",{onClick:()=>d(true),disabled:o,className:"asakaa-add-column__button",type:"button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),r]})})}function hs({columnId:e,onAddCard:t,availableUsers:a=[],className:r,placeholder:o,buttonLabel:s,disabled:d=false,theme:p="dark",locale:c="es"}){let[n,m]=react.useState(false),[l,i]=react.useState(false),[u,w]=react.useState(""),[f,g]=react.useState([]),[C,h]=react.useState(""),[b,v]=react.useState(""),[D,N]=react.useState(""),[A,x]=react.useState(false),[B,E]=react.useState(false),[T,H]=react.useState(false),k=react.useRef(null),O=react.useRef(null),_={placeholder:o||(c==="es"?"Nombre de la tarea...":"Task Name..."),buttonLabel:s||(c==="es"?"Agregar Tarea":"Add Task"),save:c==="es"?"Guardar":"Save",addAssignee:c==="es"?"Agregar asignado":"Add assignee",addDates:c==="es"?"Agregar fechas":"Add dates",addPriority:c==="es"?"Agregar prioridad":"Add priority",startDate:c==="es"?"Inicio":"Start",endDate:c==="es"?"Fin":"End",low:c==="es"?"Baja":"Low",medium:c==="es"?"Media":"Medium",high:c==="es"?"Alta":"High",urgent:c==="es"?"Urgente":"Urgent"},re=react.useCallback(()=>{w(""),g([]),h(""),v(""),N(""),x(false),E(false),H(false),m(false);},[]);react.useEffect(()=>{n&&k.current&&k.current.focus();},[n]),react.useEffect(()=>{if(!n)return;let F=z=>{O.current&&!O.current.contains(z.target)&&(u.trim()||re());};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[n,u,re]);let de=react.useCallback(async()=>{let F=u.trim();if(!(!F||l)){i(true);try{await t({name:F,columnId:e,assigneeIds:f.length>0?f:void 0,startDate:C?new Date(C):void 0,endDate:b?new Date(b):void 0,priority:D||void 0}),w(""),g([]),h(""),v(""),N(""),x(!1),E(!1),H(!1),k.current?.focus();}catch(z){console.error("Error creating card:",z);}finally{i(false);}}},[u,e,f,C,b,D,t,l]),we=react.useCallback(F=>{F.key==="Enter"&&!F.shiftKey?(F.preventDefault(),de()):F.key==="Escape"&&re();},[de,re]),Ne=react.useCallback(F=>{g(z=>z.includes(F)?z.filter(M=>M!==F):[...z,F]);},[]),R=p==="dark";return n?jsxRuntime.jsxs("div",{ref:O,className:y("rounded-lg overflow-hidden shadow-lg",R?"bg-[#1e1e2e]":"bg-white",r),style:{border:"2px solid #10b981"},children:[jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsx("input",{ref:k,type:"text",value:u,onChange:F=>w(F.target.value),onKeyDown:we,placeholder:_.placeholder,disabled:l,className:y("w-full px-0 py-1 text-sm font-medium border-0 bg-transparent focus:outline-none focus:ring-0",R?"text-gray-100 placeholder-gray-500":"text-gray-800 placeholder-gray-400")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-3",children:[a.length>0&&jsxRuntime.jsxs("button",{onClick:()=>x(!A),className:y("flex items-center gap-1 px-2 py-1.5 rounded-md text-xs transition-colors",A||f.length>0?"bg-emerald-500/20 text-emerald-400":R?"text-gray-400 hover:bg-[#2a2a3e] hover:text-gray-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),type:"button",title:_.addAssignee,children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",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"})]}),f.length>0&&jsxRuntime.jsx("span",{className:"ml-0.5",children:f.length})]}),jsxRuntime.jsx("button",{onClick:()=>E(!B),className:y("flex items-center gap-1 px-2 py-1.5 rounded-md text-xs transition-colors",B||C||b?"bg-blue-500/20 text-blue-400":R?"text-gray-400 hover:bg-[#2a2a3e] hover:text-gray-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),type:"button",title:_.addDates,children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),jsxRuntime.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),jsxRuntime.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),jsxRuntime.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),jsxRuntime.jsx("button",{onClick:()=>H(!T),className:y("flex items-center gap-1 px-2 py-1.5 rounded-md text-xs transition-colors",T||D?D==="urgent"?"bg-red-500/20 text-red-400":D==="high"?"bg-orange-500/20 text-orange-400":D==="medium"?"bg-yellow-500/20 text-yellow-400":D==="low"?"bg-green-500/20 text-green-400":"bg-orange-500/20 text-orange-400":R?"text-gray-400 hover:bg-[#2a2a3e] hover:text-gray-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),type:"button",title:_.addPriority,children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"}),jsxRuntime.jsx("line",{x1:"4",y1:"22",x2:"4",y2:"15"})]})}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{onClick:de,disabled:!u.trim()||l,className:y("px-3 py-1.5 rounded-md text-xs font-medium text-white transition-all","bg-emerald-500 hover:bg-emerald-600","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-emerald-500"),type:"button",children:l?jsxRuntime.jsx("div",{className:"w-3 h-3 border-2 border-white/30 border-t-white rounded-full animate-spin"}):_.save})]})]}),A&&a.length>0&&jsxRuntime.jsx("div",{className:y("px-3 pb-3 pt-0","border-t",R?"border-[#3a3a4e]":"border-gray-200"),children:jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 pt-3",children:a.map(F=>jsxRuntime.jsxs("button",{onClick:()=>Ne(F.id),className:y("flex items-center gap-1.5 px-2 py-1 rounded-full text-xs transition-all",f.includes(F.id)?"bg-emerald-500 text-white":R?"bg-[#2a2a3e] text-gray-300 hover:bg-[#3a3a4e]":"bg-gray-100 text-gray-700 hover:bg-gray-200"),type:"button",children:[F.avatar?jsxRuntime.jsx("img",{src:F.avatar,alt:F.name,className:"w-4 h-4 rounded-full"}):jsxRuntime.jsx("div",{className:y("w-4 h-4 rounded-full flex items-center justify-center text-[10px] font-medium",f.includes(F.id)?"bg-emerald-600 text-white":"bg-emerald-500 text-white"),children:F.name.charAt(0).toUpperCase()}),jsxRuntime.jsx("span",{children:F.name.split(" ")[0]})]},F.id))})}),B&&jsxRuntime.jsx("div",{className:y("px-3 pb-3 pt-0","border-t",R?"border-[#3a3a4e]":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:y("block text-[10px] uppercase tracking-wide mb-1",R?"text-gray-500":"text-gray-400"),children:_.startDate}),jsxRuntime.jsx("input",{type:"date",value:C,onChange:F=>h(F.target.value),className:y("w-full px-2 py-1.5 rounded text-xs border",R?"bg-[#2a2a3e] border-[#3a3a4e] text-gray-200":"bg-gray-50 border-gray-200 text-gray-800")})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:y("block text-[10px] uppercase tracking-wide mb-1",R?"text-gray-500":"text-gray-400"),children:_.endDate}),jsxRuntime.jsx("input",{type:"date",value:b,onChange:F=>v(F.target.value),className:y("w-full px-2 py-1.5 rounded text-xs border",R?"bg-[#2a2a3e] border-[#3a3a4e] text-gray-200":"bg-gray-50 border-gray-200 text-gray-800")})]})]})}),T&&jsxRuntime.jsx("div",{className:y("px-3 pb-3 pt-0","border-t",R?"border-[#3a3a4e]":"border-gray-200"),children:jsxRuntime.jsx("div",{className:"flex gap-1.5 pt-3",children:["low","medium","high","urgent"].map(F=>jsxRuntime.jsx("button",{onClick:()=>N(D===F?"":F),className:y("flex-1 px-2 py-1.5 rounded text-xs font-medium transition-all",D===F?`${{low:"bg-green-500",medium:"bg-yellow-500",high:"bg-orange-500",urgent:"bg-red-500"}[F]} text-white`:R?"bg-[#2a2a3e] text-gray-400 hover:bg-[#3a3a4e]":"bg-gray-100 text-gray-600 hover:bg-gray-200"),type:"button",children:_[F]},F))})})]}):jsxRuntime.jsxs("button",{onClick:()=>m(true),disabled:d,className:y("w-full flex items-center gap-2 px-3 py-2 rounded-lg transition-all duration-200","text-emerald-500 hover:text-emerald-400",R?"hover:bg-[#2a2a3e]":"hover:bg-gray-100",d&&"opacity-50 cursor-not-allowed",r),type:"button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:_.buttonLabel})]})}var vo=class extends core.BaseViewAdapter{constructor(a={}){super();this.id="kanban";this.name="Kanban Board";this.version="1.0.0";this.description="";this.icon="";this.supportedExports=["json","csv","pdf","png"];this.root=null;this.description="Interactive Kanban board with drag & drop, filters, and real-time updates",this.icon="\u{1F4CB}",this.kanbanConfig=a,this.options={animations:a.viewOptions?.animations??true,virtualScrolling:a.viewOptions?.virtualScrolling??false,theme:a.viewOptions?.theme??"dark",readonly:a.viewOptions?.readonly??false};}mount(a,r){this.isMounted()&&(console.warn("[KanbanViewAdapter] Already mounted, unmounting first"),this.unmount()),this.container=a,this.data=r,this.root=client.createRoot(a),this.render(),this.emit("view:mounted",{viewId:this.id,timestamp:Date.now()});}unmount(){this.isMounted()&&(this.emit("view:unmounted",{viewId:this.id,timestamp:Date.now()}),this.root&&(this.root.unmount(),this.root=null),this.container&&(this.container.innerHTML="",this.container=null),this.data=null);}update(a){if(!this.isMounted()){console.warn("[KanbanViewAdapter] Not mounted, cannot update");return}this.data=a,this.render(),this.emit("view:updated",{viewId:this.id,data:a});}configure(a){this.options={...this.options,...a},this.isMounted()&&this.render();}async export(a){if(!this.data)throw new Error("No data to export");switch(a){case "json":return JSON.stringify(this.data,null,2);case "csv":return this.exportToCSV();case "pdf":return this.exportToPDF();case "png":return this.exportToPNG();default:throw new Error(`Unsupported export format: ${a}`)}}render(){if(!this.root||!this.data)return;let a={id:this.data.board?.id||"board-1",title:this.data.board?.title||"Untitled Board",columns:this.data.columns,cards:this.data.cards};this.root.render(jsxRuntime.jsx(ir,{board:a,callbacks:this.kanbanConfig.callbacks||{},onCardClick:this.kanbanConfig.onCardClick,renderProps:this.kanbanConfig.renderProps,config:this.kanbanConfig.config,availableUsers:this.kanbanConfig.availableUsers,className:this.kanbanConfig.className,style:this.kanbanConfig.style}));}exportToCSV(){if(!this.data)return "";let a=[["Card ID","Title","Column","Description","Labels","Assignees","Due Date","Position"]];return this.data.cards.forEach(r=>{let o=this.data.columns.find(s=>s.id===r.columnId);a.push([r.id,r.title,o?.title||"",r.description||"",r.labels?.join(", ")||"",r.assignedUserIds?.join(", ")||r.assigneeId||"",r.dueDate?.toString()||"",r.position.toString()]);}),a.map(r=>r.map(o=>`"${o}"`).join(",")).join(`
4
+ `);if(t.length<1||!t[0])return {success:!1,errors:["CSV file is empty or invalid"]};let a=vl(t[0]),r=[],o=new Map,s=[];for(let d=1;d<t.length;d++)try{let p=vl(t[d]||"");if(p.length>a.length){s.push(`Line ${d+1}: Too many columns`);continue}if(a.length-p.length>3){s.push(`Line ${d+1}: Column count mismatch (expected ${a.length}, got ${p.length})`);continue}for(;p.length<a.length;)p.push("");let n={};a.forEach((u,w)=>{n[u]=p[w]||"";});let m=n.Column||"Unnamed";o.has(m)||o.set(m,{id:`col-${o.size+1}`,title:m,position:o.size+1,cardIds:[]});let l=o.get(m),i={id:n["Card ID"]||`card-${d}`,title:n.Title||"Untitled",description:n.Description?n.Description:void 0,columnId:l.id,position:l.cardIds.length+1,priority:n.Priority||void 0,labels:n.Labels?n.Labels.split(";").filter(Boolean):void 0,assignedUserIds:n["Assigned Users"]?n["Assigned Users"].split(";").filter(Boolean):void 0,startDate:n["Start Date"]?n["Start Date"]:void 0,endDate:n["End Date"]?n["End Date"]:void 0,createdAt:n["Created At"]?n["Created At"]:void 0,updatedAt:n["Updated At"]?n["Updated At"]:void 0};r.push(i),l.cardIds.push(i.id);}catch(p){s.push(`Line ${d+1}: ${p instanceof Error?p.message:"Unknown error"}`);}return r.length===0?{success:!1,errors:["No valid cards found in CSV",...s]}:{success:!0,cardsImported:r.length,columnsImported:o.size,errors:s.length>0?s:void 0}}catch(t){return {success:false,errors:[`Failed to parse CSV: ${t instanceof Error?t.message:"Unknown error"}`]}}}function vl(e){let t=[],a="",r=false;for(let o=0;o<e.length;o++){let s=e[o],d=e[o+1];s==='"'&&r&&d==='"'?(a+='"',o++):s==='"'?r=!r:s===","&&!r?(t.push(a),a=""):a+=s;}return t.push(a),t}function xl(e,t){switch(t){case "json":return Yp(e);case "csv":return qp(e);default:return {success:false,errors:[`Unsupported import format: ${t}`]}}}function kl(e){return new Promise((t,a)=>{let r=new FileReader;r.onload=o=>{o.target?.result?t(o.target.result):a(new Error("Failed to read file"));},r.onerror=()=>a(new Error("Failed to read file")),r.readAsText(e);})}var as=react.createContext(null);function wl(){return react.useContext(as)}var Cl=react.createContext(null);function Tl({children:e,themeName:t}){return jsxRuntime.jsx(Cl.Provider,{value:{themeName:t},children:e})}function Wr(){return react.useContext(Cl)}function nt({children:e,container:t}){let[a,r]=react.useState(false),o=wl(),s=Wr();if(react.useEffect(()=>(r(true),()=>r(false)),[]),!a)return null;let d=t||(typeof document<"u"?document.body:null);if(!d)return null;if(o){let{theme:p,themeName:c}=o,n={"--asakaa-color-background-primary":p.bgPrimary,"--asakaa-color-background-secondary":p.bgSecondary,"--asakaa-color-background-card":p.bgGrid,"--asakaa-color-background-hover":p.hoverBg,"--asakaa-color-text-primary":p.textPrimary,"--asakaa-color-text-secondary":p.textSecondary,"--asakaa-color-text-tertiary":p.textTertiary,"--asakaa-color-text-inverse":p.taskBarHandle||"#FFFFFF","--asakaa-color-border-default":p.border,"--asakaa-color-border-hover":p.borderLight,"--asakaa-color-border-subtle":p.borderLight,"--asakaa-color-interactive-primary":p.accent,"--asakaa-color-interactive-primaryHover":p.accentHover,"--asakaa-color-interactive-primaryBorder":`${p.accent}4D`,"--asakaa-color-interactive-primaryBackground":`${p.accent}1A`,"--asakaa-color-interactive-primaryBackgroundHover":`${p.accent}33`,"--asakaa-color-status-success":p.statusCompleted,"--asakaa-color-status-warning":p.milestone,"--asakaa-color-status-error":p.criticalPath,"--asakaa-color-danger":p.criticalPath,"--asakaa-color-danger-border":`${p.criticalPath}4D`,"--asakaa-color-danger-background":`${p.criticalPath}14`,"--asakaa-color-danger-backgroundHover":`${p.criticalPath}26`};return reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":c,"data-gantt-portal":"true",style:n,children:e}),d)}return s?reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":s.themeName,"data-kanban-portal":"true",children:e}),d):reactDom.createPortal(e,d)}var Pl={URGENT:{label:"Urgent",color:"#E74C3C"},HIGH:{label:"High",color:"#E67E22"},MEDIUM:{label:"Normal",color:"#F1C40F"},LOW:{label:"Low",color:"#2ECC71"}},rm="#BDC3C7",om=({color:e})=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",fill:e,opacity:"0.9"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"1.5",opacity:"0.3"})]});function kr({priority:e,onChange:t,className:a}){let[r,o]=react.useState(false),[s,d]=react.useState({top:0,left:0}),p=react.useRef(null),c=react.useRef(null),n=()=>{if(!c.current)return;let u=c.current.getBoundingClientRect(),w=window.innerHeight,f=window.innerWidth,g=160,C=220,h=4,b=u.right-g;b<10&&(b=u.left),b+g>f-10&&(b=f-g-10);let v=w-u.bottom,D=u.top,N;v>=C+h?N=u.bottom+h:D>=C+h?N=u.top-C-h:N=v>=D?u.bottom+h:Math.max(10,u.top-C-h),d({top:N,left:b}),o(true);};react.useEffect(()=>{let u=w=>{p.current&&!p.current.contains(w.target)&&!c.current?.contains(w.target)&&o(false);};if(r)return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[r]),react.useEffect(()=>{let u=w=>{w.key==="Escape"&&o(false);};if(r)return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[r]);let m=u=>{t(u),o(false);},l=e?Pl[e]:null,i=l?.color||rm;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:c,onClick:()=>r?o(false):n(),className:"flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95",style:{background:e?`${i}10`:"transparent",boxShadow:e?`0 0 0 2px ${i}30 inset`:"none"},title:l?.label||"Set priority",children:jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M3 2L3 14M3 2L13 6L3 8V2Z",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:i,fillOpacity:e?"0.6":"0.4"})})}),r&&jsxRuntime.jsx(nt,{children:jsxRuntime.jsxs("div",{ref:p,className:"priority-selector-menu",style:{position:"fixed",top:`${s.top}px`,left:`${s.left}px`,zIndex:99999,minWidth:"160px",maxHeight:"calc(100vh - 40px)",borderRadius:"8px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-1.5 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Priority"})}),jsxRuntime.jsxs("div",{className:"py-1",children:[Object.entries(Pl).map(([u,w])=>jsxRuntime.jsxs("button",{onClick:()=>m(u),className:"w-full px-3 py-1.5 flex items-center gap-2 text-xs font-medium transition-all active:scale-[0.98] priority-option",style:{color:w.color,background:"transparent"},onMouseEnter:f=>{f.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:f=>{f.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(om,{color:w.color}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:w.label}),e===u&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},u)),jsxRuntime.jsx("div",{className:"mt-0.5 pt-0.5 border-t",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsxs("button",{onClick:()=>m(void 0),className:"w-full px-3 py-1.5 flex items-center gap-2 text-xs font-medium transition-all active:scale-[0.98]",style:{color:"var(--modal-v2-text-primary, #e5e5e5)",background:"transparent"},onMouseEnter:u=>{u.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:u=>{u.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"#9CA3AF",strokeWidth:"1.5",strokeDasharray:"2 2",opacity:"0.6"})}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:"Clear"}),!e&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})]})})]})}var nm=[{label:"Today",days:0},{label:"Tomorrow",days:1},{label:"Next Week",days:7},{label:"2 Weeks",days:14},{label:"4 Weeks",days:28},{label:"8 Weeks",days:56}];function uo({startDate:e,endDate:t,onChange:a,className:r}){let[o,s]=react.useState(false),[d,p]=react.useState({top:0,left:0}),c=react.useRef(null),n=react.useRef(null),i=(Wr()?.themeName||"dark")==="dark",u=()=>{if(!n.current)return;let b=n.current.getBoundingClientRect(),v=window.innerHeight,D=window.innerWidth,N=320,A=380,x=4,B=b.left;B+N>D-10&&(B=D-N-10),B<10&&(B=10);let E=v-b.bottom,T=b.top,H;E>=A+x?H=b.bottom+x:T>=A+x?H=b.top-A-x:H=E>=T?b.bottom+x:Math.max(10,b.top-A-x),p({top:H,left:B}),s(true);};react.useEffect(()=>{let b=v=>{c.current&&!c.current.contains(v.target)&&!n.current?.contains(v.target)&&s(false);};if(o)return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[o]),react.useEffect(()=>{let b=v=>{v.key==="Escape"&&s(false);};if(o)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[o]);let w=b=>{let v=new Date,D=B=>{let E=B.getFullYear(),T=String(B.getMonth()+1).padStart(2,"0"),H=String(B.getDate()).padStart(2,"0");return `${E}-${T}-${H}`},N=D(v),A=new Date(v);A.setDate(A.getDate()+b);let x=D(A);a(N,x),s(false);},f=()=>{if(!e||!t)return "Set date";let b=A=>{if(A instanceof Date)return A;if(typeof A!="string"||!A.match(/^\d{4}-\d{2}-\d{2}$/))return null;let x=A.split("-").map(Number);if(x.length!==3||x.some(H=>isNaN(H)))return null;let B=x[0],E=x[1],T=x[2];return B===void 0||E===void 0||T===void 0?null:new Date(B,E-1,T)},v=b(e),D=b(t);if(!v||!D||isNaN(v.getTime())||isNaN(D.getTime()))return "Set date";let N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return `${N[v.getMonth()]} ${v.getDate()} \u2013 ${N[D.getMonth()]} ${D.getDate()}`},g=e&&t,h=(()=>{if(!t)return false;let b=typeof t=="string"?new Date(t):t,v=new Date;return v.setHours(0,0,0,0),b<v})();return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsxs("button",{ref:n,onClick:()=>o?s(false):u(),className:`flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-all hover:bg-white/5 ${h?"asakaa-date-overdue":"asakaa-date"}`,title:g?`${f()}`:"Set date range",children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"2",y:"3",width:"12",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M2 6H14",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M5 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M11 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e&&t&&jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:f()})]}),o&&jsxRuntime.jsx(nt,{children:jsxRuntime.jsxs("div",{ref:c,className:"date-picker-menu rounded-xl shadow-2xl border min-w-[320px]",style:{position:"fixed",top:`${d.top}px`,left:`${d.left}px`,background:i?"#1A1D25":"#FFFFFF",border:`1px solid ${i?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.12)"}`,boxShadow:i?"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)":"0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.08)",zIndex:99999},children:[jsxRuntime.jsxs("div",{className:"p-4 border-b",style:{borderColor:i?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.08)"},children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:i?"rgba(255, 255, 255, 0.85)":"rgba(0, 0, 0, 0.7)"},children:"Quick Select"}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:nm.map(b=>jsxRuntime.jsx("button",{onClick:()=>w(b.days),className:"px-3 py-2.5 rounded-lg text-xs font-semibold transition-all active:scale-95",style:{color:i?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",border:`1px solid ${i?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)"}`,backgroundColor:i?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)"},onMouseEnter:v=>{v.currentTarget.style.backgroundColor=i?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.1)",v.currentTarget.style.border=`1px solid ${i?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.25)"}`;},onMouseLeave:v=>{v.currentTarget.style.backgroundColor=i?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",v.currentTarget.style.border=`1px solid ${i?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)"}`;},children:b.label},b.label))})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:i?"rgba(255, 255, 255, 0.85)":"rgba(0, 0, 0, 0.7)"},children:"Custom Range"}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("input",{type:"date",value:e||"",onChange:b=>a(b.target.value,t),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:i?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",borderColor:i?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)",color:i?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",colorScheme:i?"dark":"light"}}),jsxRuntime.jsx("input",{type:"date",value:t||"",onChange:b=>a(e,b.target.value),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:i?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",borderColor:i?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)",color:i?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",colorScheme:i?"dark":"light"}})]}),(e||t)&&jsxRuntime.jsx("button",{onClick:()=>{a(void 0,void 0),s(false);},className:"mt-4 w-full px-3 py-2.5 rounded-lg text-sm font-semibold transition-all active:scale-95 border",style:{color:"#ef4444",borderColor:"rgba(239, 68, 68, 0.3)",background:"rgba(239, 68, 68, 0.1)"},onMouseEnter:b=>{b.currentTarget.style.background="rgba(239, 68, 68, 0.2)";},onMouseLeave:b=>{b.currentTarget.style.background="rgba(239, 68, 68, 0.1)";},children:"Clear Dates"})]})]})})]})}function Cr({assignedUsers:e=[],availableUsers:t,onChange:a,className:r,maxVisibleAvatars:o=3}){let[s,d]=react.useState(false),[p,c]=react.useState(""),[n,m]=react.useState({top:0,left:0}),l=react.useRef(null),i=react.useRef(null),u=()=>{if(!i.current)return;let h=i.current.getBoundingClientRect(),b=window.innerHeight,v=window.innerWidth,D=300,N=380,A=4,x=h.right-D;x<10&&(x=h.left),x+D>v-10&&(x=v-D-10);let B=b-h.bottom,E=h.top,T;B>=N+A?T=h.bottom+A:E>=N+A?T=h.top-N-A:T=B>=E?h.bottom+A:Math.max(10,h.top-N-A),m({top:T,left:x}),d(true);};react.useEffect(()=>{let h=b=>{l.current&&!l.current.contains(b.target)&&!i.current?.contains(b.target)&&(d(false),c(""));};if(s)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s]),react.useEffect(()=>{let h=b=>{b.key==="Escape"&&(d(false),c(""));};if(s)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[s]);let w=h=>{let b=e.some(v=>v.id===h.id);a(b?e.filter(v=>v.id!==h.id):[...e,h]);},f=t.filter(h=>h.name.toLowerCase().includes(p.toLowerCase())),g=e.slice(0,o),C=e.length-o;return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:i,onClick:()=>s?d(false):u(),className:"flex items-center gap-1 p-0.5 rounded transition-all hover:bg-white/10 hover:scale-105 active:scale-95",title:e.length>0?`${e.length} assigned`:"Assign users",children:e.length>0?jsxRuntime.jsxs("div",{className:"asakaa-avatar-group",children:[g.map(h=>jsxRuntime.jsx("div",{className:"asakaa-avatar",title:h.name,children:h.avatar?jsxRuntime.jsx("img",{src:h.avatar,alt:h.name,className:"asakaa-avatar-img"}):h.initials},h.id)),C>0&&jsxRuntime.jsxs("div",{className:"asakaa-avatar",children:["+",C]})]}):jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center transition-all",style:{background:"rgba(96, 165, 250, 0.15)",border:"1.5px solid rgba(96, 165, 250, 0.4)",color:"#60a5fa"},children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM4 14c0-2.21 1.79-4 4-4s4 1.79 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"13",y1:"5",x2:"13",y2:"9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"11",y1:"7",x2:"15",y2:"7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}),s&&jsxRuntime.jsx(nt,{children:jsxRuntime.jsxs("div",{ref:l,className:"user-selector-menu rounded-xl shadow-2xl border min-w-[300px]",style:{position:"fixed",top:`${n.top}px`,left:`${n.left}px`,maxHeight:"calc(100vh - 40px)",overflow:"hidden",display:"flex",flexDirection:"column",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, 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)",zIndex:99999},children:[jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.8))"},children:"Assign Users"})}),jsxRuntime.jsx("div",{className:"px-3 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("input",{type:"text",value:p,onChange:h=>c(h.target.value),placeholder:"Search users...",className:"w-full px-3 py-2.5 rounded-lg text-sm border outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.2))",color:"var(--modal-v2-text-primary, #ffffff)"},autoFocus:true})}),jsxRuntime.jsx("div",{className:"py-2 max-h-[300px] overflow-y-auto",children:f.length===0?jsxRuntime.jsx("div",{className:"px-4 py-3 text-sm text-center",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.6))"},children:"No users found"}):f.map(h=>{let b=e.some(v=>v.id===h.id);return jsxRuntime.jsxs("button",{onClick:()=>w(h),className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm transition-all active:scale-98",style:{background:"transparent"},onMouseEnter:v=>{v.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.1))";},onMouseLeave:v=>{v.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-[11px] font-bold flex-shrink-0 shadow-sm",style:{backgroundColor:h.color,color:"#fff"},children:h.avatar?jsxRuntime.jsx("img",{src:h.avatar,alt:h.name,className:"w-full h-full rounded-full object-cover"}):h.initials}),jsxRuntime.jsx("span",{className:"font-semibold flex-1 text-left truncate",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.95))"},children:h.name}),jsxRuntime.jsx("span",{className:"w-5 text-lg flex-shrink-0 text-right",style:{color:b?"#3b82f6":"transparent"},children:b?"\u2713":""})]},h.id)})}),e.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-3 border-t border-white/10",children:jsxRuntime.jsx("button",{onClick:()=>{a([]),d(false);},className:"w-full px-3 py-2.5 rounded-lg text-sm font-semibold transition-all hover:bg-red-600/30 active:scale-95 border",style:{color:"#f87171",borderColor:"rgba(248, 113, 113, 0.3)",background:"rgba(248, 113, 113, 0.08)"},children:"Clear All"})})]})})]})}function Ko(e,t,a){let r=new Map;e.forEach(c=>{if(c.dependencies&&Array.isArray(c.dependencies)){let n=c.dependencies.map(m=>{if(typeof m=="string")return m;let l=m;return l.taskId||l.targetId||""}).filter(Boolean);r.set(c.id,n);}});let o=r.get(a)||[];r.set(a,[...o,t]);let s=new Set,d=new Set,p=c=>{if(!s.has(c)){s.add(c),d.add(c);let n=r.get(c)||[];for(let m of n){if(!s.has(m)&&p(m))return true;if(d.has(m))return true}}return d.delete(c),false};return p(a)}function fo({currentCardId:e,dependencies:t=[],availableTasks:a,onChange:r,className:o,validateCircular:s=true,onCircularDependencyError:d}){let[p,c]=react.useState(false),[n,m]=react.useState(""),[l,i]=react.useState(t.length>0),[u,w]=react.useState({top:0,left:0}),[f,g]=react.useState(null),C=react.useRef(null),h=react.useRef(null),b=()=>{if(!h.current)return;let x=h.current.getBoundingClientRect(),B=window.innerHeight,E=window.innerWidth,T=300,H=l?380:120,k=4,O=x.right-T;O<10&&(O=x.left),O+T>E-10&&(O=E-T-10);let _=B-x.bottom,re=x.top,de;_>=H+k?de=x.bottom+k:re>=H+k?de=x.top-H-k:de=_>=re?x.bottom+k:Math.max(10,x.top-H-k),w({top:de,left:O}),c(true);};react.useEffect(()=>{if(!p||!h.current)return;let x=h.current.getBoundingClientRect(),B=window.innerHeight,E=window.innerWidth,T=300,H=l?380:120,k=4,O=x.right-T;O<10&&(O=x.left),O+T>E-10&&(O=E-T-10);let _=B-x.bottom,re=x.top,de;_>=H+k?de=x.bottom+k:re>=H+k?de=x.top-H-k:de=_>=re?x.bottom+k:Math.max(10,x.top-H-k),w({top:de,left:O});},[l,p]),react.useEffect(()=>{let x=B=>{C.current&&!C.current.contains(B.target)&&!h.current?.contains(B.target)&&(c(false),m(""));};if(p)return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[p]),react.useEffect(()=>{let x=B=>{B.key==="Escape"&&(c(false),m(""));};if(p)return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[p]);let v=x=>{let B=t.includes(x),E=a.find(T=>T.id===x);if(g(null),B){let T=t.filter(H=>H!==x);r(T),T.length===0&&i(false);}else {if(s&&Ko(a,x,e)){let H=`Cannot add "${E?.title||x}" as dependency - would create circular reference`;g(H),d?.(x,E?.title||x),setTimeout(()=>g(null),3e3);return}r([...t,x]),i(true);}},D=()=>{let x=!l;i(x),x||r([]);},N=a.filter(x=>x.id!==e).filter(x=>x.title.toLowerCase().includes(n.toLowerCase())||x.id.toLowerCase().includes(n.toLowerCase())),A=t.length>0?"#3B82F6":"#BDC3C7";return jsxRuntime.jsxs("div",{className:`relative ${o||""}`,children:[jsxRuntime.jsxs("button",{ref:h,onClick:()=>p?c(false):b(),className:"flex items-center gap-1 px-2 py-1 rounded transition-all hover:bg-white/5",title:t.length>0?`${t.length} dependencies`:"Add dependencies",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M7 9L9 7M11.5 3.5L10 2C8.89543 0.89543 7.10457 0.89543 6 2C4.89543 3.10457 4.89543 4.89543 6 6L7.5 7.5M4.5 12.5L6 14C7.10457 15.1046 8.89543 15.1046 10 14C11.1046 12.8954 11.1046 11.1046 10 10L8.5 8.5",stroke:A,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),t.length>0&&jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:A},children:t.length})]}),p&&jsxRuntime.jsx(nt,{children:jsxRuntime.jsxs("div",{ref:C,className:"dependencies-selector-menu rounded-xl shadow-2xl border min-w-[300px]",style:{position:"fixed",top:`${u.top}px`,left:`${u.left}px`,maxHeight:"calc(100vh - 40px)",overflow:"hidden",display:"flex",flexDirection:"column",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, 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)",zIndex:99999},children:[f&&jsxRuntime.jsxs("div",{className:"px-4 py-3 flex items-center gap-2",style:{background:"rgba(239, 68, 68, 0.15)",borderBottom:"1px solid rgba(239, 68, 68, 0.3)"},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M8 5V8M8 11H8.01M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z",stroke:"#ef4444",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:"#ef4444"},children:f})]}),jsxRuntime.jsx("div",{className:"px-4 py-2 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Task Dependencies"})}),jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",onClick:D,children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center transition-all",style:{background:l?"#3b82f6":"transparent",borderColor:l?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:l&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsx("span",{className:"text-sm font-medium",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.8))"},children:"Has dependencies"})]})}),l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsx("input",{type:"text",value:n,onChange:x=>m(x.target.value),placeholder:"Search by name or ID...",className:"w-full px-3 py-2 rounded-md text-xs border outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))",color:"var(--modal-v2-text-primary, #ffffff)"},autoFocus:true})}),jsxRuntime.jsx("div",{className:"py-2 max-h-[280px] overflow-y-auto",children:N.length===0?jsxRuntime.jsx("div",{className:"px-4 py-3 text-xs text-center",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:"No tasks found"}):N.map(x=>{let B=t.includes(x.id);return jsxRuntime.jsxs("button",{onClick:()=>v(x.id),className:"w-full px-4 py-2 flex items-start gap-3 text-sm transition-colors",style:{background:"transparent"},onMouseEnter:E=>{E.currentTarget.style.background="var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))";},onMouseLeave:E=>{E.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0 mt-0.5 transition-all",style:{background:B?"#3b82f6":"transparent",borderColor:B?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:B&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsxs("div",{className:"flex-1 text-left",children:[jsxRuntime.jsx("div",{className:"font-medium",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.9))"},children:x.title}),jsxRuntime.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:x.id})]})]},x.id)})})]}),t.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-2 border-t border-white/5",children:jsxRuntime.jsx("button",{onClick:()=>{r([]),i(false),c(false);},className:"w-full px-3 py-2 rounded-md text-xs font-medium transition-all hover:bg-red-600/20 border border-red-500/30",style:{color:"#E74C3C"},children:"Clear All Dependencies"})})]})})]})}var ja=react.memo(({card:e,render:t,onClick:a,isSelected:r,disableDrag:o,className:s,onUpdate:d,availableUsers:p=[],allCards:c=[]})=>{let{attributes:n,listeners:m,setNodeRef:l,transform:i,transition:u,isDragging:w}=sortable.useSortable({id:e.id,disabled:o,data:{type:"card",card:e}}),f={transform:Go.Transform.toString(i),transition:u};if(t)return jsxRuntime.jsx("div",{ref:l,style:f,...n,...m,onClick:()=>a?.(e),children:t(e)});let g=p.filter(v=>e.assignedUserIds?.includes(v.id)),C=e.progress===100,h=(e.attachments||[]).filter(v=>v.type.startsWith("image/")),b={...f,...e.color&&{borderTopWidth:"3px",borderTopStyle:"solid",borderTopColor:e.color}};return jsxRuntime.jsxs("div",{ref:l,style:b,className:y("asakaa-card",w&&"asakaa-card-dragging",r&&"ring-2 ring-asakaa-accent-blue",s),...n,...m,onClick:v=>{v.target.closest(".priority-selector, .date-picker, .user-selector, .dependencies-selector")||a?.(e);},children:[e.coverImage&&jsxRuntime.jsx("div",{className:"asakaa-card-cover mb-3",children:jsxRuntime.jsx("img",{src:e.coverImage,alt:`Cover for ${e.title}`,className:"w-full h-32 object-cover rounded-md",loading:"lazy",onError:v=>{v.currentTarget.style.display="none";}})}),h.length>0&&!e.coverImage&&jsxRuntime.jsx("div",{className:"asakaa-card-attachments mb-3",children:h.length===1&&h[0]?jsxRuntime.jsx("img",{src:h[0].url,alt:h[0].name,className:"w-full h-32 object-cover rounded-md",loading:"lazy",decoding:"async",style:{imageRendering:"auto",WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",transform:"translateZ(0)"},onError:v=>{v.currentTarget.style.display="none";}}):jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1",children:h.slice(0,4).map((v,D)=>jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("img",{src:v.url,alt:v.name,className:"w-full h-16 object-cover rounded",loading:"lazy",decoding:"async",style:{imageRendering:"auto",WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",transform:"translateZ(0)"},onError:N=>{N.currentTarget.style.display="none";}}),D===3&&h.length>4&&jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 rounded flex items-center justify-center",children:jsxRuntime.jsxs("span",{className:"text-white text-sm font-medium",children:["+",h.length-4]})})]},v.id))})}),jsxRuntime.jsx("h3",{className:"asakaa-card-title mb-2",style:{textDecoration:C?"line-through":"none",opacity:C?.6:1},children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"asakaa-card-description mb-3",children:e.description}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 mb-3 pt-1",children:[jsxRuntime.jsx("div",{onClick:v=>v.stopPropagation(),className:"priority-selector",children:jsxRuntime.jsx(kr,{priority:e.priority,onChange:v=>d?.(e.id,{priority:v})})}),jsxRuntime.jsx("div",{onClick:v=>v.stopPropagation(),className:"date-picker",children:jsxRuntime.jsx(uo,{startDate:e.startDate?typeof e.startDate=="string"?e.startDate:e.startDate.toISOString().split("T")[0]:void 0,endDate:e.endDate?typeof e.endDate=="string"?e.endDate:e.endDate.toISOString().split("T")[0]:void 0,onChange:(v,D)=>d?.(e.id,{startDate:v,endDate:D})})}),p.length>0&&jsxRuntime.jsx("div",{onClick:v=>v.stopPropagation(),className:"user-selector",children:jsxRuntime.jsx(Cr,{assignedUsers:g,availableUsers:p,onChange:v=>d?.(e.id,{assignedUserIds:v.map(D=>D.id)})})}),jsxRuntime.jsx("div",{onClick:v=>v.stopPropagation(),className:"dependencies-selector",children:jsxRuntime.jsx(fo,{currentCardId:e.id,dependencies:Array.isArray(e.dependencies)?e.dependencies.map(v=>typeof v=="string"?v:v.taskId):[],availableTasks:c,onChange:v=>d?.(e.id,{dependencies:v})})})]}),e.labels&&e.labels.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.labels.slice(0,3).map(v=>jsxRuntime.jsx("span",{className:"asakaa-label",children:v},v))}),typeof e.progress=="number"&&jsxRuntime.jsxs("div",{className:"mt-3 pt-2 border-t border-white/5",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-[#6B7280]",children:"Progreso"}),jsxRuntime.jsxs("span",{className:"text-[10px] font-medium",style:{color:"#3B82F6"},children:[Math.round(e.progress),"%"]})]}),jsxRuntime.jsx("div",{className:"h-1.5 rounded-full bg-white/5 overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(100,Math.max(0,e.progress))}%`,backgroundColor:"#3B82F6"}})})]})]})},(e,t)=>e.card.id===t.card.id&&e.card.title===t.card.title&&e.card.description===t.card.description&&e.card.position===t.card.position&&e.card.columnId===t.card.columnId&&e.card.priority===t.card.priority&&e.card.color===t.card.color&&e.card.progress===t.card.progress&&e.card.startDate===t.card.startDate&&e.card.endDate===t.card.endDate&&e.isSelected===t.isSelected&&JSON.stringify(e.card.labels)===JSON.stringify(t.card.labels)&&JSON.stringify(e.card.assignedUserIds)===JSON.stringify(t.card.assignedUserIds)&&JSON.stringify(e.card.dependencies)===JSON.stringify(t.card.dependencies)&&JSON.stringify(e.card.attachments?.map(a=>a.id))===JSON.stringify(t.card.attachments?.map(a=>a.id)));ja.displayName="Card";var Yo={todo:{label:"To Do",color:"#94a3b8",icon:"circle"},"in-progress":{label:"In Progress",color:"#60a5fa",icon:"circle-dot"},completed:{label:"Completed",color:"#34d399",icon:"check-circle"}},$l=({icon:e,color:t})=>e==="circle"?jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:"none"})}):e==="circle-dot"?jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:"none"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"3",fill:t})]}):jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:t,fillOpacity:"0.2"}),jsxRuntime.jsx("path",{d:"M5 8L7 10L11 6",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});function Ul({status:e="todo",onChange:t,className:a,customStatuses:r=[]}){let[o,s]=react.useState(false),[d,p]=react.useState({top:0,left:0}),c=react.useRef(null),n=react.useRef(null),m=[...Object.entries(Yo).map(([g,C])=>({id:g,label:C.label,color:C.color,icon:C.icon})),...r.filter(g=>!Object.keys(Yo).includes(g.id)).map(g=>({id:g.id,label:g.title,color:g.color||"#8B5CF6",icon:"circle-dot"}))],l=()=>{let g=Yo[e];if(g)return {...g,id:e};let C=r.find(h=>h.id===e);return C?{id:C.id,label:C.title,color:C.color||"#8B5CF6",icon:"circle-dot"}:{...Yo.todo,id:"todo"}},i=()=>{if(!n.current)return;let g=n.current.getBoundingClientRect(),C=window.innerHeight,h=window.innerWidth,b=180,v=280,D=4,N=g.right-b;N<10&&(N=g.left),N+b>h-10&&(N=h-b-10);let A=C-g.bottom,x=g.top,B;A>=v+D?B=g.bottom+D:x>=v+D?B=g.top-v-D:B=A>=x?g.bottom+D:Math.max(10,g.top-v-D),p({top:B,left:N}),s(true);};react.useEffect(()=>{let g=C=>{c.current&&!c.current.contains(C.target)&&!n.current?.contains(C.target)&&s(false);};if(o)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o]),react.useEffect(()=>{let g=C=>{C.key==="Escape"&&s(false);};if(o)return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[o]);let u=g=>{t(g),s(false);},w=l(),f=w.color;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:n,onClick:()=>o?s(false):i(),className:"flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95",style:{background:`${f}10`,boxShadow:`0 0 0 2px ${f}30 inset`},title:w.label,children:jsxRuntime.jsx($l,{icon:w.icon,color:f})}),o&&jsxRuntime.jsx(nt,{children:jsxRuntime.jsxs("div",{ref:c,className:"status-selector-menu",style:{position:"fixed",top:`${d.top}px`,left:`${d.left}px`,zIndex:99999,minWidth:"180px",maxHeight:"calc(100vh - 40px)",overflowY:"auto",borderRadius:"8px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-1.5 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Status"})}),jsxRuntime.jsx("div",{className:"py-1",children:m.map(g=>jsxRuntime.jsxs("button",{onClick:()=>u(g.id),className:"w-full px-3 py-2 flex items-center gap-2.5 text-sm font-medium transition-all active:scale-[0.98] status-option",style:{color:g.color,background:"transparent"},onMouseEnter:C=>{C.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:C=>{C.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx($l,{icon:g.icon,color:g.color}),jsxRuntime.jsx("span",{className:"font-semibold",children:g.label}),e===g.id&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},g.id))})]})})]})}function Wl({columnTitle:e,onRename:t,onDelete:a,isDeletable:r=false,className:o}){let[s,d]=react.useState(false),[p,c]=react.useState(false),[n,m]=react.useState(e),[l,i]=react.useState({top:0,left:0}),u=react.useRef(null),w=react.useRef(null),f=react.useRef(null);react.useEffect(()=>{if(s&&w.current){let b=w.current.getBoundingClientRect();i({top:b.bottom+window.scrollY+8,left:b.left+window.scrollX});}},[s]),react.useEffect(()=>{let b=v=>{u.current&&!u.current.contains(v.target)&&!w.current?.contains(v.target)&&(d(false),c(false));};if(s)return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[s]),react.useEffect(()=>{let b=v=>{v.key==="Escape"&&(d(false),c(false),m(e));};if(s)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[s,e]),react.useEffect(()=>{p&&f.current&&(f.current.focus(),f.current.select());},[p]);let g=()=>{c(true),m(e);},C=()=>{let b=n.trim();b&&b!==e&&t(b),c(false),d(false),m(e);},h=b=>{b.key==="Enter"?C():b.key==="Escape"&&(c(false),m(e));};return jsxRuntime.jsxs("div",{className:`relative ${o||""}`,children:[jsxRuntime.jsx("button",{ref:w,onClick:()=>d(!s),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-white/10",title:"Column options","aria-label":"Column menu",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"3",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"13",r:"1.5",fill:"currentColor"})]})}),s&&jsxRuntime.jsx(nt,{children:jsxRuntime.jsx("div",{ref:u,className:"fixed rounded-xl shadow-2xl border min-w-[200px]",style:{top:`${l.top}px`,left:`${l.left}px`,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)",zIndex:99999},children:p?jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsx("label",{className:"text-xs font-bold text-white/80 uppercase tracking-wider block mb-2",children:"Rename Column"}),jsxRuntime.jsx("input",{ref:f,type:"text",value:n,onChange:b=>m(b.target.value),onKeyDown:h,onBlur:C,className:"w-full px-3 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/50 outline-none focus:border-blue-500/50 transition-all",placeholder:"Column name",maxLength:50})]}):jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsxs("button",{onClick:g,className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm text-white/90 hover:bg-white/10 transition-all",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M11.5 1.5L14.5 4.5L5 14H2V11L11.5 1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-medium",children:"Rename"})]}),r&&a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"h-px bg-white/10 mx-2 my-1"}),jsxRuntime.jsxs("button",{onClick:()=>{a(),d(false);},className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm text-red-400 hover:bg-red-500/10 transition-all",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M2 4H14M5 4V2.5C5 2.22386 5.22386 2 5.5 2H10.5C10.7761 2 11 2.22386 11 2.5V4M12.5 4V13.5C12.5 13.7761 12.2761 14 12 14H4C3.72386 14 3.5 13.7761 3.5 13.5V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M6.5 7V11M9.5 7V11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),jsxRuntime.jsx("span",{className:"font-medium",children:"Delete"})]})]})]})})})]})}var _r=react.memo(({column:e,cards:t,renderColumn:a,renderCard:r,renderHeader:o,renderEmptyState:s,onCardClick:d,onCardUpdate:p,availableUsers:c,allCards:n,enableVirtualization:m,cardHeight:l=120,isCollapsed:i,onToggleCollapse:u,onColumnRename:w,onColumnDelete:f,isDeletable:g=false,className:C})=>{let{setNodeRef:h,isOver:b}=core$1.useDroppable({id:e.id,data:{type:"column",column:e}}),v=react.useRef(null),D=m??ul(t.length),N=reactVirtual.useVirtualizer({count:t.length,getScrollElement:()=>v.current,estimateSize:()=>l,enabled:D});if(a)return jsxRuntime.jsx("div",{ref:h,className:C,children:a(e,t)});let x=(()=>{if(!e.wipLimit)return {state:"none",percentage:0};let T=t.length/e.wipLimit*100;return t.length>e.wipLimit?{state:"exceeded",percentage:T}:T>=80?{state:"warning",percentage:T}:T>=60?{state:"approaching",percentage:T}:{state:"ok",percentage:T}})(),B=x.state==="exceeded",E=()=>"asakaa-column-count";return jsxRuntime.jsxs("div",{ref:h,className:y("asakaa-column",b&&"ring-2 ring-asakaa-accent-blue",B&&"ring-2 ring-asakaa-accent-red",C),children:[o?o(e,t.length):jsxRuntime.jsxs("div",{className:"asakaa-column-header group",children:[jsxRuntime.jsx("h2",{className:"asakaa-column-title",children:e.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:y(E()),children:[t.length,e.wipLimit&&` / ${e.wipLimit}`]}),e.wipLimit&&x.state!=="none"&&jsxRuntime.jsxs("span",{className:"text-xs font-medium flex items-center",title:`${x.percentage.toFixed(0)}% capacity${e.wipLimitType==="hard"?" (Hard limit - blocks new cards)":" (Soft limit - shows warning)"}`,children:[x.state==="exceeded"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"#EF4444",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M5 5L11 11M11 5L5 11",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}),x.state==="warning"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M8 1L15 14H1L8 1Z",fill:"#F59E0B",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M8 6V9M8 11V11.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})]}),x.state==="approaching"&&jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M8 1L10 7H14L10 10L12 16L8 12L4 16L6 10L2 7H6L8 1Z",fill:"#FB923C",opacity:"0.9"})}),x.state==="ok"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"#10B981",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M5 8L7 10L11 6",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})]}),(w||f)&&jsxRuntime.jsx(Wl,{columnTitle:e.title,onRename:T=>w?.(e.id,T),onDelete:f?()=>f(e.id):void 0,isDeletable:g}),u&&jsxRuntime.jsx("button",{onClick:u,className:"text-asakaa-text-tertiary hover:text-asakaa-text-primary","aria-label":i?"Expand column":"Collapse column",children:i?"\u25B6":"\u25BC"})]})]}),!i&&jsxRuntime.jsx("div",{ref:v,className:"asakaa-column-cards",style:{maxHeight:D?"600px":void 0},children:jsxRuntime.jsx(sortable.SortableContext,{items:t.map(T=>T.id),strategy:sortable.verticalListSortingStrategy,children:t.length===0?s?s(e):jsxRuntime.jsx("div",{className:"asakaa-drop-zone asakaa-empty",children:jsxRuntime.jsx("p",{children:"Drop cards here"})}):D?jsxRuntime.jsx("div",{style:{height:`${N.getTotalSize()}px`,position:"relative"},children:N.getVirtualItems().map(T=>{let H=t[T.index];return H?jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${T.start}px)`},children:jsxRuntime.jsx(ja,{card:H,render:r,onClick:d,onUpdate:p,availableUsers:c,allCards:n})},H.id):null})}):t.map(T=>jsxRuntime.jsx(ja,{card:T,render:r,onClick:d,onUpdate:p,availableUsers:c,allCards:n},T.id))})})]})});_r.displayName="Column";function is({title:e,onSave:t,className:a}){let[r,o]=react.useState(false),[s,d]=react.useState(e),p=react.useRef(null);react.useEffect(()=>{r&&p.current&&(p.current.focus(),p.current.select());},[r]);let c=()=>{let m=s.trim();m&&m!==e?t(m):d(e),o(false);},n=m=>{m.key==="Enter"?c():m.key==="Escape"&&(d(e),o(false));};return r?jsxRuntime.jsx("input",{ref:p,type:"text",value:s,onChange:m=>d(m.target.value),onBlur:c,onKeyDown:n,className:y("asakaa-column-title bg-transparent border-b-2 border-blue-500","outline-none px-1 -ml-1",a),maxLength:50}):jsxRuntime.jsx("h2",{className:y("asakaa-column-title cursor-pointer",a),onClick:()=>o(true),title:"Click to edit",children:e})}function jl(e){if("title"in e&&!("name"in e)){let t=e,a=(t.assignedUserIds||[]).map(r=>({name:r,initials:r.substring(0,2).toUpperCase(),color:"#6366F1"}));return {id:t.id,name:t.title,startDate:t.startDate?new Date(t.startDate):void 0,endDate:t.endDate?new Date(t.endDate):void 0,progress:t.progress||0,status:t.columnId,priority:t.priority?.toLowerCase(),assignees:a,dependencies:Array.isArray(t.dependencies)?t.dependencies.map(r=>typeof r=="string"?r:r.taskId):[],tags:t.tags,subtasks:t.subtasks?.map(r=>({id:r.id,name:r.title,progress:r.completed?100:0,startDate:new Date,endDate:new Date})),color:t.color,description:t.description}}return e}function Mm(e,t){return {...t,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,priority:e.priority?.toUpperCase(),tags:e.tags,description:e.description,color:e.color,columnId:e.status,assignedUserIds:t.assignedUserIds}}function ds({task:e,isOpen:t,onClose:a,onTaskUpdate:r,onCardUpdate:o,theme:s="dark",locale:d="es",availableUsers:p=[]}){let c=s==="dark",n=e&&"title"in e&&!("name"in e),m=e,[l,i]=react.useState(e?jl(e):null),[u,w]=react.useState(false),[f,g]=react.useState(false),[C,h]=react.useState(null),[b,v]=react.useState(new Date),[D,N]=react.useState(false);react.useEffect(()=>{e&&i(jl(e));},[e?.id]);let A=react.useCallback(k=>{i(k),n&&o&&m?o(Mm(k,m)):r&&r(k);},[n,m,o,r]),x=react.useCallback(()=>{w(false),g(false),h(null);},[]),B=react.useCallback((k,O)=>{if(!l)return;let _={...l,[k]:O};A(_);},[l,A]),E=react.useCallback(k=>{if(!l)return;let O=l.progress||0;k==="completed"?O=100:k==="in-progress"&&O===0?O=10:k==="todo"&&(O=0);let _={...l,status:k,progress:O};A(_),w(false);},[l,A]),T=react.useCallback((k,O)=>{if(!l)return;let _={...l,startDate:k,endDate:O};A(_);},[l,A]),H=react.useCallback(()=>{let k=b.getFullYear(),O=b.getMonth(),_=new Date(k,O,1),de=new Date(k,O+1,0).getDate(),we=_.getDay(),Ne=[],R=new Date(k,O,0).getDate();for(let z=we-1;z>=0;z--)Ne.push({date:new Date(k,O-1,R-z),isCurrentMonth:false});for(let z=1;z<=de;z++)Ne.push({date:new Date(k,O,z),isCurrentMonth:true});let F=42-Ne.length;for(let z=1;z<=F;z++)Ne.push({date:new Date(k,O+1,z),isCurrentMonth:false});return Ne},[b]);return !t||!l?null:jsxRuntime.jsx(framerMotion.AnimatePresence,{children:t&&l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:a,className:"fixed inset-0 bg-black/50 z-40"}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},className:y("fixed inset-4 md:inset-8 lg:inset-12 rounded-xl shadow-2xl z-50 flex overflow-hidden",c?"bg-[#1A1D25]":"bg-white"),children:jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxRuntime.jsxs("div",{className:y("px-6 py-3 border-b flex items-center gap-3",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Circle,{className:y("w-4 h-4",c?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("span",{className:y("text-xs px-2 py-0.5 rounded",c?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:[d==="es"?"Tarea":"Task"," \u2228"]}),jsxRuntime.jsx("span",{className:y("text-xs font-mono",c?"text-[#6B7280]":"text-gray-400"),children:l.id.slice(0,8)}),jsxRuntime.jsxs("button",{className:y("flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-colors",c?"bg-purple-500/20 text-purple-400 hover:bg-purple-500/30":"bg-purple-100 text-purple-700 hover:bg-purple-200"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-3 h-3"}),"Ask AI"]})]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:y("p-1.5 rounded transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.Maximize2,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{className:y("p-1.5 rounded transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{onClick:a,className:y("p-1.5 rounded transition-colors",c?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{let k=l.progress===100?0:100,_={...l,progress:k,status:k===100?"completed":"todo"};A(_);},className:y("mt-1 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors",l.progress===100?"bg-green-500 border-green-500":c?"border-white/30 hover:border-white/50":"border-gray-300 hover:border-gray-400"),children:l.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("h2",{className:y("text-xl font-semibold flex-1",l.progress===100?"line-through text-[#6B7280]":c?"text-white":"text-gray-900"),children:l.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:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Estado":"Status"}),jsxRuntime.jsx("button",{onClick:()=>{x(),w(!u);},className:y("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",l.progress===100||l.status==="completed"?"bg-green-500/20 text-green-400":l.progress&&l.progress>0||l.status==="in-progress"?"bg-blue-500/20 text-blue-400":c?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:l.progress===100||l.status==="completed"?d==="es"?"COMPLETADO":"DONE":l.progress&&l.progress>0||l.status==="in-progress"?d==="es"?"EN PROGRESO":"IN PROGRESS":d==="es"?"POR HACER":"TO DO"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:u&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>w(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:y("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"todo",label:d==="es"?"Por hacer":"To Do",color:"bg-gray-400"},{id:"in-progress",label:d==="es"?"En progreso":"In Progress",color:"bg-blue-500"},{id:"completed",label:d==="es"?"Completado":"Done",color:"bg-green-500"}].map(k=>jsxRuntime.jsxs("button",{onClick:()=>E(k.id),className:y("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",l.status===k.id&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:y("w-2 h-2 rounded-full",k.color)}),jsxRuntime.jsx("span",{className:c?"text-white":"text-gray-900",children:k.label})]},k.id))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.User,{className:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Asignados":"Assignees"}),l.assignees&&l.assignees.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[l.assignees.slice(0,3).map((k,O)=>jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:k.color||"#8B5CF6"},title:k.name,children:k.initials||k.name.slice(0,2).toUpperCase()},O)),l.assignees.length>3&&jsxRuntime.jsxs("span",{className:y("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:["+",l.assignees.length-3]})]}):jsxRuntime.jsx("span",{className:y("text-sm",c?"text-[#6B7280]":"text-gray-400"),children:d==="es"?"Sin asignar":"Unassigned"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Fechas":"Dates"}),jsxRuntime.jsxs("button",{onClick:()=>{h(C?null:"start"),v(l.startDate||new Date);},className:y("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-white":"bg-gray-100 hover:bg-gray-200 text-gray-900"),children:[l.startDate?.toLocaleDateString(d==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(d==="es"?"Inicio":"Start"),jsxRuntime.jsx("span",{className:y("mx-1",c?"text-[#6B7280]":"text-gray-400"),children:"\u2192"}),l.endDate?.toLocaleDateString(d==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(d==="es"?"Fin":"End")]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:C&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>h(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:y("absolute left-0 top-full mt-2 z-50 rounded-xl shadow-2xl overflow-hidden flex",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:k=>k.stopPropagation(),children:[jsxRuntime.jsx("div",{className:y("w-44 py-2 border-r",c?"border-white/10":"border-gray-200"),children:(()=>{let k=new Date,O=new Date(k);O.setDate(k.getDate()+1);let _=new Date(k);_.setDate(k.getDate()+7);let re=new Date(k);return re.setDate(k.getDate()+14),[{label:d==="es"?"Hoy":"Today",date:k},{label:d==="es"?"Ma\xF1ana":"Tomorrow",date:O},{label:d==="es"?"Pr\xF3xima semana":"Next week",date:_},{label:d==="es"?"2 semanas":"2 weeks",date:re}].map((de,we)=>jsxRuntime.jsxs("button",{className:y("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",c?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{C==="start"?(T(de.date,l.endDate),h("end")):(T(l.startDate,de.date),h(null));},children:[jsxRuntime.jsx("span",{children:de.label}),jsxRuntime.jsx("span",{className:y("text-xs",c?"text-[#6B7280]":"text-gray-400"),children:de.date.toLocaleDateString(d==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})})]},we))})()}),jsxRuntime.jsxs("div",{className:"p-4 w-[280px]",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:y("text-sm font-medium",c?"text-white":"text-gray-900"),children:C==="start"?d==="es"?"Fecha inicio":"Start date":d==="es"?"Fecha fin":"End date"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>v(new Date(b.getFullYear(),b.getMonth()-1)),className:y("p-1 rounded",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),jsxRuntime.jsx("span",{className:y("text-sm min-w-[100px] text-center",c?"text-white":"text-gray-900"),children:b.toLocaleDateString(d==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>v(new Date(b.getFullYear(),b.getMonth()+1)),className:y("p-1 rounded",c?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(d==="es"?["L","M","M","J","V","S","D"]:["S","M","T","W","T","F","S"]).map((k,O)=>jsxRuntime.jsx("div",{className:y("text-xs text-center py-1",c?"text-[#6B7280]":"text-gray-400"),children:k},O))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:H().map((k,O)=>{let _=k.date.toDateString()===new Date().toDateString(),re=l.startDate?.toDateString()===k.date.toDateString(),de=l.endDate?.toDateString()===k.date.toDateString(),we=l.startDate&&l.endDate&&k.date>=l.startDate&&k.date<=l.endDate;return jsxRuntime.jsx("button",{onClick:()=>{C==="start"?(T(k.date,l.endDate&&k.date>l.endDate?k.date:l.endDate),h("end")):(T(l.startDate&&k.date<l.startDate?k.date:l.startDate,k.date),h(null));},className:y("w-8 h-8 text-xs rounded-lg transition-colors",!k.isCurrentMonth&&(c?"text-[#4B5563]":"text-gray-300"),k.isCurrentMonth&&(c?"text-white":"text-gray-900"),_&&"ring-1 ring-blue-500",(re||de)&&"bg-blue-500 text-white",we&&!re&&!de&&(c?"bg-blue-500/20":"bg-blue-100"),c?"hover:bg-white/10":"hover:bg-gray-100"),children:k.date.getDate()},O)})})]})]})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Flag,{className:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Prioridad":"Priority"}),jsxRuntime.jsx("button",{onClick:()=>{x(),g(!f);},className:y("text-xs px-2 py-1 rounded font-medium transition-all hover:ring-2 hover:ring-white/20",l.priority==="high"||l.priority==="urgent"?"bg-red-500/20 text-red-400":l.priority==="medium"?"bg-yellow-500/20 text-yellow-400":l.priority==="low"?"bg-green-500/20 text-green-400":c?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:l.priority?l.priority==="high"||l.priority==="urgent"?d==="es"?"Alta":"High":l.priority==="medium"?d==="es"?"Media":"Medium":d==="es"?"Baja":"Low":d==="es"?"Sin prioridad":"No priority"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>g(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:y("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",c?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"urgent",label:d==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:d==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:d==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:d==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:d==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(k=>jsxRuntime.jsxs("button",{onClick:()=>{B("priority",k.id),g(false);},className:y("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",c?"hover:bg-white/5":"hover:bg-gray-50",l.priority===k.id&&(c?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:y("w-2 h-2 rounded-full",k.color)}),jsxRuntime.jsx("span",{className:c?"text-white":"text-gray-900",children:k.label})]},k.id||"none"))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Clock,{className:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Duraci\xF3n":"Duration"}),jsxRuntime.jsx("span",{className:y("text-sm",c?"text-white":"text-gray-900"),children:l.startDate&&l.endDate?`${Math.ceil((l.endDate.getTime()-l.startDate.getTime())/(1e3*60*60*24))} ${d==="es"?"d\xEDas":"days"}`:d==="es"?"Sin definir":"Not set"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:y("w-4 h-4 rounded-full border-2",c?"border-[#6B7280]":"border-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Progreso":"Progress"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[D?jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:l.progress||0,onChange:k=>{let O=parseInt(k.target.value),_=l.status;O===100?_="completed":O>0?_="in-progress":_="todo";let re={...l,progress:O,status:_};A(re);},onBlur:()=>N(false),className:y("flex-1 max-w-[120px] h-2 rounded-full appearance-none cursor-pointer",c?"bg-white/10":"bg-gray-200","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[#3B82F6] [&::-webkit-slider-thumb]:cursor-pointer"),autoFocus:true}):jsxRuntime.jsx("button",{onClick:()=>N(true),className:y("flex-1 h-2 rounded-full overflow-hidden max-w-[120px] cursor-pointer hover:ring-2 hover:ring-white/20 transition-all",c?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:y("h-full rounded-full transition-all",l.progress===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${l.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:y("text-sm font-medium min-w-[40px]",c?"text-white":"text-gray-900"),children:[l.progress||0,"%"]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Tag,{className:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Etiquetas":"Tags"}),l.tags&&l.tags.length>0?jsxRuntime.jsx("div",{className:"flex gap-1 flex-wrap",children:l.tags.map((k,O)=>jsxRuntime.jsx("span",{className:"text-xs px-2 py-0.5 rounded",style:{backgroundColor:`${k.color}20`,color:k.color},children:k.name},O))}):jsxRuntime.jsx("span",{className:y("text-sm",c?"text-[#6B7280]":"text-gray-400"),children:d==="es"?"Vac\xEDo":"Empty"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Link2,{className:y("w-4 h-4",c?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:y("text-sm w-24",c?"text-[#9CA3AF]":"text-gray-500"),children:d==="es"?"Relaciones":"Relations"}),jsxRuntime.jsx("span",{className:y("text-sm",c?"text-[#6B7280]":"text-gray-400"),children:l.dependencies&&l.dependencies.length>0?`${l.dependencies.length} ${d==="es"?"dependencias":"dependencies"}`:d==="es"?"Vac\xEDo":"Empty"})]})]}),jsxRuntime.jsxs("div",{className:y("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("button",{className:y("flex items-center gap-2 text-sm transition-colors",c?"text-[#9CA3AF] hover:text-white":"text-gray-500 hover:text-gray-900"),children:[jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),d==="es"?"Agregar descripci\xF3n":"Add description"]}),jsxRuntime.jsxs("button",{className:y("flex items-center gap-2 text-sm mt-2 transition-colors",c?"text-purple-400 hover:text-purple-300":"text-purple-600 hover:text-purple-700"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4"}),d==="es"?"Escribe con IA":"Write with AI"]})]}),jsxRuntime.jsxs("div",{className:y("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:y("text-sm font-semibold mb-3",c?"text-white":"text-gray-900"),children:d==="es"?"Campos personalizados":"Custom fields"}),jsxRuntime.jsxs("button",{className:y("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),d==="es"?"Crea un campo en esta lista":"Create a field in this list"]})]}),jsxRuntime.jsxs("div",{className:y("mt-6 pt-4 border-t",c?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:y("text-sm font-semibold mb-3",c?"text-white":"text-gray-900"),children:d==="es"?"Subtareas":"Subtasks"}),l.subtasks&&l.subtasks.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-3",children:l.subtasks.map(k=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:y("w-4 h-4 rounded border flex items-center justify-center cursor-pointer",k.progress===100?"bg-green-500 border-green-500":c?"border-white/20 hover:border-white/40":"border-gray-300 hover:border-gray-400"),children:k.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:y("text-sm",k.progress===100?"line-through text-[#6B7280]":c?"text-white":"text-gray-900"),children:k.name})]},k.id))}),jsxRuntime.jsxs("button",{className:y("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",c?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),d==="es"?"Agregar subtarea":"Add subtask"]})]})]})]})})]})})}function ps(){let[e,t]=react.useState(()=>core.dragStore.getState());react.useEffect(()=>core.dragStore.subscribe(o=>{t(o);}),[]);let a=react.useCallback(r=>{core.dragStore.setState(r);},[]);return [e,a]}function ir({board:e,callbacks:t,onCardClick:a,renderProps:r,config:o,availableUsers:s=[],className:d,style:p,isLoading:c,error:n,children:m}){let[l,i]=ps(),[u,w]=react.useState(null),f=o?.theme||"dark",g=f==="dark"||f==="neutral",C=g?"dark":"",h=react.useCallback((k,O)=>{t.onCardUpdate?.(k,O);},[t]),b=react.useCallback((k,O)=>{t.onColumnUpdate?.(k,{title:O});},[t]),v=react.useCallback(k=>{t.onColumnDelete?.(k);},[t]),D=["todo","in-progress","completed"],N=core$1.useSensors(core$1.useSensor(core$1.PointerSensor,{activationConstraint:{distance:8}}),core$1.useSensor(core$1.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),A=react.useMemo(()=>{let k=new Map;return e.columns.forEach(O=>{let _=O.cardIds.map(re=>e.cards.find(de=>de.id===re)).filter(re=>re!==void 0).sort((re,de)=>re.position-de.position);k.set(O.id,_);}),k},[e.cards,e.columns]),x=react.useCallback(k=>{let{active:O}=k,_=e.cards.find(re=>re.id===O.id);_&&i({isDragging:true,draggedCardId:_.id,sourceColumnId:_.columnId,targetColumnId:_.columnId});},[e.cards,i]),B=react.useCallback(k=>{let{active:O,over:_}=k;if(!_||!e.cards.find(we=>we.id===O.id))return;let de=null;_.data.current?.type==="column"?de=_.id:_.data.current?.type==="card"&&(de=e.cards.find(Ne=>Ne.id===_.id)?.columnId||null),de&&de!==l.targetColumnId&&i({...l,targetColumnId:de});},[e.cards,l,i]),E=react.useCallback(async k=>{let{active:O,over:_}=k;if(i({isDragging:false,draggedCardId:null,sourceColumnId:null,targetColumnId:null}),!_)return;let re=e.cards.find(R=>R.id===O.id);if(!re)return;let de,we;if(_.data.current?.type==="column"){de=_.id;let R=A.get(de)||[];we=Zn(R,0);}else {let R=e.cards.find(M=>M.id===_.id);if(!R)return;de=R.columnId;let F=A.get(de)||[],z=F.findIndex(M=>M.id===_.id);we=Zn(F,z);}let Ne=e.columns.find(R=>R.id===de);if(Ne&&Ne.wipLimit&&Ne.wipLimitType==="hard"){let R=A.get(de)||[];if(re.columnId!==de&&R.length>=Ne.wipLimit){t.onWipLimitExceeded?.(Ne,re);return}}(re.columnId!==de||re.position!==we)&&await t.onCardMove?.(re.id,de,we);},[e.cards,e.columns,A,t,i]),T=react.useCallback(k=>{w(k),a?.(k);},[a]),H=react.useCallback(k=>{t.onCardUpdate?.(k.id,k),w(k);},[t]);return c?jsxRuntime.jsx("div",{className:y("asakaa-board",C,d),style:p,children:jsxRuntime.jsx(Gm,{columnCount:3})}):n?jsxRuntime.jsx("div",{className:y("asakaa-board",C,d),style:p,children:jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full h-64",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-asakaa-accent-red text-lg font-semibold mb-2",children:"Error loading board"}),jsxRuntime.jsx("p",{className:"text-asakaa-text-secondary text-sm",children:typeof n=="string"?n:n.message})]})})}):jsxRuntime.jsxs(Tl,{themeName:f,children:[jsxRuntime.jsxs(core$1.DndContext,{sensors:N,collisionDetection:core$1.closestCorners,onDragStart:x,onDragOver:B,onDragEnd:E,children:[jsxRuntime.jsxs("div",{className:y("asakaa-board",C,d),style:p,"data-theme":f,children:[e.columns.sort((k,O)=>k.position-O.position).map(k=>{let O=A.get(k.id)||[],_=!D.includes(k.id);return jsxRuntime.jsx(_r,{column:k,cards:O,renderCard:r?.renderCard,renderColumn:r?.renderColumn,renderHeader:r?.renderColumnHeader,renderEmptyState:r?.renderEmptyState,onCardClick:T,onCardUpdate:h,onColumnRename:b,onColumnDelete:v,isDeletable:_,availableUsers:s,allCards:e.cards,enableVirtualization:o?.enableVirtualization,cardHeight:o?.cardHeight},k.id)}),m]}),jsxRuntime.jsx(core$1.DragOverlay,{children:l.draggedCardId?jsxRuntime.jsx(ja,{card:e.cards.find(k=>k.id===l.draggedCardId),render:r?.renderCardOverlay||r?.renderCard,disableDrag:true,className:"opacity-90 rotate-3 shadow-2xl"}):null})]}),jsxRuntime.jsx(ds,{task:u,isOpen:!!u,onClose:()=>w(null),onCardUpdate:H,theme:g?"dark":"light",locale:o?.locale==="es"?"es":"en"})]})}function Gm({columnCount:e}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((t,a)=>jsxRuntime.jsxs("div",{className:"asakaa-column",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-8 mb-3"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-24"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-32"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-28"})]})]},a))})}var Ym={bgGrid:"#0F1117",bgSecondary:"#1A1D25",border:"rgba(255, 255, 255, 0.1)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"#E5E7EB",textSecondary:"#9CA3AF",textTertiary:"#6B7280",accent:"#3B82F6",accentLight:"rgba(59, 130, 246, 0.15)",hoverBg:"rgba(255, 255, 255, 0.05)"},qm={bgGrid:"#FFFFFF",bgSecondary:"#F9FAFB",border:"rgba(0, 0, 0, 0.1)",borderLight:"rgba(0, 0, 0, 0.05)",textPrimary:"#111827",textSecondary:"#6B7280",textTertiary:"#9CA3AF",accent:"#3B82F6",accentLight:"rgba(59, 130, 246, 0.1)",hoverBg:"rgba(0, 0, 0, 0.05)"},Xm={newTask:"Nueva Tarea",selectColumn:"Seleccionar columna",export:"Exportar",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"},Jm={newTask:"New Task",selectColumn:"Select column",export:"Export",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"};function Zm({columns:e,onSelect:t,theme:a,t:r,createTaskLabel:o}){let[s,d]=react.useState(false),p=react.useRef(null);react.useEffect(()=>{let n=m=>{p.current&&!p.current.contains(m.target)&&d(false);};return s&&document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[s]);let c=n=>{t(n),d(false);};return jsxRuntime.jsxs("div",{ref:p,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>d(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(59, 130, 246, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:o||r.newTask}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-48 rounded-lg overflow-hidden z-50",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wider",style:{color:a.textTertiary},children:r.selectColumn}),e.sort((n,m)=>n.position-m.position).map((n,m)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>c(n.id),className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:m<e.length-1?`1px solid ${a.borderLight}`:"none"},whileHover:{backgroundColor:a.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:m*.03},children:[jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:n.color||a.accent}}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:a.textPrimary},children:n.title}),jsxRuntime.jsxs("div",{className:"text-[10px] truncate",style:{color:a.textTertiary},children:[n.cardIds.length," ",n.cardIds.length===1?"tarea":"tareas"]})]})]},n.id))]})})})]})}function Qm({theme:e,t,onExportCSV:a,onExportJSON:r,onExportExcel:o}){let[s,d]=react.useState(false),[p,c]=react.useState(null),n=react.useRef(null);if(react.useEffect(()=>{let u=w=>{n.current&&!n.current.contains(w.target)&&d(false);};return s&&document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[s]),!(a||r||o))return null;let l=[{id:"csv",label:t.exportCSV,description:"Comma-separated",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:a},{id:"json",label:t.exportJSON,description:"Data",icon:jsxRuntime.jsx(lucideReact.FileJson,{className:"w-4 h-4"}),handler:r},{id:"excel",label:t.exportExcel,description:"Spreadsheet",icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-4 h-4"}),handler:o}].filter(u=>u.handler),i=async(u,w)=>{if(w){c(u);try{await w();}catch(f){console.error(`Export ${u} failed:`,f);}finally{c(null),d(false);}}};return jsxRuntime.jsxs("div",{ref:n,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>d(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{backgroundColor:s?e.accent:e.bgSecondary,border:`1px solid ${s?e.accent:e.borderLight}`,color:s?"#FFFFFF":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{scale:1.02,backgroundColor:e.accent,color:"#FFFFFF"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:t.export}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-44 rounded-lg overflow-hidden z-50",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxRuntime.jsx("div",{className:"py-1",children:l.map((u,w)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>i(u.id,u.handler),disabled:p!==null,className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:w<l.length-1?`1px solid ${e.borderLight}`:"none"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:w*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:p===u.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-4 h-4"})}):u.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:e.textPrimary},children:u.label}),jsxRuntime.jsx("div",{className:"text-[10px] truncate",style:{color:e.textTertiary},children:u.description})]})]},u.id))})})})]})}function eu({onClick:e,label:t}){return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:e,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(59, 130, 246, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:t})]})}function us({columns:e,onCreateTask:t,createTaskLabel:a,theme:r="dark",locale:o="es",useColumnSelector:s=false,onExportCSV:d,onExportJSON:p,onExportExcel:c,translations:n}){let m=r==="dark"?Ym:qm,l={...o==="es"?Xm:Jm,...n},i=d||p||c;return jsxRuntime.jsx("div",{className:"h-12 px-4 flex items-center justify-end border-b sticky top-0 z-10",style:{backgroundColor:m.bgGrid,borderColor:m.border},children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[i&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Qm,{theme:m,t:l,onExportCSV:d,onExportJSON:p,onExportExcel:c}),t&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:m.borderLight}})]}),t&&(s?jsxRuntime.jsx(Zm,{columns:e,onSelect:t,theme:m,t:l,createTaskLabel:a}):jsxRuntime.jsx(eu,{onClick:()=>t(),label:a||l.newTask}))]})})}function fs({onAddColumn:e,className:t,placeholder:a="Nombre de la columna...",buttonLabel:r="Agregar Columna",disabled:o=false}){let[s,d]=react.useState(false),[p,c]=react.useState(""),n=react.useCallback(()=>{let i=p.trim();i&&(e(i),c(""),d(false));},[p,e]),m=react.useCallback(i=>{i.key==="Enter"?(i.preventDefault(),n()):i.key==="Escape"&&(c(""),d(false));},[n]),l=react.useCallback(()=>{setTimeout(()=>{p.trim()||d(false);},150);},[p]);return s?jsxRuntime.jsx("div",{className:y("asakaa-add-column asakaa-add-column--editing",t),children:jsxRuntime.jsxs("div",{className:"asakaa-add-column__input-wrapper",children:[jsxRuntime.jsx("input",{type:"text",value:p,onChange:i=>c(i.target.value),onKeyDown:m,onBlur:l,placeholder:a,autoFocus:true,className:"asakaa-add-column__input"}),jsxRuntime.jsxs("div",{className:"asakaa-add-column__actions",children:[jsxRuntime.jsx("button",{onClick:n,disabled:!p.trim(),className:"asakaa-add-column__submit",type:"button",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})}),jsxRuntime.jsx("button",{onClick:()=>{c(""),d(false);},className:"asakaa-add-column__cancel",type:"button",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})}):jsxRuntime.jsx("div",{className:y("asakaa-add-column",t),children:jsxRuntime.jsxs("button",{onClick:()=>d(true),disabled:o,className:"asakaa-add-column__button",type:"button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),r]})})}function hs({columnId:e,onAddCard:t,availableUsers:a=[],className:r,placeholder:o,buttonLabel:s,disabled:d=false,theme:p="dark",locale:c="es"}){let[n,m]=react.useState(false),[l,i]=react.useState(false),[u,w]=react.useState(""),[f,g]=react.useState([]),[C,h]=react.useState(""),[b,v]=react.useState(""),[D,N]=react.useState(""),[A,x]=react.useState(false),[B,E]=react.useState(false),[T,H]=react.useState(false),k=react.useRef(null),O=react.useRef(null),_={placeholder:o||(c==="es"?"Nombre de la tarea...":"Task Name..."),buttonLabel:s||(c==="es"?"Agregar Tarea":"Add Task"),save:c==="es"?"Guardar":"Save",addAssignee:c==="es"?"Agregar asignado":"Add assignee",addDates:c==="es"?"Agregar fechas":"Add dates",addPriority:c==="es"?"Agregar prioridad":"Add priority",startDate:c==="es"?"Inicio":"Start",endDate:c==="es"?"Fin":"End",low:c==="es"?"Baja":"Low",medium:c==="es"?"Media":"Medium",high:c==="es"?"Alta":"High",urgent:c==="es"?"Urgente":"Urgent"},re=react.useCallback(()=>{w(""),g([]),h(""),v(""),N(""),x(false),E(false),H(false),m(false);},[]);react.useEffect(()=>{n&&k.current&&k.current.focus();},[n]),react.useEffect(()=>{if(!n)return;let F=z=>{O.current&&!O.current.contains(z.target)&&(u.trim()||re());};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[n,u,re]);let de=react.useCallback(async()=>{let F=u.trim();if(!(!F||l)){i(true);try{await t({name:F,columnId:e,assigneeIds:f.length>0?f:void 0,startDate:C?new Date(C):void 0,endDate:b?new Date(b):void 0,priority:D||void 0}),w(""),g([]),h(""),v(""),N(""),x(!1),E(!1),H(!1),k.current?.focus();}catch(z){console.error("Error creating card:",z);}finally{i(false);}}},[u,e,f,C,b,D,t,l]),we=react.useCallback(F=>{F.key==="Enter"&&!F.shiftKey?(F.preventDefault(),de()):F.key==="Escape"&&re();},[de,re]),Ne=react.useCallback(F=>{g(z=>z.includes(F)?z.filter(M=>M!==F):[...z,F]);},[]),R=p==="dark";return n?jsxRuntime.jsxs("div",{ref:O,className:y("rounded-lg overflow-hidden shadow-lg",R?"bg-[#1e1e2e]":"bg-white",r),style:{border:"2px solid #10b981"},children:[jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsx("input",{ref:k,type:"text",value:u,onChange:F=>w(F.target.value),onKeyDown:we,placeholder:_.placeholder,disabled:l,className:y("w-full px-0 py-1 text-sm font-medium border-0 bg-transparent focus:outline-none focus:ring-0",R?"text-gray-100 placeholder-gray-500":"text-gray-800 placeholder-gray-400")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-3",children:[a.length>0&&jsxRuntime.jsxs("button",{onClick:()=>x(!A),className:y("flex items-center gap-1 px-2 py-1.5 rounded-md text-xs transition-colors",A||f.length>0?"bg-emerald-500/20 text-emerald-400":R?"text-gray-400 hover:bg-[#2a2a3e] hover:text-gray-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),type:"button",title:_.addAssignee,children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",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"})]}),f.length>0&&jsxRuntime.jsx("span",{className:"ml-0.5",children:f.length})]}),jsxRuntime.jsx("button",{onClick:()=>E(!B),className:y("flex items-center gap-1 px-2 py-1.5 rounded-md text-xs transition-colors",B||C||b?"bg-blue-500/20 text-blue-400":R?"text-gray-400 hover:bg-[#2a2a3e] hover:text-gray-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),type:"button",title:_.addDates,children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),jsxRuntime.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),jsxRuntime.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),jsxRuntime.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),jsxRuntime.jsx("button",{onClick:()=>H(!T),className:y("flex items-center gap-1 px-2 py-1.5 rounded-md text-xs transition-colors",T||D?D==="urgent"?"bg-red-500/20 text-red-400":D==="high"?"bg-orange-500/20 text-orange-400":D==="medium"?"bg-yellow-500/20 text-yellow-400":D==="low"?"bg-green-500/20 text-green-400":"bg-orange-500/20 text-orange-400":R?"text-gray-400 hover:bg-[#2a2a3e] hover:text-gray-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),type:"button",title:_.addPriority,children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"}),jsxRuntime.jsx("line",{x1:"4",y1:"22",x2:"4",y2:"15"})]})}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{onClick:de,disabled:!u.trim()||l,className:y("px-3 py-1.5 rounded-md text-xs font-medium text-white transition-all","bg-emerald-500 hover:bg-emerald-600","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-emerald-500"),type:"button",children:l?jsxRuntime.jsx("div",{className:"w-3 h-3 border-2 border-white/30 border-t-white rounded-full animate-spin"}):_.save})]})]}),A&&a.length>0&&jsxRuntime.jsx("div",{className:y("px-3 pb-3 pt-0","border-t",R?"border-[#3a3a4e]":"border-gray-200"),children:jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 pt-3",children:a.map(F=>jsxRuntime.jsxs("button",{onClick:()=>Ne(F.id),className:y("flex items-center gap-1.5 px-2 py-1 rounded-full text-xs transition-all",f.includes(F.id)?"bg-emerald-500 text-white":R?"bg-[#2a2a3e] text-gray-300 hover:bg-[#3a3a4e]":"bg-gray-100 text-gray-700 hover:bg-gray-200"),type:"button",children:[F.avatar?jsxRuntime.jsx("img",{src:F.avatar,alt:F.name,className:"w-4 h-4 rounded-full"}):jsxRuntime.jsx("div",{className:y("w-4 h-4 rounded-full flex items-center justify-center text-[10px] font-medium",f.includes(F.id)?"bg-emerald-600 text-white":"bg-emerald-500 text-white"),children:F.name.charAt(0).toUpperCase()}),jsxRuntime.jsx("span",{children:F.name.split(" ")[0]})]},F.id))})}),B&&jsxRuntime.jsx("div",{className:y("px-3 pb-3 pt-0","border-t",R?"border-[#3a3a4e]":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:y("block text-[10px] uppercase tracking-wide mb-1",R?"text-gray-500":"text-gray-400"),children:_.startDate}),jsxRuntime.jsx("input",{type:"date",value:C,onChange:F=>h(F.target.value),className:y("w-full px-2 py-1.5 rounded text-xs border",R?"bg-[#2a2a3e] border-[#3a3a4e] text-gray-200":"bg-gray-50 border-gray-200 text-gray-800")})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:y("block text-[10px] uppercase tracking-wide mb-1",R?"text-gray-500":"text-gray-400"),children:_.endDate}),jsxRuntime.jsx("input",{type:"date",value:b,onChange:F=>v(F.target.value),className:y("w-full px-2 py-1.5 rounded text-xs border",R?"bg-[#2a2a3e] border-[#3a3a4e] text-gray-200":"bg-gray-50 border-gray-200 text-gray-800")})]})]})}),T&&jsxRuntime.jsx("div",{className:y("px-3 pb-3 pt-0","border-t",R?"border-[#3a3a4e]":"border-gray-200"),children:jsxRuntime.jsx("div",{className:"flex gap-1.5 pt-3",children:["low","medium","high","urgent"].map(F=>jsxRuntime.jsx("button",{onClick:()=>N(D===F?"":F),className:y("flex-1 px-2 py-1.5 rounded text-xs font-medium transition-all",D===F?`${{low:"bg-green-500",medium:"bg-yellow-500",high:"bg-orange-500",urgent:"bg-red-500"}[F]} text-white`:R?"bg-[#2a2a3e] text-gray-400 hover:bg-[#3a3a4e]":"bg-gray-100 text-gray-600 hover:bg-gray-200"),type:"button",children:_[F]},F))})})]}):jsxRuntime.jsxs("button",{onClick:()=>m(true),disabled:d,className:y("w-full flex items-center gap-2 px-3 py-2 rounded-lg transition-all duration-200","text-emerald-500 hover:text-emerald-400",R?"hover:bg-[#2a2a3e]":"hover:bg-gray-100",d&&"opacity-50 cursor-not-allowed",r),type:"button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:_.buttonLabel})]})}var vo=class extends core.BaseViewAdapter{constructor(a={}){super();this.id="kanban";this.name="Kanban Board";this.version="1.0.0";this.description="";this.icon="";this.supportedExports=["json","csv","pdf","png"];this.root=null;this.description="Interactive Kanban board with drag & drop, filters, and real-time updates",this.icon="\u{1F4CB}",this.kanbanConfig=a,this.options={animations:a.viewOptions?.animations??true,virtualScrolling:a.viewOptions?.virtualScrolling??false,theme:a.viewOptions?.theme??"dark",readonly:a.viewOptions?.readonly??false};}mount(a,r){this.isMounted()&&(console.warn("[KanbanViewAdapter] Already mounted, unmounting first"),this.unmount()),this.container=a,this.data=r,this.root=client.createRoot(a),this.render(),this.emit("view:mounted",{viewId:this.id,timestamp:Date.now()});}unmount(){this.isMounted()&&(this.emit("view:unmounted",{viewId:this.id,timestamp:Date.now()}),this.root&&(this.root.unmount(),this.root=null),this.container&&(this.container.innerHTML="",this.container=null),this.data=null);}update(a){if(!this.isMounted()){console.warn("[KanbanViewAdapter] Not mounted, cannot update");return}this.data=a,this.render(),this.emit("view:updated",{viewId:this.id,data:a});}configure(a){this.options={...this.options,...a},this.isMounted()&&this.render();}async export(a){if(!this.data)throw new Error("No data to export");switch(a){case "json":return JSON.stringify(this.data,null,2);case "csv":return this.exportToCSV();case "pdf":return this.exportToPDF();case "png":return this.exportToPNG();default:throw new Error(`Unsupported export format: ${a}`)}}render(){if(!this.root||!this.data)return;let a={id:this.data.board?.id||"board-1",title:this.data.board?.title||"Untitled Board",columns:this.data.columns,cards:this.data.cards};this.root.render(jsxRuntime.jsx(ir,{board:a,callbacks:this.kanbanConfig.callbacks||{},onCardClick:this.kanbanConfig.onCardClick,renderProps:this.kanbanConfig.renderProps,config:this.kanbanConfig.config,availableUsers:this.kanbanConfig.availableUsers,className:this.kanbanConfig.className,style:this.kanbanConfig.style}));}exportToCSV(){if(!this.data)return "";let a=[["Card ID","Title","Column","Description","Labels","Assignees","Due Date","Position"]];return this.data.cards.forEach(r=>{let o=this.data.columns.find(s=>s.id===r.columnId);a.push([r.id,r.title,o?.title||"",r.description||"",r.labels?.join(", ")||"",r.assignedUserIds?.join(", ")||r.assigneeId||"",r.dueDate?.toString()||"",r.position.toString()]);}),a.map(r=>r.map(o=>`"${o}"`).join(",")).join(`
5
5
  `)}async exportToPDF(){throw new Error("PDF export not yet implemented in ViewAdapter")}async exportToPNG(){if(!this.container)throw new Error("View not mounted");let r=await(await import('html2canvas')).default(this.container,{backgroundColor:this.options.theme==="dark"?"#1a1a1a":"#ffffff",scale:2});return new Promise((o,s)=>{r.toBlob(d=>{d?o(d):s(new Error("Failed to create PNG blob"));},"image/png");})}};function rd(e={}){return new vo(e)}var Yr=class extends react.Component{constructor(a){super(a);this.resetError=()=>{this.setState({hasError:false,error:null,errorInfo:null});};this.state={hasError:false,error:null,errorInfo:null};}static getDerivedStateFromError(a){return {hasError:true,error:a}}componentDidCatch(a,r){let{onError:o,componentName:s}=this.props;if(process.env.NODE_ENV==="development"&&(console.error(`Error in ${s||"Component"}:`,a),console.error("Error Info:",r)),this.setState({errorInfo:r}),o)try{o(a,r);}catch(d){console.error("Error in error handler:",d);}}render(){let{hasError:a,error:r}=this.state,{children:o,fallback:s,componentName:d}=this.props;return a&&r?s?s(r,this.resetError):jsxRuntime.jsx("div",{className:"p-6 rounded-lg border",style:{background:"linear-gradient(135deg, #2d1b1b 0%, #1a1a1a 100%)",borderColor:"rgba(239, 68, 68, 0.3)"},children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"#EF4444",strokeWidth:"2"}),jsxRuntime.jsx("path",{d:"M12 8V12",stroke:"#EF4444",strokeWidth:"2",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"12",cy:"16",r:"1",fill:"#EF4444"})]}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold text-red-400 mb-1",children:d?`Error in ${d}`:"Something went wrong"}),jsxRuntime.jsx("p",{className:"text-sm text-white/70 mb-3",children:r.message||"An unexpected error occurred"}),process.env.NODE_ENV==="development"&&jsxRuntime.jsxs("details",{className:"mb-3",children:[jsxRuntime.jsx("summary",{className:"text-xs text-white/50 cursor-pointer hover:text-white/70 mb-2",children:"Error Details (Development Only)"}),jsxRuntime.jsx("pre",{className:"text-xs text-white/60 bg-black/30 p-3 rounded overflow-auto max-h-48",children:r.stack})]}),jsxRuntime.jsx("button",{onClick:this.resetError,className:"px-4 py-2 rounded-lg text-sm font-medium transition-all hover:bg-red-600/20 border border-red-500/30",style:{color:"#EF4444"},children:"Try Again"})]})]})}):o}};function bs(e,t){let a=r=>jsxRuntime.jsx(Yr,{...t,children:jsxRuntime.jsx(e,{...r})});return a.displayName=`withErrorBoundary(${e.displayName||e.name||"Component"})`,a}function vs({board:e,onCreateCard:t,onNavigateToCard:a,onSearch:r,onChangePriority:o,onAssignUser:s,onGeneratePlan:d,onPredictRisks:p,onOpenAIUsage:c,shortcut:n="k",className:m=""}){let[l,i]=react.useState(false),[u,w]=react.useState(""),[f,g]=react.useState("home"),[C,h]=react.useState(""),[b,v]=react.useState("");react.useEffect(()=>{let x=B=>{(B.metaKey||B.ctrlKey)&&B.key===n&&(B.preventDefault(),i(E=>!E)),B.key==="Escape"&&(i(false),g("home"),w(""));};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[n]),react.useEffect(()=>{l||(g("home"),w(""),h(""),v(""));},[l]);let D=react.useCallback(()=>{i(false);},[]),N=react.useCallback(x=>{let[B,E]=x.split(":");switch(B){case "create-card":g("create-card");break;case "create-card-in":h(E||"");break;case "navigate":E?(a?.(E),D()):g("navigate");break;case "search":r?.(u),D();break;case "priority":g("priority");break;case "set-priority":b&&E&&(o?.(b,E),D());break;case "assign":g("assign");break;case "assign-user":b&&E&&(s?.(b,E),D());break;case "ai":g("ai");break;case "ai-generate-plan":d?.(),D();break;case "ai-predict-risks":p?.(),D();break;case "ai-usage":c?.(),D();break;case "back":g("home");break;}},[u,b,t,a,r,o,s,d,p,c,D]),A=react.useCallback(()=>{C&&u.trim()&&(t?.(C,u.trim()),D());},[C,u,t,D]);return l?jsxRuntime.jsx(nt,{children:jsxRuntime.jsx("div",{className:"command-palette-overlay",onClick:D,children:jsxRuntime.jsx("div",{className:`command-palette ${m}`,onClick:x=>x.stopPropagation(),children:jsxRuntime.jsxs(cmdk.Command,{value:u,onValueChange:w,label:"Command Menu",children:[jsxRuntime.jsxs("div",{className:"command-palette-header",children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"8"}),jsxRuntime.jsx("path",{d:"m21 21-4.35-4.35"})]}),jsxRuntime.jsx(cmdk.Command.Input,{placeholder:f==="create-card"&&C?"Type card title and press Enter...":f==="create-card"?"Select a column first...":"Type a command or search...",className:"command-palette-input",onKeyDown:x=>{x.key==="Enter"&&f==="create-card"&&C&&A();}}),jsxRuntime.jsxs("div",{className:"command-palette-shortcut",children:[jsxRuntime.jsx("kbd",{children:navigator.platform.includes("Mac")?"\u2318":"Ctrl"}),jsxRuntime.jsx("kbd",{children:"K"})]})]}),jsxRuntime.jsxs(cmdk.Command.List,{className:"command-palette-list",children:[jsxRuntime.jsx(cmdk.Command.Empty,{className:"command-palette-empty",children:"No results found."}),f==="home"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Group,{heading:"Actions",className:"command-palette-group",children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"create-card",onSelect:N,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),jsxRuntime.jsx("path",{d:"M12 8v8m-4-4h8"})]}),jsxRuntime.jsx("span",{children:"Create Card"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"C"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"navigate",onSelect:N,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("polyline",{points:"12 16 16 12 12 8"}),jsxRuntime.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}),jsxRuntime.jsx("span",{children:"Navigate to Card"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"G"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"search",onSelect:N,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"8"}),jsxRuntime.jsx("path",{d:"m21 21-4.35-4.35"})]}),jsxRuntime.jsx("span",{children:"Search Cards"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"/"})]})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"AI Features",className:"command-palette-group",children:jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai",onSelect:N,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),jsxRuntime.jsx("span",{children:"AI Commands"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]})}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"Cards",className:"command-palette-group",children:e.cards.slice(0,5).map(x=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${x.id}`,onSelect:N,className:"command-palette-item",children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:x.priority==="URGENT"?"#EF4444":x.priority==="HIGH"?"#F59E0B":x.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsxRuntime.jsx("span",{children:x.title}),x.labels&&x.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:x.labels.slice(0,2).map(B=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:B},B))})]},x.id))})]}),f==="create-card"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:N,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"Select Column",className:"command-palette-group",children:e.columns.map(x=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`create-card-in:${x.id}`,onSelect:N,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("rect",{x:"3",y:"3",width:"7",height:"18",rx:"1"})}),jsxRuntime.jsx("span",{children:x.title}),jsxRuntime.jsxs("div",{className:"command-palette-item-count",children:[x.cardIds.length," cards"]})]},x.id))})]}),f==="navigate"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:N,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"All Cards",className:"command-palette-group",children:e.cards.map(x=>{let B=e.columns.find(E=>E.id===x.columnId);return jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${x.id}`,onSelect:N,className:"command-palette-item",keywords:[x.title,x.description||"",...x.labels||[]],children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:x.priority==="URGENT"?"#EF4444":x.priority==="HIGH"?"#F59E0B":x.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsxRuntime.jsxs("div",{className:"command-palette-item-content",children:[jsxRuntime.jsx("div",{children:x.title}),jsxRuntime.jsx("div",{className:"command-palette-item-meta",children:B?.title})]}),x.labels&&x.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:x.labels.slice(0,2).map(E=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:E},E))})]},x.id)})})]}),f==="ai"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:N,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsxs(cmdk.Command.Group,{heading:"AI Features",className:"command-palette-group",children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-generate-plan",onSelect:N,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),jsxRuntime.jsx("span",{children:"Generate Project Plan"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-predict-risks",onSelect:N,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),jsxRuntime.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),jsxRuntime.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),jsxRuntime.jsx("span",{children:"Predict Risks"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-usage",onSelect:N,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),jsxRuntime.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6"})]}),jsxRuntime.jsx("span",{children:"AI Usage & Costs"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]})]})]})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer",children:[jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"\u2191"}),jsxRuntime.jsx("kbd",{children:"\u2193"}),jsxRuntime.jsx("span",{children:"Navigate"})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"Enter"}),jsxRuntime.jsx("span",{children:"Select"})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"Esc"}),jsxRuntime.jsx("span",{children:"Close"})]})]})]})})})}):null}function sd(e,t,a,r,o){let s=document.getElementById("attachment-lightbox-native");s&&s.remove();let d=document.createElement("div");d.id="attachment-lightbox-native",d.className="attachment-lightbox",d.style.cssText=`
6
6
  position: fixed !important;
7
7
  inset: 0 !important;