@libxai/board 1.9.0 → 1.9.1
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 +9 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/styles.css +13475 -13475
- package/package.json +1 -1
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'),Xf=require('html2canvas'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime'),framerMotion=require('framer-motion'),lucideReact=require('lucide-react'),cmdk=require('cmdk'),by=require('react-markdown'),hy=require('remark-gfm'),yy=require('rehype-sanitize'),recharts=require('recharts'),htmlToImage=require('html-to-image');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Xf__default=/*#__PURE__*/_interopDefault(Xf);var by__default=/*#__PURE__*/_interopDefault(by);var hy__default=/*#__PURE__*/_interopDefault(hy);var yy__default=/*#__PURE__*/_interopDefault(yy);var Qs=(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 Zs=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 [Zs.Translate.toString(e),Zs.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:a,easing:r}=e;return t+" "+a+"ms "+r}}});function c(...e){return tailwindMerge.twMerge(clsx.clsx(e))}function ei(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 jf(e){return Array.from({length:e},(t,a)=>(a+1)*1e3)}function El(e,t){return e.length===0?1e3:t===0?ei(null,e[0].position):t>=e.length?ei(e[e.length-1].position,null):ei(e[t-1].position,e[t].position)}function fu(e,t=100){return e>t}var _f=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 Kf(e,t,a,r){let n=t*Math.pow(a,e-1),s=n*.2*Math.random();return Math.min(n+s,r)}async function ti(e,t={}){let{maxAttempts:a=3,initialDelay:r=1e3,backoffMultiplier:n=2,maxDelay:s=1e4,shouldRetry:o=_f,onRetry:l}=t,d,i=0;for(let u=1;u<=a;u++){i=u;try{return {data:await e(),attempts:i,success:!0}}catch(m){if(d=m,u===a||!o(d,u))return {error:d,attempts:i,success:false};let g=Kf(u,r,n,s);if(l)try{l(d,u,g);}catch(f){console.error("Error in retry callback:",f);}await new Promise(f=>setTimeout(f,g));}}return {error:d||new Error("Unknown error"),attempts:i,success:false}}function qf(e,t=3){let a;for(let r=1;r<=t;r++)try{return {data:e(),success:!0}}catch(n){if(a=n,r===t)return {error:a,success:false}}return {error:a||new Error("Unknown error"),success:false}}function Yf(e,t={}){return async(...a)=>ti(()=>e(...a),t)}var Ml=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 bu=(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))(bu||{}),tn=class tn{constructor(t={}){this.defaultLogHandler=t=>{let{timestamp:a,level:r,message:n,component:s,...o}=t,l=`[${a}] [${r}] [${s}]`,d=Object.keys(o).length>0;switch(r){case "DEBUG":console.debug(l,n,d?o:"");break;case "INFO":console.info(l,n,d?o:"");break;case "WARN":console.warn(l,n,d?o:"");break;case "ERROR":console.error(l,n,d?o:""),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",...tn.globalOptions};}static configure(t){tn.globalOptions={...tn.globalOptions,...t};}child(t){return new tn({...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 ai((a,r)=>{this.log(0,`${t} completed`,{...r,action:t,duration:a});},true):new ai(()=>{},false)}log(t,a,r){if(!this.options.enabled||t<this.options.minLevel)return;let n={timestamp:new Date().toISOString(),level:bu[t],message:a,component:this.options.componentName,...r};this.options.onLog(n);}};tn.globalOptions={};var Pl=tn,ai=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}},hu=new Pl;function Jf(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 Qf(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 o=e.columns.find(l=>l.id===s.columnId);return [s.id,Fl(s.title),Fl(s.description||""),Fl(o?.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 Zf(e,t,a){let r=t;if(!r){let o=document.querySelector(".asakaa-board");o&&(r=o.parentElement||o);}if(r)try{let o=await Xf__default.default(r,{backgroundColor:"#0a0a0a",scale:1.5,logging:!1,useCORS:!0,allowTaint:!0,windowWidth:r.scrollWidth,windowHeight:r.scrollHeight}),l=o.toDataURL("image/png"),d=297,i=210,u=o.width/o.height,m=d-20,p=m/u;p>i-20&&(p=i-20,m=p*u);let g=new jspdf.jsPDF({orientation:"landscape",unit:"mm",format:"a4"});g.setFontSize(16),g.setTextColor(255,255,255),g.setFillColor(10,10,10),g.rect(0,0,d,15,"F"),g.text(e.title||"Kanban Board",10,10);let f=(d-m)/2;return g.addImage(l,"PNG",f,20,m,p),g}catch(o){console.error("Error capturing board:",o);}let n=new jspdf.jsPDF,s=20;return n.setFontSize(20),n.text(e.title||"Kanban Board",20,s),s+=10,n.setFontSize(10),n.setTextColor(128,128,128),n.text(`Exported on ${new Date().toLocaleString()}`,20,s),s+=15,n.setTextColor(0,0,0),e.columns.forEach(o=>{let l=e.cards.filter(d=>d.columnId===o.id);s>250&&(n.addPage(),s=20),n.setFontSize(16),n.setFont("helvetica","bold"),n.text(o.title,20,s),s+=8,l.length===0?(n.setFontSize(10),n.setFont("helvetica","italic"),n.setTextColor(128,128,128),n.text("No cards in this column",20,s),n.setTextColor(0,0,0),s+=10):l.forEach(d=>{if(s>260&&(n.addPage(),s=20),n.setFontSize(12),n.setFont("helvetica","bold"),n.text(d.title,25,s),s+=6,d.description){n.setFontSize(9),n.setFont("helvetica","normal");let u=n.splitTextToSize(d.description,160);n.text(u,25,s),s+=u.length*5;}let i=[];if(d.priority&&i.push(`Priority: ${d.priority}`),d.labels&&d.labels.length>0&&i.push(`Labels: ${d.labels.join(", ")}`),d.assignedUserIds&&d.assignedUserIds.length>0&&i.push(`Assigned: ${d.assignedUserIds.length} user(s)`),d.startDate||d.endDate){let u=[];d.startDate&&u.push(`Start: ${d.startDate}`),d.endDate&&u.push(`End: ${d.endDate}`),i.push(u.join(" \u2192 "));}i.length>0&&(n.setFontSize(8),n.setTextColor(100,100,100),n.text(i.join(" \u2022 "),25,s),n.setTextColor(0,0,0),s+=5),s+=5;}),s+=5;}),n}function Fl(e){return e.includes(",")||e.includes('"')||e.includes(`
|
|
3
3
|
`)?`"${e.replace(/"/g,'""')}"`:e}async function xu(e,t,a,r){switch(t){case "json":return Jf(e,r);case "csv":return Qf(e);case "pdf":return await Zf(e,a);default:throw new Error(`Unsupported export format: ${t}`)}}function vu(e,t,a){let r=`board-export-${new Date().getTime()}`;if(t==="pdf"&&typeof e=="object"&&e!==null&&"save"in e){let u=`${r}.pdf`;e.save(u);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]}`,o={json:"application/json",csv:"text/csv",pdf:"application/pdf"},l=new Blob([e],{type:o[t]}),d=URL.createObjectURL(l),i=document.createElement("a");i.href=d,i.download=s,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(d);}function eb(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 tb(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=wu(t[0]),r=[],n=new Map,s=[];for(let o=1;o<t.length;o++)try{let l=wu(t[o]||"");if(l.length>a.length){s.push(`Line ${o+1}: Too many columns`);continue}if(a.length-l.length>3){s.push(`Line ${o+1}: Column count mismatch (expected ${a.length}, got ${l.length})`);continue}for(;l.length<a.length;)l.push("");let i={};a.forEach((g,f)=>{i[g]=l[f]||"";});let u=i.Column||"Unnamed";n.has(u)||n.set(u,{id:`col-${n.size+1}`,title:u,position:n.size+1,cardIds:[]});let m=n.get(u),p={id:i["Card ID"]||`card-${o}`,title:i.Title||"Untitled",description:i.Description?i.Description:void 0,columnId:m.id,position:m.cardIds.length+1,priority:i.Priority||void 0,labels:i.Labels?i.Labels.split(";").filter(Boolean):void 0,assignedUserIds:i["Assigned Users"]?i["Assigned Users"].split(";").filter(Boolean):void 0,startDate:i["Start Date"]?i["Start Date"]:void 0,endDate:i["End Date"]?i["End Date"]:void 0,createdAt:i["Created At"]?i["Created At"]:void 0,updatedAt:i["Updated At"]?i["Updated At"]:void 0};r.push(p),m.cardIds.push(p.id);}catch(l){s.push(`Line ${o+1}: ${l instanceof Error?l.message:"Unknown error"}`);}return r.length===0?{success:!1,errors:["No valid cards found in CSV",...s]}:{success:!0,cardsImported:r.length,columnsImported:n.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 wu(e){let t=[],a="",r=false;for(let n=0;n<e.length;n++){let s=e[n],o=e[n+1];s==='"'&&r&&o==='"'?(a+='"',n++):s==='"'?r=!r:s===","&&!r?(t.push(a),a=""):a+=s;}return t.push(a),t}function ku(e,t){switch(t){case "json":return eb(e);case "csv":return tb(e);default:return {success:false,errors:[`Unsupported import format: ${t}`]}}}function Cu(e){return new Promise((t,a)=>{let r=new FileReader;r.onload=n=>{n.target?.result?t(n.target.result):a(new Error("Failed to read file"));},r.onerror=()=>a(new Error("Failed to read file")),r.readAsText(e);})}var Al=react.createContext(null);function Tu(){return react.useContext(Al)}var Nu=react.createContext(null);function Du({children:e,themeName:t}){return jsxRuntime.jsx(Nu.Provider,{value:{themeName:t},children:e})}function Dn(){return react.useContext(Nu)}function Qt({children:e,container:t}){let[a,r]=react.useState(false),n=Tu(),s=Dn();if(react.useEffect(()=>(r(true),()=>r(false)),[]),!a)return null;let o=t||(typeof document<"u"?document.body:null);if(!o)return null;if(n){let{theme:l,themeName:d}=n,i={"--asakaa-color-background-primary":l.bgPrimary,"--asakaa-color-background-secondary":l.bgSecondary,"--asakaa-color-background-card":l.bgGrid,"--asakaa-color-background-hover":l.hoverBg,"--asakaa-color-text-primary":l.textPrimary,"--asakaa-color-text-secondary":l.textSecondary,"--asakaa-color-text-tertiary":l.textTertiary,"--asakaa-color-text-inverse":l.taskBarHandle||"#FFFFFF","--asakaa-color-border-default":l.border,"--asakaa-color-border-hover":l.borderLight,"--asakaa-color-border-subtle":l.borderLight,"--asakaa-color-interactive-primary":l.accent,"--asakaa-color-interactive-primaryHover":l.accentHover,"--asakaa-color-interactive-primaryBorder":`${l.accent}4D`,"--asakaa-color-interactive-primaryBackground":`${l.accent}1A`,"--asakaa-color-interactive-primaryBackgroundHover":`${l.accent}33`,"--asakaa-color-status-success":l.statusCompleted,"--asakaa-color-status-warning":l.milestone,"--asakaa-color-status-error":l.criticalPath,"--asakaa-color-danger":l.criticalPath,"--asakaa-color-danger-border":`${l.criticalPath}4D`,"--asakaa-color-danger-background":`${l.criticalPath}14`,"--asakaa-color-danger-backgroundHover":`${l.criticalPath}26`};return reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":d,"data-gantt-portal":"true",style:i,children:e}),o)}return s?reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":s.themeName,"data-kanban-portal":"true",children:e}),o):reactDom.createPortal(e,o)}var Fu={URGENT:{label:"Urgent",color:"#EF4444"},HIGH:{label:"High",color:"#F97316"},MEDIUM:{label:"Normal",color:"#F59E0B"},LOW:{label:"Low",color:"#10B981"}},db="#BDC3C7",cb=({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 an({priority:e,onChange:t,className:a}){let[r,n]=react.useState(false),[s,o]=react.useState({top:0,left:0}),l=react.useRef(null),d=react.useRef(null),i=()=>{if(!d.current)return;let g=d.current.getBoundingClientRect(),f=window.innerHeight,x=window.innerWidth,y=160,b=220,h=4,v=g.right-y;v<10&&(v=g.left),v+y>x-10&&(v=x-y-10);let w=f-g.bottom,D=g.top,S;w>=b+h?S=g.bottom+h:D>=b+h?S=g.top-b-h:S=w>=D?g.bottom+h:Math.max(10,g.top-b-h),o({top:S,left:v}),n(true);};react.useEffect(()=>{let g=f=>{l.current&&!l.current.contains(f.target)&&!d.current?.contains(f.target)&&n(false);};if(r)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[r]),react.useEffect(()=>{let g=f=>{f.key==="Escape"&&n(false);};if(r)return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]);let u=g=>{t(g),n(false);},m=e?Fu[e]:null,p=m?.color||db;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:d,onClick:()=>r?n(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:e?`${p}10`:"transparent",boxShadow:e?`0 0 0 2px ${p}30 inset`:"none"},title:m?.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:p,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:p,fillOpacity:e?"0.6":"0.4"})})}),r&&jsxRuntime.jsx(Qt,{children:jsxRuntime.jsxs("div",{ref:l,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(Fu).map(([g,f])=>jsxRuntime.jsxs("button",{onClick:()=>u(g),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:f.color,background:"transparent"},onMouseEnter:x=>{x.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:x=>{x.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(cb,{color:f.color}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:f.label}),e===g&&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:"#00E5CC",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},g)),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:()=>u(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:g=>{g.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:g=>{g.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:"#00E5CC",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})]})})]})}var ub=[{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 is({startDate:e,endDate:t,onChange:a,className:r}){let[n,s]=react.useState(false),[o,l]=react.useState({top:0,left:0}),d=react.useRef(null),i=react.useRef(null),p=(Dn()?.themeName||"dark")==="dark",g=()=>{if(!i.current)return;let v=i.current.getBoundingClientRect(),w=window.innerHeight,D=window.innerWidth,S=320,M=380,T=4,F=v.left;F+S>D-10&&(F=D-S-10),F<10&&(F=10);let A=w-v.bottom,C=v.top,_;A>=M+T?_=v.bottom+T:C>=M+T?_=v.top-M-T:_=A>=C?v.bottom+T:Math.max(10,v.top-M-T),l({top:_,left:F}),s(true);};react.useEffect(()=>{let v=w=>{d.current&&!d.current.contains(w.target)&&!i.current?.contains(w.target)&&s(false);};if(n)return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[n]),react.useEffect(()=>{let v=w=>{w.key==="Escape"&&s(false);};if(n)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[n]);let f=v=>{let w=new Date,D=F=>{let A=F.getFullYear(),C=String(F.getMonth()+1).padStart(2,"0"),_=String(F.getDate()).padStart(2,"0");return `${A}-${C}-${_}`},S=D(w),M=new Date(w);M.setDate(M.getDate()+v);let T=D(M);a(S,T),s(false);},x=()=>{if(!e||!t)return "Set date";let v=M=>{if(M instanceof Date)return M;if(typeof M!="string"||!M.match(/^\d{4}-\d{2}-\d{2}$/))return null;let T=M.split("-").map(Number);if(T.length!==3||T.some(_=>isNaN(_)))return null;let F=T[0],A=T[1],C=T[2];return F===void 0||A===void 0||C===void 0?null:new Date(F,A-1,C)},w=v(e),D=v(t);if(!w||!D||isNaN(w.getTime())||isNaN(D.getTime()))return "Set date";let S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return `${S[w.getMonth()]} ${w.getDate()} \u2013 ${S[D.getMonth()]} ${D.getDate()}`},y=e&&t,h=(()=>{if(!t)return false;let v=typeof t=="string"?new Date(t):t,w=new Date;return w.setHours(0,0,0,0),v<w})();return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsxs("button",{ref:i,onClick:()=>n?s(false):g(),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:y?`${x()}`:"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:x()})]}),n&&jsxRuntime.jsx(Qt,{children:jsxRuntime.jsxs("div",{ref:d,className:"date-picker-menu rounded-xl shadow-2xl border min-w-[320px]",style:{position:"fixed",top:`${o.top}px`,left:`${o.left}px`,background:p?"#1A1D25":"#FFFFFF",border:`1px solid ${p?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.12)"}`,boxShadow:p?"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:p?"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:p?"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:ub.map(v=>jsxRuntime.jsx("button",{onClick:()=>f(v.days),className:"px-3 py-2.5 rounded-lg text-xs font-semibold transition-all active:scale-95",style:{color:p?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",border:`1px solid ${p?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)"}`,backgroundColor:p?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)"},onMouseEnter:w=>{w.currentTarget.style.backgroundColor=p?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.1)",w.currentTarget.style.border=`1px solid ${p?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.25)"}`;},onMouseLeave:w=>{w.currentTarget.style.backgroundColor=p?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",w.currentTarget.style.border=`1px solid ${p?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)"}`;},children:v.label},v.label))})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:p?"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:v=>a(v.target.value,t),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:p?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",borderColor:p?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)",color:p?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",colorScheme:p?"dark":"light"}}),jsxRuntime.jsx("input",{type:"date",value:t||"",onChange:v=>a(e,v.target.value),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:p?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",borderColor:p?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)",color:p?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",colorScheme:p?"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:v=>{v.currentTarget.style.background="rgba(239, 68, 68, 0.2)";},onMouseLeave:v=>{v.currentTarget.style.background="rgba(239, 68, 68, 0.1)";},children:"Clear Dates"})]})]})})]})}function on({assignedUsers:e=[],availableUsers:t,onChange:a,className:r,maxVisibleAvatars:n=3}){let[s,o]=react.useState(false),[l,d]=react.useState(""),[i,u]=react.useState({top:0,left:0}),m=react.useRef(null),p=react.useRef(null),g=()=>{if(!p.current)return;let h=p.current.getBoundingClientRect(),v=window.innerHeight,w=window.innerWidth,D=300,S=380,M=4,T=h.right-D;T<10&&(T=h.left),T+D>w-10&&(T=w-D-10);let F=v-h.bottom,A=h.top,C;F>=S+M?C=h.bottom+M:A>=S+M?C=h.top-S-M:C=F>=A?h.bottom+M:Math.max(10,h.top-S-M),u({top:C,left:T}),o(true);};react.useEffect(()=>{let h=v=>{m.current&&!m.current.contains(v.target)&&!p.current?.contains(v.target)&&(o(false),d(""));};if(s)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s]),react.useEffect(()=>{let h=v=>{v.key==="Escape"&&(o(false),d(""));};if(s)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[s]);let f=h=>{let v=e.some(w=>w.id===h.id);a(v?e.filter(w=>w.id!==h.id):[...e,h]);},x=t.filter(h=>h.name.toLowerCase().includes(l.toLowerCase())),y=e.slice(0,n),b=e.length-n;return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:p,onClick:()=>s?o(false):g(),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:[y.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)),b>0&&jsxRuntime.jsxs("div",{className:"asakaa-avatar",children:["+",b]})]}):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(Qt,{children:jsxRuntime.jsxs("div",{ref:m,className:"user-selector-menu rounded-xl shadow-2xl border min-w-[300px]",style:{position:"fixed",top:`${i.top}px`,left:`${i.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:l,onChange:h=>d(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:x.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"}):x.map(h=>{let v=e.some(w=>w.id===h.id);return jsxRuntime.jsxs("button",{onClick:()=>f(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:w=>{w.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.1))";},onMouseLeave:w=>{w.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:v?"#00E5CC":"transparent"},children:v?"\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([]),o(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 ri(e,t,a){let r=new Map;e.forEach(d=>{if(d.dependencies&&Array.isArray(d.dependencies)){let i=d.dependencies.map(u=>{if(typeof u=="string")return u;let m=u;return m.taskId||m.targetId||""}).filter(Boolean);r.set(d.id,i);}});let n=r.get(a)||[];r.set(a,[...n,t]);let s=new Set,o=new Set,l=d=>{if(!s.has(d)){s.add(d),o.add(d);let i=r.get(d)||[];for(let u of i){if(!s.has(u)&&l(u))return true;if(o.has(u))return true}}return o.delete(d),false};return l(a)}function ds({currentCardId:e,dependencies:t=[],availableTasks:a,onChange:r,className:n,validateCircular:s=true,onCircularDependencyError:o}){let[l,d]=react.useState(false),[i,u]=react.useState(""),[m,p]=react.useState(t.length>0),[g,f]=react.useState({top:0,left:0}),[x,y]=react.useState(null),b=react.useRef(null),h=react.useRef(null),v=()=>{if(!h.current)return;let T=h.current.getBoundingClientRect(),F=window.innerHeight,A=window.innerWidth,C=300,_=m?380:120,W=4,oe=T.right-C;oe<10&&(oe=T.left),oe+C>A-10&&(oe=A-C-10);let L=F-T.bottom,Y=T.top,K;L>=_+W?K=T.bottom+W:Y>=_+W?K=T.top-_-W:K=L>=Y?T.bottom+W:Math.max(10,T.top-_-W),f({top:K,left:oe}),d(true);};react.useEffect(()=>{if(!l||!h.current)return;let T=h.current.getBoundingClientRect(),F=window.innerHeight,A=window.innerWidth,C=300,_=m?380:120,W=4,oe=T.right-C;oe<10&&(oe=T.left),oe+C>A-10&&(oe=A-C-10);let L=F-T.bottom,Y=T.top,K;L>=_+W?K=T.bottom+W:Y>=_+W?K=T.top-_-W:K=L>=Y?T.bottom+W:Math.max(10,T.top-_-W),f({top:K,left:oe});},[m,l]),react.useEffect(()=>{let T=F=>{b.current&&!b.current.contains(F.target)&&!h.current?.contains(F.target)&&(d(false),u(""));};if(l)return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[l]),react.useEffect(()=>{let T=F=>{F.key==="Escape"&&(d(false),u(""));};if(l)return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[l]);let w=T=>{let F=t.includes(T),A=a.find(C=>C.id===T);if(y(null),F){let C=t.filter(_=>_!==T);r(C),C.length===0&&p(false);}else {if(s&&ri(a,T,e)){let _=`Cannot add "${A?.title||T}" as dependency - would create circular reference`;y(_),o?.(T,A?.title||T),setTimeout(()=>y(null),3e3);return}r([...t,T]),p(true);}},D=()=>{let T=!m;p(T),T||r([]);},S=a.filter(T=>T.id!==e).filter(T=>T.title.toLowerCase().includes(i.toLowerCase())||T.id.toLowerCase().includes(i.toLowerCase())),M=t.length>0?"#00E5CC":"#BDC3C7";return jsxRuntime.jsxs("div",{className:`relative ${n||""}`,children:[jsxRuntime.jsxs("button",{ref:h,onClick:()=>l?d(false):v(),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:M,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),t.length>0&&jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:M},children:t.length})]}),l&&jsxRuntime.jsx(Qt,{children:jsxRuntime.jsxs("div",{ref:b,className:"dependencies-selector-menu rounded-xl shadow-2xl border min-w-[300px]",style:{position:"fixed",top:`${g.top}px`,left:`${g.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:[x&&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:x})]}),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:m?"#00E5CC":"transparent",borderColor:m?"#00E5CC":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:m&&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"})]})}),m&&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:i,onChange:T=>u(T.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:S.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"}):S.map(T=>{let F=t.includes(T.id);return jsxRuntime.jsxs("button",{onClick:()=>w(T.id),className:"w-full px-4 py-2 flex items-start gap-3 text-sm transition-colors",style:{background:"transparent"},onMouseEnter:A=>{A.currentTarget.style.background="var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))";},onMouseLeave:A=>{A.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:F?"#00E5CC":"transparent",borderColor:F?"#00E5CC":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:F&&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:T.title}),jsxRuntime.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:T.id})]})]},T.id)})})]}),t.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-2 border-t border-white/5",children:jsxRuntime.jsx("button",{onClick:()=>{r([]),p(false),d(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 ko=react.memo(({card:e,render:t,onClick:a,isSelected:r,disableDrag:n,className:s,onUpdate:o,availableUsers:l=[],allCards:d=[]})=>{let{attributes:i,listeners:u,setNodeRef:m,transform:p,transition:g,isDragging:f}=sortable.useSortable({id:e.id,disabled:n,data:{type:"card",card:e}}),x={transform:Zs.Transform.toString(p),transition:g};if(t)return jsxRuntime.jsx("div",{ref:m,style:x,...i,...u,onClick:()=>a?.(e),children:t(e)});let y=l.filter(w=>e.assignedUserIds?.includes(w.id)),b=e.progress===100,h=(e.attachments||[]).filter(w=>w.type.startsWith("image/")),v={...x,...e.color&&{borderTopWidth:"3px",borderTopStyle:"solid",borderTopColor:e.color}};return jsxRuntime.jsxs("div",{ref:m,style:v,className:c("asakaa-card",f&&"asakaa-card-dragging",r&&"ring-2 ring-asakaa-accent-blue",s),...i,...u,onClick:w=>{w.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:w=>{w.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:w=>{w.currentTarget.style.display="none";}}):jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1",children:h.slice(0,4).map((w,D)=>jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("img",{src:w.url,alt:w.name,className:"w-full h-16 object-cover rounded",loading:"lazy",decoding:"async",style:{imageRendering:"auto",WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",transform:"translateZ(0)"},onError:S=>{S.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]})})]},w.id))})}),jsxRuntime.jsx("h3",{className:"asakaa-card-title mb-2",style:{textDecoration:b?"line-through":"none",opacity:b?.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:w=>w.stopPropagation(),className:"priority-selector",children:jsxRuntime.jsx(an,{priority:e.priority,onChange:w=>o?.(e.id,{priority:w})})}),jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"date-picker",children:jsxRuntime.jsx(is,{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:(w,D)=>o?.(e.id,{startDate:w,endDate:D})})}),l.length>0&&jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"user-selector",children:jsxRuntime.jsx(on,{assignedUsers:y,availableUsers:l,onChange:w=>o?.(e.id,{assignedUserIds:w.map(D=>D.id)})})}),jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"dependencies-selector",children:jsxRuntime.jsx(ds,{currentCardId:e.id,dependencies:Array.isArray(e.dependencies)?e.dependencies.map(w=>typeof w=="string"?w:w.taskId):[],availableTasks:d,onChange:w=>o?.(e.id,{dependencies:w})})})]}),e.labels&&e.labels.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.labels.slice(0,3).map(w=>jsxRuntime.jsx("span",{className:"asakaa-label",children:w},w))}),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:"#00E5CC"},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:"#00E5CC"}})})]})]})},(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&&e.render===t.render&&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)));ko.displayName="Card";var oi={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"}},Uu=({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 Wu({status:e="todo",onChange:t,className:a,customStatuses:r=[]}){let[n,s]=react.useState(false),[o,l]=react.useState({top:0,left:0}),d=react.useRef(null),i=react.useRef(null),u=[...Object.entries(oi).map(([y,b])=>({id:y,label:b.label,color:b.color,icon:b.icon})),...r.filter(y=>!Object.keys(oi).includes(y.id)).map(y=>({id:y.id,label:y.title,color:y.color||"#8B5CF6",icon:"circle-dot"}))],m=()=>{let y=oi[e];if(y)return {...y,id:e};let b=r.find(h=>h.id===e);return b?{id:b.id,label:b.title,color:b.color||"#8B5CF6",icon:"circle-dot"}:{...oi.todo,id:"todo"}},p=()=>{if(!i.current)return;let y=i.current.getBoundingClientRect(),b=window.innerHeight,h=window.innerWidth,v=180,w=280,D=4,S=y.right-v;S<10&&(S=y.left),S+v>h-10&&(S=h-v-10);let M=b-y.bottom,T=y.top,F;M>=w+D?F=y.bottom+D:T>=w+D?F=y.top-w-D:F=M>=T?y.bottom+D:Math.max(10,y.top-w-D),l({top:F,left:S}),s(true);};react.useEffect(()=>{let y=b=>{d.current&&!d.current.contains(b.target)&&!i.current?.contains(b.target)&&s(false);};if(n)return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n]),react.useEffect(()=>{let y=b=>{b.key==="Escape"&&s(false);};if(n)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]);let g=y=>{t(y),s(false);},f=m(),x=f.color;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:i,onClick:()=>n?s(false):p(),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:`${x}10`,boxShadow:`0 0 0 2px ${x}30 inset`},title:f.label,children:jsxRuntime.jsx(Uu,{icon:f.icon,color:x})}),n&&jsxRuntime.jsx(Qt,{children:jsxRuntime.jsxs("div",{ref:d,className:"status-selector-menu",style:{position:"fixed",top:`${o.top}px`,left:`${o.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:u.map(y=>jsxRuntime.jsxs("button",{onClick:()=>g(y.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:y.color,background:"transparent"},onMouseEnter:b=>{b.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:b=>{b.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(Uu,{icon:y.icon,color:y.color}),jsxRuntime.jsx("span",{className:"font-semibold",children:y.label}),e===y.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:"#00E5CC",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},y.id))})]})})]})}var Vu={en:{renameColumn:"Rename Column",rename:"Rename",delete:"Delete",columnName:"Column name",columnOptions:"Column options"},es:{renameColumn:"Renombrar Columna",rename:"Renombrar",delete:"Eliminar",columnName:"Nombre de columna",columnOptions:"Opciones de columna"}};function Gu({columnTitle:e,onRename:t,onDelete:a,isDeletable:r=false,className:n,locale:s="en"}){let o=Vu[s]||Vu.en,[l,d]=react.useState(false),[i,u]=react.useState(false),[m,p]=react.useState(e),[g,f]=react.useState({top:0,left:0}),x=react.useRef(null),y=react.useRef(null),b=react.useRef(null);react.useEffect(()=>{if(l&&y.current){let D=y.current.getBoundingClientRect();f({top:D.bottom+window.scrollY+8,left:D.left+window.scrollX});}},[l]),react.useEffect(()=>{let D=S=>{x.current&&!x.current.contains(S.target)&&!y.current?.contains(S.target)&&(d(false),u(false));};if(l)return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[l]),react.useEffect(()=>{let D=S=>{S.key==="Escape"&&(d(false),u(false),p(e));};if(l)return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[l,e]),react.useEffect(()=>{i&&b.current&&(b.current.focus(),b.current.select());},[i]);let h=()=>{u(true),p(e);},v=()=>{let D=m.trim();D&&D!==e&&t(D),u(false),d(false),p(e);},w=D=>{D.key==="Enter"?v():D.key==="Escape"&&(u(false),p(e));};return jsxRuntime.jsxs("div",{className:`relative ${n||""}`,children:[jsxRuntime.jsx("button",{ref:y,onClick:()=>d(!l),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-white/10",title:o.columnOptions,"aria-label":o.columnOptions,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"})]})}),l&&jsxRuntime.jsx(Qt,{children:jsxRuntime.jsx("div",{ref:x,className:"fixed rounded-xl shadow-2xl border min-w-[200px]",style:{top:`${g.top}px`,left:`${g.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:i?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:o.renameColumn}),jsxRuntime.jsx("input",{ref:b,type:"text",value:m,onChange:D=>p(D.target.value),onKeyDown:w,onBlur:v,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-[#00E5CC]/50 transition-all",placeholder:o.columnName,maxLength:50})]}):jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsxs("button",{onClick:h,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:o.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:o.delete})]})]})]})})})]})}var Mn=react.memo(({column:e,cards:t,renderColumn:a,renderCard:r,renderHeader:n,renderEmptyState:s,onCardClick:o,onCardUpdate:l,availableUsers:d,allCards:i,enableVirtualization:u,cardHeight:m=120,isCollapsed:p,onToggleCollapse:g,onColumnRename:f,onColumnDelete:x,isDeletable:y=false,className:b,renderMetrics:h,locale:v})=>{let{setNodeRef:w,isOver:D}=core$1.useDroppable({id:e.id,data:{type:"column",column:e}}),S=react.useRef(null),M=u??fu(t.length),T=reactVirtual.useVirtualizer({count:t.length,getScrollElement:()=>S.current,estimateSize:()=>m,enabled:M});if(a)return jsxRuntime.jsx("div",{ref:w,className:b,children:a(e,t)});let A=(()=>{if(!e.wipLimit)return {state:"none",percentage:0};let W=t.length/e.wipLimit*100;return t.length>e.wipLimit?{state:"exceeded",percentage:W}:W>=80?{state:"warning",percentage:W}:W>=60?{state:"approaching",percentage:W}:{state:"ok",percentage:W}})(),C=A.state==="exceeded",_=()=>"asakaa-column-count";return jsxRuntime.jsxs("div",{ref:w,className:c("asakaa-column",D&&"ring-2 ring-asakaa-accent-blue",C&&"ring-2 ring-asakaa-accent-red",b),children:[n?n(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:c(_()),children:[t.length,e.wipLimit&&` / ${e.wipLimit}`]}),e.wipLimit&&A.state!=="none"&&jsxRuntime.jsxs("span",{className:"text-xs font-medium flex items-center",title:`${A.percentage.toFixed(0)}% capacity${e.wipLimitType==="hard"?" (Hard limit - blocks new cards)":" (Soft limit - shows warning)"}`,children:[A.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"})]}),A.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"})]}),A.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"})}),A.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"})]})]}),(f||x)&&jsxRuntime.jsx(Gu,{columnTitle:e.title,onRename:W=>f?.(e.id,W),onDelete:x?()=>x(e.id):void 0,isDeletable:y,locale:v}),g&&jsxRuntime.jsx("button",{onClick:g,className:"text-asakaa-text-tertiary hover:text-asakaa-text-primary","aria-label":p?"Expand column":"Collapse column",children:p?"\u25B6":"\u25BC"})]})]}),h&&h(e,t),!p&&jsxRuntime.jsx("div",{ref:S,className:"asakaa-column-cards",style:{maxHeight:M?"600px":void 0},children:jsxRuntime.jsx(sortable.SortableContext,{items:t.map(W=>W.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"})}):M?jsxRuntime.jsx("div",{style:{height:`${T.getTotalSize()}px`,position:"relative"},children:T.getVirtualItems().map(W=>{let oe=t[W.index];return oe?jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${W.start}px)`},children:jsxRuntime.jsx(ko,{card:oe,render:r,onClick:o,onUpdate:l,availableUsers:d,allCards:i})},oe.id):null})}):t.map(W=>jsxRuntime.jsx(ko,{card:W,render:r,onClick:o,onUpdate:l,availableUsers:d,allCards:i},W.id))})})]})});Mn.displayName="Column";function Ol({title:e,onSave:t,className:a}){let[r,n]=react.useState(false),[s,o]=react.useState(e),l=react.useRef(null);react.useEffect(()=>{r&&l.current&&(l.current.focus(),l.current.select());},[r]);let d=()=>{let u=s.trim();u&&u!==e?t(u):o(e),n(false);},i=u=>{u.key==="Enter"?d():u.key==="Escape"&&(o(e),n(false));};return r?jsxRuntime.jsx("input",{ref:l,type:"text",value:s,onChange:u=>o(u.target.value),onBlur:d,onKeyDown:i,className:c("asakaa-column-title bg-transparent border-b-2 border-[#00E5CC]","outline-none px-1 -ml-1",a),maxLength:50}):jsxRuntime.jsx("h2",{className:c("asakaa-column-title cursor-pointer",a),onClick:()=>n(true),title:"Click to edit",children:e})}function Fb(e,t){let a=e.slice(0,t),r=a.lastIndexOf("@");if(r===-1)return null;let n=a[r-1];if(r>0&&n&&!/\s/.test(n))return null;let s=a.slice(r+1);return /\s/.test(s)?null:{start:r,end:t,query:s.toLowerCase()}}function Xu(e,t){let a=[],r=/@(\S+)/g,n;for(;(n=r.exec(e))!==null;){let s=n[1]?.toLowerCase()??"";if(!s)continue;let o=t.find(l=>{let d=l.name.toLowerCase(),i=d.replace(/\s+/g,""),u=d.split(/\s+/);return !!(i===s||d===s||u.some(m=>m===s))});o&&!a.includes(o.id)&&a.push(o.id);}return a}function Ab(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function Lb(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}var Ib=["\u{1F600}","\u{1F602}","\u{1F970}","\u{1F60D}","\u{1F914}","\u{1F44D}","\u{1F44E}","\u{1F389}","\u{1F525}","\u2764\uFE0F","\u{1F4AF}","\u2705","\u274C","\u26A0\uFE0F","\u{1F4CC}","\u{1F4A1}","\u{1F680}","\u2B50","\u{1F3AF}","\u{1F4AA}","\u{1F64F}","\u{1F440}","\u{1F4DD}","\u{1F4AC}"];function Ju({value:e,onChange:t,onSubmit:a,users:r,placeholder:n,disabled:s=false,isSubmitting:o=false,theme:l="dark",locale:d="es",currentUser:i,enableEmoji:u=true,enableAttachments:m=true,pendingFiles:p=[],onFilesSelect:g,onRemoveFile:f,maxFileSizeMB:x=10}){let y=l==="dark",[b,h]=react.useState(false),[v,w]=react.useState([]),[D,S]=react.useState(0),[M,T]=react.useState(null),[F,A]=react.useState(false),C=react.useRef(null),_=react.useRef(null),W=react.useRef(null),oe=react.useRef(null),L=react.useCallback((R,ae)=>{let be=Fb(R,ae);if(T(be),be){let Ie=r.filter(De=>De.name.toLowerCase().includes(be.query)||De.email&&De.email.toLowerCase().includes(be.query)).slice(0,5);w(Ie),h(Ie.length>0),S(0);}else h(false),w([]);},[r]),Y=R=>{let ae=R.target.value;if(t(ae),L(ae,R.target.selectionStart||0),C.current){C.current.style.height="24px";let be=C.current.scrollHeight,Ie=280,De=Math.min(be,Ie);C.current.style.height=`${De}px`,C.current.style.overflowY=be>Ie?"auto":"hidden";}},K=()=>{C.current&&L(e,C.current.selectionStart||0);},V=react.useCallback(R=>{if(!M||!C.current)return;let ae=e.slice(0,M.start),be=e.slice(M.end),Ie=`@${R.name.replace(/\s+/g,"")} `,De=ae+Ie+be;t(De),h(false),T(null),setTimeout(()=>{if(C.current){let Ee=M.start+Ie.length;C.current.selectionStart=Ee,C.current.selectionEnd=Ee,C.current.focus();}},0);},[M,e,t]),B=R=>{if(b&&v.length>0)switch(R.key){case "ArrowDown":R.preventDefault(),S(ae=>ae<v.length-1?ae+1:0);break;case "ArrowUp":R.preventDefault(),S(ae=>ae>0?ae-1:v.length-1);break;case "Enter":{R.preventDefault();let ae=v[D];ae&&V(ae);break}case "Tab":{R.preventDefault();let ae=v[D];ae&&V(ae);break}case "Escape":R.preventDefault(),h(false);break}else R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),a());};react.useEffect(()=>{let R=ae=>{_.current&&!_.current.contains(ae.target)&&C.current&&!C.current.contains(ae.target)&&h(false),oe.current&&!oe.current.contains(ae.target)&&A(false);};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);let X=react.useCallback(R=>{if(!C.current)return;let ae=C.current.selectionStart||e.length,be=e.slice(0,ae)+R+e.slice(ae);t(be),A(false),setTimeout(()=>{if(C.current){let Ie=ae+R.length;C.current.selectionStart=Ie,C.current.selectionEnd=Ie,C.current.focus();}},0);},[e,t]),Ce=react.useCallback(R=>{if(!g||!R.target.files)return;let ae=Array.from(R.target.files),be=x*1024*1024,Ie=ae.filter(De=>De.size>be?(console.warn(`File ${De.name} exceeds max size of ${x}MB`),false):true);Ie.length>0&&g(Ie),R.target.value="";},[g,x]),Re=react.useCallback(R=>R.type.startsWith("image/")?lucideReact.Image:R.type.includes("pdf")||R.type.includes("document")?lucideReact.FileText:lucideReact.File,[]);return react.useEffect(()=>{if(b&&_.current){let R=_.current.children[D];R&&R.scrollIntoView({block:"nearest"});}},[D,b]),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[p.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:p.map(R=>{let ae=Re(R.file),be=R.file.type.startsWith("image/");return jsxRuntime.jsxs("div",{className:c("relative group flex items-center gap-2 px-2 py-1.5 rounded-lg",y?"bg-white/10":"bg-gray-100"),children:[be&&R.preview?jsxRuntime.jsx("img",{src:R.preview,alt:R.file.name,className:"w-6 h-6 rounded object-cover"}):jsxRuntime.jsx(ae,{className:c("w-4 h-4",y?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0 max-w-[120px]",children:[jsxRuntime.jsx("p",{className:c("text-xs truncate",y?"text-white":"text-gray-900"),children:R.file.name}),jsxRuntime.jsx("p",{className:c("text-xs",y?"text-[#6B7280]":"text-gray-400"),children:Lb(R.file.size)})]}),f&&jsxRuntime.jsx("button",{onClick:()=>f(R.id),className:c("p-0.5 rounded-full transition-colors",y?"hover:bg-white/10 text-[#6B7280] hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},R.id)})}),jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[i&&jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-[10px] font-medium flex-shrink-0",style:{backgroundColor:i.color||"#8B5CF6"},children:i.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:c("flex-1 relative min-w-0"),children:[jsxRuntime.jsxs("div",{className:c("flex items-end gap-1 px-2 py-2 rounded-lg",y?"bg-white/5":"bg-white border border-gray-200"),children:[u&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>A(!F),disabled:s||o,className:c("p-1 rounded transition-colors flex-shrink-0",y?"hover:bg-white/10 text-[#6B7280] hover:text-white":"hover:bg-gray-100 text-gray-400 hover:text-gray-600",(s||o)&&"opacity-50"),title:"Emojis",children:jsxRuntime.jsx(lucideReact.Smile,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:F&&jsxRuntime.jsx(framerMotion.motion.div,{ref:oe,initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},className:c("absolute bottom-full left-0 mb-2 p-2 rounded-lg shadow-xl z-50",y?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:jsxRuntime.jsx("div",{className:"grid grid-cols-8 gap-1 w-[200px]",children:Ib.map(R=>jsxRuntime.jsx("button",{type:"button",onClick:()=>X(R),className:c("w-6 h-6 flex items-center justify-center text-lg rounded transition-colors hover:scale-110",y?"hover:bg-white/10":"hover:bg-gray-100"),children:R},R))})})})]}),m&&g&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>W.current?.click(),disabled:s||o,className:c("p-1.5 rounded transition-colors",y?"hover:bg-white/10 text-[#6B7280] hover:text-white":"hover:bg-gray-100 text-gray-400 hover:text-gray-600",(s||o)&&"opacity-50"),title:d==="es"?"Adjuntar archivo":"Attach file",children:jsxRuntime.jsx(lucideReact.Paperclip,{className:"w-4 h-4"})}),jsxRuntime.jsx("input",{ref:W,type:"file",multiple:true,onChange:Ce,className:"hidden",accept:"image/*,.pdf,.doc,.docx,.xls,.xlsx,.txt,.zip"})]}),jsxRuntime.jsx("textarea",{ref:C,value:e,onChange:Y,onSelect:K,onKeyDown:B,placeholder:n||(d==="es"?"Escribe un comentario...":"Write a comment..."),disabled:s||o,rows:1,className:c("flex-1 bg-transparent text-sm outline-none min-w-[100px] resize-none py-0.5",y?"text-white placeholder:text-[#6B7280] scrollbar-slim":"text-gray-900 placeholder:text-gray-400 scrollbar-slim-light",(s||o)&&"opacity-50"),style:{lineHeight:"1.5",height:"24px",maxHeight:"280px",overflowY:"hidden"}}),jsxRuntime.jsx("button",{onClick:a,disabled:o||!e.trim()&&p.length===0||s,className:c("p-1.5 rounded transition-colors",(e.trim()||p.length>0)&&!s?"bg-[#00E5CC] text-white hover:bg-[#00C4AE]":y?"text-[#6B7280]":"text-gray-400",o&&"opacity-50 cursor-not-allowed"),children:o?jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):jsxRuntime.jsx(lucideReact.Send,{className:"w-4 h-4"})})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:b&&v.length>0&&jsxRuntime.jsx(framerMotion.motion.div,{ref:_,initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},className:c("absolute bottom-full left-0 right-0 mb-1 py-1 rounded-lg shadow-xl z-50","max-h-[200px] overflow-y-auto",y?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:v.map((R,ae)=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>V(R),className:c("w-full flex items-center gap-3 px-3 py-2 text-left transition-colors",ae===D?y?"bg-white/10":"bg-gray-100":y?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:R.color||"#8B5CF6"},children:Ab(R.name)}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:c("text-sm font-medium truncate",y?"text-white":"text-gray-900"),children:R.name}),R.email&&jsxRuntime.jsx("p",{className:c("text-xs truncate",y?"text-[#6B7280]":"text-gray-500"),children:R.email})]})]},R.id))})})]})]})]})}function Qu({content:e,theme:t="dark"}){let a=t==="dark",r=[],n=/@(\S+)/g,s=0,o;for(;(o=n.exec(e))!==null;)o.index>s&&r.push({type:"text",value:e.slice(s,o.index)}),r.push({type:"mention",value:o[0]}),s=o.index+o[0].length;return s<e.length&&r.push({type:"text",value:e.slice(s)}),jsxRuntime.jsx("span",{className:"whitespace-pre-wrap break-words",children:r.map((l,d)=>l.type==="mention"?jsxRuntime.jsx("span",{className:c("inline-flex items-center px-1 py-0.5 rounded","font-medium text-sm",a?"bg-[#00E5CC]/20 text-[#00E5CC]":"bg-[#00E5CC]/15 text-[#00C4AE]"),children:l.value},d):jsxRuntime.jsx("span",{children:l.value},d))})}var di=["#EF4444","#F97316","#F59E0B","#EAB308","#84CC16","#22C55E","#10B981","#00E5CC","#00E5CC","#0EA5E9","#00E5CC","#6366F1","#8B5CF6","#A855F7","#D946EF","#EC4899"];function Ro({selectedTags:e,availableTags:t,onChange:a,onCreateTag:r,theme:n,disabled:s=false,compact:o=true}){let[l,d]=react.useState(false),[i,u]=react.useState(""),[m,p]=react.useState(false),[g,f]=react.useState(di[10]||"#00E5CC"),[x,y]=react.useState({top:0,left:0}),b=react.useRef(null),h=react.useRef(null),v=react.useRef(null),w=react.useRef(null),D=t.filter(C=>C.name.toLowerCase().includes(i.toLowerCase())),S=t.some(C=>C.name.toLowerCase()===i.toLowerCase());react.useEffect(()=>{if(l&&h.current){let C=h.current.getBoundingClientRect();y({top:C.bottom+6,left:C.left});}},[l]),react.useEffect(()=>{let C=_=>{let W=_.target,oe=b.current?.contains(W),L=v.current?.contains(W);!oe&&!L&&(d(false),u(""),p(false));};if(l)return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[l]),react.useEffect(()=>{l&&w.current&&w.current.focus();},[l]);let M=C=>{let _=e.some(W=>W.id===C.id);a(_?e.filter(W=>W.id!==C.id):[...e,C]);},T=async()=>{if(!(!r||!i.trim())){p(true);try{let C=await r(i.trim(),g);C&&(a([...e,C]),u(""),f(di[Math.floor(Math.random()*di.length)]||"#00E5CC"));}finally{p(false);}}},F=(C,_)=>{_.stopPropagation(),a(e.filter(W=>W.id!==C));},A={backgroundColor:`${n.textTertiary}15`,border:`1px solid ${n.borderLight}`,color:n.textSecondary};return jsxRuntime.jsxs("div",{ref:b,className:"relative",children:[jsxRuntime.jsxs("button",{ref:h,type:"button",onClick:()=>!s&&d(!l),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:A,disabled:s,children:[jsxRuntime.jsx(lucideReact.Tag,{className:"w-3.5 h-3.5"}),e.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[e.slice(0,2).map(C=>jsxRuntime.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium",style:{backgroundColor:`${C.color}20`,color:C.color},children:C.name},C.id)),e.length>2&&jsxRuntime.jsxs("span",{className:"text-xs",style:{color:n.textTertiary},children:["+",e.length-2]})]}):jsxRuntime.jsx("span",{children:"Agregar"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3",style:{color:n.textTertiary}})]}),typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:l&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:v,initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.12},className:"rounded-lg min-w-[240px]",style:{position:"fixed",top:x.top,left:x.left,zIndex:99999,backgroundColor:n.bgPrimary,border:`1px solid ${n.border}`,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.25)"},children:[jsxRuntime.jsx("div",{className:"p-2 border-b",style:{borderColor:n.border},children:jsxRuntime.jsx("input",{ref:w,type:"text",value:i,onChange:C=>u(C.target.value),placeholder:"Buscar o crear etiqueta...",className:"w-full px-3 py-1.5 text-sm rounded-md outline-none",style:{backgroundColor:n.bgSecondary,color:n.textPrimary,border:`1px solid ${n.borderLight}`},onKeyDown:C=>{C.key==="Enter"&&i.trim()&&!S&&r&&T();}})}),e.length>0&&jsxRuntime.jsxs("div",{className:"p-2 border-b",style:{borderColor:n.border},children:[jsxRuntime.jsx("p",{className:"text-xs mb-1.5",style:{color:n.textTertiary},children:"Seleccionadas"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.map(C=>jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium cursor-pointer hover:opacity-80",style:{backgroundColor:`${C.color}20`,color:C.color},onClick:_=>F(C.id,_),children:[C.name,jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})]},C.id))})]}),jsxRuntime.jsx("div",{className:"max-h-[200px] overflow-y-auto p-1",children:D.length>0?D.map(C=>{let _=e.some(W=>W.id===C.id);return jsxRuntime.jsxs("button",{type:"button",onClick:()=>M(C),className:"w-full flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors",style:{backgroundColor:_?`${C.color}15`:"transparent",color:n.textPrimary},onMouseEnter:W=>{_||(W.currentTarget.style.backgroundColor=n.hoverBg);},onMouseLeave:W=>{_||(W.currentTarget.style.backgroundColor="transparent");},children:[jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:C.color}}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:C.name}),_&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:C.color}})]},C.id)}):i.trim()?jsxRuntime.jsx("div",{className:"p-2 text-center text-sm",style:{color:n.textTertiary},children:"No se encontraron etiquetas"}):jsxRuntime.jsx("div",{className:"p-2 text-center text-sm",style:{color:n.textTertiary},children:"No hay etiquetas disponibles"})}),i.trim()&&!S&&r&&jsxRuntime.jsxs("div",{className:"p-2 border-t",style:{borderColor:n.border},children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2 mb-2",children:jsxRuntime.jsx("p",{className:"text-xs",style:{color:n.textTertiary},children:"Crear nueva etiqueta"})}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:di.map(C=>jsxRuntime.jsx("button",{type:"button",onClick:()=>f(C),className:"w-5 h-5 rounded-full transition-transform hover:scale-110",style:{backgroundColor:C,outline:g===C?`2px solid ${C}`:"none",outlineOffset:"2px"}},C))}),jsxRuntime.jsxs("button",{type:"button",onClick:T,disabled:m,className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-colors",style:{backgroundColor:g,color:"#FFFFFF",opacity:m?.7:1},children:[m?jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),'Crear "',i.trim(),'"']})]})]})}),document.body)]})}function Hl({tag:e,onRemove:t,size:a="sm"}){return jsxRuntime.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full font-medium ${a==="xs"?"px-1.5 py-0.5 text-[10px]":"px-2 py-0.5 text-xs"}`,style:{backgroundColor:`${e.color}20`,color:e.color},children:[e.name,t&&jsxRuntime.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),t();},className:"hover:opacity-70",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]})}function ep({tags:e,maxVisible:t=3,size:a="sm"}){if(!e||e.length===0)return null;let r=e.slice(0,t),n=e.length-t;return jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-1",children:[r.map(s=>jsxRuntime.jsx(Hl,{tag:s,size:a},s.id)),n>0&&jsxRuntime.jsxs("span",{className:`inline-flex items-center rounded-full font-medium ${a==="xs"?"px-1.5 py-0.5 text-[10px]":"px-2 py-0.5 text-xs"}`,style:{backgroundColor:"rgba(100,100,100,0.2)",color:"#9CA3AF"},children:["+",n]})]})}var sn=[{name:"Azul",value:"#00E5CC",light:"#5AADFF"},{name:"P\xFArpura",value:"#A855F7",light:"#C084FC"},{name:"Rosa",value:"#EC4899",light:"#F472B6"},{name:"Rojo",value:"#EF4444",light:"#F87171"},{name:"Naranja",value:"#F59E0B",light:"#FBBF24"},{name:"Amarillo",value:"#EAB308",light:"#FACC15"},{name:"Lima",value:"#84CC16",light:"#A3E635"},{name:"Verde",value:"#10B981",light:"#34D399"},{name:"Esmeralda",value:"#059669",light:"#10B981"},{name:"Cyan",value:"#00E5CC",light:"#00E5CC"},{name:"Azul Cielo",value:"#0EA5E9",light:"#38BDF8"},{name:"\xCDndigo",value:"#4F46E5",light:"#6366F1"},{name:"Violeta",value:"#8B5CF6",light:"#A78BFA"},{name:"Fucsia",value:"#D946EF",light:"#E879F9"},{name:"Coral",value:"#F97316",light:"#FB923C"},{name:"Magenta",value:"#E11D48",light:"#FB7185"}];function tp(e){if(e<60)return `${e}m`;let t=Math.floor(e/60),a=e%60;return a===0?`${t}h`:`${t}h${a}m`}function Vb(e){switch(e){case "on-track":return {text:"text-green-600 dark:text-green-400",bg:"bg-green-50 dark:bg-green-900/20",border:"border-green-200 dark:border-green-800"};case "at-risk":return {text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-50 dark:bg-yellow-900/20",border:"border-yellow-200 dark:border-yellow-800"};case "over-budget":return {text:"text-red-600 dark:text-red-400",bg:"bg-red-50 dark:bg-red-900/20",border:"border-red-200 dark:border-red-800"};case "no-estimate":default:return {text:"text-gray-500 dark:text-gray-400",bg:"bg-gray-50 dark:bg-gray-800/50",border:"border-gray-200 dark:border-gray-700"}}}function Gb({className:e}){return jsxRuntime.jsxs("svg",{className:c("w-3 h-3",e),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M12 6v6l4 2"})]})}function zl({summary:e,size:t="sm",showEstimate:a=true,onClick:r,className:n}){let s=Vb(e.health),o={sm:"text-xs px-1.5 py-0.5 gap-1",md:"text-sm px-2 py-1 gap-1.5",lg:"text-base px-2.5 py-1.5 gap-2"},l={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4"},d=tp(e.loggedMinutes),i=e.estimateMinutes?tp(e.estimateMinutes):null,u=a&&i?`${d} / ${i}`:d;return e.loggedMinutes===0&&!e.estimateMinutes?null:jsxRuntime.jsxs(r?"button":"span",{className:c("inline-flex items-center rounded-full border font-medium","transition-colors duration-150",s.text,s.bg,s.border,o[t],r&&"cursor-pointer hover:opacity-80 focus:outline-none focus:ring-2 focus:ring-offset-1",n),onClick:r,type:r?"button":void 0,children:[jsxRuntime.jsx(Gb,{className:l[t]}),jsxRuntime.jsx("span",{children:u})]})}function jb(e){let t=e.trim();if(!t)return null;let a;if(t.startsWith("="))a=t.slice(1).trim();else if(t.startsWith("+")&&/[*\/()]/.test(t))a=t.slice(1).trim();else if(/^\d[\d\s]*[*\/]/.test(t)||/^\(/.test(t))a=t;else return null;if(!a||!/^[\d+\-*/().\s]+$/.test(a)||/[+\-*/]{2,}/.test(a.replace(/\s/g,"").replace(/\*-/g,"X").replace(/\/-/g,"X")))return null;try{let r=new Function(`"use strict"; return (${a});`)();return typeof r!="number"||!isFinite(r)||r<0?null:r}catch{return null}}function ui(e){let t=jb(e);return t!==null?String(t):e}function rp(e){let a=ui(e).trim().toLowerCase();if(a.includes(":")){let[o,l]=a.split(":").map(Number);return (o||0)*60+(l||0)}let r=a.match(/(\d+(?:\.\d+)?)\s*h/),n=a.match(/(\d+)\s*m/);if(r||n){let o=r?.[1]?parseFloat(r[1]):0,l=n?.[1]?parseInt(n[1],10):0;return Math.round(o*60)+l}let s=parseFloat(a);return isNaN(s)?0:Math.round(s*60)}function pi(e){if(e<60)return `${e}m`;let t=Math.floor(e/60),a=e%60;return a===0?`${t}h`:`${t}h ${a}m`}function qb(e){let t=Math.floor(e/3600),a=Math.floor(e%3600/60),r=e%60;return t>0?`${t}:${a.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${a}:${r.toString().padStart(2,"0")}`}function Yb({className:e}){return jsxRuntime.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M8 5v14l11-7z"})})}function Xb({className:e}){return jsxRuntime.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})})}function op({className:e}){return jsxRuntime.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsxRuntime.jsx("path",{d:"M6 18L18 6M6 6l12 12"})})}function Jb({className:e}){return jsxRuntime.jsxs("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M12 6v6l4 2"})]})}function Ul({taskId:e,summary:t,entries:a=[],isTimerRunning:r=false,timerElapsedSeconds:n=0,onLogTime:s,onUpdateEstimate:o,onStartTimer:l,onStopTimer:d,onDiscardTimer:i,onClose:u,className:m}){let[p,g]=react.useState(""),[f,x]=react.useState(t.estimateMinutes?pi(t.estimateMinutes):""),[y,b]=react.useState(""),[h,v]=react.useState(false),[w,D]=react.useState(false),S=react.useRef(null);react.useEffect(()=>{S.current?.focus();},[]);let M=async()=>{let A=rp(p);if(!(A<=0||!s)){v(true);try{await s({durationMinutes:A,note:y.trim()||void 0,source:"manual"}),g(""),b("");}finally{v(false);}}},T=async()=>{if(!o)return;let A=f.trim()?rp(f):null;await o(A),D(false);},F=A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),M()),A.key==="Escape"&&u?.();};return jsxRuntime.jsxs("div",{className:c("w-72 bg-white dark:bg-gray-800 rounded-lg shadow-xl border border-gray-200 dark:border-gray-700","divide-y divide-gray-100 dark:divide-gray-700",m),children:[jsxRuntime.jsxs("div",{className:"px-3 py-2 flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200",children:"Time Tracking"}),jsxRuntime.jsx("button",{onClick:u,className:"p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-400",children:jsxRuntime.jsx(op,{className:"w-4 h-4"})})]}),jsxRuntime.jsx("div",{className:"px-3 py-2",children:r?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"relative flex h-2 w-2",children:[jsxRuntime.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),jsxRuntime.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-green-500"})]}),jsxRuntime.jsx("span",{className:"text-lg font-mono font-medium text-gray-900 dark:text-white",children:qb(n)})]}),jsxRuntime.jsx("button",{onClick:d,className:"p-2 rounded-lg bg-green-500 hover:bg-green-600 text-white",title:"Stop and save",children:jsxRuntime.jsx(Xb,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{onClick:i,className:"p-2 rounded-lg bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-600 dark:text-gray-300",title:"Discard",children:jsxRuntime.jsx(op,{className:"w-4 h-4"})})]}):jsxRuntime.jsxs("button",{onClick:l,className:c("w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg","bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600","text-gray-700 dark:text-gray-200 font-medium text-sm"),children:[jsxRuntime.jsx(Yb,{className:"w-4 h-4"}),"Start Timer"]})}),jsxRuntime.jsxs("div",{className:"px-3 py-2 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("div",{className:"relative flex-1",children:[jsxRuntime.jsx(Jb,{className:"absolute left-2 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),jsxRuntime.jsx("input",{ref:S,type:"text",value:p,onChange:A=>g(A.target.value),onKeyDown:F,placeholder:"8 (=8h), 2h 30m",className:c("w-full pl-8 pr-3 py-1.5 text-sm rounded-lg","bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600","text-gray-900 dark:text-white placeholder-gray-400","focus:outline-none focus:ring-2 focus:ring-[#00E5CC] focus:border-transparent")})]}),jsxRuntime.jsx("button",{onClick:M,disabled:h||!p.trim(),className:c("px-3 py-1.5 rounded-lg text-sm font-medium","bg-[#00E5CC] hover:bg-[#00C4AE] text-white","disabled:opacity-50 disabled:cursor-not-allowed"),children:"Log"})]}),jsxRuntime.jsx("input",{type:"text",value:y,onChange:A=>b(A.target.value),onKeyDown:F,placeholder:"Note (optional)",className:c("w-full px-3 py-1.5 text-sm rounded-lg","bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600","text-gray-900 dark:text-white placeholder-gray-400","focus:outline-none focus:ring-2 focus:ring-[#00E5CC] focus:border-transparent")})]}),jsxRuntime.jsxs("div",{className:"px-3 py-2",children:[jsxRuntime.jsxs("div",{className:"flex justify-between text-sm",children:[jsxRuntime.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"Logged"}),jsxRuntime.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:pi(t.loggedMinutes)})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"Estimate"}),w?jsxRuntime.jsx("div",{className:"flex items-center gap-1",children:jsxRuntime.jsx("input",{type:"text",value:f,onChange:A=>x(A.target.value),onKeyDown:A=>{A.key==="Enter"&&T(),A.key==="Escape"&&D(false);},onBlur:T,autoFocus:true,className:"w-16 px-1 py-0.5 text-sm text-right rounded border border-[#00E5CC] bg-transparent focus:outline-none",placeholder:"4h"})}):jsxRuntime.jsx("button",{onClick:()=>D(true),className:"font-medium text-gray-900 dark:text-white hover:text-[#00E5CC]",children:t.estimateMinutes?pi(t.estimateMinutes):"Set estimate"})]}),t.progressPercent!==null&&jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"Progress"}),jsxRuntime.jsxs("span",{className:c("font-medium",t.health==="on-track"&&"text-green-600",t.health==="at-risk"&&"text-yellow-600",t.health==="over-budget"&&"text-red-600"),children:[t.progressPercent,"%"]})]}),jsxRuntime.jsx("div",{className:"h-1.5 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:c("h-full transition-all duration-300",t.health==="on-track"&&"bg-green-500",t.health==="at-risk"&&"bg-yellow-500",t.health==="over-budget"&&"bg-red-500"),style:{width:`${Math.min(100,t.progressPercent)}%`}})})]})]}),a.length>0&&jsxRuntime.jsxs("div",{className:"px-3 py-2",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-2",children:"Recent Entries"}),jsxRuntime.jsx("div",{className:"space-y-1 max-h-24 overflow-y-auto",children:a.slice(0,3).map(A=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-600 dark:text-gray-300",children:[jsxRuntime.jsx("span",{className:"truncate flex-1",children:A.note||"Time logged"}),jsxRuntime.jsx("span",{className:"font-medium ml-2",children:pi(A.durationMinutes)})]},A.id))})]})]})}function ah(e){let a=ui(e).trim().toLowerCase();if(!a||a==="-")return null;if(a.includes(":")){let[o,l]=a.split(":").map(Number);return (o||0)*60+(l||0)}let r=a.match(/(\d+(?:\.\d+)?)\s*h/),n=a.match(/(\d+)\s*m/);if(r||n){let o=r?.[1]?parseFloat(r[1]):0,l=n?.[1]?parseInt(n[1],10):0;return Math.round(o*60)+l}let s=parseFloat(a);return isNaN(s)?null:Math.round(s*60)}function rh(e){if(!e||e===0)return "";let t=Math.floor(e/60),a=e%60;return t===0?`${a}m`:a===0?`${t}h`:`${t}h ${a}m`}function io({mode:e,locale:t,isDark:a,currentValue:r,onSave:n,onClose:s,className:o}){let[l,d]=react.useState(rh(r)),[i,u]=react.useState(""),[m,p]=react.useState(false),g=react.useRef(null);react.useEffect(()=>{g.current?.focus();},[]);let f=async()=>{p(true);let v=ah(l);await n(v&&v>0?v:null,i||void 0),p(false);},x=async()=>{p(true),await n(null),p(false);},y=v=>{v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),f()),v.key==="Escape"&&s();},b={estimate:t==="es"?"Estimaci\xF3n":"Estimate",quoted:t==="es"?"T. Ofertado":"Quoted",log:t==="es"?"Registrar":"Log Time"},h=t==="es";return jsxRuntime.jsxs("div",{className:c("w-56",o),style:{background:a?"rgba(10, 10, 10, 0.95)":"#FFFFFF",border:a?"1px solid rgba(255,255,255,0.10)":"1px solid #E5E7EB",borderRadius:"8px",boxShadow:a?"0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05)":"0 8px 32px rgba(0,0,0,0.12)",backdropFilter:"blur(16px)"},onClick:v=>v.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-3 py-2",style:{borderBottom:a?"1px solid rgba(255,255,255,0.06)":"1px solid #F3F4F6"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"w-3 h-3",style:{color:a?"#007FFF":"#00E5CC"}}),jsxRuntime.jsx("span",{className:"font-mono uppercase tracking-wider",style:{fontSize:"10px",fontWeight:600,color:a?"rgba(255,255,255,0.5)":"#6B7280"},children:b[e]})]}),jsxRuntime.jsx("button",{type:"button",onClick:s,className:"p-0.5 rounded transition-colors",style:{color:a?"rgba(255,255,255,0.3)":"#9CA3AF"},children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]}),jsxRuntime.jsxs("div",{className:"p-3 space-y-2",children:[jsxRuntime.jsx("input",{ref:g,type:"text",value:l,onChange:v=>d(v.target.value),onKeyDown:y,placeholder:"2h 30m",className:"w-full font-mono outline-none",style:{fontSize:"13px",fontWeight:700,padding:"6px 10px",borderRadius:"4px",border:a?"1px solid #333":"1px solid #E5E7EB",background:a?"#1A1A1A":"#F9FAFB",color:a?"#FFFFFF":"#111827"}}),jsxRuntime.jsx("p",{className:"font-mono",style:{fontSize:"9px",color:a?"rgba(255,255,255,0.25)":"#9CA3AF",letterSpacing:"0.02em"},children:"8=8h \xB7 1h 30m \xB7 45m \xB7 =8*9"}),e==="log"&&jsxRuntime.jsx("input",{type:"text",value:i,onChange:v=>u(v.target.value),onKeyDown:y,placeholder:h?"Nota (opcional)":"Note (optional)",className:"w-full outline-none",style:{fontSize:"11px",padding:"5px 10px",borderRadius:"4px",border:a?"1px solid #333":"1px solid #E5E7EB",background:a?"#1A1A1A":"#F9FAFB",color:a?"rgba(255,255,255,0.7)":"#374151"}}),jsxRuntime.jsx("button",{type:"button",onClick:f,disabled:m||!l.trim(),className:"w-full font-mono uppercase tracking-wider transition-all disabled:opacity-30 disabled:cursor-not-allowed",style:{fontSize:"10px",fontWeight:600,padding:"6px 0",borderRadius:"4px",border:a?"1px solid rgba(0, 229, 204,0.3)":"1px solid #00E5CC",background:a?"rgba(0, 229, 204,0.15)":"#00E5CC",color:a?"#007FFF":"#FFFFFF"},children:m?h?"Guardando...":"Saving...":h?"Registrar":"Save"}),r&&e!=="log"&&jsxRuntime.jsx("button",{type:"button",onClick:x,disabled:m,className:"w-full font-mono uppercase tracking-wider transition-colors",style:{fontSize:"9px",padding:"4px 0",color:a?"rgba(255,255,255,0.3)":"#9CA3AF"},children:h?"Quitar":"Clear"})]})]})}function oh(e){switch(e){case "on-track":return "bg-green-500";case "at-risk":return "bg-yellow-500";case "over-budget":return "bg-red-500";case "no-estimate":default:return "bg-gray-400"}}function nh(e){switch(e){case "on-track":return "text-green-600 dark:text-green-400";case "at-risk":return "text-yellow-600 dark:text-yellow-400";case "over-budget":return "text-red-600 dark:text-red-400";case "no-estimate":default:return "text-gray-500 dark:text-gray-400"}}function Vl({summary:e,showLabel:t=false,size:a="md",className:r}){let n=oh(e.health),s=nh(e.health),o={sm:"h-1",md:"h-1.5",lg:"h-2"},l=e.progressPercent??0,d=Math.min(100,l),i=l>100;return e.health==="no-estimate"?jsxRuntime.jsxs("div",{className:c("flex items-center gap-2",r),children:[jsxRuntime.jsx("div",{className:c("flex-1 rounded-full bg-gray-200 dark:bg-gray-700 overflow-hidden",o[a]),children:jsxRuntime.jsx("div",{className:c("h-full w-1/4",n)})}),t&&jsxRuntime.jsx("span",{className:c("text-xs font-medium",s),children:"--"})]}):jsxRuntime.jsxs("div",{className:c("flex items-center gap-2",r),children:[jsxRuntime.jsxs("div",{className:c("flex-1 rounded-full bg-gray-200 dark:bg-gray-700 overflow-hidden relative",o[a]),children:[jsxRuntime.jsx("div",{className:c("h-full transition-all duration-300",n),style:{width:`${d}%`}}),i&&jsxRuntime.jsx("div",{className:"absolute inset-0 bg-red-500",style:{backgroundImage:"repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255,255,255,0.2) 2px, rgba(255,255,255,0.2) 4px)"}})]}),t&&jsxRuntime.jsxs("span",{className:c("text-xs font-medium tabular-nums min-w-[2.5rem] text-right",s),children:[l,"%"]})]})}function Pn(e){if(e<1)return `${Math.round(e*60)}s`;let t=Math.round(e);if(t<60)return `${t}m`;let a=Math.floor(t/60),r=t%60;return r===0?`${a}h`:`${a}h ${r}m`}function ih(e,t){switch(e){case "profitable":return t?"text-green-400":"text-green-600";case "at-cost":return t?"text-[#00E5CC]":"text-[#00C4AE]";case "loss":return t?"text-red-400":"text-red-600";case "no-estimate":return t?"text-gray-500":"text-gray-400"}}function lh(e,t){switch(e){case "profitable":return t?"bg-green-900/30 border-green-700/50":"bg-green-50 border-green-200";case "at-cost":return t?"bg-[#00A893]/30 border-[#00C4AE]/50":"bg-[#00E5CC]/15 border-[#00E5CC]/15";case "loss":return t?"bg-red-900/30 border-red-700/50":"bg-red-50 border-red-200";case "no-estimate":return t?"bg-gray-800/50 border-gray-700":"bg-gray-50 border-gray-200"}}function dh(e,t){if(t==="es")switch(e){case "profitable":return "Rentable";case "at-cost":return "En costo";case "loss":return "P\xE9rdida";case "no-estimate":return "Sin oferta"}switch(e){case "profitable":return "Profitable";case "at-cost":return "At Cost";case "loss":return "Loss";case "no-estimate":return "No Estimate"}}function ch({summary:e,locale:t,isDark:a}){let r=e.totalVarianceMinutes>0,n=r?a?"text-green-400":"text-green-600":e.totalVarianceMinutes<0?a?"text-red-400":"text-red-600":a?"text-gray-400":"text-gray-600",s=a?"bg-[#1A1D25]":"bg-white",o=a?"border-white/5":"border-gray-200",l=a?"text-[#9CA3AF]":"text-gray-500",d=a?"text-[#E5E7EB]":"text-gray-900";return jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{className:c("p-4 rounded-lg border",s,o),children:[jsxRuntime.jsx("div",{className:c("text-sm font-medium mb-1",l),children:t==="es"?"Variaci\xF3n Total":"Total Variance"}),jsxRuntime.jsxs("div",{className:c("text-2xl font-bold",n),children:[r?"+":"",Pn(Math.abs(e.totalVarianceMinutes))]}),jsxRuntime.jsxs("div",{className:c("text-xs mt-1",l),children:[e.avgVariancePercent>0?"+":"",e.avgVariancePercent,"%"]})]}),jsxRuntime.jsxs("div",{className:c("p-4 rounded-lg border",s,o),children:[jsxRuntime.jsx("div",{className:c("text-sm font-medium mb-2",l),children:t==="es"?"Distribuci\xF3n":"Distribution"}),jsxRuntime.jsxs("div",{className:"space-y-1 text-sm",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{className:a?"text-green-400":"text-green-600",children:t==="es"?"Rentables":"Profitable"}),jsxRuntime.jsx("span",{className:c("font-medium",d),children:e.profitableTasksCount})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{className:a?"text-[#00E5CC]":"text-[#00C4AE]",children:t==="es"?"En costo":"At Cost"}),jsxRuntime.jsx("span",{className:c("font-medium",d),children:e.atCostTasksCount})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{className:a?"text-red-400":"text-red-600",children:t==="es"?"P\xE9rdidas":"Loss"}),jsxRuntime.jsx("span",{className:c("font-medium",d),children:e.lossTasksCount})]})]})]}),jsxRuntime.jsxs("div",{className:c("p-4 rounded-lg border",s,o),children:[jsxRuntime.jsx("div",{className:c("text-sm font-medium mb-2",l),children:t==="es"?"Tiempos":"Time Summary"}),jsxRuntime.jsxs("div",{className:"space-y-1 text-sm",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{className:l,children:t==="es"?"Ofertado":"Sold"}),jsxRuntime.jsx("span",{className:c("font-medium",d),children:Pn(e.totalSoldMinutes)})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{className:l,children:t==="es"?"Trabajado":"Logged"}),jsxRuntime.jsx("span",{className:c("font-medium",d),children:Pn(e.totalLoggedMinutes)})]}),jsxRuntime.jsxs("div",{className:c("flex justify-between pt-1 border-t",o),children:[jsxRuntime.jsx("span",{className:l,children:t==="es"?"Tareas":"Tasks"}),jsxRuntime.jsx("span",{className:c("font-medium",d),children:e.totalTasksWithEstimate})]})]})]})]})}function uh({task:e,locale:t,isDark:a,onClick:r}){let n=e.varianceMinutes!==null?e.varianceMinutes>0?"+":e.varianceMinutes<0?"-":"":"",s=a?"border-white/5":"border-gray-200",o=a?"text-[#E5E7EB]":"text-gray-900",l=a?"text-[#9CA3AF]":"text-gray-500";return jsxRuntime.jsxs("tr",{className:c("border-b",s,r&&c("cursor-pointer",a?"hover:bg-white/5":"hover:bg-gray-50")),onClick:()=>r?.(e.taskId),children:[jsxRuntime.jsxs("td",{className:"px-4 py-3",children:[jsxRuntime.jsx("div",{className:c("font-medium",o),children:e.taskName}),e.projectName&&jsxRuntime.jsx("div",{className:c("text-xs mt-1",l),children:e.projectName})]}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-sm text-center",children:e.soldEffortMinutes?Pn(e.soldEffortMinutes):"-"}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-sm text-center",children:Pn(e.loggedMinutes)}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-sm text-center",children:e.varianceMinutes!==null?jsxRuntime.jsxs("span",{className:c("font-medium",e.varianceMinutes>0?a?"text-green-400":"text-green-600":e.varianceMinutes<0?a?"text-red-400":"text-red-600":l),children:[n,Pn(Math.abs(e.varianceMinutes))]}):"-"}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-sm text-center",children:e.variancePercent!==null?jsxRuntime.jsxs("span",{className:c("font-medium",e.variancePercent>0?a?"text-green-400":"text-green-600":e.variancePercent<0?a?"text-red-400":"text-red-600":l),children:[n,Math.abs(e.variancePercent),"%"]}):"-"}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-center",children:jsxRuntime.jsx("span",{className:c("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border",lh(e.status,a),ih(e.status,a)),children:dh(e.status,t)})})]})}function Gl({report:e,isLoading:t=false,locale:a="en",theme:r="light",className:n,onTaskClick:s}){let o=r==="dark",l=o?"bg-[#050505]":"bg-gray-50",d=o?"bg-[#0A0A0A]":"bg-white",i=o?"border-white/[0.08]":"border-gray-200",u=o?"text-white/[0.92]":"text-gray-900",m=o?"text-white/[0.60]":"text-gray-500",p=o?"bg-[#050505]/50":"bg-gray-50",g=react.useMemo(()=>e?[...e.tasks].sort((f,x)=>f.varianceMinutes===null?1:x.varianceMinutes===null?-1:x.varianceMinutes-f.varianceMinutes):[],[e]);return t?jsxRuntime.jsx("div",{className:c("p-8 text-center",m,n),children:a==="es"?"Cargando reporte...":"Loading report..."}):!e||e.tasks.length===0?jsxRuntime.jsx("div",{className:c("p-8 text-center",m,n),children:a==="es"?"No hay datos de rentabilidad disponibles":"No profitability data available"}):jsxRuntime.jsxs("div",{className:c("space-y-6 p-6",l,n),children:[jsxRuntime.jsx("div",{className:"flex items-center justify-between",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:c("text-2xl font-bold",u),children:a==="es"?"Reporte de Rentabilidad":"Profitability Report"}),jsxRuntime.jsx("p",{className:c("text-sm mt-1",m),children:a==="es"?"An\xE1lisis de tiempo ofertado vs tiempo trabajado":"Analysis of sold effort vs actual time logged"})]})}),jsxRuntime.jsx(ch,{summary:e.summary,locale:a,isDark:o}),jsxRuntime.jsx("div",{className:c("rounded-lg border overflow-hidden",d,i),children:jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-white/5",children:[jsxRuntime.jsx("thead",{className:p,children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:c("px-4 py-3 text-left text-xs font-medium uppercase tracking-wider",m),children:a==="es"?"Tarea":"Task"}),jsxRuntime.jsx("th",{className:c("px-4 py-3 text-center text-xs font-medium uppercase tracking-wider",m),children:a==="es"?"Ofertado":"Sold"}),jsxRuntime.jsx("th",{className:c("px-4 py-3 text-center text-xs font-medium uppercase tracking-wider",m),children:a==="es"?"Trabajado":"Logged"}),jsxRuntime.jsx("th",{className:c("px-4 py-3 text-center text-xs font-medium uppercase tracking-wider",m),children:a==="es"?"Variaci\xF3n":"Variance"}),jsxRuntime.jsx("th",{className:c("px-4 py-3 text-center text-xs font-medium uppercase tracking-wider",m),children:"%"}),jsxRuntime.jsx("th",{className:c("px-4 py-3 text-center text-xs font-medium uppercase tracking-wider",m),children:a==="es"?"Estado":"Status"})]})}),jsxRuntime.jsx("tbody",{className:c("divide-y",i),children:g.map(f=>jsxRuntime.jsx(uh,{task:f,locale:a,isDark:o,onClick:s},f.taskId))})]})})}),jsxRuntime.jsx("div",{className:c("text-xs text-center",m),children:a==="es"?jsxRuntime.jsx(jsxRuntime.Fragment,{children:"Rentable: variaci\xF3n > +5% | En costo: \xB15% | P\xE9rdida: variaci\xF3n < -5%"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:"Profitable: variance > +5% | At cost: \xB15% | Loss: variance < -5%"})})]})}function Fn(e){if(e<60)return `${e}m`;let t=Math.floor(e/60),a=e%60;return a===0?`${t}h`:`${t}h ${a}m`}function Nh(e){let t=Math.floor(e/3600),a=Math.floor(e%3600/60),r=e%60;return t>0?`${t.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${a.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}function gp(e,t=[]){if("title"in e&&!("name"in e)){let a=e,r=(a.assignedUserIds||[]).map(n=>{let s=t.find(o=>o.id===n);return s||null}).filter(n=>n!==null);return {id:a.id,name:a.title,startDate:a.startDate?new Date(a.startDate):void 0,endDate:a.endDate?new Date(a.endDate):void 0,progress:a.progress||0,status:a.columnId,priority:a.priority?.toLowerCase(),assignees:r,dependencies:Array.isArray(a.dependencies)?a.dependencies.map(n=>typeof n=="string"?n:n.taskId):[],tags:a.tags,subtasks:a.subtasks?.map(n=>({id:n.id,name:n.title,progress:n.completed?100:0,startDate:new Date,endDate:new Date})),color:a.color,description:a.description,effortMinutes:a.effortMinutes,timeLoggedMinutes:a.timeLoggedMinutes,soldEffortMinutes:a.soldEffortMinutes}}return e}function Dh(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,dependencies:e.dependencies}}function To({task:e,isOpen:t,onClose:a,onTaskUpdate:r,onCardUpdate:n,theme:s="dark",locale:o="es",availableUsers:l=[],availableTags:d=[],onCreateTag:i,attachments:u=[],onUploadAttachments:m,onDeleteAttachment:p,availableTasks:g=[],comments:f=[],onAddComment:x,currentUser:y,mentionableUsers:b=[],onUploadCommentAttachments:h,enableTimeTracking:v=false,timeTrackingSummary:w,timeEntries:D=[],isTimerRunning:S=false,timerElapsedSeconds:M=0,onTimeLog:T,onEstimateUpdate:F,onSoldEffortUpdate:A,onTimerStart:C,onTimerStop:_,onTimerDiscard:W,blurFinancials:oe=false}){let L=s==="dark",Y={textTertiary:L?"#6B7280":"#9CA3AF",textSecondary:L?"#9CA3AF":"#6B7280",textPrimary:L?"#FFFFFF":"#111827",borderLight:L?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",border:L?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",bgPrimary:L?"#1A1D25":"#FFFFFF",bgSecondary:L?"#0A0A0A":"#F9FAFB",hoverBg:L?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"},K=e&&"title"in e&&!("name"in e),V=e,[B,X]=react.useState(e?gp(e,l):null),[Ce,Re]=react.useState(false),[R,ae]=react.useState(false),[be,Ie]=react.useState(false),[De,Ee]=react.useState(null),[He,rt]=react.useState(new Date),[pe,We]=react.useState(false),[je,Oe]=react.useState(false),[tt,wt]=react.useState(""),[pt,Ue]=react.useState(false),[ot,Et]=react.useState(false),[ge,ht]=react.useState(false),[k,O]=react.useState(false),[Z,ve]=react.useState(""),$=react.useRef(null),re=react.useRef(null),[Ye,Te]=react.useState(""),Fe=react.useRef(null),[ze,Le]=react.useState(""),[Ze,st]=react.useState(false),[yt,xt]=react.useState([]),[$t,ut]=react.useState(""),[Gt,Mt]=react.useState(false),It=react.useRef(null);react.useEffect(()=>{if(console.log("\u{1F4E5} TaskDetailModal useEffect - task received:",{isOpen:t,taskId:e?.id,taskName:e?.name,soldEffortMinutes:e?.soldEffortMinutes,quotedMinutes:e?.quotedMinutes,effortMinutes:e?.effortMinutes,timeLoggedMinutes:e?.timeLoggedMinutes,fullTask:e}),e&&t){let N=gp(e,l);console.log("\u{1F4E5} After normalizeToTask:",{taskId:N?.id,taskName:N?.name,soldEffortMinutes:N?.soldEffortMinutes,quotedMinutes:N?.quotedMinutes,effortMinutes:N?.effortMinutes,timeLoggedMinutes:N?.timeLoggedMinutes}),X(N),ve(N.description||""),Te(N.name||"");}},[e?.id,e?.quotedMinutes,l,t]),react.useEffect(()=>{if(!t||!Z)return;let N=setTimeout(()=>{let U=re.current;U&&(U.style.height="auto",U.style.height=`${Math.max(100,U.scrollHeight)}px`);},50);return ()=>clearTimeout(N)},[t,Z]),react.useEffect(()=>()=>{$.current&&clearTimeout($.current),Fe.current&&clearTimeout(Fe.current);},[]),react.useEffect(()=>{t&&It.current&&f.length>0&&setTimeout(()=>{It.current&&(It.current.scrollTop=It.current.scrollHeight);},100);},[t,f.length]);let Ft=react.useCallback(N=>{X(N),K&&n&&V?n(Dh(N,V)):r&&r(N);},[K,V,n,r]),Ct=react.useCallback(()=>{Re(false),ae(false),Ie(false),Ee(null),Oe(false),wt(""),Ue(false);},[]),St=react.useCallback((N,U)=>{if(!B)return;let Ne={...B,[N]:U};Ft(Ne);},[B,Ft]),ct=react.useCallback(()=>{let N=re.current;N&&(N.style.height="auto",N.style.height=`${Math.max(100,N.scrollHeight)}px`);},[]),fa=react.useCallback(N=>{ve(N),setTimeout(ct,0),$.current&&clearTimeout($.current),$.current=setTimeout(()=>{if(B){let U={...B,description:N};Ft(U);}},800);},[B,Ft,ct]),xa=react.useCallback(N=>{Te(N),Fe.current&&clearTimeout(Fe.current),Fe.current=setTimeout(()=>{if(B&&N.trim()){let U={...B,name:N.trim()};Ft(U);}},800);},[B,Ft]),H=react.useCallback(N=>{let U=N.map(Ne=>{let q={id:`pending-${Date.now()}-${Math.random().toString(36).slice(2)}`,file:Ne};return Ne.type.startsWith("image/")&&(q.preview=URL.createObjectURL(Ne)),q});xt(Ne=>[...Ne,...U]);},[]),se=react.useCallback(N=>{xt(U=>{let Ne=U.find(q=>q.id===N);return Ne?.preview&&URL.revokeObjectURL(Ne.preview),U.filter(q=>q.id!==N)});},[]),at=react.useCallback(async()=>{if(!(!B||!ze.trim()&&yt.length===0||!x)){st(true);try{let N=Xu(ze,b),U=[];if(yt.length>0&&h){let Ne=yt.map(q=>q.file);U=await h(Ne);}await x(B.id,ze.trim(),N.length>0?N:void 0,U.length>0?U:void 0),Le(""),yt.forEach(Ne=>{Ne.preview&&URL.revokeObjectURL(Ne.preview);}),xt([]);}finally{st(false);}}},[B,ze,yt,x,b,h]),Xt=react.useCallback(()=>{if(!B||!$t.trim())return;let N=B.subtasks||[],U={id:`subtask-${Date.now()}-${Math.random().toString(36).slice(2)}`,name:$t.trim(),progress:0,startDate:new Date,endDate:new Date,position:N.length},Ne=[...N,U],q={...B,subtasks:Ne};Ft(q),ut(""),Mt(false);},[B,$t,Ft]),ee=react.useCallback(N=>{if(!B?.subtasks)return;let U=B.subtasks.map(q=>q.id===N?{...q,progress:q.progress===100?0:100}:q),Ne={...B,subtasks:U};Ft(Ne);},[B,Ft]),ke=react.useCallback(N=>{if(!B?.subtasks)return;let U=B.subtasks.filter(q=>q.id!==N),Ne={...B,subtasks:U};Ft(Ne);},[B,Ft]),At=react.useCallback(N=>{let U=typeof N=="string"?new Date(N):N,q=new Date().getTime()-U.getTime(),et=Math.floor(q/6e4),Nt=Math.floor(q/36e5),Wt=Math.floor(q/864e5);return et<1?o==="es"?"Ahora":"Just now":et<60?o==="es"?`Hace ${et} min`:`${et}m ago`:Nt<24?o==="es"?`Hace ${Nt}h`:`${Nt}h ago`:Wt<7?o==="es"?`Hace ${Wt}d`:`${Wt}d ago`:U.toLocaleDateString(o==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})},[o]),kt=react.useCallback(N=>{if(!B)return;let U=B.progress||0;N==="completed"?U=100:N==="in-progress"&&U===0?U=10:N==="todo"&&(U=0);let Ne={...B,status:N,progress:U};Ft(Ne),Re(false);},[B,Ft]),it=react.useCallback((N,U)=>{if(!B)return;let Ne={...B,startDate:N,endDate:U};Ft(Ne);},[B,Ft]),dt=react.useCallback(()=>{let N=He.getFullYear(),U=He.getMonth(),Ne=new Date(N,U,1),et=new Date(N,U+1,0).getDate(),Nt=Ne.getDay(),Wt=[],Va=new Date(N,U,0).getDate();for(let oa=Nt-1;oa>=0;oa--)Wt.push({date:new Date(N,U-1,Va-oa),isCurrentMonth:false});for(let oa=1;oa<=et;oa++)Wt.push({date:new Date(N,U,oa),isCurrentMonth:true});let va=42-Wt.length;for(let oa=1;oa<=va;oa++)Wt.push({date:new Date(N,U+1,oa),isCurrentMonth:false});return Wt},[He]),J=react.useCallback(async N=>{if(N.preventDefault(),N.stopPropagation(),ht(false),!B||!m)return;let U=Array.from(N.dataTransfer.files);if(U.length!==0){O(true);try{await m(B.id,U);}finally{O(false);}}},[B,m]),xe=react.useCallback(async N=>{if(!B||!m||!N.target.files)return;let U=Array.from(N.target.files);if(U.length!==0){O(true);try{await m(B.id,U);}finally{O(false);}N.target.value="";}},[B,m]),ue=react.useCallback(N=>{N.preventDefault(),N.stopPropagation(),ht(true);},[]),z=react.useCallback(N=>{N.preventDefault(),N.stopPropagation(),ht(false);},[]),ne=react.useCallback(N=>N<1024?`${N} B`:N<1024*1024?`${(N/1024).toFixed(1)} KB`:`${(N/(1024*1024)).toFixed(1)} MB`,[]),Ve=react.useCallback(N=>N.startsWith("image/")?lucideReact.Image:N.includes("pdf")||N.includes("document")?lucideReact.FileText:lucideReact.File,[]);return !t||!B?null:jsxRuntime.jsx(framerMotion.AnimatePresence,{children:t&&B&&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.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},className:c("fixed inset-4 md:inset-8 lg:inset-12 rounded-xl shadow-2xl z-50 flex overflow-hidden",L?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxRuntime.jsxs("div",{className:c("px-6 py-3 border-b flex items-center gap-3 h-[49px]",L?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Circle,{className:c("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("span",{className:c("text-xs px-2 py-0.5 rounded",L?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:[o==="es"?"Tarea":"Task"," \u2228"]}),jsxRuntime.jsx("span",{className:c("text-xs font-mono",L?"text-[#6B7280]":"text-gray-400"),children:B.id.slice(0,8)})]}),jsxRuntime.jsx("div",{className:"flex-1"})]}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{let N=B.progress===100?0:100,Ne={...B,progress:N,status:N===100?"completed":"todo"};Ft(Ne);},className:c("mt-2 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors flex-shrink-0",B.progress===100?"bg-green-500 border-green-500":L?"border-white/30 hover:border-white/50":"border-gray-300 hover:border-gray-400"),children:B.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("input",{type:"text",value:Ye,onChange:N=>xa(N.target.value),placeholder:o==="es"?"Nombre de la tarea...":"Task name...",className:c("text-xl font-semibold flex-1 bg-transparent outline-none border-none px-0 py-0","focus:ring-0 focus:outline-none",B.progress===100?"line-through text-[#6B7280]":L?"text-white placeholder:text-[#6B7280]":"text-gray-900 placeholder:text-gray-400")})]})}),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:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Estado":"Status"}),jsxRuntime.jsx("button",{onClick:()=>{Ct(),Re(!Ce);},className:c("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",B.progress===100||B.status==="completed"?"bg-green-500/20 text-green-400":B.progress&&B.progress>0||B.status==="in-progress"?"bg-[#00E5CC]/20 text-[#00E5CC]":L?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:B.progress===100||B.status==="completed"?o==="es"?"COMPLETADO":"DONE":B.progress&&B.progress>0||B.status==="in-progress"?o==="es"?"EN PROGRESO":"IN PROGRESS":o==="es"?"POR HACER":"TO DO"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Ce&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Re(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:c("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",L?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"todo",label:o==="es"?"Por hacer":"To Do",color:"bg-gray-400"},{id:"in-progress",label:o==="es"?"En progreso":"In Progress",color:"bg-[#00E5CC]"},{id:"completed",label:o==="es"?"Completado":"Done",color:"bg-green-500"}].map(N=>jsxRuntime.jsxs("button",{onClick:()=>kt(N.id),className:c("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",L?"hover:bg-white/5":"hover:bg-gray-50",B.status===N.id&&(L?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:c("w-2 h-2 rounded-full",N.color)}),jsxRuntime.jsx("span",{className:L?"text-white":"text-gray-900",children:N.label})]},N.id))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.User,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Asignados":"Assignees"}),jsxRuntime.jsxs("button",{onClick:()=>{Ct(),Ie(!be);},className:c("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",L?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[B.assignees&&B.assignees.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[B.assignees.slice(0,3).map((N,U)=>jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:N.color||"#8B5CF6"},title:N.name,children:N.initials||N.name.slice(0,2).toUpperCase()},U)),B.assignees.length>3&&jsxRuntime.jsxs("span",{className:c("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:["+",B.assignees.length-3]})]}):jsxRuntime.jsx("span",{className:c("text-sm",L?"text-[#6B7280]":"text-gray-400"),children:o==="es"?"Agregar":"Add"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-3 h-3",L?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:be&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Ie(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:c("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[200px] max-h-[280px] overflow-y-auto",L?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:l.length>0?l.map(N=>{let U=B.assignees?.some(Ne=>Ne.name===N.name);return jsxRuntime.jsxs("button",{onClick:()=>{let Ne=B.assignees||[],q;U?q=Ne.filter(et=>et.name!==N.name):q=[...Ne,N],St("assignees",q);},className:c("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors text-left",L?"hover:bg-white/5":"hover:bg-gray-50",U&&(L?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:N.color||"#8B5CF6"},children:N.initials||N.name.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:c("flex-1",L?"text-white":"text-gray-900"),children:N.name}),U&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},N.name)}):jsxRuntime.jsx("div",{className:c("px-3 py-4 text-sm text-center",L?"text-[#6B7280]":"text-gray-500"),children:o==="es"?"No hay usuarios disponibles":"No users available"})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Fechas":"Dates"}),jsxRuntime.jsxs("button",{onClick:()=>{Ee(De?null:"start"),rt(B.startDate||new Date);},className:c("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",L?"bg-white/5 hover:bg-white/10 text-white":"bg-gray-100 hover:bg-gray-200 text-gray-900"),children:[B.startDate?.toLocaleDateString(o==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(o==="es"?"Inicio":"Start"),jsxRuntime.jsx("span",{className:c("mx-1",L?"text-[#6B7280]":"text-gray-400"),children:"\u2192"}),B.endDate?.toLocaleDateString(o==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(o==="es"?"Fin":"End")]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:De&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Ee(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:c("absolute left-0 top-full mt-2 z-50 rounded-xl shadow-2xl overflow-hidden flex",L?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:N=>N.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:c("w-44 py-2 border-r",L?"border-white/10":"border-gray-200"),children:[(()=>{let N=new Date,U=new Date(N);U.setDate(N.getDate()+1);let Ne=new Date(N);Ne.setDate(N.getDate()+((6-N.getDay()+7)%7||7));let q=new Date(N);q.setDate(N.getDate()+((1-N.getDay()+7)%7||7));let et=new Date(N);et.setDate(N.getDate()+(6-N.getDay()+7)%7+7);let Nt=new Date(N);Nt.setDate(N.getDate()+14);let Wt=new Date(N);return Wt.setDate(N.getDate()+28),[{label:o==="es"?"Hoy":"Today",date:N,display:N.toLocaleDateString(o==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:o==="es"?"Ma\xF1ana":"Tomorrow",date:U,display:U.toLocaleDateString(o==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:o==="es"?"Este fin de semana":"This weekend",date:Ne,display:o==="es"?"s\xE1b.":"sat."},{label:o==="es"?"Pr\xF3xima semana":"Next week",date:q,display:o==="es"?"lun.":"mon."},{label:o==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:et,display:et.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:o==="es"?"2 semanas":"2 weeks",date:Nt,display:Nt.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:o==="es"?"4 semanas":"4 weeks",date:Wt,display:Wt.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((va,oa)=>jsxRuntime.jsxs("button",{className:c("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",L?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{if(De==="start"){let cr=B.endDate&&va.date>B.endDate?va.date:B.endDate;it(va.date,cr),Ee("end");}else {let cr=B.startDate&&va.date<B.startDate?va.date:B.startDate;it(cr,va.date),Ee(null);}},children:[jsxRuntime.jsx("span",{children:va.label}),jsxRuntime.jsx("span",{className:c("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:va.display})]},oa))})(),jsxRuntime.jsx("div",{className:c("border-t mt-2 pt-2",L?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{it(void 0,void 0),Ee(null);},className:c("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",L?"hover:bg-white/5 text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:o==="es"?"Quitar fechas":"Clear dates"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:c("text-xs mb-3 px-2 py-1 rounded",L?"bg-white/5 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:De==="start"?o==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":o==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:c("font-medium",L?"text-white":"text-gray-900"),children:He.toLocaleDateString(o==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>rt(new Date),className:c("p-1 rounded text-sm transition-colors",L?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:o==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>rt(new Date(He.getFullYear(),He.getMonth()-1)),className:c("p-1 rounded",L?"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("button",{onClick:()=>rt(new Date(He.getFullYear(),He.getMonth()+1)),className:c("p-1 rounded",L?"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:(o==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(N=>jsxRuntime.jsx("div",{className:c("w-8 h-8 flex items-center justify-center text-xs",L?"text-[#6B7280]":"text-gray-400"),children:N},N))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:dt().map((N,U)=>{let Ne=N.date.toDateString()===new Date().toDateString(),q=B.startDate?.toDateString()===N.date.toDateString(),et=B.endDate?.toDateString()===N.date.toDateString(),Nt=q||et,Wt=B.startDate&&B.endDate&&N.date>=B.startDate&&N.date<=B.endDate;return jsxRuntime.jsx("button",{onClick:()=>{let Va=new Date(N.date);if(De==="start"){let va=B.endDate&&Va>B.endDate?Va:B.endDate;it(Va,va),Ee("end");}else {let va=B.startDate&&Va<B.startDate?Va:B.startDate;it(va,Va),Ee(null);}},className:c("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!N.isCurrentMonth&&(L?"text-[#4B5563]":"text-gray-300"),N.isCurrentMonth&&(L?"text-white":"text-gray-900"),Ne&&"ring-2 ring-[#00E5CC]",q&&"bg-[#00E5CC] text-white",et&&!q&&"bg-[#7C3AED] text-white",Wt&&!Nt&&(L?"bg-[#7C3AED]/20":"bg-purple-100"),!Nt&&(L?"hover:bg-white/10":"hover:bg-gray-100")),children:N.date.getDate()},U)})})]})]})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Flag,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Prioridad":"Priority"}),jsxRuntime.jsx("button",{onClick:()=>{Ct(),ae(!R);},className:c("text-xs px-2 py-1 rounded font-medium transition-all hover:ring-2 hover:ring-white/20",B.priority==="high"||B.priority==="urgent"?"bg-red-500/20 text-red-400":B.priority==="medium"?"bg-yellow-500/20 text-yellow-400":B.priority==="low"?"bg-green-500/20 text-green-400":L?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:B.priority?B.priority==="high"||B.priority==="urgent"?o==="es"?"Alta":"High":B.priority==="medium"?o==="es"?"Media":"Medium":o==="es"?"Baja":"Low":o==="es"?"Sin prioridad":"No priority"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:R&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>ae(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:c("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",L?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"urgent",label:o==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:o==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:o==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:o==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:o==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(N=>jsxRuntime.jsxs("button",{onClick:()=>{St("priority",N.id),ae(false);},className:c("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",L?"hover:bg-white/5":"hover:bg-gray-50",B.priority===N.id&&(L?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:c("w-2 h-2 rounded-full",N.color)}),jsxRuntime.jsx("span",{className:L?"text-white":"text-gray-900",children:N.label})]},N.id||"none"))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Clock,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Duraci\xF3n":"Duration"}),jsxRuntime.jsx("span",{className:c("text-sm",L?"text-white":"text-gray-900"),children:B.startDate&&B.endDate?`${Math.ceil((B.endDate.getTime()-B.startDate.getTime())/(1e3*60*60*24))} ${o==="es"?"d\xEDas":"days"}`:o==="es"?"Sin definir":"Not set"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:c("w-4 h-4 rounded-full border-2",L?"border-[#6B7280]":"border-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Progreso":"Progress"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[pe?jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:B.progress||0,onChange:N=>{let U=parseInt(N.target.value),Ne=B.status;U===100?Ne="completed":U>0?Ne="in-progress":Ne="todo";let q={...B,progress:U,status:Ne};Ft(q);},onBlur:()=>We(false),className:c("flex-1 max-w-[120px] h-2 rounded-full appearance-none cursor-pointer",L?"bg-white/10":"bg-gray-200","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[#00E5CC] [&::-webkit-slider-thumb]:cursor-pointer"),autoFocus:true}):jsxRuntime.jsx("button",{onClick:()=>We(true),className:c("flex-1 h-2 rounded-full overflow-hidden max-w-[120px] cursor-pointer hover:ring-2 hover:ring-white/20 transition-all",L?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:c("h-full rounded-full transition-all",B.progress===100?"bg-green-500":"bg-[#00E5CC]"),style:{width:`${B.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:c("text-sm font-medium min-w-[40px]",L?"text-white":"text-gray-900"),children:[B.progress||0,"%"]})]})]}),v&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Hourglass,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Duraci\xF3n estimada":"Estimated duration"}),jsxRuntime.jsx("div",{className:"flex items-center gap-2 flex-1",children:B.status==="completed"||B.progress===100?jsxRuntime.jsx("span",{className:c("text-sm px-2 py-0.5 cursor-not-allowed",L?"text-gray-600":"text-gray-300"),title:o==="es"?"Tarea completada":"Task completed",children:w?.estimateMinutes?Fn(w.estimateMinutes):o==="es"?"Vac\xEDo":"Empty"}):w?.estimateMinutes?jsxRuntime.jsx("button",{type:"button",onClick:()=>Et("estimate"),className:c("text-sm px-2 py-0.5 rounded",L?"text-white hover:bg-white/10":"text-gray-900 hover:bg-gray-100"),children:Fn(w.estimateMinutes)}):jsxRuntime.jsx("button",{type:"button",onClick:()=>Et("estimate"),className:c("text-sm",L?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-500"),children:o==="es"?"Vac\xEDo":"Empty"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:ot==="estimate"&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"absolute top-full left-28 mt-2 z-50",children:jsxRuntime.jsx(io,{mode:"estimate",locale:o,isDark:L,currentValue:w?.estimateMinutes||null,onSave:async N=>{await F?.(B.id,N),Et(false);},onClose:()=>Et(false)})})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.FileText,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Tiempo ofertado":"Quoted time"}),jsxRuntime.jsx("div",{className:"flex items-center gap-2 flex-1",children:oe?jsxRuntime.jsx("span",{className:c("text-sm select-none blur-[4px] opacity-60 pointer-events-none",L?"text-[#94A3B8]":"text-gray-500"),title:o==="es"?"No tienes permisos para ver este dato":"You don't have permission to view this data","aria-hidden":"true",children:"\u2022\u2022\u2022\u2022"}):B.status==="completed"||B.progress===100?jsxRuntime.jsx("span",{className:c("text-sm px-2 py-0.5 cursor-not-allowed",L?"text-gray-600":"text-gray-300"),title:o==="es"?"Tarea completada":"Task completed",children:B.quotedMinutes?Fn(B.quotedMinutes):o==="es"?"Vac\xEDo":"Empty"}):B.quotedMinutes?jsxRuntime.jsx("button",{type:"button",onClick:()=>Et("quoted"),className:c("text-sm px-2 py-0.5 rounded",L?"text-white hover:bg-white/10":"text-gray-900 hover:bg-gray-100"),children:Fn(B.quotedMinutes)}):jsxRuntime.jsx("button",{type:"button",onClick:()=>Et("quoted"),className:c("text-sm",L?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-500"),children:o==="es"?"Vac\xEDo":"Empty"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:ot==="quoted"&&!oe&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"absolute top-full left-28 mt-2 z-50",children:jsxRuntime.jsx(io,{mode:"quoted",locale:o,isDark:L,currentValue:B.quotedMinutes||null,onSave:async N=>{A?(await A(B.id,N),X(U=>U?{...U,quotedMinutes:N}:null)):St("quotedMinutes",N),Et(false);},onClose:()=>Et(false)})})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Clock,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Registrar tiempo":"Track time"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[B.status==="completed"||B.progress===100?jsxRuntime.jsx("div",{className:c("flex items-center gap-1.5 p-1.5 rounded-full cursor-not-allowed",L?"bg-white/5 text-gray-600":"bg-gray-50 text-gray-300"),title:o==="es"?"Tarea completada":"Task completed",children:jsxRuntime.jsx(lucideReact.Play,{className:"w-3.5 h-3.5 fill-current"})}):S?jsxRuntime.jsxs("button",{type:"button",onClick:()=>_?.(B.id),className:c("flex items-center gap-1.5 px-2 py-1 rounded text-sm transition-colors","bg-red-500/10 text-red-500 hover:bg-red-500/20"),children:[jsxRuntime.jsx(lucideReact.Square,{className:"w-3.5 h-3.5 fill-current"}),Nh(M||0)]}):jsxRuntime.jsx("button",{type:"button",onClick:()=>C?.(B.id),className:c("flex items-center gap-1.5 p-1.5 rounded-full transition-colors",L?"bg-white/10 text-white hover:bg-white/20":"bg-gray-100 text-gray-700 hover:bg-gray-200"),title:o==="es"?"Iniciar temporizador":"Start timer",children:jsxRuntime.jsx(lucideReact.Play,{className:"w-3.5 h-3.5 fill-current"})}),B.status==="completed"||B.progress===100?jsxRuntime.jsxs("div",{className:c("flex items-center gap-1.5 px-2 py-1 rounded text-sm cursor-not-allowed",L?"text-gray-600":"text-gray-300"),title:o==="es"?"Tarea completada":"Task completed",children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),o==="es"?"Agregar tiempo":"Add time"]}):jsxRuntime.jsxs("button",{type:"button",onClick:()=>Et("log"),className:c("flex items-center gap-1.5 px-2 py-1 rounded text-sm transition-colors",L?"text-[#9CA3AF] hover:bg-white/10 hover:text-white":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),o==="es"?"Agregar tiempo":"Add time"]}),w&&w.loggedMinutes>0&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:c("text-sm font-medium",w.health==="over-budget"?"text-red-500":w.health==="at-risk"?"text-yellow-500":L?"text-white":"text-gray-900"),children:[Fn(w.loggedMinutes),w.estimateMinutes&&jsxRuntime.jsxs("span",{className:c("font-normal",L?"text-[#6B7280]":"text-gray-400"),children:[" / ",Fn(w.estimateMinutes)]})]}),w.health!=="no-estimate"&&jsxRuntime.jsx("div",{className:"w-16 h-1.5 rounded-full overflow-hidden bg-gray-200 dark:bg-gray-700",children:jsxRuntime.jsx("div",{className:c("h-full rounded-full transition-all",w.health==="over-budget"?"bg-red-500":w.health==="at-risk"?"bg-yellow-500":"bg-green-500"),style:{width:`${Math.min(100,w.progressPercent||0)}%`}})})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:ot==="log"&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"absolute top-full left-28 mt-2 z-50",children:jsxRuntime.jsx(io,{mode:"log",locale:o,isDark:L,currentValue:null,onSave:async(N,U)=>{N&&await T?.(B.id,{durationMinutes:N,note:U,source:"manual"}),Et(false);},onClose:()=>Et(false)})})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Tag,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Etiquetas":"Tags"}),jsxRuntime.jsx(Ro,{selectedTags:B.tags||[],availableTags:d,onChange:N=>{St("tags",N);},onCreateTag:i,theme:Y})]}),jsxRuntime.jsxs("div",{className:"flex items-start gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Link2,{className:c("w-4 h-4 mt-1.5",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0 mt-1",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Relaciones":"Relations"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[B.dependencies&&B.dependencies.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:B.dependencies.map(N=>{let U=g.find(Ne=>Ne.id===N);return jsxRuntime.jsxs("span",{className:c("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",L?"bg-[#00E5CC]/20 text-[#00E5CC]":"bg-[#00E5CC]/15 text-[#00C4AE]"),children:[U?.name||N.slice(0,8),jsxRuntime.jsx("button",{onClick:()=>{let Ne=(B.dependencies||[]).filter(q=>q!==N);St("dependencies",Ne);},className:c("ml-0.5 hover:bg-white/20 rounded-full p-0.5 transition-colors"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},N)})}),jsxRuntime.jsxs("button",{onClick:()=>{Ct(),Oe(!je);},className:c("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",L?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:c("text-sm",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Agregar dependencia":"Add dependency"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:je&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{Oe(false),wt("");}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:c("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[280px] max-h-[320px]",L?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[jsxRuntime.jsx("div",{className:c("p-2 border-b",L?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("input",{type:"text",value:tt,onChange:N=>wt(N.target.value),placeholder:o==="es"?"Buscar tarea...":"Search task...",className:c("w-full px-3 py-2 rounded-md text-sm outline-none",L?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400"),autoFocus:true})}),jsxRuntime.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:g.length>0?g.filter(N=>N.id!==B.id).filter(N=>tt===""||N.name.toLowerCase().includes(tt.toLowerCase())).map(N=>{let U=B.dependencies?.includes(N.id);return jsxRuntime.jsxs("button",{onClick:()=>{let Ne=B.dependencies||[],q;U?q=Ne.filter(et=>et!==N.id):q=[...Ne,N.id],St("dependencies",q);},className:c("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors text-left",L?"hover:bg-white/5":"hover:bg-gray-50",U&&(L?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:c("w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0",U?"bg-[#00E5CC] border-[#00E5CC]":L?"border-white/30":"border-gray-300"),children:U&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:c("block truncate",L?"text-white":"text-gray-900"),children:N.name}),jsxRuntime.jsx("span",{className:c("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:N.id.slice(0,8)})]})]},N.id)}):jsxRuntime.jsx("div",{className:c("px-3 py-4 text-sm text-center",L?"text-[#6B7280]":"text-gray-500"),children:o==="es"?"No hay tareas disponibles":"No tasks available"})})]})]})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Palette,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:"Color"}),jsxRuntime.jsxs("button",{onClick:()=>{Ct(),Ue(!pt);},className:c("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",L?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:B.color||"#6366F1"}}),jsxRuntime.jsx("span",{className:c("text-sm",L?"text-white":"text-gray-900"),children:sn.find(N=>N.value===B.color)?.name||(o==="es"?"Azul":"Blue")}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-3 h-3",L?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:pt&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Ue(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:c("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden p-3",L?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:jsxRuntime.jsx("div",{className:"grid grid-cols-6 gap-1.5",children:sn.map(N=>{let U=B.color===N.value;return jsxRuntime.jsx("button",{onClick:()=>{St("color",N.value),Ue(false);},className:c("w-7 h-7 rounded-full flex items-center justify-center transition-all",U&&"ring-2 ring-offset-2",L?"ring-offset-[#1A1D25]":"ring-offset-white"),style:{backgroundColor:N.value,outlineColor:U?N.value:void 0},title:N.name,children:U&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 text-white"})},N.value)})})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Diamond,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Hito":"Milestone"}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:B.isMilestone||false,onChange:N=>St("isMilestone",N.target.checked),className:c("w-4 h-4 rounded border-2 cursor-pointer appearance-none transition-colors",B.isMilestone?"bg-purple-500 border-purple-500":L?"border-white/30 bg-transparent":"border-gray-300 bg-transparent","checked:bg-purple-500 checked:border-purple-500")}),jsxRuntime.jsx("span",{className:c("text-sm",L?"text-white":"text-gray-900"),children:o==="es"?"Marcar como hito":"Mark as milestone"})]})]})]}),jsxRuntime.jsxs("div",{className:c("mt-6 pt-4 border-t",L?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[jsxRuntime.jsx(lucideReact.FileText,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("h3",{className:c("text-sm font-semibold",L?"text-white":"text-gray-900"),children:o==="es"?"Descripci\xF3n":"Description"})]}),jsxRuntime.jsx("textarea",{ref:re,value:Z,onChange:N=>fa(N.target.value),placeholder:o==="es"?"Agregar descripci\xF3n...":"Add description...",className:c("w-full min-h-[100px] max-h-[400px] px-3 py-2 rounded-lg text-sm resize-none outline-none transition-colors overflow-y-auto",L?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400 focus:bg-gray-200")})]}),jsxRuntime.jsxs("div",{className:c("mt-6 pt-4 border-t",L?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("div",{className:"flex items-center justify-between mb-3",children:jsxRuntime.jsxs("h3",{className:c("text-sm font-semibold",L?"text-white":"text-gray-900"),children:[o==="es"?"Subtareas":"Subtasks",B.subtasks&&B.subtasks.length>0&&jsxRuntime.jsxs("span",{className:c("ml-2 text-xs font-normal",L?"text-[#6B7280]":"text-gray-400"),children:["(",B.subtasks.filter(N=>N.progress===100).length,"/",B.subtasks.length,")"]})]})}),B.subtasks&&B.subtasks.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-3",children:[...B.subtasks].sort((N,U)=>(N.position??0)-(U.position??0)).map(N=>jsxRuntime.jsxs("div",{className:c("flex items-center gap-2 group p-2 rounded-lg -mx-2 transition-colors",L?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx("button",{onClick:()=>ee(N.id),className:c("w-5 h-5 rounded border flex items-center justify-center flex-shrink-0 transition-colors",N.progress===100?"bg-green-500 border-green-500":L?"border-white/20 hover:border-green-500/50":"border-gray-300 hover:border-green-500"),children:N.progress===100&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:c("text-sm flex-1",N.progress===100?"line-through text-[#6B7280]":L?"text-white":"text-gray-900"),children:N.name}),jsxRuntime.jsx("button",{onClick:()=>ke(N.id),className:c("p-1 rounded opacity-0 group-hover:opacity-100 transition-opacity",L?"hover:bg-white/10 text-[#6B7280] hover:text-red-400":"hover:bg-gray-100 text-gray-400 hover:text-red-500"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-3.5 h-3.5"})})]},N.id))}),Gt?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:$t,onChange:N=>ut(N.target.value),onKeyDown:N=>{N.key==="Enter"&&$t.trim()?Xt():N.key==="Escape"&&(Mt(false),ut(""));},placeholder:o==="es"?"Nombre de la subtarea...":"Subtask name...",autoFocus:true,className:c("flex-1 px-3 py-2 rounded-lg text-sm outline-none transition-colors",L?"bg-white/5 border border-white/10 text-white placeholder:text-[#6B7280] focus:border-[#00E5CC]/50":"bg-gray-50 border border-gray-200 text-gray-900 placeholder:text-gray-400 focus:border-[#00E5CC]")}),jsxRuntime.jsx("button",{onClick:Xt,disabled:!$t.trim(),className:c("px-3 py-2 rounded-lg text-sm font-medium transition-colors",$t.trim()?"bg-[#00E5CC] hover:bg-[#00C4AE] text-white":L?"bg-white/5 text-[#6B7280] cursor-not-allowed":"bg-gray-100 text-gray-400 cursor-not-allowed"),children:o==="es"?"Agregar":"Add"}),jsxRuntime.jsx("button",{onClick:()=>{Mt(false),ut("");},className:c("p-2 rounded-lg transition-colors",L?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}):jsxRuntime.jsxs("button",{onClick:()=>Mt(true),className:c("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",L?"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"}),o==="es"?"Agregar subtarea":"Add subtask"]})]}),jsxRuntime.jsxs("div",{className:c("mt-6 pt-4 border-t",L?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("h3",{className:c("text-sm font-semibold mb-3",L?"text-white":"text-gray-900"),children:[o==="es"?"Adjuntos":"Attachments",u.length>0&&jsxRuntime.jsxs("span",{className:c("ml-2 text-xs font-normal",L?"text-[#6B7280]":"text-gray-400"),children:["(",u.length,")"]})]}),u.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-4",children:u.map(N=>{let U=Ve(N.type),Ne=N.type.startsWith("image/");return jsxRuntime.jsxs("div",{className:c("flex items-center gap-3 p-2 rounded-lg group transition-colors",L?"bg-white/5 hover:bg-white/10":"bg-gray-50 hover:bg-gray-100"),children:[Ne&&N.thumbnailUrl?jsxRuntime.jsx("img",{src:N.thumbnailUrl,alt:N.name,className:"w-10 h-10 rounded object-cover"}):jsxRuntime.jsx("div",{className:c("w-10 h-10 rounded flex items-center justify-center",L?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(U,{className:c("w-5 h-5",L?"text-[#9CA3AF]":"text-gray-500")})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("a",{href:N.url,target:"_blank",rel:"noopener noreferrer",className:c("text-sm font-medium truncate block hover:underline",L?"text-white":"text-gray-900"),children:N.name}),jsxRuntime.jsx("p",{className:c("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:ne(N.size)})]}),p&&jsxRuntime.jsx("button",{onClick:()=>p(N.id),className:c("p-1.5 rounded opacity-0 group-hover:opacity-100 transition-all",L?"hover:bg-red-500/20 text-red-400":"hover:bg-red-100 text-red-500"),title:o==="es"?"Eliminar":"Delete",children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},N.id)})}),jsxRuntime.jsxs("div",{onDragOver:ue,onDragLeave:z,onDrop:J,className:c("border-2 border-dashed rounded-lg p-6 text-center transition-all cursor-pointer relative",ge?L?"border-[#00E5CC] bg-[#00E5CC]/10":"border-[#00E5CC] bg-[#00E5CC]/15":L?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300",k&&"pointer-events-none opacity-50"),children:[jsxRuntime.jsx("input",{type:"file",multiple:true,onChange:xe,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",disabled:!m||k}),k?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-6 h-6 mx-auto mb-2 border-2 border-[#00E5CC] border-t-transparent rounded-full animate-spin"}),jsxRuntime.jsx("p",{className:c("text-sm",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Subiendo...":"Uploading..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Upload,{className:c("w-6 h-6 mx-auto mb-2",ge?"text-[#00E5CC]":L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:c("text-sm",L?"text-[#9CA3AF]":"text-gray-500"),children:ge?o==="es"?"Suelta los archivos aqu\xED":"Drop files here":o==="es"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Suelta tus archivos aqu\xED o ",jsxRuntime.jsx("span",{className:"underline",children:"haz clic para subir"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Drop your files here or ",jsxRuntime.jsx("span",{className:"underline",children:"click to upload"})]})}),!m&&jsxRuntime.jsx("p",{className:c("text-xs mt-1",L?"text-[#6B7280]":"text-gray-400"),children:o==="es"?"Upload no disponible":"Upload not available"})]})]})]})]})]}),jsxRuntime.jsxs("div",{className:c("w-96 border-l flex flex-col",L?"border-white/[0.08] bg-[#0A0A0A]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsxs("div",{className:c("px-4 py-3 border-b flex items-center justify-between h-[49px]",L?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("h3",{className:c("text-sm font-semibold",L?"text-white":"text-gray-900"),children:[o==="es"?"Actividad":"Activity",f.length>0&&jsxRuntime.jsxs("span",{className:c("ml-2 text-xs font-normal",L?"text-[#6B7280]":"text-gray-400"),children:["(",f.length,")"]})]}),jsxRuntime.jsx("button",{onClick:a,className:c("p-1.5 rounded transition-colors",L?"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("style",{children:`
|
|
4
|
+
`);if(t.length<1||!t[0])return {success:!1,errors:["CSV file is empty or invalid"]};let a=wu(t[0]),r=[],n=new Map,s=[];for(let o=1;o<t.length;o++)try{let l=wu(t[o]||"");if(l.length>a.length){s.push(`Line ${o+1}: Too many columns`);continue}if(a.length-l.length>3){s.push(`Line ${o+1}: Column count mismatch (expected ${a.length}, got ${l.length})`);continue}for(;l.length<a.length;)l.push("");let i={};a.forEach((g,f)=>{i[g]=l[f]||"";});let u=i.Column||"Unnamed";n.has(u)||n.set(u,{id:`col-${n.size+1}`,title:u,position:n.size+1,cardIds:[]});let m=n.get(u),p={id:i["Card ID"]||`card-${o}`,title:i.Title||"Untitled",description:i.Description?i.Description:void 0,columnId:m.id,position:m.cardIds.length+1,priority:i.Priority||void 0,labels:i.Labels?i.Labels.split(";").filter(Boolean):void 0,assignedUserIds:i["Assigned Users"]?i["Assigned Users"].split(";").filter(Boolean):void 0,startDate:i["Start Date"]?i["Start Date"]:void 0,endDate:i["End Date"]?i["End Date"]:void 0,createdAt:i["Created At"]?i["Created At"]:void 0,updatedAt:i["Updated At"]?i["Updated At"]:void 0};r.push(p),m.cardIds.push(p.id);}catch(l){s.push(`Line ${o+1}: ${l instanceof Error?l.message:"Unknown error"}`);}return r.length===0?{success:!1,errors:["No valid cards found in CSV",...s]}:{success:!0,cardsImported:r.length,columnsImported:n.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 wu(e){let t=[],a="",r=false;for(let n=0;n<e.length;n++){let s=e[n],o=e[n+1];s==='"'&&r&&o==='"'?(a+='"',n++):s==='"'?r=!r:s===","&&!r?(t.push(a),a=""):a+=s;}return t.push(a),t}function ku(e,t){switch(t){case "json":return eb(e);case "csv":return tb(e);default:return {success:false,errors:[`Unsupported import format: ${t}`]}}}function Cu(e){return new Promise((t,a)=>{let r=new FileReader;r.onload=n=>{n.target?.result?t(n.target.result):a(new Error("Failed to read file"));},r.onerror=()=>a(new Error("Failed to read file")),r.readAsText(e);})}var Al=react.createContext(null);function Tu(){return react.useContext(Al)}var Nu=react.createContext(null);function Du({children:e,themeName:t}){return jsxRuntime.jsx(Nu.Provider,{value:{themeName:t},children:e})}function Dn(){return react.useContext(Nu)}function Qt({children:e,container:t}){let[a,r]=react.useState(false),n=Tu(),s=Dn();if(react.useEffect(()=>(r(true),()=>r(false)),[]),!a)return null;let o=t||(typeof document<"u"?document.body:null);if(!o)return null;if(n){let{theme:l,themeName:d}=n,i={"--asakaa-color-background-primary":l.bgPrimary,"--asakaa-color-background-secondary":l.bgSecondary,"--asakaa-color-background-card":l.bgGrid,"--asakaa-color-background-hover":l.hoverBg,"--asakaa-color-text-primary":l.textPrimary,"--asakaa-color-text-secondary":l.textSecondary,"--asakaa-color-text-tertiary":l.textTertiary,"--asakaa-color-text-inverse":l.taskBarHandle||"#FFFFFF","--asakaa-color-border-default":l.border,"--asakaa-color-border-hover":l.borderLight,"--asakaa-color-border-subtle":l.borderLight,"--asakaa-color-interactive-primary":l.accent,"--asakaa-color-interactive-primaryHover":l.accentHover,"--asakaa-color-interactive-primaryBorder":`${l.accent}4D`,"--asakaa-color-interactive-primaryBackground":`${l.accent}1A`,"--asakaa-color-interactive-primaryBackgroundHover":`${l.accent}33`,"--asakaa-color-status-success":l.statusCompleted,"--asakaa-color-status-warning":l.milestone,"--asakaa-color-status-error":l.criticalPath,"--asakaa-color-danger":l.criticalPath,"--asakaa-color-danger-border":`${l.criticalPath}4D`,"--asakaa-color-danger-background":`${l.criticalPath}14`,"--asakaa-color-danger-backgroundHover":`${l.criticalPath}26`};return reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":d,"data-gantt-portal":"true",style:i,children:e}),o)}return s?reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":s.themeName,"data-kanban-portal":"true",children:e}),o):reactDom.createPortal(e,o)}var Fu={URGENT:{label:"Urgent",color:"#EF4444"},HIGH:{label:"High",color:"#F97316"},MEDIUM:{label:"Normal",color:"#F59E0B"},LOW:{label:"Low",color:"#10B981"}},db="#BDC3C7",cb=({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 an({priority:e,onChange:t,className:a}){let[r,n]=react.useState(false),[s,o]=react.useState({top:0,left:0}),l=react.useRef(null),d=react.useRef(null),i=()=>{if(!d.current)return;let g=d.current.getBoundingClientRect(),f=window.innerHeight,x=window.innerWidth,y=160,b=220,h=4,v=g.right-y;v<10&&(v=g.left),v+y>x-10&&(v=x-y-10);let w=f-g.bottom,D=g.top,S;w>=b+h?S=g.bottom+h:D>=b+h?S=g.top-b-h:S=w>=D?g.bottom+h:Math.max(10,g.top-b-h),o({top:S,left:v}),n(true);};react.useEffect(()=>{let g=f=>{l.current&&!l.current.contains(f.target)&&!d.current?.contains(f.target)&&n(false);};if(r)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[r]),react.useEffect(()=>{let g=f=>{f.key==="Escape"&&n(false);};if(r)return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]);let u=g=>{t(g),n(false);},m=e?Fu[e]:null,p=m?.color||db;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:d,onClick:()=>r?n(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:e?`${p}10`:"transparent",boxShadow:e?`0 0 0 2px ${p}30 inset`:"none"},title:m?.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:p,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:p,fillOpacity:e?"0.6":"0.4"})})}),r&&jsxRuntime.jsx(Qt,{children:jsxRuntime.jsxs("div",{ref:l,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(Fu).map(([g,f])=>jsxRuntime.jsxs("button",{onClick:()=>u(g),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:f.color,background:"transparent"},onMouseEnter:x=>{x.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:x=>{x.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(cb,{color:f.color}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:f.label}),e===g&&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:"#00E5CC",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},g)),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:()=>u(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:g=>{g.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:g=>{g.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:"#00E5CC",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})]})})]})}var ub=[{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 is({startDate:e,endDate:t,onChange:a,className:r}){let[n,s]=react.useState(false),[o,l]=react.useState({top:0,left:0}),d=react.useRef(null),i=react.useRef(null),p=(Dn()?.themeName||"dark")==="dark",g=()=>{if(!i.current)return;let v=i.current.getBoundingClientRect(),w=window.innerHeight,D=window.innerWidth,S=320,M=380,T=4,F=v.left;F+S>D-10&&(F=D-S-10),F<10&&(F=10);let A=w-v.bottom,C=v.top,_;A>=M+T?_=v.bottom+T:C>=M+T?_=v.top-M-T:_=A>=C?v.bottom+T:Math.max(10,v.top-M-T),l({top:_,left:F}),s(true);};react.useEffect(()=>{let v=w=>{d.current&&!d.current.contains(w.target)&&!i.current?.contains(w.target)&&s(false);};if(n)return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[n]),react.useEffect(()=>{let v=w=>{w.key==="Escape"&&s(false);};if(n)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[n]);let f=v=>{let w=new Date,D=F=>{let A=F.getFullYear(),C=String(F.getMonth()+1).padStart(2,"0"),_=String(F.getDate()).padStart(2,"0");return `${A}-${C}-${_}`},S=D(w),M=new Date(w);M.setDate(M.getDate()+v);let T=D(M);a(S,T),s(false);},x=()=>{if(!e||!t)return "Set date";let v=M=>{if(M instanceof Date)return M;if(typeof M!="string"||!M.match(/^\d{4}-\d{2}-\d{2}$/))return null;let T=M.split("-").map(Number);if(T.length!==3||T.some(_=>isNaN(_)))return null;let F=T[0],A=T[1],C=T[2];return F===void 0||A===void 0||C===void 0?null:new Date(F,A-1,C)},w=v(e),D=v(t);if(!w||!D||isNaN(w.getTime())||isNaN(D.getTime()))return "Set date";let S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return `${S[w.getMonth()]} ${w.getDate()} \u2013 ${S[D.getMonth()]} ${D.getDate()}`},y=e&&t,h=(()=>{if(!t)return false;let v=typeof t=="string"?new Date(t):t,w=new Date;return w.setHours(0,0,0,0),v<w})();return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsxs("button",{ref:i,onClick:()=>n?s(false):g(),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:y?`${x()}`:"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:x()})]}),n&&jsxRuntime.jsx(Qt,{children:jsxRuntime.jsxs("div",{ref:d,className:"date-picker-menu rounded-xl shadow-2xl border min-w-[320px]",style:{position:"fixed",top:`${o.top}px`,left:`${o.left}px`,background:p?"#1A1D25":"#FFFFFF",border:`1px solid ${p?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.12)"}`,boxShadow:p?"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:p?"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:p?"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:ub.map(v=>jsxRuntime.jsx("button",{onClick:()=>f(v.days),className:"px-3 py-2.5 rounded-lg text-xs font-semibold transition-all active:scale-95",style:{color:p?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",border:`1px solid ${p?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)"}`,backgroundColor:p?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)"},onMouseEnter:w=>{w.currentTarget.style.backgroundColor=p?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.1)",w.currentTarget.style.border=`1px solid ${p?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.25)"}`;},onMouseLeave:w=>{w.currentTarget.style.backgroundColor=p?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",w.currentTarget.style.border=`1px solid ${p?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)"}`;},children:v.label},v.label))})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:p?"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:v=>a(v.target.value,t),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:p?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",borderColor:p?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)",color:p?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",colorScheme:p?"dark":"light"}}),jsxRuntime.jsx("input",{type:"date",value:t||"",onChange:v=>a(e,v.target.value),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:p?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",borderColor:p?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)",color:p?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",colorScheme:p?"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:v=>{v.currentTarget.style.background="rgba(239, 68, 68, 0.2)";},onMouseLeave:v=>{v.currentTarget.style.background="rgba(239, 68, 68, 0.1)";},children:"Clear Dates"})]})]})})]})}function on({assignedUsers:e=[],availableUsers:t,onChange:a,className:r,maxVisibleAvatars:n=3}){let[s,o]=react.useState(false),[l,d]=react.useState(""),[i,u]=react.useState({top:0,left:0}),m=react.useRef(null),p=react.useRef(null),g=()=>{if(!p.current)return;let h=p.current.getBoundingClientRect(),v=window.innerHeight,w=window.innerWidth,D=300,S=380,M=4,T=h.right-D;T<10&&(T=h.left),T+D>w-10&&(T=w-D-10);let F=v-h.bottom,A=h.top,C;F>=S+M?C=h.bottom+M:A>=S+M?C=h.top-S-M:C=F>=A?h.bottom+M:Math.max(10,h.top-S-M),u({top:C,left:T}),o(true);};react.useEffect(()=>{let h=v=>{m.current&&!m.current.contains(v.target)&&!p.current?.contains(v.target)&&(o(false),d(""));};if(s)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s]),react.useEffect(()=>{let h=v=>{v.key==="Escape"&&(o(false),d(""));};if(s)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[s]);let f=h=>{let v=e.some(w=>w.id===h.id);a(v?e.filter(w=>w.id!==h.id):[...e,h]);},x=t.filter(h=>h.name.toLowerCase().includes(l.toLowerCase())),y=e.slice(0,n),b=e.length-n;return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:p,onClick:()=>s?o(false):g(),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:[y.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)),b>0&&jsxRuntime.jsxs("div",{className:"asakaa-avatar",children:["+",b]})]}):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(Qt,{children:jsxRuntime.jsxs("div",{ref:m,className:"user-selector-menu rounded-xl shadow-2xl border min-w-[300px]",style:{position:"fixed",top:`${i.top}px`,left:`${i.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:l,onChange:h=>d(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:x.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"}):x.map(h=>{let v=e.some(w=>w.id===h.id);return jsxRuntime.jsxs("button",{onClick:()=>f(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:w=>{w.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.1))";},onMouseLeave:w=>{w.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:v?"#00E5CC":"transparent"},children:v?"\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([]),o(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 ri(e,t,a){let r=new Map;e.forEach(d=>{if(d.dependencies&&Array.isArray(d.dependencies)){let i=d.dependencies.map(u=>{if(typeof u=="string")return u;let m=u;return m.taskId||m.targetId||""}).filter(Boolean);r.set(d.id,i);}});let n=r.get(a)||[];r.set(a,[...n,t]);let s=new Set,o=new Set,l=d=>{if(!s.has(d)){s.add(d),o.add(d);let i=r.get(d)||[];for(let u of i){if(!s.has(u)&&l(u))return true;if(o.has(u))return true}}return o.delete(d),false};return l(a)}function ds({currentCardId:e,dependencies:t=[],availableTasks:a,onChange:r,className:n,validateCircular:s=true,onCircularDependencyError:o}){let[l,d]=react.useState(false),[i,u]=react.useState(""),[m,p]=react.useState(t.length>0),[g,f]=react.useState({top:0,left:0}),[x,y]=react.useState(null),b=react.useRef(null),h=react.useRef(null),v=()=>{if(!h.current)return;let T=h.current.getBoundingClientRect(),F=window.innerHeight,A=window.innerWidth,C=300,_=m?380:120,W=4,oe=T.right-C;oe<10&&(oe=T.left),oe+C>A-10&&(oe=A-C-10);let L=F-T.bottom,Y=T.top,K;L>=_+W?K=T.bottom+W:Y>=_+W?K=T.top-_-W:K=L>=Y?T.bottom+W:Math.max(10,T.top-_-W),f({top:K,left:oe}),d(true);};react.useEffect(()=>{if(!l||!h.current)return;let T=h.current.getBoundingClientRect(),F=window.innerHeight,A=window.innerWidth,C=300,_=m?380:120,W=4,oe=T.right-C;oe<10&&(oe=T.left),oe+C>A-10&&(oe=A-C-10);let L=F-T.bottom,Y=T.top,K;L>=_+W?K=T.bottom+W:Y>=_+W?K=T.top-_-W:K=L>=Y?T.bottom+W:Math.max(10,T.top-_-W),f({top:K,left:oe});},[m,l]),react.useEffect(()=>{let T=F=>{b.current&&!b.current.contains(F.target)&&!h.current?.contains(F.target)&&(d(false),u(""));};if(l)return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[l]),react.useEffect(()=>{let T=F=>{F.key==="Escape"&&(d(false),u(""));};if(l)return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[l]);let w=T=>{let F=t.includes(T),A=a.find(C=>C.id===T);if(y(null),F){let C=t.filter(_=>_!==T);r(C),C.length===0&&p(false);}else {if(s&&ri(a,T,e)){let _=`Cannot add "${A?.title||T}" as dependency - would create circular reference`;y(_),o?.(T,A?.title||T),setTimeout(()=>y(null),3e3);return}r([...t,T]),p(true);}},D=()=>{let T=!m;p(T),T||r([]);},S=a.filter(T=>T.id!==e).filter(T=>T.title.toLowerCase().includes(i.toLowerCase())||T.id.toLowerCase().includes(i.toLowerCase())),M=t.length>0?"#00E5CC":"#BDC3C7";return jsxRuntime.jsxs("div",{className:`relative ${n||""}`,children:[jsxRuntime.jsxs("button",{ref:h,onClick:()=>l?d(false):v(),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:M,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),t.length>0&&jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:M},children:t.length})]}),l&&jsxRuntime.jsx(Qt,{children:jsxRuntime.jsxs("div",{ref:b,className:"dependencies-selector-menu rounded-xl shadow-2xl border min-w-[300px]",style:{position:"fixed",top:`${g.top}px`,left:`${g.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:[x&&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:x})]}),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:m?"#00E5CC":"transparent",borderColor:m?"#00E5CC":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:m&&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"})]})}),m&&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:i,onChange:T=>u(T.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:S.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"}):S.map(T=>{let F=t.includes(T.id);return jsxRuntime.jsxs("button",{onClick:()=>w(T.id),className:"w-full px-4 py-2 flex items-start gap-3 text-sm transition-colors",style:{background:"transparent"},onMouseEnter:A=>{A.currentTarget.style.background="var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))";},onMouseLeave:A=>{A.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:F?"#00E5CC":"transparent",borderColor:F?"#00E5CC":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:F&&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:T.title}),jsxRuntime.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:T.id})]})]},T.id)})})]}),t.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-2 border-t border-white/5",children:jsxRuntime.jsx("button",{onClick:()=>{r([]),p(false),d(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 ko=react.memo(({card:e,render:t,onClick:a,isSelected:r,disableDrag:n,className:s,onUpdate:o,availableUsers:l=[],allCards:d=[]})=>{let{attributes:i,listeners:u,setNodeRef:m,transform:p,transition:g,isDragging:f}=sortable.useSortable({id:e.id,disabled:n,data:{type:"card",card:e}}),x={transform:Zs.Transform.toString(p),transition:g};if(t)return jsxRuntime.jsx("div",{ref:m,style:x,...i,...u,onClick:()=>a?.(e),children:t(e)});let y=l.filter(w=>e.assignedUserIds?.includes(w.id)),b=e.progress===100,h=(e.attachments||[]).filter(w=>w.type.startsWith("image/")),v={...x,...e.color&&{borderTopWidth:"3px",borderTopStyle:"solid",borderTopColor:e.color}};return jsxRuntime.jsxs("div",{ref:m,style:v,className:c("asakaa-card",f&&"asakaa-card-dragging",r&&"ring-2 ring-asakaa-accent-blue",s),...i,...u,onClick:w=>{w.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:w=>{w.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:w=>{w.currentTarget.style.display="none";}}):jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1",children:h.slice(0,4).map((w,D)=>jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("img",{src:w.url,alt:w.name,className:"w-full h-16 object-cover rounded",loading:"lazy",decoding:"async",style:{imageRendering:"auto",WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",transform:"translateZ(0)"},onError:S=>{S.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]})})]},w.id))})}),jsxRuntime.jsx("h3",{className:"asakaa-card-title mb-2",style:{textDecoration:b?"line-through":"none",opacity:b?.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:w=>w.stopPropagation(),className:"priority-selector",children:jsxRuntime.jsx(an,{priority:e.priority,onChange:w=>o?.(e.id,{priority:w})})}),jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"date-picker",children:jsxRuntime.jsx(is,{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:(w,D)=>o?.(e.id,{startDate:w,endDate:D})})}),l.length>0&&jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"user-selector",children:jsxRuntime.jsx(on,{assignedUsers:y,availableUsers:l,onChange:w=>o?.(e.id,{assignedUserIds:w.map(D=>D.id)})})}),jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"dependencies-selector",children:jsxRuntime.jsx(ds,{currentCardId:e.id,dependencies:Array.isArray(e.dependencies)?e.dependencies.map(w=>typeof w=="string"?w:w.taskId):[],availableTasks:d,onChange:w=>o?.(e.id,{dependencies:w})})})]}),e.labels&&e.labels.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.labels.slice(0,3).map(w=>jsxRuntime.jsx("span",{className:"asakaa-label",children:w},w))}),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:"#00E5CC"},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:"#00E5CC"}})})]})]})},(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&&e.render===t.render&&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)));ko.displayName="Card";var oi={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"}},Uu=({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 Wu({status:e="todo",onChange:t,className:a,customStatuses:r=[]}){let[n,s]=react.useState(false),[o,l]=react.useState({top:0,left:0}),d=react.useRef(null),i=react.useRef(null),u=[...Object.entries(oi).map(([y,b])=>({id:y,label:b.label,color:b.color,icon:b.icon})),...r.filter(y=>!Object.keys(oi).includes(y.id)).map(y=>({id:y.id,label:y.title,color:y.color||"#8B5CF6",icon:"circle-dot"}))],m=()=>{let y=oi[e];if(y)return {...y,id:e};let b=r.find(h=>h.id===e);return b?{id:b.id,label:b.title,color:b.color||"#8B5CF6",icon:"circle-dot"}:{...oi.todo,id:"todo"}},p=()=>{if(!i.current)return;let y=i.current.getBoundingClientRect(),b=window.innerHeight,h=window.innerWidth,v=180,w=280,D=4,S=y.right-v;S<10&&(S=y.left),S+v>h-10&&(S=h-v-10);let M=b-y.bottom,T=y.top,F;M>=w+D?F=y.bottom+D:T>=w+D?F=y.top-w-D:F=M>=T?y.bottom+D:Math.max(10,y.top-w-D),l({top:F,left:S}),s(true);};react.useEffect(()=>{let y=b=>{d.current&&!d.current.contains(b.target)&&!i.current?.contains(b.target)&&s(false);};if(n)return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n]),react.useEffect(()=>{let y=b=>{b.key==="Escape"&&s(false);};if(n)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]);let g=y=>{t(y),s(false);},f=m(),x=f.color;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:i,onClick:()=>n?s(false):p(),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:`${x}10`,boxShadow:`0 0 0 2px ${x}30 inset`},title:f.label,children:jsxRuntime.jsx(Uu,{icon:f.icon,color:x})}),n&&jsxRuntime.jsx(Qt,{children:jsxRuntime.jsxs("div",{ref:d,className:"status-selector-menu",style:{position:"fixed",top:`${o.top}px`,left:`${o.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:u.map(y=>jsxRuntime.jsxs("button",{onClick:()=>g(y.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:y.color,background:"transparent"},onMouseEnter:b=>{b.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:b=>{b.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(Uu,{icon:y.icon,color:y.color}),jsxRuntime.jsx("span",{className:"font-semibold",children:y.label}),e===y.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:"#00E5CC",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},y.id))})]})})]})}var Vu={en:{renameColumn:"Rename Column",rename:"Rename",delete:"Delete",columnName:"Column name",columnOptions:"Column options"},es:{renameColumn:"Renombrar Columna",rename:"Renombrar",delete:"Eliminar",columnName:"Nombre de columna",columnOptions:"Opciones de columna"}};function Gu({columnTitle:e,onRename:t,onDelete:a,isDeletable:r=false,className:n,locale:s="en"}){let o=Vu[s]||Vu.en,[l,d]=react.useState(false),[i,u]=react.useState(false),[m,p]=react.useState(e),[g,f]=react.useState({top:0,left:0}),x=react.useRef(null),y=react.useRef(null),b=react.useRef(null);react.useEffect(()=>{if(l&&y.current){let D=y.current.getBoundingClientRect();f({top:D.bottom+window.scrollY+8,left:D.left+window.scrollX});}},[l]),react.useEffect(()=>{let D=S=>{x.current&&!x.current.contains(S.target)&&!y.current?.contains(S.target)&&(d(false),u(false));};if(l)return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[l]),react.useEffect(()=>{let D=S=>{S.key==="Escape"&&(d(false),u(false),p(e));};if(l)return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[l,e]),react.useEffect(()=>{i&&b.current&&(b.current.focus(),b.current.select());},[i]);let h=()=>{u(true),p(e);},v=()=>{let D=m.trim();D&&D!==e&&t(D),u(false),d(false),p(e);},w=D=>{D.key==="Enter"?v():D.key==="Escape"&&(u(false),p(e));};return jsxRuntime.jsxs("div",{className:`relative ${n||""}`,children:[jsxRuntime.jsx("button",{ref:y,onClick:()=>d(!l),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-white/10",title:o.columnOptions,"aria-label":o.columnOptions,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"})]})}),l&&jsxRuntime.jsx(Qt,{children:jsxRuntime.jsx("div",{ref:x,className:"fixed rounded-xl shadow-2xl border min-w-[200px]",style:{top:`${g.top}px`,left:`${g.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:i?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:o.renameColumn}),jsxRuntime.jsx("input",{ref:b,type:"text",value:m,onChange:D=>p(D.target.value),onKeyDown:w,onBlur:v,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-[#00E5CC]/50 transition-all",placeholder:o.columnName,maxLength:50})]}):jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsxs("button",{onClick:h,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:o.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:o.delete})]})]})]})})})]})}var Mn=react.memo(({column:e,cards:t,renderColumn:a,renderCard:r,renderHeader:n,renderEmptyState:s,onCardClick:o,onCardUpdate:l,availableUsers:d,allCards:i,enableVirtualization:u,cardHeight:m=120,isCollapsed:p,onToggleCollapse:g,onColumnRename:f,onColumnDelete:x,isDeletable:y=false,className:b,renderMetrics:h,locale:v})=>{let{setNodeRef:w,isOver:D}=core$1.useDroppable({id:e.id,data:{type:"column",column:e}}),S=react.useRef(null),M=u??fu(t.length),T=reactVirtual.useVirtualizer({count:t.length,getScrollElement:()=>S.current,estimateSize:()=>m,enabled:M});if(a)return jsxRuntime.jsx("div",{ref:w,className:b,children:a(e,t)});let A=(()=>{if(!e.wipLimit)return {state:"none",percentage:0};let W=t.length/e.wipLimit*100;return t.length>e.wipLimit?{state:"exceeded",percentage:W}:W>=80?{state:"warning",percentage:W}:W>=60?{state:"approaching",percentage:W}:{state:"ok",percentage:W}})(),C=A.state==="exceeded",_=()=>"asakaa-column-count";return jsxRuntime.jsxs("div",{ref:w,className:c("asakaa-column",D&&"ring-2 ring-asakaa-accent-blue",C&&"ring-2 ring-asakaa-accent-red",b),children:[n?n(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:c(_()),children:[t.length,e.wipLimit&&` / ${e.wipLimit}`]}),e.wipLimit&&A.state!=="none"&&jsxRuntime.jsxs("span",{className:"text-xs font-medium flex items-center",title:`${A.percentage.toFixed(0)}% capacity${e.wipLimitType==="hard"?" (Hard limit - blocks new cards)":" (Soft limit - shows warning)"}`,children:[A.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"})]}),A.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"})]}),A.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"})}),A.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"})]})]}),(f||x)&&jsxRuntime.jsx(Gu,{columnTitle:e.title,onRename:W=>f?.(e.id,W),onDelete:x?()=>x(e.id):void 0,isDeletable:y,locale:v}),g&&jsxRuntime.jsx("button",{onClick:g,className:"text-asakaa-text-tertiary hover:text-asakaa-text-primary","aria-label":p?"Expand column":"Collapse column",children:p?"\u25B6":"\u25BC"})]})]}),h&&h(e,t),!p&&jsxRuntime.jsx("div",{ref:S,className:"asakaa-column-cards",style:{maxHeight:M?"600px":void 0},children:jsxRuntime.jsx(sortable.SortableContext,{items:t.map(W=>W.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"})}):M?jsxRuntime.jsx("div",{style:{height:`${T.getTotalSize()}px`,position:"relative"},children:T.getVirtualItems().map(W=>{let oe=t[W.index];return oe?jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${W.start}px)`},children:jsxRuntime.jsx(ko,{card:oe,render:r,onClick:o,onUpdate:l,availableUsers:d,allCards:i})},oe.id):null})}):t.map(W=>jsxRuntime.jsx(ko,{card:W,render:r,onClick:o,onUpdate:l,availableUsers:d,allCards:i},W.id))})})]})});Mn.displayName="Column";function Ol({title:e,onSave:t,className:a}){let[r,n]=react.useState(false),[s,o]=react.useState(e),l=react.useRef(null);react.useEffect(()=>{r&&l.current&&(l.current.focus(),l.current.select());},[r]);let d=()=>{let u=s.trim();u&&u!==e?t(u):o(e),n(false);},i=u=>{u.key==="Enter"?d():u.key==="Escape"&&(o(e),n(false));};return r?jsxRuntime.jsx("input",{ref:l,type:"text",value:s,onChange:u=>o(u.target.value),onBlur:d,onKeyDown:i,className:c("asakaa-column-title bg-transparent border-b-2 border-[#00E5CC]","outline-none px-1 -ml-1",a),maxLength:50}):jsxRuntime.jsx("h2",{className:c("asakaa-column-title cursor-pointer",a),onClick:()=>n(true),title:"Click to edit",children:e})}function Fb(e,t){let a=e.slice(0,t),r=a.lastIndexOf("@");if(r===-1)return null;let n=a[r-1];if(r>0&&n&&!/\s/.test(n))return null;let s=a.slice(r+1);return /\s/.test(s)?null:{start:r,end:t,query:s.toLowerCase()}}function Xu(e,t){let a=[],r=/@(\S+)/g,n;for(;(n=r.exec(e))!==null;){let s=n[1]?.toLowerCase()??"";if(!s)continue;let o=t.find(l=>{let d=l.name.toLowerCase(),i=d.replace(/\s+/g,""),u=d.split(/\s+/);return !!(i===s||d===s||u.some(m=>m===s))});o&&!a.includes(o.id)&&a.push(o.id);}return a}function Ab(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function Lb(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}var Ib=["\u{1F600}","\u{1F602}","\u{1F970}","\u{1F60D}","\u{1F914}","\u{1F44D}","\u{1F44E}","\u{1F389}","\u{1F525}","\u2764\uFE0F","\u{1F4AF}","\u2705","\u274C","\u26A0\uFE0F","\u{1F4CC}","\u{1F4A1}","\u{1F680}","\u2B50","\u{1F3AF}","\u{1F4AA}","\u{1F64F}","\u{1F440}","\u{1F4DD}","\u{1F4AC}"];function Ju({value:e,onChange:t,onSubmit:a,users:r,placeholder:n,disabled:s=false,isSubmitting:o=false,theme:l="dark",locale:d="es",currentUser:i,enableEmoji:u=true,enableAttachments:m=true,pendingFiles:p=[],onFilesSelect:g,onRemoveFile:f,maxFileSizeMB:x=10}){let y=l==="dark",[b,h]=react.useState(false),[v,w]=react.useState([]),[D,S]=react.useState(0),[M,T]=react.useState(null),[F,A]=react.useState(false),C=react.useRef(null),_=react.useRef(null),W=react.useRef(null),oe=react.useRef(null),L=react.useCallback((R,ae)=>{let be=Fb(R,ae);if(T(be),be){let Ie=r.filter(De=>De.name.toLowerCase().includes(be.query)||De.email&&De.email.toLowerCase().includes(be.query)).slice(0,5);w(Ie),h(Ie.length>0),S(0);}else h(false),w([]);},[r]),Y=R=>{let ae=R.target.value;if(t(ae),L(ae,R.target.selectionStart||0),C.current){C.current.style.height="24px";let be=C.current.scrollHeight,Ie=280,De=Math.min(be,Ie);C.current.style.height=`${De}px`,C.current.style.overflowY=be>Ie?"auto":"hidden";}},K=()=>{C.current&&L(e,C.current.selectionStart||0);},V=react.useCallback(R=>{if(!M||!C.current)return;let ae=e.slice(0,M.start),be=e.slice(M.end),Ie=`@${R.name.replace(/\s+/g,"")} `,De=ae+Ie+be;t(De),h(false),T(null),setTimeout(()=>{if(C.current){let Ee=M.start+Ie.length;C.current.selectionStart=Ee,C.current.selectionEnd=Ee,C.current.focus();}},0);},[M,e,t]),B=R=>{if(b&&v.length>0)switch(R.key){case "ArrowDown":R.preventDefault(),S(ae=>ae<v.length-1?ae+1:0);break;case "ArrowUp":R.preventDefault(),S(ae=>ae>0?ae-1:v.length-1);break;case "Enter":{R.preventDefault();let ae=v[D];ae&&V(ae);break}case "Tab":{R.preventDefault();let ae=v[D];ae&&V(ae);break}case "Escape":R.preventDefault(),h(false);break}else R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),a());};react.useEffect(()=>{let R=ae=>{_.current&&!_.current.contains(ae.target)&&C.current&&!C.current.contains(ae.target)&&h(false),oe.current&&!oe.current.contains(ae.target)&&A(false);};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);let X=react.useCallback(R=>{if(!C.current)return;let ae=C.current.selectionStart||e.length,be=e.slice(0,ae)+R+e.slice(ae);t(be),A(false),setTimeout(()=>{if(C.current){let Ie=ae+R.length;C.current.selectionStart=Ie,C.current.selectionEnd=Ie,C.current.focus();}},0);},[e,t]),Ce=react.useCallback(R=>{if(!g||!R.target.files)return;let ae=Array.from(R.target.files),be=x*1024*1024,Ie=ae.filter(De=>De.size>be?(console.warn(`File ${De.name} exceeds max size of ${x}MB`),false):true);Ie.length>0&&g(Ie),R.target.value="";},[g,x]),Re=react.useCallback(R=>R.type.startsWith("image/")?lucideReact.Image:R.type.includes("pdf")||R.type.includes("document")?lucideReact.FileText:lucideReact.File,[]);return react.useEffect(()=>{if(b&&_.current){let R=_.current.children[D];R&&R.scrollIntoView({block:"nearest"});}},[D,b]),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[p.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:p.map(R=>{let ae=Re(R.file),be=R.file.type.startsWith("image/");return jsxRuntime.jsxs("div",{className:c("relative group flex items-center gap-2 px-2 py-1.5 rounded-lg",y?"bg-white/10":"bg-gray-100"),children:[be&&R.preview?jsxRuntime.jsx("img",{src:R.preview,alt:R.file.name,className:"w-6 h-6 rounded object-cover"}):jsxRuntime.jsx(ae,{className:c("w-4 h-4",y?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0 max-w-[120px]",children:[jsxRuntime.jsx("p",{className:c("text-xs truncate",y?"text-white":"text-gray-900"),children:R.file.name}),jsxRuntime.jsx("p",{className:c("text-xs",y?"text-[#6B7280]":"text-gray-400"),children:Lb(R.file.size)})]}),f&&jsxRuntime.jsx("button",{onClick:()=>f(R.id),className:c("p-0.5 rounded-full transition-colors",y?"hover:bg-white/10 text-[#6B7280] hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},R.id)})}),jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[i&&jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-[10px] font-medium flex-shrink-0",style:{backgroundColor:i.color||"#8B5CF6"},children:i.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:c("flex-1 relative min-w-0"),children:[jsxRuntime.jsxs("div",{className:c("flex items-end gap-1 px-2 py-2 rounded-lg",y?"bg-white/5":"bg-white border border-gray-200"),children:[u&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>A(!F),disabled:s||o,className:c("p-1 rounded transition-colors flex-shrink-0",y?"hover:bg-white/10 text-[#6B7280] hover:text-white":"hover:bg-gray-100 text-gray-400 hover:text-gray-600",(s||o)&&"opacity-50"),title:"Emojis",children:jsxRuntime.jsx(lucideReact.Smile,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:F&&jsxRuntime.jsx(framerMotion.motion.div,{ref:oe,initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},className:c("absolute bottom-full left-0 mb-2 p-2 rounded-lg shadow-xl z-50",y?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:jsxRuntime.jsx("div",{className:"grid grid-cols-8 gap-1 w-[200px]",children:Ib.map(R=>jsxRuntime.jsx("button",{type:"button",onClick:()=>X(R),className:c("w-6 h-6 flex items-center justify-center text-lg rounded transition-colors hover:scale-110",y?"hover:bg-white/10":"hover:bg-gray-100"),children:R},R))})})})]}),m&&g&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>W.current?.click(),disabled:s||o,className:c("p-1.5 rounded transition-colors",y?"hover:bg-white/10 text-[#6B7280] hover:text-white":"hover:bg-gray-100 text-gray-400 hover:text-gray-600",(s||o)&&"opacity-50"),title:d==="es"?"Adjuntar archivo":"Attach file",children:jsxRuntime.jsx(lucideReact.Paperclip,{className:"w-4 h-4"})}),jsxRuntime.jsx("input",{ref:W,type:"file",multiple:true,onChange:Ce,className:"hidden",accept:"image/*,.pdf,.doc,.docx,.xls,.xlsx,.txt,.zip"})]}),jsxRuntime.jsx("textarea",{ref:C,value:e,onChange:Y,onSelect:K,onKeyDown:B,placeholder:n||(d==="es"?"Escribe un comentario...":"Write a comment..."),disabled:s||o,rows:1,className:c("flex-1 bg-transparent text-sm outline-none min-w-[100px] resize-none py-0.5",y?"text-white placeholder:text-[#6B7280] scrollbar-slim":"text-gray-900 placeholder:text-gray-400 scrollbar-slim-light",(s||o)&&"opacity-50"),style:{lineHeight:"1.5",height:"24px",maxHeight:"280px",overflowY:"hidden"}}),jsxRuntime.jsx("button",{onClick:a,disabled:o||!e.trim()&&p.length===0||s,className:c("p-1.5 rounded transition-colors",(e.trim()||p.length>0)&&!s?"bg-[#00E5CC] text-white hover:bg-[#00C4AE]":y?"text-[#6B7280]":"text-gray-400",o&&"opacity-50 cursor-not-allowed"),children:o?jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):jsxRuntime.jsx(lucideReact.Send,{className:"w-4 h-4"})})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:b&&v.length>0&&jsxRuntime.jsx(framerMotion.motion.div,{ref:_,initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},className:c("absolute bottom-full left-0 right-0 mb-1 py-1 rounded-lg shadow-xl z-50","max-h-[200px] overflow-y-auto",y?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:v.map((R,ae)=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>V(R),className:c("w-full flex items-center gap-3 px-3 py-2 text-left transition-colors",ae===D?y?"bg-white/10":"bg-gray-100":y?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:R.color||"#8B5CF6"},children:Ab(R.name)}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:c("text-sm font-medium truncate",y?"text-white":"text-gray-900"),children:R.name}),R.email&&jsxRuntime.jsx("p",{className:c("text-xs truncate",y?"text-[#6B7280]":"text-gray-500"),children:R.email})]})]},R.id))})})]})]})]})}function Qu({content:e,theme:t="dark"}){let a=t==="dark",r=[],n=/@(\S+)/g,s=0,o;for(;(o=n.exec(e))!==null;)o.index>s&&r.push({type:"text",value:e.slice(s,o.index)}),r.push({type:"mention",value:o[0]}),s=o.index+o[0].length;return s<e.length&&r.push({type:"text",value:e.slice(s)}),jsxRuntime.jsx("span",{className:"whitespace-pre-wrap break-words",children:r.map((l,d)=>l.type==="mention"?jsxRuntime.jsx("span",{className:c("inline-flex items-center px-1 py-0.5 rounded","font-medium text-sm",a?"bg-[#00E5CC]/20 text-[#00E5CC]":"bg-[#00E5CC]/15 text-[#00C4AE]"),children:l.value},d):jsxRuntime.jsx("span",{children:l.value},d))})}var di=["#EF4444","#F97316","#F59E0B","#EAB308","#84CC16","#22C55E","#10B981","#00E5CC","#00E5CC","#0EA5E9","#00E5CC","#6366F1","#8B5CF6","#A855F7","#D946EF","#EC4899"];function Ro({selectedTags:e,availableTags:t,onChange:a,onCreateTag:r,theme:n,disabled:s=false,compact:o=true}){let[l,d]=react.useState(false),[i,u]=react.useState(""),[m,p]=react.useState(false),[g,f]=react.useState(di[10]||"#00E5CC"),[x,y]=react.useState({top:0,left:0}),b=react.useRef(null),h=react.useRef(null),v=react.useRef(null),w=react.useRef(null),D=t.filter(C=>C.name.toLowerCase().includes(i.toLowerCase())),S=t.some(C=>C.name.toLowerCase()===i.toLowerCase());react.useEffect(()=>{if(l&&h.current){let C=h.current.getBoundingClientRect();y({top:C.bottom+6,left:C.left});}},[l]),react.useEffect(()=>{let C=_=>{let W=_.target,oe=b.current?.contains(W),L=v.current?.contains(W);!oe&&!L&&(d(false),u(""),p(false));};if(l)return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[l]),react.useEffect(()=>{l&&w.current&&w.current.focus();},[l]);let M=C=>{let _=e.some(W=>W.id===C.id);a(_?e.filter(W=>W.id!==C.id):[...e,C]);},T=async()=>{if(!(!r||!i.trim())){p(true);try{let C=await r(i.trim(),g);C&&(a([...e,C]),u(""),f(di[Math.floor(Math.random()*di.length)]||"#00E5CC"));}finally{p(false);}}},F=(C,_)=>{_.stopPropagation(),a(e.filter(W=>W.id!==C));},A={backgroundColor:`${n.textTertiary}15`,border:`1px solid ${n.borderLight}`,color:n.textSecondary};return jsxRuntime.jsxs("div",{ref:b,className:"relative",children:[jsxRuntime.jsxs("button",{ref:h,type:"button",onClick:()=>!s&&d(!l),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:A,disabled:s,children:[jsxRuntime.jsx(lucideReact.Tag,{className:"w-3.5 h-3.5"}),e.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[e.slice(0,2).map(C=>jsxRuntime.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium",style:{backgroundColor:`${C.color}20`,color:C.color},children:C.name},C.id)),e.length>2&&jsxRuntime.jsxs("span",{className:"text-xs",style:{color:n.textTertiary},children:["+",e.length-2]})]}):jsxRuntime.jsx("span",{children:"Agregar"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3",style:{color:n.textTertiary}})]}),typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:l&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:v,initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.12},className:"rounded-lg min-w-[240px]",style:{position:"fixed",top:x.top,left:x.left,zIndex:99999,backgroundColor:n.bgPrimary,border:`1px solid ${n.border}`,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.25)"},children:[jsxRuntime.jsx("div",{className:"p-2 border-b",style:{borderColor:n.border},children:jsxRuntime.jsx("input",{ref:w,type:"text",value:i,onChange:C=>u(C.target.value),placeholder:"Buscar o crear etiqueta...",className:"w-full px-3 py-1.5 text-sm rounded-md outline-none",style:{backgroundColor:n.bgSecondary,color:n.textPrimary,border:`1px solid ${n.borderLight}`},onKeyDown:C=>{C.key==="Enter"&&i.trim()&&!S&&r&&T();}})}),e.length>0&&jsxRuntime.jsxs("div",{className:"p-2 border-b",style:{borderColor:n.border},children:[jsxRuntime.jsx("p",{className:"text-xs mb-1.5",style:{color:n.textTertiary},children:"Seleccionadas"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.map(C=>jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium cursor-pointer hover:opacity-80",style:{backgroundColor:`${C.color}20`,color:C.color},onClick:_=>F(C.id,_),children:[C.name,jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})]},C.id))})]}),jsxRuntime.jsx("div",{className:"max-h-[200px] overflow-y-auto p-1",children:D.length>0?D.map(C=>{let _=e.some(W=>W.id===C.id);return jsxRuntime.jsxs("button",{type:"button",onClick:()=>M(C),className:"w-full flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors",style:{backgroundColor:_?`${C.color}15`:"transparent",color:n.textPrimary},onMouseEnter:W=>{_||(W.currentTarget.style.backgroundColor=n.hoverBg);},onMouseLeave:W=>{_||(W.currentTarget.style.backgroundColor="transparent");},children:[jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:C.color}}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:C.name}),_&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:C.color}})]},C.id)}):i.trim()?jsxRuntime.jsx("div",{className:"p-2 text-center text-sm",style:{color:n.textTertiary},children:"No se encontraron etiquetas"}):jsxRuntime.jsx("div",{className:"p-2 text-center text-sm",style:{color:n.textTertiary},children:"No hay etiquetas disponibles"})}),i.trim()&&!S&&r&&jsxRuntime.jsxs("div",{className:"p-2 border-t",style:{borderColor:n.border},children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2 mb-2",children:jsxRuntime.jsx("p",{className:"text-xs",style:{color:n.textTertiary},children:"Crear nueva etiqueta"})}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:di.map(C=>jsxRuntime.jsx("button",{type:"button",onClick:()=>f(C),className:"w-5 h-5 rounded-full transition-transform hover:scale-110",style:{backgroundColor:C,outline:g===C?`2px solid ${C}`:"none",outlineOffset:"2px"}},C))}),jsxRuntime.jsxs("button",{type:"button",onClick:T,disabled:m,className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-colors",style:{backgroundColor:g,color:"#FFFFFF",opacity:m?.7:1},children:[m?jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),'Crear "',i.trim(),'"']})]})]})}),document.body)]})}function Hl({tag:e,onRemove:t,size:a="sm"}){return jsxRuntime.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full font-medium ${a==="xs"?"px-1.5 py-0.5 text-[10px]":"px-2 py-0.5 text-xs"}`,style:{backgroundColor:`${e.color}20`,color:e.color},children:[e.name,t&&jsxRuntime.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),t();},className:"hover:opacity-70",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]})}function ep({tags:e,maxVisible:t=3,size:a="sm"}){if(!e||e.length===0)return null;let r=e.slice(0,t),n=e.length-t;return jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-1",children:[r.map(s=>jsxRuntime.jsx(Hl,{tag:s,size:a},s.id)),n>0&&jsxRuntime.jsxs("span",{className:`inline-flex items-center rounded-full font-medium ${a==="xs"?"px-1.5 py-0.5 text-[10px]":"px-2 py-0.5 text-xs"}`,style:{backgroundColor:"rgba(100,100,100,0.2)",color:"#9CA3AF"},children:["+",n]})]})}var sn=[{name:"Azul",value:"#00E5CC",light:"#5AADFF"},{name:"P\xFArpura",value:"#A855F7",light:"#C084FC"},{name:"Rosa",value:"#EC4899",light:"#F472B6"},{name:"Rojo",value:"#EF4444",light:"#F87171"},{name:"Naranja",value:"#F59E0B",light:"#FBBF24"},{name:"Amarillo",value:"#EAB308",light:"#FACC15"},{name:"Lima",value:"#84CC16",light:"#A3E635"},{name:"Verde",value:"#10B981",light:"#34D399"},{name:"Esmeralda",value:"#059669",light:"#10B981"},{name:"Cyan",value:"#00E5CC",light:"#00E5CC"},{name:"Azul Cielo",value:"#0EA5E9",light:"#38BDF8"},{name:"\xCDndigo",value:"#4F46E5",light:"#6366F1"},{name:"Violeta",value:"#8B5CF6",light:"#A78BFA"},{name:"Fucsia",value:"#D946EF",light:"#E879F9"},{name:"Coral",value:"#F97316",light:"#FB923C"},{name:"Magenta",value:"#E11D48",light:"#FB7185"}];function tp(e){if(e<60)return `${e}m`;let t=Math.floor(e/60),a=e%60;return a===0?`${t}h`:`${t}h${a}m`}function Vb(e){switch(e){case "on-track":return {text:"text-green-600 dark:text-green-400",bg:"bg-green-50 dark:bg-green-900/20",border:"border-green-200 dark:border-green-800"};case "at-risk":return {text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-50 dark:bg-yellow-900/20",border:"border-yellow-200 dark:border-yellow-800"};case "over-budget":return {text:"text-red-600 dark:text-red-400",bg:"bg-red-50 dark:bg-red-900/20",border:"border-red-200 dark:border-red-800"};case "no-estimate":default:return {text:"text-gray-500 dark:text-gray-400",bg:"bg-gray-50 dark:bg-gray-800/50",border:"border-gray-200 dark:border-gray-700"}}}function Gb({className:e}){return jsxRuntime.jsxs("svg",{className:c("w-3 h-3",e),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M12 6v6l4 2"})]})}function zl({summary:e,size:t="sm",showEstimate:a=true,onClick:r,className:n}){let s=Vb(e.health),o={sm:"text-xs px-1.5 py-0.5 gap-1",md:"text-sm px-2 py-1 gap-1.5",lg:"text-base px-2.5 py-1.5 gap-2"},l={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4"},d=tp(e.loggedMinutes),i=e.estimateMinutes?tp(e.estimateMinutes):null,u=a&&i?`${d} / ${i}`:d;return e.loggedMinutes===0&&!e.estimateMinutes?null:jsxRuntime.jsxs(r?"button":"span",{className:c("inline-flex items-center rounded-full border font-medium","transition-colors duration-150",s.text,s.bg,s.border,o[t],r&&"cursor-pointer hover:opacity-80 focus:outline-none focus:ring-2 focus:ring-offset-1",n),onClick:r,type:r?"button":void 0,children:[jsxRuntime.jsx(Gb,{className:l[t]}),jsxRuntime.jsx("span",{children:u})]})}function jb(e){let t=e.trim();if(!t)return null;let a;if(t.startsWith("="))a=t.slice(1).trim();else if(t.startsWith("+")&&/[*\/()]/.test(t))a=t.slice(1).trim();else if(/^\d[\d\s]*[*\/]/.test(t)||/^\(/.test(t))a=t;else return null;if(!a||!/^[\d+\-*/().\s]+$/.test(a)||/[+\-*/]{2,}/.test(a.replace(/\s/g,"").replace(/\*-/g,"X").replace(/\/-/g,"X")))return null;try{let r=new Function(`"use strict"; return (${a});`)();return typeof r!="number"||!isFinite(r)||r<0?null:r}catch{return null}}function ui(e){let t=jb(e);return t!==null?String(t):e}function rp(e){let a=ui(e).trim().toLowerCase();if(a.includes(":")){let[o,l]=a.split(":").map(Number);return (o||0)*60+(l||0)}let r=a.match(/(\d+(?:\.\d+)?)\s*h/),n=a.match(/(\d+)\s*m/);if(r||n){let o=r?.[1]?parseFloat(r[1]):0,l=n?.[1]?parseInt(n[1],10):0;return Math.round(o*60)+l}let s=parseFloat(a);return isNaN(s)?0:Math.round(s*60)}function pi(e){if(e<60)return `${e}m`;let t=Math.floor(e/60),a=e%60;return a===0?`${t}h`:`${t}h ${a}m`}function qb(e){let t=Math.floor(e/3600),a=Math.floor(e%3600/60),r=e%60;return t>0?`${t}:${a.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${a}:${r.toString().padStart(2,"0")}`}function Yb({className:e}){return jsxRuntime.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M8 5v14l11-7z"})})}function Xb({className:e}){return jsxRuntime.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})})}function op({className:e}){return jsxRuntime.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsxRuntime.jsx("path",{d:"M6 18L18 6M6 6l12 12"})})}function Jb({className:e}){return jsxRuntime.jsxs("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M12 6v6l4 2"})]})}function Ul({taskId:e,summary:t,entries:a=[],isTimerRunning:r=false,timerElapsedSeconds:n=0,onLogTime:s,onUpdateEstimate:o,onStartTimer:l,onStopTimer:d,onDiscardTimer:i,onClose:u,className:m}){let[p,g]=react.useState(""),[f,x]=react.useState(t.estimateMinutes?pi(t.estimateMinutes):""),[y,b]=react.useState(""),[h,v]=react.useState(false),[w,D]=react.useState(false),S=react.useRef(null);react.useEffect(()=>{S.current?.focus();},[]);let M=async()=>{let A=rp(p);if(!(A<=0||!s)){v(true);try{await s({durationMinutes:A,note:y.trim()||void 0,source:"manual"}),g(""),b("");}finally{v(false);}}},T=async()=>{if(!o)return;let A=f.trim()?rp(f):null;await o(A),D(false);},F=A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),M()),A.key==="Escape"&&u?.();};return jsxRuntime.jsxs("div",{className:c("w-72 bg-white dark:bg-gray-800 rounded-lg shadow-xl border border-gray-200 dark:border-gray-700","divide-y divide-gray-100 dark:divide-gray-700",m),children:[jsxRuntime.jsxs("div",{className:"px-3 py-2 flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200",children:"Time Tracking"}),jsxRuntime.jsx("button",{onClick:u,className:"p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-400",children:jsxRuntime.jsx(op,{className:"w-4 h-4"})})]}),jsxRuntime.jsx("div",{className:"px-3 py-2",children:r?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"relative flex h-2 w-2",children:[jsxRuntime.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),jsxRuntime.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-green-500"})]}),jsxRuntime.jsx("span",{className:"text-lg font-mono font-medium text-gray-900 dark:text-white",children:qb(n)})]}),jsxRuntime.jsx("button",{onClick:d,className:"p-2 rounded-lg bg-green-500 hover:bg-green-600 text-white",title:"Stop and save",children:jsxRuntime.jsx(Xb,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{onClick:i,className:"p-2 rounded-lg bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-600 dark:text-gray-300",title:"Discard",children:jsxRuntime.jsx(op,{className:"w-4 h-4"})})]}):jsxRuntime.jsxs("button",{onClick:l,className:c("w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg","bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600","text-gray-700 dark:text-gray-200 font-medium text-sm"),children:[jsxRuntime.jsx(Yb,{className:"w-4 h-4"}),"Start Timer"]})}),jsxRuntime.jsxs("div",{className:"px-3 py-2 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("div",{className:"relative flex-1",children:[jsxRuntime.jsx(Jb,{className:"absolute left-2 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),jsxRuntime.jsx("input",{ref:S,type:"text",value:p,onChange:A=>g(A.target.value),onKeyDown:F,placeholder:"8 (=8h), 2h 30m",className:c("w-full pl-8 pr-3 py-1.5 text-sm rounded-lg","bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600","text-gray-900 dark:text-white placeholder-gray-400","focus:outline-none focus:ring-2 focus:ring-[#00E5CC] focus:border-transparent")})]}),jsxRuntime.jsx("button",{onClick:M,disabled:h||!p.trim(),className:c("px-3 py-1.5 rounded-lg text-sm font-medium","bg-[#00E5CC] hover:bg-[#00C4AE] text-white","disabled:opacity-50 disabled:cursor-not-allowed"),children:"Log"})]}),jsxRuntime.jsx("input",{type:"text",value:y,onChange:A=>b(A.target.value),onKeyDown:F,placeholder:"Note (optional)",className:c("w-full px-3 py-1.5 text-sm rounded-lg","bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600","text-gray-900 dark:text-white placeholder-gray-400","focus:outline-none focus:ring-2 focus:ring-[#00E5CC] focus:border-transparent")})]}),jsxRuntime.jsxs("div",{className:"px-3 py-2",children:[jsxRuntime.jsxs("div",{className:"flex justify-between text-sm",children:[jsxRuntime.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"Logged"}),jsxRuntime.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:pi(t.loggedMinutes)})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"Estimate"}),w?jsxRuntime.jsx("div",{className:"flex items-center gap-1",children:jsxRuntime.jsx("input",{type:"text",value:f,onChange:A=>x(A.target.value),onKeyDown:A=>{A.key==="Enter"&&T(),A.key==="Escape"&&D(false);},onBlur:T,autoFocus:true,className:"w-16 px-1 py-0.5 text-sm text-right rounded border border-[#00E5CC] bg-transparent focus:outline-none",placeholder:"4h"})}):jsxRuntime.jsx("button",{onClick:()=>D(true),className:"font-medium text-gray-900 dark:text-white hover:text-[#00E5CC]",children:t.estimateMinutes?pi(t.estimateMinutes):"Set estimate"})]}),t.progressPercent!==null&&jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"Progress"}),jsxRuntime.jsxs("span",{className:c("font-medium",t.health==="on-track"&&"text-green-600",t.health==="at-risk"&&"text-yellow-600",t.health==="over-budget"&&"text-red-600"),children:[t.progressPercent,"%"]})]}),jsxRuntime.jsx("div",{className:"h-1.5 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:c("h-full transition-all duration-300",t.health==="on-track"&&"bg-green-500",t.health==="at-risk"&&"bg-yellow-500",t.health==="over-budget"&&"bg-red-500"),style:{width:`${Math.min(100,t.progressPercent)}%`}})})]})]}),a.length>0&&jsxRuntime.jsxs("div",{className:"px-3 py-2",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-2",children:"Recent Entries"}),jsxRuntime.jsx("div",{className:"space-y-1 max-h-24 overflow-y-auto",children:a.slice(0,3).map(A=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-600 dark:text-gray-300",children:[jsxRuntime.jsx("span",{className:"truncate flex-1",children:A.note||"Time logged"}),jsxRuntime.jsx("span",{className:"font-medium ml-2",children:pi(A.durationMinutes)})]},A.id))})]})]})}function ah(e){let a=ui(e).trim().toLowerCase();if(!a||a==="-")return null;if(a.includes(":")){let[o,l]=a.split(":").map(Number);return (o||0)*60+(l||0)}let r=a.match(/(\d+(?:\.\d+)?)\s*h/),n=a.match(/(\d+)\s*m/);if(r||n){let o=r?.[1]?parseFloat(r[1]):0,l=n?.[1]?parseInt(n[1],10):0;return Math.round(o*60)+l}let s=parseFloat(a);return isNaN(s)?null:Math.round(s*60)}function rh(e){if(!e||e===0)return "";let t=Math.floor(e/60),a=e%60;return t===0?`${a}m`:a===0?`${t}h`:`${t}h ${a}m`}function io({mode:e,locale:t,isDark:a,currentValue:r,onSave:n,onClose:s,className:o}){let[l,d]=react.useState(rh(r)),[i,u]=react.useState(""),[m,p]=react.useState(false),g=react.useRef(null);react.useEffect(()=>{g.current?.focus();},[]);let f=async()=>{p(true);let v=ah(l);await n(v&&v>0?v:null,i||void 0),p(false);},x=async()=>{p(true),await n(null),p(false);},y=v=>{v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),f()),v.key==="Escape"&&s();},b={estimate:t==="es"?"Estimaci\xF3n":"Estimate",quoted:t==="es"?"T. Ofertado":"Quoted",log:t==="es"?"Registrar":"Log Time"},h=t==="es";return jsxRuntime.jsxs("div",{className:c("w-56",o),style:{background:a?"rgba(10, 10, 10, 0.95)":"#FFFFFF",border:a?"1px solid rgba(255,255,255,0.10)":"1px solid #E5E7EB",borderRadius:"8px",boxShadow:a?"0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05)":"0 8px 32px rgba(0,0,0,0.12)",backdropFilter:"blur(16px)"},onClick:v=>v.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-3 py-2",style:{borderBottom:a?"1px solid rgba(255,255,255,0.06)":"1px solid #F3F4F6"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"w-3 h-3",style:{color:a?"#007FFF":"#00E5CC"}}),jsxRuntime.jsx("span",{className:"font-mono uppercase tracking-wider",style:{fontSize:"10px",fontWeight:600,color:a?"rgba(255,255,255,0.5)":"#6B7280"},children:b[e]})]}),jsxRuntime.jsx("button",{type:"button",onClick:s,className:"p-0.5 rounded transition-colors",style:{color:a?"rgba(255,255,255,0.3)":"#9CA3AF"},children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]}),jsxRuntime.jsxs("div",{className:"p-3 space-y-2",children:[jsxRuntime.jsx("input",{ref:g,type:"text",value:l,onChange:v=>d(v.target.value),onKeyDown:y,placeholder:"2h 30m",className:"w-full font-mono outline-none",style:{fontSize:"13px",fontWeight:700,padding:"6px 10px",borderRadius:"4px",border:a?"1px solid #333":"1px solid #E5E7EB",background:a?"#1A1A1A":"#F9FAFB",color:a?"#FFFFFF":"#111827"}}),jsxRuntime.jsx("p",{className:"font-mono",style:{fontSize:"9px",color:a?"rgba(255,255,255,0.25)":"#9CA3AF",letterSpacing:"0.02em"},children:"8=8h \xB7 1h 30m \xB7 45m \xB7 =8*9"}),e==="log"&&jsxRuntime.jsx("input",{type:"text",value:i,onChange:v=>u(v.target.value),onKeyDown:y,placeholder:h?"Nota (opcional)":"Note (optional)",className:"w-full outline-none",style:{fontSize:"11px",padding:"5px 10px",borderRadius:"4px",border:a?"1px solid #333":"1px solid #E5E7EB",background:a?"#1A1A1A":"#F9FAFB",color:a?"rgba(255,255,255,0.7)":"#374151"}}),jsxRuntime.jsx("button",{type:"button",onClick:f,disabled:m||!l.trim(),className:"w-full font-mono uppercase tracking-wider transition-all disabled:opacity-30 disabled:cursor-not-allowed",style:{fontSize:"10px",fontWeight:600,padding:"6px 0",borderRadius:"4px",border:a?"1px solid rgba(0, 229, 204,0.3)":"1px solid #00E5CC",background:a?"rgba(0, 229, 204,0.15)":"#00E5CC",color:a?"#007FFF":"#FFFFFF"},children:m?h?"Guardando...":"Saving...":h?"Registrar":"Save"}),r&&e!=="log"&&jsxRuntime.jsx("button",{type:"button",onClick:x,disabled:m,className:"w-full font-mono uppercase tracking-wider transition-colors",style:{fontSize:"9px",padding:"4px 0",color:a?"rgba(255,255,255,0.3)":"#9CA3AF"},children:h?"Quitar":"Clear"})]})]})}function oh(e){switch(e){case "on-track":return "bg-green-500";case "at-risk":return "bg-yellow-500";case "over-budget":return "bg-red-500";case "no-estimate":default:return "bg-gray-400"}}function nh(e){switch(e){case "on-track":return "text-green-600 dark:text-green-400";case "at-risk":return "text-yellow-600 dark:text-yellow-400";case "over-budget":return "text-red-600 dark:text-red-400";case "no-estimate":default:return "text-gray-500 dark:text-gray-400"}}function Vl({summary:e,showLabel:t=false,size:a="md",className:r}){let n=oh(e.health),s=nh(e.health),o={sm:"h-1",md:"h-1.5",lg:"h-2"},l=e.progressPercent??0,d=Math.min(100,l),i=l>100;return e.health==="no-estimate"?jsxRuntime.jsxs("div",{className:c("flex items-center gap-2",r),children:[jsxRuntime.jsx("div",{className:c("flex-1 rounded-full bg-gray-200 dark:bg-gray-700 overflow-hidden",o[a]),children:jsxRuntime.jsx("div",{className:c("h-full w-1/4",n)})}),t&&jsxRuntime.jsx("span",{className:c("text-xs font-medium",s),children:"--"})]}):jsxRuntime.jsxs("div",{className:c("flex items-center gap-2",r),children:[jsxRuntime.jsxs("div",{className:c("flex-1 rounded-full bg-gray-200 dark:bg-gray-700 overflow-hidden relative",o[a]),children:[jsxRuntime.jsx("div",{className:c("h-full transition-all duration-300",n),style:{width:`${d}%`}}),i&&jsxRuntime.jsx("div",{className:"absolute inset-0 bg-red-500",style:{backgroundImage:"repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255,255,255,0.2) 2px, rgba(255,255,255,0.2) 4px)"}})]}),t&&jsxRuntime.jsxs("span",{className:c("text-xs font-medium tabular-nums min-w-[2.5rem] text-right",s),children:[l,"%"]})]})}function Pn(e){if(e<1)return `${Math.round(e*60)}s`;let t=Math.round(e);if(t<60)return `${t}m`;let a=Math.floor(t/60),r=t%60;return r===0?`${a}h`:`${a}h ${r}m`}function ih(e,t){switch(e){case "profitable":return t?"text-green-400":"text-green-600";case "at-cost":return t?"text-[#00E5CC]":"text-[#00C4AE]";case "loss":return t?"text-red-400":"text-red-600";case "no-estimate":return t?"text-gray-500":"text-gray-400"}}function lh(e,t){switch(e){case "profitable":return t?"bg-green-900/30 border-green-700/50":"bg-green-50 border-green-200";case "at-cost":return t?"bg-[#00A893]/30 border-[#00C4AE]/50":"bg-[#00E5CC]/15 border-[#00E5CC]/15";case "loss":return t?"bg-red-900/30 border-red-700/50":"bg-red-50 border-red-200";case "no-estimate":return t?"bg-gray-800/50 border-gray-700":"bg-gray-50 border-gray-200"}}function dh(e,t){if(t==="es")switch(e){case "profitable":return "Rentable";case "at-cost":return "En costo";case "loss":return "P\xE9rdida";case "no-estimate":return "Sin oferta"}switch(e){case "profitable":return "Profitable";case "at-cost":return "At Cost";case "loss":return "Loss";case "no-estimate":return "No Estimate"}}function ch({summary:e,locale:t,isDark:a}){let r=e.totalVarianceMinutes>0,n=r?a?"text-green-400":"text-green-600":e.totalVarianceMinutes<0?a?"text-red-400":"text-red-600":a?"text-gray-400":"text-gray-600",s=a?"bg-[#1A1D25]":"bg-white",o=a?"border-white/5":"border-gray-200",l=a?"text-[#9CA3AF]":"text-gray-500",d=a?"text-[#E5E7EB]":"text-gray-900";return jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{className:c("p-4 rounded-lg border",s,o),children:[jsxRuntime.jsx("div",{className:c("text-sm font-medium mb-1",l),children:t==="es"?"Variaci\xF3n Total":"Total Variance"}),jsxRuntime.jsxs("div",{className:c("text-2xl font-bold",n),children:[r?"+":"",Pn(Math.abs(e.totalVarianceMinutes))]}),jsxRuntime.jsxs("div",{className:c("text-xs mt-1",l),children:[e.avgVariancePercent>0?"+":"",e.avgVariancePercent,"%"]})]}),jsxRuntime.jsxs("div",{className:c("p-4 rounded-lg border",s,o),children:[jsxRuntime.jsx("div",{className:c("text-sm font-medium mb-2",l),children:t==="es"?"Distribuci\xF3n":"Distribution"}),jsxRuntime.jsxs("div",{className:"space-y-1 text-sm",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{className:a?"text-green-400":"text-green-600",children:t==="es"?"Rentables":"Profitable"}),jsxRuntime.jsx("span",{className:c("font-medium",d),children:e.profitableTasksCount})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{className:a?"text-[#00E5CC]":"text-[#00C4AE]",children:t==="es"?"En costo":"At Cost"}),jsxRuntime.jsx("span",{className:c("font-medium",d),children:e.atCostTasksCount})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{className:a?"text-red-400":"text-red-600",children:t==="es"?"P\xE9rdidas":"Loss"}),jsxRuntime.jsx("span",{className:c("font-medium",d),children:e.lossTasksCount})]})]})]}),jsxRuntime.jsxs("div",{className:c("p-4 rounded-lg border",s,o),children:[jsxRuntime.jsx("div",{className:c("text-sm font-medium mb-2",l),children:t==="es"?"Tiempos":"Time Summary"}),jsxRuntime.jsxs("div",{className:"space-y-1 text-sm",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{className:l,children:t==="es"?"Ofertado":"Sold"}),jsxRuntime.jsx("span",{className:c("font-medium",d),children:Pn(e.totalSoldMinutes)})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{className:l,children:t==="es"?"Trabajado":"Logged"}),jsxRuntime.jsx("span",{className:c("font-medium",d),children:Pn(e.totalLoggedMinutes)})]}),jsxRuntime.jsxs("div",{className:c("flex justify-between pt-1 border-t",o),children:[jsxRuntime.jsx("span",{className:l,children:t==="es"?"Tareas":"Tasks"}),jsxRuntime.jsx("span",{className:c("font-medium",d),children:e.totalTasksWithEstimate})]})]})]})]})}function uh({task:e,locale:t,isDark:a,onClick:r}){let n=e.varianceMinutes!==null?e.varianceMinutes>0?"+":e.varianceMinutes<0?"-":"":"",s=a?"border-white/5":"border-gray-200",o=a?"text-[#E5E7EB]":"text-gray-900",l=a?"text-[#9CA3AF]":"text-gray-500";return jsxRuntime.jsxs("tr",{className:c("border-b",s,r&&c("cursor-pointer",a?"hover:bg-white/5":"hover:bg-gray-50")),onClick:()=>r?.(e.taskId),children:[jsxRuntime.jsxs("td",{className:"px-4 py-3",children:[jsxRuntime.jsx("div",{className:c("font-medium",o),children:e.taskName}),e.projectName&&jsxRuntime.jsx("div",{className:c("text-xs mt-1",l),children:e.projectName})]}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-sm text-center",children:e.soldEffortMinutes?Pn(e.soldEffortMinutes):"-"}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-sm text-center",children:Pn(e.loggedMinutes)}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-sm text-center",children:e.varianceMinutes!==null?jsxRuntime.jsxs("span",{className:c("font-medium",e.varianceMinutes>0?a?"text-green-400":"text-green-600":e.varianceMinutes<0?a?"text-red-400":"text-red-600":l),children:[n,Pn(Math.abs(e.varianceMinutes))]}):"-"}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-sm text-center",children:e.variancePercent!==null?jsxRuntime.jsxs("span",{className:c("font-medium",e.variancePercent>0?a?"text-green-400":"text-green-600":e.variancePercent<0?a?"text-red-400":"text-red-600":l),children:[n,Math.abs(e.variancePercent),"%"]}):"-"}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-center",children:jsxRuntime.jsx("span",{className:c("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border",lh(e.status,a),ih(e.status,a)),children:dh(e.status,t)})})]})}function Gl({report:e,isLoading:t=false,locale:a="en",theme:r="light",className:n,onTaskClick:s}){let o=r==="dark",l=o?"bg-[#050505]":"bg-gray-50",d=o?"bg-[#0A0A0A]":"bg-white",i=o?"border-white/[0.08]":"border-gray-200",u=o?"text-white/[0.92]":"text-gray-900",m=o?"text-white/[0.60]":"text-gray-500",p=o?"bg-[#050505]/50":"bg-gray-50",g=react.useMemo(()=>e?[...e.tasks].sort((f,x)=>f.varianceMinutes===null?1:x.varianceMinutes===null?-1:x.varianceMinutes-f.varianceMinutes):[],[e]);return t?jsxRuntime.jsx("div",{className:c("p-8 text-center",m,n),children:a==="es"?"Cargando reporte...":"Loading report..."}):!e||e.tasks.length===0?jsxRuntime.jsx("div",{className:c("p-8 text-center",m,n),children:a==="es"?"No hay datos de rentabilidad disponibles":"No profitability data available"}):jsxRuntime.jsxs("div",{className:c("space-y-6 p-6",l,n),children:[jsxRuntime.jsx("div",{className:"flex items-center justify-between",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:c("text-2xl font-bold",u),children:a==="es"?"Reporte de Rentabilidad":"Profitability Report"}),jsxRuntime.jsx("p",{className:c("text-sm mt-1",m),children:a==="es"?"An\xE1lisis de tiempo ofertado vs tiempo trabajado":"Analysis of sold effort vs actual time logged"})]})}),jsxRuntime.jsx(ch,{summary:e.summary,locale:a,isDark:o}),jsxRuntime.jsx("div",{className:c("rounded-lg border overflow-hidden",d,i),children:jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-white/5",children:[jsxRuntime.jsx("thead",{className:p,children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:c("px-4 py-3 text-left text-xs font-medium uppercase tracking-wider",m),children:a==="es"?"Tarea":"Task"}),jsxRuntime.jsx("th",{className:c("px-4 py-3 text-center text-xs font-medium uppercase tracking-wider",m),children:a==="es"?"Ofertado":"Sold"}),jsxRuntime.jsx("th",{className:c("px-4 py-3 text-center text-xs font-medium uppercase tracking-wider",m),children:a==="es"?"Trabajado":"Logged"}),jsxRuntime.jsx("th",{className:c("px-4 py-3 text-center text-xs font-medium uppercase tracking-wider",m),children:a==="es"?"Variaci\xF3n":"Variance"}),jsxRuntime.jsx("th",{className:c("px-4 py-3 text-center text-xs font-medium uppercase tracking-wider",m),children:"%"}),jsxRuntime.jsx("th",{className:c("px-4 py-3 text-center text-xs font-medium uppercase tracking-wider",m),children:a==="es"?"Estado":"Status"})]})}),jsxRuntime.jsx("tbody",{className:c("divide-y",i),children:g.map(f=>jsxRuntime.jsx(uh,{task:f,locale:a,isDark:o,onClick:s},f.taskId))})]})})}),jsxRuntime.jsx("div",{className:c("text-xs text-center",m),children:a==="es"?jsxRuntime.jsx(jsxRuntime.Fragment,{children:"Rentable: variaci\xF3n > +5% | En costo: \xB15% | P\xE9rdida: variaci\xF3n < -5%"}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:"Profitable: variance > +5% | At cost: \xB15% | Loss: variance < -5%"})})]})}function Fn(e){if(e<60)return `${e}m`;let t=Math.floor(e/60),a=e%60;return a===0?`${t}h`:`${t}h ${a}m`}function Nh(e){let t=Math.floor(e/3600),a=Math.floor(e%3600/60),r=e%60;return t>0?`${t.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${a.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}function gp(e,t=[]){if("title"in e&&!("name"in e)){let a=e,r=(a.assignedUserIds||[]).map(n=>{let s=t.find(o=>o.id===n);return s||null}).filter(n=>n!==null);return {id:a.id,name:a.title,startDate:a.startDate?new Date(a.startDate):void 0,endDate:a.endDate?new Date(a.endDate):void 0,progress:a.progress||0,status:a.columnId,priority:a.priority?.toLowerCase(),assignees:r,dependencies:Array.isArray(a.dependencies)?a.dependencies.map(n=>typeof n=="string"?n:n.taskId):[],tags:a.tags,subtasks:a.subtasks?.map(n=>({id:n.id,name:n.title,progress:n.completed?100:0,startDate:new Date,endDate:new Date})),color:a.color,description:a.description,effortMinutes:a.effortMinutes,timeLoggedMinutes:a.timeLoggedMinutes,soldEffortMinutes:a.soldEffortMinutes}}return e}function Dh(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,dependencies:e.dependencies}}function To({task:e,isOpen:t,onClose:a,onTaskUpdate:r,onCardUpdate:n,theme:s="dark",locale:o="es",availableUsers:l=[],availableTags:d=[],onCreateTag:i,attachments:u=[],onUploadAttachments:m,onDeleteAttachment:p,availableTasks:g=[],comments:f=[],onAddComment:x,currentUser:y,mentionableUsers:b=[],onUploadCommentAttachments:h,enableTimeTracking:v=false,timeTrackingSummary:w,timeEntries:D=[],isTimerRunning:S=false,timerElapsedSeconds:M=0,onTimeLog:T,onEstimateUpdate:F,onSoldEffortUpdate:A,onTimerStart:C,onTimerStop:_,onTimerDiscard:W,blurFinancials:oe=false}){let L=s==="dark",Y={textTertiary:L?"#6B7280":"#9CA3AF",textSecondary:L?"#9CA3AF":"#6B7280",textPrimary:L?"#FFFFFF":"#111827",borderLight:L?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",border:L?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",bgPrimary:L?"#1A1D25":"#FFFFFF",bgSecondary:L?"#0A0A0A":"#F9FAFB",hoverBg:L?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"},K=e&&"title"in e&&!("name"in e),V=e,[B,X]=react.useState(e?gp(e,l):null),[Ce,Re]=react.useState(false),[R,ae]=react.useState(false),[be,Ie]=react.useState(false),[De,Ee]=react.useState(null),[He,rt]=react.useState(new Date),[pe,We]=react.useState(false),[je,Oe]=react.useState(false),[tt,wt]=react.useState(""),[pt,Ue]=react.useState(false),[ot,Et]=react.useState(false),[ge,mt]=react.useState(false),[k,O]=react.useState(false),[Z,ve]=react.useState(""),$=react.useRef(null),re=react.useRef(null),[Ye,Te]=react.useState(""),Fe=react.useRef(null),[ze,Le]=react.useState(""),[Ze,st]=react.useState(false),[yt,xt]=react.useState([]),[$t,ut]=react.useState(""),[Gt,Mt]=react.useState(false),It=react.useRef(null);react.useEffect(()=>{if(console.log("\u{1F4E5} TaskDetailModal useEffect - task received:",{isOpen:t,taskId:e?.id,taskName:e?.name,soldEffortMinutes:e?.soldEffortMinutes,quotedMinutes:e?.quotedMinutes,effortMinutes:e?.effortMinutes,timeLoggedMinutes:e?.timeLoggedMinutes,fullTask:e}),e&&t){let N=gp(e,l);console.log("\u{1F4E5} After normalizeToTask:",{taskId:N?.id,taskName:N?.name,soldEffortMinutes:N?.soldEffortMinutes,quotedMinutes:N?.quotedMinutes,effortMinutes:N?.effortMinutes,timeLoggedMinutes:N?.timeLoggedMinutes}),X(N),ve(N.description||""),Te(N.name||"");}},[e?.id,e?.quotedMinutes,l,t]),react.useEffect(()=>{if(!t||!Z)return;let N=setTimeout(()=>{let U=re.current;U&&(U.style.height="auto",U.style.height=`${Math.max(100,U.scrollHeight)}px`);},50);return ()=>clearTimeout(N)},[t,Z]),react.useEffect(()=>()=>{$.current&&clearTimeout($.current),Fe.current&&clearTimeout(Fe.current);},[]),react.useEffect(()=>{t&&It.current&&f.length>0&&setTimeout(()=>{It.current&&(It.current.scrollTop=It.current.scrollHeight);},100);},[t,f.length]);let Ft=react.useCallback(N=>{X(N),K&&n&&V?n(Dh(N,V)):r&&r(N);},[K,V,n,r]),Ct=react.useCallback(()=>{Re(false),ae(false),Ie(false),Ee(null),Oe(false),wt(""),Ue(false);},[]),St=react.useCallback((N,U)=>{if(!B)return;let Ne={...B,[N]:U};Ft(Ne);},[B,Ft]),ct=react.useCallback(()=>{let N=re.current;N&&(N.style.height="auto",N.style.height=`${Math.max(100,N.scrollHeight)}px`);},[]),fa=react.useCallback(N=>{ve(N),setTimeout(ct,0),$.current&&clearTimeout($.current),$.current=setTimeout(()=>{if(B){let U={...B,description:N};Ft(U);}},800);},[B,Ft,ct]),xa=react.useCallback(N=>{Te(N),Fe.current&&clearTimeout(Fe.current),Fe.current=setTimeout(()=>{if(B&&N.trim()){let U={...B,name:N.trim()};Ft(U);}},800);},[B,Ft]),H=react.useCallback(N=>{let U=N.map(Ne=>{let q={id:`pending-${Date.now()}-${Math.random().toString(36).slice(2)}`,file:Ne};return Ne.type.startsWith("image/")&&(q.preview=URL.createObjectURL(Ne)),q});xt(Ne=>[...Ne,...U]);},[]),se=react.useCallback(N=>{xt(U=>{let Ne=U.find(q=>q.id===N);return Ne?.preview&&URL.revokeObjectURL(Ne.preview),U.filter(q=>q.id!==N)});},[]),at=react.useCallback(async()=>{if(!(!B||!ze.trim()&&yt.length===0||!x)){st(true);try{let N=Xu(ze,b),U=[];if(yt.length>0&&h){let Ne=yt.map(q=>q.file);U=await h(Ne);}await x(B.id,ze.trim(),N.length>0?N:void 0,U.length>0?U:void 0),Le(""),yt.forEach(Ne=>{Ne.preview&&URL.revokeObjectURL(Ne.preview);}),xt([]);}finally{st(false);}}},[B,ze,yt,x,b,h]),Xt=react.useCallback(()=>{if(!B||!$t.trim())return;let N=B.subtasks||[],U={id:`subtask-${Date.now()}-${Math.random().toString(36).slice(2)}`,name:$t.trim(),progress:0,startDate:new Date,endDate:new Date,position:N.length},Ne=[...N,U],q={...B,subtasks:Ne};Ft(q),ut(""),Mt(false);},[B,$t,Ft]),ee=react.useCallback(N=>{if(!B?.subtasks)return;let U=B.subtasks.map(q=>q.id===N?{...q,progress:q.progress===100?0:100}:q),Ne={...B,subtasks:U};Ft(Ne);},[B,Ft]),ke=react.useCallback(N=>{if(!B?.subtasks)return;let U=B.subtasks.filter(q=>q.id!==N),Ne={...B,subtasks:U};Ft(Ne);},[B,Ft]),At=react.useCallback(N=>{let U=typeof N=="string"?new Date(N):N,q=new Date().getTime()-U.getTime(),et=Math.floor(q/6e4),Nt=Math.floor(q/36e5),Ht=Math.floor(q/864e5);return et<1?o==="es"?"Ahora":"Just now":et<60?o==="es"?`Hace ${et} min`:`${et}m ago`:Nt<24?o==="es"?`Hace ${Nt}h`:`${Nt}h ago`:Ht<7?o==="es"?`Hace ${Ht}d`:`${Ht}d ago`:U.toLocaleDateString(o==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})},[o]),kt=react.useCallback(N=>{if(!B)return;let U=B.progress||0;N==="completed"?U=100:N==="in-progress"&&U===0?U=10:N==="todo"&&(U=0);let Ne={...B,status:N,progress:U};Ft(Ne),Re(false);},[B,Ft]),lt=react.useCallback((N,U)=>{if(!B)return;let Ne={...B,startDate:N,endDate:U};Ft(Ne);},[B,Ft]),dt=react.useCallback(()=>{let N=He.getFullYear(),U=He.getMonth(),Ne=new Date(N,U,1),et=new Date(N,U+1,0).getDate(),Nt=Ne.getDay(),Ht=[],Fa=new Date(N,U,0).getDate();for(let oa=Nt-1;oa>=0;oa--)Ht.push({date:new Date(N,U-1,Fa-oa),isCurrentMonth:false});for(let oa=1;oa<=et;oa++)Ht.push({date:new Date(N,U,oa),isCurrentMonth:true});let va=42-Ht.length;for(let oa=1;oa<=va;oa++)Ht.push({date:new Date(N,U+1,oa),isCurrentMonth:false});return Ht},[He]),J=react.useCallback(async N=>{if(N.preventDefault(),N.stopPropagation(),mt(false),!B||!m)return;let U=Array.from(N.dataTransfer.files);if(U.length!==0){O(true);try{await m(B.id,U);}finally{O(false);}}},[B,m]),xe=react.useCallback(async N=>{if(!B||!m||!N.target.files)return;let U=Array.from(N.target.files);if(U.length!==0){O(true);try{await m(B.id,U);}finally{O(false);}N.target.value="";}},[B,m]),ue=react.useCallback(N=>{N.preventDefault(),N.stopPropagation(),mt(true);},[]),z=react.useCallback(N=>{N.preventDefault(),N.stopPropagation(),mt(false);},[]),ne=react.useCallback(N=>N<1024?`${N} B`:N<1024*1024?`${(N/1024).toFixed(1)} KB`:`${(N/(1024*1024)).toFixed(1)} MB`,[]),Ve=react.useCallback(N=>N.startsWith("image/")?lucideReact.Image:N.includes("pdf")||N.includes("document")?lucideReact.FileText:lucideReact.File,[]);return !t||!B?null:jsxRuntime.jsx(framerMotion.AnimatePresence,{children:t&&B&&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.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},className:c("fixed inset-4 md:inset-8 lg:inset-12 rounded-xl shadow-2xl z-50 flex overflow-hidden",L?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxRuntime.jsxs("div",{className:c("px-6 py-3 border-b flex items-center gap-3 h-[49px]",L?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Circle,{className:c("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("span",{className:c("text-xs px-2 py-0.5 rounded",L?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:[o==="es"?"Tarea":"Task"," \u2228"]}),jsxRuntime.jsx("span",{className:c("text-xs font-mono",L?"text-[#6B7280]":"text-gray-400"),children:B.id.slice(0,8)})]}),jsxRuntime.jsx("div",{className:"flex-1"})]}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{let N=B.progress===100?0:100,Ne={...B,progress:N,status:N===100?"completed":"todo"};Ft(Ne);},className:c("mt-2 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors flex-shrink-0",B.progress===100?"bg-green-500 border-green-500":L?"border-white/30 hover:border-white/50":"border-gray-300 hover:border-gray-400"),children:B.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("input",{type:"text",value:Ye,onChange:N=>xa(N.target.value),placeholder:o==="es"?"Nombre de la tarea...":"Task name...",className:c("text-xl font-semibold flex-1 bg-transparent outline-none border-none px-0 py-0","focus:ring-0 focus:outline-none",B.progress===100?"line-through text-[#6B7280]":L?"text-white placeholder:text-[#6B7280]":"text-gray-900 placeholder:text-gray-400")})]})}),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:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Estado":"Status"}),jsxRuntime.jsx("button",{onClick:()=>{Ct(),Re(!Ce);},className:c("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",B.progress===100||B.status==="completed"?"bg-green-500/20 text-green-400":B.progress&&B.progress>0||B.status==="in-progress"?"bg-[#00E5CC]/20 text-[#00E5CC]":L?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:B.progress===100||B.status==="completed"?o==="es"?"COMPLETADO":"DONE":B.progress&&B.progress>0||B.status==="in-progress"?o==="es"?"EN PROGRESO":"IN PROGRESS":o==="es"?"POR HACER":"TO DO"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Ce&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Re(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:c("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",L?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"todo",label:o==="es"?"Por hacer":"To Do",color:"bg-gray-400"},{id:"in-progress",label:o==="es"?"En progreso":"In Progress",color:"bg-[#00E5CC]"},{id:"completed",label:o==="es"?"Completado":"Done",color:"bg-green-500"}].map(N=>jsxRuntime.jsxs("button",{onClick:()=>kt(N.id),className:c("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",L?"hover:bg-white/5":"hover:bg-gray-50",B.status===N.id&&(L?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:c("w-2 h-2 rounded-full",N.color)}),jsxRuntime.jsx("span",{className:L?"text-white":"text-gray-900",children:N.label})]},N.id))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.User,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Asignados":"Assignees"}),jsxRuntime.jsxs("button",{onClick:()=>{Ct(),Ie(!be);},className:c("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",L?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[B.assignees&&B.assignees.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[B.assignees.slice(0,3).map((N,U)=>jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:N.color||"#8B5CF6"},title:N.name,children:N.initials||N.name.slice(0,2).toUpperCase()},U)),B.assignees.length>3&&jsxRuntime.jsxs("span",{className:c("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:["+",B.assignees.length-3]})]}):jsxRuntime.jsx("span",{className:c("text-sm",L?"text-[#6B7280]":"text-gray-400"),children:o==="es"?"Agregar":"Add"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-3 h-3",L?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:be&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Ie(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:c("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[200px] max-h-[280px] overflow-y-auto",L?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:l.length>0?l.map(N=>{let U=B.assignees?.some(Ne=>Ne.name===N.name);return jsxRuntime.jsxs("button",{onClick:()=>{let Ne=B.assignees||[],q;U?q=Ne.filter(et=>et.name!==N.name):q=[...Ne,N],St("assignees",q);},className:c("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors text-left",L?"hover:bg-white/5":"hover:bg-gray-50",U&&(L?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:N.color||"#8B5CF6"},children:N.initials||N.name.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:c("flex-1",L?"text-white":"text-gray-900"),children:N.name}),U&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},N.name)}):jsxRuntime.jsx("div",{className:c("px-3 py-4 text-sm text-center",L?"text-[#6B7280]":"text-gray-500"),children:o==="es"?"No hay usuarios disponibles":"No users available"})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Fechas":"Dates"}),jsxRuntime.jsxs("button",{onClick:()=>{Ee(De?null:"start"),rt(B.startDate||new Date);},className:c("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",L?"bg-white/5 hover:bg-white/10 text-white":"bg-gray-100 hover:bg-gray-200 text-gray-900"),children:[B.startDate?.toLocaleDateString(o==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(o==="es"?"Inicio":"Start"),jsxRuntime.jsx("span",{className:c("mx-1",L?"text-[#6B7280]":"text-gray-400"),children:"\u2192"}),B.endDate?.toLocaleDateString(o==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(o==="es"?"Fin":"End")]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:De&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Ee(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:c("absolute left-0 top-full mt-2 z-50 rounded-xl shadow-2xl overflow-hidden flex",L?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:N=>N.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:c("w-44 py-2 border-r",L?"border-white/10":"border-gray-200"),children:[(()=>{let N=new Date,U=new Date(N);U.setDate(N.getDate()+1);let Ne=new Date(N);Ne.setDate(N.getDate()+((6-N.getDay()+7)%7||7));let q=new Date(N);q.setDate(N.getDate()+((1-N.getDay()+7)%7||7));let et=new Date(N);et.setDate(N.getDate()+(6-N.getDay()+7)%7+7);let Nt=new Date(N);Nt.setDate(N.getDate()+14);let Ht=new Date(N);return Ht.setDate(N.getDate()+28),[{label:o==="es"?"Hoy":"Today",date:N,display:N.toLocaleDateString(o==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:o==="es"?"Ma\xF1ana":"Tomorrow",date:U,display:U.toLocaleDateString(o==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:o==="es"?"Este fin de semana":"This weekend",date:Ne,display:o==="es"?"s\xE1b.":"sat."},{label:o==="es"?"Pr\xF3xima semana":"Next week",date:q,display:o==="es"?"lun.":"mon."},{label:o==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:et,display:et.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:o==="es"?"2 semanas":"2 weeks",date:Nt,display:Nt.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:o==="es"?"4 semanas":"4 weeks",date:Ht,display:Ht.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((va,oa)=>jsxRuntime.jsxs("button",{className:c("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",L?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{if(De==="start"){let cr=B.endDate&&va.date>B.endDate?va.date:B.endDate;lt(va.date,cr),Ee("end");}else {let cr=B.startDate&&va.date<B.startDate?va.date:B.startDate;lt(cr,va.date),Ee(null);}},children:[jsxRuntime.jsx("span",{children:va.label}),jsxRuntime.jsx("span",{className:c("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:va.display})]},oa))})(),jsxRuntime.jsx("div",{className:c("border-t mt-2 pt-2",L?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{lt(void 0,void 0),Ee(null);},className:c("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",L?"hover:bg-white/5 text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:o==="es"?"Quitar fechas":"Clear dates"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:c("text-xs mb-3 px-2 py-1 rounded",L?"bg-white/5 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:De==="start"?o==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":o==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:c("font-medium",L?"text-white":"text-gray-900"),children:He.toLocaleDateString(o==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>rt(new Date),className:c("p-1 rounded text-sm transition-colors",L?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:o==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>rt(new Date(He.getFullYear(),He.getMonth()-1)),className:c("p-1 rounded",L?"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("button",{onClick:()=>rt(new Date(He.getFullYear(),He.getMonth()+1)),className:c("p-1 rounded",L?"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:(o==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(N=>jsxRuntime.jsx("div",{className:c("w-8 h-8 flex items-center justify-center text-xs",L?"text-[#6B7280]":"text-gray-400"),children:N},N))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:dt().map((N,U)=>{let Ne=N.date.toDateString()===new Date().toDateString(),q=B.startDate?.toDateString()===N.date.toDateString(),et=B.endDate?.toDateString()===N.date.toDateString(),Nt=q||et,Ht=B.startDate&&B.endDate&&N.date>=B.startDate&&N.date<=B.endDate;return jsxRuntime.jsx("button",{onClick:()=>{let Fa=new Date(N.date);if(De==="start"){let va=B.endDate&&Fa>B.endDate?Fa:B.endDate;lt(Fa,va),Ee("end");}else {let va=B.startDate&&Fa<B.startDate?Fa:B.startDate;lt(va,Fa),Ee(null);}},className:c("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!N.isCurrentMonth&&(L?"text-[#4B5563]":"text-gray-300"),N.isCurrentMonth&&(L?"text-white":"text-gray-900"),Ne&&"ring-2 ring-[#00E5CC]",q&&"bg-[#00E5CC] text-white",et&&!q&&"bg-[#7C3AED] text-white",Ht&&!Nt&&(L?"bg-[#7C3AED]/20":"bg-purple-100"),!Nt&&(L?"hover:bg-white/10":"hover:bg-gray-100")),children:N.date.getDate()},U)})})]})]})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Flag,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Prioridad":"Priority"}),jsxRuntime.jsx("button",{onClick:()=>{Ct(),ae(!R);},className:c("text-xs px-2 py-1 rounded font-medium transition-all hover:ring-2 hover:ring-white/20",B.priority==="high"||B.priority==="urgent"?"bg-red-500/20 text-red-400":B.priority==="medium"?"bg-yellow-500/20 text-yellow-400":B.priority==="low"?"bg-green-500/20 text-green-400":L?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:B.priority?B.priority==="high"||B.priority==="urgent"?o==="es"?"Alta":"High":B.priority==="medium"?o==="es"?"Media":"Medium":o==="es"?"Baja":"Low":o==="es"?"Sin prioridad":"No priority"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:R&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>ae(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:c("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",L?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"urgent",label:o==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:o==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:o==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:o==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:o==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(N=>jsxRuntime.jsxs("button",{onClick:()=>{St("priority",N.id),ae(false);},className:c("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",L?"hover:bg-white/5":"hover:bg-gray-50",B.priority===N.id&&(L?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:c("w-2 h-2 rounded-full",N.color)}),jsxRuntime.jsx("span",{className:L?"text-white":"text-gray-900",children:N.label})]},N.id||"none"))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Clock,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Duraci\xF3n":"Duration"}),jsxRuntime.jsx("span",{className:c("text-sm",L?"text-white":"text-gray-900"),children:B.startDate&&B.endDate?`${Math.ceil((B.endDate.getTime()-B.startDate.getTime())/(1e3*60*60*24))} ${o==="es"?"d\xEDas":"days"}`:o==="es"?"Sin definir":"Not set"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:c("w-4 h-4 rounded-full border-2",L?"border-[#6B7280]":"border-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Progreso":"Progress"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[pe?jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:B.progress||0,onChange:N=>{let U=parseInt(N.target.value),Ne=B.status;U===100?Ne="completed":U>0?Ne="in-progress":Ne="todo";let q={...B,progress:U,status:Ne};Ft(q);},onBlur:()=>We(false),className:c("flex-1 max-w-[120px] h-2 rounded-full appearance-none cursor-pointer",L?"bg-white/10":"bg-gray-200","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[#00E5CC] [&::-webkit-slider-thumb]:cursor-pointer"),autoFocus:true}):jsxRuntime.jsx("button",{onClick:()=>We(true),className:c("flex-1 h-2 rounded-full overflow-hidden max-w-[120px] cursor-pointer hover:ring-2 hover:ring-white/20 transition-all",L?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:c("h-full rounded-full transition-all",B.progress===100?"bg-green-500":"bg-[#00E5CC]"),style:{width:`${B.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:c("text-sm font-medium min-w-[40px]",L?"text-white":"text-gray-900"),children:[B.progress||0,"%"]})]})]}),v&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Hourglass,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Duraci\xF3n estimada":"Estimated duration"}),jsxRuntime.jsx("div",{className:"flex items-center gap-2 flex-1",children:B.status==="completed"||B.progress===100?jsxRuntime.jsx("span",{className:c("text-sm px-2 py-0.5 cursor-not-allowed",L?"text-gray-600":"text-gray-300"),title:o==="es"?"Tarea completada":"Task completed",children:w?.estimateMinutes?Fn(w.estimateMinutes):o==="es"?"Vac\xEDo":"Empty"}):w?.estimateMinutes?jsxRuntime.jsx("button",{type:"button",onClick:()=>Et("estimate"),className:c("text-sm px-2 py-0.5 rounded",L?"text-white hover:bg-white/10":"text-gray-900 hover:bg-gray-100"),children:Fn(w.estimateMinutes)}):jsxRuntime.jsx("button",{type:"button",onClick:()=>Et("estimate"),className:c("text-sm",L?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-500"),children:o==="es"?"Vac\xEDo":"Empty"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:ot==="estimate"&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"absolute top-full left-28 mt-2 z-50",children:jsxRuntime.jsx(io,{mode:"estimate",locale:o,isDark:L,currentValue:w?.estimateMinutes||null,onSave:async N=>{await F?.(B.id,N),Et(false);},onClose:()=>Et(false)})})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.FileText,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Tiempo ofertado":"Quoted time"}),jsxRuntime.jsx("div",{className:"flex items-center gap-2 flex-1",children:oe?jsxRuntime.jsx("span",{className:c("text-sm select-none blur-[4px] opacity-60 pointer-events-none",L?"text-[#94A3B8]":"text-gray-500"),title:o==="es"?"No tienes permisos para ver este dato":"You don't have permission to view this data","aria-hidden":"true",children:"\u2022\u2022\u2022\u2022"}):B.status==="completed"||B.progress===100?jsxRuntime.jsx("span",{className:c("text-sm px-2 py-0.5 cursor-not-allowed",L?"text-gray-600":"text-gray-300"),title:o==="es"?"Tarea completada":"Task completed",children:B.quotedMinutes?Fn(B.quotedMinutes):o==="es"?"Vac\xEDo":"Empty"}):B.quotedMinutes?jsxRuntime.jsx("button",{type:"button",onClick:()=>Et("quoted"),className:c("text-sm px-2 py-0.5 rounded",L?"text-white hover:bg-white/10":"text-gray-900 hover:bg-gray-100"),children:Fn(B.quotedMinutes)}):jsxRuntime.jsx("button",{type:"button",onClick:()=>Et("quoted"),className:c("text-sm",L?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-500"),children:o==="es"?"Vac\xEDo":"Empty"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:ot==="quoted"&&!oe&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"absolute top-full left-28 mt-2 z-50",children:jsxRuntime.jsx(io,{mode:"quoted",locale:o,isDark:L,currentValue:B.quotedMinutes||null,onSave:async N=>{A?(await A(B.id,N),X(U=>U?{...U,quotedMinutes:N}:null)):St("quotedMinutes",N),Et(false);},onClose:()=>Et(false)})})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Clock,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Registrar tiempo":"Track time"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[B.status==="completed"||B.progress===100?jsxRuntime.jsx("div",{className:c("flex items-center gap-1.5 p-1.5 rounded-full cursor-not-allowed",L?"bg-white/5 text-gray-600":"bg-gray-50 text-gray-300"),title:o==="es"?"Tarea completada":"Task completed",children:jsxRuntime.jsx(lucideReact.Play,{className:"w-3.5 h-3.5 fill-current"})}):S?jsxRuntime.jsxs("button",{type:"button",onClick:()=>_?.(B.id),className:c("flex items-center gap-1.5 px-2 py-1 rounded text-sm transition-colors","bg-red-500/10 text-red-500 hover:bg-red-500/20"),children:[jsxRuntime.jsx(lucideReact.Square,{className:"w-3.5 h-3.5 fill-current"}),Nh(M||0)]}):jsxRuntime.jsx("button",{type:"button",onClick:()=>C?.(B.id),className:c("flex items-center gap-1.5 p-1.5 rounded-full transition-colors",L?"bg-white/10 text-white hover:bg-white/20":"bg-gray-100 text-gray-700 hover:bg-gray-200"),title:o==="es"?"Iniciar temporizador":"Start timer",children:jsxRuntime.jsx(lucideReact.Play,{className:"w-3.5 h-3.5 fill-current"})}),B.status==="completed"||B.progress===100?jsxRuntime.jsxs("div",{className:c("flex items-center gap-1.5 px-2 py-1 rounded text-sm cursor-not-allowed",L?"text-gray-600":"text-gray-300"),title:o==="es"?"Tarea completada":"Task completed",children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),o==="es"?"Agregar tiempo":"Add time"]}):jsxRuntime.jsxs("button",{type:"button",onClick:()=>Et("log"),className:c("flex items-center gap-1.5 px-2 py-1 rounded text-sm transition-colors",L?"text-[#9CA3AF] hover:bg-white/10 hover:text-white":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),o==="es"?"Agregar tiempo":"Add time"]}),w&&w.loggedMinutes>0&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:c("text-sm font-medium",w.health==="over-budget"?"text-red-500":w.health==="at-risk"?"text-yellow-500":L?"text-white":"text-gray-900"),children:[Fn(w.loggedMinutes),w.estimateMinutes&&jsxRuntime.jsxs("span",{className:c("font-normal",L?"text-[#6B7280]":"text-gray-400"),children:[" / ",Fn(w.estimateMinutes)]})]}),w.health!=="no-estimate"&&jsxRuntime.jsx("div",{className:"w-16 h-1.5 rounded-full overflow-hidden bg-gray-200 dark:bg-gray-700",children:jsxRuntime.jsx("div",{className:c("h-full rounded-full transition-all",w.health==="over-budget"?"bg-red-500":w.health==="at-risk"?"bg-yellow-500":"bg-green-500"),style:{width:`${Math.min(100,w.progressPercent||0)}%`}})})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:ot==="log"&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"absolute top-full left-28 mt-2 z-50",children:jsxRuntime.jsx(io,{mode:"log",locale:o,isDark:L,currentValue:null,onSave:async(N,U)=>{N&&await T?.(B.id,{durationMinutes:N,note:U,source:"manual"}),Et(false);},onClose:()=>Et(false)})})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Tag,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Etiquetas":"Tags"}),jsxRuntime.jsx(Ro,{selectedTags:B.tags||[],availableTags:d,onChange:N=>{St("tags",N);},onCreateTag:i,theme:Y})]}),jsxRuntime.jsxs("div",{className:"flex items-start gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Link2,{className:c("w-4 h-4 mt-1.5",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0 mt-1",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Relaciones":"Relations"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[B.dependencies&&B.dependencies.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:B.dependencies.map(N=>{let U=g.find(Ne=>Ne.id===N);return jsxRuntime.jsxs("span",{className:c("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",L?"bg-[#00E5CC]/20 text-[#00E5CC]":"bg-[#00E5CC]/15 text-[#00C4AE]"),children:[U?.name||N.slice(0,8),jsxRuntime.jsx("button",{onClick:()=>{let Ne=(B.dependencies||[]).filter(q=>q!==N);St("dependencies",Ne);},className:c("ml-0.5 hover:bg-white/20 rounded-full p-0.5 transition-colors"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},N)})}),jsxRuntime.jsxs("button",{onClick:()=>{Ct(),Oe(!je);},className:c("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",L?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:c("text-sm",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Agregar dependencia":"Add dependency"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:je&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{Oe(false),wt("");}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:c("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[280px] max-h-[320px]",L?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[jsxRuntime.jsx("div",{className:c("p-2 border-b",L?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("input",{type:"text",value:tt,onChange:N=>wt(N.target.value),placeholder:o==="es"?"Buscar tarea...":"Search task...",className:c("w-full px-3 py-2 rounded-md text-sm outline-none",L?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400"),autoFocus:true})}),jsxRuntime.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:g.length>0?g.filter(N=>N.id!==B.id).filter(N=>tt===""||N.name.toLowerCase().includes(tt.toLowerCase())).map(N=>{let U=B.dependencies?.includes(N.id);return jsxRuntime.jsxs("button",{onClick:()=>{let Ne=B.dependencies||[],q;U?q=Ne.filter(et=>et!==N.id):q=[...Ne,N.id],St("dependencies",q);},className:c("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors text-left",L?"hover:bg-white/5":"hover:bg-gray-50",U&&(L?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:c("w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0",U?"bg-[#00E5CC] border-[#00E5CC]":L?"border-white/30":"border-gray-300"),children:U&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:c("block truncate",L?"text-white":"text-gray-900"),children:N.name}),jsxRuntime.jsx("span",{className:c("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:N.id.slice(0,8)})]})]},N.id)}):jsxRuntime.jsx("div",{className:c("px-3 py-4 text-sm text-center",L?"text-[#6B7280]":"text-gray-500"),children:o==="es"?"No hay tareas disponibles":"No tasks available"})})]})]})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Palette,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:"Color"}),jsxRuntime.jsxs("button",{onClick:()=>{Ct(),Ue(!pt);},className:c("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",L?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:B.color||"#6366F1"}}),jsxRuntime.jsx("span",{className:c("text-sm",L?"text-white":"text-gray-900"),children:sn.find(N=>N.value===B.color)?.name||(o==="es"?"Azul":"Blue")}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-3 h-3",L?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:pt&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Ue(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:c("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden p-3",L?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:jsxRuntime.jsx("div",{className:"grid grid-cols-6 gap-1.5",children:sn.map(N=>{let U=B.color===N.value;return jsxRuntime.jsx("button",{onClick:()=>{St("color",N.value),Ue(false);},className:c("w-7 h-7 rounded-full flex items-center justify-center transition-all",U&&"ring-2 ring-offset-2",L?"ring-offset-[#1A1D25]":"ring-offset-white"),style:{backgroundColor:N.value,outlineColor:U?N.value:void 0},title:N.name,children:U&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 text-white"})},N.value)})})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Diamond,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm w-28 truncate flex-shrink-0",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Hito":"Milestone"}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:B.isMilestone||false,onChange:N=>St("isMilestone",N.target.checked),className:c("w-4 h-4 rounded border-2 cursor-pointer appearance-none transition-colors",B.isMilestone?"bg-purple-500 border-purple-500":L?"border-white/30 bg-transparent":"border-gray-300 bg-transparent","checked:bg-purple-500 checked:border-purple-500")}),jsxRuntime.jsx("span",{className:c("text-sm",L?"text-white":"text-gray-900"),children:o==="es"?"Marcar como hito":"Mark as milestone"})]})]})]}),jsxRuntime.jsxs("div",{className:c("mt-6 pt-4 border-t",L?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[jsxRuntime.jsx(lucideReact.FileText,{className:c("w-4 h-4",L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("h3",{className:c("text-sm font-semibold",L?"text-white":"text-gray-900"),children:o==="es"?"Descripci\xF3n":"Description"})]}),jsxRuntime.jsx("textarea",{ref:re,value:Z,onChange:N=>fa(N.target.value),placeholder:o==="es"?"Agregar descripci\xF3n...":"Add description...",className:c("w-full min-h-[100px] max-h-[400px] px-3 py-2 rounded-lg text-sm resize-none outline-none transition-colors overflow-y-auto",L?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400 focus:bg-gray-200")})]}),jsxRuntime.jsxs("div",{className:c("mt-6 pt-4 border-t",L?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("div",{className:"flex items-center justify-between mb-3",children:jsxRuntime.jsxs("h3",{className:c("text-sm font-semibold",L?"text-white":"text-gray-900"),children:[o==="es"?"Subtareas":"Subtasks",B.subtasks&&B.subtasks.length>0&&jsxRuntime.jsxs("span",{className:c("ml-2 text-xs font-normal",L?"text-[#6B7280]":"text-gray-400"),children:["(",B.subtasks.filter(N=>N.progress===100).length,"/",B.subtasks.length,")"]})]})}),B.subtasks&&B.subtasks.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-3",children:[...B.subtasks].sort((N,U)=>(N.position??0)-(U.position??0)).map(N=>jsxRuntime.jsxs("div",{className:c("flex items-center gap-2 group p-2 rounded-lg -mx-2 transition-colors",L?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx("button",{onClick:()=>ee(N.id),className:c("w-5 h-5 rounded border flex items-center justify-center flex-shrink-0 transition-colors",N.progress===100?"bg-green-500 border-green-500":L?"border-white/20 hover:border-green-500/50":"border-gray-300 hover:border-green-500"),children:N.progress===100&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:c("text-sm flex-1",N.progress===100?"line-through text-[#6B7280]":L?"text-white":"text-gray-900"),children:N.name}),jsxRuntime.jsx("button",{onClick:()=>ke(N.id),className:c("p-1 rounded opacity-0 group-hover:opacity-100 transition-opacity",L?"hover:bg-white/10 text-[#6B7280] hover:text-red-400":"hover:bg-gray-100 text-gray-400 hover:text-red-500"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-3.5 h-3.5"})})]},N.id))}),Gt?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:$t,onChange:N=>ut(N.target.value),onKeyDown:N=>{N.key==="Enter"&&$t.trim()?Xt():N.key==="Escape"&&(Mt(false),ut(""));},placeholder:o==="es"?"Nombre de la subtarea...":"Subtask name...",autoFocus:true,className:c("flex-1 px-3 py-2 rounded-lg text-sm outline-none transition-colors",L?"bg-white/5 border border-white/10 text-white placeholder:text-[#6B7280] focus:border-[#00E5CC]/50":"bg-gray-50 border border-gray-200 text-gray-900 placeholder:text-gray-400 focus:border-[#00E5CC]")}),jsxRuntime.jsx("button",{onClick:Xt,disabled:!$t.trim(),className:c("px-3 py-2 rounded-lg text-sm font-medium transition-colors",$t.trim()?"bg-[#00E5CC] hover:bg-[#00C4AE] text-white":L?"bg-white/5 text-[#6B7280] cursor-not-allowed":"bg-gray-100 text-gray-400 cursor-not-allowed"),children:o==="es"?"Agregar":"Add"}),jsxRuntime.jsx("button",{onClick:()=>{Mt(false),ut("");},className:c("p-2 rounded-lg transition-colors",L?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}):jsxRuntime.jsxs("button",{onClick:()=>Mt(true),className:c("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",L?"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"}),o==="es"?"Agregar subtarea":"Add subtask"]})]}),jsxRuntime.jsxs("div",{className:c("mt-6 pt-4 border-t",L?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("h3",{className:c("text-sm font-semibold mb-3",L?"text-white":"text-gray-900"),children:[o==="es"?"Adjuntos":"Attachments",u.length>0&&jsxRuntime.jsxs("span",{className:c("ml-2 text-xs font-normal",L?"text-[#6B7280]":"text-gray-400"),children:["(",u.length,")"]})]}),u.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-4",children:u.map(N=>{let U=Ve(N.type),Ne=N.type.startsWith("image/");return jsxRuntime.jsxs("div",{className:c("flex items-center gap-3 p-2 rounded-lg group transition-colors",L?"bg-white/5 hover:bg-white/10":"bg-gray-50 hover:bg-gray-100"),children:[Ne&&N.thumbnailUrl?jsxRuntime.jsx("img",{src:N.thumbnailUrl,alt:N.name,className:"w-10 h-10 rounded object-cover"}):jsxRuntime.jsx("div",{className:c("w-10 h-10 rounded flex items-center justify-center",L?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(U,{className:c("w-5 h-5",L?"text-[#9CA3AF]":"text-gray-500")})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("a",{href:N.url,target:"_blank",rel:"noopener noreferrer",className:c("text-sm font-medium truncate block hover:underline",L?"text-white":"text-gray-900"),children:N.name}),jsxRuntime.jsx("p",{className:c("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:ne(N.size)})]}),p&&jsxRuntime.jsx("button",{onClick:()=>p(N.id),className:c("p-1.5 rounded opacity-0 group-hover:opacity-100 transition-all",L?"hover:bg-red-500/20 text-red-400":"hover:bg-red-100 text-red-500"),title:o==="es"?"Eliminar":"Delete",children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},N.id)})}),jsxRuntime.jsxs("div",{onDragOver:ue,onDragLeave:z,onDrop:J,className:c("border-2 border-dashed rounded-lg p-6 text-center transition-all cursor-pointer relative",ge?L?"border-[#00E5CC] bg-[#00E5CC]/10":"border-[#00E5CC] bg-[#00E5CC]/15":L?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300",k&&"pointer-events-none opacity-50"),children:[jsxRuntime.jsx("input",{type:"file",multiple:true,onChange:xe,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",disabled:!m||k}),k?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-6 h-6 mx-auto mb-2 border-2 border-[#00E5CC] border-t-transparent rounded-full animate-spin"}),jsxRuntime.jsx("p",{className:c("text-sm",L?"text-[#9CA3AF]":"text-gray-500"),children:o==="es"?"Subiendo...":"Uploading..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Upload,{className:c("w-6 h-6 mx-auto mb-2",ge?"text-[#00E5CC]":L?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:c("text-sm",L?"text-[#9CA3AF]":"text-gray-500"),children:ge?o==="es"?"Suelta los archivos aqu\xED":"Drop files here":o==="es"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Suelta tus archivos aqu\xED o ",jsxRuntime.jsx("span",{className:"underline",children:"haz clic para subir"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Drop your files here or ",jsxRuntime.jsx("span",{className:"underline",children:"click to upload"})]})}),!m&&jsxRuntime.jsx("p",{className:c("text-xs mt-1",L?"text-[#6B7280]":"text-gray-400"),children:o==="es"?"Upload no disponible":"Upload not available"})]})]})]})]})]}),jsxRuntime.jsxs("div",{className:c("w-96 border-l flex flex-col",L?"border-white/[0.08] bg-[#0A0A0A]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsxs("div",{className:c("px-4 py-3 border-b flex items-center justify-between h-[49px]",L?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("h3",{className:c("text-sm font-semibold",L?"text-white":"text-gray-900"),children:[o==="es"?"Actividad":"Activity",f.length>0&&jsxRuntime.jsxs("span",{className:c("ml-2 text-xs font-normal",L?"text-[#6B7280]":"text-gray-400"),children:["(",f.length,")"]})]}),jsxRuntime.jsx("button",{onClick:a,className:c("p-1.5 rounded transition-colors",L?"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("style",{children:`
|
|
5
5
|
.activity-comments-scroll::-webkit-scrollbar {
|
|
6
6
|
width: 4px !important;
|
|
7
7
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
.activity-comments-scroll:hover::-webkit-scrollbar-thumb {
|
|
16
16
|
background: ${L?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.15)"} !important;
|
|
17
17
|
}
|
|
18
|
-
`}),jsxRuntime.jsx("div",{ref:It,className:c("flex-1 overflow-y-auto py-4 pl-4 pr-2 activity-comments-scroll",L?"scrollbar-slim":"scrollbar-slim-light"),children:f.length>0?jsxRuntime.jsx("div",{className:"space-y-4",children:[...f].sort((N,U)=>{let Ne=typeof N.createdAt=="string"?new Date(N.createdAt):N.createdAt,q=typeof U.createdAt=="string"?new Date(U.createdAt):U.createdAt;return Ne.getTime()-q.getTime()}).map(N=>jsxRuntime.jsxs("div",{className:"flex gap-3",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-[10px] font-medium flex-shrink-0",style:{backgroundColor:N.user?.color||"#8B5CF6"},children:N.user?.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsx("span",{className:c("text-sm font-medium",L?"text-white":"text-gray-900"),children:N.user?.name||(o==="es"?"Usuario":"User")}),jsxRuntime.jsx("span",{className:c("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:At(N.createdAt)})]}),jsxRuntime.jsx("div",{className:c("text-sm",L?"text-[#9CA3AF]":"text-gray-600"),children:jsxRuntime.jsx(Qu,{content:N.content,theme:s})}),N.attachments&&N.attachments.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:N.attachments.map(U=>{let Ne=U.type.startsWith("image/");return jsxRuntime.jsxs("a",{href:U.url,target:"_blank",rel:"noopener noreferrer",className:c("flex items-center gap-2 px-2 py-1.5 rounded-lg transition-colors",L?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[Ne?jsxRuntime.jsx(lucideReact.Image,{className:c("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}):jsxRuntime.jsx(lucideReact.File,{className:c("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsx("span",{className:c("text-xs truncate max-w-[100px]",L?"text-white":"text-gray-900"),children:U.name})]},U.id)})})]})]},N.id))}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[jsxRuntime.jsx(lucideReact.MessageSquare,{className:c("w-10 h-10 mb-3",L?"text-[#3B4252]":"text-gray-300")}),jsxRuntime.jsx("p",{className:c("text-sm",L?"text-[#6B7280]":"text-gray-500"),children:o==="es"?"Sin actividad reciente":"No recent activity"})]})}),jsxRuntime.jsx("div",{className:c("py-4 pl-4 pr-2 border-t",L?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx(Ju,{value:ze,onChange:Le,onSubmit:at,users:b,placeholder:o==="es"?"Escribe un comentario... (usa @ para mencionar)":"Write a comment... (use @ to mention)",disabled:!x,isSubmitting:Ze,theme:s,locale:o,currentUser:y,enableEmoji:true,enableAttachments:!!h,pendingFiles:yt,onFilesSelect:H,onRemoveFile:se})})]})]})]})})}function _l(){let[e,t]=react.useState(()=>core.dragStore.getState());react.useEffect(()=>core.dragStore.subscribe(n=>{t(n);}),[]);let a=react.useCallback(r=>{core.dragStore.setState(r);},[]);return [e,a]}function Ho({board:e,callbacks:t,onCardClick:a,renderProps:r,config:n,availableUsers:s=[],className:o,style:l,isLoading:d,error:i,children:u,availableTags:m=[],onCreateTag:p,attachmentsByCard:g,onUploadAttachments:f,onDeleteAttachment:x,comments:y,onAddComment:b,currentUser:h,mentionableUsers:v,onTaskOpen:w,onUploadCommentAttachments:D,enableTimeTracking:S,timeTrackingSummary:M,timeEntries:T,timerState:F,onLogTime:A,onUpdateEstimate:C,onUpdateSoldEffort:_,onStartTimer:W,onStopTimer:oe,onDiscardTimer:L,blurFinancials:Y=false,sidePanel:K,renderColumnMetrics:V,suppressDetailModal:B=false}){let[X,Ce]=_l(),[Re,R]=react.useState(null),[ae,be]=react.useState(false),Ie=react.useRef(null),De=react.useRef({x:0,y:0,scrollLeft:0,scrollTop:0}),Ee=n?.theme||"dark",He=Ee==="dark"||Ee==="neutral",rt=He?"dark":"",pe=react.useCallback((k,O)=>{t.onCardUpdate?.(k,O);},[t]),We=react.useCallback((k,O)=>{t.onColumnUpdate?.(k,{title:O});},[t]),je=react.useCallback(k=>{t.onColumnDelete?.(k);},[t]),Oe=["todo","in-progress","completed"],tt=core$1.useSensors(core$1.useSensor(core$1.PointerSensor,{activationConstraint:{distance:8}}),core$1.useSensor(core$1.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),wt=react.useMemo(()=>{let k=new Map;return e.columns.forEach(O=>{let Z=O.cardIds.map(ve=>e.cards.find($=>$.id===ve)).filter(ve=>ve!==void 0).sort((ve,$)=>ve.position-$.position);k.set(O.id,Z);}),k},[e.cards,e.columns]);react.useEffect(()=>{let k=Ie.current;if(!k)return;let O=re=>{let Ye=re.target,Te=re.button===1,Fe=Ye===k||Ye.classList.contains("asakaa-column")&&!Ye.closest(".asakaa-card");(Te||re.button===0&&Fe&&!X.isDragging)&&(re.preventDefault(),be(true),De.current={x:re.clientX,y:re.clientY,scrollLeft:k.scrollLeft,scrollTop:k.scrollTop},k.style.cursor="grabbing",k.style.userSelect="none");},Z=re=>{if(!ae)return;let Ye=re.clientX-De.current.x,Te=re.clientY-De.current.y;k.scrollLeft=De.current.scrollLeft-Ye,k.scrollTop=De.current.scrollTop-Te;},ve=()=>{ae&&(be(false),k.style.cursor="",k.style.userSelect="");},$=()=>{ae&&(be(false),k.style.cursor="",k.style.userSelect="");};return k.addEventListener("mousedown",O),document.addEventListener("mousemove",Z),document.addEventListener("mouseup",ve),k.addEventListener("mouseleave",$),()=>{k.removeEventListener("mousedown",O),document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",ve),k.removeEventListener("mouseleave",$);}},[ae,X.isDragging]);let pt=react.useMemo(()=>e.cards.map(k=>({id:k.id,name:k.title,startDate:k.startDate?new Date(k.startDate):void 0,endDate:k.endDate?new Date(k.endDate):void 0,progress:k.progress||0,status:k.columnId,priority:k.priority?.toLowerCase(),dependencies:Array.isArray(k.dependencies)?k.dependencies.map(O=>typeof O=="string"?O:O.taskId):[]})),[e.cards]),Ue=react.useCallback(k=>{let{active:O}=k,Z=e.cards.find(ve=>ve.id===O.id);Z&&Ce({isDragging:true,draggedCardId:Z.id,sourceColumnId:Z.columnId,targetColumnId:Z.columnId});},[e.cards,Ce]),ot=react.useCallback(k=>{let{active:O,over:Z}=k;if(!Z||!e.cards.find(re=>re.id===O.id))return;let $=null;Z.data.current?.type==="column"?$=Z.id:Z.data.current?.type==="card"&&($=e.cards.find(Ye=>Ye.id===Z.id)?.columnId||null),$&&$!==X.targetColumnId&&Ce({...X,targetColumnId:$});},[e.cards,X,Ce]),Et=react.useCallback(async k=>{let{active:O,over:Z}=k;if(Ce({isDragging:false,draggedCardId:null,sourceColumnId:null,targetColumnId:null}),!Z)return;let ve=e.cards.find(Te=>Te.id===O.id);if(!ve)return;let $,re;if(Z.data.current?.type==="column"){$=Z.id;let Te=wt.get($)||[];re=El(Te,0);}else {let Te=e.cards.find(Le=>Le.id===Z.id);if(!Te)return;$=Te.columnId;let Fe=wt.get($)||[],ze=Fe.findIndex(Le=>Le.id===Z.id);re=El(Fe,ze);}let Ye=e.columns.find(Te=>Te.id===$);if(Ye&&Ye.wipLimit&&Ye.wipLimitType==="hard"){let Te=wt.get($)||[];if(ve.columnId!==$&&Te.length>=Ye.wipLimit){t.onWipLimitExceeded?.(Ye,ve);return}}(ve.columnId!==$||ve.position!==re)&&await t.onCardMove?.(ve.id,$,re);},[e.cards,e.columns,wt,t,Ce]),ge=react.useCallback(k=>{B||R(k),a?.(k),w?.(k.id);},[a,w,B]),ht=react.useCallback(k=>{t.onCardUpdate?.(k.id,k),R(k);},[t]);return d?jsxRuntime.jsx("div",{className:c("asakaa-board",rt,o),style:l,children:jsxRuntime.jsx($h,{columnCount:3})}):i?jsxRuntime.jsx("div",{className:c("asakaa-board",rt,o),style:l,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 i=="string"?i:i.message})]})})}):jsxRuntime.jsxs(Du,{themeName:Ee,children:[jsxRuntime.jsxs("div",{className:c("flex h-full overflow-hidden",K?"flex-row":""),children:[jsxRuntime.jsxs(core$1.DndContext,{sensors:tt,collisionDetection:core$1.closestCorners,onDragStart:Ue,onDragOver:ot,onDragEnd:Et,children:[jsxRuntime.jsxs("div",{ref:Ie,className:c("asakaa-board",K?"flex-1":"",rt,o),style:{...l,cursor:ae?"grabbing":void 0},"data-theme":Ee,children:[e.columns.sort((k,O)=>k.position-O.position).map(k=>{let O=wt.get(k.id)||[],Z=!Oe.includes(k.id),ve=r?.renderColumnFooter?.(k);return jsxRuntime.jsxs("div",{className:"asakaa-column-wrapper",children:[jsxRuntime.jsx(Mn,{column:k,cards:O,renderCard:r?.renderCard,renderColumn:r?.renderColumn,renderHeader:r?.renderColumnHeader,renderEmptyState:r?.renderEmptyState,renderMetrics:V?($,re)=>V($,re):void 0,onCardClick:ge,onCardUpdate:pe,onColumnRename:t.onColumnUpdate?We:void 0,onColumnDelete:t.onColumnDelete?je:void 0,isDeletable:Z,locale:n?.locale==="es"?"es":"en",availableUsers:s,allCards:e.cards,enableVirtualization:n?.enableVirtualization,cardHeight:n?.cardHeight}),ve]},k.id)}),u]}),jsxRuntime.jsx(core$1.DragOverlay,{children:X.draggedCardId?jsxRuntime.jsx(ko,{card:e.cards.find(k=>k.id===X.draggedCardId),render:r?.renderCardOverlay||r?.renderCard,disableDrag:true,className:"opacity-90 rotate-3 shadow-2xl"}):null})]}),K]}),!B&&jsxRuntime.jsx(To,{task:Re,isOpen:!!Re,onClose:()=>R(null),onCardUpdate:ht,theme:He?"dark":"light",locale:n?.locale==="es"?"es":"en",availableUsers:s,availableTags:m,onCreateTag:p,attachments:Re?g?.get(Re.id)||[]:[],onUploadAttachments:f,onDeleteAttachment:x,availableTasks:pt,comments:y,onAddComment:b,currentUser:h,mentionableUsers:v,onUploadCommentAttachments:D,enableTimeTracking:S,timeTrackingSummary:M,timeEntries:T,isTimerRunning:F?.isRunning,timerElapsedSeconds:F?.elapsedSeconds,onTimeLog:A,onEstimateUpdate:C,onSoldEffortUpdate:_,onTimerStart:W,onTimerStop:oe,onTimerDiscard:L,blurFinancials:Y})]})}function $h({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 Vh={bgGrid:"#050505",bgSecondary:"#0A0A0A",border:"rgba(255, 255, 255, 0.08)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"rgba(255, 255, 255, 0.92)",textSecondary:"rgba(255, 255, 255, 0.60)",textTertiary:"rgba(255, 255, 255, 0.35)",accent:"#007FFF",accentLight:"rgba(0, 229, 204, 0.15)",hoverBg:"rgba(255, 255, 255, 0.04)"},Gh={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:"#00E5CC",accentLight:"rgba(0, 229, 204, 0.1)",hoverBg:"rgba(0, 0, 0, 0.05)"},jh={newTask:"Nueva Tarea",selectColumn:"Seleccionar columna",export:"Exportar",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"},_h={newTask:"New Task",selectColumn:"Select column",export:"Export",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"};function Kh({columns:e,onSelect:t,theme:a,t:r,createTaskLabel:n}){let[s,o]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let i=u=>{l.current&&!l.current.contains(u.target)&&o(false);};return s&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[s]);let d=i=>{t(i),o(false);};return jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>o(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #007FFF 0%, #0055CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:n||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((i,u)=>i.position-u.position).map((i,u)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>d(i.id),className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:u<e.length-1?`1px solid ${a.borderLight}`:"none"},whileHover:{backgroundColor:a.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:u*.03},children:[jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i.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:i.title}),jsxRuntime.jsxs("div",{className:"text-[10px] truncate",style:{color:a.textTertiary},children:[i.cardIds.length," ",i.cardIds.length===1?"tarea":"tareas"]})]})]},i.id))]})})})]})}function qh({theme:e,t,onExportCSV:a,onExportJSON:r,onExportExcel:n}){let[s,o]=react.useState(false),[l,d]=react.useState(null),i=react.useRef(null);if(react.useEffect(()=>{let g=f=>{i.current&&!i.current.contains(f.target)&&o(false);};return s&&document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[s]),!(a||r||n))return null;let m=[{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:n}].filter(g=>g.handler),p=async(g,f)=>{if(f){d(g);try{await f();}catch(x){console.error(`Export ${g} failed:`,x);}finally{d(null),o(false);}}};return jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>o(!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:m.map((g,f)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>p(g.id,g.handler),disabled:l!==null,className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:f<m.length-1?`1px solid ${e.borderLight}`:"none"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:f*.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:l===g.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"})}):g.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:g.label}),jsxRuntime.jsx("div",{className:"text-[10px] truncate",style:{color:e.textTertiary},children:g.description})]})]},g.id))})})})]})}function Yh({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, #007FFF 0%, #0055CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:t})]})}function ql({columns:e,onCreateTask:t,createTaskLabel:a,theme:r="dark",locale:n="es",useColumnSelector:s=false,onExportCSV:o,onExportJSON:l,onExportExcel:d,translations:i,toolbarRightContent:u,toolbarEndContent:m}){let p=r==="dark"?Vh:Gh,g={...n==="es"?jh:_h,...i},f=o||l||d;return jsxRuntime.jsx("div",{className:"h-12 px-4 flex items-center justify-end border-b sticky top-0 z-10",style:{backgroundColor:p.bgGrid,borderColor:p.border},children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[u&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u,jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:p.borderLight}})]}),f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(qh,{theme:p,t:g,onExportCSV:o,onExportJSON:l,onExportExcel:d}),t&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:p.borderLight}})]}),m,t&&(s?jsxRuntime.jsx(Kh,{columns:e,onSelect:t,theme:p,t:g,createTaskLabel:a}):jsxRuntime.jsx(Yh,{onClick:()=>t(),label:a||g.newTask}))]})})}function Xl({onAddColumn:e,className:t,placeholder:a="Nombre de la columna...",buttonLabel:r="Agregar Columna",disabled:n=false}){let[s,o]=react.useState(false),[l,d]=react.useState(""),i=react.useCallback(()=>{let p=l.trim();p&&(e(p),d(""),o(false));},[l,e]),u=react.useCallback(p=>{p.key==="Enter"?(p.preventDefault(),i()):p.key==="Escape"&&(d(""),o(false));},[i]),m=react.useCallback(()=>{setTimeout(()=>{l.trim()||o(false);},150);},[l]);return s?jsxRuntime.jsx("div",{className:c("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:l,onChange:p=>d(p.target.value),onKeyDown:u,onBlur:m,placeholder:a,autoFocus:true,className:"asakaa-add-column__input"}),jsxRuntime.jsxs("div",{className:"asakaa-add-column__actions",children:[jsxRuntime.jsx("button",{onClick:i,disabled:!l.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:()=>{d(""),o(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:c("asakaa-add-column",t),children:jsxRuntime.jsxs("button",{onClick:()=>o(true),disabled:n,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 ln({onSubmit:e,onCancel:t,availableUsers:a=[],isDark:r=true,locale:n="es",defaultDate:s,className:o,dropdownDirection:l="up"}){let[d,i]=react.useState(""),[u,m]=react.useState(void 0),[p,g]=react.useState(null),[f,x]=react.useState(null),[y,b]=react.useState(false),[h,v]=react.useState(false),[w,D]=react.useState(false),[S,M]=react.useState(s||new Date),T=react.useRef(null),F=n==="es",A=l==="up"?"bottom-full mb-1":"top-full mt-1";react.useEffect(()=>{T.current?.focus();},[]);let C=react.useCallback(()=>{b(false),v(false),D(false);},[]),_=react.useCallback(()=>{i(""),m(void 0),g(null),x(null),C(),t();},[t,C]),W=react.useCallback(()=>{let Y=d.trim();if(!Y)return;let K=a.find(B=>B.id===p),V=f||s;e({name:Y,priority:u,assignee:K||void 0,assigneeId:p,startDate:V,endDate:V}),i(""),m(void 0),g(null),x(null),C(),T.current?.focus();},[d,u,p,f,s,a,e,C]),oe=react.useCallback(Y=>{Y.key==="Enter"&&d.trim()&&(Y.preventDefault(),W()),Y.key==="Escape"&&_();},[W,_,d]),L=f||s||new Date;return jsxRuntime.jsxs("div",{className:c("quick-task-create",o),onClick:()=>C(),children:[jsxRuntime.jsx("div",{className:"p-2.5",children:jsxRuntime.jsx("input",{ref:T,type:"text",value:d,onChange:Y=>i(Y.target.value),placeholder:F?"Nombre de la tarea...":"Task name...",className:c("w-full bg-transparent text-sm outline-none font-mono",r?"text-white/90 placeholder:text-white/20":"text-gray-900 placeholder:text-gray-400"),autoFocus:true,onKeyDown:oe})}),jsxRuntime.jsxs("div",{className:c("px-2.5 py-2 flex items-center justify-between border-t",r?"border-white/[0.08]":"border-gray-100"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:Y=>{Y.stopPropagation(),b(!y),v(false),D(false);},type:"button",className:c("p-1 rounded transition-colors",u?u==="urgent"||u==="high"?"text-red-400 bg-red-500/20":u==="medium"?"text-yellow-400 bg-yellow-500/20":"text-green-400 bg-green-500/20":r?"hover:bg-white/10 text-white/30":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:l==="up"?-5:5},animate:{opacity:1,y:0},exit:{opacity:0,y:l==="up"?-5:5},className:c("absolute left-0 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[120px]",A,r?"bg-[#111] border border-white/10":"bg-white border border-gray-200"),onClick:Y=>Y.stopPropagation(),children:[{id:"urgent",label:F?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:F?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:F?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:F?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:F?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(Y=>jsxRuntime.jsxs("button",{onClick:()=>{m(Y.id),b(false);},type:"button",className:c("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",r?"hover:bg-white/5":"hover:bg-gray-50",u===Y.id&&(r?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:c("w-2 h-2 rounded-full",Y.color)}),jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:Y.label})]},Y.id||"none"))})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("button",{onClick:Y=>{Y.stopPropagation(),D(!w),b(false),v(false),M(f||s||new Date);},type:"button",className:c("flex items-center gap-1 text-xs px-1.5 py-0.5 rounded transition-colors font-mono",f?r?"bg-[#007FFF]/20 text-[#007FFF]":"bg-[#00E5CC]/20 text-[#00C4AE]":r?"bg-white/5 text-white/30 hover:bg-white/10":"bg-gray-100 text-gray-500 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:"w-3 h-3"}),L.toLocaleDateString(F?"es-ES":"en-US",{day:"numeric",month:"short"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:w&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:l==="up"?-5:5},animate:{opacity:1,y:0},exit:{opacity:0,y:l==="up"?-5:5},className:c("absolute left-0 z-[60] rounded-xl shadow-2xl overflow-hidden flex",A,r?"bg-[#111] border border-white/10":"bg-white border border-gray-200"),onClick:Y=>Y.stopPropagation(),children:[jsxRuntime.jsx("div",{className:c("w-40 py-2 border-r",r?"border-white/10":"border-gray-200"),children:(()=>{let Y=new Date,K=new Date(Y);K.setDate(Y.getDate()+1);let V=new Date(Y);V.setDate(Y.getDate()+((6-Y.getDay()+7)%7||7));let B=new Date(Y);B.setDate(Y.getDate()+((1-Y.getDay()+7)%7||7));let X=new Date(Y);X.setDate(Y.getDate()+14);let Ce=new Date(Y);Ce.setDate(Y.getDate()+28);let Re=F?"es-ES":"en-US";return [{label:F?"Hoy":"Today",date:Y,display:Y.toLocaleDateString(Re,{weekday:"short"}).slice(0,3)+"."},{label:F?"Ma\xF1ana":"Tomorrow",date:K,display:K.toLocaleDateString(Re,{weekday:"short"}).slice(0,3)+"."},{label:F?"Este fin de semana":"This weekend",date:V,display:F?"s\xE1b.":"sat."},{label:F?"Pr\xF3xima semana":"Next week",date:B,display:F?"lun.":"mon."},{label:F?"2 semanas":"2 weeks",date:X,display:X.toLocaleDateString(Re,{day:"numeric",month:"short"})},{label:F?"4 semanas":"4 weeks",date:Ce,display:Ce.toLocaleDateString(Re,{day:"numeric",month:"short"})}].map((ae,be)=>jsxRuntime.jsxs("button",{type:"button",className:c("w-full flex items-center justify-between px-3 py-1.5 text-xs transition-colors",r?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{x(ae.date),D(false);},children:[jsxRuntime.jsx("span",{children:ae.label}),jsxRuntime.jsx("span",{className:c("text-[10px] font-mono",r?"text-white/30":"text-gray-400"),children:ae.display})]},be))})()}),jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("span",{className:c("text-xs font-medium font-mono",r?"text-white":"text-gray-900"),children:S.toLocaleDateString(F?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>M(new Date),className:c("px-1.5 py-0.5 rounded text-[10px] transition-colors font-mono",r?"hover:bg-white/10 text-white/40":"hover:bg-gray-100 text-gray-500"),children:F?"Hoy":"Today"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>M(new Date(S.getFullYear(),S.getMonth()-1)),className:c("p-0.5 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>M(new Date(S.getFullYear(),S.getMonth()+1)),className:c("p-0.5 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:(F?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(Y=>jsxRuntime.jsx("div",{className:c("w-6 h-6 flex items-center justify-center text-[10px] font-mono",r?"text-white/30":"text-gray-400"),children:Y},Y))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let Y=S.getFullYear(),K=S.getMonth(),V=new Date(Y,K,1).getDay(),B=new Date(Y,K+1,0).getDate(),X=new Date(Y,K,0).getDate(),Ce=new Date().toDateString(),Re=[];for(let ae=V-1;ae>=0;ae--)Re.push({dayNum:X-ae,isCurrent:false,date:new Date(Y,K-1,X-ae)});for(let ae=1;ae<=B;ae++)Re.push({dayNum:ae,isCurrent:true,date:new Date(Y,K,ae)});let R=42-Re.length;for(let ae=1;ae<=R;ae++)Re.push({dayNum:ae,isCurrent:false,date:new Date(Y,K+1,ae)});return Re.map((ae,be)=>{let Ie=ae.date.toDateString()===Ce,De=(f||s)?.toDateString()===ae.date.toDateString();return jsxRuntime.jsx("button",{type:"button",className:c("w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors font-mono",!ae.isCurrent&&(r?"text-white/20":"text-gray-300"),ae.isCurrent&&(r?"text-white":"text-gray-900"),Ie&&"ring-1 ring-[#007FFF]",De&&"bg-[#007FFF] text-white",!De&&(r?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{x(ae.date),D(false);},children:ae.dayNum},be)})})()})]})]})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:Y=>{Y.stopPropagation(),v(!h),b(false),D(false);},type:"button",className:c("p-1 rounded transition-colors",p?"text-[#007FFF] bg-[#007FFF]/20":r?"hover:bg-white/10 text-white/30":"hover:bg-gray-100 text-gray-400"),children:p?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center text-white text-[8px] font-mono font-bold",style:{backgroundColor:a.find(Y=>Y.id===p)?.color||"#007FFF"},children:a.find(Y=>Y.id===p)?.initials||a.find(Y=>Y.id===p)?.name?.slice(0,2).toUpperCase()}):jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:h&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:l==="up"?-5:5},animate:{opacity:1,y:0},exit:{opacity:0,y:l==="up"?-5:5},className:c("absolute left-0 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[160px] max-h-[200px] overflow-y-auto",A,r?"bg-[#111] border border-white/10":"bg-white border border-gray-200"),onClick:Y=>Y.stopPropagation(),children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>{g(null),v(false);},className:c("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",r?"hover:bg-white/5":"hover:bg-gray-50",!p&&(r?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:c("w-5 h-5 rounded-full flex items-center justify-center",r?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3 h-3 text-gray-400"})}),jsxRuntime.jsx("span",{className:r?"text-white/40":"text-gray-500",children:F?"Sin asignar":"Unassigned"})]}),a.map(Y=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>{g(Y.id),v(false);},className:c("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",r?"hover:bg-white/5":"hover:bg-gray-50",p===Y.id&&(r?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-white text-[9px] font-mono font-bold",style:{backgroundColor:Y.color||"#007FFF"},children:Y.initials||Y.name?.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:Y.name})]},Y.id)),a.length===0&&jsxRuntime.jsx("div",{className:c("px-3 py-2 text-xs font-mono",r?"text-white/30":"text-gray-400"),children:F?"No hay usuarios disponibles":"No users available"})]})})]})]}),jsxRuntime.jsx("button",{onClick:W,disabled:!d.trim(),type:"button",className:c("px-2.5 py-1 rounded text-xs font-mono font-medium transition-colors",d.trim()?"bg-[#007FFF] hover:bg-[#0066CC] text-white":r?"bg-white/5 text-white/20":"bg-gray-100 text-gray-400"),children:F?"Guardar":"Save"})]})]})}function td({columnId:e,onAddCard:t,availableUsers:a=[],className:r,buttonLabel:n,disabled:s=false,theme:o="dark",locale:l="es"}){let[d,i]=react.useState(false),u=react.useRef(null),m=react.useRef(null),[p,g]=react.useState({}),[f,x]=react.useState(false),y=o==="dark",h={buttonLabel:n||(l==="es"?"Agregar Tarea":"Add Task")};react.useEffect(()=>{if(!d||!u.current)return;let w=90,D=()=>{let S=u.current.getBoundingClientRect(),T=window.innerHeight-S.bottom<w+8;x(T),g({position:"fixed",...T?{bottom:window.innerHeight-S.top+4}:{top:S.bottom+4},left:S.left,width:S.width,zIndex:9999});};return D(),window.addEventListener("scroll",D,true),window.addEventListener("resize",D),()=>{window.removeEventListener("scroll",D,true),window.removeEventListener("resize",D);}},[d]),react.useEffect(()=>{if(!d)return;let w=D=>{let S=D.target;m.current&&!m.current.contains(S)&&u.current&&!u.current.contains(S)&&i(false);};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[d]);let v=react.useCallback(w=>{t({name:w.name,columnId:e,assigneeIds:w.assigneeId?[w.assigneeId]:void 0,startDate:w.startDate,endDate:w.endDate,priority:w.priority});},[t,e]);return jsxRuntime.jsxs("div",{ref:u,className:c("asakaa-add-card",r),children:[jsxRuntime.jsxs("button",{onClick:()=>i(!d),disabled:s,className:"asakaa-add-card__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"})]}),h.buttonLabel]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:d&&jsxRuntime.jsx(framerMotion.motion.div,{ref:m,initial:{opacity:0,y:f?4:-4,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:f?4:-4,scale:.97},transition:{duration:.12},style:p,className:c("rounded-lg shadow-2xl",y?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08] shadow-[0_8px_32px_rgba(0,0,0,0.6)]":"bg-white border border-gray-200 shadow-xl"),children:jsxRuntime.jsx(ln,{onSubmit:v,onCancel:()=>i(false),availableUsers:a,isDark:y,locale:l,dropdownDirection:"up"})})}),document.body)]})}var ys=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(Ho,{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 n=this.data.columns.find(s=>s.id===r.columnId);a.push([r.id,r.title,n?.title||"",r.description||"",r.labels?.join(", ")||"",r.assignedUserIds?.join(", ")||r.assigneeId||"",r.dueDate?.toString()||"",r.position.toString()]);}),a.map(r=>r.map(n=>`"${n}"`).join(",")).join(`
|
|
18
|
+
`}),jsxRuntime.jsx("div",{ref:It,className:c("flex-1 overflow-y-auto py-4 pl-4 pr-2 activity-comments-scroll",L?"scrollbar-slim":"scrollbar-slim-light"),children:f.length>0?jsxRuntime.jsx("div",{className:"space-y-4",children:[...f].sort((N,U)=>{let Ne=typeof N.createdAt=="string"?new Date(N.createdAt):N.createdAt,q=typeof U.createdAt=="string"?new Date(U.createdAt):U.createdAt;return Ne.getTime()-q.getTime()}).map(N=>jsxRuntime.jsxs("div",{className:"flex gap-3",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-[10px] font-medium flex-shrink-0",style:{backgroundColor:N.user?.color||"#8B5CF6"},children:N.user?.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsx("span",{className:c("text-sm font-medium",L?"text-white":"text-gray-900"),children:N.user?.name||(o==="es"?"Usuario":"User")}),jsxRuntime.jsx("span",{className:c("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:At(N.createdAt)})]}),jsxRuntime.jsx("div",{className:c("text-sm",L?"text-[#9CA3AF]":"text-gray-600"),children:jsxRuntime.jsx(Qu,{content:N.content,theme:s})}),N.attachments&&N.attachments.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:N.attachments.map(U=>{let Ne=U.type.startsWith("image/");return jsxRuntime.jsxs("a",{href:U.url,target:"_blank",rel:"noopener noreferrer",className:c("flex items-center gap-2 px-2 py-1.5 rounded-lg transition-colors",L?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[Ne?jsxRuntime.jsx(lucideReact.Image,{className:c("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}):jsxRuntime.jsx(lucideReact.File,{className:c("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsx("span",{className:c("text-xs truncate max-w-[100px]",L?"text-white":"text-gray-900"),children:U.name})]},U.id)})})]})]},N.id))}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[jsxRuntime.jsx(lucideReact.MessageSquare,{className:c("w-10 h-10 mb-3",L?"text-[#3B4252]":"text-gray-300")}),jsxRuntime.jsx("p",{className:c("text-sm",L?"text-[#6B7280]":"text-gray-500"),children:o==="es"?"Sin actividad reciente":"No recent activity"})]})}),jsxRuntime.jsx("div",{className:c("py-4 pl-4 pr-2 border-t",L?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx(Ju,{value:ze,onChange:Le,onSubmit:at,users:b,placeholder:o==="es"?"Escribe un comentario... (usa @ para mencionar)":"Write a comment... (use @ to mention)",disabled:!x,isSubmitting:Ze,theme:s,locale:o,currentUser:y,enableEmoji:true,enableAttachments:!!h,pendingFiles:yt,onFilesSelect:H,onRemoveFile:se})})]})]})]})})}function _l(){let[e,t]=react.useState(()=>core.dragStore.getState());react.useEffect(()=>core.dragStore.subscribe(n=>{t(n);}),[]);let a=react.useCallback(r=>{core.dragStore.setState(r);},[]);return [e,a]}function Ho({board:e,callbacks:t,onCardClick:a,renderProps:r,config:n,availableUsers:s=[],className:o,style:l,isLoading:d,error:i,children:u,availableTags:m=[],onCreateTag:p,attachmentsByCard:g,onUploadAttachments:f,onDeleteAttachment:x,comments:y,onAddComment:b,currentUser:h,mentionableUsers:v,onTaskOpen:w,onUploadCommentAttachments:D,enableTimeTracking:S,timeTrackingSummary:M,timeEntries:T,timerState:F,onLogTime:A,onUpdateEstimate:C,onUpdateSoldEffort:_,onStartTimer:W,onStopTimer:oe,onDiscardTimer:L,blurFinancials:Y=false,sidePanel:K,renderColumnMetrics:V,suppressDetailModal:B=false}){let[X,Ce]=_l(),[Re,R]=react.useState(null),[ae,be]=react.useState(false),Ie=react.useRef(null),De=react.useRef({x:0,y:0,scrollLeft:0,scrollTop:0}),Ee=n?.theme||"dark",He=Ee==="dark"||Ee==="neutral",rt=He?"dark":"",pe=react.useCallback((k,O)=>{t.onCardUpdate?.(k,O);},[t]),We=react.useCallback((k,O)=>{t.onColumnUpdate?.(k,{title:O});},[t]),je=react.useCallback(k=>{t.onColumnDelete?.(k);},[t]),Oe=["todo","in-progress","completed"],tt=core$1.useSensors(core$1.useSensor(core$1.PointerSensor,{activationConstraint:{distance:8}}),core$1.useSensor(core$1.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),wt=react.useMemo(()=>{let k=new Map;return e.columns.forEach(O=>{let Z=O.cardIds.map(ve=>e.cards.find($=>$.id===ve)).filter(ve=>ve!==void 0).sort((ve,$)=>ve.position-$.position);k.set(O.id,Z);}),k},[e.cards,e.columns]);react.useEffect(()=>{let k=Ie.current;if(!k)return;let O=re=>{let Ye=re.target,Te=re.button===1,Fe=Ye===k||Ye.classList.contains("asakaa-column")&&!Ye.closest(".asakaa-card");(Te||re.button===0&&Fe&&!X.isDragging)&&(re.preventDefault(),be(true),De.current={x:re.clientX,y:re.clientY,scrollLeft:k.scrollLeft,scrollTop:k.scrollTop},k.style.cursor="grabbing",k.style.userSelect="none");},Z=re=>{if(!ae)return;let Ye=re.clientX-De.current.x,Te=re.clientY-De.current.y;k.scrollLeft=De.current.scrollLeft-Ye,k.scrollTop=De.current.scrollTop-Te;},ve=()=>{ae&&(be(false),k.style.cursor="",k.style.userSelect="");},$=()=>{ae&&(be(false),k.style.cursor="",k.style.userSelect="");};return k.addEventListener("mousedown",O),document.addEventListener("mousemove",Z),document.addEventListener("mouseup",ve),k.addEventListener("mouseleave",$),()=>{k.removeEventListener("mousedown",O),document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",ve),k.removeEventListener("mouseleave",$);}},[ae,X.isDragging]);let pt=react.useMemo(()=>e.cards.map(k=>({id:k.id,name:k.title,startDate:k.startDate?new Date(k.startDate):void 0,endDate:k.endDate?new Date(k.endDate):void 0,progress:k.progress||0,status:k.columnId,priority:k.priority?.toLowerCase(),dependencies:Array.isArray(k.dependencies)?k.dependencies.map(O=>typeof O=="string"?O:O.taskId):[]})),[e.cards]),Ue=react.useCallback(k=>{let{active:O}=k,Z=e.cards.find(ve=>ve.id===O.id);Z&&Ce({isDragging:true,draggedCardId:Z.id,sourceColumnId:Z.columnId,targetColumnId:Z.columnId});},[e.cards,Ce]),ot=react.useCallback(k=>{let{active:O,over:Z}=k;if(!Z||!e.cards.find(re=>re.id===O.id))return;let $=null;Z.data.current?.type==="column"?$=Z.id:Z.data.current?.type==="card"&&($=e.cards.find(Ye=>Ye.id===Z.id)?.columnId||null),$&&$!==X.targetColumnId&&Ce({...X,targetColumnId:$});},[e.cards,X,Ce]),Et=react.useCallback(async k=>{let{active:O,over:Z}=k;if(Ce({isDragging:false,draggedCardId:null,sourceColumnId:null,targetColumnId:null}),!Z)return;let ve=e.cards.find(Te=>Te.id===O.id);if(!ve)return;let $,re;if(Z.data.current?.type==="column"){$=Z.id;let Te=wt.get($)||[];re=El(Te,0);}else {let Te=e.cards.find(Le=>Le.id===Z.id);if(!Te)return;$=Te.columnId;let Fe=wt.get($)||[],ze=Fe.findIndex(Le=>Le.id===Z.id);re=El(Fe,ze);}let Ye=e.columns.find(Te=>Te.id===$);if(Ye&&Ye.wipLimit&&Ye.wipLimitType==="hard"){let Te=wt.get($)||[];if(ve.columnId!==$&&Te.length>=Ye.wipLimit){t.onWipLimitExceeded?.(Ye,ve);return}}(ve.columnId!==$||ve.position!==re)&&await t.onCardMove?.(ve.id,$,re);},[e.cards,e.columns,wt,t,Ce]),ge=react.useCallback(k=>{B||R(k),a?.(k),w?.(k.id);},[a,w,B]),mt=react.useCallback(k=>{t.onCardUpdate?.(k.id,k),R(k);},[t]);return d?jsxRuntime.jsx("div",{className:c("asakaa-board",rt,o),style:l,children:jsxRuntime.jsx($h,{columnCount:3})}):i?jsxRuntime.jsx("div",{className:c("asakaa-board",rt,o),style:l,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 i=="string"?i:i.message})]})})}):jsxRuntime.jsxs(Du,{themeName:Ee,children:[jsxRuntime.jsxs("div",{className:c("flex h-full overflow-hidden",K?"flex-row":""),children:[jsxRuntime.jsxs(core$1.DndContext,{sensors:tt,collisionDetection:core$1.closestCorners,onDragStart:Ue,onDragOver:ot,onDragEnd:Et,children:[jsxRuntime.jsxs("div",{ref:Ie,className:c("asakaa-board",K?"flex-1":"",rt,o),style:{...l,cursor:ae?"grabbing":void 0},"data-theme":Ee,children:[e.columns.sort((k,O)=>k.position-O.position).map(k=>{let O=wt.get(k.id)||[],Z=!Oe.includes(k.id),ve=r?.renderColumnFooter?.(k);return jsxRuntime.jsxs("div",{className:"asakaa-column-wrapper",children:[jsxRuntime.jsx(Mn,{column:k,cards:O,renderCard:r?.renderCard,renderColumn:r?.renderColumn,renderHeader:r?.renderColumnHeader,renderEmptyState:r?.renderEmptyState,renderMetrics:V?($,re)=>V($,re):void 0,onCardClick:ge,onCardUpdate:pe,onColumnRename:t.onColumnUpdate?We:void 0,onColumnDelete:t.onColumnDelete?je:void 0,isDeletable:Z,locale:n?.locale==="es"?"es":"en",availableUsers:s,allCards:e.cards,enableVirtualization:n?.enableVirtualization,cardHeight:n?.cardHeight}),ve]},k.id)}),u]}),jsxRuntime.jsx(core$1.DragOverlay,{children:X.draggedCardId?jsxRuntime.jsx(ko,{card:e.cards.find(k=>k.id===X.draggedCardId),render:r?.renderCardOverlay||r?.renderCard,disableDrag:true,className:"opacity-90 rotate-3 shadow-2xl"}):null})]}),K]}),!B&&jsxRuntime.jsx(To,{task:Re,isOpen:!!Re,onClose:()=>R(null),onCardUpdate:mt,theme:He?"dark":"light",locale:n?.locale==="es"?"es":"en",availableUsers:s,availableTags:m,onCreateTag:p,attachments:Re?g?.get(Re.id)||[]:[],onUploadAttachments:f,onDeleteAttachment:x,availableTasks:pt,comments:y,onAddComment:b,currentUser:h,mentionableUsers:v,onUploadCommentAttachments:D,enableTimeTracking:S,timeTrackingSummary:M,timeEntries:T,isTimerRunning:F?.isRunning,timerElapsedSeconds:F?.elapsedSeconds,onTimeLog:A,onEstimateUpdate:C,onSoldEffortUpdate:_,onTimerStart:W,onTimerStop:oe,onTimerDiscard:L,blurFinancials:Y})]})}function $h({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 Vh={bgGrid:"#050505",bgSecondary:"#0A0A0A",border:"rgba(255, 255, 255, 0.08)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"rgba(255, 255, 255, 0.92)",textSecondary:"rgba(255, 255, 255, 0.60)",textTertiary:"rgba(255, 255, 255, 0.35)",accent:"#007FFF",accentLight:"rgba(0, 229, 204, 0.15)",hoverBg:"rgba(255, 255, 255, 0.04)"},Gh={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:"#00E5CC",accentLight:"rgba(0, 229, 204, 0.1)",hoverBg:"rgba(0, 0, 0, 0.05)"},jh={newTask:"Nueva Tarea",selectColumn:"Seleccionar columna",export:"Exportar",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"},_h={newTask:"New Task",selectColumn:"Select column",export:"Export",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"};function Kh({columns:e,onSelect:t,theme:a,t:r,createTaskLabel:n}){let[s,o]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let i=u=>{l.current&&!l.current.contains(u.target)&&o(false);};return s&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[s]);let d=i=>{t(i),o(false);};return jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>o(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #007FFF 0%, #0055CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:n||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((i,u)=>i.position-u.position).map((i,u)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>d(i.id),className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:u<e.length-1?`1px solid ${a.borderLight}`:"none"},whileHover:{backgroundColor:a.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:u*.03},children:[jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i.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:i.title}),jsxRuntime.jsxs("div",{className:"text-[10px] truncate",style:{color:a.textTertiary},children:[i.cardIds.length," ",i.cardIds.length===1?"tarea":"tareas"]})]})]},i.id))]})})})]})}function qh({theme:e,t,onExportCSV:a,onExportJSON:r,onExportExcel:n}){let[s,o]=react.useState(false),[l,d]=react.useState(null),i=react.useRef(null);if(react.useEffect(()=>{let g=f=>{i.current&&!i.current.contains(f.target)&&o(false);};return s&&document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[s]),!(a||r||n))return null;let m=[{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:n}].filter(g=>g.handler),p=async(g,f)=>{if(f){d(g);try{await f();}catch(x){console.error(`Export ${g} failed:`,x);}finally{d(null),o(false);}}};return jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>o(!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:m.map((g,f)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>p(g.id,g.handler),disabled:l!==null,className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:f<m.length-1?`1px solid ${e.borderLight}`:"none"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:f*.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:l===g.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"})}):g.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:g.label}),jsxRuntime.jsx("div",{className:"text-[10px] truncate",style:{color:e.textTertiary},children:g.description})]})]},g.id))})})})]})}function Yh({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, #007FFF 0%, #0055CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:t})]})}function ql({columns:e,onCreateTask:t,createTaskLabel:a,theme:r="dark",locale:n="es",useColumnSelector:s=false,onExportCSV:o,onExportJSON:l,onExportExcel:d,translations:i,toolbarRightContent:u,toolbarEndContent:m}){let p=r==="dark"?Vh:Gh,g={...n==="es"?jh:_h,...i},f=o||l||d;return jsxRuntime.jsx("div",{className:"h-12 px-4 flex items-center justify-end border-b sticky top-0 z-10",style:{backgroundColor:p.bgGrid,borderColor:p.border},children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[u&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u,jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:p.borderLight}})]}),f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(qh,{theme:p,t:g,onExportCSV:o,onExportJSON:l,onExportExcel:d}),t&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:p.borderLight}})]}),m,t&&(s?jsxRuntime.jsx(Kh,{columns:e,onSelect:t,theme:p,t:g,createTaskLabel:a}):jsxRuntime.jsx(Yh,{onClick:()=>t(),label:a||g.newTask}))]})})}function Xl({onAddColumn:e,className:t,placeholder:a="Nombre de la columna...",buttonLabel:r="Agregar Columna",disabled:n=false}){let[s,o]=react.useState(false),[l,d]=react.useState(""),i=react.useCallback(()=>{let p=l.trim();p&&(e(p),d(""),o(false));},[l,e]),u=react.useCallback(p=>{p.key==="Enter"?(p.preventDefault(),i()):p.key==="Escape"&&(d(""),o(false));},[i]),m=react.useCallback(()=>{setTimeout(()=>{l.trim()||o(false);},150);},[l]);return s?jsxRuntime.jsx("div",{className:c("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:l,onChange:p=>d(p.target.value),onKeyDown:u,onBlur:m,placeholder:a,autoFocus:true,className:"asakaa-add-column__input"}),jsxRuntime.jsxs("div",{className:"asakaa-add-column__actions",children:[jsxRuntime.jsx("button",{onClick:i,disabled:!l.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:()=>{d(""),o(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:c("asakaa-add-column",t),children:jsxRuntime.jsxs("button",{onClick:()=>o(true),disabled:n,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 ln({onSubmit:e,onCancel:t,availableUsers:a=[],isDark:r=true,locale:n="es",defaultDate:s,className:o,dropdownDirection:l="up"}){let[d,i]=react.useState(""),[u,m]=react.useState(void 0),[p,g]=react.useState(null),[f,x]=react.useState(null),[y,b]=react.useState(false),[h,v]=react.useState(false),[w,D]=react.useState(false),[S,M]=react.useState(s||new Date),T=react.useRef(null),F=n==="es",A=l==="up"?"bottom-full mb-1":"top-full mt-1";react.useEffect(()=>{T.current?.focus();},[]);let C=react.useCallback(()=>{b(false),v(false),D(false);},[]),_=react.useCallback(()=>{i(""),m(void 0),g(null),x(null),C(),t();},[t,C]),W=react.useCallback(()=>{let Y=d.trim();if(!Y)return;let K=a.find(B=>B.id===p),V=f||s;e({name:Y,priority:u,assignee:K||void 0,assigneeId:p,startDate:V,endDate:V}),i(""),m(void 0),g(null),x(null),C(),T.current?.focus();},[d,u,p,f,s,a,e,C]),oe=react.useCallback(Y=>{Y.key==="Enter"&&d.trim()&&(Y.preventDefault(),W()),Y.key==="Escape"&&_();},[W,_,d]),L=f||s||new Date;return jsxRuntime.jsxs("div",{className:c("quick-task-create",o),onClick:()=>C(),children:[jsxRuntime.jsx("div",{className:"p-2.5",children:jsxRuntime.jsx("input",{ref:T,type:"text",value:d,onChange:Y=>i(Y.target.value),placeholder:F?"Nombre de la tarea...":"Task name...",className:c("w-full bg-transparent text-sm outline-none font-mono",r?"text-white/90 placeholder:text-white/20":"text-gray-900 placeholder:text-gray-400"),autoFocus:true,onKeyDown:oe})}),jsxRuntime.jsxs("div",{className:c("px-2.5 py-2 flex items-center justify-between border-t",r?"border-white/[0.08]":"border-gray-100"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:Y=>{Y.stopPropagation(),b(!y),v(false),D(false);},type:"button",className:c("p-1 rounded transition-colors",u?u==="urgent"||u==="high"?"text-red-400 bg-red-500/20":u==="medium"?"text-yellow-400 bg-yellow-500/20":"text-green-400 bg-green-500/20":r?"hover:bg-white/10 text-white/30":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:l==="up"?-5:5},animate:{opacity:1,y:0},exit:{opacity:0,y:l==="up"?-5:5},className:c("absolute left-0 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[120px]",A,r?"bg-[#111] border border-white/10":"bg-white border border-gray-200"),onClick:Y=>Y.stopPropagation(),children:[{id:"urgent",label:F?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:F?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:F?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:F?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:F?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(Y=>jsxRuntime.jsxs("button",{onClick:()=>{m(Y.id),b(false);},type:"button",className:c("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",r?"hover:bg-white/5":"hover:bg-gray-50",u===Y.id&&(r?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:c("w-2 h-2 rounded-full",Y.color)}),jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:Y.label})]},Y.id||"none"))})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("button",{onClick:Y=>{Y.stopPropagation(),D(!w),b(false),v(false),M(f||s||new Date);},type:"button",className:c("flex items-center gap-1 text-xs px-1.5 py-0.5 rounded transition-colors font-mono",f?r?"bg-[#007FFF]/20 text-[#007FFF]":"bg-[#00E5CC]/20 text-[#00C4AE]":r?"bg-white/5 text-white/30 hover:bg-white/10":"bg-gray-100 text-gray-500 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:"w-3 h-3"}),L.toLocaleDateString(F?"es-ES":"en-US",{day:"numeric",month:"short"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:w&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:l==="up"?-5:5},animate:{opacity:1,y:0},exit:{opacity:0,y:l==="up"?-5:5},className:c("absolute left-0 z-[60] rounded-xl shadow-2xl overflow-hidden flex",A,r?"bg-[#111] border border-white/10":"bg-white border border-gray-200"),onClick:Y=>Y.stopPropagation(),children:[jsxRuntime.jsx("div",{className:c("w-40 py-2 border-r",r?"border-white/10":"border-gray-200"),children:(()=>{let Y=new Date,K=new Date(Y);K.setDate(Y.getDate()+1);let V=new Date(Y);V.setDate(Y.getDate()+((6-Y.getDay()+7)%7||7));let B=new Date(Y);B.setDate(Y.getDate()+((1-Y.getDay()+7)%7||7));let X=new Date(Y);X.setDate(Y.getDate()+14);let Ce=new Date(Y);Ce.setDate(Y.getDate()+28);let Re=F?"es-ES":"en-US";return [{label:F?"Hoy":"Today",date:Y,display:Y.toLocaleDateString(Re,{weekday:"short"}).slice(0,3)+"."},{label:F?"Ma\xF1ana":"Tomorrow",date:K,display:K.toLocaleDateString(Re,{weekday:"short"}).slice(0,3)+"."},{label:F?"Este fin de semana":"This weekend",date:V,display:F?"s\xE1b.":"sat."},{label:F?"Pr\xF3xima semana":"Next week",date:B,display:F?"lun.":"mon."},{label:F?"2 semanas":"2 weeks",date:X,display:X.toLocaleDateString(Re,{day:"numeric",month:"short"})},{label:F?"4 semanas":"4 weeks",date:Ce,display:Ce.toLocaleDateString(Re,{day:"numeric",month:"short"})}].map((ae,be)=>jsxRuntime.jsxs("button",{type:"button",className:c("w-full flex items-center justify-between px-3 py-1.5 text-xs transition-colors",r?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{x(ae.date),D(false);},children:[jsxRuntime.jsx("span",{children:ae.label}),jsxRuntime.jsx("span",{className:c("text-[10px] font-mono",r?"text-white/30":"text-gray-400"),children:ae.display})]},be))})()}),jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("span",{className:c("text-xs font-medium font-mono",r?"text-white":"text-gray-900"),children:S.toLocaleDateString(F?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>M(new Date),className:c("px-1.5 py-0.5 rounded text-[10px] transition-colors font-mono",r?"hover:bg-white/10 text-white/40":"hover:bg-gray-100 text-gray-500"),children:F?"Hoy":"Today"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>M(new Date(S.getFullYear(),S.getMonth()-1)),className:c("p-0.5 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>M(new Date(S.getFullYear(),S.getMonth()+1)),className:c("p-0.5 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:(F?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(Y=>jsxRuntime.jsx("div",{className:c("w-6 h-6 flex items-center justify-center text-[10px] font-mono",r?"text-white/30":"text-gray-400"),children:Y},Y))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let Y=S.getFullYear(),K=S.getMonth(),V=new Date(Y,K,1).getDay(),B=new Date(Y,K+1,0).getDate(),X=new Date(Y,K,0).getDate(),Ce=new Date().toDateString(),Re=[];for(let ae=V-1;ae>=0;ae--)Re.push({dayNum:X-ae,isCurrent:false,date:new Date(Y,K-1,X-ae)});for(let ae=1;ae<=B;ae++)Re.push({dayNum:ae,isCurrent:true,date:new Date(Y,K,ae)});let R=42-Re.length;for(let ae=1;ae<=R;ae++)Re.push({dayNum:ae,isCurrent:false,date:new Date(Y,K+1,ae)});return Re.map((ae,be)=>{let Ie=ae.date.toDateString()===Ce,De=(f||s)?.toDateString()===ae.date.toDateString();return jsxRuntime.jsx("button",{type:"button",className:c("w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors font-mono",!ae.isCurrent&&(r?"text-white/20":"text-gray-300"),ae.isCurrent&&(r?"text-white":"text-gray-900"),Ie&&"ring-1 ring-[#007FFF]",De&&"bg-[#007FFF] text-white",!De&&(r?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{x(ae.date),D(false);},children:ae.dayNum},be)})})()})]})]})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:Y=>{Y.stopPropagation(),v(!h),b(false),D(false);},type:"button",className:c("p-1 rounded transition-colors",p?"text-[#007FFF] bg-[#007FFF]/20":r?"hover:bg-white/10 text-white/30":"hover:bg-gray-100 text-gray-400"),children:p?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center text-white text-[8px] font-mono font-bold",style:{backgroundColor:a.find(Y=>Y.id===p)?.color||"#007FFF"},children:a.find(Y=>Y.id===p)?.initials||a.find(Y=>Y.id===p)?.name?.slice(0,2).toUpperCase()}):jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:h&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:l==="up"?-5:5},animate:{opacity:1,y:0},exit:{opacity:0,y:l==="up"?-5:5},className:c("absolute left-0 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[160px] max-h-[200px] overflow-y-auto",A,r?"bg-[#111] border border-white/10":"bg-white border border-gray-200"),onClick:Y=>Y.stopPropagation(),children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>{g(null),v(false);},className:c("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",r?"hover:bg-white/5":"hover:bg-gray-50",!p&&(r?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:c("w-5 h-5 rounded-full flex items-center justify-center",r?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3 h-3 text-gray-400"})}),jsxRuntime.jsx("span",{className:r?"text-white/40":"text-gray-500",children:F?"Sin asignar":"Unassigned"})]}),a.map(Y=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>{g(Y.id),v(false);},className:c("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",r?"hover:bg-white/5":"hover:bg-gray-50",p===Y.id&&(r?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-white text-[9px] font-mono font-bold",style:{backgroundColor:Y.color||"#007FFF"},children:Y.initials||Y.name?.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:Y.name})]},Y.id)),a.length===0&&jsxRuntime.jsx("div",{className:c("px-3 py-2 text-xs font-mono",r?"text-white/30":"text-gray-400"),children:F?"No hay usuarios disponibles":"No users available"})]})})]})]}),jsxRuntime.jsx("button",{onClick:W,disabled:!d.trim(),type:"button",className:c("px-2.5 py-1 rounded text-xs font-mono font-medium transition-colors",d.trim()?"bg-[#007FFF] hover:bg-[#0066CC] text-white":r?"bg-white/5 text-white/20":"bg-gray-100 text-gray-400"),children:F?"Guardar":"Save"})]})]})}function td({columnId:e,onAddCard:t,availableUsers:a=[],className:r,buttonLabel:n,disabled:s=false,theme:o="dark",locale:l="es"}){let[d,i]=react.useState(false),u=react.useRef(null),m=react.useRef(null),[p,g]=react.useState({}),[f,x]=react.useState(false),y=o==="dark",h={buttonLabel:n||(l==="es"?"Agregar Tarea":"Add Task")};react.useEffect(()=>{if(!d||!u.current)return;let w=90,D=()=>{let S=u.current.getBoundingClientRect(),T=window.innerHeight-S.bottom<w+8;x(T),g({position:"fixed",...T?{bottom:window.innerHeight-S.top+4}:{top:S.bottom+4},left:S.left,width:S.width,zIndex:9999});};return D(),window.addEventListener("scroll",D,true),window.addEventListener("resize",D),()=>{window.removeEventListener("scroll",D,true),window.removeEventListener("resize",D);}},[d]),react.useEffect(()=>{if(!d)return;let w=D=>{let S=D.target;m.current&&!m.current.contains(S)&&u.current&&!u.current.contains(S)&&i(false);};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[d]);let v=react.useCallback(w=>{t({name:w.name,columnId:e,assigneeIds:w.assigneeId?[w.assigneeId]:void 0,startDate:w.startDate,endDate:w.endDate,priority:w.priority});},[t,e]);return jsxRuntime.jsxs("div",{ref:u,className:c("asakaa-add-card",r),children:[jsxRuntime.jsxs("button",{onClick:()=>i(!d),disabled:s,className:"asakaa-add-card__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"})]}),h.buttonLabel]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:d&&jsxRuntime.jsx(framerMotion.motion.div,{ref:m,initial:{opacity:0,y:f?4:-4,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:f?4:-4,scale:.97},transition:{duration:.12},style:p,className:c("rounded-lg shadow-2xl",y?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08] shadow-[0_8px_32px_rgba(0,0,0,0.6)]":"bg-white border border-gray-200 shadow-xl"),children:jsxRuntime.jsx(ln,{onSubmit:v,onCancel:()=>i(false),availableUsers:a,isDark:y,locale:l,dropdownDirection:"up"})})}),document.body)]})}var ys=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(Ho,{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 n=this.data.columns.find(s=>s.id===r.columnId);a.push([r.id,r.title,n?.title||"",r.description||"",r.labels?.join(", ")||"",r.assignedUserIds?.join(", ")||r.assigneeId||"",r.dueDate?.toString()||"",r.position.toString()]);}),a.map(r=>r.map(n=>`"${n}"`).join(",")).join(`
|
|
19
19
|
`)}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((n,s)=>{r.toBlob(o=>{o?n(o):s(new Error("Failed to create PNG blob"));},"image/png");})}};function Pp(e={}){return new ys(e)}var An=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:n,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}),n)try{n(a,r);}catch(o){console.error("Error in error handler:",o);}}render(){let{hasError:a,error:r}=this.state,{children:n,fallback:s,componentName:o}=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:o?`Error in ${o}`:"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"})]})]})}):n}};function ad(e,t){let a=r=>jsxRuntime.jsx(An,{...t,children:jsxRuntime.jsx(e,{...r})});return a.displayName=`withErrorBoundary(${e.displayName||e.name||"Component"})`,a}function od({board:e,onCreateCard:t,onNavigateToCard:a,onSearch:r,onChangePriority:n,onAssignUser:s,onGeneratePlan:o,onPredictRisks:l,onOpenAIUsage:d,shortcut:i="k",className:u=""}){let[m,p]=react.useState(false),[g,f]=react.useState(""),[x,y]=react.useState("home"),[b,h]=react.useState(""),[v,w]=react.useState("");react.useEffect(()=>{let T=F=>{(F.metaKey||F.ctrlKey)&&F.key===i&&(F.preventDefault(),p(A=>!A)),F.key==="Escape"&&(p(false),y("home"),f(""));};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[i]),react.useEffect(()=>{m||(y("home"),f(""),h(""),w(""));},[m]);let D=react.useCallback(()=>{p(false);},[]),S=react.useCallback(T=>{let[F,A]=T.split(":");switch(F){case "create-card":y("create-card");break;case "create-card-in":h(A||"");break;case "navigate":A?(a?.(A),D()):y("navigate");break;case "search":r?.(g),D();break;case "priority":y("priority");break;case "set-priority":v&&A&&(n?.(v,A),D());break;case "assign":y("assign");break;case "assign-user":v&&A&&(s?.(v,A),D());break;case "ai":y("ai");break;case "ai-generate-plan":o?.(),D();break;case "ai-predict-risks":l?.(),D();break;case "ai-usage":d?.(),D();break;case "back":y("home");break;}},[g,v,t,a,r,n,s,o,l,d,D]),M=react.useCallback(()=>{b&&g.trim()&&(t?.(b,g.trim()),D());},[b,g,t,D]);return m?jsxRuntime.jsx(Qt,{children:jsxRuntime.jsx("div",{className:"command-palette-overlay",onClick:D,children:jsxRuntime.jsx("div",{className:`command-palette ${u}`,onClick:T=>T.stopPropagation(),children:jsxRuntime.jsxs(cmdk.Command,{value:g,onValueChange:f,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:x==="create-card"&&b?"Type card title and press Enter...":x==="create-card"?"Select a column first...":"Type a command or search...",className:"command-palette-input",onKeyDown:T=>{T.key==="Enter"&&x==="create-card"&&b&&M();}}),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."}),x==="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:S,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:S,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:S,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:S,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(T=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${T.id}`,onSelect:S,className:"command-palette-item",children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:T.priority==="URGENT"?"#EF4444":T.priority==="HIGH"?"#F59E0B":T.priority==="MEDIUM"?"#00E5CC":"#6B7280"}}),jsxRuntime.jsx("span",{children:T.title}),T.labels&&T.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:T.labels.slice(0,2).map(F=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:F},F))})]},T.id))})]}),x==="create-card"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:S,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(T=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`create-card-in:${T.id}`,onSelect:S,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:T.title}),jsxRuntime.jsxs("div",{className:"command-palette-item-count",children:[T.cardIds.length," cards"]})]},T.id))})]}),x==="navigate"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:S,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(T=>{let F=e.columns.find(A=>A.id===T.columnId);return jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${T.id}`,onSelect:S,className:"command-palette-item",keywords:[T.title,T.description||"",...T.labels||[]],children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:T.priority==="URGENT"?"#EF4444":T.priority==="HIGH"?"#F59E0B":T.priority==="MEDIUM"?"#00E5CC":"#6B7280"}}),jsxRuntime.jsxs("div",{className:"command-palette-item-content",children:[jsxRuntime.jsx("div",{children:T.title}),jsxRuntime.jsx("div",{className:"command-palette-item-meta",children:F?.title})]}),T.labels&&T.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:T.labels.slice(0,2).map(A=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:A},A))})]},T.id)})})]}),x==="ai"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:S,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:S,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:S,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:S,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 Lp(e,t,a,r,n){let s=document.getElementById("attachment-lightbox-native");s&&s.remove();let o=document.createElement("div");o.id="attachment-lightbox-native",o.className="attachment-lightbox",o.style.cssText=`
|
|
20
20
|
position: fixed !important;
|
|
21
21
|
inset: 0 !important;
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
border: none !important;
|
|
83
83
|
cursor: pointer !important;
|
|
84
84
|
opacity: 0.5 !important;
|
|
85
|
-
`,g.onmouseenter=()=>{g.style.opacity="1";},g.onmouseleave=()=>{g.style.opacity="0.5";},g.onclick=f=>{f.stopPropagation();let x=r<a.length-1?r+1:0;i(),n(x);},o.appendChild(m),o.appendChild(p),o.appendChild(g);}o.appendChild(l),o.appendChild(d),document.body.appendChild(o),setTimeout(()=>{d.style.transition="opacity 0.5s ease",d.style.opacity="0";},2e3);}function cy(e){if(e===0)return "0 Bytes";let t=1024,a=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/Math.pow(t,r)*100)/100+" "+a[r]}function uy(e){return e.startsWith("image/")?"\u{1F5BC}\uFE0F":e.startsWith("video/")?"\u{1F3A5}":e.startsWith("audio/")?"\u{1F3B5}":e.includes("pdf")?"\u{1F4C4}":e.includes("word")||e.includes("document")?"\u{1F4DD}":e.includes("sheet")||e.includes("excel")?"\u{1F4CA}":e.includes("presentation")||e.includes("powerpoint")?"\u{1F4FD}\uFE0F":e.includes("zip")||e.includes("rar")||e.includes("compressed")?"\u{1F5DC}\uFE0F":e.includes("text")?"\u{1F4C3}":"\u{1F4CE}"}function sd(e){return e.startsWith("image/")}function uo({attachments:e=[],onUpload:t,onDelete:a,maxSizeMB:r=10,allowedTypes:n,maxFiles:s=10}){let[o,l]=react.useState(false),[d,i]=react.useState(false),[u,m]=react.useState(null),p=react.useRef(null),g=react.useRef(e);g.current=e;let f=react.useCallback((T,F)=>{F.preventDefault(),F.stopPropagation();let A=g.current.filter(W=>sd(W.type)),C=A.findIndex(W=>W.id===T.id),_=W=>{let oe=g.current.filter(Y=>sd(Y.type)),L=oe[W];L&&Lp(L.url,L.name,oe,W,_);};Lp(T.url,T.name,A,C,_);},[]),x=react.useCallback(T=>{let F=[],A=[];return e.length+T.length>s?(A.push(`Maximum ${s} files allowed`),{valid:F,errors:A}):(T.forEach(C=>{if(C.size/1048576>r){A.push(`${C.name} is too large (max ${r}MB)`);return}if(n&&!n.some(W=>C.type.match(W))){A.push(`${C.name} has invalid file type`);return}F.push(C);}),{valid:F,errors:A})},[e.length,s,r,n]),y=react.useCallback(async T=>{let{valid:F,errors:A}=x(T);if(A.length>0){m(A.join(", ")),setTimeout(()=>m(null),5e3);return}if(F.length!==0){i(true),m(null);try{await t?.(F);}catch(C){m(C instanceof Error?C.message:"Upload failed"),setTimeout(()=>m(null),5e3);}finally{i(false);}}},[x,t]),b=react.useCallback(T=>{T.preventDefault(),T.stopPropagation(),l(true);},[]),h=react.useCallback(T=>{T.preventDefault(),T.stopPropagation(),l(false);},[]),v=react.useCallback(T=>{T.preventDefault(),T.stopPropagation();},[]),w=react.useCallback(T=>{T.preventDefault(),T.stopPropagation(),l(false);let F=Array.from(T.dataTransfer.files);y(F);},[y]),D=react.useCallback(T=>{let F=T.target.files?Array.from(T.target.files):[];y(F),p.current&&(p.current.value="");},[y]),S=react.useCallback(()=>{p.current?.click();},[]),M=react.useCallback(T=>{confirm("Are you sure you want to delete this attachment?")&&a?.(T);},[a]);return jsxRuntime.jsxs("div",{className:"attachment-uploader",children:[jsxRuntime.jsxs("div",{className:`attachment-dropzone ${o?"dragging":""} ${d?"uploading":""}`,onDragEnter:b,onDragLeave:h,onDragOver:v,onDrop:w,onClick:S,children:[jsxRuntime.jsx("input",{ref:p,type:"file",multiple:true,onChange:D,style:{display:"none"},accept:n?.join(",")}),jsxRuntime.jsx("div",{className:"attachment-dropzone-content",children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"attachment-spinner"}),jsxRuntime.jsx("p",{className:"attachment-dropzone-text",children:"Uploading..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"attachment-dropzone-icon",children:[jsxRuntime.jsx("path",{d:"M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M17 8L12 3L7 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M12 3V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntime.jsx("p",{className:"attachment-dropzone-text",children:o?"Drop files here":"Drag & drop files here"}),jsxRuntime.jsx("p",{className:"attachment-dropzone-subtext",children:"or click to browse"}),jsxRuntime.jsxs("p",{className:"attachment-dropzone-info",children:["Max ",r,"MB \u2022 ",e.length,"/",s," files"]})]})})]}),u&&jsxRuntime.jsxs("div",{className:"attachment-error",children:[jsxRuntime.jsx("span",{className:"attachment-error-icon",children:"\u26A0\uFE0F"}),jsxRuntime.jsx("span",{className:"attachment-error-text",children:u})]}),e.length>0&&jsxRuntime.jsx("div",{className:"attachment-list",children:e.map(T=>jsxRuntime.jsxs("div",{className:"attachment-item",children:[jsxRuntime.jsx("div",{className:"attachment-preview",children:sd(T.type)&&T.url?jsxRuntime.jsxs("button",{type:"button",className:"attachment-thumbnail-btn",onClick:F=>f(T,F),title:"Click to view full size",children:[jsxRuntime.jsx("img",{src:T.thumbnailUrl||T.url,alt:T.name,className:"attachment-thumbnail"}),jsxRuntime.jsx("div",{className:"attachment-thumbnail-overlay",children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M15 3H21V9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M9 21H3V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M21 3L14 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M3 21L10 14",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]}):jsxRuntime.jsx("div",{className:"attachment-icon",children:uy(T.type)})}),jsxRuntime.jsxs("div",{className:"attachment-info",children:[jsxRuntime.jsx("a",{href:T.url,target:"_blank",rel:"noopener noreferrer",className:"attachment-name",title:T.name,children:T.name}),jsxRuntime.jsxs("div",{className:"attachment-meta",children:[jsxRuntime.jsx("span",{className:"attachment-size",children:cy(T.size)}),jsxRuntime.jsx("span",{className:"attachment-separator",children:"\u2022"}),jsxRuntime.jsx("span",{className:"attachment-date",children:new Date(T.uploadedAt).toLocaleDateString()})]})]}),jsxRuntime.jsx("button",{onClick:()=>M(T.id),className:"attachment-delete",title:"Delete attachment",type:"button",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},T.id))})]})}function id({card:e,isOpen:t,onClose:a,onUpdate:r,onDelete:n,availableUsers:s=[],comments:o=[],activities:l=[],aiInsights:d=[],attachments:i=[],onAddComment:u,onDeleteComment:m,onUploadAttachments:p,onDeleteAttachment:g,onSuggestAssignee:f,onGenerateSubtasks:x,onEstimateEffort:y,currentUserId:b="user-1"}){let[h,v]=react.useState("details"),[w,D]=react.useState(false),[S,M]=react.useState({}),[T,F]=react.useState(""),[A,C]=react.useState(false),[_,W]=react.useState({});if(!t||!e)return null;let oe=react.useCallback(()=>{D(false),M({}),v("details"),F(""),W({}),a();},[a]),L=react.useCallback(()=>{r&&Object.keys(S).length>0&&(r(e.id,S),M({}),D(false));},[e.id,S,r]),Y=react.useCallback(()=>{n&&window.confirm("Are you sure you want to delete this card?")&&(n(e.id),oe());},[e.id,n,oe]),K=react.useCallback(()=>{u&&T.trim()&&(u(e.id,T.trim()),F(""));},[e.id,T,u]),V=react.useCallback(async()=>{if(f){C(true);try{let R=await f(e);W(ae=>({...ae,assignees:R}));}catch(R){console.error("Failed to suggest assignee:",R);}finally{C(false);}}},[e,f]),B=react.useCallback(async()=>{if(x){C(true);try{let R=await x(e);W(ae=>({...ae,subtasks:R}));}catch(R){console.error("Failed to generate subtasks:",R);}finally{C(false);}}},[e,x]),X=react.useCallback(async()=>{if(y){C(true);try{let R=await y(e);W(ae=>({...ae,effort:R}));}catch(R){console.error("Failed to estimate effort:",R);}finally{C(false);}}},[e,y]),Ce={...e,...S},Re=s.filter(R=>Ce.assignedUserIds?.includes(R.id));return jsxRuntime.jsx(Qt,{children:jsxRuntime.jsx("div",{className:"card-detail-overlay",onClick:oe,children:jsxRuntime.jsxs("div",{className:"card-detail-modal",onClick:R=>R.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"card-detail-header",children:[jsxRuntime.jsxs("div",{className:"card-detail-header-left",children:[jsxRuntime.jsx("div",{className:"card-detail-priority-dot",style:{background:Ce.priority==="URGENT"?"#EF4444":Ce.priority==="HIGH"?"#F59E0B":Ce.priority==="MEDIUM"?"#00E5CC":"#6B7280"}}),w?jsxRuntime.jsx("input",{type:"text",value:S.title??Ce.title,onChange:R=>M({...S,title:R.target.value}),className:"card-detail-title-input",placeholder:"Card title"}):jsxRuntime.jsx("h2",{className:"card-detail-title",children:Ce.title})]}),jsxRuntime.jsxs("div",{className:"card-detail-header-actions",children:[w?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{onClick:L,className:"card-detail-btn card-detail-btn-primary",children:"Save"}),jsxRuntime.jsx("button",{onClick:()=>{D(false),M({});},className:"card-detail-btn",children:"Cancel"})]}):jsxRuntime.jsxs("button",{onClick:()=>D(true),className:"card-detail-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),jsxRuntime.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Edit"]}),jsxRuntime.jsxs("button",{onClick:Y,className:"card-detail-btn card-detail-btn-danger",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]}),"Delete"]}),jsxRuntime.jsx("button",{onClick:oe,className:"card-detail-btn-close",children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-tabs",children:[jsxRuntime.jsxs("button",{onClick:()=>v("details"),className:`card-detail-tab ${h==="details"?"active":""}`,children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Details"]}),jsxRuntime.jsxs("button",{onClick:()=>v("comments"),className:`card-detail-tab ${h==="comments"?"active":""}`,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),"Comments",o.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:o.length})]}),jsxRuntime.jsxs("button",{onClick:()=>v("activity"),className:`card-detail-tab ${h==="activity"?"active":""}`,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),"Activity",l.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:l.length})]}),jsxRuntime.jsxs("button",{onClick:()=>v("attachments"),className:`card-detail-tab ${h==="attachments"?"active":""}`,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})}),"Attachments",i.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:i.length})]}),jsxRuntime.jsxs("button",{onClick:()=>v("ai"),className:`card-detail-tab ${h==="ai"?"active":""}`,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"})]}),"AI Insights",jsxRuntime.jsx("span",{className:"card-detail-tab-badge card-detail-tab-badge-ai",children:"AI"})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-content",children:[h==="details"&&jsxRuntime.jsxs("div",{className:"card-detail-details",children:[jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Description"}),w?jsxRuntime.jsx("textarea",{value:S.description??Ce.description??"",onChange:R=>M({...S,description:R.target.value}),className:"card-detail-textarea",placeholder:"Add a description...",rows:4}):jsxRuntime.jsx("p",{className:"card-detail-text",children:Ce.description||"No description"})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Assigned To"}),w?jsxRuntime.jsx("select",{multiple:true,value:S.assignedUserIds??Ce.assignedUserIds??[],onChange:R=>{let ae=Array.from(R.target.selectedOptions,be=>be.value);M({...S,assignedUserIds:ae});},className:"card-detail-textarea",style:{height:"120px",padding:"8px 12px"},children:s.map(R=>jsxRuntime.jsx("option",{value:R.id,children:R.name},R.id))}):jsxRuntime.jsx("div",{className:"card-detail-users",children:Re.length>0?Re.map(R=>jsxRuntime.jsxs("div",{className:"card-detail-user",children:[jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:R.color},children:R.initials}),jsxRuntime.jsx("span",{children:R.name})]},R.id)):jsxRuntime.jsx("span",{className:"card-detail-empty",children:"Unassigned"})})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Priority"}),w?jsxRuntime.jsxs("select",{value:S.priority??Ce.priority??"",onChange:R=>M({...S,priority:R.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"},children:[jsxRuntime.jsx("option",{value:"",children:"None"}),jsxRuntime.jsx("option",{value:"LOW",children:"LOW"}),jsxRuntime.jsx("option",{value:"MEDIUM",children:"MEDIUM"}),jsxRuntime.jsx("option",{value:"HIGH",children:"HIGH"}),jsxRuntime.jsx("option",{value:"URGENT",children:"URGENT"})]}):jsxRuntime.jsxs("div",{className:"card-detail-priority",children:[jsxRuntime.jsx("div",{className:"card-detail-priority-dot",style:{background:Ce.priority==="URGENT"?"#EF4444":Ce.priority==="HIGH"?"#F59E0B":Ce.priority==="MEDIUM"?"#00E5CC":"#6B7280"}}),jsxRuntime.jsx("span",{children:Ce.priority||"None"})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Labels"}),jsxRuntime.jsx("div",{className:"card-detail-labels",children:Ce.labels&&Ce.labels.length>0?Ce.labels.map(R=>jsxRuntime.jsx("span",{className:"card-detail-label-tag",children:R},R)):jsxRuntime.jsx("span",{className:"card-detail-empty",children:"No labels"})})]}),jsxRuntime.jsxs("div",{className:"card-detail-section-row",children:[jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Start Date"}),w?jsxRuntime.jsx("input",{type:"date",value:S.startDate?new Date(S.startDate).toISOString().split("T")[0]:Ce.startDate?new Date(Ce.startDate).toISOString().split("T")[0]:"",onChange:R=>M({...S,startDate:R.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsxRuntime.jsx("span",{className:"card-detail-text",children:Ce.startDate?new Date(Ce.startDate).toLocaleDateString():"Not set"})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"End Date"}),w?jsxRuntime.jsx("input",{type:"date",value:S.endDate?new Date(S.endDate).toISOString().split("T")[0]:Ce.endDate?new Date(Ce.endDate).toISOString().split("T")[0]:"",onChange:R=>M({...S,endDate:R.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsxRuntime.jsx("span",{className:"card-detail-text",children:Ce.endDate?new Date(Ce.endDate).toLocaleDateString():"Not set"})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Estimated Hours"}),w?jsxRuntime.jsx("input",{type:"number",min:"0",step:"0.5",value:S.estimatedTime??Ce.estimatedTime??"",onChange:R=>M({...S,estimatedTime:R.target.value?parseFloat(R.target.value):void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"},placeholder:"Enter hours"}):jsxRuntime.jsx("span",{className:"card-detail-text",children:Ce.estimatedTime||"Not estimated"})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Dependencies"}),jsxRuntime.jsx("div",{className:"card-detail-dependencies",children:Ce.dependencies&&Ce.dependencies.length>0?Ce.dependencies.map(R=>{let ae=typeof R=="string"?R:R.taskId;return jsxRuntime.jsxs("span",{className:"card-detail-dependency",children:["Card #",ae.slice(-4)]},ae)}):jsxRuntime.jsx("span",{className:"card-detail-empty",children:"No dependencies"})})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Created"}),jsxRuntime.jsx("span",{className:"card-detail-text",children:Ce.createdAt?new Date(Ce.createdAt).toLocaleString():"Unknown"})]})]}),h==="comments"&&jsxRuntime.jsxs("div",{className:"card-detail-comments",children:[jsxRuntime.jsxs("div",{className:"card-detail-comment-form",children:[jsxRuntime.jsx("textarea",{value:T,onChange:R=>F(R.target.value),className:"card-detail-comment-textarea",placeholder:"Write a comment...",rows:3}),jsxRuntime.jsx("button",{onClick:K,disabled:!T.trim(),className:"card-detail-btn card-detail-btn-primary",children:"Add Comment"})]}),jsxRuntime.jsx("div",{className:"card-detail-comments-list",children:o.length>0?o.map(R=>{let ae=s.find(be=>be.id===R.authorId);return jsxRuntime.jsxs("div",{className:"card-detail-comment",children:[jsxRuntime.jsxs("div",{className:"card-detail-comment-header",children:[jsxRuntime.jsxs("div",{className:"card-detail-comment-author",children:[ae&&jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:ae.color},children:ae.initials}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"card-detail-comment-author-name",children:ae?.name||"Unknown"}),jsxRuntime.jsx("div",{className:"card-detail-comment-time",children:new Date(R.createdAt).toLocaleString()})]})]}),m&&jsxRuntime.jsx("button",{onClick:()=>m(R.id),className:"card-detail-comment-delete",children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]})})]}),jsxRuntime.jsx("p",{className:"card-detail-comment-content",children:R.content})]},R.id)}):jsxRuntime.jsxs("div",{className:"card-detail-empty-state",children:[jsxRuntime.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsxRuntime.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),jsxRuntime.jsx("p",{children:"No comments yet"}),jsxRuntime.jsx("span",{children:"Be the first to comment"})]})})]}),h==="activity"&&jsxRuntime.jsx("div",{className:"card-detail-activity",children:l.length>0?jsxRuntime.jsx("div",{className:"card-detail-activity-list",children:l.map(R=>{let ae=s.find(be=>be.id===R.userId);return jsxRuntime.jsxs("div",{className:"card-detail-activity-item",children:[jsxRuntime.jsxs("div",{className:"card-detail-activity-icon",children:[R.type.includes("CREATED")&&"\u2795",R.type.includes("UPDATED")&&"\u270F\uFE0F",R.type.includes("MOVED")&&"\u27A1\uFE0F",R.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",R.type.includes("COMMENT")&&"\u{1F4AC}",R.type.includes("ASSIGNED")&&"\u{1F464}",R.type.includes("PRIORITY")&&"\u{1F3AF}",R.type.includes("LABEL")&&"\u{1F3F7}\uFE0F",R.type.includes("ATTACHMENT")&&"\u{1F4CE}"]}),jsxRuntime.jsxs("div",{className:"card-detail-activity-content",children:[jsxRuntime.jsxs("div",{className:"card-detail-activity-text",children:[jsxRuntime.jsx("strong",{children:ae?.name||"Unknown"})," ",R.type.replace(/_/g," ").toLowerCase(),R.newValue&&jsxRuntime.jsxs("span",{className:"card-detail-activity-value",children:[" ","to ",jsxRuntime.jsx("strong",{children:R.newValue})]})]}),jsxRuntime.jsx("div",{className:"card-detail-activity-time",children:new Date(R.timestamp).toLocaleString()})]})]},R.id)})}):jsxRuntime.jsxs("div",{className:"card-detail-empty-state",children:[jsxRuntime.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsxRuntime.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),jsxRuntime.jsx("p",{children:"No activity yet"}),jsxRuntime.jsx("span",{children:"Activity will appear here"})]})}),h==="attachments"&&jsxRuntime.jsx("div",{className:"card-detail-attachments",children:jsxRuntime.jsx(uo,{cardId:e.id,attachments:i,onUpload:p?R=>p(e.id,R):void 0,onDelete:g,currentUserId:b,maxSizeMB:10,maxFiles:20})}),h==="ai"&&jsxRuntime.jsxs("div",{className:"card-detail-ai",children:[jsxRuntime.jsxs("div",{className:"card-detail-ai-actions",children:[jsxRuntime.jsx("h3",{className:"card-detail-ai-heading",children:"AI-Powered Suggestions"}),jsxRuntime.jsxs("button",{onClick:V,disabled:A||!f,className:"card-detail-ai-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),"Suggest Best Assignee"]}),jsxRuntime.jsxs("button",{onClick:B,disabled:A||!x,className:"card-detail-ai-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),jsxRuntime.jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),jsxRuntime.jsx("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),jsxRuntime.jsx("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),jsxRuntime.jsx("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),jsxRuntime.jsx("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]}),"Generate Subtasks"]}),jsxRuntime.jsxs("button",{onClick:X,disabled:A||!y,className:"card-detail-ai-btn",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 6 12 12 16 14"})]}),"Estimate Effort"]})]}),_.assignees&&jsxRuntime.jsxs("div",{className:"card-detail-ai-results",children:[jsxRuntime.jsx("h4",{children:"Assignee Suggestions"}),_.assignees.map((R,ae)=>{let be=s.find(Ie=>Ie.id===R.userId);return jsxRuntime.jsxs("div",{className:"card-detail-ai-suggestion",children:[be&&jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:be.color},children:be.initials}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"card-detail-ai-suggestion-name",children:be?.name}),jsxRuntime.jsx("div",{className:"card-detail-ai-suggestion-reason",children:R.reasoning}),jsxRuntime.jsxs("div",{className:"card-detail-ai-suggestion-confidence",children:["Confidence: ",(R.confidence*100).toFixed(0),"%"]})]})]},ae)})]}),_.subtasks&&jsxRuntime.jsxs("div",{className:"card-detail-ai-results",children:[jsxRuntime.jsx("h4",{children:"Suggested Subtasks"}),_.subtasks.map((R,ae)=>jsxRuntime.jsxs("div",{className:"card-detail-ai-subtask",children:[jsxRuntime.jsx("div",{className:"card-detail-ai-subtask-title",children:R.title}),R.description&&jsxRuntime.jsx("div",{className:"card-detail-ai-subtask-desc",children:R.description}),R.estimatedTime&&jsxRuntime.jsxs("div",{className:"card-detail-ai-subtask-time",children:["Est: ",R.estimatedTime,"h"]})]},ae))]}),_.effort&&jsxRuntime.jsxs("div",{className:"card-detail-ai-results",children:[jsxRuntime.jsx("h4",{children:"Effort Estimate"}),jsxRuntime.jsxs("div",{className:"card-detail-ai-effort",children:[jsxRuntime.jsxs("div",{className:"card-detail-ai-effort-hours",children:[_.effort.hours," hours"]}),jsxRuntime.jsxs("div",{className:"card-detail-ai-effort-confidence",children:["Confidence: ",(_.effort.confidence*100).toFixed(0),"%"]})]})]}),d.length>0&&jsxRuntime.jsxs("div",{className:"card-detail-ai-insights",children:[jsxRuntime.jsx("h4",{children:"AI Insights"}),d.map(R=>jsxRuntime.jsxs("div",{className:`card-detail-ai-insight card-detail-ai-insight-${R.severity.toLowerCase()}`,children:[jsxRuntime.jsxs("div",{className:"card-detail-ai-insight-header",children:[jsxRuntime.jsx("span",{className:"card-detail-ai-insight-title",children:R.title}),jsxRuntime.jsx("span",{className:"card-detail-ai-insight-severity",children:R.severity})]}),jsxRuntime.jsx("p",{className:"card-detail-ai-insight-desc",children:R.description}),R.suggestedAction&&jsxRuntime.jsxs("div",{className:"card-detail-ai-insight-action",children:["\u{1F4A1} ",R.suggestedAction]})]},R.id))]}),!_.assignees&&!_.subtasks&&!_.effort&&d.length===0&&jsxRuntime.jsxs("div",{className:"card-detail-empty-state",children:[jsxRuntime.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",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("p",{children:"AI Suggestions"}),jsxRuntime.jsx("span",{children:"Click a button above to get AI-powered insights"})]})]})]})]})})})}function vs({triggerRef:e,isOpen:t,onClose:a,children:r,width:n=200,estimatedHeight:s=300,className:o=""}){let[l,d]=react.useState({top:0,left:0}),i=react.useRef(null),u=react.useCallback(()=>{if(!e.current)return {top:0,left:0};let m=e.current.getBoundingClientRect(),p=window.innerHeight,g=window.innerWidth,f=4,x=m.left;x+n>g-10&&(x=g-n-10),x<10&&(x=10);let y=p-m.bottom,b=m.top,h;return y>=s+f?h=m.bottom+f:b>=s+f?h=m.top-s-f:y>=b?h=m.bottom+f:h=Math.max(10,m.top-s-f),{top:h,left:x}},[e,n,s]);return react.useEffect(()=>{t&&d(u());},[t,u]),react.useEffect(()=>{if(!t)return;let m=g=>{let f=g.target;i.current&&!i.current.contains(f)&&e.current&&!e.current.contains(f)&&a();},p=setTimeout(()=>{document.addEventListener("mousedown",m);},0);return ()=>{clearTimeout(p),document.removeEventListener("mousedown",m);}},[t,a,e]),react.useEffect(()=>{if(!t)return;let m=p=>{p.key==="Escape"&&(p.preventDefault(),p.stopPropagation(),a());};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[t,a]),t?jsxRuntime.jsx(Qt,{children:jsxRuntime.jsx("div",{ref:i,className:`smart-popover ${o}`,style:{position:"fixed",top:`${l.top}px`,left:`${l.left}px`,width:`${n}px`,maxHeight:"calc(100vh - 40px)",overflowY:"auto",zIndex:99999,padding:"6px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.3)",animation:"popoverSlideIn 100ms ease-out"},children:r})}):null}var gt={dark:{bgPrimary:"#050505",bgSecondary:"#0A0A0A",bgGrid:"rgba(255, 255, 255, 0.02)",bgWeekend:"rgba(17, 17, 17, 0.4)",border:"rgba(255, 255, 255, 0.08)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"rgba(255, 255, 255, 0.92)",textSecondary:"rgba(255, 255, 255, 0.60)",textTertiary:"rgba(255, 255, 255, 0.35)",accent:"#00E5CC",accentHover:"#5AADFF",accentLight:"rgba(0, 229, 204, 0.12)",taskBarPrimary:"#00E5CC",taskBarProgress:"#5AADFF",taskBarHandle:"#FFFFFF",dependency:"#444444",dependencyHover:"#FFFFFF",criticalPath:"#EF4444",criticalPathLight:"rgba(239, 68, 68, 0.15)",today:"#EF4444",todayLight:"rgba(239, 68, 68, 0.08)",milestone:"#FFFFFF",milestoneLight:"rgba(255, 255, 255, 0.1)",statusTodo:"#666666",statusInProgress:"#00E5CC",statusCompleted:"#10B981",hoverBg:"rgba(255, 255, 255, 0.04)",focusRing:"#00E5CC",dotGrid:"rgba(255, 255, 255, 0.05)",glassHeader:"#0A0A0A",glassToolbar:"rgba(0, 0, 0, 0.4)",forecastHud:"rgba(15, 15, 15, 0.9)",neonRedGlow:"0 0 8px rgba(239, 68, 68, 0.25)",executionBarBg:"rgba(0, 229, 204, 0.12)"},light:{bgPrimary:"#FFFFFF",bgSecondary:"#F8FAFC",bgGrid:"#F1F5F9",bgWeekend:"rgba(0, 196, 174, 0.03)",border:"#CBD5E1",borderLight:"#E2E8F0",textPrimary:"#0F172A",textSecondary:"#334155",textTertiary:"#64748B",accent:"#00E5CC",accentHover:"#1D4ED8",accentLight:"rgba(0, 196, 174, 0.08)",taskBarPrimary:"#00E5CC",taskBarProgress:"#00A893",taskBarHandle:"#FFFFFF",dependency:"#6B7280",dependencyHover:"#00E5CC",criticalPath:"#DC2626",criticalPathLight:"rgba(220, 38, 38, 0.1)",today:"#D21E24",todayLight:"rgba(210, 30, 36, 0.1)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.08)",statusTodo:"#64748B",statusInProgress:"#00E5CC",statusCompleted:"#059669",hoverBg:"rgba(0, 0, 0, 0.04)",focusRing:"#00E5CC",dotGrid:"rgba(0, 0, 0, 0.04)",glassHeader:"#F8FAFC",glassToolbar:"rgba(255, 255, 255, 0.85)",forecastHud:"rgba(248, 250, 252, 0.95)",neonRedGlow:"0 0 10px rgba(220, 38, 38, 0.3)",executionBarBg:"rgba(0, 196, 174, 0.28)"},neutral:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgGrid:"#EFEDEC",bgWeekend:"rgba(41, 37, 36, 0.02)",border:"#D6D3D1",borderLight:"#E7E5E4",textPrimary:"#0C0A09",textSecondary:"#44403C",textTertiary:"#78716C",accent:"#292524",accentHover:"#44403C",accentLight:"rgba(41, 37, 36, 0.08)",taskBarPrimary:"#292524",taskBarProgress:"#1C1917",taskBarHandle:"#FFFFFF",dependency:"#78716C",dependencyHover:"#A8A29E",criticalPath:"#44403C",criticalPathLight:"rgba(68, 64, 60, 0.08)",today:"#1C1917",todayLight:"rgba(28, 25, 23, 0.06)",milestone:"#57534E",milestoneLight:"rgba(87, 83, 78, 0.08)",statusTodo:"#78716C",statusInProgress:"#292524",statusCompleted:"#15803D",hoverBg:"rgba(0, 0, 0, 0.035)",focusRing:"#292524",dotGrid:"rgba(0, 0, 0, 0.03)",glassHeader:"#F5F5F4",glassToolbar:"rgba(250, 250, 249, 0.85)",forecastHud:"rgba(245, 245, 244, 0.95)",neonRedGlow:"0 0 10px rgba(68, 64, 60, 0.3)",executionBarBg:"rgba(41, 37, 36, 0.25)"}};var xy=["LOW","MEDIUM","HIGH","URGENT"],vy=["todo","in-progress","review","done"];function cd({card:e,isOpen:t,onClose:a,onUpdate:r,onDelete:n,availableUsers:s=[],comments:o=[],activities:l=[],onAddComment:d,onDeleteComment:i,currentUser:u,onAIGenerateDescription:m,onAICreateSubtasks:p,onAIFindSimilar:g,availableColumns:f=[],availableLabels:x=[],availableTags:y=[],onCreateTag:b,onUploadCoverImage:h,unsplashAccessKey:v,theme:w,onSubtasksChange:D,attachments:S=[],onUploadAttachments:M,onDeleteAttachment:T}){let F=Dn(),A=w||F?.themeName||"dark",[C,_]=react.useState(e),[W,oe]=react.useState(false),[L,Y]=react.useState(()=>[...e?.subtasks||[]].sort((se,at)=>(se.position??0)-(at.position??0))),[K,V]=react.useState(false),[B,X]=react.useState(""),[Ce,Re]=react.useState(""),[R,ae]=react.useState("all"),[be,Ie]=react.useState(false),[De,Ee]=react.useState(false),[He,rt]=react.useState(false),[pe,We]=react.useState(false),[je,Oe]=react.useState(false),[tt,wt]=react.useState(false),pt=react.useRef(null),Ue=react.useRef(null),ot=react.useRef(null),Et=react.useRef(null),ge=react.useRef(null),ht=react.useRef(null),k=react.useRef(null),O=react.useRef(null),Z=react.useRef(null),ve=react.useRef(null),$=react.useRef(null),re=react.useRef(null);react.useEffect(()=>{if(e&&!C){_({...e});let H=[...e.subtasks||[]].sort((se,at)=>(se.position??0)-(at.position??0));Y(H);}else if(e&&C&&e.id!==C.id){_({...e});let H=[...e.subtasks||[]].sort((se,at)=>(se.position??0)-(at.position??0));Y(H);}},[e,C]),react.useEffect(()=>{let H=se=>{let at=se.target;Et.current&&!Et.current.contains(at)&&Ie(false),ge.current&&!ge.current.contains(at)&&Ee(false),ht.current&&!ht.current.contains(at)&&rt(false),k.current&&!k.current.contains(at)&&We(false);};if(be||De||He||pe)return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[be,De,He,pe]),react.useEffect(()=>{if(!t)return;let H=se=>{let at=se.target,Xt=at.tagName==="INPUT"||at.tagName==="TEXTAREA"||at.isContentEditable;if(se.key==="Escape"){se.preventDefault(),be||De||He||pe||je||tt?(Ie(false),Ee(false),rt(false),We(false),Oe(false),wt(false)):Xt||a();return}if(Xt&&se.key!=="Escape")return;let ee=se.metaKey||se.ctrlKey;switch(se.key.toLowerCase()){case "s":se.preventDefault(),Ie(true);break;case "a":se.preventDefault(),rt(true);break;case "p":se.preventDefault(),Ee(true);break;case "l":se.preventDefault(),We(true);break;case "d":ee||(se.preventDefault(),Oe(true),setTimeout(()=>O.current?.focus(),0));break;case "e":ee||(se.preventDefault(),wt(true));break;case "i":se.preventDefault(),oe(true),setTimeout(()=>Ue.current?.focus(),0);break;case "t":se.preventDefault(),V(true);break;case "c":se.preventDefault(),ot.current?.focus();break}};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[t,a,be,De,He,pe,je,tt]);let Ye=react.useCallback(H=>{let se=H.currentTarget.textContent?.trim()||"";if(C&&se!==C.title){let at={...C,title:se};_(at),r?.(C.id,{title:se});}},[C,r]),Te=react.useCallback(H=>{H.key==="Enter"&&(H.preventDefault(),H.currentTarget.blur()),H.key==="Escape"&&(H.preventDefault(),H.currentTarget.textContent=C?.title||"",H.currentTarget.blur());},[C]),Fe=react.useCallback(()=>{C&&e&&C.description!==e.description&&r?.(C.id,{description:C.description}),oe(false);},[C,e,r]),ze=react.useCallback(H=>{if(C){let se={...C,columnId:H};_(se),r?.(C.id,{columnId:H}),Ie(false);}},[C,r]),Le=react.useCallback(H=>{if(C){let se={...C,priority:H};_(se),r?.(C.id,{priority:H}),Ee(false);}},[C,r]),Ze=react.useCallback(H=>{if(C){let se=C.assignedUserIds||[],at=se.includes(H)?se.filter(ee=>ee!==H):[...se,H],Xt={...C,assignedUserIds:at};_(Xt),r?.(C.id,{assignedUserIds:at});}},[C,r]),st=react.useCallback(H=>{if(C){let se=C.labels||[],at=se.includes(H)?se.filter(ee=>ee!==H):[...se,H],Xt={...C,labels:at};_(Xt),r?.(C.id,{labels:at});}},[C,r]),yt=react.useCallback(H=>{if(C){let se={...C,tags:H};_(se),r?.(C.id,{tags:H});}},[C,r]),xt=react.useCallback(H=>{if(C){let se=H.target.value,at={...C,endDate:se};_(at),r?.(C.id,{endDate:se}),Oe(false);}},[C,r]),$t=react.useCallback(H=>{if(C){let se={...C,estimatedTime:parseFloat(H)||0};_(se),r?.(C.id,{estimatedTime:parseFloat(H)||0});}},[C,r]),ut=react.useCallback(()=>{if(B.trim()&&C){let H={id:`subtask-${Date.now()}`,title:B.trim(),completed:false,position:L.length,createdAt:new Date},se=[...L,H];Y(se),X(""),V(false),D?.(C.id,se);}},[B,L,C,D]),Gt=react.useCallback(H=>{let se=L.map(at=>at.id===H?{...at,completed:!at.completed,updatedAt:new Date}:at);Y(se),C&&D?.(C.id,se);},[L,C,D]),Mt=react.useCallback(H=>{let se=L.filter(at=>at.id!==H);Y(se),C&&D?.(C.id,se);},[L,C,D]),It=react.useCallback(()=>{Ce.trim()&&C&&d&&(d(C.id,Ce.trim()),Re(""));},[Ce,C,d]),Ft=react.useCallback(H=>{(H.metaKey||H.ctrlKey)&&H.key==="Enter"&&(H.preventDefault(),It());},[It]),Ct=H=>jsxRuntime.jsx(by__default.default,{remarkPlugins:[hy__default.default],rehypePlugins:[yy__default.default],components:{a:({node:se,...at})=>jsxRuntime.jsx("a",{...at,target:"_blank",rel:"noopener noreferrer"})},children:H}),St=l.filter(H=>R==="comments"?H.type.includes("COMMENT"):R==="history"?!H.type.includes("COMMENT"):true);if(!t||!e)return null;let ct=C||e,fa=s.filter(H=>ct.assignedUserIds?.includes(H.id)),xa=L.filter(H=>H.completed).length;return jsxRuntime.jsx(Qt,{children:jsxRuntime.jsx("div",{className:"modal-v2-backdrop",onClick:a,style:{position:"fixed",inset:"0",zIndex:9999,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsxs("div",{className:"modal-v2-container",onClick:H=>H.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"modal-title","data-theme":A,children:[jsxRuntime.jsxs("header",{className:"modal-v2-header",children:[jsxRuntime.jsx("h1",{id:"modal-title",ref:pt,className:"modal-v2-title",contentEditable:true,suppressContentEditableWarning:true,onBlur:Ye,onKeyDown:Te,children:ct.title}),jsxRuntime.jsxs("p",{className:"modal-v2-ai-prompt",children:[jsxRuntime.jsx("span",{className:"modal-v2-ai-icon",children:"\u2728"}),"Ask AI to write a description, create subtasks, or find similar tasks"]}),jsxRuntime.jsx("button",{className:"modal-v2-close",onClick:a,"aria-label":"Close",children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntime.jsxs("section",{className:"modal-v2-metadata",children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:Et,children:[jsxRuntime.jsxs("button",{ref:Z,className:"modal-v2-field",onClick:()=>Ie(!be),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",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("path",{d:"M12 6v6l4 2"})]}),jsxRuntime.jsx("span",{children:"Status"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"S"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:ct.columnId||"No status"})]}),jsxRuntime.jsx(vs,{triggerRef:Z,isOpen:be,onClose:()=>Ie(false),width:250,estimatedHeight:200,children:(f.length>0?f:vy.map(H=>({id:H,title:H}))).map(H=>jsxRuntime.jsx("button",{className:`modal-v2-popover-item ${ct.columnId===H.id?"active":""}`,onClick:()=>ze(H.id),children:H.title},H.id))})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:ht,children:[jsxRuntime.jsxs("button",{ref:ve,className:"modal-v2-field",onClick:()=>rt(!He),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxRuntime.jsx("span",{children:"Assignees"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"A"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:fa.length>0?jsxRuntime.jsx("div",{className:"modal-v2-avatars",children:fa.map(H=>jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:H.color},title:H.name,children:H.initials},H.id))}):jsxRuntime.jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),jsxRuntime.jsx(vs,{triggerRef:ve,isOpen:He,onClose:()=>rt(false),width:280,estimatedHeight:300,children:s.map(H=>jsxRuntime.jsxs("button",{className:`modal-v2-popover-item ${ct.assignedUserIds?.includes(H.id)?"active":""}`,onClick:()=>Ze(H.id),children:[jsxRuntime.jsx("div",{className:"modal-v2-avatar-small",style:{background:H.color},children:H.initials}),H.name,ct.assignedUserIds?.includes(H.id)&&jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginLeft:"auto"},children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})]},H.id))})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:ge,children:[jsxRuntime.jsxs("button",{ref:$,className:"modal-v2-field",onClick:()=>Ee(!De),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",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:"Priority"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"P"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:ct.priority||"None"})]}),jsxRuntime.jsxs(vs,{triggerRef:$,isOpen:De,onClose:()=>Ee(false),width:180,estimatedHeight:220,children:[xy.map(H=>jsxRuntime.jsx("button",{className:`modal-v2-popover-item priority-${H.toLowerCase()} ${ct.priority===H?"active":""}`,onClick:()=>Le(H),children:H},H)),jsxRuntime.jsx("button",{className:"modal-v2-popover-item",onClick:()=>Le(""),children:"None"})]})]}),y.length>0||b?jsxRuntime.jsx("div",{className:"modal-v2-field-wrapper",children:jsxRuntime.jsxs("div",{className:"modal-v2-field",style:{cursor:"default"},children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsx("span",{children:"Etiquetas"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:jsxRuntime.jsx(Ro,{selectedTags:ct.tags||[],availableTags:y,onChange:yt,onCreateTag:b,theme:gt[A]||gt.dark})})]})}):jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:k,children:[jsxRuntime.jsxs("button",{ref:re,className:"modal-v2-field",onClick:()=>We(!pe),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsx("span",{children:"Labels"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"L"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:ct.labels&&ct.labels.length>0?jsxRuntime.jsx("span",{children:ct.labels.join(", ")}):jsxRuntime.jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),jsxRuntime.jsx(vs,{triggerRef:re,isOpen:pe,onClose:()=>We(false),width:220,estimatedHeight:200,children:(x.length>0?x:["Bug","Feature","Enhancement","Documentation"]).map(H=>jsxRuntime.jsxs("button",{className:`modal-v2-popover-item ${ct.labels?.includes(H)?"active":""}`,onClick:()=>st(H),children:[H,ct.labels?.includes(H)&&jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginLeft:"auto"},children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})]},H))})]}),jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>{Oe(!je),setTimeout(()=>O.current?.showPicker?.(),0);},children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",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:"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("span",{children:"Due Date"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"D"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:ct.endDate?new Date(ct.endDate).toLocaleDateString():"Not set"}),jsxRuntime.jsx("input",{ref:O,type:"date",value:typeof ct.endDate=="string"?ct.endDate.split("T")[0]:ct.endDate?(()=>{let H=new Date(ct.endDate),se=H.getUTCFullYear(),at=String(H.getUTCMonth()+1).padStart(2,"0"),Xt=String(H.getUTCDate()).padStart(2,"0");return `${se}-${at}-${Xt}`})():"",onChange:xt,style:{position:"absolute",opacity:0,pointerEvents:"none"}})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>wt(!tt),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",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 6 12 12 16 14"})]}),jsxRuntime.jsx("span",{children:"Estimated Time"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"E"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:ct.estimatedTime?`${ct.estimatedTime}h`:"Not set"})]}),tt&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:jsxRuntime.jsx("input",{type:"number",min:"0",step:"0.5",placeholder:"Hours",value:ct.estimatedTime||"",onChange:H=>$t(H.target.value),className:"modal-v2-time-input",autoFocus:true,onBlur:()=>wt(false)})})]})]}),jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),jsxRuntime.jsx("h2",{children:"Description"})]}),W?jsxRuntime.jsx("textarea",{className:"modal-v2-textarea",value:ct.description||"",onChange:H=>{if(C){let se={...C,description:H.target.value};_(se);}},onBlur:Fe,placeholder:"Add a detailed description...",autoFocus:true}):jsxRuntime.jsx("div",{className:"modal-v2-content",onClick:()=>oe(true),children:ct.description?jsxRuntime.jsx("div",{className:"modal-v2-markdown",children:Ct(ct.description)}):jsxRuntime.jsxs("p",{className:"modal-v2-placeholder",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),jsxRuntime.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Add description..."]})})]}),jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M9 11l3 3L22 4"}),jsxRuntime.jsx("path",{d:"M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"})]}),jsxRuntime.jsx("h2",{children:"Subtasks"}),L.length>0&&jsxRuntime.jsxs("span",{className:"modal-v2-count",children:[xa,"/",L.length]}),jsxRuntime.jsxs("button",{className:"modal-v2-add-button",onClick:()=>V(true),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:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Add"]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-subtasks",children:[L.map(H=>jsxRuntime.jsxs("div",{className:`modal-v2-subtask ${H.completed?"completed":""}`,children:[jsxRuntime.jsx("button",{className:"modal-v2-subtask-checkbox",onClick:()=>Gt(H.id),children:H.completed?jsxRuntime.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M9 12l2 2 4-4",stroke:"white",strokeWidth:"2",fill:"none"})]}):jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"})})}),jsxRuntime.jsx("span",{className:"modal-v2-subtask-title",children:H.title}),jsxRuntime.jsx("button",{className:"modal-v2-subtask-delete",onClick:()=>Mt(H.id),children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]})})]},H.id)),K&&jsxRuntime.jsx("div",{className:"modal-v2-subtask-input-row",children:jsxRuntime.jsx("input",{type:"text",placeholder:"Subtask title...",value:B,onChange:H=>X(H.target.value),onKeyDown:H=>{H.key==="Enter"&&ut(),H.key==="Escape"&&(V(false),X(""));},onBlur:ut,autoFocus:true,className:"modal-v2-subtask-input"})})]})]}),(M||S.length>0)&&jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})}),jsxRuntime.jsx("h2",{children:"Attachments"}),S.length>0&&jsxRuntime.jsx("span",{className:"modal-v2-count",children:S.length})]}),jsxRuntime.jsx(uo,{cardId:ct.id,attachments:S,onUpload:M?H=>M(ct.id,H):void 0,onDelete:T,maxSizeMB:10,maxFiles:20})]}),jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),jsxRuntime.jsx("h2",{children:"Activity"}),jsxRuntime.jsxs("div",{className:"modal-v2-filters",children:[jsxRuntime.jsx("button",{className:`modal-v2-filter ${R==="all"?"active":""}`,onClick:()=>ae("all"),children:"All"}),jsxRuntime.jsx("button",{className:`modal-v2-filter ${R==="comments"?"active":""}`,onClick:()=>ae("comments"),children:"Comments"}),jsxRuntime.jsx("button",{className:`modal-v2-filter ${R==="history"?"active":""}`,onClick:()=>ae("history"),children:"History"})]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-input",children:[u&&jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:u.color},children:u.initials}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-wrapper",children:[jsxRuntime.jsx("textarea",{ref:ot,className:"modal-v2-comment-textarea",placeholder:"Write a comment...",value:Ce,onChange:H=>Re(H.target.value),onKeyDown:Ft,rows:1}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-toolbar",children:[jsxRuntime.jsxs("div",{className:"modal-v2-toolbar-left",children:[jsxRuntime.jsx("button",{className:"modal-v2-toolbar-button",title:"Attach file",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})})}),jsxRuntime.jsx("button",{className:"modal-v2-toolbar-button",title:"Mention user",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:"4"}),jsxRuntime.jsx("path",{d:"M16 8v5a3 3 0 006 0v-1a10 10 0 10-3.92 7.94"})]})}),jsxRuntime.jsx("button",{className:"modal-v2-toolbar-button",title:"Add emoji",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("path",{d:"M8 14s1.5 2 4 2 4-2 4-2"}),jsxRuntime.jsx("line",{x1:"9",y1:"9",x2:"9.01",y2:"9"}),jsxRuntime.jsx("line",{x1:"15",y1:"9",x2:"15.01",y2:"9"})]})})]}),jsxRuntime.jsx("button",{className:"modal-v2-send-button",onClick:It,disabled:!Ce.trim(),children:"Send"})]})]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-timeline",children:[St.map(H=>{let se=s.find(Xt=>Xt.id===H.userId);if(H.type.includes("COMMENT")){let Xt=o.find(ee=>ee.id===H.metadata?.commentId);return Xt?jsxRuntime.jsxs("div",{className:"modal-v2-activity-item comment-item",children:[se&&jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:se.color},children:se.initials}),jsxRuntime.jsxs("div",{className:"modal-v2-activity-content",children:[jsxRuntime.jsxs("div",{className:"modal-v2-activity-header",children:[jsxRuntime.jsx("span",{className:"modal-v2-activity-user",children:se?.name||"Unknown"}),jsxRuntime.jsx("span",{className:"modal-v2-activity-time",children:new Date(H.timestamp).toLocaleString()})]}),jsxRuntime.jsx("div",{className:"modal-v2-comment-body",children:Xt.content})]})]},H.id):null}return jsxRuntime.jsxs("div",{className:"modal-v2-activity-item history-item",children:[jsxRuntime.jsxs("div",{className:"modal-v2-history-icon",children:[H.type.includes("CREATED")&&"\u2795",H.type.includes("UPDATED")&&"\u270F\uFE0F",H.type.includes("MOVED")&&"\u27A1\uFE0F",H.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",H.type.includes("ASSIGNED")&&"\u{1F464}",H.type.includes("PRIORITY")&&"\u{1F3AF}",H.type.includes("LABEL")&&"\u{1F3F7}\uFE0F"]}),jsxRuntime.jsxs("div",{className:"modal-v2-activity-content",children:[jsxRuntime.jsxs("div",{className:"modal-v2-history-text",children:[jsxRuntime.jsx("span",{className:"modal-v2-activity-user",children:se?.name||"Unknown"})," ",H.type.replace(/_/g," ").toLowerCase(),H.newValue&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" to ",jsxRuntime.jsx("strong",{children:H.newValue})]})]}),jsxRuntime.jsx("span",{className:"modal-v2-activity-time",children:new Date(H.timestamp).toLocaleString()})]})]},H.id)}),St.length===0&&jsxRuntime.jsxs("div",{className:"modal-v2-empty",children:[jsxRuntime.jsx("p",{children:"No activity yet"}),jsxRuntime.jsx("span",{children:"Activity will appear here"})]})]})]})]})})})}function My({active:e,payload:t}){return !e||!t||!t.length?null:jsxRuntime.jsxs("div",{className:"chart-tooltip",children:[jsxRuntime.jsx("p",{className:"chart-tooltip-label",children:t[0].payload.period}),t.map((a,r)=>jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:a.color},children:[a.name,": ",jsxRuntime.jsx("strong",{children:a.value})," cards"]},r))]})}function pd({data:e,title:t="Team Velocity",height:a=300,showAverage:r=true,showPlanned:n=true}){let s=e.map(o=>({...o,average:o.average??e.reduce((l,d)=>l+d.completed,0)/e.length}));return jsxRuntime.jsxs("div",{className:"chart-container",children:[t&&jsxRuntime.jsx("h3",{className:"chart-title",children:t}),jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:a,children:jsxRuntime.jsxs(recharts.LineChart,{data:s,margin:{top:5,right:30,left:20,bottom:5},children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"period",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(My,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"completed",stroke:"#10B981",strokeWidth:3,name:"Completed",dot:{fill:"#10B981",r:5},activeDot:{r:7}}),n&&jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"planned",stroke:"#00E5CC",strokeWidth:2,strokeDasharray:"5 5",name:"Planned",dot:{fill:"#00E5CC",r:4}}),r&&jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"average",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"3 3",name:"Average",dot:false})]})}),jsxRuntime.jsxs("div",{className:"chart-stats",children:[jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Total Completed"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#10B981"},children:e.reduce((o,l)=>o+l.completed,0)})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Average Velocity"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#F59E0B"},children:(e.reduce((o,l)=>o+l.completed,0)/e.length).toFixed(1)})]}),n&&e.some(o=>o.planned)&&jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Total Planned"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#00E5CC"},children:e.reduce((o,l)=>o+(l.planned||0),0)})]})]})]})}function $y({active:e,payload:t}){return !e||!t||!t.length?null:jsxRuntime.jsxs("div",{className:"chart-tooltip",children:[jsxRuntime.jsx("p",{className:"chart-tooltip-label",children:t[0].payload.day}),t.map((a,r)=>jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:a.color},children:[a.name,": ",jsxRuntime.jsx("strong",{children:a.value})," tasks"]},r))]})}function md({data:e,title:t="Sprint Burndown",height:a=300,totalTasks:r,useArea:n=false}){let s=r??(e[0]?.ideal||e[0]?.remaining||0),o=e[e.length-1]?.remaining||0,l=e[e.length-1]?.ideal||0,d=s>0?(s-o)/s*100:0,i=o<=l;return jsxRuntime.jsxs("div",{className:"chart-container",children:[t&&jsxRuntime.jsx("h3",{className:"chart-title",children:t}),jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:a,children:jsxRuntime.jsxs(n?recharts.AreaChart:recharts.LineChart,{data:e,margin:{top:5,right:30,left:20,bottom:5},children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"day",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx($y,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(recharts.Area,{type:"monotone",dataKey:"ideal",stroke:"#F59E0B",fill:"rgba(245, 158, 11, 0.2)",strokeWidth:2,strokeDasharray:"5 5",name:"Ideal"}),jsxRuntime.jsx(recharts.Area,{type:"monotone",dataKey:"remaining",stroke:i?"#10B981":"#EF4444",fill:i?"rgba(16, 185, 129, 0.2)":"rgba(239, 68, 68, 0.2)",strokeWidth:3,name:"Remaining"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(recharts.Line,{type:"linear",dataKey:"ideal",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",name:"Ideal",dot:{fill:"#F59E0B",r:4}}),jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"remaining",stroke:i?"#10B981":"#EF4444",strokeWidth:3,name:"Remaining",dot:{fill:i?"#10B981":"#EF4444",r:5},activeDot:{r:7}})]})]})}),jsxRuntime.jsxs("div",{className:"chart-stats",children:[jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Progress"}),jsxRuntime.jsxs("span",{className:"chart-stat-value",style:{color:d>=50?"#10B981":"#F59E0B"},children:[d.toFixed(0),"%"]})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Remaining"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:i?"#10B981":"#EF4444"},children:o})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Status"}),jsxRuntime.jsx("span",{className:"chart-stat-badge",style:{background:i?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:i?"#10B981":"#EF4444"},children:i?"\u2713 On Track":"\u26A0 Behind"})]})]})]})}var Ky={URGENT:"#EF4444",HIGH:"#F59E0B",MEDIUM:"#00E5CC",LOW:"#10B981"},Wp=["#00E5CC","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899"];function qy({cx:e,cy:t,midAngle:a,innerRadius:r,outerRadius:n,percent:s}){let o=r+(n-r)*.5,l=e+o*Math.cos(-a*(Math.PI/180)),d=t+o*Math.sin(-a*(Math.PI/180));return s<.05?null:jsxRuntime.jsx("text",{x:l,y:d,fill:"white",textAnchor:l>e?"start":"end",dominantBaseline:"central",style:{fontSize:"12px",fontWeight:600},children:`${(s*100).toFixed(0)}%`})}function Vp({active:e,payload:t}){if(!e||!t||!t.length)return null;let a=t[0].payload,r=t[0].payload.totalValue||0,n=r>0?(a.value/r*100).toFixed(1):"0";return jsxRuntime.jsxs("div",{className:"chart-tooltip",children:[jsxRuntime.jsx("p",{className:"chart-tooltip-label",children:a.name}),jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:a.color||t[0].color},children:["Count: ",jsxRuntime.jsx("strong",{children:a.value})]}),jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:"rgba(255, 255, 255, 0.7)"},children:["Percentage: ",jsxRuntime.jsxs("strong",{children:[n,"%"]})]})]})}function gd({data:e,title:t="Distribution",type:a="pie",height:r=300,showPercentages:n=true}){let s=e.reduce((d,i)=>d+i.value,0),o=e.map(d=>({...d,totalValue:s,color:d.color||Ky[d.name]||Wp[e.indexOf(d)%Wp.length]})),l=o.map(d=>d.color);return jsxRuntime.jsxs("div",{className:"chart-container",children:[t&&jsxRuntime.jsx("h3",{className:"chart-title",children:t}),jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:r,children:a==="pie"?jsxRuntime.jsxs(recharts.PieChart,{children:[jsxRuntime.jsx(recharts.Pie,{data:o,cx:"50%",cy:"50%",labelLine:false,label:n?qy:false,outerRadius:r*.35,fill:"#8884d8",dataKey:"value",children:o.map((d,i)=>jsxRuntime.jsx(recharts.Cell,{fill:l[i]},`cell-${i}`))}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(Vp,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"},formatter:(d,i)=>{let u=i.payload,m=s>0?(u.value/s*100).toFixed(0):"0";return `${d} (${u.value} - ${m}%)`}})]}):jsxRuntime.jsxs(recharts.BarChart,{data:o,margin:{top:5,right:30,left:20,bottom:5},children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"name",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(Vp,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),jsxRuntime.jsx(recharts.Bar,{dataKey:"value",name:"Count",radius:[8,8,0,0],children:o.map((d,i)=>jsxRuntime.jsx(recharts.Cell,{fill:l[i]},`cell-${i}`))})]})}),jsxRuntime.jsxs("div",{className:"chart-stats",children:[jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Total Cards"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#00E5CC"},children:s})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Categories"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#10B981"},children:e.length})]}),e.length>0&&jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Largest Category"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#F59E0B"},children:e.reduce((d,i)=>i.value>d.value?i:d).name})]})]})]})}var Ti=react.memo(({selectedCards:e,availableUsers:t=[],onClearSelection:a,callbacks:r,columns:n=[],availableLabels:s=[]})=>{let[o,l]=react.useState(false),[d,i]=react.useState(false),[u,m]=react.useState(false),[p,g]=react.useState(false);if(e.length===0)return null;let f=e.map(w=>w.id),x=w=>{r.onBulkUpdate?.(f,{priority:w}),l(false);},y=w=>{r.onBulkMove?.(f,w),i(false),a();},b=w=>{r.onBulkUpdate?.(f,{assignedUserIds:w}),m(false);},h=w=>{let D=new Set;e.forEach(M=>{M.labels?.forEach(T=>D.add(T));});let S=Array.from(new Set([...D,...w]));r.onBulkUpdate?.(f,{labels:S}),g(false);},v=()=>{confirm(`Delete ${e.length} card(s)? This cannot be undone.`)&&(r.onBulkDelete?.(f),a());};return jsxRuntime.jsx("div",{className:"asakaa-bulk-toolbar",children:jsxRuntime.jsxs("div",{className:"asakaa-bulk-toolbar-content",children:[jsxRuntime.jsxs("div",{className:"asakaa-bulk-toolbar-count",children:[e.length," card",e.length!==1?"s":""," selected"]}),jsxRuntime.jsxs("div",{className:"asakaa-bulk-toolbar-actions",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>l(!o),title:"Update priority",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Priority"})}),o&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:["LOW","MEDIUM","HIGH","URGENT"].map(w=>jsxRuntime.jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>x(w),children:[jsxRuntime.jsx("span",{className:c("asakaa-priority-dot",w==="LOW"&&"bg-asakaa-priority-low",w==="MEDIUM"&&"bg-asakaa-priority-medium",w==="HIGH"&&"bg-asakaa-priority-high",w==="URGENT"&&"bg-asakaa-priority-urgent")}),w]},w))})]}),n.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>i(!d),title:"Move to column",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Move"})}),d&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:n.map(w=>jsxRuntime.jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>y(w.id),children:w.title},w.id))})]}),t.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>m(!u),title:"Assign users",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Assign"})}),u&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:t.map(w=>jsxRuntime.jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>b([w.id]),children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-xs font-medium",style:{backgroundColor:w.color},children:w.initials}),w.name]},w.id))})]}),s.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>g(!p),title:"Add labels",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Labels"})}),p&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:s.map(w=>jsxRuntime.jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>h([w]),children:w},w))})]}),jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button asakaa-bulk-toolbar-button-danger",onClick:v,title:"Delete selected cards",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Delete"})}),jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:a,title:"Clear selection",children:jsxRuntime.jsx("span",{className:"text-sm",children:"\u2715"})})]})]})})});Ti.displayName="BulkOperationsToolbar";function Zy(e,t,a){if(t==="none")return [];let r=new Map;return e.forEach(n=>{let s,o,l,d,i;switch(t){case "assignee":let u=n.assignedUserIds||(n.assigneeId?[n.assigneeId]:[]);u.length>0?u.forEach(g=>{let f=a?.find(x=>x.id===g);o=`assignee-${g}`,l=f?.name||`User ${g}`,d=f?.color,i=f?.avatar,r.has(o)||r.set(o,{id:o,title:l,groupValue:g,cardIds:[],color:d,icon:i}),r.get(o).cardIds.push(n.id);}):(o="assignee-unassigned",l="Unassigned",d="#6b7280",i="\u{1F464}",r.has(o)||r.set(o,{id:o,title:l,groupValue:null,cardIds:[],color:d,icon:i}),r.get(o).cardIds.push(n.id));break;case "priority":s=n.priority||"NONE",o=`priority-${s}`;let p={URGENT:{title:"\u{1F534} Urgent",color:"#ef4444"},HIGH:{title:"\u{1F7E0} High",color:"#f97316"},MEDIUM:{title:"\u{1F7E1} Medium",color:"#eab308"},LOW:{title:"\u{1F7E2} Low",color:"#22c55e"},NONE:{title:"\u26AA No Priority",color:"#6b7280"}}[s];l=p.title,d=p.color,r.has(o)||r.set(o,{id:o,title:l,groupValue:s,cardIds:[],color:d}),r.get(o).cardIds.push(n.id);break;case "label":n.labels&&n.labels.length>0?n.labels.forEach(g=>{o=`label-${g}`,l=g,d="#6b7280",r.has(o)||r.set(o,{id:o,title:l,groupValue:g,cardIds:[],color:d}),r.get(o).cardIds.push(n.id);}):(o="label-none",l="No Labels",d="#6b7280",r.has(o)||r.set(o,{id:o,title:l,groupValue:null,cardIds:[],color:d}),r.get(o).cardIds.push(n.id));break}}),Array.from(r.values()).sort((n,s)=>n.title.localeCompare(s.title))}function fd({board:e,swimlaneConfig:t,availableUsers:a,callbacks:r,className:n}){let[s,o]=react.useState(new Set),l=react.useMemo(()=>Zy(e.cards,t.groupBy,a),[e.cards,t.groupBy,a]),d=react.useCallback(i=>{o(u=>{let m=new Set(u);return m.has(i)?m.delete(i):m.add(i),m});},[]);return t.groupBy==="none"||l.length===0?jsxRuntime.jsx(Ho,{board:e,callbacks:r,availableUsers:a,className:n}):jsxRuntime.jsxs("div",{className:c("asakaa-swimlane-view",n),children:[l.map(i=>{let u=s.has(i.id),m=e.cards.filter(g=>i.cardIds.includes(g.id)),p={...e,cards:m};return jsxRuntime.jsxs("div",{className:"asakaa-swimlane mb-6 rounded-lg border border-white/10 overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"asakaa-swimlane-header px-4 py-3 bg-white/5 backdrop-blur-sm flex items-center justify-between cursor-pointer hover:bg-white/10 transition-colors",onClick:()=>t.collapsible&&d(i.id),style:{borderLeft:i.color?`4px solid ${i.color}`:void 0},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[i.icon&&jsxRuntime.jsx("span",{className:"text-2xl leading-none",children:i.icon}),jsxRuntime.jsx("h3",{className:"text-lg font-semibold",style:{color:i.color},children:i.title}),jsxRuntime.jsxs("span",{className:"text-sm text-white/50 font-medium",children:["(",i.cardIds.length," ",i.cardIds.length===1?"card":"cards",")"]})]}),t.collapsible&&jsxRuntime.jsx("button",{className:"text-white/50 hover:text-white transition-colors","aria-label":u?"Expand lane":"Collapse lane",children:u?"\u25B6":"\u25BC"})]}),!u&&jsxRuntime.jsx("div",{className:"asakaa-swimlane-content p-4",children:jsxRuntime.jsx(Ho,{board:p,callbacks:r,availableUsers:a})})]},i.id)}),l.length===0&&jsxRuntime.jsxs("div",{className:"text-center py-12 text-white/50",children:[jsxRuntime.jsx("p",{className:"text-lg",children:"No cards to display"}),jsxRuntime.jsx("p",{className:"text-sm mt-2",children:"Cards will appear here when they match the grouping criteria"})]})]})}var bd=[{value:"none",label:"No Grouping",icon:"\u{1F4CB}",description:"Standard Kanban board view"},{value:"assignee",label:"By Assignee",icon:"\u{1F465}",description:"Group cards by assigned user"},{value:"priority",label:"By Priority",icon:"\u{1F3AF}",description:"Group cards by priority level"},{value:"label",label:"By Label",icon:"\u{1F3F7}\uFE0F",description:"Group cards by label/tag"}];function hd({value:e,onChange:t,className:a}){let[r,n]=react.useState(false),s=react.useRef(null),o=react.useRef(null),l=bd.find(i=>i.value===e)||bd[0];react.useEffect(()=>{function i(u){s.current&&!s.current.contains(u.target)&&o.current&&!o.current.contains(u.target)&&n(false);}if(r)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[r]);let d=i=>{t(i),n(false);};return jsxRuntime.jsxs("div",{className:c("relative inline-block",a),children:[jsxRuntime.jsxs("button",{ref:o,onClick:()=>n(!r),className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-white/10 hover:bg-white/15 border border-white/20 transition-all text-sm font-medium text-white/90",children:[jsxRuntime.jsx("span",{className:"text-base leading-none",children:l.icon}),jsxRuntime.jsx("span",{children:l.label}),jsxRuntime.jsx("svg",{className:c("w-4 h-4 transition-transform",r&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsxRuntime.jsxs("div",{ref:s,className:"absolute top-full left-0 mt-2 min-w-[280px] rounded-lg bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl border border-white/20 shadow-2xl z-50 overflow-hidden",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b border-white/10",children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold text-white/70 uppercase tracking-wider",children:"Group By"})}),jsxRuntime.jsx("div",{className:"py-1",children:bd.map(i=>jsxRuntime.jsxs("button",{onClick:()=>d(i.value),className:c("w-full px-3 py-2 flex items-start gap-3 text-left transition-all hover:bg-white/10",e===i.value&&"bg-white/5"),children:[jsxRuntime.jsx("span",{className:"text-xl leading-none mt-0.5",children:i.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"font-semibold text-sm text-white",children:i.label}),e===i.value&&jsxRuntime.jsx("span",{className:"text-[#00E5CC] text-xs",children:"\u2713"})]}),jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-0.5",children:i.description})]})]},i.value))})]})]})}var ws=[{keys:"ArrowUp",action:"navigate_up",description:"Navigate to card above"},{keys:"ArrowDown",action:"navigate_down",description:"Navigate to card below"},{keys:"ArrowLeft",action:"navigate_left",description:"Navigate to previous column"},{keys:"ArrowRight",action:"navigate_right",description:"Navigate to next column"},{keys:"Enter",action:"open_card",description:"Open selected card"},{keys:"Escape",action:"close_modal",description:"Close modal or dialog"},{keys:"Delete",action:"delete_card",description:"Delete selected card",modifiers:{shift:true}},{keys:"n",action:"new_card",description:"Create new card",modifiers:{ctrl:true}},{keys:"k",action:"search",description:"Open search/command palette",modifiers:{ctrl:true}},{keys:"s",action:"save",description:"Save changes",modifiers:{ctrl:true}},{keys:"z",action:"undo",description:"Undo last action",modifiers:{ctrl:true}},{keys:"y",action:"redo",description:"Redo last undone action",modifiers:{ctrl:true}},{keys:"a",action:"select_all",description:"Select all cards",modifiers:{ctrl:true}},{keys:"Escape",action:"deselect_all",description:"Deselect all cards"},{keys:"?",action:"show_shortcuts",description:"Show keyboard shortcuts help",modifiers:{shift:true}}];function ax(e,t){if(!(Array.isArray(t.keys)?t.keys:[t.keys]).some(i=>e.key===i||e.code===i))return false;let n=t.modifiers||{},s=n.ctrl?e.ctrlKey||e.metaKey:!e.ctrlKey&&!e.metaKey,o=n.shift?e.shiftKey:!e.shiftKey,l=n.alt?e.altKey:!e.altKey,d=n.meta?e.metaKey:true;return s&&o&&l&&d}function qp(e={}){let{shortcuts:t=ws,enabled:a=true,preventDefault:r=true}=e,n=react.useRef(t),s=react.useRef(a);react.useEffect(()=>{n.current=t,s.current=a;},[t,a]);let o=react.useCallback(d=>{n.current=[...n.current,d];},[]),l=react.useCallback(d=>{n.current=n.current.filter(i=>i.action!==d);},[]);return react.useEffect(()=>{function d(i){if(!s.current)return;let u=i.target;if(!((u.tagName==="INPUT"||u.tagName==="TEXTAREA"||u.isContentEditable)&&i.key!=="Escape"&&!i.ctrlKey&&!i.metaKey)){for(let m of n.current)if(ax(i,m)){r&&i.preventDefault();let p=new CustomEvent("keyboard-action",{detail:m.action,bubbles:true,cancelable:true});window.dispatchEvent(p);break}}}return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[r]),{registerShortcut:o,unregisterShortcut:l,isEnabled:a}}function ox(e){return {ArrowUp:"\u2191",ArrowDown:"\u2193",ArrowLeft:"\u2190",ArrowRight:"\u2192",Enter:"\u21B5",Escape:"Esc",Delete:"Del"," ":"Space"}[e]||e.toUpperCase()}function nx(e){let t=[],a=typeof navigator<"u"&&navigator.platform.includes("Mac");return e.modifiers?.ctrl&&t.push(a?"\u2318":"Ctrl"),e.modifiers?.shift&&t.push("Shift"),e.modifiers?.alt&&t.push(a?"\u2325":"Alt"),e.modifiers?.meta&&t.push("\u2318"),t.join(" + ")}function sx(e){let t=Array.isArray(e.keys)?e.keys[0]:e.keys,a=nx(e),r=t?ox(t):"";return a?`${a} + ${r}`:r}function ix(e){let t={Navigation:[],Actions:[],Editing:[],Selection:[]};return e.forEach(a=>{a.action.includes("navigate")?t.Navigation?.push(a):a.action.includes("select")?t.Selection?.push(a):["undo","redo","save"].includes(a.action)?t.Editing?.push(a):t.Actions?.push(a);}),t}function yd({shortcuts:e=ws,isOpen:t,onClose:a,className:r}){let[n,s]=react.useState(false);if(react.useEffect(()=>{s(true);},[]),react.useEffect(()=>{function l(d){d.key==="Escape"&&t&&a();}if(t)return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,a]),!n||!t)return null;let o=ix(e);return jsxRuntime.jsxs("div",{className:c("fixed inset-0 z-[9999] flex items-center justify-center",r),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 backdrop-blur-sm bg-black/40 dark:bg-black/60",onClick:a}),jsxRuntime.jsxs("div",{className:"relative backdrop-blur-xl rounded-2xl border shadow-2xl max-w-3xl w-full mx-4 max-h-[80vh] overflow-hidden bg-white dark:bg-gradient-to-br dark:from-gray-900/95 dark:to-gray-800/95 border-gray-200 dark:border-white/20",children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b flex items-center justify-between border-gray-200 dark:border-white/10",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-2xl font-bold flex items-center gap-3 text-gray-900 dark:text-white",children:[jsxRuntime.jsx("span",{className:"text-3xl",children:"\u2328\uFE0F"}),"Keyboard Shortcuts"]}),jsxRuntime.jsx("p",{className:"text-sm mt-1 text-gray-500 dark:text-white/60",children:"Speed up your workflow with these shortcuts"})]}),jsxRuntime.jsx("button",{onClick:a,className:"transition-colors text-2xl leading-none p-2 rounded-lg text-gray-400 hover:text-gray-600 hover:bg-gray-100 dark:text-white/50 dark:hover:text-white dark:hover:bg-white/10","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"px-6 py-6 overflow-y-auto max-h-[calc(80vh-120px)]",children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:Object.entries(o).map(([l,d])=>d.length===0?null:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center gap-2 text-gray-800 dark:text-white/90",children:[jsxRuntime.jsx("span",{className:"w-1 h-5 bg-[#00E5CC] rounded-full"}),l]}),jsxRuntime.jsx("div",{className:"space-y-3",children:d.map(i=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-4 p-3 rounded-lg transition-colors bg-gray-50 hover:bg-gray-100 dark:bg-white/5 dark:hover:bg-white/10",children:[jsxRuntime.jsx("span",{className:"text-sm text-gray-700 dark:text-white/80",children:i.description}),jsxRuntime.jsx("kbd",{className:"px-3 py-1.5 border rounded-md text-xs font-mono shadow-sm whitespace-nowrap bg-white border-gray-300 text-gray-800 dark:bg-gradient-to-br dark:from-gray-700 dark:to-gray-800 dark:border-white/20 dark:text-white/90",children:sx(i)})]},i.action))})]},l))})}),jsxRuntime.jsx("div",{className:"px-6 py-4 border-t border-gray-200 bg-gray-50 dark:border-white/10 dark:bg-white/5",children:jsxRuntime.jsxs("p",{className:"text-xs text-center text-gray-500 dark:text-white/50",children:["Press ",jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded bg-gray-200 text-gray-600 dark:bg-white/10 dark:text-white/70",children:"?"})," to toggle this help panel"]})})]})]})}var xd=[{id:"bug-report",name:"Bug Report",description:"Report a bug or issue",icon:"\u{1F41B}",category:"Development",template:{title:"[BUG] ",description:`**Steps to reproduce:**
|
|
85
|
+
`,g.onmouseenter=()=>{g.style.opacity="1";},g.onmouseleave=()=>{g.style.opacity="0.5";},g.onclick=f=>{f.stopPropagation();let x=r<a.length-1?r+1:0;i(),n(x);},o.appendChild(m),o.appendChild(p),o.appendChild(g);}o.appendChild(l),o.appendChild(d),document.body.appendChild(o),setTimeout(()=>{d.style.transition="opacity 0.5s ease",d.style.opacity="0";},2e3);}function cy(e){if(e===0)return "0 Bytes";let t=1024,a=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/Math.pow(t,r)*100)/100+" "+a[r]}function uy(e){return e.startsWith("image/")?"\u{1F5BC}\uFE0F":e.startsWith("video/")?"\u{1F3A5}":e.startsWith("audio/")?"\u{1F3B5}":e.includes("pdf")?"\u{1F4C4}":e.includes("word")||e.includes("document")?"\u{1F4DD}":e.includes("sheet")||e.includes("excel")?"\u{1F4CA}":e.includes("presentation")||e.includes("powerpoint")?"\u{1F4FD}\uFE0F":e.includes("zip")||e.includes("rar")||e.includes("compressed")?"\u{1F5DC}\uFE0F":e.includes("text")?"\u{1F4C3}":"\u{1F4CE}"}function sd(e){return e.startsWith("image/")}function uo({attachments:e=[],onUpload:t,onDelete:a,maxSizeMB:r=10,allowedTypes:n,maxFiles:s=10}){let[o,l]=react.useState(false),[d,i]=react.useState(false),[u,m]=react.useState(null),p=react.useRef(null),g=react.useRef(e);g.current=e;let f=react.useCallback((T,F)=>{F.preventDefault(),F.stopPropagation();let A=g.current.filter(W=>sd(W.type)),C=A.findIndex(W=>W.id===T.id),_=W=>{let oe=g.current.filter(Y=>sd(Y.type)),L=oe[W];L&&Lp(L.url,L.name,oe,W,_);};Lp(T.url,T.name,A,C,_);},[]),x=react.useCallback(T=>{let F=[],A=[];return e.length+T.length>s?(A.push(`Maximum ${s} files allowed`),{valid:F,errors:A}):(T.forEach(C=>{if(C.size/1048576>r){A.push(`${C.name} is too large (max ${r}MB)`);return}if(n&&!n.some(W=>C.type.match(W))){A.push(`${C.name} has invalid file type`);return}F.push(C);}),{valid:F,errors:A})},[e.length,s,r,n]),y=react.useCallback(async T=>{let{valid:F,errors:A}=x(T);if(A.length>0){m(A.join(", ")),setTimeout(()=>m(null),5e3);return}if(F.length!==0){i(true),m(null);try{await t?.(F);}catch(C){m(C instanceof Error?C.message:"Upload failed"),setTimeout(()=>m(null),5e3);}finally{i(false);}}},[x,t]),b=react.useCallback(T=>{T.preventDefault(),T.stopPropagation(),l(true);},[]),h=react.useCallback(T=>{T.preventDefault(),T.stopPropagation(),l(false);},[]),v=react.useCallback(T=>{T.preventDefault(),T.stopPropagation();},[]),w=react.useCallback(T=>{T.preventDefault(),T.stopPropagation(),l(false);let F=Array.from(T.dataTransfer.files);y(F);},[y]),D=react.useCallback(T=>{let F=T.target.files?Array.from(T.target.files):[];y(F),p.current&&(p.current.value="");},[y]),S=react.useCallback(()=>{p.current?.click();},[]),M=react.useCallback(T=>{confirm("Are you sure you want to delete this attachment?")&&a?.(T);},[a]);return jsxRuntime.jsxs("div",{className:"attachment-uploader",children:[jsxRuntime.jsxs("div",{className:`attachment-dropzone ${o?"dragging":""} ${d?"uploading":""}`,onDragEnter:b,onDragLeave:h,onDragOver:v,onDrop:w,onClick:S,children:[jsxRuntime.jsx("input",{ref:p,type:"file",multiple:true,onChange:D,style:{display:"none"},accept:n?.join(",")}),jsxRuntime.jsx("div",{className:"attachment-dropzone-content",children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"attachment-spinner"}),jsxRuntime.jsx("p",{className:"attachment-dropzone-text",children:"Uploading..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"attachment-dropzone-icon",children:[jsxRuntime.jsx("path",{d:"M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M17 8L12 3L7 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M12 3V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntime.jsx("p",{className:"attachment-dropzone-text",children:o?"Drop files here":"Drag & drop files here"}),jsxRuntime.jsx("p",{className:"attachment-dropzone-subtext",children:"or click to browse"}),jsxRuntime.jsxs("p",{className:"attachment-dropzone-info",children:["Max ",r,"MB \u2022 ",e.length,"/",s," files"]})]})})]}),u&&jsxRuntime.jsxs("div",{className:"attachment-error",children:[jsxRuntime.jsx("span",{className:"attachment-error-icon",children:"\u26A0\uFE0F"}),jsxRuntime.jsx("span",{className:"attachment-error-text",children:u})]}),e.length>0&&jsxRuntime.jsx("div",{className:"attachment-list",children:e.map(T=>jsxRuntime.jsxs("div",{className:"attachment-item",children:[jsxRuntime.jsx("div",{className:"attachment-preview",children:sd(T.type)&&T.url?jsxRuntime.jsxs("button",{type:"button",className:"attachment-thumbnail-btn",onClick:F=>f(T,F),title:"Click to view full size",children:[jsxRuntime.jsx("img",{src:T.thumbnailUrl||T.url,alt:T.name,className:"attachment-thumbnail"}),jsxRuntime.jsx("div",{className:"attachment-thumbnail-overlay",children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M15 3H21V9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M9 21H3V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M21 3L14 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M3 21L10 14",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]}):jsxRuntime.jsx("div",{className:"attachment-icon",children:uy(T.type)})}),jsxRuntime.jsxs("div",{className:"attachment-info",children:[jsxRuntime.jsx("a",{href:T.url,target:"_blank",rel:"noopener noreferrer",className:"attachment-name",title:T.name,children:T.name}),jsxRuntime.jsxs("div",{className:"attachment-meta",children:[jsxRuntime.jsx("span",{className:"attachment-size",children:cy(T.size)}),jsxRuntime.jsx("span",{className:"attachment-separator",children:"\u2022"}),jsxRuntime.jsx("span",{className:"attachment-date",children:new Date(T.uploadedAt).toLocaleDateString()})]})]}),jsxRuntime.jsx("button",{onClick:()=>M(T.id),className:"attachment-delete",title:"Delete attachment",type:"button",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},T.id))})]})}function id({card:e,isOpen:t,onClose:a,onUpdate:r,onDelete:n,availableUsers:s=[],comments:o=[],activities:l=[],aiInsights:d=[],attachments:i=[],onAddComment:u,onDeleteComment:m,onUploadAttachments:p,onDeleteAttachment:g,onSuggestAssignee:f,onGenerateSubtasks:x,onEstimateEffort:y,currentUserId:b="user-1"}){let[h,v]=react.useState("details"),[w,D]=react.useState(false),[S,M]=react.useState({}),[T,F]=react.useState(""),[A,C]=react.useState(false),[_,W]=react.useState({});if(!t||!e)return null;let oe=react.useCallback(()=>{D(false),M({}),v("details"),F(""),W({}),a();},[a]),L=react.useCallback(()=>{r&&Object.keys(S).length>0&&(r(e.id,S),M({}),D(false));},[e.id,S,r]),Y=react.useCallback(()=>{n&&window.confirm("Are you sure you want to delete this card?")&&(n(e.id),oe());},[e.id,n,oe]),K=react.useCallback(()=>{u&&T.trim()&&(u(e.id,T.trim()),F(""));},[e.id,T,u]),V=react.useCallback(async()=>{if(f){C(true);try{let R=await f(e);W(ae=>({...ae,assignees:R}));}catch(R){console.error("Failed to suggest assignee:",R);}finally{C(false);}}},[e,f]),B=react.useCallback(async()=>{if(x){C(true);try{let R=await x(e);W(ae=>({...ae,subtasks:R}));}catch(R){console.error("Failed to generate subtasks:",R);}finally{C(false);}}},[e,x]),X=react.useCallback(async()=>{if(y){C(true);try{let R=await y(e);W(ae=>({...ae,effort:R}));}catch(R){console.error("Failed to estimate effort:",R);}finally{C(false);}}},[e,y]),Ce={...e,...S},Re=s.filter(R=>Ce.assignedUserIds?.includes(R.id));return jsxRuntime.jsx(Qt,{children:jsxRuntime.jsx("div",{className:"card-detail-overlay",onClick:oe,children:jsxRuntime.jsxs("div",{className:"card-detail-modal",onClick:R=>R.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"card-detail-header",children:[jsxRuntime.jsxs("div",{className:"card-detail-header-left",children:[jsxRuntime.jsx("div",{className:"card-detail-priority-dot",style:{background:Ce.priority==="URGENT"?"#EF4444":Ce.priority==="HIGH"?"#F59E0B":Ce.priority==="MEDIUM"?"#00E5CC":"#6B7280"}}),w?jsxRuntime.jsx("input",{type:"text",value:S.title??Ce.title,onChange:R=>M({...S,title:R.target.value}),className:"card-detail-title-input",placeholder:"Card title"}):jsxRuntime.jsx("h2",{className:"card-detail-title",children:Ce.title})]}),jsxRuntime.jsxs("div",{className:"card-detail-header-actions",children:[w?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{onClick:L,className:"card-detail-btn card-detail-btn-primary",children:"Save"}),jsxRuntime.jsx("button",{onClick:()=>{D(false),M({});},className:"card-detail-btn",children:"Cancel"})]}):jsxRuntime.jsxs("button",{onClick:()=>D(true),className:"card-detail-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),jsxRuntime.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Edit"]}),jsxRuntime.jsxs("button",{onClick:Y,className:"card-detail-btn card-detail-btn-danger",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]}),"Delete"]}),jsxRuntime.jsx("button",{onClick:oe,className:"card-detail-btn-close",children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-tabs",children:[jsxRuntime.jsxs("button",{onClick:()=>v("details"),className:`card-detail-tab ${h==="details"?"active":""}`,children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Details"]}),jsxRuntime.jsxs("button",{onClick:()=>v("comments"),className:`card-detail-tab ${h==="comments"?"active":""}`,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),"Comments",o.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:o.length})]}),jsxRuntime.jsxs("button",{onClick:()=>v("activity"),className:`card-detail-tab ${h==="activity"?"active":""}`,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),"Activity",l.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:l.length})]}),jsxRuntime.jsxs("button",{onClick:()=>v("attachments"),className:`card-detail-tab ${h==="attachments"?"active":""}`,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})}),"Attachments",i.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:i.length})]}),jsxRuntime.jsxs("button",{onClick:()=>v("ai"),className:`card-detail-tab ${h==="ai"?"active":""}`,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"})]}),"AI Insights",jsxRuntime.jsx("span",{className:"card-detail-tab-badge card-detail-tab-badge-ai",children:"AI"})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-content",children:[h==="details"&&jsxRuntime.jsxs("div",{className:"card-detail-details",children:[jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Description"}),w?jsxRuntime.jsx("textarea",{value:S.description??Ce.description??"",onChange:R=>M({...S,description:R.target.value}),className:"card-detail-textarea",placeholder:"Add a description...",rows:4}):jsxRuntime.jsx("p",{className:"card-detail-text",children:Ce.description||"No description"})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Assigned To"}),w?jsxRuntime.jsx("select",{multiple:true,value:S.assignedUserIds??Ce.assignedUserIds??[],onChange:R=>{let ae=Array.from(R.target.selectedOptions,be=>be.value);M({...S,assignedUserIds:ae});},className:"card-detail-textarea",style:{height:"120px",padding:"8px 12px"},children:s.map(R=>jsxRuntime.jsx("option",{value:R.id,children:R.name},R.id))}):jsxRuntime.jsx("div",{className:"card-detail-users",children:Re.length>0?Re.map(R=>jsxRuntime.jsxs("div",{className:"card-detail-user",children:[jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:R.color},children:R.initials}),jsxRuntime.jsx("span",{children:R.name})]},R.id)):jsxRuntime.jsx("span",{className:"card-detail-empty",children:"Unassigned"})})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Priority"}),w?jsxRuntime.jsxs("select",{value:S.priority??Ce.priority??"",onChange:R=>M({...S,priority:R.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"},children:[jsxRuntime.jsx("option",{value:"",children:"None"}),jsxRuntime.jsx("option",{value:"LOW",children:"LOW"}),jsxRuntime.jsx("option",{value:"MEDIUM",children:"MEDIUM"}),jsxRuntime.jsx("option",{value:"HIGH",children:"HIGH"}),jsxRuntime.jsx("option",{value:"URGENT",children:"URGENT"})]}):jsxRuntime.jsxs("div",{className:"card-detail-priority",children:[jsxRuntime.jsx("div",{className:"card-detail-priority-dot",style:{background:Ce.priority==="URGENT"?"#EF4444":Ce.priority==="HIGH"?"#F59E0B":Ce.priority==="MEDIUM"?"#00E5CC":"#6B7280"}}),jsxRuntime.jsx("span",{children:Ce.priority||"None"})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Labels"}),jsxRuntime.jsx("div",{className:"card-detail-labels",children:Ce.labels&&Ce.labels.length>0?Ce.labels.map(R=>jsxRuntime.jsx("span",{className:"card-detail-label-tag",children:R},R)):jsxRuntime.jsx("span",{className:"card-detail-empty",children:"No labels"})})]}),jsxRuntime.jsxs("div",{className:"card-detail-section-row",children:[jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Start Date"}),w?jsxRuntime.jsx("input",{type:"date",value:S.startDate?new Date(S.startDate).toISOString().split("T")[0]:Ce.startDate?new Date(Ce.startDate).toISOString().split("T")[0]:"",onChange:R=>M({...S,startDate:R.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsxRuntime.jsx("span",{className:"card-detail-text",children:Ce.startDate?new Date(Ce.startDate).toLocaleDateString():"Not set"})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"End Date"}),w?jsxRuntime.jsx("input",{type:"date",value:S.endDate?new Date(S.endDate).toISOString().split("T")[0]:Ce.endDate?new Date(Ce.endDate).toISOString().split("T")[0]:"",onChange:R=>M({...S,endDate:R.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsxRuntime.jsx("span",{className:"card-detail-text",children:Ce.endDate?new Date(Ce.endDate).toLocaleDateString():"Not set"})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Estimated Hours"}),w?jsxRuntime.jsx("input",{type:"number",min:"0",step:"0.5",value:S.estimatedTime??Ce.estimatedTime??"",onChange:R=>M({...S,estimatedTime:R.target.value?parseFloat(R.target.value):void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"},placeholder:"Enter hours"}):jsxRuntime.jsx("span",{className:"card-detail-text",children:Ce.estimatedTime||"Not estimated"})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Dependencies"}),jsxRuntime.jsx("div",{className:"card-detail-dependencies",children:Ce.dependencies&&Ce.dependencies.length>0?Ce.dependencies.map(R=>{let ae=typeof R=="string"?R:R.taskId;return jsxRuntime.jsxs("span",{className:"card-detail-dependency",children:["Card #",ae.slice(-4)]},ae)}):jsxRuntime.jsx("span",{className:"card-detail-empty",children:"No dependencies"})})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Created"}),jsxRuntime.jsx("span",{className:"card-detail-text",children:Ce.createdAt?new Date(Ce.createdAt).toLocaleString():"Unknown"})]})]}),h==="comments"&&jsxRuntime.jsxs("div",{className:"card-detail-comments",children:[jsxRuntime.jsxs("div",{className:"card-detail-comment-form",children:[jsxRuntime.jsx("textarea",{value:T,onChange:R=>F(R.target.value),className:"card-detail-comment-textarea",placeholder:"Write a comment...",rows:3}),jsxRuntime.jsx("button",{onClick:K,disabled:!T.trim(),className:"card-detail-btn card-detail-btn-primary",children:"Add Comment"})]}),jsxRuntime.jsx("div",{className:"card-detail-comments-list",children:o.length>0?o.map(R=>{let ae=s.find(be=>be.id===R.authorId);return jsxRuntime.jsxs("div",{className:"card-detail-comment",children:[jsxRuntime.jsxs("div",{className:"card-detail-comment-header",children:[jsxRuntime.jsxs("div",{className:"card-detail-comment-author",children:[ae&&jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:ae.color},children:ae.initials}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"card-detail-comment-author-name",children:ae?.name||"Unknown"}),jsxRuntime.jsx("div",{className:"card-detail-comment-time",children:new Date(R.createdAt).toLocaleString()})]})]}),m&&jsxRuntime.jsx("button",{onClick:()=>m(R.id),className:"card-detail-comment-delete",children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]})})]}),jsxRuntime.jsx("p",{className:"card-detail-comment-content",children:R.content})]},R.id)}):jsxRuntime.jsxs("div",{className:"card-detail-empty-state",children:[jsxRuntime.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsxRuntime.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),jsxRuntime.jsx("p",{children:"No comments yet"}),jsxRuntime.jsx("span",{children:"Be the first to comment"})]})})]}),h==="activity"&&jsxRuntime.jsx("div",{className:"card-detail-activity",children:l.length>0?jsxRuntime.jsx("div",{className:"card-detail-activity-list",children:l.map(R=>{let ae=s.find(be=>be.id===R.userId);return jsxRuntime.jsxs("div",{className:"card-detail-activity-item",children:[jsxRuntime.jsxs("div",{className:"card-detail-activity-icon",children:[R.type.includes("CREATED")&&"\u2795",R.type.includes("UPDATED")&&"\u270F\uFE0F",R.type.includes("MOVED")&&"\u27A1\uFE0F",R.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",R.type.includes("COMMENT")&&"\u{1F4AC}",R.type.includes("ASSIGNED")&&"\u{1F464}",R.type.includes("PRIORITY")&&"\u{1F3AF}",R.type.includes("LABEL")&&"\u{1F3F7}\uFE0F",R.type.includes("ATTACHMENT")&&"\u{1F4CE}"]}),jsxRuntime.jsxs("div",{className:"card-detail-activity-content",children:[jsxRuntime.jsxs("div",{className:"card-detail-activity-text",children:[jsxRuntime.jsx("strong",{children:ae?.name||"Unknown"})," ",R.type.replace(/_/g," ").toLowerCase(),R.newValue&&jsxRuntime.jsxs("span",{className:"card-detail-activity-value",children:[" ","to ",jsxRuntime.jsx("strong",{children:R.newValue})]})]}),jsxRuntime.jsx("div",{className:"card-detail-activity-time",children:new Date(R.timestamp).toLocaleString()})]})]},R.id)})}):jsxRuntime.jsxs("div",{className:"card-detail-empty-state",children:[jsxRuntime.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsxRuntime.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),jsxRuntime.jsx("p",{children:"No activity yet"}),jsxRuntime.jsx("span",{children:"Activity will appear here"})]})}),h==="attachments"&&jsxRuntime.jsx("div",{className:"card-detail-attachments",children:jsxRuntime.jsx(uo,{cardId:e.id,attachments:i,onUpload:p?R=>p(e.id,R):void 0,onDelete:g,currentUserId:b,maxSizeMB:10,maxFiles:20})}),h==="ai"&&jsxRuntime.jsxs("div",{className:"card-detail-ai",children:[jsxRuntime.jsxs("div",{className:"card-detail-ai-actions",children:[jsxRuntime.jsx("h3",{className:"card-detail-ai-heading",children:"AI-Powered Suggestions"}),jsxRuntime.jsxs("button",{onClick:V,disabled:A||!f,className:"card-detail-ai-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),"Suggest Best Assignee"]}),jsxRuntime.jsxs("button",{onClick:B,disabled:A||!x,className:"card-detail-ai-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),jsxRuntime.jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),jsxRuntime.jsx("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),jsxRuntime.jsx("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),jsxRuntime.jsx("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),jsxRuntime.jsx("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]}),"Generate Subtasks"]}),jsxRuntime.jsxs("button",{onClick:X,disabled:A||!y,className:"card-detail-ai-btn",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 6 12 12 16 14"})]}),"Estimate Effort"]})]}),_.assignees&&jsxRuntime.jsxs("div",{className:"card-detail-ai-results",children:[jsxRuntime.jsx("h4",{children:"Assignee Suggestions"}),_.assignees.map((R,ae)=>{let be=s.find(Ie=>Ie.id===R.userId);return jsxRuntime.jsxs("div",{className:"card-detail-ai-suggestion",children:[be&&jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:be.color},children:be.initials}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"card-detail-ai-suggestion-name",children:be?.name}),jsxRuntime.jsx("div",{className:"card-detail-ai-suggestion-reason",children:R.reasoning}),jsxRuntime.jsxs("div",{className:"card-detail-ai-suggestion-confidence",children:["Confidence: ",(R.confidence*100).toFixed(0),"%"]})]})]},ae)})]}),_.subtasks&&jsxRuntime.jsxs("div",{className:"card-detail-ai-results",children:[jsxRuntime.jsx("h4",{children:"Suggested Subtasks"}),_.subtasks.map((R,ae)=>jsxRuntime.jsxs("div",{className:"card-detail-ai-subtask",children:[jsxRuntime.jsx("div",{className:"card-detail-ai-subtask-title",children:R.title}),R.description&&jsxRuntime.jsx("div",{className:"card-detail-ai-subtask-desc",children:R.description}),R.estimatedTime&&jsxRuntime.jsxs("div",{className:"card-detail-ai-subtask-time",children:["Est: ",R.estimatedTime,"h"]})]},ae))]}),_.effort&&jsxRuntime.jsxs("div",{className:"card-detail-ai-results",children:[jsxRuntime.jsx("h4",{children:"Effort Estimate"}),jsxRuntime.jsxs("div",{className:"card-detail-ai-effort",children:[jsxRuntime.jsxs("div",{className:"card-detail-ai-effort-hours",children:[_.effort.hours," hours"]}),jsxRuntime.jsxs("div",{className:"card-detail-ai-effort-confidence",children:["Confidence: ",(_.effort.confidence*100).toFixed(0),"%"]})]})]}),d.length>0&&jsxRuntime.jsxs("div",{className:"card-detail-ai-insights",children:[jsxRuntime.jsx("h4",{children:"AI Insights"}),d.map(R=>jsxRuntime.jsxs("div",{className:`card-detail-ai-insight card-detail-ai-insight-${R.severity.toLowerCase()}`,children:[jsxRuntime.jsxs("div",{className:"card-detail-ai-insight-header",children:[jsxRuntime.jsx("span",{className:"card-detail-ai-insight-title",children:R.title}),jsxRuntime.jsx("span",{className:"card-detail-ai-insight-severity",children:R.severity})]}),jsxRuntime.jsx("p",{className:"card-detail-ai-insight-desc",children:R.description}),R.suggestedAction&&jsxRuntime.jsxs("div",{className:"card-detail-ai-insight-action",children:["\u{1F4A1} ",R.suggestedAction]})]},R.id))]}),!_.assignees&&!_.subtasks&&!_.effort&&d.length===0&&jsxRuntime.jsxs("div",{className:"card-detail-empty-state",children:[jsxRuntime.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",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("p",{children:"AI Suggestions"}),jsxRuntime.jsx("span",{children:"Click a button above to get AI-powered insights"})]})]})]})]})})})}function vs({triggerRef:e,isOpen:t,onClose:a,children:r,width:n=200,estimatedHeight:s=300,className:o=""}){let[l,d]=react.useState({top:0,left:0}),i=react.useRef(null),u=react.useCallback(()=>{if(!e.current)return {top:0,left:0};let m=e.current.getBoundingClientRect(),p=window.innerHeight,g=window.innerWidth,f=4,x=m.left;x+n>g-10&&(x=g-n-10),x<10&&(x=10);let y=p-m.bottom,b=m.top,h;return y>=s+f?h=m.bottom+f:b>=s+f?h=m.top-s-f:y>=b?h=m.bottom+f:h=Math.max(10,m.top-s-f),{top:h,left:x}},[e,n,s]);return react.useEffect(()=>{t&&d(u());},[t,u]),react.useEffect(()=>{if(!t)return;let m=g=>{let f=g.target;i.current&&!i.current.contains(f)&&e.current&&!e.current.contains(f)&&a();},p=setTimeout(()=>{document.addEventListener("mousedown",m);},0);return ()=>{clearTimeout(p),document.removeEventListener("mousedown",m);}},[t,a,e]),react.useEffect(()=>{if(!t)return;let m=p=>{p.key==="Escape"&&(p.preventDefault(),p.stopPropagation(),a());};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[t,a]),t?jsxRuntime.jsx(Qt,{children:jsxRuntime.jsx("div",{ref:i,className:`smart-popover ${o}`,style:{position:"fixed",top:`${l.top}px`,left:`${l.left}px`,width:`${n}px`,maxHeight:"calc(100vh - 40px)",overflowY:"auto",zIndex:99999,padding:"6px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.3)",animation:"popoverSlideIn 100ms ease-out"},children:r})}):null}var ft={dark:{bgPrimary:"#050505",bgSecondary:"#0A0A0A",bgGrid:"rgba(255, 255, 255, 0.02)",bgWeekend:"rgba(17, 17, 17, 0.4)",border:"rgba(255, 255, 255, 0.08)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"rgba(255, 255, 255, 0.92)",textSecondary:"rgba(255, 255, 255, 0.60)",textTertiary:"rgba(255, 255, 255, 0.35)",accent:"#00E5CC",accentHover:"#5AADFF",accentLight:"rgba(0, 229, 204, 0.12)",taskBarPrimary:"#00E5CC",taskBarProgress:"#5AADFF",taskBarHandle:"#FFFFFF",dependency:"#444444",dependencyHover:"#FFFFFF",criticalPath:"#EF4444",criticalPathLight:"rgba(239, 68, 68, 0.15)",today:"#EF4444",todayLight:"rgba(239, 68, 68, 0.08)",milestone:"#FFFFFF",milestoneLight:"rgba(255, 255, 255, 0.1)",statusTodo:"#666666",statusInProgress:"#00E5CC",statusCompleted:"#10B981",hoverBg:"rgba(255, 255, 255, 0.04)",focusRing:"#00E5CC",dotGrid:"rgba(255, 255, 255, 0.05)",glassHeader:"#0A0A0A",glassToolbar:"rgba(0, 0, 0, 0.4)",forecastHud:"rgba(15, 15, 15, 0.9)",neonRedGlow:"0 0 8px rgba(239, 68, 68, 0.25)",executionBarBg:"rgba(0, 229, 204, 0.12)"},light:{bgPrimary:"#FFFFFF",bgSecondary:"#F8FAFC",bgGrid:"#F1F5F9",bgWeekend:"rgba(0, 196, 174, 0.03)",border:"#CBD5E1",borderLight:"#E2E8F0",textPrimary:"#0F172A",textSecondary:"#334155",textTertiary:"#64748B",accent:"#00E5CC",accentHover:"#1D4ED8",accentLight:"rgba(0, 196, 174, 0.08)",taskBarPrimary:"#00E5CC",taskBarProgress:"#00A893",taskBarHandle:"#FFFFFF",dependency:"#6B7280",dependencyHover:"#00E5CC",criticalPath:"#DC2626",criticalPathLight:"rgba(220, 38, 38, 0.1)",today:"#D21E24",todayLight:"rgba(210, 30, 36, 0.1)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.08)",statusTodo:"#64748B",statusInProgress:"#00E5CC",statusCompleted:"#059669",hoverBg:"rgba(0, 0, 0, 0.04)",focusRing:"#00E5CC",dotGrid:"rgba(0, 0, 0, 0.04)",glassHeader:"#F8FAFC",glassToolbar:"rgba(255, 255, 255, 0.85)",forecastHud:"rgba(248, 250, 252, 0.95)",neonRedGlow:"0 0 10px rgba(220, 38, 38, 0.3)",executionBarBg:"rgba(0, 196, 174, 0.28)"},neutral:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgGrid:"#EFEDEC",bgWeekend:"rgba(41, 37, 36, 0.02)",border:"#D6D3D1",borderLight:"#E7E5E4",textPrimary:"#0C0A09",textSecondary:"#44403C",textTertiary:"#78716C",accent:"#292524",accentHover:"#44403C",accentLight:"rgba(41, 37, 36, 0.08)",taskBarPrimary:"#292524",taskBarProgress:"#1C1917",taskBarHandle:"#FFFFFF",dependency:"#78716C",dependencyHover:"#A8A29E",criticalPath:"#44403C",criticalPathLight:"rgba(68, 64, 60, 0.08)",today:"#1C1917",todayLight:"rgba(28, 25, 23, 0.06)",milestone:"#57534E",milestoneLight:"rgba(87, 83, 78, 0.08)",statusTodo:"#78716C",statusInProgress:"#292524",statusCompleted:"#15803D",hoverBg:"rgba(0, 0, 0, 0.035)",focusRing:"#292524",dotGrid:"rgba(0, 0, 0, 0.03)",glassHeader:"#F5F5F4",glassToolbar:"rgba(250, 250, 249, 0.85)",forecastHud:"rgba(245, 245, 244, 0.95)",neonRedGlow:"0 0 10px rgba(68, 64, 60, 0.3)",executionBarBg:"rgba(41, 37, 36, 0.25)"}};var xy=["LOW","MEDIUM","HIGH","URGENT"],vy=["todo","in-progress","review","done"];function cd({card:e,isOpen:t,onClose:a,onUpdate:r,onDelete:n,availableUsers:s=[],comments:o=[],activities:l=[],onAddComment:d,onDeleteComment:i,currentUser:u,onAIGenerateDescription:m,onAICreateSubtasks:p,onAIFindSimilar:g,availableColumns:f=[],availableLabels:x=[],availableTags:y=[],onCreateTag:b,onUploadCoverImage:h,unsplashAccessKey:v,theme:w,onSubtasksChange:D,attachments:S=[],onUploadAttachments:M,onDeleteAttachment:T}){let F=Dn(),A=w||F?.themeName||"dark",[C,_]=react.useState(e),[W,oe]=react.useState(false),[L,Y]=react.useState(()=>[...e?.subtasks||[]].sort((se,at)=>(se.position??0)-(at.position??0))),[K,V]=react.useState(false),[B,X]=react.useState(""),[Ce,Re]=react.useState(""),[R,ae]=react.useState("all"),[be,Ie]=react.useState(false),[De,Ee]=react.useState(false),[He,rt]=react.useState(false),[pe,We]=react.useState(false),[je,Oe]=react.useState(false),[tt,wt]=react.useState(false),pt=react.useRef(null),Ue=react.useRef(null),ot=react.useRef(null),Et=react.useRef(null),ge=react.useRef(null),mt=react.useRef(null),k=react.useRef(null),O=react.useRef(null),Z=react.useRef(null),ve=react.useRef(null),$=react.useRef(null),re=react.useRef(null);react.useEffect(()=>{if(e&&!C){_({...e});let H=[...e.subtasks||[]].sort((se,at)=>(se.position??0)-(at.position??0));Y(H);}else if(e&&C&&e.id!==C.id){_({...e});let H=[...e.subtasks||[]].sort((se,at)=>(se.position??0)-(at.position??0));Y(H);}},[e,C]),react.useEffect(()=>{let H=se=>{let at=se.target;Et.current&&!Et.current.contains(at)&&Ie(false),ge.current&&!ge.current.contains(at)&&Ee(false),mt.current&&!mt.current.contains(at)&&rt(false),k.current&&!k.current.contains(at)&&We(false);};if(be||De||He||pe)return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[be,De,He,pe]),react.useEffect(()=>{if(!t)return;let H=se=>{let at=se.target,Xt=at.tagName==="INPUT"||at.tagName==="TEXTAREA"||at.isContentEditable;if(se.key==="Escape"){se.preventDefault(),be||De||He||pe||je||tt?(Ie(false),Ee(false),rt(false),We(false),Oe(false),wt(false)):Xt||a();return}if(Xt&&se.key!=="Escape")return;let ee=se.metaKey||se.ctrlKey;switch(se.key.toLowerCase()){case "s":se.preventDefault(),Ie(true);break;case "a":se.preventDefault(),rt(true);break;case "p":se.preventDefault(),Ee(true);break;case "l":se.preventDefault(),We(true);break;case "d":ee||(se.preventDefault(),Oe(true),setTimeout(()=>O.current?.focus(),0));break;case "e":ee||(se.preventDefault(),wt(true));break;case "i":se.preventDefault(),oe(true),setTimeout(()=>Ue.current?.focus(),0);break;case "t":se.preventDefault(),V(true);break;case "c":se.preventDefault(),ot.current?.focus();break}};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[t,a,be,De,He,pe,je,tt]);let Ye=react.useCallback(H=>{let se=H.currentTarget.textContent?.trim()||"";if(C&&se!==C.title){let at={...C,title:se};_(at),r?.(C.id,{title:se});}},[C,r]),Te=react.useCallback(H=>{H.key==="Enter"&&(H.preventDefault(),H.currentTarget.blur()),H.key==="Escape"&&(H.preventDefault(),H.currentTarget.textContent=C?.title||"",H.currentTarget.blur());},[C]),Fe=react.useCallback(()=>{C&&e&&C.description!==e.description&&r?.(C.id,{description:C.description}),oe(false);},[C,e,r]),ze=react.useCallback(H=>{if(C){let se={...C,columnId:H};_(se),r?.(C.id,{columnId:H}),Ie(false);}},[C,r]),Le=react.useCallback(H=>{if(C){let se={...C,priority:H};_(se),r?.(C.id,{priority:H}),Ee(false);}},[C,r]),Ze=react.useCallback(H=>{if(C){let se=C.assignedUserIds||[],at=se.includes(H)?se.filter(ee=>ee!==H):[...se,H],Xt={...C,assignedUserIds:at};_(Xt),r?.(C.id,{assignedUserIds:at});}},[C,r]),st=react.useCallback(H=>{if(C){let se=C.labels||[],at=se.includes(H)?se.filter(ee=>ee!==H):[...se,H],Xt={...C,labels:at};_(Xt),r?.(C.id,{labels:at});}},[C,r]),yt=react.useCallback(H=>{if(C){let se={...C,tags:H};_(se),r?.(C.id,{tags:H});}},[C,r]),xt=react.useCallback(H=>{if(C){let se=H.target.value,at={...C,endDate:se};_(at),r?.(C.id,{endDate:se}),Oe(false);}},[C,r]),$t=react.useCallback(H=>{if(C){let se={...C,estimatedTime:parseFloat(H)||0};_(se),r?.(C.id,{estimatedTime:parseFloat(H)||0});}},[C,r]),ut=react.useCallback(()=>{if(B.trim()&&C){let H={id:`subtask-${Date.now()}`,title:B.trim(),completed:false,position:L.length,createdAt:new Date},se=[...L,H];Y(se),X(""),V(false),D?.(C.id,se);}},[B,L,C,D]),Gt=react.useCallback(H=>{let se=L.map(at=>at.id===H?{...at,completed:!at.completed,updatedAt:new Date}:at);Y(se),C&&D?.(C.id,se);},[L,C,D]),Mt=react.useCallback(H=>{let se=L.filter(at=>at.id!==H);Y(se),C&&D?.(C.id,se);},[L,C,D]),It=react.useCallback(()=>{Ce.trim()&&C&&d&&(d(C.id,Ce.trim()),Re(""));},[Ce,C,d]),Ft=react.useCallback(H=>{(H.metaKey||H.ctrlKey)&&H.key==="Enter"&&(H.preventDefault(),It());},[It]),Ct=H=>jsxRuntime.jsx(by__default.default,{remarkPlugins:[hy__default.default],rehypePlugins:[yy__default.default],components:{a:({node:se,...at})=>jsxRuntime.jsx("a",{...at,target:"_blank",rel:"noopener noreferrer"})},children:H}),St=l.filter(H=>R==="comments"?H.type.includes("COMMENT"):R==="history"?!H.type.includes("COMMENT"):true);if(!t||!e)return null;let ct=C||e,fa=s.filter(H=>ct.assignedUserIds?.includes(H.id)),xa=L.filter(H=>H.completed).length;return jsxRuntime.jsx(Qt,{children:jsxRuntime.jsx("div",{className:"modal-v2-backdrop",onClick:a,style:{position:"fixed",inset:"0",zIndex:9999,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsxs("div",{className:"modal-v2-container",onClick:H=>H.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"modal-title","data-theme":A,children:[jsxRuntime.jsxs("header",{className:"modal-v2-header",children:[jsxRuntime.jsx("h1",{id:"modal-title",ref:pt,className:"modal-v2-title",contentEditable:true,suppressContentEditableWarning:true,onBlur:Ye,onKeyDown:Te,children:ct.title}),jsxRuntime.jsxs("p",{className:"modal-v2-ai-prompt",children:[jsxRuntime.jsx("span",{className:"modal-v2-ai-icon",children:"\u2728"}),"Ask AI to write a description, create subtasks, or find similar tasks"]}),jsxRuntime.jsx("button",{className:"modal-v2-close",onClick:a,"aria-label":"Close",children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntime.jsxs("section",{className:"modal-v2-metadata",children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:Et,children:[jsxRuntime.jsxs("button",{ref:Z,className:"modal-v2-field",onClick:()=>Ie(!be),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",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("path",{d:"M12 6v6l4 2"})]}),jsxRuntime.jsx("span",{children:"Status"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"S"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:ct.columnId||"No status"})]}),jsxRuntime.jsx(vs,{triggerRef:Z,isOpen:be,onClose:()=>Ie(false),width:250,estimatedHeight:200,children:(f.length>0?f:vy.map(H=>({id:H,title:H}))).map(H=>jsxRuntime.jsx("button",{className:`modal-v2-popover-item ${ct.columnId===H.id?"active":""}`,onClick:()=>ze(H.id),children:H.title},H.id))})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:mt,children:[jsxRuntime.jsxs("button",{ref:ve,className:"modal-v2-field",onClick:()=>rt(!He),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxRuntime.jsx("span",{children:"Assignees"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"A"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:fa.length>0?jsxRuntime.jsx("div",{className:"modal-v2-avatars",children:fa.map(H=>jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:H.color},title:H.name,children:H.initials},H.id))}):jsxRuntime.jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),jsxRuntime.jsx(vs,{triggerRef:ve,isOpen:He,onClose:()=>rt(false),width:280,estimatedHeight:300,children:s.map(H=>jsxRuntime.jsxs("button",{className:`modal-v2-popover-item ${ct.assignedUserIds?.includes(H.id)?"active":""}`,onClick:()=>Ze(H.id),children:[jsxRuntime.jsx("div",{className:"modal-v2-avatar-small",style:{background:H.color},children:H.initials}),H.name,ct.assignedUserIds?.includes(H.id)&&jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginLeft:"auto"},children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})]},H.id))})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:ge,children:[jsxRuntime.jsxs("button",{ref:$,className:"modal-v2-field",onClick:()=>Ee(!De),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",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:"Priority"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"P"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:ct.priority||"None"})]}),jsxRuntime.jsxs(vs,{triggerRef:$,isOpen:De,onClose:()=>Ee(false),width:180,estimatedHeight:220,children:[xy.map(H=>jsxRuntime.jsx("button",{className:`modal-v2-popover-item priority-${H.toLowerCase()} ${ct.priority===H?"active":""}`,onClick:()=>Le(H),children:H},H)),jsxRuntime.jsx("button",{className:"modal-v2-popover-item",onClick:()=>Le(""),children:"None"})]})]}),y.length>0||b?jsxRuntime.jsx("div",{className:"modal-v2-field-wrapper",children:jsxRuntime.jsxs("div",{className:"modal-v2-field",style:{cursor:"default"},children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsx("span",{children:"Etiquetas"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:jsxRuntime.jsx(Ro,{selectedTags:ct.tags||[],availableTags:y,onChange:yt,onCreateTag:b,theme:ft[A]||ft.dark})})]})}):jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:k,children:[jsxRuntime.jsxs("button",{ref:re,className:"modal-v2-field",onClick:()=>We(!pe),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsx("span",{children:"Labels"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"L"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:ct.labels&&ct.labels.length>0?jsxRuntime.jsx("span",{children:ct.labels.join(", ")}):jsxRuntime.jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),jsxRuntime.jsx(vs,{triggerRef:re,isOpen:pe,onClose:()=>We(false),width:220,estimatedHeight:200,children:(x.length>0?x:["Bug","Feature","Enhancement","Documentation"]).map(H=>jsxRuntime.jsxs("button",{className:`modal-v2-popover-item ${ct.labels?.includes(H)?"active":""}`,onClick:()=>st(H),children:[H,ct.labels?.includes(H)&&jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginLeft:"auto"},children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})]},H))})]}),jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>{Oe(!je),setTimeout(()=>O.current?.showPicker?.(),0);},children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",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:"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("span",{children:"Due Date"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"D"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:ct.endDate?new Date(ct.endDate).toLocaleDateString():"Not set"}),jsxRuntime.jsx("input",{ref:O,type:"date",value:typeof ct.endDate=="string"?ct.endDate.split("T")[0]:ct.endDate?(()=>{let H=new Date(ct.endDate),se=H.getUTCFullYear(),at=String(H.getUTCMonth()+1).padStart(2,"0"),Xt=String(H.getUTCDate()).padStart(2,"0");return `${se}-${at}-${Xt}`})():"",onChange:xt,style:{position:"absolute",opacity:0,pointerEvents:"none"}})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>wt(!tt),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",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 6 12 12 16 14"})]}),jsxRuntime.jsx("span",{children:"Estimated Time"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"E"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:ct.estimatedTime?`${ct.estimatedTime}h`:"Not set"})]}),tt&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:jsxRuntime.jsx("input",{type:"number",min:"0",step:"0.5",placeholder:"Hours",value:ct.estimatedTime||"",onChange:H=>$t(H.target.value),className:"modal-v2-time-input",autoFocus:true,onBlur:()=>wt(false)})})]})]}),jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),jsxRuntime.jsx("h2",{children:"Description"})]}),W?jsxRuntime.jsx("textarea",{className:"modal-v2-textarea",value:ct.description||"",onChange:H=>{if(C){let se={...C,description:H.target.value};_(se);}},onBlur:Fe,placeholder:"Add a detailed description...",autoFocus:true}):jsxRuntime.jsx("div",{className:"modal-v2-content",onClick:()=>oe(true),children:ct.description?jsxRuntime.jsx("div",{className:"modal-v2-markdown",children:Ct(ct.description)}):jsxRuntime.jsxs("p",{className:"modal-v2-placeholder",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),jsxRuntime.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Add description..."]})})]}),jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M9 11l3 3L22 4"}),jsxRuntime.jsx("path",{d:"M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"})]}),jsxRuntime.jsx("h2",{children:"Subtasks"}),L.length>0&&jsxRuntime.jsxs("span",{className:"modal-v2-count",children:[xa,"/",L.length]}),jsxRuntime.jsxs("button",{className:"modal-v2-add-button",onClick:()=>V(true),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:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Add"]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-subtasks",children:[L.map(H=>jsxRuntime.jsxs("div",{className:`modal-v2-subtask ${H.completed?"completed":""}`,children:[jsxRuntime.jsx("button",{className:"modal-v2-subtask-checkbox",onClick:()=>Gt(H.id),children:H.completed?jsxRuntime.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M9 12l2 2 4-4",stroke:"white",strokeWidth:"2",fill:"none"})]}):jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"})})}),jsxRuntime.jsx("span",{className:"modal-v2-subtask-title",children:H.title}),jsxRuntime.jsx("button",{className:"modal-v2-subtask-delete",onClick:()=>Mt(H.id),children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]})})]},H.id)),K&&jsxRuntime.jsx("div",{className:"modal-v2-subtask-input-row",children:jsxRuntime.jsx("input",{type:"text",placeholder:"Subtask title...",value:B,onChange:H=>X(H.target.value),onKeyDown:H=>{H.key==="Enter"&&ut(),H.key==="Escape"&&(V(false),X(""));},onBlur:ut,autoFocus:true,className:"modal-v2-subtask-input"})})]})]}),(M||S.length>0)&&jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})}),jsxRuntime.jsx("h2",{children:"Attachments"}),S.length>0&&jsxRuntime.jsx("span",{className:"modal-v2-count",children:S.length})]}),jsxRuntime.jsx(uo,{cardId:ct.id,attachments:S,onUpload:M?H=>M(ct.id,H):void 0,onDelete:T,maxSizeMB:10,maxFiles:20})]}),jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),jsxRuntime.jsx("h2",{children:"Activity"}),jsxRuntime.jsxs("div",{className:"modal-v2-filters",children:[jsxRuntime.jsx("button",{className:`modal-v2-filter ${R==="all"?"active":""}`,onClick:()=>ae("all"),children:"All"}),jsxRuntime.jsx("button",{className:`modal-v2-filter ${R==="comments"?"active":""}`,onClick:()=>ae("comments"),children:"Comments"}),jsxRuntime.jsx("button",{className:`modal-v2-filter ${R==="history"?"active":""}`,onClick:()=>ae("history"),children:"History"})]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-input",children:[u&&jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:u.color},children:u.initials}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-wrapper",children:[jsxRuntime.jsx("textarea",{ref:ot,className:"modal-v2-comment-textarea",placeholder:"Write a comment...",value:Ce,onChange:H=>Re(H.target.value),onKeyDown:Ft,rows:1}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-toolbar",children:[jsxRuntime.jsxs("div",{className:"modal-v2-toolbar-left",children:[jsxRuntime.jsx("button",{className:"modal-v2-toolbar-button",title:"Attach file",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})})}),jsxRuntime.jsx("button",{className:"modal-v2-toolbar-button",title:"Mention user",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:"4"}),jsxRuntime.jsx("path",{d:"M16 8v5a3 3 0 006 0v-1a10 10 0 10-3.92 7.94"})]})}),jsxRuntime.jsx("button",{className:"modal-v2-toolbar-button",title:"Add emoji",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("path",{d:"M8 14s1.5 2 4 2 4-2 4-2"}),jsxRuntime.jsx("line",{x1:"9",y1:"9",x2:"9.01",y2:"9"}),jsxRuntime.jsx("line",{x1:"15",y1:"9",x2:"15.01",y2:"9"})]})})]}),jsxRuntime.jsx("button",{className:"modal-v2-send-button",onClick:It,disabled:!Ce.trim(),children:"Send"})]})]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-timeline",children:[St.map(H=>{let se=s.find(Xt=>Xt.id===H.userId);if(H.type.includes("COMMENT")){let Xt=o.find(ee=>ee.id===H.metadata?.commentId);return Xt?jsxRuntime.jsxs("div",{className:"modal-v2-activity-item comment-item",children:[se&&jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:se.color},children:se.initials}),jsxRuntime.jsxs("div",{className:"modal-v2-activity-content",children:[jsxRuntime.jsxs("div",{className:"modal-v2-activity-header",children:[jsxRuntime.jsx("span",{className:"modal-v2-activity-user",children:se?.name||"Unknown"}),jsxRuntime.jsx("span",{className:"modal-v2-activity-time",children:new Date(H.timestamp).toLocaleString()})]}),jsxRuntime.jsx("div",{className:"modal-v2-comment-body",children:Xt.content})]})]},H.id):null}return jsxRuntime.jsxs("div",{className:"modal-v2-activity-item history-item",children:[jsxRuntime.jsxs("div",{className:"modal-v2-history-icon",children:[H.type.includes("CREATED")&&"\u2795",H.type.includes("UPDATED")&&"\u270F\uFE0F",H.type.includes("MOVED")&&"\u27A1\uFE0F",H.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",H.type.includes("ASSIGNED")&&"\u{1F464}",H.type.includes("PRIORITY")&&"\u{1F3AF}",H.type.includes("LABEL")&&"\u{1F3F7}\uFE0F"]}),jsxRuntime.jsxs("div",{className:"modal-v2-activity-content",children:[jsxRuntime.jsxs("div",{className:"modal-v2-history-text",children:[jsxRuntime.jsx("span",{className:"modal-v2-activity-user",children:se?.name||"Unknown"})," ",H.type.replace(/_/g," ").toLowerCase(),H.newValue&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" to ",jsxRuntime.jsx("strong",{children:H.newValue})]})]}),jsxRuntime.jsx("span",{className:"modal-v2-activity-time",children:new Date(H.timestamp).toLocaleString()})]})]},H.id)}),St.length===0&&jsxRuntime.jsxs("div",{className:"modal-v2-empty",children:[jsxRuntime.jsx("p",{children:"No activity yet"}),jsxRuntime.jsx("span",{children:"Activity will appear here"})]})]})]})]})})})}function My({active:e,payload:t}){return !e||!t||!t.length?null:jsxRuntime.jsxs("div",{className:"chart-tooltip",children:[jsxRuntime.jsx("p",{className:"chart-tooltip-label",children:t[0].payload.period}),t.map((a,r)=>jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:a.color},children:[a.name,": ",jsxRuntime.jsx("strong",{children:a.value})," cards"]},r))]})}function pd({data:e,title:t="Team Velocity",height:a=300,showAverage:r=true,showPlanned:n=true}){let s=e.map(o=>({...o,average:o.average??e.reduce((l,d)=>l+d.completed,0)/e.length}));return jsxRuntime.jsxs("div",{className:"chart-container",children:[t&&jsxRuntime.jsx("h3",{className:"chart-title",children:t}),jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:a,children:jsxRuntime.jsxs(recharts.LineChart,{data:s,margin:{top:5,right:30,left:20,bottom:5},children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"period",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(My,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"completed",stroke:"#10B981",strokeWidth:3,name:"Completed",dot:{fill:"#10B981",r:5},activeDot:{r:7}}),n&&jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"planned",stroke:"#00E5CC",strokeWidth:2,strokeDasharray:"5 5",name:"Planned",dot:{fill:"#00E5CC",r:4}}),r&&jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"average",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"3 3",name:"Average",dot:false})]})}),jsxRuntime.jsxs("div",{className:"chart-stats",children:[jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Total Completed"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#10B981"},children:e.reduce((o,l)=>o+l.completed,0)})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Average Velocity"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#F59E0B"},children:(e.reduce((o,l)=>o+l.completed,0)/e.length).toFixed(1)})]}),n&&e.some(o=>o.planned)&&jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Total Planned"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#00E5CC"},children:e.reduce((o,l)=>o+(l.planned||0),0)})]})]})]})}function $y({active:e,payload:t}){return !e||!t||!t.length?null:jsxRuntime.jsxs("div",{className:"chart-tooltip",children:[jsxRuntime.jsx("p",{className:"chart-tooltip-label",children:t[0].payload.day}),t.map((a,r)=>jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:a.color},children:[a.name,": ",jsxRuntime.jsx("strong",{children:a.value})," tasks"]},r))]})}function md({data:e,title:t="Sprint Burndown",height:a=300,totalTasks:r,useArea:n=false}){let s=r??(e[0]?.ideal||e[0]?.remaining||0),o=e[e.length-1]?.remaining||0,l=e[e.length-1]?.ideal||0,d=s>0?(s-o)/s*100:0,i=o<=l;return jsxRuntime.jsxs("div",{className:"chart-container",children:[t&&jsxRuntime.jsx("h3",{className:"chart-title",children:t}),jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:a,children:jsxRuntime.jsxs(n?recharts.AreaChart:recharts.LineChart,{data:e,margin:{top:5,right:30,left:20,bottom:5},children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"day",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx($y,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(recharts.Area,{type:"monotone",dataKey:"ideal",stroke:"#F59E0B",fill:"rgba(245, 158, 11, 0.2)",strokeWidth:2,strokeDasharray:"5 5",name:"Ideal"}),jsxRuntime.jsx(recharts.Area,{type:"monotone",dataKey:"remaining",stroke:i?"#10B981":"#EF4444",fill:i?"rgba(16, 185, 129, 0.2)":"rgba(239, 68, 68, 0.2)",strokeWidth:3,name:"Remaining"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(recharts.Line,{type:"linear",dataKey:"ideal",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",name:"Ideal",dot:{fill:"#F59E0B",r:4}}),jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"remaining",stroke:i?"#10B981":"#EF4444",strokeWidth:3,name:"Remaining",dot:{fill:i?"#10B981":"#EF4444",r:5},activeDot:{r:7}})]})]})}),jsxRuntime.jsxs("div",{className:"chart-stats",children:[jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Progress"}),jsxRuntime.jsxs("span",{className:"chart-stat-value",style:{color:d>=50?"#10B981":"#F59E0B"},children:[d.toFixed(0),"%"]})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Remaining"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:i?"#10B981":"#EF4444"},children:o})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Status"}),jsxRuntime.jsx("span",{className:"chart-stat-badge",style:{background:i?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:i?"#10B981":"#EF4444"},children:i?"\u2713 On Track":"\u26A0 Behind"})]})]})]})}var Ky={URGENT:"#EF4444",HIGH:"#F59E0B",MEDIUM:"#00E5CC",LOW:"#10B981"},Wp=["#00E5CC","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899"];function qy({cx:e,cy:t,midAngle:a,innerRadius:r,outerRadius:n,percent:s}){let o=r+(n-r)*.5,l=e+o*Math.cos(-a*(Math.PI/180)),d=t+o*Math.sin(-a*(Math.PI/180));return s<.05?null:jsxRuntime.jsx("text",{x:l,y:d,fill:"white",textAnchor:l>e?"start":"end",dominantBaseline:"central",style:{fontSize:"12px",fontWeight:600},children:`${(s*100).toFixed(0)}%`})}function Vp({active:e,payload:t}){if(!e||!t||!t.length)return null;let a=t[0].payload,r=t[0].payload.totalValue||0,n=r>0?(a.value/r*100).toFixed(1):"0";return jsxRuntime.jsxs("div",{className:"chart-tooltip",children:[jsxRuntime.jsx("p",{className:"chart-tooltip-label",children:a.name}),jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:a.color||t[0].color},children:["Count: ",jsxRuntime.jsx("strong",{children:a.value})]}),jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:"rgba(255, 255, 255, 0.7)"},children:["Percentage: ",jsxRuntime.jsxs("strong",{children:[n,"%"]})]})]})}function gd({data:e,title:t="Distribution",type:a="pie",height:r=300,showPercentages:n=true}){let s=e.reduce((d,i)=>d+i.value,0),o=e.map(d=>({...d,totalValue:s,color:d.color||Ky[d.name]||Wp[e.indexOf(d)%Wp.length]})),l=o.map(d=>d.color);return jsxRuntime.jsxs("div",{className:"chart-container",children:[t&&jsxRuntime.jsx("h3",{className:"chart-title",children:t}),jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:r,children:a==="pie"?jsxRuntime.jsxs(recharts.PieChart,{children:[jsxRuntime.jsx(recharts.Pie,{data:o,cx:"50%",cy:"50%",labelLine:false,label:n?qy:false,outerRadius:r*.35,fill:"#8884d8",dataKey:"value",children:o.map((d,i)=>jsxRuntime.jsx(recharts.Cell,{fill:l[i]},`cell-${i}`))}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(Vp,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"},formatter:(d,i)=>{let u=i.payload,m=s>0?(u.value/s*100).toFixed(0):"0";return `${d} (${u.value} - ${m}%)`}})]}):jsxRuntime.jsxs(recharts.BarChart,{data:o,margin:{top:5,right:30,left:20,bottom:5},children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"name",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(Vp,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),jsxRuntime.jsx(recharts.Bar,{dataKey:"value",name:"Count",radius:[8,8,0,0],children:o.map((d,i)=>jsxRuntime.jsx(recharts.Cell,{fill:l[i]},`cell-${i}`))})]})}),jsxRuntime.jsxs("div",{className:"chart-stats",children:[jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Total Cards"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#00E5CC"},children:s})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Categories"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#10B981"},children:e.length})]}),e.length>0&&jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Largest Category"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#F59E0B"},children:e.reduce((d,i)=>i.value>d.value?i:d).name})]})]})]})}var Ti=react.memo(({selectedCards:e,availableUsers:t=[],onClearSelection:a,callbacks:r,columns:n=[],availableLabels:s=[]})=>{let[o,l]=react.useState(false),[d,i]=react.useState(false),[u,m]=react.useState(false),[p,g]=react.useState(false);if(e.length===0)return null;let f=e.map(w=>w.id),x=w=>{r.onBulkUpdate?.(f,{priority:w}),l(false);},y=w=>{r.onBulkMove?.(f,w),i(false),a();},b=w=>{r.onBulkUpdate?.(f,{assignedUserIds:w}),m(false);},h=w=>{let D=new Set;e.forEach(M=>{M.labels?.forEach(T=>D.add(T));});let S=Array.from(new Set([...D,...w]));r.onBulkUpdate?.(f,{labels:S}),g(false);},v=()=>{confirm(`Delete ${e.length} card(s)? This cannot be undone.`)&&(r.onBulkDelete?.(f),a());};return jsxRuntime.jsx("div",{className:"asakaa-bulk-toolbar",children:jsxRuntime.jsxs("div",{className:"asakaa-bulk-toolbar-content",children:[jsxRuntime.jsxs("div",{className:"asakaa-bulk-toolbar-count",children:[e.length," card",e.length!==1?"s":""," selected"]}),jsxRuntime.jsxs("div",{className:"asakaa-bulk-toolbar-actions",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>l(!o),title:"Update priority",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Priority"})}),o&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:["LOW","MEDIUM","HIGH","URGENT"].map(w=>jsxRuntime.jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>x(w),children:[jsxRuntime.jsx("span",{className:c("asakaa-priority-dot",w==="LOW"&&"bg-asakaa-priority-low",w==="MEDIUM"&&"bg-asakaa-priority-medium",w==="HIGH"&&"bg-asakaa-priority-high",w==="URGENT"&&"bg-asakaa-priority-urgent")}),w]},w))})]}),n.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>i(!d),title:"Move to column",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Move"})}),d&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:n.map(w=>jsxRuntime.jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>y(w.id),children:w.title},w.id))})]}),t.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>m(!u),title:"Assign users",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Assign"})}),u&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:t.map(w=>jsxRuntime.jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>b([w.id]),children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-xs font-medium",style:{backgroundColor:w.color},children:w.initials}),w.name]},w.id))})]}),s.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>g(!p),title:"Add labels",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Labels"})}),p&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:s.map(w=>jsxRuntime.jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>h([w]),children:w},w))})]}),jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button asakaa-bulk-toolbar-button-danger",onClick:v,title:"Delete selected cards",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Delete"})}),jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:a,title:"Clear selection",children:jsxRuntime.jsx("span",{className:"text-sm",children:"\u2715"})})]})]})})});Ti.displayName="BulkOperationsToolbar";function Zy(e,t,a){if(t==="none")return [];let r=new Map;return e.forEach(n=>{let s,o,l,d,i;switch(t){case "assignee":let u=n.assignedUserIds||(n.assigneeId?[n.assigneeId]:[]);u.length>0?u.forEach(g=>{let f=a?.find(x=>x.id===g);o=`assignee-${g}`,l=f?.name||`User ${g}`,d=f?.color,i=f?.avatar,r.has(o)||r.set(o,{id:o,title:l,groupValue:g,cardIds:[],color:d,icon:i}),r.get(o).cardIds.push(n.id);}):(o="assignee-unassigned",l="Unassigned",d="#6b7280",i="\u{1F464}",r.has(o)||r.set(o,{id:o,title:l,groupValue:null,cardIds:[],color:d,icon:i}),r.get(o).cardIds.push(n.id));break;case "priority":s=n.priority||"NONE",o=`priority-${s}`;let p={URGENT:{title:"\u{1F534} Urgent",color:"#ef4444"},HIGH:{title:"\u{1F7E0} High",color:"#f97316"},MEDIUM:{title:"\u{1F7E1} Medium",color:"#eab308"},LOW:{title:"\u{1F7E2} Low",color:"#22c55e"},NONE:{title:"\u26AA No Priority",color:"#6b7280"}}[s];l=p.title,d=p.color,r.has(o)||r.set(o,{id:o,title:l,groupValue:s,cardIds:[],color:d}),r.get(o).cardIds.push(n.id);break;case "label":n.labels&&n.labels.length>0?n.labels.forEach(g=>{o=`label-${g}`,l=g,d="#6b7280",r.has(o)||r.set(o,{id:o,title:l,groupValue:g,cardIds:[],color:d}),r.get(o).cardIds.push(n.id);}):(o="label-none",l="No Labels",d="#6b7280",r.has(o)||r.set(o,{id:o,title:l,groupValue:null,cardIds:[],color:d}),r.get(o).cardIds.push(n.id));break}}),Array.from(r.values()).sort((n,s)=>n.title.localeCompare(s.title))}function fd({board:e,swimlaneConfig:t,availableUsers:a,callbacks:r,className:n}){let[s,o]=react.useState(new Set),l=react.useMemo(()=>Zy(e.cards,t.groupBy,a),[e.cards,t.groupBy,a]),d=react.useCallback(i=>{o(u=>{let m=new Set(u);return m.has(i)?m.delete(i):m.add(i),m});},[]);return t.groupBy==="none"||l.length===0?jsxRuntime.jsx(Ho,{board:e,callbacks:r,availableUsers:a,className:n}):jsxRuntime.jsxs("div",{className:c("asakaa-swimlane-view",n),children:[l.map(i=>{let u=s.has(i.id),m=e.cards.filter(g=>i.cardIds.includes(g.id)),p={...e,cards:m};return jsxRuntime.jsxs("div",{className:"asakaa-swimlane mb-6 rounded-lg border border-white/10 overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"asakaa-swimlane-header px-4 py-3 bg-white/5 backdrop-blur-sm flex items-center justify-between cursor-pointer hover:bg-white/10 transition-colors",onClick:()=>t.collapsible&&d(i.id),style:{borderLeft:i.color?`4px solid ${i.color}`:void 0},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[i.icon&&jsxRuntime.jsx("span",{className:"text-2xl leading-none",children:i.icon}),jsxRuntime.jsx("h3",{className:"text-lg font-semibold",style:{color:i.color},children:i.title}),jsxRuntime.jsxs("span",{className:"text-sm text-white/50 font-medium",children:["(",i.cardIds.length," ",i.cardIds.length===1?"card":"cards",")"]})]}),t.collapsible&&jsxRuntime.jsx("button",{className:"text-white/50 hover:text-white transition-colors","aria-label":u?"Expand lane":"Collapse lane",children:u?"\u25B6":"\u25BC"})]}),!u&&jsxRuntime.jsx("div",{className:"asakaa-swimlane-content p-4",children:jsxRuntime.jsx(Ho,{board:p,callbacks:r,availableUsers:a})})]},i.id)}),l.length===0&&jsxRuntime.jsxs("div",{className:"text-center py-12 text-white/50",children:[jsxRuntime.jsx("p",{className:"text-lg",children:"No cards to display"}),jsxRuntime.jsx("p",{className:"text-sm mt-2",children:"Cards will appear here when they match the grouping criteria"})]})]})}var bd=[{value:"none",label:"No Grouping",icon:"\u{1F4CB}",description:"Standard Kanban board view"},{value:"assignee",label:"By Assignee",icon:"\u{1F465}",description:"Group cards by assigned user"},{value:"priority",label:"By Priority",icon:"\u{1F3AF}",description:"Group cards by priority level"},{value:"label",label:"By Label",icon:"\u{1F3F7}\uFE0F",description:"Group cards by label/tag"}];function hd({value:e,onChange:t,className:a}){let[r,n]=react.useState(false),s=react.useRef(null),o=react.useRef(null),l=bd.find(i=>i.value===e)||bd[0];react.useEffect(()=>{function i(u){s.current&&!s.current.contains(u.target)&&o.current&&!o.current.contains(u.target)&&n(false);}if(r)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[r]);let d=i=>{t(i),n(false);};return jsxRuntime.jsxs("div",{className:c("relative inline-block",a),children:[jsxRuntime.jsxs("button",{ref:o,onClick:()=>n(!r),className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-white/10 hover:bg-white/15 border border-white/20 transition-all text-sm font-medium text-white/90",children:[jsxRuntime.jsx("span",{className:"text-base leading-none",children:l.icon}),jsxRuntime.jsx("span",{children:l.label}),jsxRuntime.jsx("svg",{className:c("w-4 h-4 transition-transform",r&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsxRuntime.jsxs("div",{ref:s,className:"absolute top-full left-0 mt-2 min-w-[280px] rounded-lg bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl border border-white/20 shadow-2xl z-50 overflow-hidden",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b border-white/10",children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold text-white/70 uppercase tracking-wider",children:"Group By"})}),jsxRuntime.jsx("div",{className:"py-1",children:bd.map(i=>jsxRuntime.jsxs("button",{onClick:()=>d(i.value),className:c("w-full px-3 py-2 flex items-start gap-3 text-left transition-all hover:bg-white/10",e===i.value&&"bg-white/5"),children:[jsxRuntime.jsx("span",{className:"text-xl leading-none mt-0.5",children:i.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"font-semibold text-sm text-white",children:i.label}),e===i.value&&jsxRuntime.jsx("span",{className:"text-[#00E5CC] text-xs",children:"\u2713"})]}),jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-0.5",children:i.description})]})]},i.value))})]})]})}var ws=[{keys:"ArrowUp",action:"navigate_up",description:"Navigate to card above"},{keys:"ArrowDown",action:"navigate_down",description:"Navigate to card below"},{keys:"ArrowLeft",action:"navigate_left",description:"Navigate to previous column"},{keys:"ArrowRight",action:"navigate_right",description:"Navigate to next column"},{keys:"Enter",action:"open_card",description:"Open selected card"},{keys:"Escape",action:"close_modal",description:"Close modal or dialog"},{keys:"Delete",action:"delete_card",description:"Delete selected card",modifiers:{shift:true}},{keys:"n",action:"new_card",description:"Create new card",modifiers:{ctrl:true}},{keys:"k",action:"search",description:"Open search/command palette",modifiers:{ctrl:true}},{keys:"s",action:"save",description:"Save changes",modifiers:{ctrl:true}},{keys:"z",action:"undo",description:"Undo last action",modifiers:{ctrl:true}},{keys:"y",action:"redo",description:"Redo last undone action",modifiers:{ctrl:true}},{keys:"a",action:"select_all",description:"Select all cards",modifiers:{ctrl:true}},{keys:"Escape",action:"deselect_all",description:"Deselect all cards"},{keys:"?",action:"show_shortcuts",description:"Show keyboard shortcuts help",modifiers:{shift:true}}];function ax(e,t){if(!(Array.isArray(t.keys)?t.keys:[t.keys]).some(i=>e.key===i||e.code===i))return false;let n=t.modifiers||{},s=n.ctrl?e.ctrlKey||e.metaKey:!e.ctrlKey&&!e.metaKey,o=n.shift?e.shiftKey:!e.shiftKey,l=n.alt?e.altKey:!e.altKey,d=n.meta?e.metaKey:true;return s&&o&&l&&d}function qp(e={}){let{shortcuts:t=ws,enabled:a=true,preventDefault:r=true}=e,n=react.useRef(t),s=react.useRef(a);react.useEffect(()=>{n.current=t,s.current=a;},[t,a]);let o=react.useCallback(d=>{n.current=[...n.current,d];},[]),l=react.useCallback(d=>{n.current=n.current.filter(i=>i.action!==d);},[]);return react.useEffect(()=>{function d(i){if(!s.current)return;let u=i.target;if(!((u.tagName==="INPUT"||u.tagName==="TEXTAREA"||u.isContentEditable)&&i.key!=="Escape"&&!i.ctrlKey&&!i.metaKey)){for(let m of n.current)if(ax(i,m)){r&&i.preventDefault();let p=new CustomEvent("keyboard-action",{detail:m.action,bubbles:true,cancelable:true});window.dispatchEvent(p);break}}}return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[r]),{registerShortcut:o,unregisterShortcut:l,isEnabled:a}}function ox(e){return {ArrowUp:"\u2191",ArrowDown:"\u2193",ArrowLeft:"\u2190",ArrowRight:"\u2192",Enter:"\u21B5",Escape:"Esc",Delete:"Del"," ":"Space"}[e]||e.toUpperCase()}function nx(e){let t=[],a=typeof navigator<"u"&&navigator.platform.includes("Mac");return e.modifiers?.ctrl&&t.push(a?"\u2318":"Ctrl"),e.modifiers?.shift&&t.push("Shift"),e.modifiers?.alt&&t.push(a?"\u2325":"Alt"),e.modifiers?.meta&&t.push("\u2318"),t.join(" + ")}function sx(e){let t=Array.isArray(e.keys)?e.keys[0]:e.keys,a=nx(e),r=t?ox(t):"";return a?`${a} + ${r}`:r}function ix(e){let t={Navigation:[],Actions:[],Editing:[],Selection:[]};return e.forEach(a=>{a.action.includes("navigate")?t.Navigation?.push(a):a.action.includes("select")?t.Selection?.push(a):["undo","redo","save"].includes(a.action)?t.Editing?.push(a):t.Actions?.push(a);}),t}function yd({shortcuts:e=ws,isOpen:t,onClose:a,className:r}){let[n,s]=react.useState(false);if(react.useEffect(()=>{s(true);},[]),react.useEffect(()=>{function l(d){d.key==="Escape"&&t&&a();}if(t)return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,a]),!n||!t)return null;let o=ix(e);return jsxRuntime.jsxs("div",{className:c("fixed inset-0 z-[9999] flex items-center justify-center",r),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 backdrop-blur-sm bg-black/40 dark:bg-black/60",onClick:a}),jsxRuntime.jsxs("div",{className:"relative backdrop-blur-xl rounded-2xl border shadow-2xl max-w-3xl w-full mx-4 max-h-[80vh] overflow-hidden bg-white dark:bg-gradient-to-br dark:from-gray-900/95 dark:to-gray-800/95 border-gray-200 dark:border-white/20",children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b flex items-center justify-between border-gray-200 dark:border-white/10",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-2xl font-bold flex items-center gap-3 text-gray-900 dark:text-white",children:[jsxRuntime.jsx("span",{className:"text-3xl",children:"\u2328\uFE0F"}),"Keyboard Shortcuts"]}),jsxRuntime.jsx("p",{className:"text-sm mt-1 text-gray-500 dark:text-white/60",children:"Speed up your workflow with these shortcuts"})]}),jsxRuntime.jsx("button",{onClick:a,className:"transition-colors text-2xl leading-none p-2 rounded-lg text-gray-400 hover:text-gray-600 hover:bg-gray-100 dark:text-white/50 dark:hover:text-white dark:hover:bg-white/10","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"px-6 py-6 overflow-y-auto max-h-[calc(80vh-120px)]",children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:Object.entries(o).map(([l,d])=>d.length===0?null:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center gap-2 text-gray-800 dark:text-white/90",children:[jsxRuntime.jsx("span",{className:"w-1 h-5 bg-[#00E5CC] rounded-full"}),l]}),jsxRuntime.jsx("div",{className:"space-y-3",children:d.map(i=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-4 p-3 rounded-lg transition-colors bg-gray-50 hover:bg-gray-100 dark:bg-white/5 dark:hover:bg-white/10",children:[jsxRuntime.jsx("span",{className:"text-sm text-gray-700 dark:text-white/80",children:i.description}),jsxRuntime.jsx("kbd",{className:"px-3 py-1.5 border rounded-md text-xs font-mono shadow-sm whitespace-nowrap bg-white border-gray-300 text-gray-800 dark:bg-gradient-to-br dark:from-gray-700 dark:to-gray-800 dark:border-white/20 dark:text-white/90",children:sx(i)})]},i.action))})]},l))})}),jsxRuntime.jsx("div",{className:"px-6 py-4 border-t border-gray-200 bg-gray-50 dark:border-white/10 dark:bg-white/5",children:jsxRuntime.jsxs("p",{className:"text-xs text-center text-gray-500 dark:text-white/50",children:["Press ",jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded bg-gray-200 text-gray-600 dark:bg-white/10 dark:text-white/70",children:"?"})," to toggle this help panel"]})})]})]})}var xd=[{id:"bug-report",name:"Bug Report",description:"Report a bug or issue",icon:"\u{1F41B}",category:"Development",template:{title:"[BUG] ",description:`**Steps to reproduce:**
|
|
86
86
|
1.
|
|
87
87
|
|
|
88
88
|
**Expected behavior:**
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
1.
|
|
123
123
|
|
|
124
124
|
**Action items:**
|
|
125
|
-
- [ ] `,priority:"MEDIUM",labels:["meeting"]}}];function vd({templates:e,onSelectTemplate:t,className:a}){let[r,n]=react.useState(false),s=react.useRef(null),o=react.useRef(null);react.useEffect(()=>{function i(u){s.current&&!s.current.contains(u.target)&&o.current&&!o.current.contains(u.target)&&n(false);}if(r)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[r]);let l=i=>{t(i),n(false);},d=e.reduce((i,u)=>{let m=u.category||"Other";return i[m]||(i[m]=[]),i[m].push(u),i},{});return jsxRuntime.jsxs("div",{className:c("relative inline-block",a),children:[jsxRuntime.jsxs("button",{ref:o,onClick:()=>n(!r),className:"flex items-center gap-2 px-3 py-2 rounded-lg border transition-all text-sm font-medium shadow-lg",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-primary)"},onMouseEnter:i=>{i.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",i.currentTarget.style.borderColor="var(--theme-border-secondary)";},onMouseLeave:i=>{i.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",i.currentTarget.style.borderColor="var(--theme-border-primary)";},title:"Create from template",children:[jsxRuntime.jsx("span",{className:"text-base leading-none",children:"\u{1F4CB}"}),jsxRuntime.jsx("span",{children:"Templates"}),jsxRuntime.jsx("svg",{className:c("w-4 h-4 transition-transform",r&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsxRuntime.jsxs("div",{ref:s,className:"absolute top-full left-0 mt-2 min-w-[320px] max-w-[400px] rounded-xl backdrop-blur-xl border shadow-2xl z-50 overflow-hidden max-h-[500px] overflow-y-auto",style:{backgroundColor:"var(--theme-bg-primary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-4 py-3 border-b sticky top-0 backdrop-blur-sm",style:{borderColor:"var(--theme-border-primary)",backgroundColor:"var(--theme-bg-secondary)"},children:[jsxRuntime.jsx("span",{className:"text-sm font-bold uppercase tracking-wider",style:{color:"var(--theme-text-primary)"},children:"Card Templates"}),jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:"Quick start with pre-configured cards"})]}),Object.entries(d).map(([i,u])=>jsxRuntime.jsxs("div",{className:"py-2",children:[jsxRuntime.jsx("div",{className:"px-4 py-2",children:jsxRuntime.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--theme-text-secondary)"},children:i})}),jsxRuntime.jsx("div",{children:u.map(m=>jsxRuntime.jsxs("button",{onClick:()=>l(m),className:"w-full px-4 py-3 flex items-start gap-3 text-left transition-all active:scale-[0.98]",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-2xl leading-none mt-0.5",children:m.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"font-semibold text-sm",style:{color:"var(--theme-text-primary)"},children:m.name}),m.description&&jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:m.description})]})]},m.id))})]},i)),e.length===0&&jsxRuntime.jsx("div",{className:"px-4 py-8 text-center",style:{color:"var(--theme-text-tertiary)"},children:jsxRuntime.jsx("p",{className:"text-sm",children:"No templates available"})})]})]})}function kd({board:e,isOpen:t,onClose:a,onImport:r,boardElementRef:n,className:s}){let[o,l]=react.useState("export"),[d,i]=react.useState("json"),[u,m]=react.useState(null),p=react.useRef(null);if(!t)return null;let g=async()=>{let x=n?.current||void 0,y=await xu(e,d,x);vu(y,d);},f=async x=>{let y=x.target.files?.[0];if(y){try{let b=await Cu(y),h=y.name.endsWith(".json")?"json":"csv",v=ku(b,h);m(v),v.success&&r&&r(v,b);}catch(b){m({success:false,errors:[`Failed to read file: ${b instanceof Error?b.message:"Unknown error"}`]});}p.current&&(p.current.value="");}};return jsxRuntime.jsxs("div",{className:c("fixed inset-0 z-[9999] flex items-center justify-center",s),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:a}),jsxRuntime.jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-2xl w-full mx-4",children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsxRuntime.jsx("span",{className:"text-3xl",children:"\u{1F4E6}"}),"Export / Import"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Transfer your board data"})]}),jsxRuntime.jsx("button",{onClick:a,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"flex border-b border-white/10",children:[jsxRuntime.jsx("button",{onClick:()=>l("export"),className:c("flex-1 px-6 py-4 font-semibold transition-colors",o==="export"?"text-white border-b-2 border-[#00E5CC]":"text-white/50 hover:text-white/80"),children:"Export"}),jsxRuntime.jsx("button",{onClick:()=>l("import"),className:c("flex-1 px-6 py-4 font-semibold transition-colors",o==="import"?"text-white border-b-2 border-[#00E5CC]":"text-white/50 hover:text-white/80"),children:"Import"})]}),jsxRuntime.jsxs("div",{className:"p-6",children:[o==="export"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Select format"}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-3",children:["json","csv","pdf"].map(x=>jsxRuntime.jsxs("button",{onClick:()=>i(x),className:c("p-4 rounded-lg border-2 transition-all text-center",d===x?"border-[#00E5CC] bg-[#00E5CC]/20 text-white":"border-white/20 hover:border-white/40 text-white/70 hover:text-white"),children:[jsxRuntime.jsxs("div",{className:"text-2xl mb-2",children:[x==="json"&&"\u{1F4C4}",x==="csv"&&"\u{1F4CA}",x==="pdf"&&"\u{1F4DD}"]}),jsxRuntime.jsx("div",{className:"font-semibold uppercase text-xs",children:x})]},x))})]}),jsxRuntime.jsxs("div",{className:"bg-white/5 rounded-lg p-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:"Preview"}),jsxRuntime.jsxs("div",{className:"text-xs text-white/60",children:[jsxRuntime.jsxs("div",{children:["Board: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.title||"Untitled"})]}),jsxRuntime.jsxs("div",{children:["Columns: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.columns.length})]}),jsxRuntime.jsxs("div",{children:["Cards: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.cards.length})]})]})]}),jsxRuntime.jsx("button",{onClick:g,className:"w-full py-3 px-4 bg-gradient-to-r from-[#00C4AE] to-[#00C4AE] hover:from-[#00E5CC] hover:to-[#00C4AE] text-white font-semibold rounded-lg transition-all shadow-lg shadow-[#00E5CC]/20",children:"Export Board"})]}),o==="import"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Upload file"}),jsxRuntime.jsx("input",{ref:p,type:"file",accept:".json,.csv",onChange:f,className:"hidden"}),jsxRuntime.jsxs("button",{onClick:()=>p.current?.click(),className:"w-full py-12 px-4 border-2 border-dashed border-white/30 hover:border-white/50 rounded-lg transition-colors text-white/70 hover:text-white",children:[jsxRuntime.jsx("div",{className:"text-5xl mb-3",children:"\u{1F4C1}"}),jsxRuntime.jsx("div",{className:"font-semibold mb-1",children:"Click to select file"}),jsxRuntime.jsx("div",{className:"text-xs text-white/50",children:"Supports JSON and CSV files"})]})]}),u&&jsxRuntime.jsxs("div",{className:c("p-4 rounded-lg",u.success?"bg-green-500/20 border border-green-500/30":"bg-red-500/20 border border-red-500/30"),children:[jsxRuntime.jsx("h3",{className:c("font-semibold mb-2",u.success?"text-green-400":"text-red-400"),children:u.success?"\u2713 Import Successful":"\u2717 Import Failed"}),u.success&&jsxRuntime.jsxs("div",{className:"text-sm text-white/80",children:[jsxRuntime.jsxs("div",{children:["Cards imported: ",u.cardsImported]}),jsxRuntime.jsxs("div",{children:["Columns imported: ",u.columnsImported]})]}),u.errors&&u.errors.length>0&&jsxRuntime.jsx("div",{className:"mt-2 text-sm",children:u.errors.map((x,y)=>jsxRuntime.jsxs("div",{className:"text-red-300",children:["\u2022 ",x]},y))})]})]})]})]})]})}var px=["URGENT","HIGH","MEDIUM","LOW"],mx=[{value:"none",label:"None"},{value:"created",label:"Date Created"},{value:"priority",label:"Priority"},{value:"dueDate",label:"Due Date"},{value:"title",label:"Title"},{value:"estimate",label:"Estimate"}],gx=[{value:"none",label:"No Grouping"},{value:"priority",label:"By Priority"},{value:"assignee",label:"By Assignee"},{value:"label",label:"By Label"}];function Cd({filters:e,sort:t,onFiltersChange:a,onSortChange:r,onReset:n,onFilterMyTasks:s,onFilterOverdue:o,onFilterHighPriority:l,availableUsers:d=[],availableLabels:i=[],availableColumns:u=[],showQuickFilters:m=true,compact:p=false,groupBy:g="none",onGroupByChange:f}){let[x,y]=react.useState(true),b=react.useCallback(S=>{a({search:S.target.value});},[a]),h=react.useCallback(S=>{a({dateFilter:S.target.value});},[a]),v=react.useCallback(S=>{r({by:S.target.value});},[r]),w=react.useCallback(()=>{r({order:t.order==="asc"?"desc":"asc"});},[t.order,r]),D=e.search||e.dateFilter!=="all"||e.priorities.length>0||e.assignees.length>0||e.labels.length>0||t.by!=="none";return jsxRuntime.jsxs("div",{className:`filter-bar ${p?"filter-bar--compact":""} ${x?"filter-bar--collapsed":""}`,children:[jsxRuntime.jsxs("div",{className:"filter-bar__header",onClick:()=>y(!x),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",marginBottom:x?"0":"12px",padding:"4px 6px",borderRadius:"6px",transition:"all 0.2s ease"},onMouseEnter:S=>{S.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:x?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--theme-text-secondary)"},children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})}),jsxRuntime.jsx("span",{className:"filter-bar__label",style:{fontWeight:500,fontSize:"0.875rem",color:"var(--theme-text-primary)"},children:"Filters & Grouping"}),D&&jsxRuntime.jsxs("span",{style:{color:"var(--theme-accent-primary)",fontSize:"0.75rem",fontWeight:600},children:["(",[e.search&&"search",e.dateFilter!=="all"&&"date",e.priorities.length>0&&"priority",e.assignees.length>0&&"assignee",e.labels.length>0&&"label",t.by!=="none"&&"sort"].filter(Boolean).length," active)"]})]}),!x&&jsxRuntime.jsxs("div",{className:"filter-bar__content",children:[m&&jsxRuntime.jsxs("div",{className:"filter-bar__quick",style:{marginBottom:"12px"},children:[jsxRuntime.jsx("span",{className:"filter-bar__label",children:"Quick:"}),s&&jsxRuntime.jsx("button",{onClick:s,className:"filter-bar__quick-btn",title:"Show only my tasks",children:"My Tasks"}),o&&jsxRuntime.jsx("button",{onClick:o,className:"filter-bar__quick-btn",title:"Show overdue tasks",children:"Overdue"}),l&&jsxRuntime.jsx("button",{onClick:l,className:"filter-bar__quick-btn",title:"Show high priority tasks",children:"High Priority"})]}),jsxRuntime.jsxs("div",{className:"filter-bar__main",children:[jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("input",{type:"text",placeholder:"Search tasks...",value:e.search,onChange:b,className:"filter-bar__search"})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.dateFilter,onChange:h,className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Dates"}),jsxRuntime.jsx("option",{value:"overdue",children:"Overdue"}),jsxRuntime.jsx("option",{value:"today",children:"Today"}),jsxRuntime.jsx("option",{value:"this-week",children:"This Week"})]})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.priorities[0]||"all",onChange:S=>{let M=S.target.value;a({priorities:M==="all"?[]:[M]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Priorities"}),px.map(S=>jsxRuntime.jsx("option",{value:S,children:S},S))]})}),d.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.assignees[0]||"all",onChange:S=>{let M=S.target.value;a({assignees:M==="all"?[]:[M]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Assignees"}),d.map(S=>jsxRuntime.jsx("option",{value:S.id,children:S.name},S.id))]})}),i.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.labels[0]||"all",onChange:S=>{let M=S.target.value;a({labels:M==="all"?[]:[M]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Labels"}),i.map(S=>jsxRuntime.jsx("option",{value:S,children:S},S))]})}),jsxRuntime.jsxs("div",{className:"filter-bar__field filter-bar__sort",children:[jsxRuntime.jsx("span",{className:"filter-bar__label",style:{color:"var(--theme-text-secondary)"},children:"Sort:"}),jsxRuntime.jsx("select",{value:t.by,onChange:v,className:"filter-bar__select filter-bar__select--sm",children:mx.map(S=>jsxRuntime.jsx("option",{value:S.value,children:S.label},S.value))}),t.by!=="none"&&jsxRuntime.jsx("button",{onClick:w,className:"filter-bar__sort-toggle",title:`Sort ${t.order==="asc"?"descending":"ascending"}`,children:t.order==="asc"?"\u2191":"\u2193"})]}),f&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("select",{value:g,onChange:S=>f(S.target.value),className:"filter-bar__select",style:{fontWeight:500,borderWidth:"2px"},children:gx.map(S=>jsxRuntime.jsx("option",{value:S.value,children:S.label},S.value))})}),D&&jsxRuntime.jsx("button",{onClick:n,className:"filter-bar__reset",title:"Clear all filters",children:"Clear"})]})]})]})}function Td({onOpenExport:e,onOpenThemes:t,onOpenShortcuts:a,className:r,viewMode:n="kanban",onExportGanttPDF:s,onExportGanttExcel:o,onExportGanttPNG:l,onExportGanttCSV:d}){let[i,u]=react.useState(false),m=react.useRef(null);react.useEffect(()=>{let g=f=>{m.current&&!m.current.contains(f.target)&&u(false);};return i&&document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g);}},[i]);let p=g=>{g(),u(false);};return jsxRuntime.jsxs("div",{className:c("relative",r),ref:m,children:[jsxRuntime.jsxs("button",{onClick:()=>u(!i),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all border",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-secondary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",g.currentTarget.style.color="var(--theme-text-primary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",g.currentTarget.style.color="var(--theme-text-secondary)";},"aria-label":"Configuration Menu","aria-expanded":i,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:"3"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6M5.6 5.6l4.2 4.2m4.2 4.2l4.2 4.2M1 12h6m6 0h6M5.6 18.4l4.2-4.2m4.2-4.2l4.2-4.2"})]}),jsxRuntime.jsx("span",{children:"Config"})]}),i&&jsxRuntime.jsxs("div",{className:"absolute right-0 mt-2 w-48 rounded-lg border shadow-lg overflow-hidden z-50",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[n==="kanban"?jsxRuntime.jsxs("button",{onClick:()=>p(e),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Export"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:()=>p(async()=>await s?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Export PDF"]}),jsxRuntime.jsxs("button",{onClick:()=>p(async()=>await o?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),jsxRuntime.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),"Export Excel"]}),jsxRuntime.jsxs("button",{onClick:()=>p(async()=>await l?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},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",ry:"2"}),jsxRuntime.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),jsxRuntime.jsx("polyline",{points:"21 15 16 10 5 21"})]}),"Export PNG"]}),jsxRuntime.jsxs("button",{onClick:()=>p(()=>d?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),jsxRuntime.jsx("line",{x1:"8",y1:"17",x2:"16",y2:"17"})]}),"Export CSV"]})]}),jsxRuntime.jsxs("button",{onClick:()=>p(t),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},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:"5"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6m8.5-8.5L17 15M7 9L3.5 5.5M7 15l-3.5 3.5M20.5 5.5L17 9m3.5 11.5L17 17"})]}),"Themes"]}),jsxRuntime.jsxs("button",{onClick:()=>p(a),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),jsxRuntime.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M8 12h.01M12 12h.01M16 12h.01M7 16h10"})]}),"Shortcuts"]})]})]})}var Nd={name:"dark",displayName:"Dark (Enhanced)",emoji:"\u{1F319}",colors:{bgPrimary:"#222326",bgSecondary:"#2A2B2F",bgTertiary:"#33343A",bgCard:"#2d2d2d",bgHover:"#353535",bgActive:"#404040",bgInput:"#2a2a2a",textPrimary:"#F4F5F8",textSecondary:"#AEB6C0",textTertiary:"#7A7F8A",textDisabled:"#606060",textInverse:"#1a1a1a",borderPrimary:"rgba(255, 255, 255, 0.1)",borderSecondary:"rgba(255, 255, 255, 0.05)",borderDefault:"#404040",borderHover:"#505050",borderSubtle:"#2a2a2a",accentPrimary:"#5E6AD2",accentHover:"#7780DD",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.1)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.2)",success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#00E5CC",danger:"#ef4444",dangerBorder:"rgba(239, 68, 68, 0.3)",dangerBackground:"rgba(239, 68, 68, 0.1)",dangerBackgroundHover:"rgba(239, 68, 68, 0.2)"},shadows:{sm:"0 1px 2px rgba(0, 0, 0, 0.3)",md:"0 4px 12px rgba(0, 0, 0, 0.4)",lg:"0 12px 32px rgba(0, 0, 0, 0.5)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Dd={name:"light",displayName:"Light (Standard)",emoji:"\u2600\uFE0F",colors:{bgPrimary:"#FFFFFF",bgSecondary:"#F7F7F8",bgTertiary:"#EEEFF1",bgCard:"#ffffff",bgHover:"#f3f4f6",bgActive:"#e5e7eb",bgInput:"#f9fafb",textPrimary:"#1A1A1A",textSecondary:"#5A5A5A",textTertiary:"#8A8A8A",textDisabled:"#d1d5db",textInverse:"#ffffff",borderPrimary:"rgba(0, 0, 0, 0.1)",borderSecondary:"rgba(0, 0, 0, 0.05)",borderDefault:"#e5e7eb",borderHover:"#d1d5db",borderSubtle:"#f3f4f6",accentPrimary:"#5E6AD2",accentHover:"#4A56B8",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.08)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.15)",success:"#059669",warning:"#D97706",error:"#DC2626",info:"#00E5CC",danger:"#dc2626",dangerBorder:"rgba(220, 38, 38, 0.3)",dangerBackground:"rgba(220, 38, 38, 0.08)",dangerBackgroundHover:"rgba(220, 38, 38, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.12)",md:"0 4px 12px rgba(0, 0, 0, 0.15)",lg:"0 12px 32px rgba(0, 0, 0, 0.2)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Sd={name:"neutral",emoji:"\u26AA",displayName:"Neutral (Zen)",colors:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgTertiary:"#E7E5E4",bgCard:"#FEFEFE",bgHover:"#F0EFEE",bgActive:"#E7E5E4",bgInput:"#FAFAF9",textPrimary:"#1C1917",textSecondary:"#57534E",textTertiary:"#A8A29E",textDisabled:"#D6D3D1",textInverse:"#FAFAF9",borderPrimary:"#E7E5E4",borderSecondary:"#F0EFEE",borderDefault:"#E7E5E4",borderHover:"#D6D3D1",borderSubtle:"#F5F5F4",accentPrimary:"#292524",accentHover:"#44403C",interactivePrimary:"#292524",interactivePrimaryHover:"#44403C",interactivePrimaryBorder:"rgba(41, 37, 36, 0.3)",interactivePrimaryBackground:"rgba(41, 37, 36, 0.06)",interactivePrimaryBackgroundHover:"rgba(41, 37, 36, 0.12)",success:"#15803D",warning:"#CA8A04",error:"#B91C1C",info:"#1D4ED8",danger:"#B91C1C",dangerBorder:"rgba(185, 28, 28, 0.3)",dangerBackground:"rgba(185, 28, 28, 0.08)",dangerBackgroundHover:"rgba(185, 28, 28, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.1)",md:"0 4px 12px rgba(0, 0, 0, 0.12)",lg:"0 12px 32px rgba(0, 0, 0, 0.15)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},un={dark:Nd,light:Dd,neutral:Sd},Di="dark";var Si=react.createContext(void 0),Tx="asakaa-theme";function Jp({children:e,defaultTheme:t=Di,storageKey:a=Tx}){let[r,n]=react.useState(()=>{if(typeof window<"u"){let l=localStorage.getItem(a);if(l&&(l==="dark"||l==="light"||l==="neutral"))return l}return t}),s=react.useCallback(l=>{n(l),typeof window<"u"&&localStorage.setItem(a,l);},[a]);react.useEffect(()=>{if(typeof window>"u")return;let l=document.documentElement,d=un[r];Object.entries(d.colors).forEach(([u,m])=>{m&&l.style.setProperty(`--theme-${Nx(u)}`,m);}),Object.entries({bgPrimary:"--asakaa-color-background-primary",bgSecondary:"--asakaa-color-background-secondary",bgTertiary:"--asakaa-color-background-tertiary",bgCard:"--asakaa-color-background-card",bgHover:"--asakaa-color-background-hover",bgActive:"--asakaa-color-background-active",bgInput:"--asakaa-color-background-input",textPrimary:"--asakaa-color-text-primary",textSecondary:"--asakaa-color-text-secondary",textTertiary:"--asakaa-color-text-tertiary",textDisabled:"--asakaa-color-text-disabled",textInverse:"--asakaa-color-text-inverse",borderPrimary:"--asakaa-color-border-primary",borderSecondary:"--asakaa-color-border-secondary",borderDefault:"--asakaa-color-border-default",borderHover:"--asakaa-color-border-hover",borderSubtle:"--asakaa-color-border-subtle",accentPrimary:"--asakaa-color-accent-primary",accentHover:"--asakaa-color-accent-hover",interactivePrimary:"--asakaa-color-interactive-primary",interactivePrimaryHover:"--asakaa-color-interactive-primaryHover",interactivePrimaryBorder:"--asakaa-color-interactive-primaryBorder",interactivePrimaryBackground:"--asakaa-color-interactive-primaryBackground",interactivePrimaryBackgroundHover:"--asakaa-color-interactive-primaryBackgroundHover",success:"--asakaa-color-status-success",warning:"--asakaa-color-status-warning",error:"--asakaa-color-status-error",info:"--asakaa-color-status-info",danger:"--asakaa-color-danger",dangerBorder:"--asakaa-color-danger-border",dangerBackground:"--asakaa-color-danger-background",dangerBackgroundHover:"--asakaa-color-danger-backgroundHover"}).forEach(([u,m])=>{let p=d.colors[u];p&&l.style.setProperty(m,p);}),l.setAttribute("data-theme",r),l.classList.remove("theme-dark","theme-light","theme-neutral"),l.classList.add(`theme-${r}`);},[r]);let o={theme:r,setTheme:s,themes:un};return jsxRuntime.jsx(Si.Provider,{value:o,children:e})}function Rn(){let e=react.useContext(Si);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function Nx(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ed({isOpen:e,onClose:t,className:a}){let{theme:r,setTheme:n}=Rn();return e?jsxRuntime.jsxs("div",{className:c("fixed inset-0 z-[9999] flex items-center justify-center",a),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t}),jsxRuntime.jsxs("div",{className:"relative rounded-2xl border shadow-2xl max-w-md w-full mx-4",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b flex items-center justify-between",style:{borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsx("h2",{className:"text-2xl font-bold",style:{color:"var(--theme-text-primary)"},children:"Select Theme"}),jsxRuntime.jsx("button",{onClick:t,className:"text-2xl leading-none p-2 hover:bg-white/10 rounded-lg transition-colors",style:{color:"var(--theme-text-secondary)"},"aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"p-6 space-y-3",children:Object.entries(un).map(([s,o])=>jsxRuntime.jsxs("button",{onClick:()=>{n(s),t();},className:c("w-full p-4 rounded-lg border-2 transition-all flex items-center gap-4",r===s?"border-[#00E5CC] bg-[#00E5CC]/20":"border-white/20 hover:border-white/40"),style:{backgroundColor:r===s?"var(--theme-accent-primary)20":"transparent"},children:[jsxRuntime.jsx("div",{className:"text-3xl",children:o.emoji}),jsxRuntime.jsxs("div",{className:"text-left flex-1",children:[jsxRuntime.jsx("div",{className:"font-semibold",style:{color:"var(--theme-text-primary)"},children:o.displayName}),jsxRuntime.jsxs("div",{className:"text-xs",style:{color:"var(--theme-text-secondary)"},children:[s==="dark"&&"Default dark theme with Linear-inspired colors",s==="light"&&"Clean light theme with high contrast",s==="neutral"&&"Monochrome zen theme"]})]}),r===s&&jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5"})})]},s))})]})]}):null}function Qp(e="dark"){if(typeof window>"u"||typeof getComputedStyle>"u")return gt[e]||gt.dark;let t=document.documentElement,a=getComputedStyle(t),r=(s,o)=>a.getPropertyValue(s).trim()||o;return {bgPrimary:r("--theme-bg-primary",gt[e].bgPrimary),bgSecondary:r("--theme-bg-secondary",gt[e].bgSecondary),bgGrid:r("--theme-bg-card",gt[e].bgGrid),bgWeekend:r("--theme-bg-hover",gt[e].bgWeekend),border:r("--theme-border-primary",gt[e].border),borderLight:r("--theme-border-subtle",gt[e].borderLight),textPrimary:r("--theme-text-primary",gt[e].textPrimary),textSecondary:r("--theme-text-secondary",gt[e].textSecondary),textTertiary:r("--theme-text-tertiary",gt[e].textTertiary),accent:r("--theme-accent-primary",gt[e].accent),accentHover:r("--theme-accent-hover",gt[e].accentHover),accentLight:r("--theme-accent-primary",gt[e].accentLight),taskBarPrimary:r("--theme-accent-primary",gt[e].taskBarPrimary),taskBarProgress:r("--theme-accent-hover",gt[e].taskBarProgress),taskBarHandle:r("--theme-text-inverse",gt[e].taskBarHandle||"#FFFFFF"),dependency:r("--theme-border-secondary",gt[e].dependency),dependencyHover:r("--theme-border-secondary",gt[e].dependencyHover),criticalPath:r("--theme-error",gt[e].criticalPath),criticalPathLight:r("--theme-error",gt[e].criticalPathLight),today:e==="light"?r("--theme-accent-primary",gt[e].today):e==="neutral"?r("--theme-text-primary",gt[e].today):r("--theme-error",gt[e].today),todayLight:e==="light"?r("--theme-accent-primary",gt[e].todayLight):e==="neutral"?r("--theme-text-primary",gt[e].todayLight):r("--theme-error",gt[e].todayLight),milestone:r("--theme-warning",gt[e].milestone),milestoneLight:r("--theme-warning",gt[e].milestoneLight),statusTodo:r("--theme-text-tertiary",gt[e].statusTodo),statusInProgress:r("--theme-accent-primary",gt[e].statusInProgress),statusCompleted:r("--theme-success",gt[e].statusCompleted),hoverBg:r("--theme-bg-hover",gt[e].hoverBg),focusRing:r("--theme-accent-primary",gt[e].focusRing),...gt[e].dotGrid&&{dotGrid:gt[e].dotGrid},...gt[e].glassHeader&&{glassHeader:gt[e].glassHeader},...gt[e].glassToolbar&&{glassToolbar:gt[e].glassToolbar},...gt[e].forecastHud&&{forecastHud:gt[e].forecastHud},...gt[e].neonRedGlow&&{neonRedGlow:gt[e].neonRedGlow},...gt[e].executionBarBg&&{executionBarBg:gt[e].executionBarBg}}}var Ei={columns:{taskName:"TASK NAME",startDate:"Start Date",endDate:"End Date",duration:"Duration",assignees:"Assignees",status:"Status",progress:"% Complete",priority:"Priority"},toolbar:{today:"Today",day:"Day",week:"Week",month:"Month",export:"Export",exportPdf:"Export to PDF",exportPng:"Export to PNG",exportCsv:"Export to CSV",exportExcel:"Export to Excel",exportMsProject:"Export to MS Project",undo:"Undo",redo:"Redo",createTask:"New Task",density:"Row Density",compact:"Compact",normal:"Normal",spacious:"Spacious",filterAll:"All",filterIncomplete:"Incomplete",filterInProgress:"In Progress",filterCompleted:"Completed",filter:"Filters",filterBy:"FILTER BY STATUS",filterAllDesc:"Show all tasks",filterIncompleteDesc:"Hide completed tasks",filterInProgressDesc:"Tasks currently being worked on",filterCompletedDesc:"Only show finished tasks",clearFilter:"Clear filter",hideCompleted:"Hide Completed Tasks",toDo:"To Do / Pending",wbsLevel:"Level",wbsAllLevels:"All",viewExecution:"Execution",viewOracle:"Pulse View",simulateScenario:"Simulate Scenario",projectForecast:"PROJECT FORECAST",expectedFinish:"Expected Finish",confidence:"Confidence",costAtCompletion:"Cost at Completion",delayLabel:"Delay",earlyLabel:"Early",onTimeLabel:"On Time",budgetOver:"Over",budgetUnder:"Under",baselines:"Baselines",visibility:"Visibility",share:"Share",copySnapshotLink:"Copy Snapshot Link",copied:"Copied!"},contextMenu:{editTask:"Edit Task",addSubtask:"Add Subtask",markIncomplete:"Mark Incomplete",setInProgress:"Set In Progress",markComplete:"Mark Complete",duplicateTask:"Duplicate Task",splitTask:"Split Task",deleteTask:"Delete Task"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",addSubtask:"Add Subtask",indent:"Indent",outdent:"Outdent",moveUp:"Move Up",moveDown:"Move Down",splitTask:"Split Task",linkTasks:"Link Tasks",unlinkTasks:"Unlink Tasks"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{progress:"Progress",duration:"Duration",days:"days",day:"day",assigned:"Assigned",milestone:"Milestone",criticalPath:"Critical Path",subtask:"Subtask",task:"Task",noTasks:"No tasks yet",addTask:"Add task",newTask:"New Task",loading:"Loading...",error:"Error",today:"Today",week:"Week",clickToSetDates:"Click to set dates..."},ai:{placeholder:'Ask AI to edit tasks... (e.g., "Move Design to next week")',thinking:"Thinking...",suggestions:{moveTask:'Move "Task Name" to next Monday',extendTask:'Extend "Task Name" by 3 days',renameTask:'Rename "Old Name" to "New Name"',setProgress:'Set "Task Name" progress to 50%',linkTasks:'Link "Task A" to "Task B"',createTask:'Create a new task called "New Task"',deleteTask:'Delete "Task Name"',assignTask:'Assign John to "Task Name"'},errors:{taskNotFound:"Task not found",invalidDate:"Invalid date",invalidDuration:"Invalid duration",invalidProgress:"Invalid progress value",unknownCommand:"Unknown command",processingError:"Error processing command"}},export:{projectName:"Gantt Project",ganttTasks:"Gantt Tasks",taskId:"Task ID",taskName:"Task Name",startDate:"Start Date",endDate:"End Date",isMilestone:"Is Milestone",parentId:"Parent ID",yes:"Yes",no:"No",noTasksToExport:"No tasks available to export"},dateFormat:{short:"MM/dd",medium:"MMM d",long:"MMMM d, yyyy"}},Zp={columns:{taskName:"NOMBRE DE TAREA",startDate:"Fecha Inicio",endDate:"Fecha Fin",duration:"Duraci\xF3n",assignees:"Asignados",status:"Estado",progress:"% Completado",priority:"Prioridad"},toolbar:{today:"Hoy",day:"D\xEDa",week:"Semana",month:"Mes",export:"Exportar",exportPdf:"Exportar a PDF",exportPng:"Exportar a PNG",exportCsv:"Exportar a CSV",exportExcel:"Exportar a Excel",exportMsProject:"Exportar a MS Project",undo:"Deshacer",redo:"Rehacer",createTask:"Nueva Tarea",density:"Densidad",compact:"Compacto",normal:"Normal",spacious:"Espacioso",filterAll:"Todas",filterIncomplete:"Sin completar",filterInProgress:"En progreso",filterCompleted:"Completadas",filter:"Filtros",filterBy:"FILTRAR POR ESTADO",filterAllDesc:"Mostrar todas las tareas",filterIncompleteDesc:"Ocultar tareas completadas",filterInProgressDesc:"Tareas en las que se est\xE1 trabajando",filterCompletedDesc:"Solo mostrar tareas terminadas",clearFilter:"Limpiar filtro",hideCompleted:"Ocultar Tareas Completadas",toDo:"Por Hacer / Pendiente",wbsLevel:"Nivel",wbsAllLevels:"Todos",viewExecution:"Ejecuci\xF3n",viewOracle:"Vista Pulse",simulateScenario:"Simular Escenario",projectForecast:"PRON\xD3STICO DEL PROYECTO",expectedFinish:"Fin Estimado",confidence:"Confianza",costAtCompletion:"Costo al Completar",delayLabel:"Retraso",earlyLabel:"Adelanto",onTimeLabel:"A Tiempo",budgetOver:"Excedido",budgetUnder:"Bajo",baselines:"L\xEDneas Base",visibility:"Visibilidad",share:"Compartir",copySnapshotLink:"Copiar enlace de vista",copied:"\xA1Copiado!"},contextMenu:{editTask:"Editar Tarea",addSubtask:"Agregar Subtarea",markIncomplete:"Marcar Incompleta",setInProgress:"Marcar En Progreso",markComplete:"Marcar Completada",duplicateTask:"Duplicar Tarea",splitTask:"Dividir Tarea",deleteTask:"Eliminar Tarea"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",addSubtask:"Agregar Subtarea",indent:"Aumentar Nivel",outdent:"Disminuir Nivel",moveUp:"Mover Arriba",moveDown:"Mover Abajo",splitTask:"Dividir Tarea",linkTasks:"Vincular Tareas",unlinkTasks:"Desvincular Tareas"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{progress:"Progreso",duration:"Duraci\xF3n",days:"d\xEDas",day:"d\xEDa",assigned:"Asignado",milestone:"Hito",criticalPath:"Ruta Cr\xEDtica",subtask:"Subtarea",task:"Tarea",noTasks:"Sin tareas a\xFAn",addTask:"Agregar tarea",newTask:"Nueva Tarea",loading:"Cargando...",error:"Error",today:"Hoy",week:"Semana",clickToSetDates:"Clic para establecer fechas..."},ai:{placeholder:'P\xEDdele a la IA que edite tareas... (ej: "Mover Dise\xF1o a la pr\xF3xima semana")',thinking:"Pensando...",suggestions:{moveTask:'Mover "Nombre de Tarea" al pr\xF3ximo lunes',extendTask:'Extender "Nombre de Tarea" por 3 d\xEDas',renameTask:'Renombrar "Nombre Anterior" a "Nombre Nuevo"',setProgress:'Establecer progreso de "Nombre de Tarea" al 50%',linkTasks:'Vincular "Tarea A" con "Tarea B"',createTask:'Crear una nueva tarea llamada "Nueva Tarea"',deleteTask:'Eliminar "Nombre de Tarea"',assignTask:'Asignar a Juan a "Nombre de Tarea"'},errors:{taskNotFound:"Tarea no encontrada",invalidDate:"Fecha inv\xE1lida",invalidDuration:"Duraci\xF3n inv\xE1lida",invalidProgress:"Valor de progreso inv\xE1lido",unknownCommand:"Comando desconocido",processingError:"Error procesando el comando"}},export:{projectName:"Proyecto Gantt",ganttTasks:"Tareas Gantt",taskId:"ID de Tarea",taskName:"Nombre de Tarea",startDate:"Fecha Inicio",endDate:"Fecha Fin",isMilestone:"Es Hito",parentId:"ID Padre",yes:"S\xED",no:"No",noTasksToExport:"No hay tareas disponibles para exportar"},dateFormat:{short:"dd/MM",medium:"d MMM",long:"d de MMMM de yyyy"}},Md={en:Ei,es:Zp};function em(e){return Md[e]||Md.en}function Pd(e,t){let a=em(e);return t?{columns:{...a.columns,...t.columns},toolbar:{...a.toolbar,...t.toolbar},contextMenu:{...a.contextMenu,...t.contextMenu},actions:{...a.actions,...t.actions},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},ai:{...a.ai,...t.ai,suggestions:{...a.ai.suggestions,...t.ai?.suggestions},errors:{...a.ai.errors,...t.ai?.errors}},export:{...a.export,...t.export},dateFormat:{...a.dateFormat,...t.dateFormat}}:a}var $n=react.createContext(Ei);function Hr(){return react.useContext($n)}function Ts(e,t,a="left",r=208){let[n,s]=react.useState({top:0,left:0});return react.useEffect(()=>{if(!t||!e.current)return;let o=e.current.getBoundingClientRect(),l=o.bottom+4,d;a==="right"?d=o.right-r:d=o.left;let i=8;d+r>window.innerWidth-i&&(d=window.innerWidth-i-r),d<i&&(d=i),s({top:l,left:d});},[t,a,e,r]),n}function dm({theme:e,onExportPNG:t,onExportPDF:a,onExportExcel:r,onExportCSV:n,onExportJSON:s,onExportMSProject:o}){let[l,d]=react.useState(false),[i,u]=react.useState(null),m=react.useRef(null),p=react.useRef(null),g=Hr(),f=Ts(m,l,"right",176);if(react.useEffect(()=>{if(!l)return;let h=v=>{let w=v.target;m.current&&!m.current.contains(w)&&p.current&&!p.current.contains(w)&&d(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[l]),!(t||a||r||n||s||o))return null;let y=[{id:"png",label:"PNG",description:"Image",icon:jsxRuntime.jsx(lucideReact.FileImage,{className:"w-4 h-4"}),handler:t},{id:"pdf",label:"PDF",description:"Document",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:a},{id:"excel",label:"Excel",description:"Spreadsheet",icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-4 h-4"}),handler:r},{id:"csv",label:"CSV",description:"Comma-separated",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:n},{id:"json",label:"JSON",description:"Data",icon:jsxRuntime.jsx(lucideReact.FileJson,{className:"w-4 h-4"}),handler:s},{id:"msproject",label:"MS Project",description:"XML",icon:jsxRuntime.jsx(lucideReact.FolderKanban,{className:"w-4 h-4"}),handler:o}].filter(h=>h.handler),b=async(h,v)=>{if(v){u(h);try{await v();}catch(w){console.error(`Export ${h} failed:`,w);}finally{u(null),d(false);}}};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:m,onClick:()=>d(!l),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{backgroundColor:l?e.accent:e.bgSecondary,border:`1px solid ${l?e.accent:e.borderLight}`,color:l?"#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:g.toolbar.export}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:l?"rotate(180deg)":"rotate(0deg)"}})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:l&&jsxRuntime.jsx(framerMotion.motion.div,{ref:p,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-44 rounded-xl overflow-hidden",style:{top:f.top,left:f.left,zIndex:99999,backgroundColor:e.bgPrimary==="#050505"?"rgba(10, 10, 10, 0.95)":e.bgSecondary,border:`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.08)":e.border}`,boxShadow:e.bgPrimary==="#050505"?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:jsxRuntime.jsx("div",{className:"py-1",children:y.map((h,v)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>b(h.id,h.handler),disabled:i!==null,className:"w-full flex items-center gap-2.5 px-3 py-2 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:v<y.length-1?`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.borderLight}`:"none",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:v*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:i===h.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"})}):h.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-[11px] font-medium truncate",style:{color:e.textPrimary},children:h.label}),jsxRuntime.jsx("div",{className:"text-[9px] truncate",style:{color:e.textTertiary},children:h.description})]})]},h.id))})})}),document.body)]})}function am({theme:e,onExportPNG:t,onExportPDF:a,onExportExcel:r,onExportMSProject:n,onCopySnapshotLink:s}){let[o,l]=react.useState(false),[d,i]=react.useState(null),[u,m]=react.useState(false),p=react.useRef(null),g=react.useRef(null),f=Hr(),x=Ts(p,o,"right",224),y=e.bgPrimary==="#050505"||(e.bgPrimary||"").charAt(1)==="0",b=f.toolbar.visibility==="Visibilidad";react.useEffect(()=>{if(!o)return;let D=S=>{let M=S.target;p.current&&!p.current.contains(M)&&g.current&&!g.current.contains(M)&&l(false);};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[o]);let h=[{id:"png",label:f.toolbar.exportPng,icon:jsxRuntime.jsx(lucideReact.FileImage,{className:"w-3.5 h-3.5"}),handler:t},{id:"pdf",label:f.toolbar.exportPdf,icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-3.5 h-3.5"}),handler:a},{id:"excel",label:f.toolbar.exportExcel,icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-3.5 h-3.5"}),handler:r},{id:"msproject",label:f.toolbar.exportMsProject,icon:jsxRuntime.jsx(lucideReact.FolderKanban,{className:"w-3.5 h-3.5"}),handler:n}].filter(D=>D.handler),v=async(D,S)=>{if(S){i(D);try{await S();}catch(M){console.error(`Export ${D} failed:`,M);}finally{i(null),l(false);}}},w=()=>{s?.(),m(true),setTimeout(()=>m(false),2e3);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:p,onClick:()=>l(!o),className:"flex items-center justify-center w-8 h-8 rounded-lg",style:{color:o?e.accent:e.textTertiary,backgroundColor:o?e.accentLight:"transparent"},whileHover:{color:e.textPrimary,backgroundColor:e.hoverBg},title:f.toolbar.share,children:jsxRuntime.jsx(lucideReact.Share2,{className:"w-4 h-4"})}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:o&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:g,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-56 rounded-xl overflow-hidden",style:{top:x.top,left:x.left,zIndex:99999,backgroundColor:y?"rgba(10, 10, 10, 0.95)":e.bgSecondary||"#F8FAFC",border:`1px solid ${y?"rgba(255,255,255,0.08)":e.border||"#CBD5E1"}`,boxShadow:y?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[h.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:b?"EXPORTAR":"EXPORT"})}),jsxRuntime.jsx("div",{className:"py-0.5",children:h.map((D,S)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>v(D.id,D.handler),disabled:d!==null,className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:y?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:S*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md flex-shrink-0",style:{backgroundColor:e.accentLight,color:e.accent},children:d===D.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"})}):D.icon}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:D.label})]},D.id))})]}),h.length>0&&s&&jsxRuntime.jsx("div",{className:"mx-3 h-px",style:{backgroundColor:y?"rgba(255,255,255,0.06)":e.borderLight}}),s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:b?"COMPARTIR":"SHARE"})}),jsxRuntime.jsx("div",{className:"py-0.5 pb-1.5",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:w,className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:y?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:h.length*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md flex-shrink-0",style:{backgroundColor:u?"rgba(34,197,94,0.15)":e.accentLight,color:u?"#22C55E":e.accent},children:u?jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5"}):jsxRuntime.jsx(lucideReact.Link2,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:u?f.toolbar.copied:f.toolbar.copySnapshotLink})]})})]})]})}),document.body)]})}function qx({options:e,value:t,onChange:a,theme:r,layoutId:n="activeSegment"}){return jsxRuntime.jsx("div",{className:"inline-flex p-1 rounded-lg relative",style:{backgroundColor:r.bgSecondary,border:`1px solid ${r.borderLight}`},children:e.map(s=>{let o=t===s.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>a(s.value),className:"relative px-3 py-1.5 rounded-md text-[11px] transition-all flex items-center gap-1.5 min-w-[70px] justify-center",style:{color:o?r.textPrimary:r.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:o?600:500,zIndex:o?2:1},whileHover:{scale:1.02},whileTap:{scale:.98},children:[o&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:n,className:"absolute inset-0 rounded-md",style:{backgroundColor:r.accent,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},transition:{type:"spring",stiffness:400,damping:30}}),s.icon&&jsxRuntime.jsx("span",{className:"relative z-10",style:{color:o?"#FFFFFF":r.textTertiary},children:s.icon}),jsxRuntime.jsx("span",{className:"relative z-10",style:{color:o?"#FFFFFF":r.textTertiary},children:s.label})]},s.value)})})}function Yx({options:e,value:t,onChange:a,theme:r}){return jsxRuntime.jsx("div",{className:"inline-flex items-center gap-1",children:e.map(n=>{let s=t===n.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>a(n.value),className:"relative px-3 py-1.5 text-[11px] transition-all",style:{color:s?r.accent:r.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:s?600:500},whileHover:{color:s?r.accent:r.textSecondary},whileTap:{scale:.98},children:[jsxRuntime.jsx("span",{children:n.label}),s&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:"timeScaleUnderline",className:"absolute bottom-0 left-1 right-1 h-0.5 rounded-full",style:{backgroundColor:r.accent},transition:{type:"spring",stiffness:400,damping:30}})]},n.value)})})}function rm({theme:e,value:t,onChange:a,maxDepth:r}){let[n,s]=react.useState(false),o=react.useRef(null),l=react.useRef(null),d=Hr(),i=Ts(o,n,"left");react.useEffect(()=>{if(!n)return;let p=g=>{let f=g.target;o.current&&!o.current.contains(f)&&l.current&&!l.current.contains(f)&&s(false);};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);let u=[{value:"all",label:d.toolbar.wbsAllLevels||"All"},...Array.from({length:Math.min(r,5)},(p,g)=>({value:g+1,label:`L${g+1}`}))],m=t==="all"?d.toolbar.wbsAllLevels||"All":`L${t}`;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:o,onClick:()=>s(!n),className:"flex items-center gap-1.5 px-2 py-1.5 rounded-lg transition-all",style:{backgroundColor:n?e.accentLight:e.bgSecondary,border:`1px solid ${n?e.accent:e.borderLight}`,color:n?e.accent:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},title:`${d.toolbar.wbsLevel||"Level"}: ${m}`,children:[jsxRuntime.jsx(lucideReact.Layers,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium",style:{fontFamily:"'JetBrains Mono', monospace"},children:m})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:n&&jsxRuntime.jsx(framerMotion.motion.div,{ref:l,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-24 rounded-xl overflow-hidden",style:{top:i.top,left:i.left,zIndex:99999,backgroundColor:e.bgPrimary==="#050505"?"rgba(10, 10, 10, 0.95)":e.bgSecondary,border:`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.08)":e.border}`,boxShadow:e.bgPrimary==="#050505"?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:jsxRuntime.jsx("div",{className:"py-1",children:u.map((p,g)=>{let f=t===p.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{a(p.value),s(false);},className:"w-full flex items-center justify-between px-3 py-2 text-left transition-all",style:{backgroundColor:f?e.accentLight:"transparent",borderBottom:g<u.length-1?`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.borderLight}`:"none"},whileHover:{backgroundColor:f?e.accentLight:e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:g*.03},children:[jsxRuntime.jsx("span",{className:"text-[11px]",style:{color:f?e.accent:e.textPrimary,fontFamily:"'JetBrains Mono', monospace",fontWeight:f?600:500},children:p.label}),f&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent}})]},String(p.value))})})})}),document.body)]})}function om({theme:e,value:t,onChange:a,hideCompleted:r=false,onHideCompletedChange:n}){let[s,o]=react.useState(false),l=react.useRef(null),d=react.useRef(null),i=Hr(),u=Ts(l,s,"left");react.useEffect(()=>{if(!s)return;let f=setTimeout(()=>{let x=b=>{let h=b.target;l.current&&!l.current.contains(h)&&d.current&&!d.current.contains(h)&&o(false);},y=b=>{b.key==="Escape"&&o(false);};document.addEventListener("mousedown",x),document.addEventListener("keydown",y),d._cleanup=()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",y);};},100);return ()=>{clearTimeout(f),d._cleanup&&d._cleanup();}},[s]);let m=[{value:"all",label:i.toolbar.filterAll||"Show All",icon:jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}),color:"text-[#00E5CC]"},{value:"completed",label:i.toolbar.filterCompleted||"Completed",icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3.5 h-3.5"}),color:"text-green-500"},{value:"in_progress",label:i.toolbar.filterInProgress||"In Progress",icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3.5 h-3.5"}),color:"text-[#00E5CC]"},{value:"incomplete",label:i.toolbar.toDo||"To Do / Pending",icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-3.5 h-3.5"}),color:"text-gray-400"}],p=t!=="all"||r,g=e.bgPrimary==="#0F1117"||e.bgPrimary==="#0a0a0a"||e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:l,onClick:f=>{f.stopPropagation(),o(x=>!x);},className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{backgroundColor:p?g?"rgba(0, 229, 204, 0.2)":"rgb(239 246 255)":s?e.hoverBg:e.bgSecondary,border:`1px solid ${p?g?"rgba(0, 229, 204, 0.5)":"rgb(191 219 254)":e.borderLight}`,color:p?"#00E5CC":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:i.toolbar.filter||"Filters"}),p&&jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#00E5CC"}})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:d,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-56 rounded-xl overflow-hidden",style:{top:u.top,left:u.left,zIndex:99999,backgroundColor:g?"rgba(10, 10, 10, 0.95)":"#FFFFFF",border:`1px solid ${g?"rgba(255,255,255,0.08)":"rgb(229 231 235)"}`,boxShadow:g?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:g?"rgba(255,255,255,0.06)":"rgb(229 231 235)"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:g?"rgba(255,255,255,0.35)":"#9CA3AF",fontFamily:"Inter, sans-serif"},children:i.toolbar.filterBy||"FILTER BY STATUS"})}),jsxRuntime.jsx("div",{className:"py-1",children:m.map(f=>{let x=t===f.value&&!r,y=()=>f.value==="all"?x?jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}):jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-gray-400"}):f.icon;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{a(f.value),n&&n(false),o(false);},className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{backgroundColor:x?g?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:g?"rgba(255,255,255,0.06)":"rgb(243 244 246)"},children:[jsxRuntime.jsx("span",{className:`${x?f.color:"text-gray-400"} flex-shrink-0`,children:y()}),jsxRuntime.jsx("span",{className:"flex-1 text-left whitespace-nowrap font-medium",style:{color:g?"rgba(255,255,255,0.85)":"#111827"},children:f.label}),x&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"#00E5CC"}})]},f.value)})}),jsxRuntime.jsx("div",{className:"mx-3 h-px",style:{backgroundColor:g?"rgba(255,255,255,0.06)":"rgb(229 231 235)"}}),n&&jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{n(!r),r||a("all"),o(false);},className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{backgroundColor:r?g?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:g?"rgba(255,255,255,0.06)":"rgb(243 244 246)"},children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:r?"#00E5CC":g?"rgba(255,255,255,0.35)":"#9CA3AF"}}),jsxRuntime.jsx("span",{className:"flex-1 text-left whitespace-nowrap font-medium",style:{color:g?"rgba(255,255,255,0.85)":"#111827"},children:i.toolbar.hideCompleted||"Hide Completed Tasks"}),r&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"#00E5CC"}})]})})]})}),document.body)]})}function Xx({value:e,onChange:t,theme:a}){let r=Hr(),n=a.bgPrimary==="#050505"||a.textPrimary==="#FFFFFF",s=[{value:"day",label:r.toolbar.day.charAt(0).toUpperCase()},{value:"week",label:r.toolbar.week.charAt(0).toUpperCase()},{value:"month",label:r.toolbar.month.charAt(0).toUpperCase()}];return jsxRuntime.jsx("div",{className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:n?"#000000":a.bgSecondary,border:`1px solid ${n?"rgba(255,255,255,0.1)":a.border}`},children:s.map(o=>{let l=e===o.value;return jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>t(o.value),className:"relative px-3 py-1 text-[11px] font-medium rounded-full transition-colors",style:{color:l?n?"#FFFFFF":a.textPrimary:a.textTertiary,fontFamily:"Inter, sans-serif",backgroundColor:l?n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent"},whileHover:{color:n?"#FFFFFF":a.textPrimary},whileTap:{scale:.95},children:o.label},o.value)})})}function Jx({theme:e,forecast:t}){let a=Hr(),r=e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF",n=t?.expectedFinish?t.expectedFinish.toLocaleDateString(void 0,{month:"short",day:"numeric"}):"\u2014",s=t?.delayDays,o=s!=null,l=s!=null?s>0?`+${s}d ${a.toolbar.delayLabel}`:s<0?`${s}d ${a.toolbar.earlyLabel}`:a.toolbar.onTimeLabel:null,d=s!=null&&s>0?{bg:r?"rgba(239,68,68,0.15)":"rgba(220,38,38,0.1)",text:r?"#EF4444":"#DC2626"}:s!=null&&s<0?{bg:r?"rgba(34,197,94,0.15)":"rgba(22,163,74,0.1)",text:r?"#22C55E":"#16A34A"}:{bg:r?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",text:e.textTertiary},i=t?.confidencePercent,u=i!=null?i>=75?"#22C55E":i>=40?"#F59E0B":"#EF4444":e.textTertiary,m=t?.costAtCompletion,p=t?.currency||"$",g=m!=null?m>=1e6?`${p}${(m/1e6).toFixed(2)}M`:m>=1e3?`${p}${(m/1e3).toFixed(1)}K`:`${p}${m.toFixed(0)}`:"\u2014",f=t?.budgetVariancePercent,x=f!=null&&f!==0,y=f!=null?f>0?`+${f.toFixed(0)}% ${a.toolbar.budgetOver}`:`${f.toFixed(0)}% ${a.toolbar.budgetUnder}`:null,b=f!=null&&f>0?{bg:r?"rgba(239,68,68,0.15)":"rgba(220,38,38,0.1)",text:r?"#EF4444":"#DC2626"}:f!=null&&f<0?{bg:r?"rgba(34,197,94,0.15)":"rgba(22,163,74,0.1)",text:r?"#22C55E":"#16A34A"}:{bg:"transparent",text:e.textTertiary};return jsxRuntime.jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:e.forecastHud||(r?"rgba(15,15,15,0.9)":"rgba(248,250,252,0.95)"),borderColor:e.borderLight,backdropFilter:"blur(12px)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-6",children:[jsxRuntime.jsx("span",{className:"text-[9px] uppercase tracking-[0.15em]",style:{color:e.textTertiary,fontFamily:"'JetBrains Mono', monospace",fontWeight:500},children:a.toolbar.projectForecast}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"text-[13px] font-semibold",style:{color:e.textPrimary,fontFamily:"Inter, sans-serif"},children:[a.toolbar.expectedFinish,": ",n]}),o&&l&&jsxRuntime.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:d.bg,color:d.text,fontFamily:"'JetBrains Mono', monospace"},children:l})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-6",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"text-[11px]",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif"},children:[a.toolbar.confidence,":"]}),jsxRuntime.jsx("span",{className:"text-[13px] font-semibold",style:{color:u,fontFamily:"'JetBrains Mono', monospace"},children:i!=null?`${i.toFixed(0)}%`:"\u2014"})]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:r?"rgba(255,255,255,0.08)":e.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"text-[11px]",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif"},children:[a.toolbar.costAtCompletion,":"]}),jsxRuntime.jsx("span",{className:"text-[13px] font-bold",style:{color:e.textPrimary,fontFamily:"'JetBrains Mono', monospace"},children:g}),x&&y&&jsxRuntime.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:b.bg,color:b.text,fontFamily:"'JetBrains Mono', monospace"},children:y})]})]})]})}function Qx({theme:e,showCriticalPath:t,onShowCriticalPathChange:a,showBaseline:r,onShowBaselineChange:n,highlightWeekends:s,onHighlightWeekendsChange:o,showDependencies:l,onShowDependenciesChange:d,rowDensity:i,onRowDensityChange:u,hasDependencies:m=true}){let[p,g]=react.useState(false),f=react.useRef(null),x=react.useRef(null),y=Hr(),b=Ts(f,p,"right",208),h=e.bgPrimary==="#050505"||(e.bgPrimary||"").charAt(1)==="0";react.useEffect(()=>{if(!p)return;let S=M=>{let T=M.target;f.current&&!f.current.contains(T)&&x.current&&!x.current.contains(T)&&g(false);};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[p]);let v=y.toolbar.visibility==="Visibilidad",w=[{key:"criticalPath",label:v?"Ruta Cr\xEDtica":"Critical Path",icon:lucideReact.Zap,active:t,onChange:a,disabled:!m,tooltip:m?void 0:v?"Agrega dependencias entre tareas para ver la ruta cr\xEDtica":"Add dependencies between tasks to see the critical path"},{key:"baselines",label:v?"L\xEDneas Base":"Baselines",icon:lucideReact.Layers,active:r,onChange:n},{key:"weekends",label:v?"Fines de Semana":"Weekends",icon:lucideReact.CalendarDays,active:s,onChange:o},{key:"dependencies",label:v?"Dependencias":"Dependencies",icon:lucideReact.GitBranch,active:l,onChange:d}],D=[{value:"compact",label:y.toolbar.visibility==="Visibilidad"?"Compacto":"Compact"},{value:"comfortable",label:"Normal"},{value:"spacious",label:y.toolbar.visibility==="Visibilidad"?"Amplio":"Spacious"}];return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:f,onClick:()=>g(!p),className:"flex items-center justify-center w-8 h-8 rounded-lg",style:{color:p?e.accent:e.textTertiary,backgroundColor:p?e.accentLight:"transparent"},whileHover:{color:e.textPrimary,backgroundColor:e.hoverBg},title:y.toolbar.visibility,children:jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"})}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:p&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:x,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-52 rounded-xl overflow-hidden",style:{top:b.top,left:b.left,zIndex:99999,backgroundColor:h?"rgba(10, 10, 10, 0.95)":e.bgSecondary||"#F8FAFC",border:`1px solid ${h?"rgba(255,255,255,0.08)":e.border||"#CBD5E1"}`,boxShadow:h?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[jsxRuntime.jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:h?"rgba(255,255,255,0.35)":e.textTertiary},children:y.toolbar.visibility==="Visibilidad"?"OPCIONES DE VISTA":"DISPLAY OPTIONS"})}),jsxRuntime.jsx("div",{className:"py-0.5",children:w.map((S,M)=>{let T=S.icon,F=S.disabled,A=S.tooltip;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>!F&&S.onChange?.(!S.active),className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:F?h?"rgba(255,255,255,0.3)":"#9CA3AF":h?"rgba(255,255,255,0.85)":"#111827",cursor:F?"not-allowed":"pointer"},whileHover:F?{}:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:M*.03},title:A,children:[jsxRuntime.jsx(T,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:F?h?"rgba(255,255,255,0.2)":"#D1D5DB":S.active?e.accent||"#00E5CC":e.textTertiary}}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:S.label}),S.active&&!F&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent||"#00E5CC"}})]},S.key)})}),jsxRuntime.jsx("div",{className:"mx-3 h-px",style:{backgroundColor:h?"rgba(255,255,255,0.06)":e.borderLight}}),jsxRuntime.jsxs("div",{className:"py-0.5",children:[jsxRuntime.jsx("div",{className:"px-3 pt-2 pb-1",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:h?"rgba(255,255,255,0.35)":e.textTertiary},children:y.toolbar.visibility==="Visibilidad"?"DENSIDAD":"DENSITY"})}),D.map((S,M)=>{let T=i===S.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>u(S.value),className:"w-full flex items-center justify-between px-3 py-2 text-[11px] transition-colors",style:{color:h?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:(w.length+M)*.03},children:[jsxRuntime.jsx("span",{style:{color:T?e.accent||"#00E5CC":h?"rgba(255,255,255,0.85)":e.textPrimary},children:S.label}),T&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent||"#00E5CC"}})]},S.value)})]})]})}),document.body)]})}function Mi({theme:e,timeScale:t,onTimeScaleChange:a,zoom:r,onZoomChange:n,currentTheme:s,onThemeChange:o,rowDensity:l,onRowDensityChange:d,showThemeSelector:i=false,showCreateTaskButton:u=false,createTaskLabel:m,onCreateTask:p,taskFilter:g="all",onTaskFilterChange:f,hideCompleted:x=false,onHideCompletedChange:y,toolbarRightContent:b,wbsLevel:h,onWbsLevelChange:v,maxWbsDepth:w=4,viewMode:D="execution",onViewModeChange:S,projectForecast:M,onExportPNG:T,onExportPDF:F,onExportExcel:A,onExportCSV:C,onExportJSON:_,onExportMSProject:W,showCriticalPath:oe=true,onShowCriticalPathChange:L,showDependencies:Y=true,onShowDependenciesChange:K,highlightWeekends:V=true,onHighlightWeekendsChange:B,showBaseline:X=false,onShowBaselineChange:Ce,onCopySnapshotLink:Re,hasDependencies:R=true}){let ae=Hr(),be=T||F||A||C||_||W,Ie=!!e.glassToolbar,[De,Ee]=react.useState(false),He=react.useRef(null);react.useEffect(()=>{De&&He.current&&He.current.focus();},[De]);let rt=[{value:"day",label:ae.toolbar.day},{value:"week",label:ae.toolbar.week},{value:"month",label:ae.toolbar.month}],pe=[{value:"dark",label:"Dark",icon:jsxRuntime.jsx(lucideReact.Moon,{className:"w-3.5 h-3.5"})},{value:"light",label:"Light",icon:jsxRuntime.jsx(lucideReact.Sun,{className:"w-3.5 h-3.5"})},{value:"neutral",label:"Zen",icon:jsxRuntime.jsx(lucideReact.Palette,{className:"w-3.5 h-3.5"})}],We=e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF";if(Ie){let je=We?"rgba(255,255,255,0.08)":e.borderLight;return jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsxs("div",{className:"h-[52px] px-4 flex items-center justify-between border-b",style:{backgroundColor:e.glassToolbar,borderColor:e.borderLight,backdropFilter:"blur(12px)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs(framerMotion.motion.div,{className:"flex items-center rounded-full overflow-hidden",style:{backgroundColor:We?"#1A1A1A":e.bgSecondary,border:`1px solid ${We?"rgba(255,255,255,0.08)":e.border}`},animate:{width:De?220:36},transition:{type:"spring",stiffness:400,damping:30},children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>Ee(!De),className:"flex items-center justify-center w-9 h-9 flex-shrink-0",style:{color:e.textTertiary},whileHover:{color:e.textPrimary},children:jsxRuntime.jsx(lucideReact.Search,{className:"w-4 h-4"})}),De&&jsxRuntime.jsx("input",{ref:He,type:"text",placeholder:"Search tasks...",className:"bg-transparent border-none outline-none text-[11px] pr-3 w-full",style:{color:e.textPrimary,fontFamily:"Inter, sans-serif"},onBlur:()=>Ee(false),onKeyDown:Oe=>{Oe.key==="Escape"&&Ee(false);}})]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:je}}),S&&jsxRuntime.jsxs("div",{className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:We?"#000000":e.bgSecondary,border:`1px solid ${We?"rgba(255,255,255,0.08)":e.border}`},children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>S("execution"),className:"px-3 py-1.5 rounded-full text-[11px] font-medium transition-colors",style:{backgroundColor:D==="execution"?We?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent",color:D==="execution"?e.textPrimary:e.textTertiary,fontFamily:"Inter, sans-serif"},whileHover:D!=="execution"?{color:e.textSecondary}:{},children:ae.toolbar.viewExecution}),jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>S("oracle"),className:"px-3 py-1.5 rounded-full text-[11px] font-medium transition-colors",style:{backgroundColor:D==="oracle"?We?"rgba(0, 229, 204,0.15)":"rgba(0, 196, 174,0.08)":"transparent",color:D==="oracle"?"#00E5CC":e.textTertiary,fontFamily:"Inter, sans-serif"},whileHover:D!=="oracle"?{color:e.textSecondary}:{},children:ae.toolbar.viewOracle})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Xx,{value:t,onChange:a,theme:e}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:je}}),v&&jsxRuntime.jsx(rm,{theme:e,value:h??"all",onChange:v,maxDepth:w}),f&&jsxRuntime.jsx(om,{theme:e,value:g,onChange:f,hideCompleted:x,onHideCompletedChange:y}),b&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:je}}),b]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:je}}),jsxRuntime.jsx(Qx,{theme:e,showCriticalPath:oe,onShowCriticalPathChange:L,showBaseline:X,onShowBaselineChange:Ce,highlightWeekends:V,onHighlightWeekendsChange:B,showDependencies:Y,onShowDependenciesChange:K,rowDensity:l,onRowDensityChange:d,hasDependencies:R}),jsxRuntime.jsx(am,{theme:e,onExportPNG:T,onExportPDF:F,onExportExcel:A,onExportMSProject:W,onCopySnapshotLink:Re}),u&&p&&jsxRuntime.jsxs(framerMotion.motion.button,{onClick:p,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px]",style:{background:`linear-gradient(135deg, ${e.accent} 0%, ${e.accentHover} 100%)`,color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:`0 2px 8px ${We?"rgba(0, 229, 204,0.3)":"rgba(0, 196, 174,0.3)"}`},whileHover:{scale:1.02,boxShadow:`0 4px 12px ${We?"rgba(0, 229, 204,0.4)":"rgba(0, 196, 174,0.4)"}`},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:m||ae.toolbar.createTask})]})]})]}),M&&jsxRuntime.jsx(Jx,{theme:e,forecast:M})]})}return jsxRuntime.jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:e.bgGrid,borderColor:e.border},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Yx,{options:rt,value:t,onChange:je=>a(je),theme:e}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>n(Math.max(.5,r-.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsxs("div",{className:"px-2 py-0.5 rounded text-[11px] tabular-nums min-w-[42px] text-center",style:{color:e.textSecondary,fontFamily:"'JetBrains Mono', monospace",fontWeight:500},children:[Math.round(r*100),"%"]}),jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>n(Math.min(2,r+.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"w-3.5 h-3.5"})})]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),v&&jsxRuntime.jsx(rm,{theme:e,value:h??"all",onChange:v,maxDepth:w}),f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsx(om,{theme:e,value:g,onChange:f,hideCompleted:x,onHideCompletedChange:y})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[b&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[b,jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}})]}),u&&p&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:p,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{background:"linear-gradient(135deg, #00E5CC 0%, #00E5CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:m||ae.toolbar.createTask})]}),(be||i)&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}})]}),jsxRuntime.jsx(am,{theme:e,onExportPNG:T,onExportPDF:F,onExportExcel:A,onExportMSProject:W,onCopySnapshotLink:Re}),i&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}}),i&&jsxRuntime.jsx(qx,{options:pe,value:s,onChange:je=>o(je),theme:e})]})]})}function Pi({columns:e,onToggleColumn:t,theme:a}){let[r,n]=react.useState(false),[s,o]=react.useState({x:0,y:0}),l=react.useRef(null),d=react.useRef(null);react.useEffect(()=>{if(!r)return;let u=m=>{l.current&&!l.current.contains(m.target)&&n(false);};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[r]);let i=e.filter(u=>u.id!=="name");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:d,onClick:()=>{if(!r&&d.current){let u=d.current.getBoundingClientRect();o({x:u.left,y:u.bottom+4});}n(!r);},className:"p-2 rounded-md transition-colors flex items-center gap-1",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.borderLight}`,color:a.textSecondary},whileHover:{backgroundColor:a.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:r&&jsxRuntime.jsx(Qt,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:l,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15},className:"column-manager-menu fixed min-w-[180px] rounded-lg shadow-xl z-[9999]",style:{left:`${s.x}px`,top:`${s.y}px`,backgroundColor:a.bgSecondary,border:`1px solid ${a.border}`},children:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-xs uppercase tracking-wider",style:{color:a.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Add Column"}),i.map(u=>jsxRuntime.jsxs("button",{onClick:()=>{t(u.id);},className:"w-full px-3 py-2 text-left flex items-center justify-between transition-colors text-sm",style:{color:a.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor=a.hoverBg;},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{children:u.label}),u.visible&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:a.accent}})]},u.id))]})})})})]})}function zn({isOpen:e,x:t,y:a,items:r,onClose:n,theme:s}){let o=react.useRef(null),[l,d]=react.useState({x:t,y:a});if(react.useEffect(()=>{if(!e)return;let u=200,m=r.length*36+8,p=8,g=window.innerWidth,f=window.innerHeight,x=t,y=a;t+u+p>g&&(x=t-u,x<p&&(x=p)),a+m+p>f&&(y=f-m-p,y<p&&(y=p)),d({x,y});},[e,t,a,r.length]),react.useEffect(()=>{if(!e)return;let u=p=>{o.current&&!o.current.contains(p.target)&&n();},m=p=>{p.key==="Escape"&&n();};return document.addEventListener("mousedown",u),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",m);}},[e,n]),!e)return null;let i=u=>u.startsWith("#")&&(u.length===7||u.length===4)?u:s.bgPrimary?.includes("1")||s.bgPrimary?.includes("2")||s.textPrimary?.toLowerCase().includes("fff")||s.textPrimary?.toLowerCase().includes("white")?"#1E2128":"#FFFFFF";return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:o,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15,ease:[.4,0,.2,1]},className:"fixed z-[9999] min-w-[200px] rounded-lg",style:{left:`${l.x}px`,top:`${l.y}px`,backgroundColor:i(s.bgSecondary),border:`1px solid ${s.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2)",backdropFilter:"none"},children:jsxRuntime.jsx("div",{className:"py-1",children:r.map(u=>jsxRuntime.jsxs("div",{children:[u.separator&&jsxRuntime.jsx("div",{className:"my-1 h-px",style:{backgroundColor:s.borderLight}}),jsxRuntime.jsxs("button",{onClick:()=>{u.disabled||(u.onClick(),n());},disabled:u.disabled,className:"w-full px-3 py-2 text-left flex items-center gap-2 transition-colors text-sm",style:{color:u.disabled?s.textTertiary:s.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif",cursor:u.disabled?"not-allowed":"pointer",opacity:u.disabled?.5:1},onMouseEnter:m=>{u.disabled||(m.currentTarget.style.backgroundColor=s.hoverBg);},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[u.icon&&jsxRuntime.jsx("span",{style:{color:s.textSecondary},children:u.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:u.label}),u.submenu&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:s.textTertiary}})]})]},u.id))})})})}var ga={Edit:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),Pencil:jsxRuntime.jsx(lucideReact.Pencil,{className:"w-4 h-4"}),Delete:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),Add:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),AddSubtask:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),Remove:jsxRuntime.jsx(lucideReact.Minus,{className:"w-4 h-4"}),Link:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),Progress:jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),Sort:jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-4 h-4"}),SortAsc:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),SortDesc:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),Hide:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),Show:jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"}),Settings:jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4"}),Split:jsxRuntime.jsx(lucideReact.Scissors,{className:"w-4 h-4"}),Duplicate:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),MarkIncomplete:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),SetInProgress:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),MarkComplete:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"})};function bm({tasks:e,selectedTaskIds:t,onTaskSelect:a,onTaskCreate:r,onTaskDelete:n,onTaskDuplicate:s,onTaskMove:o,onTaskIndent:l,onTaskOutdent:d,onTaskRename:i,onTaskToggleExpand:u,onOpenTaskModal:m,enableKeyboard:p=true}){let g=react.useRef(false),f=react.useCallback(v=>{g.current=v;},[]),x=react.useCallback(v=>{let w=[],D=S=>{for(let M of S)w.push(M),M.subtasks&&M.subtasks.length>0&&M.isExpanded&&D(M.subtasks);};return D(v),w},[]),y=react.useCallback(()=>{let v=x(e);for(let w of v)if(t.has(w.id))return w;return null},[e,t,x]),b=react.useCallback((v,w)=>{let D=x(e);if(D.length===0)return;let S=y();if(!S){a(D[0].id,false);return}let M=D.findIndex(A=>A.id===S.id);if(M===-1)return;let T=v==="up"?M-1:M+1;if(T<0||T>=D.length)return;let F=D[T];a(F.id,w);},[e,y,x,a]),h=react.useCallback(v=>{if(!p)return;let w=v.target;if(w.tagName==="INPUT"||w.tagName==="TEXTAREA"||w.isContentEditable||g.current){v.key==="Escape"&&(w.blur(),g.current=false);return}let M=navigator.platform.toUpperCase().indexOf("MAC")>=0?v.metaKey:v.ctrlKey,T=Array.from(t),F=y();if(v.key==="ArrowUp"){v.preventDefault(),b("up",v.shiftKey);return}if(v.key==="ArrowDown"){v.preventDefault(),b("down",v.shiftKey);return}if(F&&(v.key==="ArrowRight"||v.key==="ArrowLeft")){F.subtasks&&F.subtasks.length>0&&(v.preventDefault(),(v.key==="ArrowRight"&&!F.isExpanded||v.key==="ArrowLeft"&&F.isExpanded)&&u(F.id));return}if(v.altKey&&(v.key==="ArrowUp"||v.key==="ArrowDown")){T.length>0&&(v.preventDefault(),o(T,v.key==="ArrowUp"?"up":"down"));return}if(v.key==="Tab"&&!v.shiftKey){T.length>0&&(v.preventDefault(),l(T));return}if(v.key==="Tab"&&v.shiftKey){T.length>0&&(v.preventDefault(),d(T));return}if(v.key==="Enter"&&!v.shiftKey&&!M){F&&(v.preventDefault(),r(F.id,"below"));return}if(v.key==="Enter"&&v.shiftKey&&!M){F&&(v.preventDefault(),r(F.id,"above"));return}if(v.key==="Enter"&&M){F&&(v.preventDefault(),m(F.id));return}if(v.key==="F2"){F&&(v.preventDefault(),i(F.id));return}if(v.key==="Delete"||v.key==="Backspace"&&M){T.length>0&&(v.preventDefault(),n(T));return}if(v.key==="d"&&M&&!v.shiftKey){T.length>0&&(v.preventDefault(),s(T));return}},[p,t,y,b,r,n,s,o,l,d,i,u,m]);return react.useEffect(()=>{if(p)return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h);}},[p,h]),{setIsEditing:f}}function ym(){let[e,t]=react.useState(new Set),[a,r]=react.useState(null),n=react.useCallback(m=>{t(new Set([m])),r(m);},[]),s=react.useCallback(m=>{t(p=>{let g=new Set(p);return g.has(m)?g.delete(m):g.add(m),g}),r(m);},[]),o=react.useCallback((m,p)=>{if(!a){n(m);return}let g=p.indexOf(a),f=p.indexOf(m);if(g===-1||f===-1){n(m);return}let x=Math.min(g,f),y=Math.max(g,f),b=p.slice(x,y+1);t(new Set(b)),r(m);},[a,n]),l=react.useCallback((m,p,g,f)=>{f?o(m,p):g?s(m):n(m);},[n,s,o]),d=react.useCallback((m,p)=>{p?t(g=>{let f=new Set(g);return f.add(m),f}):n(m);},[n]),i=react.useCallback(()=>{t(new Set),r(null);},[]),u=react.useCallback(m=>e.has(m),[e]);return {selectedTaskIds:e,selectTask:n,toggleTaskSelection:s,selectTaskRange:o,handleTaskClick:l,handleKeyboardSelection:d,clearSelection:i,isTaskSelected:u}}function Bd(e){return e.map((t,a)=>({...t,position:a,subtasks:t.subtasks?.length?Bd(t.subtasks):t.subtasks}))}function Un(e){let t=[],a=(r,n,s=0)=>{let o=[...r].sort((l,d)=>(l.position??0)-(d.position??0));for(let l=0;l<o.length;l++){let d={...o[l],parentId:n,level:s,position:o[l].position??l};t.push(d),d.subtasks&&d.subtasks.length>0&&d.isExpanded&&a(d.subtasks,d.id,s+1);}};return a(e),t}function Wn(e,t){for(let a of e){if(a.id===t)return a;if(a.subtasks){let r=Wn(a.subtasks,t);if(r)return r}}return null}function Id(e,t){for(let a of e)if(a.subtasks){if(a.subtasks.some(n=>n.id===t))return a;let r=Id(a.subtasks,t);if(r)return r}return null}function Rd(e,t){if(t.length===0)return e;let a=Un(e),r=t[0],n=a.findIndex(p=>p.id===r);if(n<=0)return e;let s=a[n-1],o=(p,g)=>{let f=[];return {tasks:p.filter(y=>{if(g.has(y.id))return f.push(y),false;if(y.subtasks){let b=o(y.subtasks,g);y.subtasks=b.tasks,f.push(...b.removed);}return true}),removed:f}},l=(p,g,f)=>p.map(x=>x.id===g?{...x,subtasks:[...x.subtasks||[],...f],isExpanded:true}:x.subtasks?{...x,subtasks:l(x.subtasks,g,f)}:x),d=new Set(t),{tasks:i,removed:u}=o(e,d),m=l(i,s.id,u);return Bd(m)}function Od(e,t){if(t.length===0)return e;let a=[...e];for(let r of t){let n=Id(a,r);if(!n)continue;let s=Id(a,n.id),o=(i,u,m)=>{for(let p=0;p<i.length;p++){let g=i[p];if(g.id===u&&g.subtasks){let f=g.subtasks.findIndex(x=>x.id===m);if(f!==-1){let[x]=g.subtasks.splice(f,1);return x}}if(g.subtasks){let f=o(g.subtasks,u,m);if(f)return f}}return null},l=(i,u,m)=>{let p=i.findIndex(g=>g.id===u);if(p!==-1)return i.splice(p+1,0,m),i;for(let g of i)g.subtasks&&l(g.subtasks,u,m);return i},d=o(a,n.id,r);d&&(s&&s.subtasks?l(s.subtasks,n.id,d):l(a,n.id,d));}return Bd(a)}function $d(e,t,a){if(t.length===0)return e;let r=[...e],n=t[0],s=(o,l,d)=>{let i=o.findIndex(m=>m.id===l);if(i===-1){for(let m of o)if(m.subtasks&&s(m.subtasks,l,d))return true;return false}let u=d==="up"?i-1:i+1;return u<0||u>=o.length?false:([o[i],o[u]]=[o[u],o[i]],o[i]={...o[i],position:i},o[u]={...o[u],position:u},true)};return s(r,n,a),r}function Hd(e,t){let a=new Set(t),r=n=>n.filter(s=>!a.has(s.id)).map(s=>s.subtasks?{...s,subtasks:r(s.subtasks)}:s);return r(e)}function Ds(e,t){let a=[...e],r=[];for(let n of t){let s=(d,i)=>d.map((u,m)=>({...u,id:`${u.id}-copy-${Date.now()}-${m}`,parentId:i,subtasks:u.subtasks?s(u.subtasks,`${u.id}-copy-${Date.now()}-${m}`):void 0})),o=d=>{let i=d.findIndex(g=>g.id===n);if(i===-1){for(let g of d)if(g.subtasks){let f=o(g.subtasks);if(f)return f}return null}let u=d[i],m=`${u.id}-copy-${Date.now()}`,p={...u,id:m,name:`${u.name} (Copy)`,subtasks:u.subtasks?s(u.subtasks,m):void 0};return d.splice(i+1,0,p),p},l=o(a);l&&r.push(l);}return {tasks:a,duplicatedTasks:r}}function xm(e,t,a){let r=[...e],n=new Date,s=new Date(n);s.setDate(s.getDate()+7);let o={id:`task-${Date.now()}`,name:"New Task",progress:0,status:"todo",startDate:n,endDate:s,color:"#00E5CC"},l=d=>{let i=d.findIndex(m=>m.id===t);if(i===-1){for(let m of d)if(m.subtasks&&l(m.subtasks))return true;return false}let u=a==="above"?i:i+1;return d.splice(u,0,o),true};return l(r),{tasks:r,newTask:o}}function zd(e,t,a){return e.map(r=>r.id===t?{...r,name:a}:r.subtasks?{...r,subtasks:zd(r.subtasks,t,a)}:r)}function Ud(e,t){return e.map(a=>a.id===t?{...a,isExpanded:!a.isExpanded}:a.subtasks?{...a,subtasks:Ud(a.subtasks,t)}:a)}function Wd(e,t){let a=p=>{for(let g of p){if(g.id===t)return g;if(g.subtasks){let f=a(g.subtasks);if(f)return f}}return null},r=a(e),n=new Date,s=new Date(n);s.setDate(s.getDate()+7);let o=r?.startDate||n,l=r?.endDate||s,d=p=>{for(let g of p){if(g.id===t)return (g.subtasks||[]).length;if(g.subtasks){let f=d(g.subtasks);if(f>=0)return f}}return 0},i=d(e),u={id:`task-${Date.now()}`,name:"New Subtask",progress:0,status:"todo",startDate:new Date(o),endDate:new Date(l),color:r?.color||"#00E5CC",position:i,parentId:t},m=p=>p.map(g=>{if(g.id===t){let f=g.subtasks||[];return {...g,subtasks:[...f,u],isExpanded:true}}return g.subtasks?{...g,subtasks:m(g.subtasks)}:g});return {tasks:m(e),newTask:u}}function vm(e,t,a,r){if(t===a)return e;let n=Wn(e,t);if(!n)return e;if(a){let l=(d,i)=>{if(!d.subtasks)return false;for(let u of d.subtasks)if(u.id===i||l(u,i))return true;return false};if(l(n,a))return e}let s=l=>{let d=l.filter(u=>u.id!==t),i=d.length<l.length;return d.map((u,m)=>{let p=i?{...u,position:m}:u;return p.subtasks&&p.subtasks.length>0?{...p,subtasks:s(p.subtasks)}:p})},o=s(e);if(a===null){let l=r!==void 0?r:o.length;o.splice(l,0,{...n,parentId:void 0}),o=o.map((d,i)=>({...d,position:i}));}else {let l=d=>d.map(i=>{if(i.id===a){let u=i.subtasks||[],m=r!==void 0?r:u.length,p=[...u];p.splice(m,0,{...n,parentId:a});let g=p.map((f,x)=>({...f,position:x}));return {...i,subtasks:g,isExpanded:true}}return i.subtasks&&i.subtasks.length>0?{...i,subtasks:l(i.subtasks)}:i});o=l(o);}return o}function zr(e){return e.map(t=>{if(!t.subtasks||t.subtasks.length===0)return t;let a=zr(t.subtasks),r=a.reduce((l,d)=>(d.startDate&&l.starts.push(new Date(d.startDate).getTime()),d.endDate&&l.ends.push(new Date(d.endDate).getTime()),l.progresses.push(d.progress??0),l),{starts:[],ends:[],progresses:[]}),n=r.starts.length>0?new Date(Math.min(...r.starts)):t.startDate,s=r.ends.length>0?new Date(Math.max(...r.ends)):t.endDate,o=r.progresses.length>0?Math.round(r.progresses.reduce((l,d)=>l+d,0)/r.progresses.length):t.progress;return {...t,subtasks:a,startDate:n,endDate:s,progress:o}})}function Ai({tasks:e,theme:t,rowHeight:a,availableUsers:r=[],templates:n,onTaskClick:s,onTaskDblClick:o,onTaskContextMenu:l,onTaskToggle:d,scrollTop:i,columns:u,onToggleColumn:m,onColumnResize:p,onTaskUpdate:g,onBulkFill:f,onTaskIndent:x,onTaskOutdent:y,onTaskMove:b,onMultiTaskDelete:h,onTaskDuplicate:v,onTaskCreate:w,onTaskRename:D,onCreateSubtask:S,onOpenTaskModal:M,onDeleteRequest:T,onTaskReparent:F,scrollContainerRef:A,showCriticalPath:C=false}){let _=react.useContext($n),[W,oe]=react.useState(null),[L,Y]=react.useState(null),[K,V]=react.useState(""),B=react.useRef(null),[X,Ce]=react.useState(null),[Re,R]=react.useState(0),[ae,be]=react.useState(0),[Ie,De]=react.useState({isOpen:false,x:0,y:0,type:"header"}),[Ee,He]=react.useState(null),[rt,pe]=react.useState(null),[We,je]=react.useState(null),Oe=react.useRef(0),tt=5,wt=react.useRef(false),[pt,Ue]=react.useState(null),[ot,Et]=react.useState(false),ge=react.useRef(null),[ht,k]=react.useState(null),[O,Z]=react.useState(null),[ve,$]=react.useState(false),re=react.useRef(null);react.useEffect(()=>{function ee(ke){re.current&&!re.current.contains(ke.target)&&$(false);}if(ve)return document.addEventListener("mousedown",ee),()=>document.removeEventListener("mousedown",ee)},[ve]),react.useEffect(()=>{L&&B.current&&(B.current.focus(),B.current.select());},[L]),react.useEffect(()=>{if(!X)return;let ee=At=>{let kt=At.clientX-Re,it=ae+kt;p?.(X,it);},ke=()=>{Ce(null),document.body.style.cursor="",document.body.style.userSelect="";};return document.addEventListener("mousemove",ee),document.addEventListener("mouseup",ke),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",ee),document.removeEventListener("mouseup",ke),document.body.style.cursor="",document.body.style.userSelect="";}},[X,Re,ae,p]);let{selectedTaskIds:Ye,handleTaskClick:Te,isTaskSelected:Fe}=ym(),{setIsEditing:ze}=bm({tasks:e,selectedTaskIds:Ye,onTaskSelect:(ee,ke)=>{let kt=Un(e).map(it=>it.id);Te(ee,kt,ke||false,false);},onTaskCreate:w||(()=>{}),onTaskDelete:h||(()=>{}),onTaskDuplicate:v||(()=>{}),onTaskMove:b||(()=>{}),onTaskIndent:x||(()=>{}),onTaskOutdent:y||(()=>{}),onTaskRename:ee=>{let ke=Un(e).find(At=>At.id===ee);ke&&Mt(ke);},onTaskToggleExpand:d||(()=>{}),onOpenTaskModal:ee=>{let ke=Un(e).find(At=>At.id===ee);ke&&M&&M(ke);},enableKeyboard:true}),Le=(ee,ke=0,At="")=>{let kt=[],it=[...ee].sort((dt,J)=>(dt.position??0)-(J.position??0));for(let dt=0;dt<it.length;dt++){let J=it[dt],xe=dt+1,ue=At?`${At}.${xe}`:`${xe}.0`,z=J.wbsCode||ue;if(J.wbsCode=z,kt.push({task:J,level:ke}),J.subtasks&&J.subtasks.length>0&&J.isExpanded){let Ve=J.wbsCode?.replace(/\.0$/,"")||(At?`${At}.${xe}`:`${xe}`);kt.push(...Le(J.subtasks,ke+1,Ve));}}return kt},Ze=Le(e),st=48,yt=Math.max(Ze.length*a,600-st),xt=(ee,ke)=>ke==="assignees"?ee.assignees:ke==="startDate"?ee.startDate:ee.endDate,$t=(ee,ke,At,kt)=>{ee.preventDefault(),ee.stopPropagation(),k({sourceTaskId:ke,column:At,sourceIndex:kt,targetIndex:kt});let it=ee.currentTarget.closest("[data-grid-body]"),dt=ue=>{let z=it?.getBoundingClientRect().top??0,ne=Math.floor((ue-z)/a);return ne=Math.max(0,Math.min(Ze.length-1,ne)),ne<kt&&(ne=kt),ne},J=ue=>{let z=dt(ue.clientY);k(ne=>ne&&{...ne,targetIndex:z});},xe=ue=>{window.removeEventListener("mousemove",J),window.removeEventListener("mouseup",xe),k(null);let z=dt(ue.clientY),ne=Ze.find(q=>q.task.id===ke)?.task;if(!ne)return;let Ve=xt(ne,At),N=Math.min(kt,z),U=Math.max(kt,z),Ne=[];for(let q=N;q<=U;q++){if(q===kt)continue;let et=Ze[q]?.task;!et||et.subtasks&&et.subtasks.length>0||Ne.push(et.id);}Ne.length!==0&&f?.(Ne,At,Ve);};window.addEventListener("mousemove",J),window.addEventListener("mouseup",xe);},ut=ee=>{if(!ht)return false;let ke=Math.min(ht.sourceIndex,ht.targetIndex),At=Math.max(ht.sourceIndex,ht.targetIndex);return ee>=ke&&ee<=At},Gt=ee=>!ee.startDate||!ee.endDate?"-":`${Math.ceil((ee.endDate.getTime()-ee.startDate.getTime())/(1e3*60*60*24))}d`,Mt=ee=>{Y(ee.id),V(ee.name),ze(true);},It=ee=>{K.trim()&&K!==e.find(ke=>ke.id===ee)?.name&&D?.(ee,K.trim()),Y(null),V(""),ze(false);},Ft=()=>{Y(null),V(""),ze(false);},Ct=(ee,ke)=>{ke.stopPropagation(),S?.(ee.id);},St=(ee,ke)=>{ke.preventDefault(),Oe.current=ke.clientY,He(ee),wt.current=false,Et(false),Ue({x:ke.clientX,y:ke.clientY});},ct=ee=>{if(!Ee||(Math.abs(ee.clientY-Oe.current)>tt&&!wt.current&&(wt.current=true,Et(true)),Ue({x:ee.clientX,y:ee.clientY}),!wt.current))return;if(A?.current){let dt=A.current,J=dt.getBoundingClientRect(),xe=60,ue=12;ge.current&&(cancelAnimationFrame(ge.current),ge.current=null);let z=ee.clientY-J.top,ne=J.bottom-ee.clientY;if(z<xe&&dt.scrollTop>0){let Ve=Math.round(ue*(1-z/xe)),N=()=>{dt.scrollTop-=Ve,wt.current&&dt.scrollTop>0&&(ge.current=requestAnimationFrame(N));};ge.current=requestAnimationFrame(N);}else if(ne<xe&&dt.scrollTop<dt.scrollHeight-dt.clientHeight){let Ve=Math.round(ue*(1-ne/xe)),N=()=>{dt.scrollTop+=Ve,wt.current&&dt.scrollTop<dt.scrollHeight-dt.clientHeight&&(ge.current=requestAnimationFrame(N));};ge.current=requestAnimationFrame(N);}}let At=document.querySelectorAll("[data-task-row]"),kt=null,it=null;At.forEach(dt=>{let J=dt.getBoundingClientRect(),xe=dt.getAttribute("data-task-row");if(xe&&xe!==Ee&&ee.clientY>=J.top&&ee.clientY<=J.bottom){kt=xe;let ue=ee.clientY-J.top,z=J.height;ue<z*.25?it="above":ue>z*.75?it="below":it="child";}}),pe(kt),je(it);},fa=()=>{if(wt.current&&Ee&&rt&&We){if(We==="child")F?.(Ee,rt);else if(We==="above"||We==="below"){let ee=(it,dt,J=null)=>{for(let xe of it){if(xe.id===dt)return J;if(xe.subtasks){let ue=ee(xe.subtasks,dt,xe.id);if(ue!==void 0)return ue}}},ke=ee(e,Ee,null),At=ee(e,rt,null),kt=(it,dt,J,xe)=>{let ue=it.findIndex(Ve=>Ve.id===dt),z=xe?it.findIndex(Ve=>Ve.id===J):-1,ne=We==="below"?ue+1:ue;return xe&&z!==-1&&z<ue&&(ne-=1),Math.max(0,ne)};if(At===null){let dt=kt(e,rt,Ee,ke===null);F?.(Ee,null,dt);}else {let it=Wn(e,At);if(it?.subtasks){let dt=ke===At,J=kt(it.subtasks,rt,Ee,dt);F?.(Ee,At,J);}}}}ge.current&&(cancelAnimationFrame(ge.current),ge.current=null),He(null),pe(null),je(null),Ue(null),wt.current=false,Et(false);};react.useEffect(()=>{if(Ee)return document.addEventListener("mousemove",ct),document.addEventListener("mouseup",fa),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",ct),document.removeEventListener("mouseup",fa),document.body.style.cursor="",document.body.style.userSelect="";}},[Ee,rt,We]);let xa=(ee,ke,At)=>{let kt=ke.subtasks&&ke.subtasks.length>0;switch(ee.id){case "name":let it=L===ke.id,dt=W===ke.id;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 relative",style:{paddingLeft:`${At*20}px`},children:[F&&jsxRuntime.jsx("div",{className:"cursor-grab active:cursor-grabbing p-0.5 rounded hover:bg-white/10 transition-all flex-shrink-0",style:{color:t.textTertiary,opacity:dt?1:.3},onMouseDown:q=>St(ke.id,q),title:"Arrastrar para mover tarea",children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-4 h-4"})}),ke.subtasks&&ke.subtasks.length>0?jsxRuntime.jsx("button",{onClick:q=>{q.stopPropagation(),d?.(ke.id);},className:"p-0.5 hover:bg-opacity-10 rounded transition-colors flex-shrink-0",style:{color:t.textSecondary},children:ke.isExpanded?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})}):jsxRuntime.jsx("div",{className:"w-5 h-5 flex-shrink-0"}),it?jsxRuntime.jsx("input",{ref:B,type:"text",value:K,onChange:q=>V(q.target.value),onKeyDown:q=>{q.key==="Enter"?It(ke.id):q.key==="Escape"&&Ft();},onBlur:()=>It(ke.id),className:"flex-1 px-2 py-1 rounded border outline-none",style:{backgroundColor:t.bgPrimary,borderColor:t.accent,color:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:"13px",fontWeight:500},onClick:q=>q.stopPropagation()}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{className:"flex-1 min-w-0",style:{display:"flex",alignItems:"baseline",gap:"6px",color:ke.parentId?t.textSecondary:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:ke.parentId?"13px":"14px",fontWeight:ke.isMilestone?600:ke.parentId?400:600,letterSpacing:ke.parentId?"0":"-0.01em"},title:ke.name,children:[ke.wbsCode&&jsxRuntime.jsx("span",{style:{color:t.textTertiary,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,opacity:.65,flexShrink:0},children:ke.wbsCode}),ke.isHighlighted&&ke.status==="completed"&&jsxRuntime.jsx("span",{title:"\u2605",style:{color:"#F59E0B",fontSize:"10px",flexShrink:0,lineHeight:1},children:"\u2605"}),jsxRuntime.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ke.name}),ke.subtasks&&ke.subtasks.length>0&&jsxRuntime.jsxs("span",{style:{color:"#6B7280",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",fontWeight:400,flexShrink:0,whiteSpace:"nowrap"},children:["\xB7 ",Math.round(ke.progress||0),"%"]}),C&&ke.isCriticalPath&&jsxRuntime.jsx("span",{style:{display:"inline-block",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#EF4444",flexShrink:0,marginLeft:"2px"}}),C&&ke.cpmData&&jsxRuntime.jsxs("span",{style:{color:ke.cpmData.totalFloat<=0?"#EF4444":ke.cpmData.totalFloat<=5?"#F59E0B":"#6B7280",fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",fontWeight:500,flexShrink:0,whiteSpace:"nowrap",marginLeft:"4px"},children:["TF: ",Math.round(ke.cpmData.totalFloat),"d"]})]}),dt&&!it&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 ml-2",onClick:q=>q.stopPropagation(),children:[jsxRuntime.jsx("button",{onClick:q=>Ct(ke,q),className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Create subtask",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:q=>{q.stopPropagation(),Mt(ke);},className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Rename (F2)",children:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-3.5 h-3.5"})})]})]})]});case "startDate":case "endDate":let xe=ee.id==="startDate"?"startDate":"endDate",ue=ke[xe],z=O?.taskId===ke.id&&O?.field===xe,ne=q=>q?(typeof q=="string"?new Date(q):q).toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit",year:"numeric"}):"-";return jsxRuntime.jsxs("div",{className:"flex items-center justify-center w-full relative",onClick:q=>q.stopPropagation(),children:[jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors hover:bg-white/5",style:{color:t.textSecondary,opacity:kt?.5:1,cursor:kt?"default":"pointer"},title:kt?"Auto-calculated from subtasks":void 0,onClick:q=>{if(!kt)if(z)Z(null);else {let et=q.currentTarget.getBoundingClientRect();Z({taskId:ke.id,field:xe,month:ue?typeof ue=="string"?new Date(ue):ue:new Date,position:{top:et.bottom+4,left:et.left}});}},children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-3 h-3",style:{color:t.textTertiary}}),jsxRuntime.jsx("span",{children:ne(ue)}),kt&&jsxRuntime.jsx("span",{style:{fontSize:"9px",color:t.textTertiary,marginLeft:"2px"},children:"\u25BC"})]}),z&&typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>Z(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"fixed z-[9999] rounded-xl shadow-2xl overflow-visible flex",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,top:O?.position.top,left:O?.position.left},onClick:q=>q.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"w-36 py-2",style:{borderRight:`1px solid ${t.border}`},children:[(()=>{let q=new Date,et=new Date(q);et.setDate(q.getDate()+1);let Nt=new Date(q);Nt.setDate(q.getDate()+7);let Wt=new Date(q);return Wt.setDate(q.getDate()+14),[{label:"Hoy",date:q},{label:"Ma\xF1ana",date:et},{label:"Pr\xF3xima semana",date:Nt},{label:"2 semanas",date:Wt}].map((va,oa)=>jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:t.textPrimary},onMouseEnter:cr=>cr.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:cr=>cr.currentTarget.style.backgroundColor="transparent",onClick:()=>{g?.(ke.id,{[xe]:va.date}),Z(null);},children:va.label},oa))})(),jsxRuntime.jsx("div",{style:{borderTop:`1px solid ${t.border}`,margin:"0.25rem 0"}}),jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:"#EF4444"},onMouseEnter:q=>q.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:q=>q.currentTarget.style.backgroundColor="transparent",onClick:()=>{g?.(ke.id,{[xe]:void 0}),Z(null);},children:"Borrar"})]}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>Z(q=>q?{...q,month:new Date(q.month.getFullYear(),q.month.getMonth()-1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:t.textPrimary},children:O?.month.toLocaleDateString("es-ES",{month:"long",year:"numeric"})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>Z(q=>q?{...q,month:new Date(q.month.getFullYear(),q.month.getMonth()+1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:["D","L","M","M","J","V","S"].map((q,et)=>jsxRuntime.jsx("div",{className:"w-6 h-6 flex items-center justify-center text-[10px]",style:{color:t.textTertiary},children:q},et))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let q=O?.month||new Date,et=q.getFullYear(),Nt=q.getMonth(),Wt=new Date(et,Nt,1).getDay(),Va=new Date(et,Nt+1,0).getDate(),va=new Date,oa=[];for(let wa=Wt-1;wa>=0;wa--)oa.push({day:new Date(et,Nt,-wa).getDate(),date:new Date(et,Nt-1,new Date(et,Nt,-wa).getDate()),isCurrentMonth:false});for(let wa=1;wa<=Va;wa++)oa.push({day:wa,date:new Date(et,Nt,wa),isCurrentMonth:true});let cr=42-oa.length;for(let wa=1;wa<=cr;wa++)oa.push({day:wa,date:new Date(et,Nt+1,wa),isCurrentMonth:false});return oa.map((wa,br)=>{let yo=wa.date.toDateString()===va.toDateString(),ro=(ue?typeof ue=="string"?new Date(ue):ue:null)?.toDateString()===wa.date.toDateString();return jsxRuntime.jsx("button",{type:"button",className:"w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",style:{color:wa.isCurrentMonth?ro?"#FFF":t.textPrimary:t.textTertiary,backgroundColor:ro?"#00E5CC":"transparent",boxShadow:yo&&!ro?"inset 0 0 0 1px #00E5CC":"none"},onClick:()=>{g?.(ke.id,{[xe]:wa.date}),Z(null);},children:wa.day},br)})})()})]})]})]}),document.body)]});case "duration":return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",children:jsxRuntime.jsx("span",{className:"text-xs tabular-nums",style:{color:t.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:600},children:Gt(ke)})});case "assignees":if(kt)return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",style:{opacity:.4},children:jsxRuntime.jsx("span",{className:"text-xs",style:{color:t.textTertiary},children:"\u2014"})});let Ve=r.filter(q=>ke.assignees?.some(et=>et.id?et.id===q.id:et.name===q.name||et.initials===q.initials));return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:q=>q.stopPropagation(),children:jsxRuntime.jsx(on,{assignedUsers:Ve,availableUsers:r,onChange:q=>{let et=q.map(Nt=>({id:Nt.id,name:Nt.name,initials:Nt.initials,color:Nt.color}));g?.(ke.id,{assignees:et});}})});case "status":if(kt){let q=ke.progress===100?"\u2713":ke.progress>0?"\u25D0":"\u25CB";return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",style:{opacity:.5},children:jsxRuntime.jsx("span",{className:"text-xs",style:{color:t.textTertiary},children:q})})}return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:q=>q.stopPropagation(),children:jsxRuntime.jsx(Wu,{status:ke.status||"todo",onChange:q=>{g?.(ke.id,{status:q,progress:q==="completed"?100:ke.progress});}})});case "progress":return jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-2 w-full",style:{opacity:kt?.6:1},children:[jsxRuntime.jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden max-w-[60px]",style:{backgroundColor:t.bgSecondary},children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${ke.progress}%`,backgroundColor:ke.progress===100?t.statusCompleted:t.accent}})}),jsxRuntime.jsxs("span",{className:"text-xs tabular-nums min-w-[35px] text-right",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:[ke.progress,"%"]})]});case "priority":let N={low:"LOW",medium:"MEDIUM",high:"HIGH",urgent:"URGENT"},U={LOW:"low",MEDIUM:"medium",HIGH:"high",URGENT:"urgent"},Ne=N[ke.priority||"medium"]||"MEDIUM";return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:q=>q.stopPropagation(),children:jsxRuntime.jsx(an,{priority:Ne,onChange:q=>{q&&g?.(ke.id,{priority:U[q]||"medium"});}})});default:return null}},H=ee=>[{id:"hide",label:"Hide Column",icon:ga.Hide,onClick:()=>m(ee),disabled:ee==="name"},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"sortAsc",label:"Sort Ascending",icon:ga.SortAsc,onClick:()=>{}},{id:"sortDesc",label:"Sort Descending",icon:ga.SortDesc,onClick:()=>{}}],se=ee=>ee.subtasks&&ee.subtasks.length>0?[{id:"addSubtask",label:_?.contextMenu?.addSubtask||"Add Subtask",icon:ga.Add,onClick:()=>{S?.(ee.id);}},{id:"duplicate",label:_?.contextMenu?.duplicateTask||"Duplicate Task",icon:ga.Duplicate,onClick:()=>{v?.([ee.id]);}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"delete",label:_?.contextMenu?.deleteTask||"Delete Task",icon:ga.Delete,onClick:()=>{T?T(ee.id,ee.name):h?.([ee.id]);}}]:[{id:"edit",label:_?.contextMenu?.editTask||"Edit Task",icon:ga.Pencil,onClick:()=>{o?.(ee);}},{id:"addSubtask",label:_?.contextMenu?.addSubtask||"Add Subtask",icon:ga.Add,onClick:()=>{S?.(ee.id);}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"markIncomplete",label:_?.contextMenu?.markIncomplete||"Mark Incomplete",icon:ga.MarkIncomplete,onClick:()=>{g?.(ee.id,{status:"todo",progress:0});},disabled:ee.status==="todo"},{id:"setInProgress",label:_?.contextMenu?.setInProgress||"Set In Progress",icon:ga.SetInProgress,onClick:()=>{g?.(ee.id,{status:"in-progress"});},disabled:ee.status==="in-progress"},{id:"markComplete",label:_?.contextMenu?.markComplete||"Mark Complete",icon:ga.MarkComplete,onClick:()=>{g?.(ee.id,{status:"completed",progress:100});},disabled:ee.status==="completed"},{id:"sep2",label:"",onClick:()=>{},separator:true},{id:"duplicate",label:_?.contextMenu?.duplicateTask||"Duplicate Task",icon:ga.Duplicate,onClick:()=>{v?.([ee.id]);}},{id:"split",label:_?.contextMenu?.splitTask||"Split Task",icon:ga.Split,onClick:()=>{},disabled:true},{id:"sep3",label:"",onClick:()=>{},separator:true},{id:"delete",label:_?.contextMenu?.deleteTask||"Delete Task",icon:ga.Delete,onClick:()=>{T?T(ee.id,ee.name):h?.([ee.id]);}}],at=u.filter(ee=>ee.visible),Xt=at.reduce((ee,ke)=>ee+ke.width,0);return jsxRuntime.jsxs("div",{className:"gantt-taskgrid-content",style:{backgroundColor:t.bgPrimary,minWidth:Xt},children:[jsxRuntime.jsxs("div",{className:"sticky top-0 z-10 flex items-center",style:{backgroundColor:t.glassHeader||t.bgSecondary,height:`${st}px`,paddingLeft:"3px",borderBottom:`1px solid ${t.border}`,boxSizing:"border-box"},children:[jsxRuntime.jsx("div",{className:"flex items-center flex-1 min-w-0",children:at.map((ee,ke)=>{let At=ke===at.length-1,kt=ee.id==="name";return jsxRuntime.jsxs("div",{className:`flex items-center px-4 cursor-pointer hover:bg-opacity-50 transition-colors relative ${kt?"":"justify-center"}`,style:{width:`${ee.width}px`,minWidth:`${ee.minWidth??(kt?200:60)}px`,maxWidth:`${ee.maxWidth??2e3}px`,flexShrink:kt&&at.length===1?1:0,flexGrow:kt&&at.length===1?1:0,borderRight:At?"none":`1px solid ${t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"hidden"},onContextMenu:it=>{it.preventDefault(),De({isOpen:true,x:it.clientX,y:it.clientY,type:"header",columnId:ee.id});},onMouseEnter:it=>{it.currentTarget.style.backgroundColor=t.hoverBg;},onMouseLeave:it=>{it.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,paddingRight:"0"},title:ee.label,children:ee.label}),ee.resizable&&jsxRuntime.jsx("div",{className:"absolute right-0 top-0 bottom-0 cursor-col-resize transition-colors group",style:{width:"12px",marginRight:"-6px",backgroundColor:X===ee.id?`${t.accent}30`:"transparent",zIndex:5},onMouseDown:it=>{it.preventDefault(),it.stopPropagation(),Ce(ee.id),R(it.clientX),be(ee.width);},title:"Drag to resize column",children:jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 transition-opacity",style:{left:"5px",width:"2px",backgroundColor:t.accent,borderRadius:"1px",opacity:X===ee.id?.8:void 0},children:jsxRuntime.jsx("div",{className:"absolute inset-0 opacity-20 group-hover:opacity-80 transition-opacity",style:{backgroundColor:t.accent}})})})]},ee.id)})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 px-2",style:{position:"sticky",right:0,height:"100%",backgroundColor:t.glassHeader||t.bgSecondary,zIndex:5},children:[jsxRuntime.jsx(Pi,{columns:u,onToggleColumn:m,theme:t}),jsxRuntime.jsx("button",{onClick:()=>$(!ve),className:"p-1.5 rounded hover:bg-opacity-10 transition-colors",style:{color:t.textTertiary},title:"Keyboard shortcuts",children:jsxRuntime.jsx(lucideReact.Keyboard,{className:"w-4 h-4"})}),ve&&jsxRuntime.jsxs("div",{ref:re,className:"absolute top-full right-0 mt-2 p-4 rounded-lg shadow-2xl z-50 min-w-[400px]",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,color:t.textPrimary},onClick:ee=>ee.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b",style:{borderColor:t.border},children:[jsxRuntime.jsx("h3",{className:"font-semibold text-sm",style:{color:t.textPrimary},children:"Keyboard Shortcuts"}),jsxRuntime.jsx("button",{onClick:()=>$(false),className:"text-xs px-2 py-1 rounded hover:bg-opacity-10",style:{color:t.textTertiary},children:"Close"})]}),jsxRuntime.jsxs("div",{className:"space-y-3 text-xs",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Navigation"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move focus up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Select range"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Toggle selection"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Click"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Hierarchy"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Indent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Outdent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Expand/Collapse"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2192 / \u2190"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Editing"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task below"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task above"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Open task modal"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Rename task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"F2"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Actions"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move task up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Alt + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Delete task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Delete"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Duplicate task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + D"})]})]})]})]})]})]})]}),jsxRuntime.jsx("div",{className:"gantt-taskgrid-content","data-grid-body":true,style:{minHeight:yt},children:Ze.map(({task:ee,level:ke},At)=>{let kt=Fe(ee.id),it=ut(At),dt=rt===ee.id,J=dt&&We==="above",xe=dt&&We==="below",ue=dt&&We==="child",z={};return ue&&(z.backgroundColor=`${t.accent}15`,z.boxShadow=`inset 0 0 0 2px ${t.accent}`),jsxRuntime.jsxs(framerMotion.motion.div,{"data-task-row":ee.id,className:`flex items-center cursor-pointer group ${Ee===ee.id?"opacity-50":""}`,style:{position:"relative",height:`${a}px`,borderLeft:kt?`3px solid ${t.accent}`:"3px solid transparent",backgroundColor:it?`${t.accent}22`:kt?t.accentLight:ue?`${t.accent}15`:At%2===0?t.bgPrimary:t.bgGrid,boxShadow:it?`inset 0 0 0 1px ${t.accent}55`:void 0,opacity:C?ee.isCriticalPath?1:.4:void 0,transition:"opacity 300ms ease",...z},onMouseEnter:()=>oe(ee.id),onMouseLeave:()=>oe(null),onClick:ne=>{let N=Un(e).map(q=>q.id),Ne=navigator.platform.toUpperCase().indexOf("MAC")>=0?ne.metaKey:ne.ctrlKey;Te(ee.id,N,Ne,ne.shiftKey),s?.(ee);},onDoubleClick:ne=>{ne.stopPropagation(),o?.(ee);},onContextMenu:ne=>{ne.preventDefault(),De({isOpen:true,x:ne.clientX,y:ne.clientY,type:"task",task:ee}),l?.(ee,ne);},whileHover:{backgroundColor:kt?t.accentLight:t.hoverBg},children:[J&&jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),xe&&jsxRuntime.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),at.map((ne,Ve)=>{let N=Ve===at.length-1,U=ne.id==="name",Ne=!!(ee.subtasks&&ee.subtasks.length>0),q=ne.id==="assignees"||ne.id==="startDate"||ne.id==="endDate"?ne.id:null,Nt=!!q&&!Ne&&W===ee.id&&!ht;return jsxRuntime.jsxs("div",{className:`px-4 flex items-center ${U?"justify-start":"justify-center"}`,style:{position:"relative",width:`${ne.width}px`,minWidth:`${ne.minWidth??(U?200:60)}px`,maxWidth:`${ne.maxWidth??2e3}px`,flexShrink:U&&at.length===1?1:0,flexGrow:U&&at.length===1?1:0,borderRight:N?"none":`1px solid ${W===ee.id?t.border:t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"visible"},children:[xa(ne,ee,U?ke:0),Nt&&q&&jsxRuntime.jsx("div",{title:"Arrastr\xE1 hacia abajo para aplicar a varias tareas",onMouseDown:Wt=>$t(Wt,ee.id,q,At),style:{position:"absolute",right:2,bottom:2,width:8,height:8,borderRadius:2,background:t.accent,border:`1px solid ${t.bgPrimary}`,cursor:"crosshair",zIndex:5}})]},`${ee.id}-${ne.id}`)})]},ee.id)})}),jsxRuntime.jsx(zn,{isOpen:Ie.isOpen,x:Ie.x,y:Ie.y,items:Ie.type==="header"&&Ie.columnId?H(Ie.columnId):Ie.type==="task"&&Ie.task?se(Ie.task):[],onClose:()=>De({...Ie,isOpen:false}),theme:t}),ot&&pt&&Ee&&typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsx("div",{style:{position:"fixed",left:pt.x+12,top:pt.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let ee=Ze.find(ke=>ke.task.id===Ee)?.task;return ee?jsxRuntime.jsx("div",{className:"flex items-center gap-2 px-2 py-1 rounded",style:{backgroundColor:"rgba(255, 255, 255, 0.08)",backdropFilter:"blur(4px)"},children:jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:t.textSecondary,opacity:.9},children:ee.name})}):null})()}),document.body)]})}function Nm(e,t){let[a,r]=react.useState("none"),[n,s]=react.useState(0),[o,l]=react.useState(e),[d,i]=react.useState(t),[u,m]=react.useState(null),[p,g]=react.useState(null),[f,x]=react.useState(null),[y,b]=react.useState(null),[h,v]=react.useState(0),[w,D]=react.useState(0),[S,M]=react.useState(null),[T,F]=react.useState(false);return {dragMode:a,setDragMode:r,dragOffset:n,setDragOffset:s,ghostX:o,setGhostX:l,ghostWidth:d,setGhostWidth:i,connectionLine:u,setConnectionLine:m,hoveredTaskId:p,setHoveredTaskId:g,activeZone:f,setActiveZone:x,draggedSegmentIndex:y,setDraggedSegmentIndex:b,draggedSegmentStartX:h,setDraggedSegmentStartX:v,segmentDragOffsetX:w,setSegmentDragOffsetX:D,hoveredSegmentIndex:S,setHoveredSegmentIndex:M,isHovered:T,setIsHovered:F,isDragging:a!=="none",isResizing:a==="resize-start"||a==="resize-end",isConnecting:a==="connect",resetDragState:(oe,L)=>{r("none"),m(null),g(null),l(oe),i(L),D(0),b(null),v(0);}}}function Li({task:e,x:t,y:a,width:r,theme:n,dayWidth:s,startDate:o,templates:l,onClick:d,onDoubleClick:i,onContextMenu:u,onDateChange:m,onDependencyCreate:p,allTaskPositions:g=[],onDragMove:f,onHoverChange:x,showBaseline:y,showTaskBarLabels:b=true,showCriticalPath:h=true,readOnly:v=false,onProgressChange:w}){let D=Nm(t,r),S=react.useRef(null),M=react.useRef(false),T=react.useRef(null),F=react.useRef(null),{dragMode:A,setDragMode:C,dragOffset:_,setDragOffset:W,ghostX:oe,setGhostX:L,ghostWidth:Y,setGhostWidth:K,connectionLine:V,setConnectionLine:B,hoveredTaskId:X,setHoveredTaskId:Ce,activeZone:Re,setActiveZone:R,draggedSegmentIndex:ae,setDraggedSegmentIndex:be,draggedSegmentStartX:Ie,setDraggedSegmentStartX:De,segmentDragOffsetX:Ee,setSegmentDragOffsetX:He,hoveredSegmentIndex:rt,setHoveredSegmentIndex:pe,isHovered:We,setIsHovered:je,isDragging:Oe,isResizing:tt,isConnecting:wt,resetDragState:pt}=D,Ue=18,ot=!!n.executionBarBg,Et=n.textPrimary==="#FFFFFF"||n.bgPrimary==="#050505",ge=ot?3:6,ht=e.subtasks&&e.subtasks.length>0,k=react.useRef(null),[O,Z]=(()=>{let J=react.useRef(null),[,xe]=react.useState(0);return [J.current,ue=>{J.current=ue,xe(z=>z+1);}]})(),ve=!!w&&!v&&!ht&&!e.segments&&!!e.startDate&&!!e.endDate,$=e.endDate&&(()=>{let J=new Date;J.setHours(0,0,0,0);let xe=new Date(e.endDate);return xe.setHours(0,0,0,0),xe<J})()&&e.progress<100,re=h&&e.isCriticalPath,Ye=n.name==="neutral"||n.today==="#1C1917",Te=e.status==="completed"||e.progress===100,Fe={low:"#10B981",LOW:"#10B981",medium:"#F59E0B",MEDIUM:"#F59E0B",high:"#F97316",HIGH:"#F97316",urgent:"#EF4444",URGENT:"#EF4444"},Le=h&&e.isCriticalPath||$?"#EF4444":e.color?e.color:e.priority&&Fe[e.priority]?Fe[e.priority]:n.taskBarPrimary,Ze=v?"default":Oe?wt?"crosshair":tt?"ew-resize":"grabbing":"grab",st=v?"default":"ew-resize",xt=(J=>J>=80?20:J>=60?15:J>=50?12:10)(r),$t=r<50,ut=r<40;react.useEffect(()=>{x&&(!We||Oe||e.segments)&&x(null);},[We,Oe,e.segments,x]);let Gt=J=>J.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Mt=()=>{let J=Math.ceil((e.endDate.getTime()-e.startDate.getTime())/864e5);return `${J} day${J!==1?"s":""}`},It=J=>Math.round(J/s)*s,Ft=J=>{let xe=Math.round(J/s),ue=new Date(o);return ue.setDate(ue.getDate()+xe),ue},Ct=(J,xe)=>{for(let ue of g){if(ue.id===e.id)continue;let z=5;if(J>=ue.x-z&&J<=ue.x+ue.width+z&&xe>=ue.y-z&&xe<=ue.y+ue.height+z)return ue.id}return null},St=react.useCallback((J,xe,ue)=>{if(v)return;J.preventDefault(),J.stopPropagation();let z=S.current?.ownerSVGElement;if(!z)return;let ne=z.createSVGPoint();ne.x=J.clientX,ne.y=J.clientY;let Ve=ne.matrixTransform(z.getScreenCTM()?.inverse()),N=ue!==void 0?ue:t,U=xe;if(!U){let Ne=Ve.x-N;J.shiftKey?(U="connect",B({x:t+r,y:a+Ue/2})):J.ctrlKey||J.metaKey?U="move":J.altKey?U=Ne<r/2?"resize-start":"resize-end":ut?Ne<r/2?U="move":U="resize-end":$t?Ne<=xt/2?U="resize-start":Ne>=r-xt/2?U="resize-end":U="move":Ne<=xt?U="resize-start":Ne>=r-xt?U="resize-end":U="move";}M.current=false,C(U),je(false),R(null),U==="move"?W(Ve.x-N):U==="connect"?B({x:t+r,y:a+Ue/2}):W(0),L(N),K(r);},[t,r,a,Ue,v]),ct=react.useCallback(J=>{let xe=S.current?.ownerSVGElement;if(!xe)return;let ue=xe.closest(".gantt-timeline-scroll");if(!ue)return;let z=ue.getBoundingClientRect(),ne=60,Ve=15,N=0;if(J.clientX<z.left+ne){let U=z.left+ne-J.clientX;N=-Math.min(Ve,U/2);}else if(J.clientX>z.right-ne){let U=J.clientX-(z.right-ne);N=Math.min(Ve,U/2);}return N!==0&&(ue.scrollLeft+=N),N!==0},[]),fa=react.useCallback(J=>{if(A==="none")return;M.current=true,F.current=J;let xe=S.current?.ownerSVGElement;if(!xe)return;if(A==="move"||A==="resize-start"||A==="resize-end"){let ne=ct(J);ne&&!T.current?T.current=window.setInterval(()=>{F.current&&(ct(F.current),fa(F.current));},16):!ne&&T.current&&(window.clearInterval(T.current),T.current=null);}let ue=xe.createSVGPoint();ue.x=J.clientX,ue.y=J.clientY;let z=ue.matrixTransform(xe.getScreenCTM()?.inverse());if(A==="connect"){B({x:z.x,y:z.y});let ne=Ct(z.x,z.y);Ce(ne);}else if(A==="move"){let ne=z.x-_,Ve=It(ne);L(Ve),K(r);let N=Math.round((Ve-t)/s);if(f?.(e.id,N,true),e.segments&&e.segments.length>0&&ae!==null){let U=Ve-Ie;He(U);}}else if(A==="resize-start"){let ne=z.x,Ve=It(ne),N=t+r-Ve;N>=s&&(L(Ve),K(N));}else if(A==="resize-end"){let ne=z.x,N=It(ne)-t;N>=s&&K(N);}},[A,t,r,s,_,e,It,ae,Ie,Ct,Ce,B,L,K,He,f,ct]),xa=react.useCallback(()=>{if(T.current&&(window.clearInterval(T.current),T.current=null),F.current=null,A!=="none"){if(A==="connect")X&&p&&p(e,X),B(null),Ce(null);else {let J=e.endDate.getTime()-e.startDate.getTime(),xe,ue,z=true;if(A==="move"){if(xe=Ft(oe),ue=new Date(xe.getTime()+J),e.segments&&e.segments.length>0&&ae!==null){let ne=Math.round(Ee/s),Ve=e.segments.map((q,et)=>{if(et===ae){let Nt=new Date(q.startDate),Wt=new Date(q.endDate);return Nt.setDate(Nt.getDate()+ne),Wt.setDate(Wt.getDate()+ne),{startDate:Nt,endDate:Wt}}return q}),N=Ve.flatMap(q=>[q.startDate,q.endDate]),U=new Date(Math.min(...N.map(q=>q.getTime()))),Ne=new Date(Math.max(...N.map(q=>q.getTime())));m?.({...e,segments:Ve},U,Ne),pt(t,r);return}}else A==="resize-start"?(xe=Ft(oe),ue=e.endDate,xe>ue&&(console.warn("Invalid date range: start date must be before or equal to end date"),z=false)):A==="resize-end"?(xe=e.startDate,ue=Ft(oe+Y),ue.setDate(ue.getDate()-1),ue<xe&&(console.warn("Invalid date range: end date must be after or equal to start date"),z=false)):z=false;z&&xe&&ue&&(ue.getTime()<xe.getTime()?console.warn("Invalid date range: end date cannot be before start date"):m?.(e,xe,ue));}f?.(e.id,0,false),pt(t,r);}},[A,oe,Y,e,m,X,p,t,r,s,Ft,Ee,ae,pt,f]);react.useEffect(()=>{if(A==="none")return;let J=ue=>{fa(ue);},xe=()=>{xa();};return window.addEventListener("mousemove",J),window.addEventListener("mouseup",xe),()=>{window.removeEventListener("mousemove",J),window.removeEventListener("mouseup",xe),T.current&&(window.clearInterval(T.current),T.current=null);}},[A,fa,xa]);let H=Oe&&!wt?oe:t,se=Oe&&!wt?Y:r,at=l.taskClass(e),Xt=24,ee=h?e.isCriticalPath?1:.25:1,ke=react.useCallback(J=>{if(!ve)return;J.stopPropagation(),J.preventDefault();let ue=S.current?.querySelector('rect[data-bar-background="true"]')?.getBoundingClientRect()??null;k.current={barRect:ue,initialPct:e.progress||0},J.currentTarget.setPointerCapture(J.pointerId),Z(e.progress||0);},[ve,e.progress,Z]),At=react.useCallback(J=>{let xe=k.current;if(!xe)return;let z=S.current?.querySelector('rect[data-bar-background="true"]')?.getBoundingClientRect()??xe.barRect;if(!z||z.width<=0)return;let ne=(J.clientX-z.left)/z.width,Ve=Math.round(Math.max(0,Math.min(1,ne))*100);J.shiftKey&&(Ve=Math.round(Ve/25)*25),Z(Ve);},[Z]),kt=react.useCallback(J=>{let xe=k.current;if(!xe)return;J.stopPropagation(),J.preventDefault();try{J.currentTarget.releasePointerCapture(J.pointerId);}catch{}let ue=O;k.current=null,Z(null),ue!=null&&ue!==xe.initialPct&&w&&w(e,ue);},[O,w,e,Z]),it=react.useCallback(J=>{J.stopPropagation(),J.preventDefault();},[]),dt=O??(e.progress||0);return jsxRuntime.jsxs("g",{ref:S,"data-task-bar":"true",style:{opacity:ee,transition:"opacity 300ms ease"},onClick:()=>{!Oe&&!M.current&&d?.(e),M.current=false;},onDoubleClick:J=>{!Oe&&!M.current&&(J.stopPropagation(),i?.(e));},onContextMenu:J=>{J.preventDefault(),u?.(e,J);},onMouseEnter:()=>!Oe&&je(true),onMouseMove:J=>{x&&We&&!Oe&&!e.segments&&x({task:e,x:t,y:a,width:r,height:Ue,showBelow:false,mouseX:J.clientX,mouseY:J.clientY});},onMouseLeave:()=>{Oe||(je(false),R(null));},children:[jsxRuntime.jsx("rect",{x:t,y:a,width:r+Xt,height:Ue,fill:"transparent",style:{pointerEvents:"all"}}),We&&!Oe&&!$t&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:a,width:xt,height:Ue,fill:Re==="resize-start"?n.accent:"transparent",opacity:Re==="resize-start"?.15:0,style:{cursor:st,pointerEvents:"all"},onMouseEnter:()=>R("resize-start"),onMouseDown:J=>St(J,"resize-start")}),jsxRuntime.jsx("rect",{x:t+xt,y:a,width:r-xt*2,height:Ue,fill:Re==="move"?n.accent:"transparent",opacity:Re==="move"?.1:0,style:{cursor:v?"default":"grab",pointerEvents:"all"},onMouseEnter:()=>R("move"),onMouseDown:J=>St(J,"move")}),jsxRuntime.jsx("rect",{x:t+r-xt,y:a,width:xt,height:Ue,fill:Re==="resize-end"?n.accent:"transparent",opacity:Re==="resize-end"?.15:0,style:{cursor:st,pointerEvents:"all"},onMouseEnter:()=>R("resize-end"),onMouseDown:J=>St(J,"resize-end")})]}),We&&!Oe&&ut&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:a,width:r/2,height:Ue,fill:Re==="move"?n.accent:"transparent",opacity:Re==="move"?.2:0,style:{cursor:v?"default":"grab",pointerEvents:"all"},onMouseEnter:()=>R("move"),onMouseDown:J=>St(J,"move")}),jsxRuntime.jsx("rect",{x:t+r/2,y:a,width:r/2,height:Ue,fill:Re==="resize-end"?n.accent:"transparent",opacity:Re==="resize-end"?.2:0,style:{cursor:st,pointerEvents:"all"},onMouseEnter:()=>R("resize-end"),onMouseDown:J=>St(J,"resize-end")}),We&&jsxRuntime.jsx(framerMotion.motion.line,{x1:t+r/2,y1:a+4,x2:t+r/2,y2:a+Ue-4,stroke:n.textTertiary,strokeWidth:1,strokeDasharray:"2 2",opacity:.3,initial:{opacity:0},animate:{opacity:.3},transition:{duration:.2},style:{pointerEvents:"none"}})]}),Oe&&!wt&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:oe,y:a,width:Y,height:Ue,rx:ge,fill:n.accent,opacity:.15,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 3",initial:{opacity:0},animate:{opacity:.25},transition:{duration:.15},style:{pointerEvents:"none"}}),y&&e.baselineStartDate&&e.baselineEndDate&&!Oe&&(()=>{let J=e.baselineStartDate.getTime(),xe=e.baselineEndDate.getTime(),ue=o.getTime(),z=864e5,ne=(J-ue)/z,Ve=(xe-J)/z,N=ne*s,U=Math.max(Ve*s,s),Ne=H+se,q=N+U,et=e.endDate?.getTime()??0,Nt=Math.ceil((et-xe)/z),Wt=Nt>0,Va=Nt<-0;return jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("rect",{x:N,y:a,width:U,height:Ue,rx:ge,fill:"none",stroke:Et?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.35)",strokeWidth:1.5,strokeDasharray:"6 4"}),Wt&&Ne>q&&jsxRuntime.jsx("rect",{x:q,y:a,width:Ne-q,height:Ue,rx:0,fill:"#EF4444",opacity:.2}),Wt&&jsxRuntime.jsxs("text",{x:Math.max(Ne,q)+6,y:a+Ue/2+1,fill:"#EF4444",fontSize:"10",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",dominantBaseline:"middle",children:["+",Nt,"d"]}),Va&&jsxRuntime.jsxs("text",{x:Ne+6,y:a+Ue/2+1,fill:"#10B981",fontSize:"10",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",dominantBaseline:"middle",children:[Nt,"d"]})]})})(),!e.segments&&ot&&ht&&(()=>{let xe=a+(Ue-8)/2,ue=4,z=e.progress||0,ne=new Date;ne.setHours(0,0,0,0);let Ve=e.startDate&&ne>=e.startDate,N=e.endDate&&(()=>{let Wt=new Date(e.endDate);return Wt.setHours(0,0,0,0),ne>Wt})(),U=e.startDate&&ne<e.startDate,Ne=1;if(Ve&&e.startDate&&e.endDate&&!U){let Wt=new Date(e.startDate);Wt.setHours(0,0,0,0);let Va=new Date(e.endDate);Va.setHours(0,0,0,0);let va=Math.max(1,(Va.getTime()-Wt.getTime())/(1e3*60*60*24)),cr=Math.min((ne.getTime()-Wt.getTime())/(1e3*60*60*24),va)/va*100;Ne=cr>0?z/cr:1;}let q;z>=100?q="#00E5CC":U?q="#4B5563":N&&z<100?q="#EF4444":Ne>=.95?q="#22C55E":Ne>=.8?q="#F59E0B":q="#EF4444";let et=Math.max(z/100*se,z>0?ue*2:0),Nt=se>100&&z>0;return jsxRuntime.jsxs("g",{"data-task-class":at,style:{cursor:"default",pointerEvents:"all"},children:[jsxRuntime.jsx("rect",{x:H,y:xe,width:se,height:8,rx:ue,fill:"rgba(255,255,255,0.10)"}),z>0&&jsxRuntime.jsx("rect",{x:H,y:xe,width:et,height:8,rx:ue,fill:q}),Nt&&jsxRuntime.jsxs("text",{x:H+et+6,y:xe+8/2,dominantBaseline:"central",fill:"rgba(255,255,255,0.7)",fontSize:"9",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[Math.round(z),"%"]})]})})(),!e.segments&&ot&&!ht&&jsxRuntime.jsx(framerMotion.motion.rect,{x:H,y:a,width:se,height:Ue,rx:ge,fill:n.executionBarBg||"rgba(255,255,255,0.06)",stroke:n.border||"rgba(255,255,255,0.1)",strokeWidth:1,"data-task-class":at,"data-bar-background":"true",initial:{opacity:0,scale:.95},animate:{opacity:Oe&&!wt?.15:e.parentId?.6:1,scale:We&&!Oe?1.01:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:J=>St(J),style:{cursor:Ze,pointerEvents:"all"}}),!e.segments&&!ot&&jsxRuntime.jsx(framerMotion.motion.rect,{x:H,y:a,width:se,height:Ue,rx:ge,fill:Le,"data-task-class":at,initial:{opacity:0,scale:.95},animate:{opacity:Oe&&!wt?.15:e.parentId?.6:We?.9:.8,scale:We&&!Oe?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:ht?void 0:J=>St(J),style:{cursor:ht?"default":Ze,pointerEvents:"all"}}),ot&&($||re)&&!e.segments&&jsxRuntime.jsx("rect",{x:H,y:a,width:se,height:Ue,rx:ge,fill:"none",stroke:n.criticalPath,strokeWidth:2,style:{pointerEvents:"none",filter:`drop-shadow(0 0 6px ${n.criticalPathLight||"rgba(255,46,46,0.4)"})`}}),!e.segments&&dt>0&&!ht&&jsxRuntime.jsx("rect",{x:H,y:a,width:Math.max(se*(dt/100),ge*2),height:Ue,rx:ge,fill:Le,opacity:1,style:{pointerEvents:"none"}}),!e.segments&&!ht&&e.progress<100&&(()=>{let J=e.progress>0?se*(e.progress/100):0,xe=H+J,ue=se-J,z=e.progress===0?ge:0,ne=e.progress===0?H:xe,Ve=e.progress===0?se:ue;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:ne,y:a,width:Ve,height:Ue,rx:z,fill:"url(#bar-remaining-hatch)",style:{pointerEvents:"none"}}),jsxRuntime.jsx("rect",{x:ne,y:a,width:Ve,height:Ue,rx:z,fill:"none",stroke:"#00E5CC",strokeWidth:.8,strokeDasharray:"5 3",style:{pointerEvents:"none"}})]})})(),ot&&!e.segments&&e.progress>0&&e.progress<100&&!ht&&!Oe&&O===null&&(()=>{let J=H+se*(e.progress/100),xe=8,ue=e.assignees?.[0];return jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("circle",{cx:J,cy:a+Ue/2,r:xe,fill:ue?.color||n.accent,stroke:"#000",strokeWidth:1.5}),jsxRuntime.jsx("text",{x:J,y:a+Ue/2,textAnchor:"middle",dominantBaseline:"central",fill:"#FFF",fontSize:"8",fontWeight:"600",fontFamily:"Inter, sans-serif",children:ue?.initials||ue?.name?.charAt(0)?.toUpperCase()||""})]})})(),ve&&!Oe&&se>=40&&(O!==null||dt<88)&&(()=>{let J=H+se*(dt/100),xe=a+Ue/2,ue=O!==null,z=ue?7:We?6:5,ne=ue||We?1:.35,Ve=H+se-J,N=Math.max(4,Math.min(12,Ve-10)),U=12;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:J-U,y:xe-12,width:U+N,height:24,fill:"transparent",style:{cursor:"ew-resize",touchAction:"none"},onPointerDown:ke,onPointerMove:At,onPointerUp:kt,onPointerCancel:kt,onClick:it,onDoubleClick:it,onMouseDown:Ne=>Ne.stopPropagation()}),jsxRuntime.jsx("circle",{cx:J,cy:xe,r:z,fill:"#FFFFFF",stroke:Le,strokeWidth:2,opacity:ne,style:{pointerEvents:"none",filter:ue?`drop-shadow(0 0 4px ${Le})`:void 0,transition:"r 120ms ease, opacity 120ms ease"}}),ue&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("rect",{x:J-20,y:xe-28,width:40,height:18,rx:4,fill:Et?"rgba(15, 15, 20, 0.95)":"rgba(255, 255, 255, 0.95)",stroke:Le,strokeWidth:1}),jsxRuntime.jsxs("text",{x:J,y:xe-16,textAnchor:"middle",dominantBaseline:"central",fill:Et?"#FFFFFF":"#111111",fontSize:"11",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",children:[O,"%"]})]})]})})(),e.segments&&e.segments.map((J,xe)=>{let ue=(J.startDate.getTime()-o.getTime())/864e5*s,ne=(J.endDate.getTime()-o.getTime())/(1e3*60*60*24)*s-ue+s,Ve=Oe&&A==="move"&&ae===xe,N=rt===xe,U=Ve?ue+Ee:ue;return jsxRuntime.jsxs("g",{onMouseEnter:()=>!Oe&&pe(xe),onMouseLeave:()=>!Oe&&pe(null),children:[jsxRuntime.jsx(framerMotion.motion.rect,{x:U,y:a,width:ne,height:Ue,rx:ge,fill:Le,initial:{opacity:0,scale:.95},animate:{opacity:Ve||e.parentId?.6:N?.9:.8,scale:N&&!Oe?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:Ne=>{Ne.stopPropagation(),be(xe),De(ue),St(Ne,void 0,ue);},style:{cursor:Ze,pointerEvents:"all"}}),jsxRuntime.jsx("rect",{x:U,y:a,width:ne*(e.progress/100),height:Ue,rx:ge,fill:Le,opacity:1,style:{pointerEvents:"none"}})]},`segment-${xe}`)}),Ye&&($||re)&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[re&&!$&&jsxRuntime.jsx("rect",{x:H,y:a,width:se,height:Ue,rx:ge,fill:"none",stroke:n.border,strokeWidth:2,strokeDasharray:"4 4",opacity:.8,style:{pointerEvents:"none"}}),$&&jsxRuntime.jsx("rect",{x:H,y:a,width:se,height:Ue,rx:ge,fill:"url(#diagonal-stripes)",opacity:.3,style:{pointerEvents:"none"}})]}),b&&se>60&&!e.segments&&!(ot&&ht)&&(()=>{let J=l.taskLabel(e),xe=typeof J=="string"?J:e.name,ue=xe.length>Math.floor(se/8)?`${xe.substring(0,Math.floor(se/8))}...`:xe;return jsxRuntime.jsx("text",{x:H+8,y:a+Ue/2,dominantBaseline:"middle",fill:Te?"rgba(255, 255, 255, 0.6)":"#FFFFFF",fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none",textDecoration:Te?"line-through":"none"},children:ue})})(),!Oe&&!e.segments&&!ht&&e.progress>0&&e.progress<100&&(ot?jsxRuntime.jsxs("text",{x:H+se+6,y:a+Ue/2,dominantBaseline:"middle",fill:"#FFFFFF",fontSize:"9",fontWeight:"500",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}):se>100?jsxRuntime.jsxs("text",{x:H+se-12,y:a+Ue/2,dominantBaseline:"middle",textAnchor:"end",fill:"rgba(255, 255, 255, 0.9)",fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}):null),e.status&&se>80&&!Oe&&!e.segments&&!(ot&&ht)&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[e.status==="completed"&&jsxRuntime.jsx("circle",{cx:H+se-8,cy:a+8,r:4,fill:n.statusCompleted,stroke:"#FFFFFF",strokeWidth:1.5}),e.status==="in-progress"&&jsxRuntime.jsx("circle",{cx:H+se-8,cy:a+8,r:4,fill:n.statusInProgress,stroke:"#FFFFFF",strokeWidth:1.5,opacity:.8})]}),(We||tt)&&!wt&&!e.segments&&!ht&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:H-2,y:a,width:16,height:Ue,fill:"transparent",style:{cursor:st},onMouseEnter:()=>R("resize-start"),onMouseLeave:()=>R(null),onMouseDown:J=>{J.stopPropagation(),St(J,"resize-start");}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:H+4,y:a+8,width:3,height:Ue-16,rx:1.5,fill:Re==="resize-start"||A==="resize-start"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]}),jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:H+se-14,y:a,width:16,height:Ue,fill:"transparent",style:{cursor:st},onMouseEnter:()=>R("resize-end"),onMouseLeave:()=>R(null),onMouseDown:J=>{J.stopPropagation(),St(J,"resize-end");}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:H+se-7,y:a+8,width:3,height:Ue-16,rx:1.5,fill:Re==="resize-end"||A==="resize-end"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:We&&!Oe&&!e.segments&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[jsxRuntime.jsx("circle",{cx:t+r+10,cy:a+Ue/2,r:10,fill:"transparent",style:{cursor:"crosshair"},onMouseEnter:()=>R("connect"),onMouseLeave:()=>R(null),onMouseDown:J=>{J.stopPropagation(),St(J,"connect");}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:t+r+10,cy:a+Ue/2,r:4,fill:n.accent,stroke:"#FFFFFF",strokeWidth:1.5,style:{pointerEvents:"none"},initial:{scale:0},animate:{scale:Re==="connect"?1.4:1},exit:{scale:0},transition:{duration:.15,type:"spring",stiffness:500,damping:30}})]})}),wt&&V&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx(framerMotion.motion.line,{x1:t+r,y1:a+Ue/2,x2:V.x,y2:V.y,stroke:X?n.statusCompleted:n.accent,strokeWidth:X?3:2,strokeDasharray:"6 4",initial:{opacity:0},animate:{opacity:X?1:.8},transition:{duration:.15}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:V.x,cy:V.y,r:X?8:6,fill:X?n.statusCompleted:n.accent,stroke:"#FFFFFF",strokeWidth:2,initial:{scale:0},animate:{scale:1},transition:{duration:.15}}),X&&jsxRuntime.jsx(framerMotion.motion.text,{x:V.x+15,y:V.y,dominantBaseline:"middle",fill:n.statusCompleted,fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",initial:{opacity:0,x:V.x+10},animate:{opacity:1,x:V.x+15},transition:{duration:.2},children:"Connect"})]}),(We||Oe)&&!wt&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:H-1,y:a-1,width:se+2,height:Ue+2,rx:ge+1,fill:"none",stroke:Oe?n.accent:ot?"rgba(255,255,255,0.2)":n.taskBarPrimary,strokeWidth:ot?1:2,opacity:Oe||ot?.6:.4,initial:{opacity:0},animate:{opacity:Oe||ot?.6:.4},transition:{duration:.2},style:{pointerEvents:"none"}}),tt&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("line",{x1:oe,y1:0,x2:oe,y2:1e3,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}}),jsxRuntime.jsx("line",{x1:oe+Y,y1:0,x2:oe+Y,y2:1e3,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:We&&!Oe&&!e.segments&&!x&&(()=>{let ue=a<100,z=ue?a+Ue+13:a-82-13,ne=ue?`M ${H+se/2-6} ${a+Ue+3} L ${H+se/2} ${a+Ue+13} L ${H+se/2+6} ${a+Ue+3}`:`M ${H+se/2-6} ${a-13} L ${H+se/2} ${a-3} L ${H+se/2+6} ${a-13}`,Ve=z+22,N=z+40,U=z+55,Ne=z+70,q=ue?z+82-5:a-18;return jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:ue?-10:10},animate:{opacity:1,y:0},exit:{opacity:0,y:ue?-10:10},transition:{duration:.2},style:{pointerEvents:"none"},children:[jsxRuntime.jsx("path",{d:ne,fill:n.bgSecondary,stroke:n.border,strokeWidth:1}),jsxRuntime.jsx("rect",{x:H+se/2-120,y:z,width:240,height:82,rx:8,fill:n.bgSecondary,stroke:n.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("text",{x:H+se/2,y:Ve,textAnchor:"middle",fill:n.textPrimary,fontSize:"13",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>28?`${e.name.substring(0,28)}...`:e.name}),jsxRuntime.jsx("text",{x:H+se/2-110,y:N,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Start:"}),jsxRuntime.jsx("text",{x:H+se/2-70,y:N,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Gt(e.startDate)}),jsxRuntime.jsx("text",{x:H+se/2-110,y:U,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"End:"}),jsxRuntime.jsx("text",{x:H+se/2-70,y:U,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Gt(e.endDate)}),jsxRuntime.jsx("text",{x:H+se/2+10,y:N,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Duration:"}),jsxRuntime.jsx("text",{x:H+se/2+65,y:N,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Mt()}),jsxRuntime.jsx("text",{x:H+se/2+10,y:U,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Progress:"}),jsxRuntime.jsxs("text",{x:H+se/2+65,y:U,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.progress,"%"]}),e.assignees&&e.assignees.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("text",{x:H+se/2-110,y:Ne,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Assignees:"}),jsxRuntime.jsxs("text",{x:H+se/2-50,y:Ne,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.assignees.map(et=>et.name).join(", ").substring(0,30),e.assignees.map(et=>et.name).join(", ").length>30?"...":""]})]}),!ue&&jsxRuntime.jsx("text",{x:H+se/2,y:q,textAnchor:"middle",fill:n.textTertiary,fontSize:"9",fontFamily:"Inter, sans-serif",style:{opacity:.7},children:ut?"Left: move \u2022 Right: resize":$t?"Drag to move \u2022 Hold ALT + drag edge to resize":"Drag edges to resize \u2022 Drag center to move \u2022 Click \u26AB to link"})]})})()})]})}var Vd=260,Gn=8,Em=16,zv=-12;function Mm({tooltipData:e,theme:t,locale:a="en",workingDaysConfig:r}){let[n,s]=react.useState(null);if(react.useLayoutEffect(()=>{if(!e){s(null);return}let{task:v,mouseX:w,mouseY:D}=e,S=v.effortMinutes!=null||v.timeLoggedMinutes!=null||v.soldEffortMinutes!=null,M=v.lastActivity!=null,T=(S?155:105)+(M?28:0),F=w+Em,A=D+zv-T;F+Vd>window.innerWidth-Gn&&(F=w-Vd-Em),F<Gn&&(F=Gn);let C=A<Gn;C&&(A=D+20),A+T>window.innerHeight-Gn&&(A=window.innerHeight-Gn-T),s({left:F,top:A,showBelow:C});},[e]),!e||!n)return null;let{task:o}=e,l=o.effortMinutes!=null||o.timeLoggedMinutes!=null||o.soldEffortMinutes!=null,d={start:a==="es"?"Inicio":"Start",end:a==="es"?"Fin":"End",duration:a==="es"?"Duraci\xF3n":"Duration",progress:a==="es"?"Progreso":"Progress",assignees:a==="es"?"Asignados":"Assignees",estimated:a==="es"?"Estimado":"Estimated",logged:a==="es"?"Registrado":"Logged",quoted:a==="es"?"Ofertado":"Quoted"},i=v=>v.toLocaleDateString(a==="es"?"es-ES":"en-US",{month:"short",day:"numeric",year:"numeric"}),u=()=>{if(!o.startDate||!o.endDate)return "N/A";if(!r?.enabledWeekdays){let A=Math.max(1,Math.round((o.endDate.getTime()-o.startDate.getTime())/864e5)+1);return a==="es"?`${A} d\xEDa${A!==1?"s":""}`:`${A} day${A!==1?"s":""}`}let v=r.enabledWeekdays,w=r.holidayDates instanceof Set?r.holidayDates:new Set(r.holidayDates??[]),D=A=>`${A.getFullYear()}-${String(A.getMonth()+1).padStart(2,"0")}-${String(A.getDate()).padStart(2,"0")}`,S=0,M=new Date(o.startDate.getFullYear(),o.startDate.getMonth(),o.startDate.getDate()),T=new Date(o.endDate.getFullYear(),o.endDate.getMonth(),o.endDate.getDate());for(;M.getTime()<=T.getTime();){let A=M.getDay();v[A]&&!w.has(D(M))&&S++,M.setDate(M.getDate()+1);}let F=Math.max(0,S);return a==="es"?`${F} d\xEDa${F!==1?"s":""}`:`${F} day${F!==1?"s":""}`},m=v=>{if(v==null||v===0)return "N/A";let w=Math.floor(v/60),D=v%60;return w===0?`${D}m`:D===0?`${w}h`:`${w}h ${D}m`},p=t.textTertiary||"#9CA3AF",g=t.textSecondary||"#D1D5DB",f=t.textPrimary||"#F9FAFB",x=t.accent||"#00E5CC",y=t.bgSecondary||"#1F2937",b=t.border||"#374151",h=jsxRuntime.jsxs("div",{style:{position:"fixed",left:n.left,top:n.top,width:Vd,zIndex:99999,pointerEvents:"none",fontFamily:"Inter, system-ui, sans-serif",animation:"gantt-tooltip-fade 0.12s ease-out"},children:[jsxRuntime.jsxs("div",{style:{background:y,border:`1px solid ${b}`,borderRadius:8,padding:"12px 14px",boxShadow:"0 8px 24px rgba(0,0,0,0.3)"},children:[jsxRuntime.jsx("div",{style:{fontSize:13,fontWeight:600,color:f,marginBottom:8,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.name}),jsxRuntime.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"3px 12px",fontSize:11},children:[jsxRuntime.jsx(Ii,{label:d.start,value:o.startDate?i(o.startDate):"N/A",labelColor:p,valueColor:g}),jsxRuntime.jsx(Ii,{label:d.duration,value:u(),labelColor:p,valueColor:g}),jsxRuntime.jsx(Ii,{label:d.end,value:o.endDate?i(o.endDate):"N/A",labelColor:p,valueColor:g}),jsxRuntime.jsx(Ii,{label:d.progress,value:`${o.progress}%`,labelColor:p,valueColor:g})]}),o.assignees&&o.assignees.length>0&&jsxRuntime.jsxs("div",{style:{fontSize:11,marginTop:6},children:[jsxRuntime.jsxs("span",{style:{color:p},children:[d.assignees,": "]}),jsxRuntime.jsx("span",{style:{color:g,fontWeight:500},children:o.assignees.map(v=>v.name).join(", ")})]}),l&&jsxRuntime.jsxs("div",{style:{marginTop:6,display:"flex",gap:10,fontSize:11},children:[o.effortMinutes!=null&&jsxRuntime.jsxs("span",{children:[jsxRuntime.jsxs("span",{style:{color:p},children:[d.estimated,":"]})," ",jsxRuntime.jsx("span",{style:{color:g,fontWeight:600},children:m(o.effortMinutes)})]}),o.timeLoggedMinutes!=null&&jsxRuntime.jsxs("span",{children:[jsxRuntime.jsxs("span",{style:{color:p},children:[d.logged,":"]})," ",jsxRuntime.jsx("span",{style:{color:x,fontWeight:600},children:m(o.timeLoggedMinutes)})]}),o.soldEffortMinutes!=null&&jsxRuntime.jsxs("span",{children:[jsxRuntime.jsxs("span",{style:{color:p},children:[d.quoted,":"]})," ",jsxRuntime.jsx("span",{style:{color:g,fontWeight:600},children:m(o.soldEffortMinutes)})]})]}),o.lastActivity&&jsxRuntime.jsxs("div",{style:{marginTop:8,paddingTop:8,borderTop:`1px solid ${t?.borderSubtle||"rgba(255,255,255,0.08)"}`,fontSize:11,color:p,lineHeight:1.4},children:[jsxRuntime.jsx("span",{style:{opacity:.7},children:a==="es"?"\xDAltimo: ":"Last: "}),jsxRuntime.jsx("span",{style:{color:g},children:o.lastActivity.userName})," ",jsxRuntime.jsx("span",{children:o.lastActivity.summary})," ",jsxRuntime.jsx("span",{style:{opacity:.6},children:o.lastActivity.relativeTime})]})]}),jsxRuntime.jsx("style",{children:`
|
|
125
|
+
- [ ] `,priority:"MEDIUM",labels:["meeting"]}}];function vd({templates:e,onSelectTemplate:t,className:a}){let[r,n]=react.useState(false),s=react.useRef(null),o=react.useRef(null);react.useEffect(()=>{function i(u){s.current&&!s.current.contains(u.target)&&o.current&&!o.current.contains(u.target)&&n(false);}if(r)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[r]);let l=i=>{t(i),n(false);},d=e.reduce((i,u)=>{let m=u.category||"Other";return i[m]||(i[m]=[]),i[m].push(u),i},{});return jsxRuntime.jsxs("div",{className:c("relative inline-block",a),children:[jsxRuntime.jsxs("button",{ref:o,onClick:()=>n(!r),className:"flex items-center gap-2 px-3 py-2 rounded-lg border transition-all text-sm font-medium shadow-lg",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-primary)"},onMouseEnter:i=>{i.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",i.currentTarget.style.borderColor="var(--theme-border-secondary)";},onMouseLeave:i=>{i.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",i.currentTarget.style.borderColor="var(--theme-border-primary)";},title:"Create from template",children:[jsxRuntime.jsx("span",{className:"text-base leading-none",children:"\u{1F4CB}"}),jsxRuntime.jsx("span",{children:"Templates"}),jsxRuntime.jsx("svg",{className:c("w-4 h-4 transition-transform",r&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsxRuntime.jsxs("div",{ref:s,className:"absolute top-full left-0 mt-2 min-w-[320px] max-w-[400px] rounded-xl backdrop-blur-xl border shadow-2xl z-50 overflow-hidden max-h-[500px] overflow-y-auto",style:{backgroundColor:"var(--theme-bg-primary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-4 py-3 border-b sticky top-0 backdrop-blur-sm",style:{borderColor:"var(--theme-border-primary)",backgroundColor:"var(--theme-bg-secondary)"},children:[jsxRuntime.jsx("span",{className:"text-sm font-bold uppercase tracking-wider",style:{color:"var(--theme-text-primary)"},children:"Card Templates"}),jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:"Quick start with pre-configured cards"})]}),Object.entries(d).map(([i,u])=>jsxRuntime.jsxs("div",{className:"py-2",children:[jsxRuntime.jsx("div",{className:"px-4 py-2",children:jsxRuntime.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--theme-text-secondary)"},children:i})}),jsxRuntime.jsx("div",{children:u.map(m=>jsxRuntime.jsxs("button",{onClick:()=>l(m),className:"w-full px-4 py-3 flex items-start gap-3 text-left transition-all active:scale-[0.98]",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-2xl leading-none mt-0.5",children:m.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"font-semibold text-sm",style:{color:"var(--theme-text-primary)"},children:m.name}),m.description&&jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:m.description})]})]},m.id))})]},i)),e.length===0&&jsxRuntime.jsx("div",{className:"px-4 py-8 text-center",style:{color:"var(--theme-text-tertiary)"},children:jsxRuntime.jsx("p",{className:"text-sm",children:"No templates available"})})]})]})}function kd({board:e,isOpen:t,onClose:a,onImport:r,boardElementRef:n,className:s}){let[o,l]=react.useState("export"),[d,i]=react.useState("json"),[u,m]=react.useState(null),p=react.useRef(null);if(!t)return null;let g=async()=>{let x=n?.current||void 0,y=await xu(e,d,x);vu(y,d);},f=async x=>{let y=x.target.files?.[0];if(y){try{let b=await Cu(y),h=y.name.endsWith(".json")?"json":"csv",v=ku(b,h);m(v),v.success&&r&&r(v,b);}catch(b){m({success:false,errors:[`Failed to read file: ${b instanceof Error?b.message:"Unknown error"}`]});}p.current&&(p.current.value="");}};return jsxRuntime.jsxs("div",{className:c("fixed inset-0 z-[9999] flex items-center justify-center",s),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:a}),jsxRuntime.jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-2xl w-full mx-4",children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsxRuntime.jsx("span",{className:"text-3xl",children:"\u{1F4E6}"}),"Export / Import"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Transfer your board data"})]}),jsxRuntime.jsx("button",{onClick:a,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"flex border-b border-white/10",children:[jsxRuntime.jsx("button",{onClick:()=>l("export"),className:c("flex-1 px-6 py-4 font-semibold transition-colors",o==="export"?"text-white border-b-2 border-[#00E5CC]":"text-white/50 hover:text-white/80"),children:"Export"}),jsxRuntime.jsx("button",{onClick:()=>l("import"),className:c("flex-1 px-6 py-4 font-semibold transition-colors",o==="import"?"text-white border-b-2 border-[#00E5CC]":"text-white/50 hover:text-white/80"),children:"Import"})]}),jsxRuntime.jsxs("div",{className:"p-6",children:[o==="export"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Select format"}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-3",children:["json","csv","pdf"].map(x=>jsxRuntime.jsxs("button",{onClick:()=>i(x),className:c("p-4 rounded-lg border-2 transition-all text-center",d===x?"border-[#00E5CC] bg-[#00E5CC]/20 text-white":"border-white/20 hover:border-white/40 text-white/70 hover:text-white"),children:[jsxRuntime.jsxs("div",{className:"text-2xl mb-2",children:[x==="json"&&"\u{1F4C4}",x==="csv"&&"\u{1F4CA}",x==="pdf"&&"\u{1F4DD}"]}),jsxRuntime.jsx("div",{className:"font-semibold uppercase text-xs",children:x})]},x))})]}),jsxRuntime.jsxs("div",{className:"bg-white/5 rounded-lg p-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:"Preview"}),jsxRuntime.jsxs("div",{className:"text-xs text-white/60",children:[jsxRuntime.jsxs("div",{children:["Board: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.title||"Untitled"})]}),jsxRuntime.jsxs("div",{children:["Columns: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.columns.length})]}),jsxRuntime.jsxs("div",{children:["Cards: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.cards.length})]})]})]}),jsxRuntime.jsx("button",{onClick:g,className:"w-full py-3 px-4 bg-gradient-to-r from-[#00C4AE] to-[#00C4AE] hover:from-[#00E5CC] hover:to-[#00C4AE] text-white font-semibold rounded-lg transition-all shadow-lg shadow-[#00E5CC]/20",children:"Export Board"})]}),o==="import"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Upload file"}),jsxRuntime.jsx("input",{ref:p,type:"file",accept:".json,.csv",onChange:f,className:"hidden"}),jsxRuntime.jsxs("button",{onClick:()=>p.current?.click(),className:"w-full py-12 px-4 border-2 border-dashed border-white/30 hover:border-white/50 rounded-lg transition-colors text-white/70 hover:text-white",children:[jsxRuntime.jsx("div",{className:"text-5xl mb-3",children:"\u{1F4C1}"}),jsxRuntime.jsx("div",{className:"font-semibold mb-1",children:"Click to select file"}),jsxRuntime.jsx("div",{className:"text-xs text-white/50",children:"Supports JSON and CSV files"})]})]}),u&&jsxRuntime.jsxs("div",{className:c("p-4 rounded-lg",u.success?"bg-green-500/20 border border-green-500/30":"bg-red-500/20 border border-red-500/30"),children:[jsxRuntime.jsx("h3",{className:c("font-semibold mb-2",u.success?"text-green-400":"text-red-400"),children:u.success?"\u2713 Import Successful":"\u2717 Import Failed"}),u.success&&jsxRuntime.jsxs("div",{className:"text-sm text-white/80",children:[jsxRuntime.jsxs("div",{children:["Cards imported: ",u.cardsImported]}),jsxRuntime.jsxs("div",{children:["Columns imported: ",u.columnsImported]})]}),u.errors&&u.errors.length>0&&jsxRuntime.jsx("div",{className:"mt-2 text-sm",children:u.errors.map((x,y)=>jsxRuntime.jsxs("div",{className:"text-red-300",children:["\u2022 ",x]},y))})]})]})]})]})]})}var px=["URGENT","HIGH","MEDIUM","LOW"],mx=[{value:"none",label:"None"},{value:"created",label:"Date Created"},{value:"priority",label:"Priority"},{value:"dueDate",label:"Due Date"},{value:"title",label:"Title"},{value:"estimate",label:"Estimate"}],gx=[{value:"none",label:"No Grouping"},{value:"priority",label:"By Priority"},{value:"assignee",label:"By Assignee"},{value:"label",label:"By Label"}];function Cd({filters:e,sort:t,onFiltersChange:a,onSortChange:r,onReset:n,onFilterMyTasks:s,onFilterOverdue:o,onFilterHighPriority:l,availableUsers:d=[],availableLabels:i=[],availableColumns:u=[],showQuickFilters:m=true,compact:p=false,groupBy:g="none",onGroupByChange:f}){let[x,y]=react.useState(true),b=react.useCallback(S=>{a({search:S.target.value});},[a]),h=react.useCallback(S=>{a({dateFilter:S.target.value});},[a]),v=react.useCallback(S=>{r({by:S.target.value});},[r]),w=react.useCallback(()=>{r({order:t.order==="asc"?"desc":"asc"});},[t.order,r]),D=e.search||e.dateFilter!=="all"||e.priorities.length>0||e.assignees.length>0||e.labels.length>0||t.by!=="none";return jsxRuntime.jsxs("div",{className:`filter-bar ${p?"filter-bar--compact":""} ${x?"filter-bar--collapsed":""}`,children:[jsxRuntime.jsxs("div",{className:"filter-bar__header",onClick:()=>y(!x),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",marginBottom:x?"0":"12px",padding:"4px 6px",borderRadius:"6px",transition:"all 0.2s ease"},onMouseEnter:S=>{S.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:x?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--theme-text-secondary)"},children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})}),jsxRuntime.jsx("span",{className:"filter-bar__label",style:{fontWeight:500,fontSize:"0.875rem",color:"var(--theme-text-primary)"},children:"Filters & Grouping"}),D&&jsxRuntime.jsxs("span",{style:{color:"var(--theme-accent-primary)",fontSize:"0.75rem",fontWeight:600},children:["(",[e.search&&"search",e.dateFilter!=="all"&&"date",e.priorities.length>0&&"priority",e.assignees.length>0&&"assignee",e.labels.length>0&&"label",t.by!=="none"&&"sort"].filter(Boolean).length," active)"]})]}),!x&&jsxRuntime.jsxs("div",{className:"filter-bar__content",children:[m&&jsxRuntime.jsxs("div",{className:"filter-bar__quick",style:{marginBottom:"12px"},children:[jsxRuntime.jsx("span",{className:"filter-bar__label",children:"Quick:"}),s&&jsxRuntime.jsx("button",{onClick:s,className:"filter-bar__quick-btn",title:"Show only my tasks",children:"My Tasks"}),o&&jsxRuntime.jsx("button",{onClick:o,className:"filter-bar__quick-btn",title:"Show overdue tasks",children:"Overdue"}),l&&jsxRuntime.jsx("button",{onClick:l,className:"filter-bar__quick-btn",title:"Show high priority tasks",children:"High Priority"})]}),jsxRuntime.jsxs("div",{className:"filter-bar__main",children:[jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("input",{type:"text",placeholder:"Search tasks...",value:e.search,onChange:b,className:"filter-bar__search"})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.dateFilter,onChange:h,className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Dates"}),jsxRuntime.jsx("option",{value:"overdue",children:"Overdue"}),jsxRuntime.jsx("option",{value:"today",children:"Today"}),jsxRuntime.jsx("option",{value:"this-week",children:"This Week"})]})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.priorities[0]||"all",onChange:S=>{let M=S.target.value;a({priorities:M==="all"?[]:[M]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Priorities"}),px.map(S=>jsxRuntime.jsx("option",{value:S,children:S},S))]})}),d.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.assignees[0]||"all",onChange:S=>{let M=S.target.value;a({assignees:M==="all"?[]:[M]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Assignees"}),d.map(S=>jsxRuntime.jsx("option",{value:S.id,children:S.name},S.id))]})}),i.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.labels[0]||"all",onChange:S=>{let M=S.target.value;a({labels:M==="all"?[]:[M]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Labels"}),i.map(S=>jsxRuntime.jsx("option",{value:S,children:S},S))]})}),jsxRuntime.jsxs("div",{className:"filter-bar__field filter-bar__sort",children:[jsxRuntime.jsx("span",{className:"filter-bar__label",style:{color:"var(--theme-text-secondary)"},children:"Sort:"}),jsxRuntime.jsx("select",{value:t.by,onChange:v,className:"filter-bar__select filter-bar__select--sm",children:mx.map(S=>jsxRuntime.jsx("option",{value:S.value,children:S.label},S.value))}),t.by!=="none"&&jsxRuntime.jsx("button",{onClick:w,className:"filter-bar__sort-toggle",title:`Sort ${t.order==="asc"?"descending":"ascending"}`,children:t.order==="asc"?"\u2191":"\u2193"})]}),f&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("select",{value:g,onChange:S=>f(S.target.value),className:"filter-bar__select",style:{fontWeight:500,borderWidth:"2px"},children:gx.map(S=>jsxRuntime.jsx("option",{value:S.value,children:S.label},S.value))})}),D&&jsxRuntime.jsx("button",{onClick:n,className:"filter-bar__reset",title:"Clear all filters",children:"Clear"})]})]})]})}function Td({onOpenExport:e,onOpenThemes:t,onOpenShortcuts:a,className:r,viewMode:n="kanban",onExportGanttPDF:s,onExportGanttExcel:o,onExportGanttPNG:l,onExportGanttCSV:d}){let[i,u]=react.useState(false),m=react.useRef(null);react.useEffect(()=>{let g=f=>{m.current&&!m.current.contains(f.target)&&u(false);};return i&&document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g);}},[i]);let p=g=>{g(),u(false);};return jsxRuntime.jsxs("div",{className:c("relative",r),ref:m,children:[jsxRuntime.jsxs("button",{onClick:()=>u(!i),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all border",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-secondary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",g.currentTarget.style.color="var(--theme-text-primary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",g.currentTarget.style.color="var(--theme-text-secondary)";},"aria-label":"Configuration Menu","aria-expanded":i,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:"3"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6M5.6 5.6l4.2 4.2m4.2 4.2l4.2 4.2M1 12h6m6 0h6M5.6 18.4l4.2-4.2m4.2-4.2l4.2-4.2"})]}),jsxRuntime.jsx("span",{children:"Config"})]}),i&&jsxRuntime.jsxs("div",{className:"absolute right-0 mt-2 w-48 rounded-lg border shadow-lg overflow-hidden z-50",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[n==="kanban"?jsxRuntime.jsxs("button",{onClick:()=>p(e),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Export"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:()=>p(async()=>await s?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Export PDF"]}),jsxRuntime.jsxs("button",{onClick:()=>p(async()=>await o?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),jsxRuntime.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),"Export Excel"]}),jsxRuntime.jsxs("button",{onClick:()=>p(async()=>await l?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},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",ry:"2"}),jsxRuntime.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),jsxRuntime.jsx("polyline",{points:"21 15 16 10 5 21"})]}),"Export PNG"]}),jsxRuntime.jsxs("button",{onClick:()=>p(()=>d?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),jsxRuntime.jsx("line",{x1:"8",y1:"17",x2:"16",y2:"17"})]}),"Export CSV"]})]}),jsxRuntime.jsxs("button",{onClick:()=>p(t),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},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:"5"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6m8.5-8.5L17 15M7 9L3.5 5.5M7 15l-3.5 3.5M20.5 5.5L17 9m3.5 11.5L17 17"})]}),"Themes"]}),jsxRuntime.jsxs("button",{onClick:()=>p(a),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),jsxRuntime.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M8 12h.01M12 12h.01M16 12h.01M7 16h10"})]}),"Shortcuts"]})]})]})}var Nd={name:"dark",displayName:"Dark (Enhanced)",emoji:"\u{1F319}",colors:{bgPrimary:"#222326",bgSecondary:"#2A2B2F",bgTertiary:"#33343A",bgCard:"#2d2d2d",bgHover:"#353535",bgActive:"#404040",bgInput:"#2a2a2a",textPrimary:"#F4F5F8",textSecondary:"#AEB6C0",textTertiary:"#7A7F8A",textDisabled:"#606060",textInverse:"#1a1a1a",borderPrimary:"rgba(255, 255, 255, 0.1)",borderSecondary:"rgba(255, 255, 255, 0.05)",borderDefault:"#404040",borderHover:"#505050",borderSubtle:"#2a2a2a",accentPrimary:"#5E6AD2",accentHover:"#7780DD",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.1)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.2)",success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#00E5CC",danger:"#ef4444",dangerBorder:"rgba(239, 68, 68, 0.3)",dangerBackground:"rgba(239, 68, 68, 0.1)",dangerBackgroundHover:"rgba(239, 68, 68, 0.2)"},shadows:{sm:"0 1px 2px rgba(0, 0, 0, 0.3)",md:"0 4px 12px rgba(0, 0, 0, 0.4)",lg:"0 12px 32px rgba(0, 0, 0, 0.5)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Dd={name:"light",displayName:"Light (Standard)",emoji:"\u2600\uFE0F",colors:{bgPrimary:"#FFFFFF",bgSecondary:"#F7F7F8",bgTertiary:"#EEEFF1",bgCard:"#ffffff",bgHover:"#f3f4f6",bgActive:"#e5e7eb",bgInput:"#f9fafb",textPrimary:"#1A1A1A",textSecondary:"#5A5A5A",textTertiary:"#8A8A8A",textDisabled:"#d1d5db",textInverse:"#ffffff",borderPrimary:"rgba(0, 0, 0, 0.1)",borderSecondary:"rgba(0, 0, 0, 0.05)",borderDefault:"#e5e7eb",borderHover:"#d1d5db",borderSubtle:"#f3f4f6",accentPrimary:"#5E6AD2",accentHover:"#4A56B8",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.08)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.15)",success:"#059669",warning:"#D97706",error:"#DC2626",info:"#00E5CC",danger:"#dc2626",dangerBorder:"rgba(220, 38, 38, 0.3)",dangerBackground:"rgba(220, 38, 38, 0.08)",dangerBackgroundHover:"rgba(220, 38, 38, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.12)",md:"0 4px 12px rgba(0, 0, 0, 0.15)",lg:"0 12px 32px rgba(0, 0, 0, 0.2)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Sd={name:"neutral",emoji:"\u26AA",displayName:"Neutral (Zen)",colors:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgTertiary:"#E7E5E4",bgCard:"#FEFEFE",bgHover:"#F0EFEE",bgActive:"#E7E5E4",bgInput:"#FAFAF9",textPrimary:"#1C1917",textSecondary:"#57534E",textTertiary:"#A8A29E",textDisabled:"#D6D3D1",textInverse:"#FAFAF9",borderPrimary:"#E7E5E4",borderSecondary:"#F0EFEE",borderDefault:"#E7E5E4",borderHover:"#D6D3D1",borderSubtle:"#F5F5F4",accentPrimary:"#292524",accentHover:"#44403C",interactivePrimary:"#292524",interactivePrimaryHover:"#44403C",interactivePrimaryBorder:"rgba(41, 37, 36, 0.3)",interactivePrimaryBackground:"rgba(41, 37, 36, 0.06)",interactivePrimaryBackgroundHover:"rgba(41, 37, 36, 0.12)",success:"#15803D",warning:"#CA8A04",error:"#B91C1C",info:"#1D4ED8",danger:"#B91C1C",dangerBorder:"rgba(185, 28, 28, 0.3)",dangerBackground:"rgba(185, 28, 28, 0.08)",dangerBackgroundHover:"rgba(185, 28, 28, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.1)",md:"0 4px 12px rgba(0, 0, 0, 0.12)",lg:"0 12px 32px rgba(0, 0, 0, 0.15)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},un={dark:Nd,light:Dd,neutral:Sd},Di="dark";var Si=react.createContext(void 0),Tx="asakaa-theme";function Jp({children:e,defaultTheme:t=Di,storageKey:a=Tx}){let[r,n]=react.useState(()=>{if(typeof window<"u"){let l=localStorage.getItem(a);if(l&&(l==="dark"||l==="light"||l==="neutral"))return l}return t}),s=react.useCallback(l=>{n(l),typeof window<"u"&&localStorage.setItem(a,l);},[a]);react.useEffect(()=>{if(typeof window>"u")return;let l=document.documentElement,d=un[r];Object.entries(d.colors).forEach(([u,m])=>{m&&l.style.setProperty(`--theme-${Nx(u)}`,m);}),Object.entries({bgPrimary:"--asakaa-color-background-primary",bgSecondary:"--asakaa-color-background-secondary",bgTertiary:"--asakaa-color-background-tertiary",bgCard:"--asakaa-color-background-card",bgHover:"--asakaa-color-background-hover",bgActive:"--asakaa-color-background-active",bgInput:"--asakaa-color-background-input",textPrimary:"--asakaa-color-text-primary",textSecondary:"--asakaa-color-text-secondary",textTertiary:"--asakaa-color-text-tertiary",textDisabled:"--asakaa-color-text-disabled",textInverse:"--asakaa-color-text-inverse",borderPrimary:"--asakaa-color-border-primary",borderSecondary:"--asakaa-color-border-secondary",borderDefault:"--asakaa-color-border-default",borderHover:"--asakaa-color-border-hover",borderSubtle:"--asakaa-color-border-subtle",accentPrimary:"--asakaa-color-accent-primary",accentHover:"--asakaa-color-accent-hover",interactivePrimary:"--asakaa-color-interactive-primary",interactivePrimaryHover:"--asakaa-color-interactive-primaryHover",interactivePrimaryBorder:"--asakaa-color-interactive-primaryBorder",interactivePrimaryBackground:"--asakaa-color-interactive-primaryBackground",interactivePrimaryBackgroundHover:"--asakaa-color-interactive-primaryBackgroundHover",success:"--asakaa-color-status-success",warning:"--asakaa-color-status-warning",error:"--asakaa-color-status-error",info:"--asakaa-color-status-info",danger:"--asakaa-color-danger",dangerBorder:"--asakaa-color-danger-border",dangerBackground:"--asakaa-color-danger-background",dangerBackgroundHover:"--asakaa-color-danger-backgroundHover"}).forEach(([u,m])=>{let p=d.colors[u];p&&l.style.setProperty(m,p);}),l.setAttribute("data-theme",r),l.classList.remove("theme-dark","theme-light","theme-neutral"),l.classList.add(`theme-${r}`);},[r]);let o={theme:r,setTheme:s,themes:un};return jsxRuntime.jsx(Si.Provider,{value:o,children:e})}function Rn(){let e=react.useContext(Si);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function Nx(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ed({isOpen:e,onClose:t,className:a}){let{theme:r,setTheme:n}=Rn();return e?jsxRuntime.jsxs("div",{className:c("fixed inset-0 z-[9999] flex items-center justify-center",a),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t}),jsxRuntime.jsxs("div",{className:"relative rounded-2xl border shadow-2xl max-w-md w-full mx-4",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b flex items-center justify-between",style:{borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsx("h2",{className:"text-2xl font-bold",style:{color:"var(--theme-text-primary)"},children:"Select Theme"}),jsxRuntime.jsx("button",{onClick:t,className:"text-2xl leading-none p-2 hover:bg-white/10 rounded-lg transition-colors",style:{color:"var(--theme-text-secondary)"},"aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"p-6 space-y-3",children:Object.entries(un).map(([s,o])=>jsxRuntime.jsxs("button",{onClick:()=>{n(s),t();},className:c("w-full p-4 rounded-lg border-2 transition-all flex items-center gap-4",r===s?"border-[#00E5CC] bg-[#00E5CC]/20":"border-white/20 hover:border-white/40"),style:{backgroundColor:r===s?"var(--theme-accent-primary)20":"transparent"},children:[jsxRuntime.jsx("div",{className:"text-3xl",children:o.emoji}),jsxRuntime.jsxs("div",{className:"text-left flex-1",children:[jsxRuntime.jsx("div",{className:"font-semibold",style:{color:"var(--theme-text-primary)"},children:o.displayName}),jsxRuntime.jsxs("div",{className:"text-xs",style:{color:"var(--theme-text-secondary)"},children:[s==="dark"&&"Default dark theme with Linear-inspired colors",s==="light"&&"Clean light theme with high contrast",s==="neutral"&&"Monochrome zen theme"]})]}),r===s&&jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5"})})]},s))})]})]}):null}function Qp(e="dark"){if(typeof window>"u"||typeof getComputedStyle>"u")return ft[e]||ft.dark;let t=document.documentElement,a=getComputedStyle(t),r=(s,o)=>a.getPropertyValue(s).trim()||o;return {bgPrimary:r("--theme-bg-primary",ft[e].bgPrimary),bgSecondary:r("--theme-bg-secondary",ft[e].bgSecondary),bgGrid:r("--theme-bg-card",ft[e].bgGrid),bgWeekend:r("--theme-bg-hover",ft[e].bgWeekend),border:r("--theme-border-primary",ft[e].border),borderLight:r("--theme-border-subtle",ft[e].borderLight),textPrimary:r("--theme-text-primary",ft[e].textPrimary),textSecondary:r("--theme-text-secondary",ft[e].textSecondary),textTertiary:r("--theme-text-tertiary",ft[e].textTertiary),accent:r("--theme-accent-primary",ft[e].accent),accentHover:r("--theme-accent-hover",ft[e].accentHover),accentLight:r("--theme-accent-primary",ft[e].accentLight),taskBarPrimary:r("--theme-accent-primary",ft[e].taskBarPrimary),taskBarProgress:r("--theme-accent-hover",ft[e].taskBarProgress),taskBarHandle:r("--theme-text-inverse",ft[e].taskBarHandle||"#FFFFFF"),dependency:r("--theme-border-secondary",ft[e].dependency),dependencyHover:r("--theme-border-secondary",ft[e].dependencyHover),criticalPath:r("--theme-error",ft[e].criticalPath),criticalPathLight:r("--theme-error",ft[e].criticalPathLight),today:e==="light"?r("--theme-accent-primary",ft[e].today):e==="neutral"?r("--theme-text-primary",ft[e].today):r("--theme-error",ft[e].today),todayLight:e==="light"?r("--theme-accent-primary",ft[e].todayLight):e==="neutral"?r("--theme-text-primary",ft[e].todayLight):r("--theme-error",ft[e].todayLight),milestone:r("--theme-warning",ft[e].milestone),milestoneLight:r("--theme-warning",ft[e].milestoneLight),statusTodo:r("--theme-text-tertiary",ft[e].statusTodo),statusInProgress:r("--theme-accent-primary",ft[e].statusInProgress),statusCompleted:r("--theme-success",ft[e].statusCompleted),hoverBg:r("--theme-bg-hover",ft[e].hoverBg),focusRing:r("--theme-accent-primary",ft[e].focusRing),...ft[e].dotGrid&&{dotGrid:ft[e].dotGrid},...ft[e].glassHeader&&{glassHeader:ft[e].glassHeader},...ft[e].glassToolbar&&{glassToolbar:ft[e].glassToolbar},...ft[e].forecastHud&&{forecastHud:ft[e].forecastHud},...ft[e].neonRedGlow&&{neonRedGlow:ft[e].neonRedGlow},...ft[e].executionBarBg&&{executionBarBg:ft[e].executionBarBg}}}var Ei={columns:{taskName:"TASK NAME",startDate:"Start Date",endDate:"End Date",duration:"Duration",assignees:"Assignees",status:"Status",progress:"% Complete",priority:"Priority"},toolbar:{today:"Today",day:"Day",week:"Week",month:"Month",export:"Export",exportPdf:"Export to PDF",exportPng:"Export to PNG",exportCsv:"Export to CSV",exportExcel:"Export to Excel",exportMsProject:"Export to MS Project",undo:"Undo",redo:"Redo",createTask:"New Task",density:"Row Density",compact:"Compact",normal:"Normal",spacious:"Spacious",filterAll:"All",filterIncomplete:"Incomplete",filterInProgress:"In Progress",filterCompleted:"Completed",filter:"Filters",filterBy:"FILTER BY STATUS",filterAllDesc:"Show all tasks",filterIncompleteDesc:"Hide completed tasks",filterInProgressDesc:"Tasks currently being worked on",filterCompletedDesc:"Only show finished tasks",clearFilter:"Clear filter",hideCompleted:"Hide Completed Tasks",toDo:"To Do / Pending",wbsLevel:"Level",wbsAllLevels:"All",viewExecution:"Execution",viewOracle:"Pulse View",simulateScenario:"Simulate Scenario",projectForecast:"PROJECT FORECAST",expectedFinish:"Expected Finish",confidence:"Confidence",costAtCompletion:"Cost at Completion",delayLabel:"Delay",earlyLabel:"Early",onTimeLabel:"On Time",budgetOver:"Over",budgetUnder:"Under",baselines:"Baselines",visibility:"Visibility",share:"Share",copySnapshotLink:"Copy Snapshot Link",copied:"Copied!"},contextMenu:{editTask:"Edit Task",addSubtask:"Add Subtask",markIncomplete:"Mark Incomplete",setInProgress:"Set In Progress",markComplete:"Mark Complete",duplicateTask:"Duplicate Task",splitTask:"Split Task",deleteTask:"Delete Task"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",addSubtask:"Add Subtask",indent:"Indent",outdent:"Outdent",moveUp:"Move Up",moveDown:"Move Down",splitTask:"Split Task",linkTasks:"Link Tasks",unlinkTasks:"Unlink Tasks"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{progress:"Progress",duration:"Duration",days:"days",day:"day",assigned:"Assigned",milestone:"Milestone",criticalPath:"Critical Path",subtask:"Subtask",task:"Task",noTasks:"No tasks yet",addTask:"Add task",newTask:"New Task",loading:"Loading...",error:"Error",today:"Today",week:"Week",clickToSetDates:"Click to set dates..."},ai:{placeholder:'Ask AI to edit tasks... (e.g., "Move Design to next week")',thinking:"Thinking...",suggestions:{moveTask:'Move "Task Name" to next Monday',extendTask:'Extend "Task Name" by 3 days',renameTask:'Rename "Old Name" to "New Name"',setProgress:'Set "Task Name" progress to 50%',linkTasks:'Link "Task A" to "Task B"',createTask:'Create a new task called "New Task"',deleteTask:'Delete "Task Name"',assignTask:'Assign John to "Task Name"'},errors:{taskNotFound:"Task not found",invalidDate:"Invalid date",invalidDuration:"Invalid duration",invalidProgress:"Invalid progress value",unknownCommand:"Unknown command",processingError:"Error processing command"}},export:{projectName:"Gantt Project",ganttTasks:"Gantt Tasks",taskId:"Task ID",taskName:"Task Name",startDate:"Start Date",endDate:"End Date",isMilestone:"Is Milestone",parentId:"Parent ID",yes:"Yes",no:"No",noTasksToExport:"No tasks available to export"},dateFormat:{short:"MM/dd",medium:"MMM d",long:"MMMM d, yyyy"}},Zp={columns:{taskName:"NOMBRE DE TAREA",startDate:"Fecha Inicio",endDate:"Fecha Fin",duration:"Duraci\xF3n",assignees:"Asignados",status:"Estado",progress:"% Completado",priority:"Prioridad"},toolbar:{today:"Hoy",day:"D\xEDa",week:"Semana",month:"Mes",export:"Exportar",exportPdf:"Exportar a PDF",exportPng:"Exportar a PNG",exportCsv:"Exportar a CSV",exportExcel:"Exportar a Excel",exportMsProject:"Exportar a MS Project",undo:"Deshacer",redo:"Rehacer",createTask:"Nueva Tarea",density:"Densidad",compact:"Compacto",normal:"Normal",spacious:"Espacioso",filterAll:"Todas",filterIncomplete:"Sin completar",filterInProgress:"En progreso",filterCompleted:"Completadas",filter:"Filtros",filterBy:"FILTRAR POR ESTADO",filterAllDesc:"Mostrar todas las tareas",filterIncompleteDesc:"Ocultar tareas completadas",filterInProgressDesc:"Tareas en las que se est\xE1 trabajando",filterCompletedDesc:"Solo mostrar tareas terminadas",clearFilter:"Limpiar filtro",hideCompleted:"Ocultar Tareas Completadas",toDo:"Por Hacer / Pendiente",wbsLevel:"Nivel",wbsAllLevels:"Todos",viewExecution:"Ejecuci\xF3n",viewOracle:"Vista Pulse",simulateScenario:"Simular Escenario",projectForecast:"PRON\xD3STICO DEL PROYECTO",expectedFinish:"Fin Estimado",confidence:"Confianza",costAtCompletion:"Costo al Completar",delayLabel:"Retraso",earlyLabel:"Adelanto",onTimeLabel:"A Tiempo",budgetOver:"Excedido",budgetUnder:"Bajo",baselines:"L\xEDneas Base",visibility:"Visibilidad",share:"Compartir",copySnapshotLink:"Copiar enlace de vista",copied:"\xA1Copiado!"},contextMenu:{editTask:"Editar Tarea",addSubtask:"Agregar Subtarea",markIncomplete:"Marcar Incompleta",setInProgress:"Marcar En Progreso",markComplete:"Marcar Completada",duplicateTask:"Duplicar Tarea",splitTask:"Dividir Tarea",deleteTask:"Eliminar Tarea"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",addSubtask:"Agregar Subtarea",indent:"Aumentar Nivel",outdent:"Disminuir Nivel",moveUp:"Mover Arriba",moveDown:"Mover Abajo",splitTask:"Dividir Tarea",linkTasks:"Vincular Tareas",unlinkTasks:"Desvincular Tareas"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{progress:"Progreso",duration:"Duraci\xF3n",days:"d\xEDas",day:"d\xEDa",assigned:"Asignado",milestone:"Hito",criticalPath:"Ruta Cr\xEDtica",subtask:"Subtarea",task:"Tarea",noTasks:"Sin tareas a\xFAn",addTask:"Agregar tarea",newTask:"Nueva Tarea",loading:"Cargando...",error:"Error",today:"Hoy",week:"Semana",clickToSetDates:"Clic para establecer fechas..."},ai:{placeholder:'P\xEDdele a la IA que edite tareas... (ej: "Mover Dise\xF1o a la pr\xF3xima semana")',thinking:"Pensando...",suggestions:{moveTask:'Mover "Nombre de Tarea" al pr\xF3ximo lunes',extendTask:'Extender "Nombre de Tarea" por 3 d\xEDas',renameTask:'Renombrar "Nombre Anterior" a "Nombre Nuevo"',setProgress:'Establecer progreso de "Nombre de Tarea" al 50%',linkTasks:'Vincular "Tarea A" con "Tarea B"',createTask:'Crear una nueva tarea llamada "Nueva Tarea"',deleteTask:'Eliminar "Nombre de Tarea"',assignTask:'Asignar a Juan a "Nombre de Tarea"'},errors:{taskNotFound:"Tarea no encontrada",invalidDate:"Fecha inv\xE1lida",invalidDuration:"Duraci\xF3n inv\xE1lida",invalidProgress:"Valor de progreso inv\xE1lido",unknownCommand:"Comando desconocido",processingError:"Error procesando el comando"}},export:{projectName:"Proyecto Gantt",ganttTasks:"Tareas Gantt",taskId:"ID de Tarea",taskName:"Nombre de Tarea",startDate:"Fecha Inicio",endDate:"Fecha Fin",isMilestone:"Es Hito",parentId:"ID Padre",yes:"S\xED",no:"No",noTasksToExport:"No hay tareas disponibles para exportar"},dateFormat:{short:"dd/MM",medium:"d MMM",long:"d de MMMM de yyyy"}},Md={en:Ei,es:Zp};function em(e){return Md[e]||Md.en}function Pd(e,t){let a=em(e);return t?{columns:{...a.columns,...t.columns},toolbar:{...a.toolbar,...t.toolbar},contextMenu:{...a.contextMenu,...t.contextMenu},actions:{...a.actions,...t.actions},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},ai:{...a.ai,...t.ai,suggestions:{...a.ai.suggestions,...t.ai?.suggestions},errors:{...a.ai.errors,...t.ai?.errors}},export:{...a.export,...t.export},dateFormat:{...a.dateFormat,...t.dateFormat}}:a}var $n=react.createContext(Ei);function Hr(){return react.useContext($n)}function Ts(e,t,a="left",r=208){let[n,s]=react.useState({top:0,left:0});return react.useEffect(()=>{if(!t||!e.current)return;let o=e.current.getBoundingClientRect(),l=o.bottom+4,d;a==="right"?d=o.right-r:d=o.left;let i=8;d+r>window.innerWidth-i&&(d=window.innerWidth-i-r),d<i&&(d=i),s({top:l,left:d});},[t,a,e,r]),n}function dm({theme:e,onExportPNG:t,onExportPDF:a,onExportExcel:r,onExportCSV:n,onExportJSON:s,onExportMSProject:o}){let[l,d]=react.useState(false),[i,u]=react.useState(null),m=react.useRef(null),p=react.useRef(null),g=Hr(),f=Ts(m,l,"right",176);if(react.useEffect(()=>{if(!l)return;let h=v=>{let w=v.target;m.current&&!m.current.contains(w)&&p.current&&!p.current.contains(w)&&d(false);};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[l]),!(t||a||r||n||s||o))return null;let y=[{id:"png",label:"PNG",description:"Image",icon:jsxRuntime.jsx(lucideReact.FileImage,{className:"w-4 h-4"}),handler:t},{id:"pdf",label:"PDF",description:"Document",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:a},{id:"excel",label:"Excel",description:"Spreadsheet",icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-4 h-4"}),handler:r},{id:"csv",label:"CSV",description:"Comma-separated",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:n},{id:"json",label:"JSON",description:"Data",icon:jsxRuntime.jsx(lucideReact.FileJson,{className:"w-4 h-4"}),handler:s},{id:"msproject",label:"MS Project",description:"XML",icon:jsxRuntime.jsx(lucideReact.FolderKanban,{className:"w-4 h-4"}),handler:o}].filter(h=>h.handler),b=async(h,v)=>{if(v){u(h);try{await v();}catch(w){console.error(`Export ${h} failed:`,w);}finally{u(null),d(false);}}};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:m,onClick:()=>d(!l),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{backgroundColor:l?e.accent:e.bgSecondary,border:`1px solid ${l?e.accent:e.borderLight}`,color:l?"#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:g.toolbar.export}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:l?"rotate(180deg)":"rotate(0deg)"}})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:l&&jsxRuntime.jsx(framerMotion.motion.div,{ref:p,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-44 rounded-xl overflow-hidden",style:{top:f.top,left:f.left,zIndex:99999,backgroundColor:e.bgPrimary==="#050505"?"rgba(10, 10, 10, 0.95)":e.bgSecondary,border:`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.08)":e.border}`,boxShadow:e.bgPrimary==="#050505"?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:jsxRuntime.jsx("div",{className:"py-1",children:y.map((h,v)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>b(h.id,h.handler),disabled:i!==null,className:"w-full flex items-center gap-2.5 px-3 py-2 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:v<y.length-1?`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.borderLight}`:"none",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:v*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:i===h.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"})}):h.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-[11px] font-medium truncate",style:{color:e.textPrimary},children:h.label}),jsxRuntime.jsx("div",{className:"text-[9px] truncate",style:{color:e.textTertiary},children:h.description})]})]},h.id))})})}),document.body)]})}function am({theme:e,onExportPNG:t,onExportPDF:a,onExportExcel:r,onExportMSProject:n,onCopySnapshotLink:s}){let[o,l]=react.useState(false),[d,i]=react.useState(null),[u,m]=react.useState(false),p=react.useRef(null),g=react.useRef(null),f=Hr(),x=Ts(p,o,"right",224),y=e.bgPrimary==="#050505"||(e.bgPrimary||"").charAt(1)==="0",b=f.toolbar.visibility==="Visibilidad";react.useEffect(()=>{if(!o)return;let D=S=>{let M=S.target;p.current&&!p.current.contains(M)&&g.current&&!g.current.contains(M)&&l(false);};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[o]);let h=[{id:"png",label:f.toolbar.exportPng,icon:jsxRuntime.jsx(lucideReact.FileImage,{className:"w-3.5 h-3.5"}),handler:t},{id:"pdf",label:f.toolbar.exportPdf,icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-3.5 h-3.5"}),handler:a},{id:"excel",label:f.toolbar.exportExcel,icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-3.5 h-3.5"}),handler:r},{id:"msproject",label:f.toolbar.exportMsProject,icon:jsxRuntime.jsx(lucideReact.FolderKanban,{className:"w-3.5 h-3.5"}),handler:n}].filter(D=>D.handler),v=async(D,S)=>{if(S){i(D);try{await S();}catch(M){console.error(`Export ${D} failed:`,M);}finally{i(null),l(false);}}},w=()=>{s?.(),m(true),setTimeout(()=>m(false),2e3);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:p,onClick:()=>l(!o),className:"flex items-center justify-center w-8 h-8 rounded-lg",style:{color:o?e.accent:e.textTertiary,backgroundColor:o?e.accentLight:"transparent"},whileHover:{color:e.textPrimary,backgroundColor:e.hoverBg},title:f.toolbar.share,children:jsxRuntime.jsx(lucideReact.Share2,{className:"w-4 h-4"})}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:o&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:g,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-56 rounded-xl overflow-hidden",style:{top:x.top,left:x.left,zIndex:99999,backgroundColor:y?"rgba(10, 10, 10, 0.95)":e.bgSecondary||"#F8FAFC",border:`1px solid ${y?"rgba(255,255,255,0.08)":e.border||"#CBD5E1"}`,boxShadow:y?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[h.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:b?"EXPORTAR":"EXPORT"})}),jsxRuntime.jsx("div",{className:"py-0.5",children:h.map((D,S)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>v(D.id,D.handler),disabled:d!==null,className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:y?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:S*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md flex-shrink-0",style:{backgroundColor:e.accentLight,color:e.accent},children:d===D.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"})}):D.icon}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:D.label})]},D.id))})]}),h.length>0&&s&&jsxRuntime.jsx("div",{className:"mx-3 h-px",style:{backgroundColor:y?"rgba(255,255,255,0.06)":e.borderLight}}),s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:b?"COMPARTIR":"SHARE"})}),jsxRuntime.jsx("div",{className:"py-0.5 pb-1.5",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:w,className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:y?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:h.length*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md flex-shrink-0",style:{backgroundColor:u?"rgba(34,197,94,0.15)":e.accentLight,color:u?"#22C55E":e.accent},children:u?jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5"}):jsxRuntime.jsx(lucideReact.Link2,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:u?f.toolbar.copied:f.toolbar.copySnapshotLink})]})})]})]})}),document.body)]})}function qx({options:e,value:t,onChange:a,theme:r,layoutId:n="activeSegment"}){return jsxRuntime.jsx("div",{className:"inline-flex p-1 rounded-lg relative",style:{backgroundColor:r.bgSecondary,border:`1px solid ${r.borderLight}`},children:e.map(s=>{let o=t===s.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>a(s.value),className:"relative px-3 py-1.5 rounded-md text-[11px] transition-all flex items-center gap-1.5 min-w-[70px] justify-center",style:{color:o?r.textPrimary:r.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:o?600:500,zIndex:o?2:1},whileHover:{scale:1.02},whileTap:{scale:.98},children:[o&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:n,className:"absolute inset-0 rounded-md",style:{backgroundColor:r.accent,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},transition:{type:"spring",stiffness:400,damping:30}}),s.icon&&jsxRuntime.jsx("span",{className:"relative z-10",style:{color:o?"#FFFFFF":r.textTertiary},children:s.icon}),jsxRuntime.jsx("span",{className:"relative z-10",style:{color:o?"#FFFFFF":r.textTertiary},children:s.label})]},s.value)})})}function Yx({options:e,value:t,onChange:a,theme:r}){return jsxRuntime.jsx("div",{className:"inline-flex items-center gap-1",children:e.map(n=>{let s=t===n.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>a(n.value),className:"relative px-3 py-1.5 text-[11px] transition-all",style:{color:s?r.accent:r.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:s?600:500},whileHover:{color:s?r.accent:r.textSecondary},whileTap:{scale:.98},children:[jsxRuntime.jsx("span",{children:n.label}),s&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:"timeScaleUnderline",className:"absolute bottom-0 left-1 right-1 h-0.5 rounded-full",style:{backgroundColor:r.accent},transition:{type:"spring",stiffness:400,damping:30}})]},n.value)})})}function rm({theme:e,value:t,onChange:a,maxDepth:r}){let[n,s]=react.useState(false),o=react.useRef(null),l=react.useRef(null),d=Hr(),i=Ts(o,n,"left");react.useEffect(()=>{if(!n)return;let p=g=>{let f=g.target;o.current&&!o.current.contains(f)&&l.current&&!l.current.contains(f)&&s(false);};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);let u=[{value:"all",label:d.toolbar.wbsAllLevels||"All"},...Array.from({length:Math.min(r,5)},(p,g)=>({value:g+1,label:`L${g+1}`}))],m=t==="all"?d.toolbar.wbsAllLevels||"All":`L${t}`;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:o,onClick:()=>s(!n),className:"flex items-center gap-1.5 px-2 py-1.5 rounded-lg transition-all",style:{backgroundColor:n?e.accentLight:e.bgSecondary,border:`1px solid ${n?e.accent:e.borderLight}`,color:n?e.accent:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},title:`${d.toolbar.wbsLevel||"Level"}: ${m}`,children:[jsxRuntime.jsx(lucideReact.Layers,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium",style:{fontFamily:"'JetBrains Mono', monospace"},children:m})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:n&&jsxRuntime.jsx(framerMotion.motion.div,{ref:l,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-24 rounded-xl overflow-hidden",style:{top:i.top,left:i.left,zIndex:99999,backgroundColor:e.bgPrimary==="#050505"?"rgba(10, 10, 10, 0.95)":e.bgSecondary,border:`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.08)":e.border}`,boxShadow:e.bgPrimary==="#050505"?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:jsxRuntime.jsx("div",{className:"py-1",children:u.map((p,g)=>{let f=t===p.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{a(p.value),s(false);},className:"w-full flex items-center justify-between px-3 py-2 text-left transition-all",style:{backgroundColor:f?e.accentLight:"transparent",borderBottom:g<u.length-1?`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.borderLight}`:"none"},whileHover:{backgroundColor:f?e.accentLight:e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:g*.03},children:[jsxRuntime.jsx("span",{className:"text-[11px]",style:{color:f?e.accent:e.textPrimary,fontFamily:"'JetBrains Mono', monospace",fontWeight:f?600:500},children:p.label}),f&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent}})]},String(p.value))})})})}),document.body)]})}function om({theme:e,value:t,onChange:a,hideCompleted:r=false,onHideCompletedChange:n}){let[s,o]=react.useState(false),l=react.useRef(null),d=react.useRef(null),i=Hr(),u=Ts(l,s,"left");react.useEffect(()=>{if(!s)return;let f=setTimeout(()=>{let x=b=>{let h=b.target;l.current&&!l.current.contains(h)&&d.current&&!d.current.contains(h)&&o(false);},y=b=>{b.key==="Escape"&&o(false);};document.addEventListener("mousedown",x),document.addEventListener("keydown",y),d._cleanup=()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",y);};},100);return ()=>{clearTimeout(f),d._cleanup&&d._cleanup();}},[s]);let m=[{value:"all",label:i.toolbar.filterAll||"Show All",icon:jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}),color:"text-[#00E5CC]"},{value:"completed",label:i.toolbar.filterCompleted||"Completed",icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3.5 h-3.5"}),color:"text-green-500"},{value:"in_progress",label:i.toolbar.filterInProgress||"In Progress",icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3.5 h-3.5"}),color:"text-[#00E5CC]"},{value:"incomplete",label:i.toolbar.toDo||"To Do / Pending",icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-3.5 h-3.5"}),color:"text-gray-400"}],p=t!=="all"||r,g=e.bgPrimary==="#0F1117"||e.bgPrimary==="#0a0a0a"||e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:l,onClick:f=>{f.stopPropagation(),o(x=>!x);},className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{backgroundColor:p?g?"rgba(0, 229, 204, 0.2)":"rgb(239 246 255)":s?e.hoverBg:e.bgSecondary,border:`1px solid ${p?g?"rgba(0, 229, 204, 0.5)":"rgb(191 219 254)":e.borderLight}`,color:p?"#00E5CC":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:i.toolbar.filter||"Filters"}),p&&jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#00E5CC"}})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:d,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-56 rounded-xl overflow-hidden",style:{top:u.top,left:u.left,zIndex:99999,backgroundColor:g?"rgba(10, 10, 10, 0.95)":"#FFFFFF",border:`1px solid ${g?"rgba(255,255,255,0.08)":"rgb(229 231 235)"}`,boxShadow:g?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:g?"rgba(255,255,255,0.06)":"rgb(229 231 235)"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:g?"rgba(255,255,255,0.35)":"#9CA3AF",fontFamily:"Inter, sans-serif"},children:i.toolbar.filterBy||"FILTER BY STATUS"})}),jsxRuntime.jsx("div",{className:"py-1",children:m.map(f=>{let x=t===f.value&&!r,y=()=>f.value==="all"?x?jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}):jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-gray-400"}):f.icon;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{a(f.value),n&&n(false),o(false);},className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{backgroundColor:x?g?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:g?"rgba(255,255,255,0.06)":"rgb(243 244 246)"},children:[jsxRuntime.jsx("span",{className:`${x?f.color:"text-gray-400"} flex-shrink-0`,children:y()}),jsxRuntime.jsx("span",{className:"flex-1 text-left whitespace-nowrap font-medium",style:{color:g?"rgba(255,255,255,0.85)":"#111827"},children:f.label}),x&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"#00E5CC"}})]},f.value)})}),jsxRuntime.jsx("div",{className:"mx-3 h-px",style:{backgroundColor:g?"rgba(255,255,255,0.06)":"rgb(229 231 235)"}}),n&&jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{n(!r),r||a("all"),o(false);},className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{backgroundColor:r?g?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:g?"rgba(255,255,255,0.06)":"rgb(243 244 246)"},children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:r?"#00E5CC":g?"rgba(255,255,255,0.35)":"#9CA3AF"}}),jsxRuntime.jsx("span",{className:"flex-1 text-left whitespace-nowrap font-medium",style:{color:g?"rgba(255,255,255,0.85)":"#111827"},children:i.toolbar.hideCompleted||"Hide Completed Tasks"}),r&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"#00E5CC"}})]})})]})}),document.body)]})}function Xx({value:e,onChange:t,theme:a}){let r=Hr(),n=a.bgPrimary==="#050505"||a.textPrimary==="#FFFFFF",s=[{value:"day",label:r.toolbar.day.charAt(0).toUpperCase()},{value:"week",label:r.toolbar.week.charAt(0).toUpperCase()},{value:"month",label:r.toolbar.month.charAt(0).toUpperCase()}];return jsxRuntime.jsx("div",{className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:n?"#000000":a.bgSecondary,border:`1px solid ${n?"rgba(255,255,255,0.1)":a.border}`},children:s.map(o=>{let l=e===o.value;return jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>t(o.value),className:"relative px-3 py-1 text-[11px] font-medium rounded-full transition-colors",style:{color:l?n?"#FFFFFF":a.textPrimary:a.textTertiary,fontFamily:"Inter, sans-serif",backgroundColor:l?n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent"},whileHover:{color:n?"#FFFFFF":a.textPrimary},whileTap:{scale:.95},children:o.label},o.value)})})}function Jx({theme:e,forecast:t}){let a=Hr(),r=e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF",n=t?.expectedFinish?t.expectedFinish.toLocaleDateString(void 0,{month:"short",day:"numeric"}):"\u2014",s=t?.delayDays,o=s!=null,l=s!=null?s>0?`+${s}d ${a.toolbar.delayLabel}`:s<0?`${s}d ${a.toolbar.earlyLabel}`:a.toolbar.onTimeLabel:null,d=s!=null&&s>0?{bg:r?"rgba(239,68,68,0.15)":"rgba(220,38,38,0.1)",text:r?"#EF4444":"#DC2626"}:s!=null&&s<0?{bg:r?"rgba(34,197,94,0.15)":"rgba(22,163,74,0.1)",text:r?"#22C55E":"#16A34A"}:{bg:r?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",text:e.textTertiary},i=t?.confidencePercent,u=i!=null?i>=75?"#22C55E":i>=40?"#F59E0B":"#EF4444":e.textTertiary,m=t?.costAtCompletion,p=t?.currency||"$",g=m!=null?m>=1e6?`${p}${(m/1e6).toFixed(2)}M`:m>=1e3?`${p}${(m/1e3).toFixed(1)}K`:`${p}${m.toFixed(0)}`:"\u2014",f=t?.budgetVariancePercent,x=f!=null&&f!==0,y=f!=null?f>0?`+${f.toFixed(0)}% ${a.toolbar.budgetOver}`:`${f.toFixed(0)}% ${a.toolbar.budgetUnder}`:null,b=f!=null&&f>0?{bg:r?"rgba(239,68,68,0.15)":"rgba(220,38,38,0.1)",text:r?"#EF4444":"#DC2626"}:f!=null&&f<0?{bg:r?"rgba(34,197,94,0.15)":"rgba(22,163,74,0.1)",text:r?"#22C55E":"#16A34A"}:{bg:"transparent",text:e.textTertiary};return jsxRuntime.jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:e.forecastHud||(r?"rgba(15,15,15,0.9)":"rgba(248,250,252,0.95)"),borderColor:e.borderLight,backdropFilter:"blur(12px)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-6",children:[jsxRuntime.jsx("span",{className:"text-[9px] uppercase tracking-[0.15em]",style:{color:e.textTertiary,fontFamily:"'JetBrains Mono', monospace",fontWeight:500},children:a.toolbar.projectForecast}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"text-[13px] font-semibold",style:{color:e.textPrimary,fontFamily:"Inter, sans-serif"},children:[a.toolbar.expectedFinish,": ",n]}),o&&l&&jsxRuntime.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:d.bg,color:d.text,fontFamily:"'JetBrains Mono', monospace"},children:l})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-6",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"text-[11px]",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif"},children:[a.toolbar.confidence,":"]}),jsxRuntime.jsx("span",{className:"text-[13px] font-semibold",style:{color:u,fontFamily:"'JetBrains Mono', monospace"},children:i!=null?`${i.toFixed(0)}%`:"\u2014"})]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:r?"rgba(255,255,255,0.08)":e.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"text-[11px]",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif"},children:[a.toolbar.costAtCompletion,":"]}),jsxRuntime.jsx("span",{className:"text-[13px] font-bold",style:{color:e.textPrimary,fontFamily:"'JetBrains Mono', monospace"},children:g}),x&&y&&jsxRuntime.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:b.bg,color:b.text,fontFamily:"'JetBrains Mono', monospace"},children:y})]})]})]})}function Qx({theme:e,showCriticalPath:t,onShowCriticalPathChange:a,showBaseline:r,onShowBaselineChange:n,highlightWeekends:s,onHighlightWeekendsChange:o,showDependencies:l,onShowDependenciesChange:d,rowDensity:i,onRowDensityChange:u,hasDependencies:m=true}){let[p,g]=react.useState(false),f=react.useRef(null),x=react.useRef(null),y=Hr(),b=Ts(f,p,"right",208),h=e.bgPrimary==="#050505"||(e.bgPrimary||"").charAt(1)==="0";react.useEffect(()=>{if(!p)return;let S=M=>{let T=M.target;f.current&&!f.current.contains(T)&&x.current&&!x.current.contains(T)&&g(false);};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[p]);let v=y.toolbar.visibility==="Visibilidad",w=[{key:"criticalPath",label:v?"Ruta Cr\xEDtica":"Critical Path",icon:lucideReact.Zap,active:t,onChange:a,disabled:!m,tooltip:m?void 0:v?"Agrega dependencias entre tareas para ver la ruta cr\xEDtica":"Add dependencies between tasks to see the critical path"},{key:"baselines",label:v?"L\xEDneas Base":"Baselines",icon:lucideReact.Layers,active:r,onChange:n},{key:"weekends",label:v?"Fines de Semana":"Weekends",icon:lucideReact.CalendarDays,active:s,onChange:o},{key:"dependencies",label:v?"Dependencias":"Dependencies",icon:lucideReact.GitBranch,active:l,onChange:d}],D=[{value:"compact",label:y.toolbar.visibility==="Visibilidad"?"Compacto":"Compact"},{value:"comfortable",label:"Normal"},{value:"spacious",label:y.toolbar.visibility==="Visibilidad"?"Amplio":"Spacious"}];return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:f,onClick:()=>g(!p),className:"flex items-center justify-center w-8 h-8 rounded-lg",style:{color:p?e.accent:e.textTertiary,backgroundColor:p?e.accentLight:"transparent"},whileHover:{color:e.textPrimary,backgroundColor:e.hoverBg},title:y.toolbar.visibility,children:jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"})}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:p&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:x,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-52 rounded-xl overflow-hidden",style:{top:b.top,left:b.left,zIndex:99999,backgroundColor:h?"rgba(10, 10, 10, 0.95)":e.bgSecondary||"#F8FAFC",border:`1px solid ${h?"rgba(255,255,255,0.08)":e.border||"#CBD5E1"}`,boxShadow:h?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[jsxRuntime.jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:h?"rgba(255,255,255,0.35)":e.textTertiary},children:y.toolbar.visibility==="Visibilidad"?"OPCIONES DE VISTA":"DISPLAY OPTIONS"})}),jsxRuntime.jsx("div",{className:"py-0.5",children:w.map((S,M)=>{let T=S.icon,F=S.disabled,A=S.tooltip;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>!F&&S.onChange?.(!S.active),className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:F?h?"rgba(255,255,255,0.3)":"#9CA3AF":h?"rgba(255,255,255,0.85)":"#111827",cursor:F?"not-allowed":"pointer"},whileHover:F?{}:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:M*.03},title:A,children:[jsxRuntime.jsx(T,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:F?h?"rgba(255,255,255,0.2)":"#D1D5DB":S.active?e.accent||"#00E5CC":e.textTertiary}}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:S.label}),S.active&&!F&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent||"#00E5CC"}})]},S.key)})}),jsxRuntime.jsx("div",{className:"mx-3 h-px",style:{backgroundColor:h?"rgba(255,255,255,0.06)":e.borderLight}}),jsxRuntime.jsxs("div",{className:"py-0.5",children:[jsxRuntime.jsx("div",{className:"px-3 pt-2 pb-1",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:h?"rgba(255,255,255,0.35)":e.textTertiary},children:y.toolbar.visibility==="Visibilidad"?"DENSIDAD":"DENSITY"})}),D.map((S,M)=>{let T=i===S.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>u(S.value),className:"w-full flex items-center justify-between px-3 py-2 text-[11px] transition-colors",style:{color:h?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:(w.length+M)*.03},children:[jsxRuntime.jsx("span",{style:{color:T?e.accent||"#00E5CC":h?"rgba(255,255,255,0.85)":e.textPrimary},children:S.label}),T&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent||"#00E5CC"}})]},S.value)})]})]})}),document.body)]})}function Mi({theme:e,timeScale:t,onTimeScaleChange:a,zoom:r,onZoomChange:n,currentTheme:s,onThemeChange:o,rowDensity:l,onRowDensityChange:d,showThemeSelector:i=false,showCreateTaskButton:u=false,createTaskLabel:m,onCreateTask:p,taskFilter:g="all",onTaskFilterChange:f,hideCompleted:x=false,onHideCompletedChange:y,toolbarRightContent:b,wbsLevel:h,onWbsLevelChange:v,maxWbsDepth:w=4,viewMode:D="execution",onViewModeChange:S,projectForecast:M,onExportPNG:T,onExportPDF:F,onExportExcel:A,onExportCSV:C,onExportJSON:_,onExportMSProject:W,showCriticalPath:oe=true,onShowCriticalPathChange:L,showDependencies:Y=true,onShowDependenciesChange:K,highlightWeekends:V=true,onHighlightWeekendsChange:B,showBaseline:X=false,onShowBaselineChange:Ce,onCopySnapshotLink:Re,hasDependencies:R=true}){let ae=Hr(),be=T||F||A||C||_||W,Ie=!!e.glassToolbar,[De,Ee]=react.useState(false),He=react.useRef(null);react.useEffect(()=>{De&&He.current&&He.current.focus();},[De]);let rt=[{value:"day",label:ae.toolbar.day},{value:"week",label:ae.toolbar.week},{value:"month",label:ae.toolbar.month}],pe=[{value:"dark",label:"Dark",icon:jsxRuntime.jsx(lucideReact.Moon,{className:"w-3.5 h-3.5"})},{value:"light",label:"Light",icon:jsxRuntime.jsx(lucideReact.Sun,{className:"w-3.5 h-3.5"})},{value:"neutral",label:"Zen",icon:jsxRuntime.jsx(lucideReact.Palette,{className:"w-3.5 h-3.5"})}],We=e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF";if(Ie){let je=We?"rgba(255,255,255,0.08)":e.borderLight;return jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsxs("div",{className:"h-[52px] px-4 flex items-center justify-between border-b",style:{backgroundColor:e.glassToolbar,borderColor:e.borderLight,backdropFilter:"blur(12px)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs(framerMotion.motion.div,{className:"flex items-center rounded-full overflow-hidden",style:{backgroundColor:We?"#1A1A1A":e.bgSecondary,border:`1px solid ${We?"rgba(255,255,255,0.08)":e.border}`},animate:{width:De?220:36},transition:{type:"spring",stiffness:400,damping:30},children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>Ee(!De),className:"flex items-center justify-center w-9 h-9 flex-shrink-0",style:{color:e.textTertiary},whileHover:{color:e.textPrimary},children:jsxRuntime.jsx(lucideReact.Search,{className:"w-4 h-4"})}),De&&jsxRuntime.jsx("input",{ref:He,type:"text",placeholder:"Search tasks...",className:"bg-transparent border-none outline-none text-[11px] pr-3 w-full",style:{color:e.textPrimary,fontFamily:"Inter, sans-serif"},onBlur:()=>Ee(false),onKeyDown:Oe=>{Oe.key==="Escape"&&Ee(false);}})]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:je}}),S&&jsxRuntime.jsxs("div",{className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:We?"#000000":e.bgSecondary,border:`1px solid ${We?"rgba(255,255,255,0.08)":e.border}`},children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>S("execution"),className:"px-3 py-1.5 rounded-full text-[11px] font-medium transition-colors",style:{backgroundColor:D==="execution"?We?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent",color:D==="execution"?e.textPrimary:e.textTertiary,fontFamily:"Inter, sans-serif"},whileHover:D!=="execution"?{color:e.textSecondary}:{},children:ae.toolbar.viewExecution}),jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>S("oracle"),className:"px-3 py-1.5 rounded-full text-[11px] font-medium transition-colors",style:{backgroundColor:D==="oracle"?We?"rgba(0, 229, 204,0.15)":"rgba(0, 196, 174,0.08)":"transparent",color:D==="oracle"?"#00E5CC":e.textTertiary,fontFamily:"Inter, sans-serif"},whileHover:D!=="oracle"?{color:e.textSecondary}:{},children:ae.toolbar.viewOracle})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Xx,{value:t,onChange:a,theme:e}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:je}}),v&&jsxRuntime.jsx(rm,{theme:e,value:h??"all",onChange:v,maxDepth:w}),f&&jsxRuntime.jsx(om,{theme:e,value:g,onChange:f,hideCompleted:x,onHideCompletedChange:y}),b&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:je}}),b]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:je}}),jsxRuntime.jsx(Qx,{theme:e,showCriticalPath:oe,onShowCriticalPathChange:L,showBaseline:X,onShowBaselineChange:Ce,highlightWeekends:V,onHighlightWeekendsChange:B,showDependencies:Y,onShowDependenciesChange:K,rowDensity:l,onRowDensityChange:d,hasDependencies:R}),jsxRuntime.jsx(am,{theme:e,onExportPNG:T,onExportPDF:F,onExportExcel:A,onExportMSProject:W,onCopySnapshotLink:Re}),u&&p&&jsxRuntime.jsxs(framerMotion.motion.button,{onClick:p,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px]",style:{background:`linear-gradient(135deg, ${e.accent} 0%, ${e.accentHover} 100%)`,color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:`0 2px 8px ${We?"rgba(0, 229, 204,0.3)":"rgba(0, 196, 174,0.3)"}`},whileHover:{scale:1.02,boxShadow:`0 4px 12px ${We?"rgba(0, 229, 204,0.4)":"rgba(0, 196, 174,0.4)"}`},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:m||ae.toolbar.createTask})]})]})]}),M&&jsxRuntime.jsx(Jx,{theme:e,forecast:M})]})}return jsxRuntime.jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:e.bgGrid,borderColor:e.border},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Yx,{options:rt,value:t,onChange:je=>a(je),theme:e}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>n(Math.max(.5,r-.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsxs("div",{className:"px-2 py-0.5 rounded text-[11px] tabular-nums min-w-[42px] text-center",style:{color:e.textSecondary,fontFamily:"'JetBrains Mono', monospace",fontWeight:500},children:[Math.round(r*100),"%"]}),jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>n(Math.min(2,r+.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"w-3.5 h-3.5"})})]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),v&&jsxRuntime.jsx(rm,{theme:e,value:h??"all",onChange:v,maxDepth:w}),f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsx(om,{theme:e,value:g,onChange:f,hideCompleted:x,onHideCompletedChange:y})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[b&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[b,jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}})]}),u&&p&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:p,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{background:"linear-gradient(135deg, #00E5CC 0%, #00E5CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:m||ae.toolbar.createTask})]}),(be||i)&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}})]}),jsxRuntime.jsx(am,{theme:e,onExportPNG:T,onExportPDF:F,onExportExcel:A,onExportMSProject:W,onCopySnapshotLink:Re}),i&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}}),i&&jsxRuntime.jsx(qx,{options:pe,value:s,onChange:je=>o(je),theme:e})]})]})}function Pi({columns:e,onToggleColumn:t,theme:a}){let[r,n]=react.useState(false),[s,o]=react.useState({x:0,y:0}),l=react.useRef(null),d=react.useRef(null);react.useEffect(()=>{if(!r)return;let u=m=>{l.current&&!l.current.contains(m.target)&&n(false);};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[r]);let i=e.filter(u=>u.id!=="name");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:d,onClick:()=>{if(!r&&d.current){let u=d.current.getBoundingClientRect();o({x:u.left,y:u.bottom+4});}n(!r);},className:"p-2 rounded-md transition-colors flex items-center gap-1",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.borderLight}`,color:a.textSecondary},whileHover:{backgroundColor:a.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:r&&jsxRuntime.jsx(Qt,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:l,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15},className:"column-manager-menu fixed min-w-[180px] rounded-lg shadow-xl z-[9999]",style:{left:`${s.x}px`,top:`${s.y}px`,backgroundColor:a.bgSecondary,border:`1px solid ${a.border}`},children:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-xs uppercase tracking-wider",style:{color:a.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Add Column"}),i.map(u=>jsxRuntime.jsxs("button",{onClick:()=>{t(u.id);},className:"w-full px-3 py-2 text-left flex items-center justify-between transition-colors text-sm",style:{color:a.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif"},onMouseEnter:m=>{m.currentTarget.style.backgroundColor=a.hoverBg;},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{children:u.label}),u.visible&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:a.accent}})]},u.id))]})})})})]})}function zn({isOpen:e,x:t,y:a,items:r,onClose:n,theme:s}){let o=react.useRef(null),[l,d]=react.useState({x:t,y:a});if(react.useEffect(()=>{if(!e)return;let u=200,m=r.length*36+8,p=8,g=window.innerWidth,f=window.innerHeight,x=t,y=a;t+u+p>g&&(x=t-u,x<p&&(x=p)),a+m+p>f&&(y=f-m-p,y<p&&(y=p)),d({x,y});},[e,t,a,r.length]),react.useEffect(()=>{if(!e)return;let u=p=>{o.current&&!o.current.contains(p.target)&&n();},m=p=>{p.key==="Escape"&&n();};return document.addEventListener("mousedown",u),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",m);}},[e,n]),!e)return null;let i=u=>u.startsWith("#")&&(u.length===7||u.length===4)?u:s.bgPrimary?.includes("1")||s.bgPrimary?.includes("2")||s.textPrimary?.toLowerCase().includes("fff")||s.textPrimary?.toLowerCase().includes("white")?"#1E2128":"#FFFFFF";return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:o,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15,ease:[.4,0,.2,1]},className:"fixed z-[9999] min-w-[200px] rounded-lg",style:{left:`${l.x}px`,top:`${l.y}px`,backgroundColor:i(s.bgSecondary),border:`1px solid ${s.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2)",backdropFilter:"none"},children:jsxRuntime.jsx("div",{className:"py-1",children:r.map(u=>jsxRuntime.jsxs("div",{children:[u.separator&&jsxRuntime.jsx("div",{className:"my-1 h-px",style:{backgroundColor:s.borderLight}}),jsxRuntime.jsxs("button",{onClick:()=>{u.disabled||(u.onClick(),n());},disabled:u.disabled,className:"w-full px-3 py-2 text-left flex items-center gap-2 transition-colors text-sm",style:{color:u.disabled?s.textTertiary:s.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif",cursor:u.disabled?"not-allowed":"pointer",opacity:u.disabled?.5:1},onMouseEnter:m=>{u.disabled||(m.currentTarget.style.backgroundColor=s.hoverBg);},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent";},children:[u.icon&&jsxRuntime.jsx("span",{style:{color:s.textSecondary},children:u.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:u.label}),u.submenu&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:s.textTertiary}})]})]},u.id))})})})}var ga={Edit:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),Pencil:jsxRuntime.jsx(lucideReact.Pencil,{className:"w-4 h-4"}),Delete:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),Add:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),AddSubtask:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),Remove:jsxRuntime.jsx(lucideReact.Minus,{className:"w-4 h-4"}),Link:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),Progress:jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),Sort:jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-4 h-4"}),SortAsc:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),SortDesc:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),Hide:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),Show:jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"}),Settings:jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4"}),Split:jsxRuntime.jsx(lucideReact.Scissors,{className:"w-4 h-4"}),Duplicate:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),MarkIncomplete:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),SetInProgress:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),MarkComplete:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"})};function bm({tasks:e,selectedTaskIds:t,onTaskSelect:a,onTaskCreate:r,onTaskDelete:n,onTaskDuplicate:s,onTaskMove:o,onTaskIndent:l,onTaskOutdent:d,onTaskRename:i,onTaskToggleExpand:u,onOpenTaskModal:m,enableKeyboard:p=true}){let g=react.useRef(false),f=react.useCallback(v=>{g.current=v;},[]),x=react.useCallback(v=>{let w=[],D=S=>{for(let M of S)w.push(M),M.subtasks&&M.subtasks.length>0&&M.isExpanded&&D(M.subtasks);};return D(v),w},[]),y=react.useCallback(()=>{let v=x(e);for(let w of v)if(t.has(w.id))return w;return null},[e,t,x]),b=react.useCallback((v,w)=>{let D=x(e);if(D.length===0)return;let S=y();if(!S){a(D[0].id,false);return}let M=D.findIndex(A=>A.id===S.id);if(M===-1)return;let T=v==="up"?M-1:M+1;if(T<0||T>=D.length)return;let F=D[T];a(F.id,w);},[e,y,x,a]),h=react.useCallback(v=>{if(!p)return;let w=v.target;if(w.tagName==="INPUT"||w.tagName==="TEXTAREA"||w.isContentEditable||g.current){v.key==="Escape"&&(w.blur(),g.current=false);return}let M=navigator.platform.toUpperCase().indexOf("MAC")>=0?v.metaKey:v.ctrlKey,T=Array.from(t),F=y();if(v.key==="ArrowUp"){v.preventDefault(),b("up",v.shiftKey);return}if(v.key==="ArrowDown"){v.preventDefault(),b("down",v.shiftKey);return}if(F&&(v.key==="ArrowRight"||v.key==="ArrowLeft")){F.subtasks&&F.subtasks.length>0&&(v.preventDefault(),(v.key==="ArrowRight"&&!F.isExpanded||v.key==="ArrowLeft"&&F.isExpanded)&&u(F.id));return}if(v.altKey&&(v.key==="ArrowUp"||v.key==="ArrowDown")){T.length>0&&(v.preventDefault(),o(T,v.key==="ArrowUp"?"up":"down"));return}if(v.key==="Tab"&&!v.shiftKey){T.length>0&&(v.preventDefault(),l(T));return}if(v.key==="Tab"&&v.shiftKey){T.length>0&&(v.preventDefault(),d(T));return}if(v.key==="Enter"&&!v.shiftKey&&!M){F&&(v.preventDefault(),r(F.id,"below"));return}if(v.key==="Enter"&&v.shiftKey&&!M){F&&(v.preventDefault(),r(F.id,"above"));return}if(v.key==="Enter"&&M){F&&(v.preventDefault(),m(F.id));return}if(v.key==="F2"){F&&(v.preventDefault(),i(F.id));return}if(v.key==="Delete"||v.key==="Backspace"&&M){T.length>0&&(v.preventDefault(),n(T));return}if(v.key==="d"&&M&&!v.shiftKey){T.length>0&&(v.preventDefault(),s(T));return}},[p,t,y,b,r,n,s,o,l,d,i,u,m]);return react.useEffect(()=>{if(p)return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h);}},[p,h]),{setIsEditing:f}}function ym(){let[e,t]=react.useState(new Set),[a,r]=react.useState(null),n=react.useCallback(m=>{t(new Set([m])),r(m);},[]),s=react.useCallback(m=>{t(p=>{let g=new Set(p);return g.has(m)?g.delete(m):g.add(m),g}),r(m);},[]),o=react.useCallback((m,p)=>{if(!a){n(m);return}let g=p.indexOf(a),f=p.indexOf(m);if(g===-1||f===-1){n(m);return}let x=Math.min(g,f),y=Math.max(g,f),b=p.slice(x,y+1);t(new Set(b)),r(m);},[a,n]),l=react.useCallback((m,p,g,f)=>{f?o(m,p):g?s(m):n(m);},[n,s,o]),d=react.useCallback((m,p)=>{p?t(g=>{let f=new Set(g);return f.add(m),f}):n(m);},[n]),i=react.useCallback(()=>{t(new Set),r(null);},[]),u=react.useCallback(m=>e.has(m),[e]);return {selectedTaskIds:e,selectTask:n,toggleTaskSelection:s,selectTaskRange:o,handleTaskClick:l,handleKeyboardSelection:d,clearSelection:i,isTaskSelected:u}}function Bd(e){return e.map((t,a)=>({...t,position:a,subtasks:t.subtasks?.length?Bd(t.subtasks):t.subtasks}))}function Un(e){let t=[],a=(r,n,s=0)=>{let o=[...r].sort((l,d)=>(l.position??0)-(d.position??0));for(let l=0;l<o.length;l++){let d={...o[l],parentId:n,level:s,position:o[l].position??l};t.push(d),d.subtasks&&d.subtasks.length>0&&d.isExpanded&&a(d.subtasks,d.id,s+1);}};return a(e),t}function Wn(e,t){for(let a of e){if(a.id===t)return a;if(a.subtasks){let r=Wn(a.subtasks,t);if(r)return r}}return null}function Id(e,t){for(let a of e)if(a.subtasks){if(a.subtasks.some(n=>n.id===t))return a;let r=Id(a.subtasks,t);if(r)return r}return null}function Rd(e,t){if(t.length===0)return e;let a=Un(e),r=t[0],n=a.findIndex(p=>p.id===r);if(n<=0)return e;let s=a[n-1],o=(p,g)=>{let f=[];return {tasks:p.filter(y=>{if(g.has(y.id))return f.push(y),false;if(y.subtasks){let b=o(y.subtasks,g);y.subtasks=b.tasks,f.push(...b.removed);}return true}),removed:f}},l=(p,g,f)=>p.map(x=>x.id===g?{...x,subtasks:[...x.subtasks||[],...f],isExpanded:true}:x.subtasks?{...x,subtasks:l(x.subtasks,g,f)}:x),d=new Set(t),{tasks:i,removed:u}=o(e,d),m=l(i,s.id,u);return Bd(m)}function Od(e,t){if(t.length===0)return e;let a=[...e];for(let r of t){let n=Id(a,r);if(!n)continue;let s=Id(a,n.id),o=(i,u,m)=>{for(let p=0;p<i.length;p++){let g=i[p];if(g.id===u&&g.subtasks){let f=g.subtasks.findIndex(x=>x.id===m);if(f!==-1){let[x]=g.subtasks.splice(f,1);return x}}if(g.subtasks){let f=o(g.subtasks,u,m);if(f)return f}}return null},l=(i,u,m)=>{let p=i.findIndex(g=>g.id===u);if(p!==-1)return i.splice(p+1,0,m),i;for(let g of i)g.subtasks&&l(g.subtasks,u,m);return i},d=o(a,n.id,r);d&&(s&&s.subtasks?l(s.subtasks,n.id,d):l(a,n.id,d));}return Bd(a)}function $d(e,t,a){if(t.length===0)return e;let r=[...e],n=t[0],s=(o,l,d)=>{let i=o.findIndex(m=>m.id===l);if(i===-1){for(let m of o)if(m.subtasks&&s(m.subtasks,l,d))return true;return false}let u=d==="up"?i-1:i+1;return u<0||u>=o.length?false:([o[i],o[u]]=[o[u],o[i]],o[i]={...o[i],position:i},o[u]={...o[u],position:u},true)};return s(r,n,a),r}function Hd(e,t){let a=new Set(t),r=n=>n.filter(s=>!a.has(s.id)).map(s=>s.subtasks?{...s,subtasks:r(s.subtasks)}:s);return r(e)}function Ds(e,t){let a=[...e],r=[];for(let n of t){let s=(d,i)=>d.map((u,m)=>({...u,id:`${u.id}-copy-${Date.now()}-${m}`,parentId:i,subtasks:u.subtasks?s(u.subtasks,`${u.id}-copy-${Date.now()}-${m}`):void 0})),o=d=>{let i=d.findIndex(g=>g.id===n);if(i===-1){for(let g of d)if(g.subtasks){let f=o(g.subtasks);if(f)return f}return null}let u=d[i],m=`${u.id}-copy-${Date.now()}`,p={...u,id:m,name:`${u.name} (Copy)`,subtasks:u.subtasks?s(u.subtasks,m):void 0};return d.splice(i+1,0,p),p},l=o(a);l&&r.push(l);}return {tasks:a,duplicatedTasks:r}}function xm(e,t,a){let r=[...e],n=new Date,s=new Date(n);s.setDate(s.getDate()+7);let o={id:`task-${Date.now()}`,name:"New Task",progress:0,status:"todo",startDate:n,endDate:s,color:"#00E5CC"},l=d=>{let i=d.findIndex(m=>m.id===t);if(i===-1){for(let m of d)if(m.subtasks&&l(m.subtasks))return true;return false}let u=a==="above"?i:i+1;return d.splice(u,0,o),true};return l(r),{tasks:r,newTask:o}}function zd(e,t,a){return e.map(r=>r.id===t?{...r,name:a}:r.subtasks?{...r,subtasks:zd(r.subtasks,t,a)}:r)}function Ud(e,t){return e.map(a=>a.id===t?{...a,isExpanded:!a.isExpanded}:a.subtasks?{...a,subtasks:Ud(a.subtasks,t)}:a)}function Wd(e,t){let a=p=>{for(let g of p){if(g.id===t)return g;if(g.subtasks){let f=a(g.subtasks);if(f)return f}}return null},r=a(e),n=new Date,s=new Date(n);s.setDate(s.getDate()+7);let o=r?.startDate||n,l=r?.endDate||s,d=p=>{for(let g of p){if(g.id===t)return (g.subtasks||[]).length;if(g.subtasks){let f=d(g.subtasks);if(f>=0)return f}}return 0},i=d(e),u={id:`task-${Date.now()}`,name:"New Subtask",progress:0,status:"todo",startDate:new Date(o),endDate:new Date(l),color:r?.color||"#00E5CC",position:i,parentId:t},m=p=>p.map(g=>{if(g.id===t){let f=g.subtasks||[];return {...g,subtasks:[...f,u],isExpanded:true}}return g.subtasks?{...g,subtasks:m(g.subtasks)}:g});return {tasks:m(e),newTask:u}}function vm(e,t,a,r){if(t===a)return e;let n=Wn(e,t);if(!n)return e;if(a){let l=(d,i)=>{if(!d.subtasks)return false;for(let u of d.subtasks)if(u.id===i||l(u,i))return true;return false};if(l(n,a))return e}let s=l=>{let d=l.filter(u=>u.id!==t),i=d.length<l.length;return d.map((u,m)=>{let p=i?{...u,position:m}:u;return p.subtasks&&p.subtasks.length>0?{...p,subtasks:s(p.subtasks)}:p})},o=s(e);if(a===null){let l=r!==void 0?r:o.length;o.splice(l,0,{...n,parentId:void 0}),o=o.map((d,i)=>({...d,position:i}));}else {let l=d=>d.map(i=>{if(i.id===a){let u=i.subtasks||[],m=r!==void 0?r:u.length,p=[...u];p.splice(m,0,{...n,parentId:a});let g=p.map((f,x)=>({...f,position:x}));return {...i,subtasks:g,isExpanded:true}}return i.subtasks&&i.subtasks.length>0?{...i,subtasks:l(i.subtasks)}:i});o=l(o);}return o}function zr(e){return e.map(t=>{if(!t.subtasks||t.subtasks.length===0)return t;let a=zr(t.subtasks),r=a.reduce((l,d)=>(d.startDate&&l.starts.push(new Date(d.startDate).getTime()),d.endDate&&l.ends.push(new Date(d.endDate).getTime()),l.progresses.push(d.progress??0),l),{starts:[],ends:[],progresses:[]}),n=r.starts.length>0?new Date(Math.min(...r.starts)):t.startDate,s=r.ends.length>0?new Date(Math.max(...r.ends)):t.endDate,o=r.progresses.length>0?Math.round(r.progresses.reduce((l,d)=>l+d,0)/r.progresses.length):t.progress;return {...t,subtasks:a,startDate:n,endDate:s,progress:o}})}function Ai({tasks:e,theme:t,rowHeight:a,availableUsers:r=[],templates:n,onTaskClick:s,onTaskDblClick:o,onTaskContextMenu:l,onTaskToggle:d,scrollTop:i,columns:u,onToggleColumn:m,onColumnResize:p,onTaskUpdate:g,onBulkFill:f,onTaskIndent:x,onTaskOutdent:y,onTaskMove:b,onMultiTaskDelete:h,onTaskDuplicate:v,onTaskCreate:w,onTaskRename:D,onCreateSubtask:S,onOpenTaskModal:M,onDeleteRequest:T,onTaskReparent:F,scrollContainerRef:A,showCriticalPath:C=false}){let _=react.useContext($n),[W,oe]=react.useState(null),[L,Y]=react.useState(null),[K,V]=react.useState(""),B=react.useRef(null),[X,Ce]=react.useState(null),[Re,R]=react.useState(0),[ae,be]=react.useState(0),[Ie,De]=react.useState({isOpen:false,x:0,y:0,type:"header"}),[Ee,He]=react.useState(null),[rt,pe]=react.useState(null),[We,je]=react.useState(null),Oe=react.useRef(0),tt=5,wt=react.useRef(false),[pt,Ue]=react.useState(null),[ot,Et]=react.useState(false),ge=react.useRef(null),[mt,k]=react.useState(null),[O,Z]=react.useState(null),[ve,$]=react.useState(false),re=react.useRef(null);react.useEffect(()=>{function ee(ke){re.current&&!re.current.contains(ke.target)&&$(false);}if(ve)return document.addEventListener("mousedown",ee),()=>document.removeEventListener("mousedown",ee)},[ve]),react.useEffect(()=>{L&&B.current&&(B.current.focus(),B.current.select());},[L]),react.useEffect(()=>{if(!X)return;let ee=At=>{let kt=At.clientX-Re,lt=ae+kt;p?.(X,lt);},ke=()=>{Ce(null),document.body.style.cursor="",document.body.style.userSelect="";};return document.addEventListener("mousemove",ee),document.addEventListener("mouseup",ke),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",ee),document.removeEventListener("mouseup",ke),document.body.style.cursor="",document.body.style.userSelect="";}},[X,Re,ae,p]);let{selectedTaskIds:Ye,handleTaskClick:Te,isTaskSelected:Fe}=ym(),{setIsEditing:ze}=bm({tasks:e,selectedTaskIds:Ye,onTaskSelect:(ee,ke)=>{let kt=Un(e).map(lt=>lt.id);Te(ee,kt,ke||false,false);},onTaskCreate:w||(()=>{}),onTaskDelete:h||(()=>{}),onTaskDuplicate:v||(()=>{}),onTaskMove:b||(()=>{}),onTaskIndent:x||(()=>{}),onTaskOutdent:y||(()=>{}),onTaskRename:ee=>{let ke=Un(e).find(At=>At.id===ee);ke&&Mt(ke);},onTaskToggleExpand:d||(()=>{}),onOpenTaskModal:ee=>{let ke=Un(e).find(At=>At.id===ee);ke&&M&&M(ke);},enableKeyboard:true}),Le=(ee,ke=0,At="")=>{let kt=[],lt=[...ee].sort((dt,J)=>(dt.position??0)-(J.position??0));for(let dt=0;dt<lt.length;dt++){let J=lt[dt],xe=dt+1,ue=At?`${At}.${xe}`:`${xe}.0`,z=J.wbsCode||ue;if(J.wbsCode=z,kt.push({task:J,level:ke}),J.subtasks&&J.subtasks.length>0&&J.isExpanded){let Ve=J.wbsCode?.replace(/\.0$/,"")||(At?`${At}.${xe}`:`${xe}`);kt.push(...Le(J.subtasks,ke+1,Ve));}}return kt},Ze=Le(e),st=48,yt=Math.max(Ze.length*a,600-st),xt=(ee,ke)=>ke==="assignees"?ee.assignees:ke==="startDate"?ee.startDate:ee.endDate,$t=(ee,ke,At,kt)=>{ee.preventDefault(),ee.stopPropagation(),k({sourceTaskId:ke,column:At,sourceIndex:kt,targetIndex:kt});let lt=ee.currentTarget.closest("[data-grid-body]"),dt=ue=>{let z=lt?.getBoundingClientRect().top??0,ne=Math.floor((ue-z)/a);return ne=Math.max(0,Math.min(Ze.length-1,ne)),ne<kt&&(ne=kt),ne},J=ue=>{let z=dt(ue.clientY);k(ne=>ne&&{...ne,targetIndex:z});},xe=ue=>{window.removeEventListener("mousemove",J),window.removeEventListener("mouseup",xe),k(null);let z=dt(ue.clientY),ne=Ze.find(q=>q.task.id===ke)?.task;if(!ne)return;let Ve=xt(ne,At),N=Math.min(kt,z),U=Math.max(kt,z),Ne=[];for(let q=N;q<=U;q++){if(q===kt)continue;let et=Ze[q]?.task;!et||et.subtasks&&et.subtasks.length>0||Ne.push(et.id);}Ne.length!==0&&f?.(Ne,At,Ve);};window.addEventListener("mousemove",J),window.addEventListener("mouseup",xe);},ut=ee=>{if(!mt)return false;let ke=Math.min(mt.sourceIndex,mt.targetIndex),At=Math.max(mt.sourceIndex,mt.targetIndex);return ee>=ke&&ee<=At},Gt=ee=>!ee.startDate||!ee.endDate?"-":`${Math.ceil((ee.endDate.getTime()-ee.startDate.getTime())/(1e3*60*60*24))}d`,Mt=ee=>{Y(ee.id),V(ee.name),ze(true);},It=ee=>{K.trim()&&K!==e.find(ke=>ke.id===ee)?.name&&D?.(ee,K.trim()),Y(null),V(""),ze(false);},Ft=()=>{Y(null),V(""),ze(false);},Ct=(ee,ke)=>{ke.stopPropagation(),S?.(ee.id);},St=(ee,ke)=>{ke.preventDefault(),Oe.current=ke.clientY,He(ee),wt.current=false,Et(false),Ue({x:ke.clientX,y:ke.clientY});},ct=ee=>{if(!Ee||(Math.abs(ee.clientY-Oe.current)>tt&&!wt.current&&(wt.current=true,Et(true)),Ue({x:ee.clientX,y:ee.clientY}),!wt.current))return;if(A?.current){let dt=A.current,J=dt.getBoundingClientRect(),xe=60,ue=12;ge.current&&(cancelAnimationFrame(ge.current),ge.current=null);let z=ee.clientY-J.top,ne=J.bottom-ee.clientY;if(z<xe&&dt.scrollTop>0){let Ve=Math.round(ue*(1-z/xe)),N=()=>{dt.scrollTop-=Ve,wt.current&&dt.scrollTop>0&&(ge.current=requestAnimationFrame(N));};ge.current=requestAnimationFrame(N);}else if(ne<xe&&dt.scrollTop<dt.scrollHeight-dt.clientHeight){let Ve=Math.round(ue*(1-ne/xe)),N=()=>{dt.scrollTop+=Ve,wt.current&&dt.scrollTop<dt.scrollHeight-dt.clientHeight&&(ge.current=requestAnimationFrame(N));};ge.current=requestAnimationFrame(N);}}let At=document.querySelectorAll("[data-task-row]"),kt=null,lt=null;At.forEach(dt=>{let J=dt.getBoundingClientRect(),xe=dt.getAttribute("data-task-row");if(xe&&xe!==Ee&&ee.clientY>=J.top&&ee.clientY<=J.bottom){kt=xe;let ue=ee.clientY-J.top,z=J.height;ue<z*.25?lt="above":ue>z*.75?lt="below":lt="child";}}),pe(kt),je(lt);},fa=()=>{if(wt.current&&Ee&&rt&&We){if(We==="child")F?.(Ee,rt);else if(We==="above"||We==="below"){let ee=(lt,dt,J=null)=>{for(let xe of lt){if(xe.id===dt)return J;if(xe.subtasks){let ue=ee(xe.subtasks,dt,xe.id);if(ue!==void 0)return ue}}},ke=ee(e,Ee,null),At=ee(e,rt,null),kt=(lt,dt,J,xe)=>{let ue=lt.findIndex(Ve=>Ve.id===dt),z=xe?lt.findIndex(Ve=>Ve.id===J):-1,ne=We==="below"?ue+1:ue;return xe&&z!==-1&&z<ue&&(ne-=1),Math.max(0,ne)};if(At===null){let dt=kt(e,rt,Ee,ke===null);F?.(Ee,null,dt);}else {let lt=Wn(e,At);if(lt?.subtasks){let dt=ke===At,J=kt(lt.subtasks,rt,Ee,dt);F?.(Ee,At,J);}}}}ge.current&&(cancelAnimationFrame(ge.current),ge.current=null),He(null),pe(null),je(null),Ue(null),wt.current=false,Et(false);};react.useEffect(()=>{if(Ee)return document.addEventListener("mousemove",ct),document.addEventListener("mouseup",fa),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",ct),document.removeEventListener("mouseup",fa),document.body.style.cursor="",document.body.style.userSelect="";}},[Ee,rt,We]);let xa=(ee,ke,At)=>{let kt=ke.subtasks&&ke.subtasks.length>0;switch(ee.id){case "name":let lt=L===ke.id,dt=W===ke.id;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 relative",style:{paddingLeft:`${At*20}px`},children:[F&&jsxRuntime.jsx("div",{className:"cursor-grab active:cursor-grabbing p-0.5 rounded hover:bg-white/10 transition-all flex-shrink-0",style:{color:t.textTertiary,opacity:dt?1:.3},onMouseDown:q=>St(ke.id,q),title:"Arrastrar para mover tarea",children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-4 h-4"})}),ke.subtasks&&ke.subtasks.length>0?jsxRuntime.jsx("button",{onClick:q=>{q.stopPropagation(),d?.(ke.id);},className:"p-0.5 hover:bg-opacity-10 rounded transition-colors flex-shrink-0",style:{color:t.textSecondary},children:ke.isExpanded?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})}):jsxRuntime.jsx("div",{className:"w-5 h-5 flex-shrink-0"}),lt?jsxRuntime.jsx("input",{ref:B,type:"text",value:K,onChange:q=>V(q.target.value),onKeyDown:q=>{q.key==="Enter"?It(ke.id):q.key==="Escape"&&Ft();},onBlur:()=>It(ke.id),className:"flex-1 px-2 py-1 rounded border outline-none",style:{backgroundColor:t.bgPrimary,borderColor:t.accent,color:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:"13px",fontWeight:500},onClick:q=>q.stopPropagation()}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{className:"flex-1 min-w-0",style:{display:"flex",alignItems:"baseline",gap:"6px",color:ke.parentId?t.textSecondary:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:ke.parentId?"13px":"14px",fontWeight:ke.isMilestone?600:ke.parentId?400:600,letterSpacing:ke.parentId?"0":"-0.01em"},title:ke.name,children:[ke.wbsCode&&jsxRuntime.jsx("span",{style:{color:t.textTertiary,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,opacity:.65,flexShrink:0},children:ke.wbsCode}),ke.isHighlighted&&ke.status==="completed"&&jsxRuntime.jsx("span",{title:"\u2605",style:{color:"#F59E0B",fontSize:"10px",flexShrink:0,lineHeight:1},children:"\u2605"}),jsxRuntime.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ke.name}),ke.subtasks&&ke.subtasks.length>0&&jsxRuntime.jsxs("span",{style:{color:"#6B7280",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",fontWeight:400,flexShrink:0,whiteSpace:"nowrap"},children:["\xB7 ",Math.round(ke.progress||0),"%"]}),C&&ke.isCriticalPath&&jsxRuntime.jsx("span",{style:{display:"inline-block",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#EF4444",flexShrink:0,marginLeft:"2px"}}),C&&ke.cpmData&&jsxRuntime.jsxs("span",{style:{color:ke.cpmData.totalFloat<=0?"#EF4444":ke.cpmData.totalFloat<=5?"#F59E0B":"#6B7280",fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",fontWeight:500,flexShrink:0,whiteSpace:"nowrap",marginLeft:"4px"},children:["TF: ",Math.round(ke.cpmData.totalFloat),"d"]})]}),dt&&!lt&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 ml-2",onClick:q=>q.stopPropagation(),children:[jsxRuntime.jsx("button",{onClick:q=>Ct(ke,q),className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Create subtask",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:q=>{q.stopPropagation(),Mt(ke);},className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Rename (F2)",children:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-3.5 h-3.5"})})]})]})]});case "startDate":case "endDate":let xe=ee.id==="startDate"?"startDate":"endDate",ue=ke[xe],z=O?.taskId===ke.id&&O?.field===xe,ne=q=>q?(typeof q=="string"?new Date(q):q).toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit",year:"numeric"}):"-";return jsxRuntime.jsxs("div",{className:"flex items-center justify-center w-full relative",onClick:q=>q.stopPropagation(),children:[jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors hover:bg-white/5",style:{color:t.textSecondary,opacity:kt?.5:1,cursor:kt?"default":"pointer"},title:kt?"Auto-calculated from subtasks":void 0,onClick:q=>{if(!kt)if(z)Z(null);else {let et=q.currentTarget.getBoundingClientRect();Z({taskId:ke.id,field:xe,month:ue?typeof ue=="string"?new Date(ue):ue:new Date,position:{top:et.bottom+4,left:et.left}});}},children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-3 h-3",style:{color:t.textTertiary}}),jsxRuntime.jsx("span",{children:ne(ue)}),kt&&jsxRuntime.jsx("span",{style:{fontSize:"9px",color:t.textTertiary,marginLeft:"2px"},children:"\u25BC"})]}),z&&typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>Z(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"fixed z-[9999] rounded-xl shadow-2xl overflow-visible flex",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,top:O?.position.top,left:O?.position.left},onClick:q=>q.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"w-36 py-2",style:{borderRight:`1px solid ${t.border}`},children:[(()=>{let q=new Date,et=new Date(q);et.setDate(q.getDate()+1);let Nt=new Date(q);Nt.setDate(q.getDate()+7);let Ht=new Date(q);return Ht.setDate(q.getDate()+14),[{label:"Hoy",date:q},{label:"Ma\xF1ana",date:et},{label:"Pr\xF3xima semana",date:Nt},{label:"2 semanas",date:Ht}].map((va,oa)=>jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:t.textPrimary},onMouseEnter:cr=>cr.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:cr=>cr.currentTarget.style.backgroundColor="transparent",onClick:()=>{g?.(ke.id,{[xe]:va.date}),Z(null);},children:va.label},oa))})(),jsxRuntime.jsx("div",{style:{borderTop:`1px solid ${t.border}`,margin:"0.25rem 0"}}),jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:"#EF4444"},onMouseEnter:q=>q.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:q=>q.currentTarget.style.backgroundColor="transparent",onClick:()=>{g?.(ke.id,{[xe]:void 0}),Z(null);},children:"Borrar"})]}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>Z(q=>q?{...q,month:new Date(q.month.getFullYear(),q.month.getMonth()-1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:t.textPrimary},children:O?.month.toLocaleDateString("es-ES",{month:"long",year:"numeric"})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>Z(q=>q?{...q,month:new Date(q.month.getFullYear(),q.month.getMonth()+1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:["D","L","M","M","J","V","S"].map((q,et)=>jsxRuntime.jsx("div",{className:"w-6 h-6 flex items-center justify-center text-[10px]",style:{color:t.textTertiary},children:q},et))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let q=O?.month||new Date,et=q.getFullYear(),Nt=q.getMonth(),Ht=new Date(et,Nt,1).getDay(),Fa=new Date(et,Nt+1,0).getDate(),va=new Date,oa=[];for(let wa=Ht-1;wa>=0;wa--)oa.push({day:new Date(et,Nt,-wa).getDate(),date:new Date(et,Nt-1,new Date(et,Nt,-wa).getDate()),isCurrentMonth:false});for(let wa=1;wa<=Fa;wa++)oa.push({day:wa,date:new Date(et,Nt,wa),isCurrentMonth:true});let cr=42-oa.length;for(let wa=1;wa<=cr;wa++)oa.push({day:wa,date:new Date(et,Nt+1,wa),isCurrentMonth:false});return oa.map((wa,br)=>{let yo=wa.date.toDateString()===va.toDateString(),ro=(ue?typeof ue=="string"?new Date(ue):ue:null)?.toDateString()===wa.date.toDateString();return jsxRuntime.jsx("button",{type:"button",className:"w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",style:{color:wa.isCurrentMonth?ro?"#FFF":t.textPrimary:t.textTertiary,backgroundColor:ro?"#00E5CC":"transparent",boxShadow:yo&&!ro?"inset 0 0 0 1px #00E5CC":"none"},onClick:()=>{g?.(ke.id,{[xe]:wa.date}),Z(null);},children:wa.day},br)})})()})]})]})]}),document.body)]});case "duration":return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",children:jsxRuntime.jsx("span",{className:"text-xs tabular-nums",style:{color:t.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:600},children:Gt(ke)})});case "assignees":if(kt)return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",style:{opacity:.4},children:jsxRuntime.jsx("span",{className:"text-xs",style:{color:t.textTertiary},children:"\u2014"})});let Ve=r.filter(q=>ke.assignees?.some(et=>et.id?et.id===q.id:et.name===q.name||et.initials===q.initials));return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:q=>q.stopPropagation(),children:jsxRuntime.jsx(on,{assignedUsers:Ve,availableUsers:r,onChange:q=>{let et=q.map(Nt=>({id:Nt.id,name:Nt.name,initials:Nt.initials,color:Nt.color}));g?.(ke.id,{assignees:et});}})});case "status":if(kt){let q=ke.progress===100?"\u2713":ke.progress>0?"\u25D0":"\u25CB";return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",style:{opacity:.5},children:jsxRuntime.jsx("span",{className:"text-xs",style:{color:t.textTertiary},children:q})})}return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:q=>q.stopPropagation(),children:jsxRuntime.jsx(Wu,{status:ke.status||"todo",onChange:q=>{g?.(ke.id,{status:q,progress:q==="completed"?100:ke.progress});}})});case "progress":return jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-2 w-full",style:{opacity:kt?.6:1},children:[jsxRuntime.jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden max-w-[60px]",style:{backgroundColor:t.bgSecondary},children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${ke.progress}%`,backgroundColor:ke.progress===100?t.statusCompleted:t.accent}})}),jsxRuntime.jsxs("span",{className:"text-xs tabular-nums min-w-[35px] text-right",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:[ke.progress,"%"]})]});case "priority":let N={low:"LOW",medium:"MEDIUM",high:"HIGH",urgent:"URGENT"},U={LOW:"low",MEDIUM:"medium",HIGH:"high",URGENT:"urgent"},Ne=N[ke.priority||"medium"]||"MEDIUM";return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:q=>q.stopPropagation(),children:jsxRuntime.jsx(an,{priority:Ne,onChange:q=>{q&&g?.(ke.id,{priority:U[q]||"medium"});}})});default:return null}},H=ee=>[{id:"hide",label:"Hide Column",icon:ga.Hide,onClick:()=>m(ee),disabled:ee==="name"},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"sortAsc",label:"Sort Ascending",icon:ga.SortAsc,onClick:()=>{}},{id:"sortDesc",label:"Sort Descending",icon:ga.SortDesc,onClick:()=>{}}],se=ee=>ee.subtasks&&ee.subtasks.length>0?[{id:"addSubtask",label:_?.contextMenu?.addSubtask||"Add Subtask",icon:ga.Add,onClick:()=>{S?.(ee.id);}},{id:"duplicate",label:_?.contextMenu?.duplicateTask||"Duplicate Task",icon:ga.Duplicate,onClick:()=>{v?.([ee.id]);}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"delete",label:_?.contextMenu?.deleteTask||"Delete Task",icon:ga.Delete,onClick:()=>{T?T(ee.id,ee.name):h?.([ee.id]);}}]:[{id:"edit",label:_?.contextMenu?.editTask||"Edit Task",icon:ga.Pencil,onClick:()=>{o?.(ee);}},{id:"addSubtask",label:_?.contextMenu?.addSubtask||"Add Subtask",icon:ga.Add,onClick:()=>{S?.(ee.id);}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"markIncomplete",label:_?.contextMenu?.markIncomplete||"Mark Incomplete",icon:ga.MarkIncomplete,onClick:()=>{g?.(ee.id,{status:"todo",progress:0});},disabled:ee.status==="todo"},{id:"setInProgress",label:_?.contextMenu?.setInProgress||"Set In Progress",icon:ga.SetInProgress,onClick:()=>{g?.(ee.id,{status:"in-progress"});},disabled:ee.status==="in-progress"},{id:"markComplete",label:_?.contextMenu?.markComplete||"Mark Complete",icon:ga.MarkComplete,onClick:()=>{g?.(ee.id,{status:"completed",progress:100});},disabled:ee.status==="completed"},{id:"sep2",label:"",onClick:()=>{},separator:true},{id:"duplicate",label:_?.contextMenu?.duplicateTask||"Duplicate Task",icon:ga.Duplicate,onClick:()=>{v?.([ee.id]);}},{id:"split",label:_?.contextMenu?.splitTask||"Split Task",icon:ga.Split,onClick:()=>{},disabled:true},{id:"sep3",label:"",onClick:()=>{},separator:true},{id:"delete",label:_?.contextMenu?.deleteTask||"Delete Task",icon:ga.Delete,onClick:()=>{T?T(ee.id,ee.name):h?.([ee.id]);}}],at=u.filter(ee=>ee.visible),Xt=at.reduce((ee,ke)=>ee+ke.width,0);return jsxRuntime.jsxs("div",{className:"gantt-taskgrid-content",style:{backgroundColor:t.bgPrimary,minWidth:Xt},children:[jsxRuntime.jsxs("div",{className:"sticky top-0 z-10 flex items-center",style:{backgroundColor:t.glassHeader||t.bgSecondary,height:`${st}px`,paddingLeft:"3px",borderBottom:`1px solid ${t.border}`,boxSizing:"border-box"},children:[jsxRuntime.jsx("div",{className:"flex items-center flex-1 min-w-0",children:at.map((ee,ke)=>{let At=ke===at.length-1,kt=ee.id==="name";return jsxRuntime.jsxs("div",{className:`flex items-center px-4 cursor-pointer hover:bg-opacity-50 transition-colors relative ${kt?"":"justify-center"}`,style:{width:`${ee.width}px`,minWidth:`${ee.minWidth??(kt?200:60)}px`,maxWidth:`${ee.maxWidth??2e3}px`,flexShrink:kt&&at.length===1?1:0,flexGrow:kt&&at.length===1?1:0,borderRight:At?"none":`1px solid ${t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"hidden"},onContextMenu:lt=>{lt.preventDefault(),De({isOpen:true,x:lt.clientX,y:lt.clientY,type:"header",columnId:ee.id});},onMouseEnter:lt=>{lt.currentTarget.style.backgroundColor=t.hoverBg;},onMouseLeave:lt=>{lt.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,paddingRight:"0"},title:ee.label,children:ee.label}),ee.resizable&&jsxRuntime.jsx("div",{className:"absolute right-0 top-0 bottom-0 cursor-col-resize transition-colors group",style:{width:"12px",marginRight:"-6px",backgroundColor:X===ee.id?`${t.accent}30`:"transparent",zIndex:5},onMouseDown:lt=>{lt.preventDefault(),lt.stopPropagation(),Ce(ee.id),R(lt.clientX),be(ee.width);},title:"Drag to resize column",children:jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 transition-opacity",style:{left:"5px",width:"2px",backgroundColor:t.accent,borderRadius:"1px",opacity:X===ee.id?.8:void 0},children:jsxRuntime.jsx("div",{className:"absolute inset-0 opacity-20 group-hover:opacity-80 transition-opacity",style:{backgroundColor:t.accent}})})})]},ee.id)})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 px-2",style:{position:"sticky",right:0,height:"100%",backgroundColor:t.glassHeader||t.bgSecondary,zIndex:5},children:[jsxRuntime.jsx(Pi,{columns:u,onToggleColumn:m,theme:t}),jsxRuntime.jsx("button",{onClick:()=>$(!ve),className:"p-1.5 rounded hover:bg-opacity-10 transition-colors",style:{color:t.textTertiary},title:"Keyboard shortcuts",children:jsxRuntime.jsx(lucideReact.Keyboard,{className:"w-4 h-4"})}),ve&&jsxRuntime.jsxs("div",{ref:re,className:"absolute top-full right-0 mt-2 p-4 rounded-lg shadow-2xl z-50 min-w-[400px]",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,color:t.textPrimary},onClick:ee=>ee.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b",style:{borderColor:t.border},children:[jsxRuntime.jsx("h3",{className:"font-semibold text-sm",style:{color:t.textPrimary},children:"Keyboard Shortcuts"}),jsxRuntime.jsx("button",{onClick:()=>$(false),className:"text-xs px-2 py-1 rounded hover:bg-opacity-10",style:{color:t.textTertiary},children:"Close"})]}),jsxRuntime.jsxs("div",{className:"space-y-3 text-xs",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Navigation"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move focus up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Select range"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Toggle selection"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Click"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Hierarchy"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Indent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Outdent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Expand/Collapse"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2192 / \u2190"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Editing"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task below"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task above"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Open task modal"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Rename task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"F2"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Actions"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move task up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Alt + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Delete task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Delete"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Duplicate task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + D"})]})]})]})]})]})]})]}),jsxRuntime.jsx("div",{className:"gantt-taskgrid-content","data-grid-body":true,style:{minHeight:yt},children:Ze.map(({task:ee,level:ke},At)=>{let kt=Fe(ee.id),lt=ut(At),dt=rt===ee.id,J=dt&&We==="above",xe=dt&&We==="below",ue=dt&&We==="child",z={};return ue&&(z.backgroundColor=`${t.accent}15`,z.boxShadow=`inset 0 0 0 2px ${t.accent}`),jsxRuntime.jsxs(framerMotion.motion.div,{"data-task-row":ee.id,className:`flex items-center cursor-pointer group ${Ee===ee.id?"opacity-50":""}`,style:{position:"relative",height:`${a}px`,borderLeft:kt?`3px solid ${t.accent}`:"3px solid transparent",backgroundColor:kt?t.accentLight:ue?`${t.accent}15`:At%2===0?t.bgPrimary:t.bgGrid,opacity:C?ee.isCriticalPath?1:.4:void 0,transition:"opacity 300ms ease",...z},onMouseEnter:()=>oe(ee.id),onMouseLeave:()=>oe(null),onClick:ne=>{let N=Un(e).map(q=>q.id),Ne=navigator.platform.toUpperCase().indexOf("MAC")>=0?ne.metaKey:ne.ctrlKey;Te(ee.id,N,Ne,ne.shiftKey),s?.(ee);},onDoubleClick:ne=>{ne.stopPropagation(),o?.(ee);},onContextMenu:ne=>{ne.preventDefault(),De({isOpen:true,x:ne.clientX,y:ne.clientY,type:"task",task:ee}),l?.(ee,ne);},whileHover:{backgroundColor:kt?t.accentLight:t.hoverBg},children:[J&&jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),xe&&jsxRuntime.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),at.map((ne,Ve)=>{let N=Ve===at.length-1,U=ne.id==="name",Ne=!!(ee.subtasks&&ee.subtasks.length>0),q=ne.id==="assignees"||ne.id==="startDate"||ne.id==="endDate"?ne.id:null,Nt=!!q&&!Ne&&W===ee.id&&!mt,Ht=lt&&!!mt&&mt.column===ne.id;return jsxRuntime.jsxs("div",{className:`px-4 flex items-center ${U?"justify-start":"justify-center"}`,style:{position:"relative",width:`${ne.width}px`,minWidth:`${ne.minWidth??(U?200:60)}px`,maxWidth:`${ne.maxWidth??2e3}px`,flexShrink:U&&at.length===1?1:0,flexGrow:U&&at.length===1?1:0,borderRight:N?"none":`1px solid ${W===ee.id?t.border:t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"visible",backgroundColor:Ht?`${t.accent}22`:void 0,boxShadow:Ht?`inset 0 0 0 1px ${t.accent}66`:void 0},children:[xa(ne,ee,U?ke:0),Nt&&q&&jsxRuntime.jsx("div",{title:"Arrastr\xE1 hacia abajo para aplicar a varias tareas",onMouseDown:Fa=>$t(Fa,ee.id,q,At),style:{position:"absolute",right:2,bottom:2,width:8,height:8,borderRadius:2,background:t.accent,border:`1px solid ${t.bgPrimary}`,cursor:"crosshair",zIndex:5}})]},`${ee.id}-${ne.id}`)})]},ee.id)})}),jsxRuntime.jsx(zn,{isOpen:Ie.isOpen,x:Ie.x,y:Ie.y,items:Ie.type==="header"&&Ie.columnId?H(Ie.columnId):Ie.type==="task"&&Ie.task?se(Ie.task):[],onClose:()=>De({...Ie,isOpen:false}),theme:t}),ot&&pt&&Ee&&typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsx("div",{style:{position:"fixed",left:pt.x+12,top:pt.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let ee=Ze.find(ke=>ke.task.id===Ee)?.task;return ee?jsxRuntime.jsx("div",{className:"flex items-center gap-2 px-2 py-1 rounded",style:{backgroundColor:"rgba(255, 255, 255, 0.08)",backdropFilter:"blur(4px)"},children:jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:t.textSecondary,opacity:.9},children:ee.name})}):null})()}),document.body)]})}function Nm(e,t){let[a,r]=react.useState("none"),[n,s]=react.useState(0),[o,l]=react.useState(e),[d,i]=react.useState(t),[u,m]=react.useState(null),[p,g]=react.useState(null),[f,x]=react.useState(null),[y,b]=react.useState(null),[h,v]=react.useState(0),[w,D]=react.useState(0),[S,M]=react.useState(null),[T,F]=react.useState(false);return {dragMode:a,setDragMode:r,dragOffset:n,setDragOffset:s,ghostX:o,setGhostX:l,ghostWidth:d,setGhostWidth:i,connectionLine:u,setConnectionLine:m,hoveredTaskId:p,setHoveredTaskId:g,activeZone:f,setActiveZone:x,draggedSegmentIndex:y,setDraggedSegmentIndex:b,draggedSegmentStartX:h,setDraggedSegmentStartX:v,segmentDragOffsetX:w,setSegmentDragOffsetX:D,hoveredSegmentIndex:S,setHoveredSegmentIndex:M,isHovered:T,setIsHovered:F,isDragging:a!=="none",isResizing:a==="resize-start"||a==="resize-end",isConnecting:a==="connect",resetDragState:(oe,L)=>{r("none"),m(null),g(null),l(oe),i(L),D(0),b(null),v(0);}}}function Li({task:e,x:t,y:a,width:r,theme:n,dayWidth:s,startDate:o,templates:l,onClick:d,onDoubleClick:i,onContextMenu:u,onDateChange:m,onDependencyCreate:p,allTaskPositions:g=[],onDragMove:f,onHoverChange:x,showBaseline:y,showTaskBarLabels:b=true,showCriticalPath:h=true,readOnly:v=false,onProgressChange:w}){let D=Nm(t,r),S=react.useRef(null),M=react.useRef(false),T=react.useRef(null),F=react.useRef(null),{dragMode:A,setDragMode:C,dragOffset:_,setDragOffset:W,ghostX:oe,setGhostX:L,ghostWidth:Y,setGhostWidth:K,connectionLine:V,setConnectionLine:B,hoveredTaskId:X,setHoveredTaskId:Ce,activeZone:Re,setActiveZone:R,draggedSegmentIndex:ae,setDraggedSegmentIndex:be,draggedSegmentStartX:Ie,setDraggedSegmentStartX:De,segmentDragOffsetX:Ee,setSegmentDragOffsetX:He,hoveredSegmentIndex:rt,setHoveredSegmentIndex:pe,isHovered:We,setIsHovered:je,isDragging:Oe,isResizing:tt,isConnecting:wt,resetDragState:pt}=D,Ue=18,ot=!!n.executionBarBg,Et=n.textPrimary==="#FFFFFF"||n.bgPrimary==="#050505",ge=ot?3:6,mt=e.subtasks&&e.subtasks.length>0,k=react.useRef(null),[O,Z]=(()=>{let J=react.useRef(null),[,xe]=react.useState(0);return [J.current,ue=>{J.current=ue,xe(z=>z+1);}]})(),ve=!!w&&!v&&!mt&&!e.segments&&!!e.startDate&&!!e.endDate,$=e.endDate&&(()=>{let J=new Date;J.setHours(0,0,0,0);let xe=new Date(e.endDate);return xe.setHours(0,0,0,0),xe<J})()&&e.progress<100,re=h&&e.isCriticalPath,Ye=n.name==="neutral"||n.today==="#1C1917",Te=e.status==="completed"||e.progress===100,Fe={low:"#10B981",LOW:"#10B981",medium:"#F59E0B",MEDIUM:"#F59E0B",high:"#F97316",HIGH:"#F97316",urgent:"#EF4444",URGENT:"#EF4444"},Le=h&&e.isCriticalPath||$?"#EF4444":e.color?e.color:e.priority&&Fe[e.priority]?Fe[e.priority]:n.taskBarPrimary,Ze=v?"default":Oe?wt?"crosshair":tt?"ew-resize":"grabbing":"grab",st=v?"default":"ew-resize",xt=(J=>J>=80?20:J>=60?15:J>=50?12:10)(r),$t=r<50,ut=r<40;react.useEffect(()=>{x&&(!We||Oe||e.segments)&&x(null);},[We,Oe,e.segments,x]);let Gt=J=>J.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Mt=()=>{let J=Math.ceil((e.endDate.getTime()-e.startDate.getTime())/864e5);return `${J} day${J!==1?"s":""}`},It=J=>Math.round(J/s)*s,Ft=J=>{let xe=Math.round(J/s),ue=new Date(o);return ue.setDate(ue.getDate()+xe),ue},Ct=(J,xe)=>{for(let ue of g){if(ue.id===e.id)continue;let z=5;if(J>=ue.x-z&&J<=ue.x+ue.width+z&&xe>=ue.y-z&&xe<=ue.y+ue.height+z)return ue.id}return null},St=react.useCallback((J,xe,ue)=>{if(v)return;J.preventDefault(),J.stopPropagation();let z=S.current?.ownerSVGElement;if(!z)return;let ne=z.createSVGPoint();ne.x=J.clientX,ne.y=J.clientY;let Ve=ne.matrixTransform(z.getScreenCTM()?.inverse()),N=ue!==void 0?ue:t,U=xe;if(!U){let Ne=Ve.x-N;J.shiftKey?(U="connect",B({x:t+r,y:a+Ue/2})):J.ctrlKey||J.metaKey?U="move":J.altKey?U=Ne<r/2?"resize-start":"resize-end":ut?Ne<r/2?U="move":U="resize-end":$t?Ne<=xt/2?U="resize-start":Ne>=r-xt/2?U="resize-end":U="move":Ne<=xt?U="resize-start":Ne>=r-xt?U="resize-end":U="move";}M.current=false,C(U),je(false),R(null),U==="move"?W(Ve.x-N):U==="connect"?B({x:t+r,y:a+Ue/2}):W(0),L(N),K(r);},[t,r,a,Ue,v]),ct=react.useCallback(J=>{let xe=S.current?.ownerSVGElement;if(!xe)return;let ue=xe.closest(".gantt-timeline-scroll");if(!ue)return;let z=ue.getBoundingClientRect(),ne=60,Ve=15,N=0;if(J.clientX<z.left+ne){let U=z.left+ne-J.clientX;N=-Math.min(Ve,U/2);}else if(J.clientX>z.right-ne){let U=J.clientX-(z.right-ne);N=Math.min(Ve,U/2);}return N!==0&&(ue.scrollLeft+=N),N!==0},[]),fa=react.useCallback(J=>{if(A==="none")return;M.current=true,F.current=J;let xe=S.current?.ownerSVGElement;if(!xe)return;if(A==="move"||A==="resize-start"||A==="resize-end"){let ne=ct(J);ne&&!T.current?T.current=window.setInterval(()=>{F.current&&(ct(F.current),fa(F.current));},16):!ne&&T.current&&(window.clearInterval(T.current),T.current=null);}let ue=xe.createSVGPoint();ue.x=J.clientX,ue.y=J.clientY;let z=ue.matrixTransform(xe.getScreenCTM()?.inverse());if(A==="connect"){B({x:z.x,y:z.y});let ne=Ct(z.x,z.y);Ce(ne);}else if(A==="move"){let ne=z.x-_,Ve=It(ne);L(Ve),K(r);let N=Math.round((Ve-t)/s);if(f?.(e.id,N,true),e.segments&&e.segments.length>0&&ae!==null){let U=Ve-Ie;He(U);}}else if(A==="resize-start"){let ne=z.x,Ve=It(ne),N=t+r-Ve;N>=s&&(L(Ve),K(N));}else if(A==="resize-end"){let ne=z.x,N=It(ne)-t;N>=s&&K(N);}},[A,t,r,s,_,e,It,ae,Ie,Ct,Ce,B,L,K,He,f,ct]),xa=react.useCallback(()=>{if(T.current&&(window.clearInterval(T.current),T.current=null),F.current=null,A!=="none"){if(A==="connect")X&&p&&p(e,X),B(null),Ce(null);else {let J=e.endDate.getTime()-e.startDate.getTime(),xe,ue,z=true;if(A==="move"){if(xe=Ft(oe),ue=new Date(xe.getTime()+J),e.segments&&e.segments.length>0&&ae!==null){let ne=Math.round(Ee/s),Ve=e.segments.map((q,et)=>{if(et===ae){let Nt=new Date(q.startDate),Ht=new Date(q.endDate);return Nt.setDate(Nt.getDate()+ne),Ht.setDate(Ht.getDate()+ne),{startDate:Nt,endDate:Ht}}return q}),N=Ve.flatMap(q=>[q.startDate,q.endDate]),U=new Date(Math.min(...N.map(q=>q.getTime()))),Ne=new Date(Math.max(...N.map(q=>q.getTime())));m?.({...e,segments:Ve},U,Ne),pt(t,r);return}}else A==="resize-start"?(xe=Ft(oe),ue=e.endDate,xe>ue&&(console.warn("Invalid date range: start date must be before or equal to end date"),z=false)):A==="resize-end"?(xe=e.startDate,ue=Ft(oe+Y),ue.setDate(ue.getDate()-1),ue<xe&&(console.warn("Invalid date range: end date must be after or equal to start date"),z=false)):z=false;z&&xe&&ue&&(ue.getTime()<xe.getTime()?console.warn("Invalid date range: end date cannot be before start date"):m?.(e,xe,ue));}f?.(e.id,0,false),pt(t,r);}},[A,oe,Y,e,m,X,p,t,r,s,Ft,Ee,ae,pt,f]);react.useEffect(()=>{if(A==="none")return;let J=ue=>{fa(ue);},xe=()=>{xa();};return window.addEventListener("mousemove",J),window.addEventListener("mouseup",xe),()=>{window.removeEventListener("mousemove",J),window.removeEventListener("mouseup",xe),T.current&&(window.clearInterval(T.current),T.current=null);}},[A,fa,xa]);let H=Oe&&!wt?oe:t,se=Oe&&!wt?Y:r,at=l.taskClass(e),Xt=24,ee=h?e.isCriticalPath?1:.25:1,ke=react.useCallback(J=>{if(!ve)return;J.stopPropagation(),J.preventDefault();let ue=S.current?.querySelector('rect[data-bar-background="true"]')?.getBoundingClientRect()??null;k.current={barRect:ue,initialPct:e.progress||0},J.currentTarget.setPointerCapture(J.pointerId),Z(e.progress||0);},[ve,e.progress,Z]),At=react.useCallback(J=>{let xe=k.current;if(!xe)return;let z=S.current?.querySelector('rect[data-bar-background="true"]')?.getBoundingClientRect()??xe.barRect;if(!z||z.width<=0)return;let ne=(J.clientX-z.left)/z.width,Ve=Math.round(Math.max(0,Math.min(1,ne))*100);J.shiftKey&&(Ve=Math.round(Ve/25)*25),Z(Ve);},[Z]),kt=react.useCallback(J=>{let xe=k.current;if(!xe)return;J.stopPropagation(),J.preventDefault();try{J.currentTarget.releasePointerCapture(J.pointerId);}catch{}let ue=O;k.current=null,Z(null),ue!=null&&ue!==xe.initialPct&&w&&w(e,ue);},[O,w,e,Z]),lt=react.useCallback(J=>{J.stopPropagation(),J.preventDefault();},[]),dt=O??(e.progress||0);return jsxRuntime.jsxs("g",{ref:S,"data-task-bar":"true",style:{opacity:ee,transition:"opacity 300ms ease"},onClick:()=>{!Oe&&!M.current&&d?.(e),M.current=false;},onDoubleClick:J=>{!Oe&&!M.current&&(J.stopPropagation(),i?.(e));},onContextMenu:J=>{J.preventDefault(),u?.(e,J);},onMouseEnter:()=>!Oe&&je(true),onMouseMove:J=>{x&&We&&!Oe&&!e.segments&&x({task:e,x:t,y:a,width:r,height:Ue,showBelow:false,mouseX:J.clientX,mouseY:J.clientY});},onMouseLeave:()=>{Oe||(je(false),R(null));},children:[jsxRuntime.jsx("rect",{x:t,y:a,width:r+Xt,height:Ue,fill:"transparent",style:{pointerEvents:"all"}}),We&&!Oe&&!$t&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:a,width:xt,height:Ue,fill:Re==="resize-start"?n.accent:"transparent",opacity:Re==="resize-start"?.15:0,style:{cursor:st,pointerEvents:"all"},onMouseEnter:()=>R("resize-start"),onMouseDown:J=>St(J,"resize-start")}),jsxRuntime.jsx("rect",{x:t+xt,y:a,width:r-xt*2,height:Ue,fill:Re==="move"?n.accent:"transparent",opacity:Re==="move"?.1:0,style:{cursor:v?"default":"grab",pointerEvents:"all"},onMouseEnter:()=>R("move"),onMouseDown:J=>St(J,"move")}),jsxRuntime.jsx("rect",{x:t+r-xt,y:a,width:xt,height:Ue,fill:Re==="resize-end"?n.accent:"transparent",opacity:Re==="resize-end"?.15:0,style:{cursor:st,pointerEvents:"all"},onMouseEnter:()=>R("resize-end"),onMouseDown:J=>St(J,"resize-end")})]}),We&&!Oe&&ut&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:a,width:r/2,height:Ue,fill:Re==="move"?n.accent:"transparent",opacity:Re==="move"?.2:0,style:{cursor:v?"default":"grab",pointerEvents:"all"},onMouseEnter:()=>R("move"),onMouseDown:J=>St(J,"move")}),jsxRuntime.jsx("rect",{x:t+r/2,y:a,width:r/2,height:Ue,fill:Re==="resize-end"?n.accent:"transparent",opacity:Re==="resize-end"?.2:0,style:{cursor:st,pointerEvents:"all"},onMouseEnter:()=>R("resize-end"),onMouseDown:J=>St(J,"resize-end")}),We&&jsxRuntime.jsx(framerMotion.motion.line,{x1:t+r/2,y1:a+4,x2:t+r/2,y2:a+Ue-4,stroke:n.textTertiary,strokeWidth:1,strokeDasharray:"2 2",opacity:.3,initial:{opacity:0},animate:{opacity:.3},transition:{duration:.2},style:{pointerEvents:"none"}})]}),Oe&&!wt&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:oe,y:a,width:Y,height:Ue,rx:ge,fill:n.accent,opacity:.15,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 3",initial:{opacity:0},animate:{opacity:.25},transition:{duration:.15},style:{pointerEvents:"none"}}),y&&e.baselineStartDate&&e.baselineEndDate&&!Oe&&(()=>{let J=e.baselineStartDate.getTime(),xe=e.baselineEndDate.getTime(),ue=o.getTime(),z=864e5,ne=(J-ue)/z,Ve=(xe-J)/z,N=ne*s,U=Math.max(Ve*s,s),Ne=H+se,q=N+U,et=e.endDate?.getTime()??0,Nt=Math.ceil((et-xe)/z),Ht=Nt>0,Fa=Nt<-0;return jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("rect",{x:N,y:a,width:U,height:Ue,rx:ge,fill:"none",stroke:Et?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.35)",strokeWidth:1.5,strokeDasharray:"6 4"}),Ht&&Ne>q&&jsxRuntime.jsx("rect",{x:q,y:a,width:Ne-q,height:Ue,rx:0,fill:"#EF4444",opacity:.2}),Ht&&jsxRuntime.jsxs("text",{x:Math.max(Ne,q)+6,y:a+Ue/2+1,fill:"#EF4444",fontSize:"10",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",dominantBaseline:"middle",children:["+",Nt,"d"]}),Fa&&jsxRuntime.jsxs("text",{x:Ne+6,y:a+Ue/2+1,fill:"#10B981",fontSize:"10",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",dominantBaseline:"middle",children:[Nt,"d"]})]})})(),!e.segments&&ot&&mt&&(()=>{let xe=a+(Ue-8)/2,ue=4,z=e.progress||0,ne=new Date;ne.setHours(0,0,0,0);let Ve=e.startDate&&ne>=e.startDate,N=e.endDate&&(()=>{let Ht=new Date(e.endDate);return Ht.setHours(0,0,0,0),ne>Ht})(),U=e.startDate&&ne<e.startDate,Ne=1;if(Ve&&e.startDate&&e.endDate&&!U){let Ht=new Date(e.startDate);Ht.setHours(0,0,0,0);let Fa=new Date(e.endDate);Fa.setHours(0,0,0,0);let va=Math.max(1,(Fa.getTime()-Ht.getTime())/(1e3*60*60*24)),cr=Math.min((ne.getTime()-Ht.getTime())/(1e3*60*60*24),va)/va*100;Ne=cr>0?z/cr:1;}let q;z>=100?q="#00E5CC":U?q="#4B5563":N&&z<100?q="#EF4444":Ne>=.95?q="#22C55E":Ne>=.8?q="#F59E0B":q="#EF4444";let et=Math.max(z/100*se,z>0?ue*2:0),Nt=se>100&&z>0;return jsxRuntime.jsxs("g",{"data-task-class":at,style:{cursor:"default",pointerEvents:"all"},children:[jsxRuntime.jsx("rect",{x:H,y:xe,width:se,height:8,rx:ue,fill:"rgba(255,255,255,0.10)"}),z>0&&jsxRuntime.jsx("rect",{x:H,y:xe,width:et,height:8,rx:ue,fill:q}),Nt&&jsxRuntime.jsxs("text",{x:H+et+6,y:xe+8/2,dominantBaseline:"central",fill:"rgba(255,255,255,0.7)",fontSize:"9",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[Math.round(z),"%"]})]})})(),!e.segments&&ot&&!mt&&jsxRuntime.jsx(framerMotion.motion.rect,{x:H,y:a,width:se,height:Ue,rx:ge,fill:n.executionBarBg||"rgba(255,255,255,0.06)",stroke:n.border||"rgba(255,255,255,0.1)",strokeWidth:1,"data-task-class":at,"data-bar-background":"true",initial:{opacity:0,scale:.95},animate:{opacity:Oe&&!wt?.15:e.parentId?.6:1,scale:We&&!Oe?1.01:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:J=>St(J),style:{cursor:Ze,pointerEvents:"all"}}),!e.segments&&!ot&&jsxRuntime.jsx(framerMotion.motion.rect,{x:H,y:a,width:se,height:Ue,rx:ge,fill:Le,"data-task-class":at,initial:{opacity:0,scale:.95},animate:{opacity:Oe&&!wt?.15:e.parentId?.6:We?.9:.8,scale:We&&!Oe?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:mt?void 0:J=>St(J),style:{cursor:mt?"default":Ze,pointerEvents:"all"}}),ot&&($||re)&&!e.segments&&jsxRuntime.jsx("rect",{x:H,y:a,width:se,height:Ue,rx:ge,fill:"none",stroke:n.criticalPath,strokeWidth:2,style:{pointerEvents:"none",filter:`drop-shadow(0 0 6px ${n.criticalPathLight||"rgba(255,46,46,0.4)"})`}}),!e.segments&&dt>0&&!mt&&jsxRuntime.jsx("rect",{x:H,y:a,width:Math.max(se*(dt/100),ge*2),height:Ue,rx:ge,fill:Le,opacity:1,style:{pointerEvents:"none"}}),!e.segments&&!mt&&e.progress<100&&(()=>{let J=e.progress>0?se*(e.progress/100):0,xe=H+J,ue=se-J,z=e.progress===0?ge:0,ne=e.progress===0?H:xe,Ve=e.progress===0?se:ue;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:ne,y:a,width:Ve,height:Ue,rx:z,fill:"url(#bar-remaining-hatch)",style:{pointerEvents:"none"}}),jsxRuntime.jsx("rect",{x:ne,y:a,width:Ve,height:Ue,rx:z,fill:"none",stroke:"#00E5CC",strokeWidth:.8,strokeDasharray:"5 3",style:{pointerEvents:"none"}})]})})(),ot&&!e.segments&&e.progress>0&&e.progress<100&&!mt&&!Oe&&O===null&&(()=>{let J=H+se*(e.progress/100),xe=8,ue=e.assignees?.[0];return jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("circle",{cx:J,cy:a+Ue/2,r:xe,fill:ue?.color||n.accent,stroke:"#000",strokeWidth:1.5}),jsxRuntime.jsx("text",{x:J,y:a+Ue/2,textAnchor:"middle",dominantBaseline:"central",fill:"#FFF",fontSize:"8",fontWeight:"600",fontFamily:"Inter, sans-serif",children:ue?.initials||ue?.name?.charAt(0)?.toUpperCase()||""})]})})(),ve&&!Oe&&se>=40&&(O!==null||dt<88)&&(()=>{let J=H+se*(dt/100),xe=a+Ue/2,ue=O!==null,z=ue?7:We?6:5,ne=ue||We?1:.35,Ve=H+se-J,N=Math.max(4,Math.min(12,Ve-10)),U=12;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:J-U,y:xe-12,width:U+N,height:24,fill:"transparent",style:{cursor:"ew-resize",touchAction:"none"},onPointerDown:ke,onPointerMove:At,onPointerUp:kt,onPointerCancel:kt,onClick:lt,onDoubleClick:lt,onMouseDown:Ne=>Ne.stopPropagation()}),jsxRuntime.jsx("circle",{cx:J,cy:xe,r:z,fill:"#FFFFFF",stroke:Le,strokeWidth:2,opacity:ne,style:{pointerEvents:"none",filter:ue?`drop-shadow(0 0 4px ${Le})`:void 0,transition:"r 120ms ease, opacity 120ms ease"}}),ue&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("rect",{x:J-20,y:xe-28,width:40,height:18,rx:4,fill:Et?"rgba(15, 15, 20, 0.95)":"rgba(255, 255, 255, 0.95)",stroke:Le,strokeWidth:1}),jsxRuntime.jsxs("text",{x:J,y:xe-16,textAnchor:"middle",dominantBaseline:"central",fill:Et?"#FFFFFF":"#111111",fontSize:"11",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",children:[O,"%"]})]})]})})(),e.segments&&e.segments.map((J,xe)=>{let ue=(J.startDate.getTime()-o.getTime())/864e5*s,ne=(J.endDate.getTime()-o.getTime())/(1e3*60*60*24)*s-ue+s,Ve=Oe&&A==="move"&&ae===xe,N=rt===xe,U=Ve?ue+Ee:ue;return jsxRuntime.jsxs("g",{onMouseEnter:()=>!Oe&&pe(xe),onMouseLeave:()=>!Oe&&pe(null),children:[jsxRuntime.jsx(framerMotion.motion.rect,{x:U,y:a,width:ne,height:Ue,rx:ge,fill:Le,initial:{opacity:0,scale:.95},animate:{opacity:Ve||e.parentId?.6:N?.9:.8,scale:N&&!Oe?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:Ne=>{Ne.stopPropagation(),be(xe),De(ue),St(Ne,void 0,ue);},style:{cursor:Ze,pointerEvents:"all"}}),jsxRuntime.jsx("rect",{x:U,y:a,width:ne*(e.progress/100),height:Ue,rx:ge,fill:Le,opacity:1,style:{pointerEvents:"none"}})]},`segment-${xe}`)}),Ye&&($||re)&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[re&&!$&&jsxRuntime.jsx("rect",{x:H,y:a,width:se,height:Ue,rx:ge,fill:"none",stroke:n.border,strokeWidth:2,strokeDasharray:"4 4",opacity:.8,style:{pointerEvents:"none"}}),$&&jsxRuntime.jsx("rect",{x:H,y:a,width:se,height:Ue,rx:ge,fill:"url(#diagonal-stripes)",opacity:.3,style:{pointerEvents:"none"}})]}),b&&se>60&&!e.segments&&!(ot&&mt)&&(()=>{let J=l.taskLabel(e),xe=typeof J=="string"?J:e.name,ue=xe.length>Math.floor(se/8)?`${xe.substring(0,Math.floor(se/8))}...`:xe;return jsxRuntime.jsx("text",{x:H+8,y:a+Ue/2,dominantBaseline:"middle",fill:Te?"rgba(255, 255, 255, 0.6)":"#FFFFFF",fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none",textDecoration:Te?"line-through":"none"},children:ue})})(),!Oe&&!e.segments&&!mt&&e.progress>0&&e.progress<100&&(ot?jsxRuntime.jsxs("text",{x:H+se+6,y:a+Ue/2,dominantBaseline:"middle",fill:"#FFFFFF",fontSize:"9",fontWeight:"500",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}):se>100?jsxRuntime.jsxs("text",{x:H+se-12,y:a+Ue/2,dominantBaseline:"middle",textAnchor:"end",fill:"rgba(255, 255, 255, 0.9)",fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}):null),e.status&&se>80&&!Oe&&!e.segments&&!(ot&&mt)&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[e.status==="completed"&&jsxRuntime.jsx("circle",{cx:H+se-8,cy:a+8,r:4,fill:n.statusCompleted,stroke:"#FFFFFF",strokeWidth:1.5}),e.status==="in-progress"&&jsxRuntime.jsx("circle",{cx:H+se-8,cy:a+8,r:4,fill:n.statusInProgress,stroke:"#FFFFFF",strokeWidth:1.5,opacity:.8})]}),(We||tt)&&!wt&&!e.segments&&!mt&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:H-2,y:a,width:16,height:Ue,fill:"transparent",style:{cursor:st},onMouseEnter:()=>R("resize-start"),onMouseLeave:()=>R(null),onMouseDown:J=>{J.stopPropagation(),St(J,"resize-start");}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:H+4,y:a+8,width:3,height:Ue-16,rx:1.5,fill:Re==="resize-start"||A==="resize-start"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]}),jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:H+se-14,y:a,width:16,height:Ue,fill:"transparent",style:{cursor:st},onMouseEnter:()=>R("resize-end"),onMouseLeave:()=>R(null),onMouseDown:J=>{J.stopPropagation(),St(J,"resize-end");}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:H+se-7,y:a+8,width:3,height:Ue-16,rx:1.5,fill:Re==="resize-end"||A==="resize-end"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:We&&!Oe&&!e.segments&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[jsxRuntime.jsx("circle",{cx:t+r+10,cy:a+Ue/2,r:10,fill:"transparent",style:{cursor:"crosshair"},onMouseEnter:()=>R("connect"),onMouseLeave:()=>R(null),onMouseDown:J=>{J.stopPropagation(),St(J,"connect");}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:t+r+10,cy:a+Ue/2,r:4,fill:n.accent,stroke:"#FFFFFF",strokeWidth:1.5,style:{pointerEvents:"none"},initial:{scale:0},animate:{scale:Re==="connect"?1.4:1},exit:{scale:0},transition:{duration:.15,type:"spring",stiffness:500,damping:30}})]})}),wt&&V&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx(framerMotion.motion.line,{x1:t+r,y1:a+Ue/2,x2:V.x,y2:V.y,stroke:X?n.statusCompleted:n.accent,strokeWidth:X?3:2,strokeDasharray:"6 4",initial:{opacity:0},animate:{opacity:X?1:.8},transition:{duration:.15}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:V.x,cy:V.y,r:X?8:6,fill:X?n.statusCompleted:n.accent,stroke:"#FFFFFF",strokeWidth:2,initial:{scale:0},animate:{scale:1},transition:{duration:.15}}),X&&jsxRuntime.jsx(framerMotion.motion.text,{x:V.x+15,y:V.y,dominantBaseline:"middle",fill:n.statusCompleted,fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",initial:{opacity:0,x:V.x+10},animate:{opacity:1,x:V.x+15},transition:{duration:.2},children:"Connect"})]}),(We||Oe)&&!wt&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:H-1,y:a-1,width:se+2,height:Ue+2,rx:ge+1,fill:"none",stroke:Oe?n.accent:ot?"rgba(255,255,255,0.2)":n.taskBarPrimary,strokeWidth:ot?1:2,opacity:Oe||ot?.6:.4,initial:{opacity:0},animate:{opacity:Oe||ot?.6:.4},transition:{duration:.2},style:{pointerEvents:"none"}}),tt&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("line",{x1:oe,y1:0,x2:oe,y2:1e3,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}}),jsxRuntime.jsx("line",{x1:oe+Y,y1:0,x2:oe+Y,y2:1e3,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:We&&!Oe&&!e.segments&&!x&&(()=>{let ue=a<100,z=ue?a+Ue+13:a-82-13,ne=ue?`M ${H+se/2-6} ${a+Ue+3} L ${H+se/2} ${a+Ue+13} L ${H+se/2+6} ${a+Ue+3}`:`M ${H+se/2-6} ${a-13} L ${H+se/2} ${a-3} L ${H+se/2+6} ${a-13}`,Ve=z+22,N=z+40,U=z+55,Ne=z+70,q=ue?z+82-5:a-18;return jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:ue?-10:10},animate:{opacity:1,y:0},exit:{opacity:0,y:ue?-10:10},transition:{duration:.2},style:{pointerEvents:"none"},children:[jsxRuntime.jsx("path",{d:ne,fill:n.bgSecondary,stroke:n.border,strokeWidth:1}),jsxRuntime.jsx("rect",{x:H+se/2-120,y:z,width:240,height:82,rx:8,fill:n.bgSecondary,stroke:n.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("text",{x:H+se/2,y:Ve,textAnchor:"middle",fill:n.textPrimary,fontSize:"13",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>28?`${e.name.substring(0,28)}...`:e.name}),jsxRuntime.jsx("text",{x:H+se/2-110,y:N,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Start:"}),jsxRuntime.jsx("text",{x:H+se/2-70,y:N,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Gt(e.startDate)}),jsxRuntime.jsx("text",{x:H+se/2-110,y:U,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"End:"}),jsxRuntime.jsx("text",{x:H+se/2-70,y:U,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Gt(e.endDate)}),jsxRuntime.jsx("text",{x:H+se/2+10,y:N,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Duration:"}),jsxRuntime.jsx("text",{x:H+se/2+65,y:N,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Mt()}),jsxRuntime.jsx("text",{x:H+se/2+10,y:U,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Progress:"}),jsxRuntime.jsxs("text",{x:H+se/2+65,y:U,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.progress,"%"]}),e.assignees&&e.assignees.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("text",{x:H+se/2-110,y:Ne,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Assignees:"}),jsxRuntime.jsxs("text",{x:H+se/2-50,y:Ne,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.assignees.map(et=>et.name).join(", ").substring(0,30),e.assignees.map(et=>et.name).join(", ").length>30?"...":""]})]}),!ue&&jsxRuntime.jsx("text",{x:H+se/2,y:q,textAnchor:"middle",fill:n.textTertiary,fontSize:"9",fontFamily:"Inter, sans-serif",style:{opacity:.7},children:ut?"Left: move \u2022 Right: resize":$t?"Drag to move \u2022 Hold ALT + drag edge to resize":"Drag edges to resize \u2022 Drag center to move \u2022 Click \u26AB to link"})]})})()})]})}var Vd=260,Gn=8,Em=16,zv=-12;function Mm({tooltipData:e,theme:t,locale:a="en",workingDaysConfig:r}){let[n,s]=react.useState(null);if(react.useLayoutEffect(()=>{if(!e){s(null);return}let{task:v,mouseX:w,mouseY:D}=e,S=v.effortMinutes!=null||v.timeLoggedMinutes!=null||v.soldEffortMinutes!=null,M=v.lastActivity!=null,T=(S?155:105)+(M?28:0),F=w+Em,A=D+zv-T;F+Vd>window.innerWidth-Gn&&(F=w-Vd-Em),F<Gn&&(F=Gn);let C=A<Gn;C&&(A=D+20),A+T>window.innerHeight-Gn&&(A=window.innerHeight-Gn-T),s({left:F,top:A,showBelow:C});},[e]),!e||!n)return null;let{task:o}=e,l=o.effortMinutes!=null||o.timeLoggedMinutes!=null||o.soldEffortMinutes!=null,d={start:a==="es"?"Inicio":"Start",end:a==="es"?"Fin":"End",duration:a==="es"?"Duraci\xF3n":"Duration",progress:a==="es"?"Progreso":"Progress",assignees:a==="es"?"Asignados":"Assignees",estimated:a==="es"?"Estimado":"Estimated",logged:a==="es"?"Registrado":"Logged",quoted:a==="es"?"Ofertado":"Quoted"},i=v=>v.toLocaleDateString(a==="es"?"es-ES":"en-US",{month:"short",day:"numeric",year:"numeric"}),u=()=>{if(!o.startDate||!o.endDate)return "N/A";if(!r?.enabledWeekdays){let A=Math.max(1,Math.round((o.endDate.getTime()-o.startDate.getTime())/864e5)+1);return a==="es"?`${A} d\xEDa${A!==1?"s":""}`:`${A} day${A!==1?"s":""}`}let v=r.enabledWeekdays,w=r.holidayDates instanceof Set?r.holidayDates:new Set(r.holidayDates??[]),D=A=>`${A.getFullYear()}-${String(A.getMonth()+1).padStart(2,"0")}-${String(A.getDate()).padStart(2,"0")}`,S=0,M=new Date(o.startDate.getFullYear(),o.startDate.getMonth(),o.startDate.getDate()),T=new Date(o.endDate.getFullYear(),o.endDate.getMonth(),o.endDate.getDate());for(;M.getTime()<=T.getTime();){let A=M.getDay();v[A]&&!w.has(D(M))&&S++,M.setDate(M.getDate()+1);}let F=Math.max(0,S);return a==="es"?`${F} d\xEDa${F!==1?"s":""}`:`${F} day${F!==1?"s":""}`},m=v=>{if(v==null||v===0)return "N/A";let w=Math.floor(v/60),D=v%60;return w===0?`${D}m`:D===0?`${w}h`:`${w}h ${D}m`},p=t.textTertiary||"#9CA3AF",g=t.textSecondary||"#D1D5DB",f=t.textPrimary||"#F9FAFB",x=t.accent||"#00E5CC",y=t.bgSecondary||"#1F2937",b=t.border||"#374151",h=jsxRuntime.jsxs("div",{style:{position:"fixed",left:n.left,top:n.top,width:Vd,zIndex:99999,pointerEvents:"none",fontFamily:"Inter, system-ui, sans-serif",animation:"gantt-tooltip-fade 0.12s ease-out"},children:[jsxRuntime.jsxs("div",{style:{background:y,border:`1px solid ${b}`,borderRadius:8,padding:"12px 14px",boxShadow:"0 8px 24px rgba(0,0,0,0.3)"},children:[jsxRuntime.jsx("div",{style:{fontSize:13,fontWeight:600,color:f,marginBottom:8,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.name}),jsxRuntime.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"3px 12px",fontSize:11},children:[jsxRuntime.jsx(Ii,{label:d.start,value:o.startDate?i(o.startDate):"N/A",labelColor:p,valueColor:g}),jsxRuntime.jsx(Ii,{label:d.duration,value:u(),labelColor:p,valueColor:g}),jsxRuntime.jsx(Ii,{label:d.end,value:o.endDate?i(o.endDate):"N/A",labelColor:p,valueColor:g}),jsxRuntime.jsx(Ii,{label:d.progress,value:`${o.progress}%`,labelColor:p,valueColor:g})]}),o.assignees&&o.assignees.length>0&&jsxRuntime.jsxs("div",{style:{fontSize:11,marginTop:6},children:[jsxRuntime.jsxs("span",{style:{color:p},children:[d.assignees,": "]}),jsxRuntime.jsx("span",{style:{color:g,fontWeight:500},children:o.assignees.map(v=>v.name).join(", ")})]}),l&&jsxRuntime.jsxs("div",{style:{marginTop:6,display:"flex",gap:10,fontSize:11},children:[o.effortMinutes!=null&&jsxRuntime.jsxs("span",{children:[jsxRuntime.jsxs("span",{style:{color:p},children:[d.estimated,":"]})," ",jsxRuntime.jsx("span",{style:{color:g,fontWeight:600},children:m(o.effortMinutes)})]}),o.timeLoggedMinutes!=null&&jsxRuntime.jsxs("span",{children:[jsxRuntime.jsxs("span",{style:{color:p},children:[d.logged,":"]})," ",jsxRuntime.jsx("span",{style:{color:x,fontWeight:600},children:m(o.timeLoggedMinutes)})]}),o.soldEffortMinutes!=null&&jsxRuntime.jsxs("span",{children:[jsxRuntime.jsxs("span",{style:{color:p},children:[d.quoted,":"]})," ",jsxRuntime.jsx("span",{style:{color:g,fontWeight:600},children:m(o.soldEffortMinutes)})]})]}),o.lastActivity&&jsxRuntime.jsxs("div",{style:{marginTop:8,paddingTop:8,borderTop:`1px solid ${t?.borderSubtle||"rgba(255,255,255,0.08)"}`,fontSize:11,color:p,lineHeight:1.4},children:[jsxRuntime.jsx("span",{style:{opacity:.7},children:a==="es"?"\xDAltimo: ":"Last: "}),jsxRuntime.jsx("span",{style:{color:g},children:o.lastActivity.userName})," ",jsxRuntime.jsx("span",{children:o.lastActivity.summary})," ",jsxRuntime.jsx("span",{style:{opacity:.6},children:o.lastActivity.relativeTime})]})]}),jsxRuntime.jsx("style",{children:`
|
|
126
126
|
@keyframes gantt-tooltip-fade {
|
|
127
127
|
from { opacity: 0; transform: translateY(${n.showBelow?"-4px":"4px"}); }
|
|
128
128
|
to { opacity: 1; transform: translateY(0); }
|
|
@@ -358,14 +358,14 @@
|
|
|
358
358
|
</Calendars>
|
|
359
359
|
<Tasks>${d}
|
|
360
360
|
</Tasks>
|
|
361
|
-
</Project>`,u=new Blob([i],{type:"application/xml;charset=utf-8;"}),m=document.createElement("a");m.href=URL.createObjectURL(u),m.download=a,m.click(),URL.revokeObjectURL(m.href);},calculateCriticalPath:e=>{let t=Pe.flattenTasks(e),a=t.filter(i=>i.startDate&&i.endDate);if(a.length===0)return [];let r=new Map,n=i=>{if(r.has(i.id))return;let u=i.startDate&&i.endDate?Pe.calculateDuration(i.startDate,i.endDate):0,m=0;if(i.dependencies&&i.dependencies.length>0)for(let g of i.dependencies){let f=t.find(x=>x.id===g);if(f){n(f);let x=r.get(g)?.ef||0;m=Math.max(m,x);}}let p=m+u;r.set(i.id,{es:m,ef:p});};a.forEach(n);let s=Math.max(...Array.from(r.values()).map(i=>i.ef)),o=new Map,l=i=>{if(o.has(i.id))return;let u=i.startDate&&i.endDate?Pe.calculateDuration(i.startDate,i.endDate):0,m=t.filter(f=>f.dependencies&&f.dependencies.includes(i.id)),p=s;if(m.length>0)for(let f of m){l(f);let x=o.get(f.id)?.ls||0;p=Math.min(p,x);}let g=p-u;o.set(i.id,{ls:g,lf:p});};a.forEach(l);let d=[];for(let i of a){let u=r.get(i.id),m=o.get(i.id);if(u&&m){let p=m.ls-u.es;Math.abs(p)<.01&&d.push(i.id);}}return d},calculateCriticalPathFull:e=>{let t=new Map,r=Pe.flattenTasks(e).filter(p=>p.startDate&&p.endDate);if(r.length===0)return t;let n=new Map(r.map(p=>[p.id,p])),s=new Map;for(let p of r)s.has(p.id)||s.set(p.id,[]);for(let p of r)if(p.dependencies){for(let g of p.dependencies)if(n.has(g)){let f=s.get(g);f&&f.push(p.id);}}let o=new Map;for(let p of r)o.set(p.id,0);for(let p of r)if(p.dependencies)for(let g of p.dependencies)n.has(g)&&o.set(p.id,(o.get(p.id)||0)+1);let l=new Map,d=[],i=[];for(let p of r)(o.get(p.id)||0)===0&&i.push(p.id);for(;i.length>0;){let p=i.shift();d.push(p);let g=n.get(p);if(!g||!g.startDate||!g.endDate)continue;let f=Pe.calculateDuration(g.startDate,g.endDate),x=0;if(g.dependencies)for(let b of g.dependencies){let h=l.get(b);h&&(x=Math.max(x,h.ef));}l.set(p,{es:x,ef:x+f});let y=s.get(p)||[];for(let b of y){let h=(o.get(b)||1)-1;o.set(b,h),h===0&&i.push(b);}}if(d.length<r.length)return t;let u=Math.max(...Array.from(l.values()).map(p=>p.ef)),m=new Map;for(let p=d.length-1;p>=0;p--){let g=d[p];if(!g)continue;let f=n.get(g);if(!f||!f.startDate||!f.endDate)continue;let x=Pe.calculateDuration(f.startDate,f.endDate),y=s.get(g)||[],b=u;if(y.length>0)for(let h of y){let v=m.get(h);v&&(b=Math.min(b,v.ls));}m.set(g,{ls:b-x,lf:b});}for(let p of d){let g=l.get(p),f=m.get(p),x=f.ls-g.es,y=s.get(p)||[],b;y.length>0?b=Math.min(...y.map(h=>l.get(h).es))-g.ef:b=u-g.ef,t.set(p,{earlyStart:g.es,earlyFinish:g.ef,lateStart:f.ls,lateFinish:f.lf,totalFloat:Math.round(x*100)/100,freeFloat:Math.max(0,Math.round(b*100)/100),isCritical:x<=.01});}return t},calculateSlack:(e,t)=>{let a=Pe.findTaskById(e,t);if(!a||!a.startDate||!a.endDate)return null;if(Pe.calculateCriticalPath(e).includes(t))return 0;let n=Pe.getDependentTasks(e,t);if(n.length===0){let l=Pe.getLatestEndDate(e);if(!l)return null;let d=Pe.calculateDuration(a.endDate,l);return Math.max(0,d)}let s=n.filter(l=>l.startDate).map(l=>l.startDate.getTime()).sort((l,d)=>l-d)[0];if(!s)return null;let o=Pe.calculateDuration(a.endDate,new Date(s));return Math.max(0,o)},isOnCriticalPath:(e,t)=>Pe.calculateCriticalPath(e).includes(t),autoScheduleDependents:(e,t,a,r)=>{let n=r||new Set;if(n.has(t))return e;n.add(t);let s=Pe.findTaskById(e,t);if(!s||!s.endDate)return e;let o=Pe.getDependentTasks(e,t);if(o.length===0)return e;let l=[...e];for(let d of o){if(n.has(d.id)||!d.startDate||!d.endDate)continue;let i=Pe.calculateDuration(d.startDate,d.endDate),u;if(a!==void 0?(u=new Date(d.startDate),u.setDate(u.getDate()+a)):(u=new Date(s.endDate),u.setDate(u.getDate()+1)),a!==void 0){let g=new Date(s.endDate),f=new Date(g);f.setDate(f.getDate()+1),u<f&&(u=f);}let m=Pe.calculateEndDate(u,i),p=g=>g.map(f=>f.id===d.id?{...f,startDate:u,endDate:m}:f.subtasks?{...f,subtasks:p(f.subtasks)}:f);l=p(l),l=Pe.autoScheduleDependents(l,d.id,a,n);}return l},calculateCascadePreview:(e,t,a,r,n,s,o,l)=>{if(a===0)return [];let d=[],i=n.getTime(),u=1e3*60*60*24,m=Pe.findTaskById(e,t);if(!m||!m.endDate)return [];let p=(g,f,x=new Set)=>{if(x.has(g))return;x.add(g);let y=Pe.getDependentTasks(e,g);for(let b of y){if(!b.startDate||!b.endDate)continue;let h=r.findIndex(C=>C.id===b.id);if(h===-1)continue;let v=b.startDate.getTime(),D=(b.endDate.getTime()-v)/u,M=(v-i)/u*s,T=M+f*s,F=Math.max(D*s,s),A=l+h*o+(o-18)/2;d.push({taskId:b.id,taskName:b.name,originalX:M,previewX:T,width:F,y:A,rowIndex:h,daysDelta:f,color:b.color}),p(b.id,f,x);}};return p(t,a),d},splitTask:(e,t,a,r=3)=>{let n=Pe.findTaskById(e,t);if(!n||!n.startDate||!n.endDate)return e;if(a<=n.startDate||a>=n.endDate)return console.warn("Split date must be between task start and end dates"),e;let s=new Date(a);s.setDate(s.getDate()-1);let o=new Date(a);o.setDate(o.getDate()+r);let l=new Date(n.endDate);l.setDate(l.getDate()+r);let d=[{startDate:new Date(n.startDate),endDate:s},{startDate:o,endDate:l}],i=u=>u.map(m=>m.id===n.id?{...m,endDate:l,segments:d}:m.subtasks?{...m,subtasks:i(m.subtasks)}:m);return i(e)}};function zi({tasks:e,theme:t,rowHeight:a,timeScale:r,startDate:n,endDate:s,zoom:o,locale:l="en",templates:d,dependencyLineStyle:i="curved",showTaskBarLabels:u=true,onTaskClick:m,onTaskDblClick:p,onTaskContextMenu:g,onTaskDateChange:f,onDependencyCreate:x,onDependencyDelete:y,showBaseline:b,showCriticalPath:h=true,showDependencies:v=true,highlightWeekends:w=true,canEditTask:D,onTaskProgressDrag:S,workingDaysConfig:M}){let F=Hr(),A=react.useRef(null),[C,_]=react.useState([]),[W,oe]=react.useState(null),[L,Y]=react.useState(null),[K,V]=react.useState(null),B=react.useRef(false),[X,Ce]=react.useState(new Set),[Re,R]=react.useState(null),ae=react.useCallback(k=>{if(K&&!B.current){let O=k.target,Z=false;for(;O&&O!==k.currentTarget;){if(O.getAttribute?.("data-dependency-line")==="true"||O.getAttribute?.("data-dependency-hover-overlay")==="true"){Z=true;break}O=O.parentElement;}Z||V(null);}},[K]),be=react.useCallback(k=>{Y(k);},[]),Ie=Math.ceil((s.getTime()-n.getTime())/(1e3*60*60*24)),De=r==="day"?60:r==="week"?20:8,Ee=Ie*De*o,He=k=>{let O=new Date(Date.UTC(k.getFullYear(),k.getMonth(),k.getDate())),Z=O.getUTCDay()||7;O.setUTCDate(O.getUTCDate()+4-Z);let ve=new Date(Date.UTC(O.getUTCFullYear(),0,1));return Math.ceil(((O.getTime()-ve.getTime())/864e5+1)/7)},rt=k=>{let O=k.getDay();return O===0||O===6},pe=react.useCallback(k=>{let O=Math.round(k/(De*o)),Z=new Date(n);return Z.setDate(Z.getDate()+O),Z},[n,De,o]),We=react.useCallback((k,O)=>{if(O.startDate&&O.endDate)return;let Z=k.currentTarget.ownerSVGElement;if(!Z)return;let ve=Z.createSVGPoint();ve.x=k.clientX,ve.y=k.clientY;let $=ve.matrixTransform(Z.getScreenCTM()?.inverse()),re=pe($.x),Ye=new Date(re);Ye.setDate(Ye.getDate()+1),R(null),f?.(O,re,Ye);},[pe,f]),je=react.useCallback((k,O,Z)=>{let ve=k.currentTarget.ownerSVGElement;if(!ve)return;let $=ve.createSVGPoint();$.x=k.clientX,$.y=k.clientY;let re=$.matrixTransform(ve.getScreenCTM()?.inverse()),Ye=pe(re.x),Fe=Math.round(re.x/(De*o))*De*o;R({taskId:O.id,x:Fe,y:Z*a+a/2,date:Ye});},[pe,De,o,a]),Oe=react.useCallback(()=>{R(null);},[]),tt=react.useMemo(()=>{let k=$=>$.map(re=>{if(re.subtasks&&re.subtasks.length>0){let Ye=k(re.subtasks),Te=Ye.filter(Fe=>Fe.startDate&&Fe.endDate);if(Te.length>0){let Fe=Te.map(st=>st.startDate.getTime()),ze=Te.map(st=>st.endDate.getTime()),Le=new Date(Math.min(...Fe)),Ze=new Date(Math.max(...ze));return {...re,subtasks:Ye,startDate:Le,endDate:Ze}}return {...re,subtasks:Ye}}return re}),O=($,re=[])=>{let Ye=[...$].sort((Te,Fe)=>(Te.position??0)-(Fe.position??0));for(let Te of Ye)re.push(Te),Te.subtasks&&Te.subtasks.length>0&&(Te.isExpanded===void 0||Te.isExpanded)&&O(Te.subtasks,re);return re},Z=k(e);return O(Z)},[e]),wt=react.useCallback(k=>{if(!k.startDate||!k.endDate)return {x:0,width:0};let O=k.startDate.getTime(),Z=k.endDate.getTime(),ve=n.getTime(),$=(O-ve)/(1e3*60*60*24),re=(Z-O)/(1e3*60*60*24)+1,Ye=$*De*o,Te=Math.max(De*o,40),Fe=Math.max(re*De*o,Te);return {x:Ye,width:Fe}},[n,De,o]),pt=react.useMemo(()=>tt.filter(k=>k.startDate&&k.endDate).map(k=>{let{x:O,width:Z}=wt(k),$=tt.findIndex(re=>re.id===k.id)*a+(a-18)/2;return {id:k.id,x:O,y:$,width:Z,height:18}}),[tt,wt]),Ue=react.useCallback((k,O,Z)=>{if(!Z){_([]),oe(null);return}if(oe({taskId:k,daysDelta:O}),O===0){_([]);return}let ve=Pe.calculateCascadePreview(e,k,O,tt,n,De*o,a,48);_(ve);},[e,tt,n,De,o,a,48]),ot=react.useCallback((k,O)=>{if(!W)return O;let Z=De*o,ve=W.daysDelta*Z;if(k===W.taskId)return {x:O.x+ve,width:O.width};let $=C.find(re=>re.taskId===k);return $?{x:$.previewX,width:$.width}:O},[W,C,De,o]),Et=react.useMemo(()=>{let k=[],O=new Date(n);for(;O<=s;){let $=(O.getTime()-n.getTime())/864e5*De*o;if(r==="day")k.push({date:new Date(O),label:O.toLocaleDateString(l,{day:"numeric",month:"short"}),x:$}),O.setDate(O.getDate()+1);else if(r==="week"){let re=He(O);k.push({date:new Date(O),label:`${F.labels.week} ${re}`,x:$}),O.setDate(O.getDate()+7);}else k.push({date:new Date(O),label:O.toLocaleDateString(l,{month:"short",year:"numeric"}),x:$}),O.setMonth(O.getMonth()+1);}return k},[n,s,r,De,o,l,F.labels.week]),ge=react.useMemo(()=>(new Date().getTime()-n.getTime())/(1e3*60*60*24)*De*o,[n,De,o]),ht=Math.max(tt.length*a,552);return jsxRuntime.jsxs("div",{className:"w-full flex flex-col","data-gantt-chart":true,style:{backgroundColor:t.bgPrimary},children:[jsxRuntime.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:t.glassHeader||t.bgSecondary,flexShrink:0,height:"48px",borderBottom:`1px solid ${t.borderLight}`,boxSizing:"border-box"},children:jsxRuntime.jsxs("svg",{width:Math.max(Ee,1e3),height:47,style:{display:"block"},children:[jsxRuntime.jsx("rect",{x:0,y:0,width:Math.max(Ee,1e3),height:48,fill:t.glassHeader||t.bgSecondary}),Et.map((k,O)=>jsxRuntime.jsxs("g",{children:[O>0&&jsxRuntime.jsx("line",{x1:k.x,y1:0,x2:k.x,y2:48,stroke:t.border,strokeWidth:1,opacity:.1}),jsxRuntime.jsx("text",{x:k.x+8,y:48/2,fill:t.textTertiary,fontSize:"11",fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontWeight:"500",dominantBaseline:"middle",children:k.label})]},`header-${O}`)),ge>=0&&ge<=Ee&&jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:ge,cy:38,r:4,fill:t.today,opacity:1}),t.neonRedGlow&&jsxRuntime.jsx("circle",{cx:ge,cy:38,r:6,fill:"none",stroke:t.today,strokeWidth:1,opacity:.3}),t.neonRedGlow&&jsxRuntime.jsxs("g",{transform:`translate(${ge-18}, 2)`,children:[jsxRuntime.jsx("rect",{x:0,y:0,width:36,height:14,rx:2,fill:"rgba(0,0,0,0.8)",stroke:t.today,strokeWidth:.5,opacity:.8}),jsxRuntime.jsx("text",{x:18,y:10,textAnchor:"middle",fill:t.today,fontSize:"7",fontFamily:"'JetBrains Mono', monospace",fontWeight:"700",letterSpacing:"0.1em",children:F.labels.today.toUpperCase()})]})]})]})}),jsxRuntime.jsxs("svg",{ref:A,width:Math.max(Ee,1e3),height:ht,style:{display:"block",flexShrink:0,overflow:"visible"},onMouseMove:ae,children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsx("filter",{id:"shadow",children:jsxRuntime.jsx("feDropShadow",{dx:"0",dy:"1",stdDeviation:"2",floodOpacity:"0.1"})}),jsxRuntime.jsx("pattern",{id:"diagonal-stripes",width:"8",height:"8",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:jsxRuntime.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"8",stroke:t.border,strokeWidth:"2"})}),jsxRuntime.jsx("pattern",{id:"weekend-hatch",width:"8",height:"8",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:jsxRuntime.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"8",stroke:(t.bgPrimary||"").charAt(1)==="0"?"rgba(255,255,255,0.055)":"rgba(0,0,0,0.04)",strokeWidth:"4"})}),jsxRuntime.jsxs("pattern",{id:"bar-remaining-hatch",width:"10",height:"10",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:[jsxRuntime.jsx("rect",{x:"0",y:"0",width:"5",height:"10",fill:"#00E5CC",opacity:"0.18"}),jsxRuntime.jsx("rect",{x:"5",y:"0",width:"5",height:"10",fill:"#94A3B8",opacity:"0.12"})]})]}),jsxRuntime.jsx("rect",{x:0,y:0,width:Math.max(Ee,1e3),height:ht,fill:t.bgPrimary}),tt.map((k,O)=>jsxRuntime.jsx("rect",{x:0,y:O*a,width:Math.max(Ee,1e3),height:a,fill:O%2===0?t.bgPrimary:t.bgGrid,opacity:1,style:{pointerEvents:"none"}},`row-bg-${k.id}`)),Et.map((k,O)=>O>0?jsxRuntime.jsx("line",{x1:k.x,y1:0,x2:k.x,y2:tt.length*a,stroke:t.borderLight,strokeWidth:1,shapeRendering:"crispEdges",opacity:t.neonRedGlow?1:.1},`vgrid-${O}`):null),w&&Et.map((k,O)=>{let Z=Et[O+1]?.x||Ee;return rt(k.date)?jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:k.x,y:0,width:Z-k.x,height:tt.length*a,fill:(t.bgPrimary||"").charAt(1)==="0"?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)",style:{pointerEvents:"none"}}),jsxRuntime.jsx("rect",{x:k.x,y:0,width:Z-k.x,height:tt.length*a,fill:"url(#weekend-hatch)",style:{pointerEvents:"none"}})]},`we-overlay-${O}`):null}),tt.map((k,O)=>{let Z=k.startDate&&k.endDate;return jsxRuntime.jsx("g",{children:!Z&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:0,y:O*a,width:Ee,height:a,fill:"transparent",style:{cursor:"pointer",pointerEvents:"all"},onClick:ve=>We(ve,k),onMouseMove:ve=>je(ve,k,O),onMouseLeave:()=>{Oe();}},`clickable-${k.id}`),Re&&Re.taskId===k.id&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("line",{x1:Re.x,y1:O*a+4,x2:Re.x,y2:O*a+a-4,stroke:t.accent,strokeWidth:2,opacity:.8}),jsxRuntime.jsx("circle",{cx:Re.x,cy:Re.y,r:8,fill:t.accent,opacity:.9}),jsxRuntime.jsx("circle",{cx:Re.x,cy:Re.y,r:4,fill:"white",opacity:.9}),jsxRuntime.jsxs("g",{transform:`translate(${Re.x}, ${O*a-8})`,children:[jsxRuntime.jsx("rect",{x:-40,y:-20,width:80,height:20,rx:4,fill:t.bgSecondary,stroke:t.border,strokeWidth:1}),jsxRuntime.jsx("text",{x:0,y:-6,textAnchor:"middle",fill:t.textPrimary,fontSize:"11",fontFamily:"Inter, sans-serif",fontWeight:"500",children:Re.date.toLocaleDateString(l==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})})]})]}),(!Re||Re.taskId!==k.id)&&jsxRuntime.jsx("text",{x:ge>0?ge:100,y:O*a+a/2,fill:t.textTertiary,fontSize:"12",fontFamily:"Inter, sans-serif",fontStyle:"italic",dominantBaseline:"middle",opacity:.4,style:{pointerEvents:"none",userSelect:"none"},children:F.labels.clickToSetDates},`placeholder-${k.id}`)]})},`row-group-${k.id}`)}),tt.map((k,O)=>{if(!k.startDate||!k.endDate)return null;let{x:Z,width:ve}=wt(k),$=O*a+(a-18)/2,re=k.subtasks&&k.subtasks.length>0&&!k.isMilestone;if(k.isMilestone)return jsxRuntime.jsx($i,{task:k,x:Z+ve/2,y:$+12,theme:t,onClick:m},k.id);if(re){let Ye=!t.bgPrimary||t.bgPrimary.startsWith("#0")||t.bgPrimary.startsWith("#1"),Te=8,Fe=$+(a-18)/2+(18-Te)/2,ze=4,Le=k.progress||0,Ze=new Date;Ze.setHours(0,0,0,0);let st=k.startDate&&Ze>=k.startDate,yt=k.endDate&&(()=>{let Ct=new Date(k.endDate);return Ct.setHours(0,0,0,0),Ze>Ct})(),xt=k.startDate&&Ze<k.startDate,$t=1;if(st&&k.startDate&&k.endDate&&!xt){let Ct=new Date(k.startDate);Ct.setHours(0,0,0,0);let St=new Date(k.endDate);St.setHours(0,0,0,0);let ct=Math.max(1,(St.getTime()-Ct.getTime())/(1e3*60*60*24)),xa=Math.min((Ze.getTime()-Ct.getTime())/(1e3*60*60*24),ct)/ct*100;$t=xa>0?Le/xa:1;}let ut;Le>=100?ut="#00E5CC":xt?ut="#4B5563":yt&&Le<100?ut="#EF4444":$t>=.95?ut="#22C55E":$t>=.8?ut="#F59E0B":ut="#EF4444";let Gt=Math.max(Le/100*ve,Le>0?ze*2:0),Mt=ve>100&&Le>0,It=k.isCriticalPath;return jsxRuntime.jsxs("g",{onClick:()=>m?.(k),onContextMenu:Ct=>{Ct.preventDefault(),Ct.stopPropagation(),g?.(k,Ct);},onMouseMove:Ct=>{be({task:k,x:Z,y:Fe,width:ve,height:Te,showBelow:Fe<100,mouseX:Ct.clientX,mouseY:Ct.clientY});},onMouseLeave:()=>be(null),style:{cursor:"default",opacity:h?It?1:.25:1,transition:"opacity 300ms ease"},children:[jsxRuntime.jsx("rect",{x:Z,y:$,width:ve,height:a,fill:"transparent",style:{pointerEvents:"all"}}),jsxRuntime.jsx("rect",{x:Z,y:Fe,width:ve,height:Te,rx:ze,fill:Ye?"rgba(255,255,255,0.10)":"rgba(0,0,0,0.08)"}),Le>0&&jsxRuntime.jsx("rect",{x:Z,y:Fe,width:Gt,height:Te,rx:ze,fill:ut}),h&&It&&jsxRuntime.jsx("rect",{x:Z,y:Fe,width:ve,height:Te,rx:ze,fill:"none",stroke:"#EF4444",strokeWidth:2,style:{pointerEvents:"none",filter:"drop-shadow(0 0 6px rgba(239, 68, 68, 0.4))"}}),Mt&&jsxRuntime.jsxs("text",{x:Z+Gt+6,y:Fe+Te/2,dominantBaseline:"central",fill:Ye?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.55)",fontSize:"9",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[Math.round(Le),"%"]})]},k.id)}return jsxRuntime.jsx(Li,{task:k,x:Z,y:$,width:ve,theme:t,dayWidth:De*o,startDate:n,templates:d,onClick:m,onDoubleClick:p,onContextMenu:g,onDateChange:f,onDependencyCreate:x,allTaskPositions:pt,onDragMove:Ue,onHoverChange:be,showBaseline:b,showTaskBarLabels:u,showCriticalPath:h,readOnly:D?!D(k):false,onProgressChange:S},k.id)}),v&&tt.map((k,O)=>!k.dependencies||k.dependencies.length===0||!k.startDate||!k.endDate?null:k.dependencies.map(Z=>{let ve=tt.find(ut=>ut.id===Z);if(!ve||!ve.startDate||!ve.endDate)return null;let $=tt.findIndex(ut=>ut.id===Z),re=ot(ve.id,wt(ve)),Ye=ot(k.id,wt(k)),Te=re.x+re.width,Fe=$*a+26,ze=Ye.x,Le=O*a+26,Ze=`dep-${Z}-${k.id}`;if(X.has(Ze))return null;let st=h&&k.isCriticalPath&&ve.isCriticalPath;return jsxRuntime.jsx(Es,{x1:Te,y1:Fe,x2:ze,y2:Le,theme:t,lineStyle:i,colorOverride:h?st?"#EF4444":"rgba(255,255,255,0.10)":void 0,strokeWidthOverride:h?st?2:1:void 0,glowFilter:st?"drop-shadow(0 0 4px rgba(239, 68, 68, 0.3))":void 0,onDelete:()=>y?.(k.id,Z),onHoverChange:ut=>{B.current=ut,ut&&V({key:Ze,fromId:Z,toId:k.id,exitX:Te,exitY:Fe,enterX:ze,enterY:Le});}},Ze)})),C.map(k=>jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("rect",{x:k.previewX,y:k.y-48,width:k.width,height:18,rx:6,fill:k.color||t.accent,opacity:.15,stroke:t.accent,strokeWidth:1,strokeDasharray:"4 3"}),Math.abs(k.daysDelta)>0&&jsxRuntime.jsx("text",{x:k.previewX+k.width/2,y:k.y-48+9,textAnchor:"middle",dominantBaseline:"middle",fill:t.accent,fontSize:"10",fontWeight:"600",fontFamily:"Inter, sans-serif",style:{userSelect:"none"},children:k.daysDelta>0?`+${k.daysDelta}d`:`${k.daysDelta}d`})]},`cascade-preview-${k.taskId}`)),v&&K&&jsxRuntime.jsx(Es,{x1:K.exitX,y1:K.exitY,x2:K.enterX,y2:K.enterY,theme:t,lineStyle:i,onDelete:()=>{let k=K.key;V(null),B.current=false,Ce(O=>new Set(O).add(k)),y?.(K.toId,K.fromId);},hoverOverlayOnly:true,onHoverChange:k=>{B.current=k,k||V(null);}},`${K.key}-hover-overlay`),ge>=0&&ge<=Ee&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[t.neonRedGlow&&jsxRuntime.jsx("line",{x1:ge,y1:0,x2:ge,y2:ht,stroke:t.today,strokeWidth:6,opacity:.15}),jsxRuntime.jsx("line",{x1:ge,y1:0,x2:ge,y2:ht,stroke:t.today,strokeWidth:1,opacity:1})]})]}),L&&jsxRuntime.jsx(Mm,{tooltipData:L,theme:t,locale:l==="es"?"es":"en",workingDaysConfig:M})]})}var Gv=['Move "Task Name" to next Monday','Extend "Task Name" by 3 days','Rename "Old Name" to "New Name"','Set "Task Name" progress to 50%','Link "Task A" to "Task B"','Create a new task called "New Task"','Delete "Task Name"','Assign John to "Task Name"'],Am=({size:e=16})=>jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M12 2l2.4 7.2L22 12l-7.6 2.8L12 22l-2.4-7.2L2 12l7.6-2.8L12 2z"})}),jv=()=>jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M22 2L11 13M22 2L15 22L11 13M22 2L2 9L11 13"})}),_v=()=>jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18"})}),Kv=()=>jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M5 12h14"})}),qv=()=>jsxRuntime.jsx("div",{className:"flex gap-1 items-center",children:[0,1,2].map(e=>jsxRuntime.jsx(framerMotion.motion.div,{className:"w-2 h-2 rounded-full bg-current",animate:{scale:[1,1.2,1],opacity:[.5,1,.5]},transition:{duration:.8,repeat:1/0,delay:e*.15}},e))});function Vi({tasks:e,theme:t,config:a,onTasksUpdate:r,onTaskUpdate:n,onTaskCreate:s,onTaskDelete:o,onDependencyCreate:l,onDependencyDelete:d}){let[i,u]=react.useState(false),[m,p]=react.useState(false),[g,f]=react.useState([]),[x,y]=react.useState(""),[b,h]=react.useState(false),[v,w]=react.useState(true),[D,S]=react.useState(""),[M,T]=react.useState(-1),[F,A]=react.useState(false),[C,_]=react.useState(0),W=react.useRef(null),oe=react.useRef(null),L=react.useRef(null),Y=react.useRef(null),{enabled:K=true,placeholder:V='Ask AI to edit tasks... (e.g., "Move Design to next week")',position:B="bottom-right",onCommand:X,suggestions:Ce=Gv,maxHistory:Re=50,persistHistory:R,mentionableUsers:ae=[]}=a,be=t.bgPrimary==="#050505"||t.bgPrimary==="#0a0a0a"||t.textPrimary==="#FFFFFF",Ie=be?"rgba(10, 10, 10, 0.75)":"rgba(255, 255, 255, 0.85)",De=be?"rgba(0, 229, 204, 0.15)":"rgba(0, 229, 204, 0.25)",Ee=be?"0 0 20px rgba(0, 229, 204, 0.08), 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(0, 229, 204, 0.04)":"0 0 20px rgba(0, 229, 204, 0.06), 0 4px 12px rgba(0, 0, 0, 0.08)",He=be?"rgba(0, 229, 204, 0.2)":"rgba(0, 229, 204, 0.15)",rt=be?"rgba(0, 229, 204, 0.08)":"rgba(0, 229, 204, 0.06)",pe=be?"rgba(10, 10, 10, 0.85)":"rgba(255, 255, 255, 0.95)",We=be?"rgba(0, 229, 204, 0.12)":"rgba(0, 229, 204, 0.2)",je=be?"rgba(0, 229, 204, 0.9)":"#00E5CC",Oe=be?"rgba(10, 10, 10, 0.92)":"rgba(255, 255, 255, 0.95)",tt=be?"rgba(0, 229, 204, 0.1)":"rgba(0, 229, 204, 0.15)",wt=be?"0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 229, 204, 0.04), inset 0 1px 0 rgba(255,255,255,0.03)":"0 20px 60px rgba(0, 0, 0, 0.1), 0 0 20px rgba(0, 229, 204, 0.04)",pt=be?"rgba(0, 229, 204, 0.04)":"rgba(0, 229, 204, 0.03)",Ue=be?"rgba(0, 229, 204, 0.1)":"rgba(0, 229, 204, 0.08)",ot=be?"rgba(0, 229, 204, 0.08)":"rgba(0, 229, 204, 0.06)",Et=be?"rgba(0, 229, 204, 0.2)":"rgba(0, 229, 204, 0.15)",ge=be?"rgba(255, 255, 255, 0.85)":"rgba(0, 0, 0, 0.85)",ht=be?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",k=be?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.6)",O=be?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",Z=be?"rgba(255,255,255,0.35)":"rgba(0,0,0,0.4)",ve="rgba(0, 229, 204, 0.04)",$=be?"rgba(0, 229, 204, 0.08)":"rgba(0, 229, 204, 0.12)",re=be?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.5)",Ye=be?"rgba(0, 229, 204, 0.25)":"rgba(0, 229, 204, 0.3)",Te=be?"rgba(0, 229, 204, 0.12)":"rgba(0, 229, 204, 0.08)",Fe=be?"rgba(0, 229, 204, 0.15)":"rgba(0, 229, 204, 0.12)",ze=be?"rgba(255, 255, 255, 0.04)":"rgba(0, 0, 0, 0.03)",Le=be?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.06)",Ze=be?"rgba(255,255,255,0.8)":"rgba(0,0,0,0.8)",st="rgba(0, 229, 204, 0.06)",yt=be?"rgba(255, 255, 255, 0.03)":"rgba(0, 0, 0, 0.02)",xt=be?"rgba(0, 229, 204, 0.08)":"rgba(0, 229, 204, 0.1)",$t=be?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.85)",ut=be?"rgba(0, 229, 204, 0.12)":"rgba(0, 229, 204, 0.08)",Gt=be?"rgba(0, 229, 204, 0.2)":"rgba(0, 229, 204, 0.15)",Mt=be?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.2)",It=be?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.25)",Ft=be?"rgba(15, 15, 15, 0.95)":"rgba(255, 255, 255, 0.98)",Ct=be?"rgba(0, 229, 204, 0.1)":"rgba(0, 229, 204, 0.15)",St=be?"0 -4px 20px rgba(0, 0, 0, 0.4)":"0 -4px 20px rgba(0, 0, 0, 0.08)",ct=be?"rgba(0, 229, 204, 0.08)":"rgba(0, 229, 204, 0.06)",fa=be?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.85)",xa=be?"rgba(255,255,255,0.35)":"rgba(0,0,0,0.4)",H=be?"rgba(0, 229, 204, 0.12)":"rgba(0, 229, 204, 0.08)",se=be?"rgba(0, 229, 204, 0.2)":"rgba(0, 229, 204, 0.15)",at=R?.storageKey||"gantt-ai-history",Xt=R?.maxMessages??5,ee=ae.filter(z=>{if(!D)return true;let ne=D.toLowerCase();return z.name.toLowerCase().includes(ne)||z.email&&z.email.toLowerCase().includes(ne)}).slice(0,5),ke=react.useCallback(z=>{if(y(z),ae.length===0)return;let ne=W.current;if(!ne)return;let Ve=ne.selectionStart||z.length,N=z.slice(0,Ve),U=N.lastIndexOf("@");if(U>=0&&((U>0?N[U-1]:" ")===" "||U===0)){let q=N.slice(U+1);if(q.length<=40){S(q),T(U),A(true),_(0);return}}A(false),S(""),T(-1);},[ae.length]),At=react.useCallback(z=>{let ne=x.slice(0,M),Ve=x.slice(M+1+D.length),N=`${ne}@${z.name} ${Ve}`;y(N),A(false),S(""),T(-1),setTimeout(()=>W.current?.focus(),0);},[x,M,D]),kt=react.useCallback(z=>{if(!F||ee.length===0)return false;if(z.key==="ArrowDown")return z.preventDefault(),_(ne=>ne<ee.length-1?ne+1:0),true;if(z.key==="ArrowUp")return z.preventDefault(),_(ne=>ne>0?ne-1:ee.length-1),true;if(z.key==="Enter"||z.key==="Tab"){z.preventDefault();let ne=ee[C];return ne&&At(ne),true}return z.key==="Escape"?(A(false),true):false},[F,ee,C,At]);react.useEffect(()=>{if(R?.enabled)try{let z=localStorage.getItem(at);if(z){let Ve=JSON.parse(z).map(N=>({...N,timestamp:new Date(N.timestamp)}));f(Ve.slice(-Xt));}}catch(z){console.warn("[GanttAIAssistant] Failed to load persisted history:",z);}},[R?.enabled,at,Xt]),react.useEffect(()=>{if(R?.enabled&&g.length>0)try{let z=g.filter(ne=>!ne.isLoading).slice(-Xt);localStorage.setItem(at,JSON.stringify(z));}catch(z){console.warn("[GanttAIAssistant] Failed to persist history:",z);}},[g,R?.enabled,at,Xt]),react.useEffect(()=>{oe.current&&oe.current.scrollIntoView({behavior:"smooth"});},[g]),react.useEffect(()=>{i&&!m&&W.current&&setTimeout(()=>W.current?.focus(),100);},[i,m]);let it=react.useCallback(z=>{if(z.success)switch(z.type){case "move_task":case "resize_task":case "rename_task":case "set_progress":case "set_status":case "assign_task":z.taskId&&z.updates&&n?.(z.taskId,z.updates);break;case "create_task":z.newTask&&s?.(z.newTask);break;case "delete_task":z.taskId&&o?.(z.taskId);break;case "link_tasks":z.dependencyFrom&&z.dependencyTo&&l?.(z.dependencyFrom,z.dependencyTo);break;case "unlink_tasks":z.taskId&&z.dependencyFrom&&d?.(z.taskId,z.dependencyFrom);break}},[n,s,o,l,d]),dt=react.useCallback(async z=>{if(!z.trim()||b)return;let ne={id:`user-${Date.now()}`,role:"user",content:z,timestamp:new Date};f(N=>[...N.slice(-(Re-1)),ne]),y(""),w(false),h(true);let Ve={id:`loading-${Date.now()}`,role:"assistant",content:"",timestamp:new Date,isLoading:true};f(N=>[...N,Ve]);try{if(X){let N=await X(z,e);f(U=>{let Ne=U.filter(et=>!et.isLoading),q={id:`assistant-${Date.now()}`,role:"assistant",content:N.message,timestamp:new Date,command:N};return [...Ne,q]}),it(N);}else f(N=>[...N.filter(Ne=>!Ne.isLoading),{id:`assistant-${Date.now()}`,role:"assistant",content:"AI handler not configured. Please provide an onCommand handler in the aiAssistant config.",timestamp:new Date}]);}catch(N){f(U=>[...U.filter(q=>!q.isLoading),{id:`error-${Date.now()}`,role:"assistant",content:`Sorry, I encountered an error: ${N instanceof Error?N.message:"Unknown error"}`,timestamp:new Date}]);}finally{h(false);}},[b,Re,X,e,it]),J=z=>{z.preventDefault(),dt(x);},xe=z=>{y(z),W.current?.focus();};if(react.useEffect(()=>{let z=ne=>{(ne.metaKey||ne.ctrlKey)&&ne.key==="k"&&(ne.preventDefault(),u(Ve=>!Ve),i||p(false)),ne.key==="Escape"&&i&&u(false);};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),react.useEffect(()=>{if(!i)return;let z=Ve=>{let N=Ve.target;L.current&&!L.current.contains(N)&&u(false);},ne=setTimeout(()=>{document.addEventListener("mousedown",z);},100);return ()=>{clearTimeout(ne),document.removeEventListener("mousedown",z);}},[i]),!K)return null;let ue={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"};return jsxRuntime.jsxs(Qt,{children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{children:!i&&jsxRuntime.jsxs(framerMotion.motion.button,{initial:{scale:0,opacity:0,rotate:-180},animate:{scale:1,opacity:1,rotate:0},exit:{scale:0,opacity:0,rotate:180},transition:{type:"spring",damping:20,stiffness:260},whileHover:{scale:1.12},whileTap:{scale:.9},className:`fixed ${ue[B]} z-[99999] group`,style:{width:44,height:44,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:Ie,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:`1px solid ${De}`,color:"#00E5CC",cursor:"pointer",boxShadow:Ee,overflow:"visible"},onClick:()=>u(true),children:[jsxRuntime.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:`1px solid ${He}`,animation:"ai-fab-pulse 3s ease-in-out infinite",pointerEvents:"none"}}),jsxRuntime.jsx("span",{style:{position:"absolute",inset:-6,borderRadius:"50%",border:`1px solid ${rt}`,animation:"ai-fab-pulse 3s ease-in-out infinite 1.5s",pointerEvents:"none"}}),jsxRuntime.jsx(Am,{size:18}),jsxRuntime.jsx("span",{className:"pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-200",style:{position:"absolute",right:"100%",marginRight:10,whiteSpace:"nowrap",fontSize:11,fontWeight:500,fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.05em",textTransform:"uppercase",color:je,background:pe,backdropFilter:"blur(8px)",padding:"4px 10px",borderRadius:6,border:`1px solid ${We}`},children:"AI \xB7 \u2318K"}),jsxRuntime.jsx("style",{children:`
|
|
361
|
+
</Project>`,u=new Blob([i],{type:"application/xml;charset=utf-8;"}),m=document.createElement("a");m.href=URL.createObjectURL(u),m.download=a,m.click(),URL.revokeObjectURL(m.href);},calculateCriticalPath:e=>{let t=Pe.flattenTasks(e),a=t.filter(i=>i.startDate&&i.endDate);if(a.length===0)return [];let r=new Map,n=i=>{if(r.has(i.id))return;let u=i.startDate&&i.endDate?Pe.calculateDuration(i.startDate,i.endDate):0,m=0;if(i.dependencies&&i.dependencies.length>0)for(let g of i.dependencies){let f=t.find(x=>x.id===g);if(f){n(f);let x=r.get(g)?.ef||0;m=Math.max(m,x);}}let p=m+u;r.set(i.id,{es:m,ef:p});};a.forEach(n);let s=Math.max(...Array.from(r.values()).map(i=>i.ef)),o=new Map,l=i=>{if(o.has(i.id))return;let u=i.startDate&&i.endDate?Pe.calculateDuration(i.startDate,i.endDate):0,m=t.filter(f=>f.dependencies&&f.dependencies.includes(i.id)),p=s;if(m.length>0)for(let f of m){l(f);let x=o.get(f.id)?.ls||0;p=Math.min(p,x);}let g=p-u;o.set(i.id,{ls:g,lf:p});};a.forEach(l);let d=[];for(let i of a){let u=r.get(i.id),m=o.get(i.id);if(u&&m){let p=m.ls-u.es;Math.abs(p)<.01&&d.push(i.id);}}return d},calculateCriticalPathFull:e=>{let t=new Map,r=Pe.flattenTasks(e).filter(p=>p.startDate&&p.endDate);if(r.length===0)return t;let n=new Map(r.map(p=>[p.id,p])),s=new Map;for(let p of r)s.has(p.id)||s.set(p.id,[]);for(let p of r)if(p.dependencies){for(let g of p.dependencies)if(n.has(g)){let f=s.get(g);f&&f.push(p.id);}}let o=new Map;for(let p of r)o.set(p.id,0);for(let p of r)if(p.dependencies)for(let g of p.dependencies)n.has(g)&&o.set(p.id,(o.get(p.id)||0)+1);let l=new Map,d=[],i=[];for(let p of r)(o.get(p.id)||0)===0&&i.push(p.id);for(;i.length>0;){let p=i.shift();d.push(p);let g=n.get(p);if(!g||!g.startDate||!g.endDate)continue;let f=Pe.calculateDuration(g.startDate,g.endDate),x=0;if(g.dependencies)for(let b of g.dependencies){let h=l.get(b);h&&(x=Math.max(x,h.ef));}l.set(p,{es:x,ef:x+f});let y=s.get(p)||[];for(let b of y){let h=(o.get(b)||1)-1;o.set(b,h),h===0&&i.push(b);}}if(d.length<r.length)return t;let u=Math.max(...Array.from(l.values()).map(p=>p.ef)),m=new Map;for(let p=d.length-1;p>=0;p--){let g=d[p];if(!g)continue;let f=n.get(g);if(!f||!f.startDate||!f.endDate)continue;let x=Pe.calculateDuration(f.startDate,f.endDate),y=s.get(g)||[],b=u;if(y.length>0)for(let h of y){let v=m.get(h);v&&(b=Math.min(b,v.ls));}m.set(g,{ls:b-x,lf:b});}for(let p of d){let g=l.get(p),f=m.get(p),x=f.ls-g.es,y=s.get(p)||[],b;y.length>0?b=Math.min(...y.map(h=>l.get(h).es))-g.ef:b=u-g.ef,t.set(p,{earlyStart:g.es,earlyFinish:g.ef,lateStart:f.ls,lateFinish:f.lf,totalFloat:Math.round(x*100)/100,freeFloat:Math.max(0,Math.round(b*100)/100),isCritical:x<=.01});}return t},calculateSlack:(e,t)=>{let a=Pe.findTaskById(e,t);if(!a||!a.startDate||!a.endDate)return null;if(Pe.calculateCriticalPath(e).includes(t))return 0;let n=Pe.getDependentTasks(e,t);if(n.length===0){let l=Pe.getLatestEndDate(e);if(!l)return null;let d=Pe.calculateDuration(a.endDate,l);return Math.max(0,d)}let s=n.filter(l=>l.startDate).map(l=>l.startDate.getTime()).sort((l,d)=>l-d)[0];if(!s)return null;let o=Pe.calculateDuration(a.endDate,new Date(s));return Math.max(0,o)},isOnCriticalPath:(e,t)=>Pe.calculateCriticalPath(e).includes(t),autoScheduleDependents:(e,t,a,r)=>{let n=r||new Set;if(n.has(t))return e;n.add(t);let s=Pe.findTaskById(e,t);if(!s||!s.endDate)return e;let o=Pe.getDependentTasks(e,t);if(o.length===0)return e;let l=[...e];for(let d of o){if(n.has(d.id)||!d.startDate||!d.endDate)continue;let i=Pe.calculateDuration(d.startDate,d.endDate),u;if(a!==void 0?(u=new Date(d.startDate),u.setDate(u.getDate()+a)):(u=new Date(s.endDate),u.setDate(u.getDate()+1)),a!==void 0){let g=new Date(s.endDate),f=new Date(g);f.setDate(f.getDate()+1),u<f&&(u=f);}let m=Pe.calculateEndDate(u,i),p=g=>g.map(f=>f.id===d.id?{...f,startDate:u,endDate:m}:f.subtasks?{...f,subtasks:p(f.subtasks)}:f);l=p(l),l=Pe.autoScheduleDependents(l,d.id,a,n);}return l},calculateCascadePreview:(e,t,a,r,n,s,o,l)=>{if(a===0)return [];let d=[],i=n.getTime(),u=1e3*60*60*24,m=Pe.findTaskById(e,t);if(!m||!m.endDate)return [];let p=(g,f,x=new Set)=>{if(x.has(g))return;x.add(g);let y=Pe.getDependentTasks(e,g);for(let b of y){if(!b.startDate||!b.endDate)continue;let h=r.findIndex(C=>C.id===b.id);if(h===-1)continue;let v=b.startDate.getTime(),D=(b.endDate.getTime()-v)/u,M=(v-i)/u*s,T=M+f*s,F=Math.max(D*s,s),A=l+h*o+(o-18)/2;d.push({taskId:b.id,taskName:b.name,originalX:M,previewX:T,width:F,y:A,rowIndex:h,daysDelta:f,color:b.color}),p(b.id,f,x);}};return p(t,a),d},splitTask:(e,t,a,r=3)=>{let n=Pe.findTaskById(e,t);if(!n||!n.startDate||!n.endDate)return e;if(a<=n.startDate||a>=n.endDate)return console.warn("Split date must be between task start and end dates"),e;let s=new Date(a);s.setDate(s.getDate()-1);let o=new Date(a);o.setDate(o.getDate()+r);let l=new Date(n.endDate);l.setDate(l.getDate()+r);let d=[{startDate:new Date(n.startDate),endDate:s},{startDate:o,endDate:l}],i=u=>u.map(m=>m.id===n.id?{...m,endDate:l,segments:d}:m.subtasks?{...m,subtasks:i(m.subtasks)}:m);return i(e)}};function zi({tasks:e,theme:t,rowHeight:a,timeScale:r,startDate:n,endDate:s,zoom:o,locale:l="en",templates:d,dependencyLineStyle:i="curved",showTaskBarLabels:u=true,onTaskClick:m,onTaskDblClick:p,onTaskContextMenu:g,onTaskDateChange:f,onDependencyCreate:x,onDependencyDelete:y,showBaseline:b,showCriticalPath:h=true,showDependencies:v=true,highlightWeekends:w=true,canEditTask:D,onTaskProgressDrag:S,workingDaysConfig:M}){let F=Hr(),A=react.useRef(null),[C,_]=react.useState([]),[W,oe]=react.useState(null),[L,Y]=react.useState(null),[K,V]=react.useState(null),B=react.useRef(false),[X,Ce]=react.useState(new Set),[Re,R]=react.useState(null),ae=react.useCallback(k=>{if(K&&!B.current){let O=k.target,Z=false;for(;O&&O!==k.currentTarget;){if(O.getAttribute?.("data-dependency-line")==="true"||O.getAttribute?.("data-dependency-hover-overlay")==="true"){Z=true;break}O=O.parentElement;}Z||V(null);}},[K]),be=react.useCallback(k=>{Y(k);},[]),Ie=Math.ceil((s.getTime()-n.getTime())/(1e3*60*60*24)),De=r==="day"?60:r==="week"?20:8,Ee=Ie*De*o,He=k=>{let O=new Date(Date.UTC(k.getFullYear(),k.getMonth(),k.getDate())),Z=O.getUTCDay()||7;O.setUTCDate(O.getUTCDate()+4-Z);let ve=new Date(Date.UTC(O.getUTCFullYear(),0,1));return Math.ceil(((O.getTime()-ve.getTime())/864e5+1)/7)},rt=k=>{let O=k.getDay();return O===0||O===6},pe=react.useCallback(k=>{let O=Math.round(k/(De*o)),Z=new Date(n);return Z.setDate(Z.getDate()+O),Z},[n,De,o]),We=react.useCallback((k,O)=>{if(O.startDate&&O.endDate)return;let Z=k.currentTarget.ownerSVGElement;if(!Z)return;let ve=Z.createSVGPoint();ve.x=k.clientX,ve.y=k.clientY;let $=ve.matrixTransform(Z.getScreenCTM()?.inverse()),re=pe($.x),Ye=new Date(re);Ye.setDate(Ye.getDate()+1),R(null),f?.(O,re,Ye);},[pe,f]),je=react.useCallback((k,O,Z)=>{let ve=k.currentTarget.ownerSVGElement;if(!ve)return;let $=ve.createSVGPoint();$.x=k.clientX,$.y=k.clientY;let re=$.matrixTransform(ve.getScreenCTM()?.inverse()),Ye=pe(re.x),Fe=Math.round(re.x/(De*o))*De*o;R({taskId:O.id,x:Fe,y:Z*a+a/2,date:Ye});},[pe,De,o,a]),Oe=react.useCallback(()=>{R(null);},[]),tt=react.useMemo(()=>{let k=$=>$.map(re=>{if(re.subtasks&&re.subtasks.length>0){let Ye=k(re.subtasks),Te=Ye.filter(Fe=>Fe.startDate&&Fe.endDate);if(Te.length>0){let Fe=Te.map(st=>st.startDate.getTime()),ze=Te.map(st=>st.endDate.getTime()),Le=new Date(Math.min(...Fe)),Ze=new Date(Math.max(...ze));return {...re,subtasks:Ye,startDate:Le,endDate:Ze}}return {...re,subtasks:Ye}}return re}),O=($,re=[])=>{let Ye=[...$].sort((Te,Fe)=>(Te.position??0)-(Fe.position??0));for(let Te of Ye)re.push(Te),Te.subtasks&&Te.subtasks.length>0&&(Te.isExpanded===void 0||Te.isExpanded)&&O(Te.subtasks,re);return re},Z=k(e);return O(Z)},[e]),wt=react.useCallback(k=>{if(!k.startDate||!k.endDate)return {x:0,width:0};let O=k.startDate.getTime(),Z=k.endDate.getTime(),ve=n.getTime(),$=(O-ve)/(1e3*60*60*24),re=(Z-O)/(1e3*60*60*24)+1,Ye=$*De*o,Te=Math.max(De*o,40),Fe=Math.max(re*De*o,Te);return {x:Ye,width:Fe}},[n,De,o]),pt=react.useMemo(()=>tt.filter(k=>k.startDate&&k.endDate).map(k=>{let{x:O,width:Z}=wt(k),$=tt.findIndex(re=>re.id===k.id)*a+(a-18)/2;return {id:k.id,x:O,y:$,width:Z,height:18}}),[tt,wt]),Ue=react.useCallback((k,O,Z)=>{if(!Z){_([]),oe(null);return}if(oe({taskId:k,daysDelta:O}),O===0){_([]);return}let ve=Pe.calculateCascadePreview(e,k,O,tt,n,De*o,a,48);_(ve);},[e,tt,n,De,o,a,48]),ot=react.useCallback((k,O)=>{if(!W)return O;let Z=De*o,ve=W.daysDelta*Z;if(k===W.taskId)return {x:O.x+ve,width:O.width};let $=C.find(re=>re.taskId===k);return $?{x:$.previewX,width:$.width}:O},[W,C,De,o]),Et=react.useMemo(()=>{let k=[],O=new Date(n);for(;O<=s;){let $=(O.getTime()-n.getTime())/864e5*De*o;if(r==="day")k.push({date:new Date(O),label:O.toLocaleDateString(l,{day:"numeric",month:"short"}),x:$}),O.setDate(O.getDate()+1);else if(r==="week"){let re=He(O);k.push({date:new Date(O),label:`${F.labels.week} ${re}`,x:$}),O.setDate(O.getDate()+7);}else k.push({date:new Date(O),label:O.toLocaleDateString(l,{month:"short",year:"numeric"}),x:$}),O.setMonth(O.getMonth()+1);}return k},[n,s,r,De,o,l,F.labels.week]),ge=react.useMemo(()=>(new Date().getTime()-n.getTime())/(1e3*60*60*24)*De*o,[n,De,o]),mt=Math.max(tt.length*a,552);return jsxRuntime.jsxs("div",{className:"w-full flex flex-col","data-gantt-chart":true,style:{backgroundColor:t.bgPrimary},children:[jsxRuntime.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:t.glassHeader||t.bgSecondary,flexShrink:0,height:"48px",borderBottom:`1px solid ${t.borderLight}`,boxSizing:"border-box"},children:jsxRuntime.jsxs("svg",{width:Math.max(Ee,1e3),height:47,style:{display:"block"},children:[jsxRuntime.jsx("rect",{x:0,y:0,width:Math.max(Ee,1e3),height:48,fill:t.glassHeader||t.bgSecondary}),Et.map((k,O)=>jsxRuntime.jsxs("g",{children:[O>0&&jsxRuntime.jsx("line",{x1:k.x,y1:0,x2:k.x,y2:48,stroke:t.border,strokeWidth:1,opacity:.1}),jsxRuntime.jsx("text",{x:k.x+8,y:48/2,fill:t.textTertiary,fontSize:"11",fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontWeight:"500",dominantBaseline:"middle",children:k.label})]},`header-${O}`)),ge>=0&&ge<=Ee&&jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:ge,cy:38,r:4,fill:t.today,opacity:1}),t.neonRedGlow&&jsxRuntime.jsx("circle",{cx:ge,cy:38,r:6,fill:"none",stroke:t.today,strokeWidth:1,opacity:.3}),t.neonRedGlow&&jsxRuntime.jsxs("g",{transform:`translate(${ge-18}, 2)`,children:[jsxRuntime.jsx("rect",{x:0,y:0,width:36,height:14,rx:2,fill:"rgba(0,0,0,0.8)",stroke:t.today,strokeWidth:.5,opacity:.8}),jsxRuntime.jsx("text",{x:18,y:10,textAnchor:"middle",fill:t.today,fontSize:"7",fontFamily:"'JetBrains Mono', monospace",fontWeight:"700",letterSpacing:"0.1em",children:F.labels.today.toUpperCase()})]})]})]})}),jsxRuntime.jsxs("svg",{ref:A,width:Math.max(Ee,1e3),height:mt,style:{display:"block",flexShrink:0,overflow:"visible"},onMouseMove:ae,children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsx("filter",{id:"shadow",children:jsxRuntime.jsx("feDropShadow",{dx:"0",dy:"1",stdDeviation:"2",floodOpacity:"0.1"})}),jsxRuntime.jsx("pattern",{id:"diagonal-stripes",width:"8",height:"8",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:jsxRuntime.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"8",stroke:t.border,strokeWidth:"2"})}),jsxRuntime.jsx("pattern",{id:"weekend-hatch",width:"8",height:"8",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:jsxRuntime.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"8",stroke:(t.bgPrimary||"").charAt(1)==="0"?"rgba(255,255,255,0.055)":"rgba(0,0,0,0.04)",strokeWidth:"4"})}),jsxRuntime.jsxs("pattern",{id:"bar-remaining-hatch",width:"10",height:"10",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:[jsxRuntime.jsx("rect",{x:"0",y:"0",width:"5",height:"10",fill:"#00E5CC",opacity:"0.18"}),jsxRuntime.jsx("rect",{x:"5",y:"0",width:"5",height:"10",fill:"#94A3B8",opacity:"0.12"})]})]}),jsxRuntime.jsx("rect",{x:0,y:0,width:Math.max(Ee,1e3),height:mt,fill:t.bgPrimary}),tt.map((k,O)=>jsxRuntime.jsx("rect",{x:0,y:O*a,width:Math.max(Ee,1e3),height:a,fill:O%2===0?t.bgPrimary:t.bgGrid,opacity:1,style:{pointerEvents:"none"}},`row-bg-${k.id}`)),Et.map((k,O)=>O>0?jsxRuntime.jsx("line",{x1:k.x,y1:0,x2:k.x,y2:tt.length*a,stroke:t.borderLight,strokeWidth:1,shapeRendering:"crispEdges",opacity:t.neonRedGlow?1:.1},`vgrid-${O}`):null),w&&Et.map((k,O)=>{let Z=Et[O+1]?.x||Ee;return rt(k.date)?jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:k.x,y:0,width:Z-k.x,height:tt.length*a,fill:(t.bgPrimary||"").charAt(1)==="0"?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)",style:{pointerEvents:"none"}}),jsxRuntime.jsx("rect",{x:k.x,y:0,width:Z-k.x,height:tt.length*a,fill:"url(#weekend-hatch)",style:{pointerEvents:"none"}})]},`we-overlay-${O}`):null}),tt.map((k,O)=>{let Z=k.startDate&&k.endDate;return jsxRuntime.jsx("g",{children:!Z&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:0,y:O*a,width:Ee,height:a,fill:"transparent",style:{cursor:"pointer",pointerEvents:"all"},onClick:ve=>We(ve,k),onMouseMove:ve=>je(ve,k,O),onMouseLeave:()=>{Oe();}},`clickable-${k.id}`),Re&&Re.taskId===k.id&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("line",{x1:Re.x,y1:O*a+4,x2:Re.x,y2:O*a+a-4,stroke:t.accent,strokeWidth:2,opacity:.8}),jsxRuntime.jsx("circle",{cx:Re.x,cy:Re.y,r:8,fill:t.accent,opacity:.9}),jsxRuntime.jsx("circle",{cx:Re.x,cy:Re.y,r:4,fill:"white",opacity:.9}),jsxRuntime.jsxs("g",{transform:`translate(${Re.x}, ${O*a-8})`,children:[jsxRuntime.jsx("rect",{x:-40,y:-20,width:80,height:20,rx:4,fill:t.bgSecondary,stroke:t.border,strokeWidth:1}),jsxRuntime.jsx("text",{x:0,y:-6,textAnchor:"middle",fill:t.textPrimary,fontSize:"11",fontFamily:"Inter, sans-serif",fontWeight:"500",children:Re.date.toLocaleDateString(l==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})})]})]}),(!Re||Re.taskId!==k.id)&&jsxRuntime.jsx("text",{x:ge>0?ge:100,y:O*a+a/2,fill:t.textTertiary,fontSize:"12",fontFamily:"Inter, sans-serif",fontStyle:"italic",dominantBaseline:"middle",opacity:.4,style:{pointerEvents:"none",userSelect:"none"},children:F.labels.clickToSetDates},`placeholder-${k.id}`)]})},`row-group-${k.id}`)}),tt.map((k,O)=>{if(!k.startDate||!k.endDate)return null;let{x:Z,width:ve}=wt(k),$=O*a+(a-18)/2,re=k.subtasks&&k.subtasks.length>0&&!k.isMilestone;if(k.isMilestone)return jsxRuntime.jsx($i,{task:k,x:Z+ve/2,y:$+12,theme:t,onClick:m},k.id);if(re){let Ye=!t.bgPrimary||t.bgPrimary.startsWith("#0")||t.bgPrimary.startsWith("#1"),Te=8,Fe=$+(a-18)/2+(18-Te)/2,ze=4,Le=k.progress||0,Ze=new Date;Ze.setHours(0,0,0,0);let st=k.startDate&&Ze>=k.startDate,yt=k.endDate&&(()=>{let Ct=new Date(k.endDate);return Ct.setHours(0,0,0,0),Ze>Ct})(),xt=k.startDate&&Ze<k.startDate,$t=1;if(st&&k.startDate&&k.endDate&&!xt){let Ct=new Date(k.startDate);Ct.setHours(0,0,0,0);let St=new Date(k.endDate);St.setHours(0,0,0,0);let ct=Math.max(1,(St.getTime()-Ct.getTime())/(1e3*60*60*24)),xa=Math.min((Ze.getTime()-Ct.getTime())/(1e3*60*60*24),ct)/ct*100;$t=xa>0?Le/xa:1;}let ut;Le>=100?ut="#00E5CC":xt?ut="#4B5563":yt&&Le<100?ut="#EF4444":$t>=.95?ut="#22C55E":$t>=.8?ut="#F59E0B":ut="#EF4444";let Gt=Math.max(Le/100*ve,Le>0?ze*2:0),Mt=ve>100&&Le>0,It=k.isCriticalPath;return jsxRuntime.jsxs("g",{onClick:()=>m?.(k),onContextMenu:Ct=>{Ct.preventDefault(),Ct.stopPropagation(),g?.(k,Ct);},onMouseMove:Ct=>{be({task:k,x:Z,y:Fe,width:ve,height:Te,showBelow:Fe<100,mouseX:Ct.clientX,mouseY:Ct.clientY});},onMouseLeave:()=>be(null),style:{cursor:"default",opacity:h?It?1:.25:1,transition:"opacity 300ms ease"},children:[jsxRuntime.jsx("rect",{x:Z,y:$,width:ve,height:a,fill:"transparent",style:{pointerEvents:"all"}}),jsxRuntime.jsx("rect",{x:Z,y:Fe,width:ve,height:Te,rx:ze,fill:Ye?"rgba(255,255,255,0.10)":"rgba(0,0,0,0.08)"}),Le>0&&jsxRuntime.jsx("rect",{x:Z,y:Fe,width:Gt,height:Te,rx:ze,fill:ut}),h&&It&&jsxRuntime.jsx("rect",{x:Z,y:Fe,width:ve,height:Te,rx:ze,fill:"none",stroke:"#EF4444",strokeWidth:2,style:{pointerEvents:"none",filter:"drop-shadow(0 0 6px rgba(239, 68, 68, 0.4))"}}),Mt&&jsxRuntime.jsxs("text",{x:Z+Gt+6,y:Fe+Te/2,dominantBaseline:"central",fill:Ye?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.55)",fontSize:"9",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[Math.round(Le),"%"]})]},k.id)}return jsxRuntime.jsx(Li,{task:k,x:Z,y:$,width:ve,theme:t,dayWidth:De*o,startDate:n,templates:d,onClick:m,onDoubleClick:p,onContextMenu:g,onDateChange:f,onDependencyCreate:x,allTaskPositions:pt,onDragMove:Ue,onHoverChange:be,showBaseline:b,showTaskBarLabels:u,showCriticalPath:h,readOnly:D?!D(k):false,onProgressChange:S},k.id)}),v&&tt.map((k,O)=>!k.dependencies||k.dependencies.length===0||!k.startDate||!k.endDate?null:k.dependencies.map(Z=>{let ve=tt.find(ut=>ut.id===Z);if(!ve||!ve.startDate||!ve.endDate)return null;let $=tt.findIndex(ut=>ut.id===Z),re=ot(ve.id,wt(ve)),Ye=ot(k.id,wt(k)),Te=re.x+re.width,Fe=$*a+26,ze=Ye.x,Le=O*a+26,Ze=`dep-${Z}-${k.id}`;if(X.has(Ze))return null;let st=h&&k.isCriticalPath&&ve.isCriticalPath;return jsxRuntime.jsx(Es,{x1:Te,y1:Fe,x2:ze,y2:Le,theme:t,lineStyle:i,colorOverride:h?st?"#EF4444":"rgba(255,255,255,0.10)":void 0,strokeWidthOverride:h?st?2:1:void 0,glowFilter:st?"drop-shadow(0 0 4px rgba(239, 68, 68, 0.3))":void 0,onDelete:()=>y?.(k.id,Z),onHoverChange:ut=>{B.current=ut,ut&&V({key:Ze,fromId:Z,toId:k.id,exitX:Te,exitY:Fe,enterX:ze,enterY:Le});}},Ze)})),C.map(k=>jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("rect",{x:k.previewX,y:k.y-48,width:k.width,height:18,rx:6,fill:k.color||t.accent,opacity:.15,stroke:t.accent,strokeWidth:1,strokeDasharray:"4 3"}),Math.abs(k.daysDelta)>0&&jsxRuntime.jsx("text",{x:k.previewX+k.width/2,y:k.y-48+9,textAnchor:"middle",dominantBaseline:"middle",fill:t.accent,fontSize:"10",fontWeight:"600",fontFamily:"Inter, sans-serif",style:{userSelect:"none"},children:k.daysDelta>0?`+${k.daysDelta}d`:`${k.daysDelta}d`})]},`cascade-preview-${k.taskId}`)),v&&K&&jsxRuntime.jsx(Es,{x1:K.exitX,y1:K.exitY,x2:K.enterX,y2:K.enterY,theme:t,lineStyle:i,onDelete:()=>{let k=K.key;V(null),B.current=false,Ce(O=>new Set(O).add(k)),y?.(K.toId,K.fromId);},hoverOverlayOnly:true,onHoverChange:k=>{B.current=k,k||V(null);}},`${K.key}-hover-overlay`),ge>=0&&ge<=Ee&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[t.neonRedGlow&&jsxRuntime.jsx("line",{x1:ge,y1:0,x2:ge,y2:mt,stroke:t.today,strokeWidth:6,opacity:.15}),jsxRuntime.jsx("line",{x1:ge,y1:0,x2:ge,y2:mt,stroke:t.today,strokeWidth:1,opacity:1})]})]}),L&&jsxRuntime.jsx(Mm,{tooltipData:L,theme:t,locale:l==="es"?"es":"en",workingDaysConfig:M})]})}var Gv=['Move "Task Name" to next Monday','Extend "Task Name" by 3 days','Rename "Old Name" to "New Name"','Set "Task Name" progress to 50%','Link "Task A" to "Task B"','Create a new task called "New Task"','Delete "Task Name"','Assign John to "Task Name"'],Am=({size:e=16})=>jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M12 2l2.4 7.2L22 12l-7.6 2.8L12 22l-2.4-7.2L2 12l7.6-2.8L12 2z"})}),jv=()=>jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M22 2L11 13M22 2L15 22L11 13M22 2L2 9L11 13"})}),_v=()=>jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18"})}),Kv=()=>jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M5 12h14"})}),qv=()=>jsxRuntime.jsx("div",{className:"flex gap-1 items-center",children:[0,1,2].map(e=>jsxRuntime.jsx(framerMotion.motion.div,{className:"w-2 h-2 rounded-full bg-current",animate:{scale:[1,1.2,1],opacity:[.5,1,.5]},transition:{duration:.8,repeat:1/0,delay:e*.15}},e))});function Vi({tasks:e,theme:t,config:a,onTasksUpdate:r,onTaskUpdate:n,onTaskCreate:s,onTaskDelete:o,onDependencyCreate:l,onDependencyDelete:d}){let[i,u]=react.useState(false),[m,p]=react.useState(false),[g,f]=react.useState([]),[x,y]=react.useState(""),[b,h]=react.useState(false),[v,w]=react.useState(true),[D,S]=react.useState(""),[M,T]=react.useState(-1),[F,A]=react.useState(false),[C,_]=react.useState(0),W=react.useRef(null),oe=react.useRef(null),L=react.useRef(null),Y=react.useRef(null),{enabled:K=true,placeholder:V='Ask AI to edit tasks... (e.g., "Move Design to next week")',position:B="bottom-right",onCommand:X,suggestions:Ce=Gv,maxHistory:Re=50,persistHistory:R,mentionableUsers:ae=[]}=a,be=t.bgPrimary==="#050505"||t.bgPrimary==="#0a0a0a"||t.textPrimary==="#FFFFFF",Ie=be?"rgba(10, 10, 10, 0.75)":"rgba(255, 255, 255, 0.85)",De=be?"rgba(0, 229, 204, 0.15)":"rgba(0, 229, 204, 0.25)",Ee=be?"0 0 20px rgba(0, 229, 204, 0.08), 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(0, 229, 204, 0.04)":"0 0 20px rgba(0, 229, 204, 0.06), 0 4px 12px rgba(0, 0, 0, 0.08)",He=be?"rgba(0, 229, 204, 0.2)":"rgba(0, 229, 204, 0.15)",rt=be?"rgba(0, 229, 204, 0.08)":"rgba(0, 229, 204, 0.06)",pe=be?"rgba(10, 10, 10, 0.85)":"rgba(255, 255, 255, 0.95)",We=be?"rgba(0, 229, 204, 0.12)":"rgba(0, 229, 204, 0.2)",je=be?"rgba(0, 229, 204, 0.9)":"#00E5CC",Oe=be?"rgba(10, 10, 10, 0.92)":"rgba(255, 255, 255, 0.95)",tt=be?"rgba(0, 229, 204, 0.1)":"rgba(0, 229, 204, 0.15)",wt=be?"0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 229, 204, 0.04), inset 0 1px 0 rgba(255,255,255,0.03)":"0 20px 60px rgba(0, 0, 0, 0.1), 0 0 20px rgba(0, 229, 204, 0.04)",pt=be?"rgba(0, 229, 204, 0.04)":"rgba(0, 229, 204, 0.03)",Ue=be?"rgba(0, 229, 204, 0.1)":"rgba(0, 229, 204, 0.08)",ot=be?"rgba(0, 229, 204, 0.08)":"rgba(0, 229, 204, 0.06)",Et=be?"rgba(0, 229, 204, 0.2)":"rgba(0, 229, 204, 0.15)",ge=be?"rgba(255, 255, 255, 0.85)":"rgba(0, 0, 0, 0.85)",mt=be?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",k=be?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.6)",O=be?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",Z=be?"rgba(255,255,255,0.35)":"rgba(0,0,0,0.4)",ve="rgba(0, 229, 204, 0.04)",$=be?"rgba(0, 229, 204, 0.08)":"rgba(0, 229, 204, 0.12)",re=be?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.5)",Ye=be?"rgba(0, 229, 204, 0.25)":"rgba(0, 229, 204, 0.3)",Te=be?"rgba(0, 229, 204, 0.12)":"rgba(0, 229, 204, 0.08)",Fe=be?"rgba(0, 229, 204, 0.15)":"rgba(0, 229, 204, 0.12)",ze=be?"rgba(255, 255, 255, 0.04)":"rgba(0, 0, 0, 0.03)",Le=be?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.06)",Ze=be?"rgba(255,255,255,0.8)":"rgba(0,0,0,0.8)",st="rgba(0, 229, 204, 0.06)",yt=be?"rgba(255, 255, 255, 0.03)":"rgba(0, 0, 0, 0.02)",xt=be?"rgba(0, 229, 204, 0.08)":"rgba(0, 229, 204, 0.1)",$t=be?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.85)",ut=be?"rgba(0, 229, 204, 0.12)":"rgba(0, 229, 204, 0.08)",Gt=be?"rgba(0, 229, 204, 0.2)":"rgba(0, 229, 204, 0.15)",Mt=be?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.2)",It=be?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.25)",Ft=be?"rgba(15, 15, 15, 0.95)":"rgba(255, 255, 255, 0.98)",Ct=be?"rgba(0, 229, 204, 0.1)":"rgba(0, 229, 204, 0.15)",St=be?"0 -4px 20px rgba(0, 0, 0, 0.4)":"0 -4px 20px rgba(0, 0, 0, 0.08)",ct=be?"rgba(0, 229, 204, 0.08)":"rgba(0, 229, 204, 0.06)",fa=be?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.85)",xa=be?"rgba(255,255,255,0.35)":"rgba(0,0,0,0.4)",H=be?"rgba(0, 229, 204, 0.12)":"rgba(0, 229, 204, 0.08)",se=be?"rgba(0, 229, 204, 0.2)":"rgba(0, 229, 204, 0.15)",at=R?.storageKey||"gantt-ai-history",Xt=R?.maxMessages??5,ee=ae.filter(z=>{if(!D)return true;let ne=D.toLowerCase();return z.name.toLowerCase().includes(ne)||z.email&&z.email.toLowerCase().includes(ne)}).slice(0,5),ke=react.useCallback(z=>{if(y(z),ae.length===0)return;let ne=W.current;if(!ne)return;let Ve=ne.selectionStart||z.length,N=z.slice(0,Ve),U=N.lastIndexOf("@");if(U>=0&&((U>0?N[U-1]:" ")===" "||U===0)){let q=N.slice(U+1);if(q.length<=40){S(q),T(U),A(true),_(0);return}}A(false),S(""),T(-1);},[ae.length]),At=react.useCallback(z=>{let ne=x.slice(0,M),Ve=x.slice(M+1+D.length),N=`${ne}@${z.name} ${Ve}`;y(N),A(false),S(""),T(-1),setTimeout(()=>W.current?.focus(),0);},[x,M,D]),kt=react.useCallback(z=>{if(!F||ee.length===0)return false;if(z.key==="ArrowDown")return z.preventDefault(),_(ne=>ne<ee.length-1?ne+1:0),true;if(z.key==="ArrowUp")return z.preventDefault(),_(ne=>ne>0?ne-1:ee.length-1),true;if(z.key==="Enter"||z.key==="Tab"){z.preventDefault();let ne=ee[C];return ne&&At(ne),true}return z.key==="Escape"?(A(false),true):false},[F,ee,C,At]);react.useEffect(()=>{if(R?.enabled)try{let z=localStorage.getItem(at);if(z){let Ve=JSON.parse(z).map(N=>({...N,timestamp:new Date(N.timestamp)}));f(Ve.slice(-Xt));}}catch(z){console.warn("[GanttAIAssistant] Failed to load persisted history:",z);}},[R?.enabled,at,Xt]),react.useEffect(()=>{if(R?.enabled&&g.length>0)try{let z=g.filter(ne=>!ne.isLoading).slice(-Xt);localStorage.setItem(at,JSON.stringify(z));}catch(z){console.warn("[GanttAIAssistant] Failed to persist history:",z);}},[g,R?.enabled,at,Xt]),react.useEffect(()=>{oe.current&&oe.current.scrollIntoView({behavior:"smooth"});},[g]),react.useEffect(()=>{i&&!m&&W.current&&setTimeout(()=>W.current?.focus(),100);},[i,m]);let lt=react.useCallback(z=>{if(z.success)switch(z.type){case "move_task":case "resize_task":case "rename_task":case "set_progress":case "set_status":case "assign_task":z.taskId&&z.updates&&n?.(z.taskId,z.updates);break;case "create_task":z.newTask&&s?.(z.newTask);break;case "delete_task":z.taskId&&o?.(z.taskId);break;case "link_tasks":z.dependencyFrom&&z.dependencyTo&&l?.(z.dependencyFrom,z.dependencyTo);break;case "unlink_tasks":z.taskId&&z.dependencyFrom&&d?.(z.taskId,z.dependencyFrom);break}},[n,s,o,l,d]),dt=react.useCallback(async z=>{if(!z.trim()||b)return;let ne={id:`user-${Date.now()}`,role:"user",content:z,timestamp:new Date};f(N=>[...N.slice(-(Re-1)),ne]),y(""),w(false),h(true);let Ve={id:`loading-${Date.now()}`,role:"assistant",content:"",timestamp:new Date,isLoading:true};f(N=>[...N,Ve]);try{if(X){let N=await X(z,e);f(U=>{let Ne=U.filter(et=>!et.isLoading),q={id:`assistant-${Date.now()}`,role:"assistant",content:N.message,timestamp:new Date,command:N};return [...Ne,q]}),lt(N);}else f(N=>[...N.filter(Ne=>!Ne.isLoading),{id:`assistant-${Date.now()}`,role:"assistant",content:"AI handler not configured. Please provide an onCommand handler in the aiAssistant config.",timestamp:new Date}]);}catch(N){f(U=>[...U.filter(q=>!q.isLoading),{id:`error-${Date.now()}`,role:"assistant",content:`Sorry, I encountered an error: ${N instanceof Error?N.message:"Unknown error"}`,timestamp:new Date}]);}finally{h(false);}},[b,Re,X,e,lt]),J=z=>{z.preventDefault(),dt(x);},xe=z=>{y(z),W.current?.focus();};if(react.useEffect(()=>{let z=ne=>{(ne.metaKey||ne.ctrlKey)&&ne.key==="k"&&(ne.preventDefault(),u(Ve=>!Ve),i||p(false)),ne.key==="Escape"&&i&&u(false);};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),react.useEffect(()=>{if(!i)return;let z=Ve=>{let N=Ve.target;L.current&&!L.current.contains(N)&&u(false);},ne=setTimeout(()=>{document.addEventListener("mousedown",z);},100);return ()=>{clearTimeout(ne),document.removeEventListener("mousedown",z);}},[i]),!K)return null;let ue={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"};return jsxRuntime.jsxs(Qt,{children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{children:!i&&jsxRuntime.jsxs(framerMotion.motion.button,{initial:{scale:0,opacity:0,rotate:-180},animate:{scale:1,opacity:1,rotate:0},exit:{scale:0,opacity:0,rotate:180},transition:{type:"spring",damping:20,stiffness:260},whileHover:{scale:1.12},whileTap:{scale:.9},className:`fixed ${ue[B]} z-[99999] group`,style:{width:44,height:44,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:Ie,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:`1px solid ${De}`,color:"#00E5CC",cursor:"pointer",boxShadow:Ee,overflow:"visible"},onClick:()=>u(true),children:[jsxRuntime.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:`1px solid ${He}`,animation:"ai-fab-pulse 3s ease-in-out infinite",pointerEvents:"none"}}),jsxRuntime.jsx("span",{style:{position:"absolute",inset:-6,borderRadius:"50%",border:`1px solid ${rt}`,animation:"ai-fab-pulse 3s ease-in-out infinite 1.5s",pointerEvents:"none"}}),jsxRuntime.jsx(Am,{size:18}),jsxRuntime.jsx("span",{className:"pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-200",style:{position:"absolute",right:"100%",marginRight:10,whiteSpace:"nowrap",fontSize:11,fontWeight:500,fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.05em",textTransform:"uppercase",color:je,background:pe,backdropFilter:"blur(8px)",padding:"4px 10px",borderRadius:6,border:`1px solid ${We}`},children:"AI \xB7 \u2318K"}),jsxRuntime.jsx("style",{children:`
|
|
362
362
|
@keyframes ai-fab-pulse {
|
|
363
363
|
0%, 100% { transform: scale(1); opacity: 0.4; }
|
|
364
364
|
50% { transform: scale(1.15); opacity: 0; }
|
|
365
365
|
}
|
|
366
|
-
`})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:i&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:L,initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1,height:m?"auto":500},exit:{opacity:0,y:20,scale:.95},transition:{type:"spring",damping:25,stiffness:300},className:`fixed ${ue[B]} z-[99999] w-96 rounded-2xl overflow-hidden flex flex-col`,style:{background:Oe,backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)",border:`1px solid ${tt}`,boxShadow:wt},children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{background:pt,borderBottom:`1px solid ${Ue}`},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2.5",children:[jsxRuntime.jsx("div",{style:{width:28,height:28,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:ot,border:`1px solid ${Et}`,color:"#00E5CC"},children:jsxRuntime.jsx(Am,{size:14})}),jsxRuntime.jsx("span",{style:{fontSize:12,fontWeight:600,fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.06em",textTransform:"uppercase",color:ge},children:"AI Assistant"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{onClick:()=>p(z=>!z),className:"p-1.5 rounded-lg transition-colors",style:{color:ht},onMouseEnter:z=>{z.currentTarget.style.background=O,z.currentTarget.style.color=k;},onMouseLeave:z=>{z.currentTarget.style.background="transparent",z.currentTarget.style.color=ht;},children:jsxRuntime.jsx(Kv,{})}),jsxRuntime.jsx("button",{onClick:()=>u(false),className:"p-1.5 rounded-lg transition-colors",style:{color:ht},onMouseEnter:z=>{z.currentTarget.style.background=O,z.currentTarget.style.color=k;},onMouseLeave:z=>{z.currentTarget.style.background="transparent",z.currentTarget.style.color=ht;},children:jsxRuntime.jsx(_v,{})})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:!m&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"flex flex-col flex-1 min-h-0",children:[jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",style:{maxHeight:350},children:[g.length===0&&v&&jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("p",{className:"text-xs text-center",style:{color:Z,fontFamily:"'JetBrains Mono', monospace"},children:"Try asking me to edit your Gantt chart:"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:Ce.slice(0,4).map((z,ne)=>jsxRuntime.jsx("button",{onClick:()=>xe(z),className:"text-xs px-3 py-1.5 rounded-full transition-all",style:{background:ve,color:re,border:`1px solid ${$}`},onMouseEnter:Ve=>{Ve.currentTarget.style.borderColor=Ye,Ve.currentTarget.style.color="#00E5CC";},onMouseLeave:Ve=>{Ve.currentTarget.style.borderColor=$,Ve.currentTarget.style.color=re;},children:z.length>30?z.slice(0,30)+"...":z},ne))})]}),g.map(z=>jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex ${z.role==="user"?"justify-end":"justify-start"}`,children:jsxRuntime.jsxs("div",{className:`max-w-[85%] rounded-2xl px-4 py-2.5 ${z.role==="user"?"rounded-br-md":"rounded-bl-md"}`,style:{background:z.role==="user"?Te:ze,color:z.role==="user"?"#00E5CC":Ze,border:z.role==="user"?`1px solid ${Fe}`:`1px solid ${Le}`},children:[z.isLoading?jsxRuntime.jsx(qv,{}):jsxRuntime.jsx("p",{className:"text-sm whitespace-pre-wrap",children:z.content}),z.command&&jsxRuntime.jsxs("div",{className:"mt-2 text-xs px-2 py-1 rounded-md inline-flex items-center gap-1",style:{background:z.command.success?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:z.command.success?"#10B981":"#EF4444",border:`1px solid ${z.command.success?"rgba(16,185,129,0.2)":"rgba(239,68,68,0.2)"}`},children:[z.command.success?"\u2713":"\u2717",jsxRuntime.jsx("span",{className:"capitalize",children:z.command.type.replace(/_/g," ")})]})]})},z.id)),jsxRuntime.jsx("div",{ref:oe})]}),jsxRuntime.jsxs("form",{onSubmit:z=>{if(F&&ee.length>0){z.preventDefault();return}J(z);},className:"p-3 relative",style:{borderTop:`1px solid ${st}`},children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{children:F&&ee.length>0&&jsxRuntime.jsx(framerMotion.motion.div,{ref:Y,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.12},className:"absolute bottom-full left-3 right-3 mb-1 rounded-lg overflow-hidden z-10",style:{background:Ft,border:`1px solid ${Ct}`,boxShadow:St,backdropFilter:"blur(12px)"},children:ee.map((z,ne)=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>At(z),className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-colors",style:{background:ne===C?ct:"transparent",color:fa},onMouseEnter:()=>_(ne),children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold flex-shrink-0",style:{background:H,border:`1px solid ${se}`,color:"#00E5CC"},children:z.name.split(" ").map(Ve=>Ve[0]).join("").slice(0,2).toUpperCase()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-sm font-medium truncate",children:z.name}),z.email&&jsxRuntime.jsx("div",{className:"text-xs truncate",style:{color:xa},children:z.email})]})]},z.id))})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 rounded-xl px-4 py-2",style:{background:yt,border:`1px solid ${xt}`},children:[jsxRuntime.jsx("input",{ref:W,type:"text",value:x,onChange:z=>ke(z.target.value),onKeyDown:z=>{kt(z);},placeholder:V,disabled:b,className:"flex-1 bg-transparent text-sm outline-none",style:{color:$t,fontFamily:"Inter, sans-serif"}}),jsxRuntime.jsx("button",{type:"submit",disabled:!x.trim()||b,className:"p-2 rounded-lg transition-all disabled:opacity-30",style:{background:x.trim()?ut:"transparent",color:x.trim()?"#00E5CC":Mt,border:x.trim()?`1px solid ${Gt}`:"1px solid transparent"},children:jsxRuntime.jsx(jv,{})})]}),jsxRuntime.jsx("p",{className:"text-[10px] text-center mt-2",style:{color:It,fontFamily:"'JetBrains Mono', monospace"},children:"Enter to send \xB7 Esc to close"})]})]})})]})})]})}function Lm(e,t=50){let[a,r]=react.useState({past:[],present:e,future:[]}),n=react.useRef(false),s=react.useCallback((i,u=true)=>{r(m=>{let p=typeof i=="function"?i(m.present):i;if(n.current)return {...m,present:p};if(!u)return {...m,present:p};let g=[...m.past,m.present];return g.length>t&&g.shift(),{past:g,present:p,future:[]}});},[t]),o=react.useCallback(()=>{r(i=>{if(i.past.length===0)return i;let u=i.past[i.past.length-1],m=i.past.slice(0,i.past.length-1);return n.current=true,setTimeout(()=>{n.current=false;},0),{past:m,present:u,future:[i.present,...i.future]}});},[]),l=react.useCallback(()=>{r(i=>{if(i.future.length===0)return i;let u=i.future[0],m=i.future.slice(1);return n.current=true,setTimeout(()=>{n.current=false;},0),{past:[...i.past,i.present],present:u,future:m}});},[]),d=react.useCallback(()=>{r(i=>({past:[],present:i.present,future:[]}));},[]);return {state:a.present,setState:s,undo:o,redo:l,canUndo:a.past.length>0,canRedo:a.future.length>0,clearHistory:d}}function Im({undo:e,redo:t,canUndo:a,canRedo:r,enabled:n=true}){react.useEffect(()=>{if(!n)return;let s=o=>{let l=navigator.platform.toUpperCase().indexOf("MAC")>=0,d=l?o.metaKey:o.ctrlKey;if(d&&o.key==="z"&&!o.shiftKey&&a){o.preventDefault(),e();return}if(r){if(!l&&d&&o.key==="y"){o.preventDefault(),t();return}if(l&&d&&o.shiftKey&&o.key==="z"){o.preventDefault(),t();return}}};return window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s);}},[e,t,a,r,n]);}var Qv={taskTooltip:e=>{let t=[`<strong>${e.name}</strong>`];if(e.startDate&&e.endDate){t.push(`${Pe.formatDate(e.startDate)} - ${Pe.formatDate(e.endDate)}`);let a=Pe.calculateDuration(e.startDate,e.endDate);t.push(`Duration: ${a} days`);}if(e.progress!==void 0&&t.push(`Progress: ${e.progress}%`),e.status&&t.push(`Status: ${e.status}`),e.assignees&&e.assignees.length>0){let a=e.assignees.map(r=>r.name).join(", ");t.push(`Assigned: ${a}`);}return e.dependencies&&e.dependencies.length>0&&t.push(`Dependencies: ${e.dependencies.length}`),t.join("<br/>")},taskLabel:e=>e.name,gridCell:(e,t,a)=>a,taskClass:e=>{let t=[];return e.isCriticalPath&&t.push("critical-path"),e.status==="completed"?t.push("completed"):e.status==="in-progress"?t.push("in-progress"):e.status==="todo"&&t.push("todo"),e.isMilestone&&t.push("milestone"),t.join(" ")},milestoneContent:e=>`\u25C6 ${e.name}`,dateFormat:e=>Pe.formatDate(e),durationFormat:e=>e===1?"1 day":`${e} days`,progressFormat:e=>`${e}%`};function Bm(e){return {...Qv,...e}}var s2=e=>{switch(e){case "compact":return 36;case "comfortable":return 42;case "spacious":return 52;default:return 42}},$m=react.forwardRef(function({tasks:t,config:a={},onTasksChange:r},n){let{theme:s,timeScale:o="week",rowDensity:l="comfortable",showThemeSelector:d=true,showExportButton:i=true,onExportSuccess:u,projectName:m,availableUsers:p=[],templates:g,enableAutoCriticalPath:f=true,persistExpandedState:x,persistFilter:y,persistColumns:b,clearFiltersKey:h,aiAssistant:v,locale:w="en",customTranslations:D,showCreateTaskButton:S=false,createTaskLabel:M,onCreateTask:T,taskFilter:F,onTaskFilterChange:A,toolbarRightContent:C,showBaseline:_,viewMode:W,onViewModeChange:oe,projectForecast:L,onThemeChange:Y,onTaskClick:K,onTaskDblClick:V,onTaskContextMenu:B,onTaskUpdate:X,onDependentTasksScheduled:Ce,onProgressChange:Re,onTaskEdit:R,onTaskAddSubtask:ae,onTaskMarkIncomplete:be,onTaskSetInProgress:Ie,onDependencyCreate:De,onDependencyDelete:Ee,onBeforeTaskAdd:He,onAfterTaskAdd:rt,onBeforeTaskUpdate:pe,onAfterTaskUpdate:We,onBeforeTaskDelete:je,onAfterTaskDelete:Oe,permissions:tt,onCopySnapshotLink:wt}=a,Ue=react.useContext(Si)?.theme,[ot,Et]=react.useState(Ue||s||"dark"),[ge,ht]=react.useState(o),[k,O]=react.useState(l),[Z,ve]=react.useState(1),[$,re]=react.useState("all"),[Ye,Te]=react.useState(W||"execution"),Fe=W??Ye,ze=react.useCallback(E=>{Te(E),oe?.(E);},[oe]),Le=_??Fe==="oracle",[Ze,st]=react.useState(a.showCriticalPath!==false),[yt,xt]=react.useState(a.showDependencies!==false),[$t,ut]=react.useState(a.highlightWeekends!==false),Gt=react.useCallback(E=>{st(E),a.onShowCriticalPathChange?.(E);},[a.onShowCriticalPathChange]),Mt=react.useCallback(E=>{xt(E),a.onShowDependenciesChange?.(E);},[a.onShowDependenciesChange]),It=react.useCallback(E=>{ut(E),a.onHighlightWeekendsChange?.(E);},[a.onHighlightWeekendsChange]);react.useEffect(()=>{a.onTimeScaleChange?.(ge);},[ge]),react.useEffect(()=>{a.onZoomChange?.(Z);},[Z]);let Ft=react.useRef(a.onDateRangeChange);Ft.current=a.onDateRangeChange;let Ct=react.useCallback(()=>y?typeof y=="string"?y:"gantt-filter-state":null,[y]),[St,ct]=react.useState(()=>{if(!y)return "all";try{let E=typeof y=="string"?y:"gantt-filter-state",I=localStorage.getItem(E);if(I){let G=JSON.parse(I);if(G.taskFilter)return G.taskFilter}}catch(E){console.warn("[GanttBoard] Error loading filter state from localStorage:",E);}return "all"}),fa=F??St,xa=A??ct,[H,se]=react.useState(()=>{if(!y)return false;try{let E=typeof y=="string"?y:"gantt-filter-state",I=localStorage.getItem(E);if(I){let G=JSON.parse(I);if(typeof G.hideCompleted=="boolean")return G.hideCompleted}}catch(E){console.warn("[GanttBoard] Error loading hideCompleted state from localStorage:",E);}return false});react.useEffect(()=>{let E=Ct();if(E)try{let I={taskFilter:fa,hideCompleted:H};localStorage.setItem(E,JSON.stringify(I));}catch(I){console.warn("[GanttBoard] Error saving filter state to localStorage:",I);}},[fa,H,Ct]);let at=react.useRef(h);react.useEffect(()=>{if(at.current!==h&&h!==void 0){ct("all"),se(false);let E=Ct();if(E)try{localStorage.removeItem(E);}catch(I){console.warn("[GanttBoard] Error clearing filter state from localStorage:",I);}}at.current=h;},[h,Ct]);let[Xt,ee]=react.useState(0),[ke,At]=react.useState(false),[kt,it]=react.useState(null),[dt,J]=react.useState({isOpen:false,x:0,y:0,task:null}),[xe,ue]=react.useState(null),[z,ne]=react.useState(null);react.useEffect(()=>{Ue&&Ue!==ot&&Et(Ue);},[Ue]),react.useEffect(()=>{s&&s!==ot&&Et(s);},[s]);let Ve=react.useCallback(E=>{Et(E),Y?.(E);},[Y]),{state:N,setState:U,undo:Ne,redo:q,canUndo:et,canRedo:Nt,clearHistory:Wt}=Lm(t,50),Va=react.useMemo(()=>{let E=(I,G=0)=>{let Q=G;for(let de of I)de.subtasks?.length&&(Q=Math.max(Q,E(de.subtasks,G+1)));return Q};return E(N)+1},[N]),va=react.useCallback(()=>x?typeof x=="string"?x:"gantt-expanded-tasks":null,[x]),oa=react.useRef(new Map),cr=react.useRef(false);if(!cr.current&&x){cr.current=true;let E=typeof x=="string"?x:"gantt-expanded-tasks";try{let I=localStorage.getItem(E);if(I){let G=JSON.parse(I);Array.isArray(G)&&(oa.current=new Map(G));}}catch(I){console.warn("[GanttBoard] Error loading expanded state from localStorage:",I);}}let wa=react.useCallback(()=>{let E=va();if(E)try{let I=Array.from(oa.current.entries());localStorage.setItem(E,JSON.stringify(I));}catch(I){console.warn("[GanttBoard] Error saving expanded state to localStorage:",I);}},[va]),br=react.useRef(0),yo=react.useRef(N);react.useEffect(()=>{yo.current=N;},[N]);let ao=react.useRef(false),ro=react.useCallback(E=>{re(E),br.current+=1,U(I=>{let G=(de,ye=0)=>de.map(Xe=>{let Je=E==="all"||ye<E-1;return Xe.subtasks?.length&&oa.current.set(Xe.id,Je),{...Xe,isExpanded:Je,subtasks:Xe.subtasks?G(Xe.subtasks,ye+1):void 0}}),Q=G(I);return wa(),Q});},[U,wa]);react.useEffect(()=>{if(br.current>0){br.current-=1;return}let E=G=>{let Q=new Map;for(let de of G){let ye=de.id;Q.get(ye)||Q.set(ye,de);}return Array.from(Q.values())},I=G=>G.map(Q=>{let de=oa.current.get(Q.id),ye=de!==void 0?{...Q,isExpanded:de}:Q;if(ye.subtasks?.length){let Xe=E(ye.subtasks);return {...ye,subtasks:I(Xe)}}return ye});if(oa.current.size>0)U(zr(I(t)));else {let G=Q=>Q.map(de=>de.subtasks?.length?{...de,subtasks:E(G(de.subtasks))}:de);U(zr(G(t)));}},[t,U]);let xo=react.useRef(t),P=react.useRef(true);react.useEffect(()=>{if(P.current){P.current=false,xo.current=N;return}if(ao.current){ao.current=false,xo.current=N;return}if(!r)return;let E=JSON.stringify(xo.current),I=JSON.stringify(N);E!==I&&(xo.current=N,r(N));},[N,r]);let te=react.useMemo(()=>Pd(w,D),[w,D]),he=react.useCallback(E=>[{id:"name",label:E.columns.taskName,width:400,minWidth:200,maxWidth:2e3,visible:true,sortable:true,resizable:true},{id:"startDate",label:E.columns.startDate,width:110,minWidth:80,maxWidth:200,visible:false,sortable:true,resizable:true},{id:"endDate",label:E.columns.endDate,width:110,minWidth:80,maxWidth:200,visible:false,sortable:true,resizable:true},{id:"duration",label:E.columns.duration,width:80,minWidth:60,maxWidth:150,visible:false,sortable:true,resizable:true},{id:"assignees",label:E.columns.assignees,width:120,minWidth:80,maxWidth:300,visible:false,sortable:false,resizable:true},{id:"status",label:E.columns.status,width:100,minWidth:70,maxWidth:180,visible:false,sortable:true,resizable:true},{id:"progress",label:E.columns.progress,width:120,minWidth:80,maxWidth:200,visible:false,sortable:true,resizable:true},{id:"priority",label:E.columns.priority,width:90,minWidth:70,maxWidth:150,visible:false,sortable:true,resizable:true}],[]),Se=react.useMemo(()=>b?typeof b=="string"?b:"gantt-columns-state":null,[b]),[Me,Qe]=react.useState(()=>{let E=he(te);if(!b)return E;try{let I=typeof b=="string"?b:"gantt-columns-state",G=localStorage.getItem(I);if(!G)return E;let Q=JSON.parse(G),de=new Map(Q.map(ye=>[ye.id,ye]));return E.map(ye=>{let Xe=de.get(ye.id);return Xe?{...ye,visible:Xe.visible??ye.visible,width:Xe.width??ye.width}:ye})}catch(I){return console.warn("[GanttBoard] Error loading columns state from localStorage:",I),E}}),fe=react.useRef(Se);react.useEffect(()=>{if(fe.current===Se)return;fe.current=Se;let E=he(te);if(!Se){Qe(E);return}try{let I=localStorage.getItem(Se);if(!I){Qe(E);return}let G=JSON.parse(I),Q=new Map(G.map(de=>[de.id,de]));Qe(E.map(de=>{let ye=Q.get(de.id);return ye?{...de,visible:ye.visible??de.visible,width:ye.width??de.width}:de}));}catch(I){console.warn("[GanttBoard] Error reloading columns state from localStorage:",I),Qe(E);}},[Se,he,te]),react.useEffect(()=>{if(Se&&fe.current===Se)try{let E=Me.map(I=>({id:I.id,visible:I.visible,width:I.width}));localStorage.setItem(Se,JSON.stringify(E));}catch(E){console.warn("[GanttBoard] Error saving columns state to localStorage:",E);}},[Me,Se]),react.useEffect(()=>{Qe(E=>E.map(I=>({...I,label:te.columns[I.id==="name"?"taskName":I.id]||I.label})));},[te]);let Ge=react.useMemo(()=>Me.filter(I=>I.visible).reduce((I,G)=>I+G.width,0),[Me]),nt=react.useRef(Me.filter(E=>E.visible).map(E=>E.id).join(","));react.useEffect(()=>{let E=Me.filter(Q=>Q.visible),I=E.map(Q=>Q.id).join(","),G=nt.current;if(I!==G){let Q=E.some(ye=>ye.id!=="name"),de=G.includes(",");Q?!de&&Q&&it(null):it(null),nt.current=I;}},[Me]);let vt=60,na=.6,jt=react.useMemo(()=>{let I=Ge+vt,G=typeof window<"u"?window.innerWidth*na:800,Q=Math.max(I,G);return kt!==null?Math.max(200,Math.min(kt,Q)):Math.max(200,I)},[kt,Ge]),Pt=react.useRef(null),Qa=react.useRef(null),ia=react.useRef(null),nr=react.useRef(null),ua=react.useRef(null),Dt=react.useMemo(()=>Qp(ot),[ot]),Vr=react.useMemo(()=>({theme:Dt,themeName:ot}),[Dt,ot]),Za=react.useMemo(()=>Bm(g),[g]),rs=react.useMemo(()=>{if(!f)return N;let E=Pe.calculateCriticalPathFull(N),I=G=>G.map(Q=>{let de=E.get(Q.id),ye=Q.subtasks?I(Q.subtasks):void 0,Xe=ye?.some(pa=>pa.isCriticalPath||pa.subtasks&&pa.subtasks.some(Jt=>Jt.isCriticalPath))||false,Je=de?de.isCritical:Xe;return {...Q,isCriticalPath:Je,cpmData:de||void 0,subtasks:ye}});return I(N)},[N,f]),Ys=react.useMemo(()=>Pe.flattenTasks(N).some(I=>I.dependencies&&I.dependencies.length>0),[N]),os=react.useMemo(()=>{let E=(I,G="")=>[...I].sort((de,ye)=>(de.position??0)-(ye.position??0)).map((de,ye)=>{let Xe=ye+1,Je=G?`${G}.${Xe}`:`${Xe}.0`,pa=G?`${G}.${Xe}`:`${Xe}`;return {...de,wbsCode:Je,subtasks:de.subtasks?.length?E(de.subtasks,pa):de.subtasks}});return E(rs)},[rs]),vo=react.useMemo(()=>{if(fa==="all"&&!H)return os;let E=I=>{let G=[];for(let Q of I){let de=Q.subtasks?.length?E(Q.subtasks):void 0,ye=false;if(H)ye=Q.progress<100;else switch(fa){case "all":ye=true;break;case "incomplete":ye=Q.progress<100;break;case "in_progress":ye=Q.progress>0&&Q.progress<100;break;case "completed":ye=Q.progress===100;break}(ye||de&&de.length>0)&&G.push({...Q,subtasks:de});}return G};return E(os)},[os,fa,H]),oo=s2(k);Im({undo:Ne,redo:q,canUndo:et,canRedo:Nt,enabled:true}),react.useImperativeHandle(n,()=>({getTask:E=>Pe.findTaskById(N,E),addTask:(E,I)=>{U(G=>{if(!I)return [...G,{...E,level:0}];let Q=de=>de.map(ye=>ye.id===I?{...ye,subtasks:[...ye.subtasks||[],{...E,parentId:I,level:(ye.level||0)+1}],isExpanded:true}:ye.subtasks?{...ye,subtasks:Q(ye.subtasks)}:ye);return Q(G)});},updateTask:(E,I)=>{U(G=>{let Q=de=>de.map(ye=>ye.id===E?{...ye,...I}:ye.subtasks?{...ye,subtasks:Q(ye.subtasks)}:ye);return Q(G)});},deleteTask:E=>{U(I=>{let G=Q=>Q.filter(de=>de.id===E?false:(de.subtasks&&(de.subtasks=G(de.subtasks)),true));return G(I)});},deleteTasks:E=>{U(I=>Hd(I,E));},duplicateTask:E=>{if(a.onTaskDuplicate){let I=Pe.findTaskById(N,E);I&&a.onTaskDuplicate(I);}else U(I=>Ds(I,[E]).tasks);},splitTask:(E,I,G=3)=>{U(Q=>Pe.splitTask(Q,E,I,G));},calculateEndDate:Pe.calculateEndDate,calculateDuration:Pe.calculateDuration,validateDependency:(E,I)=>!Pe.validateDependencies(N,E,I),getAllTasks:()=>Pe.flattenTasks(N),getTasksByStatus:E=>Pe.flattenTasks(N).filter(I=>I.status===E),getTasksByParent:E=>E?Pe.findTaskById(N,E)?.subtasks||[]:N.filter(G=>!G.parentId),getCriticalPath:()=>Pe.flattenTasks(N).filter(E=>E.isCriticalPath),indentTask:E=>{U(I=>zr(Rd(I,[E])));},outdentTask:E=>{U(I=>zr(Od(I,[E])));},moveTask:(E,I)=>{U(G=>$d(G,[E],I));},createSubtask:async E=>{let{tasks:I,newTask:G}=Wd(N,E);if(He){let Q=He({...G,parentId:E});if((Q instanceof Promise?await Q:Q)===false)return}U(zr(I)),rt&&rt({...G,parentId:E});},scrollToTask:E=>{let G=Pe.flattenTasks(N).findIndex(Q=>Q.id===E);if(G!==-1&&Pt.current){let Q=G*oo;Pt.current.scrollTo({top:Q,behavior:"smooth"}),ia.current&&ia.current.scrollTo({top:Q,behavior:"smooth"});}},highlightTask:(E,I=2e3)=>{},expandTask:E=>{U(I=>{let G=Q=>Q.map(de=>de.id===E?{...de,isExpanded:true}:de.subtasks?{...de,subtasks:G(de.subtasks)}:de);return G(I)});},collapseTask:E=>{U(I=>{let G=Q=>Q.map(de=>de.id===E?{...de,isExpanded:false}:de.subtasks?{...de,subtasks:G(de.subtasks)}:de);return G(I)});},expandAll:()=>{U(E=>{let I=G=>G.map(Q=>({...Q,isExpanded:true,subtasks:Q.subtasks?I(Q.subtasks):void 0}));return I(E)});},collapseAll:()=>{U(E=>{let I=G=>G.map(Q=>({...Q,isExpanded:false,subtasks:Q.subtasks?I(Q.subtasks):void 0}));return I(E)});},collapseToLevel:E=>{ro(E);},undo:Ne,redo:q,canUndo:()=>et,canRedo:()=>Nt,clearHistory:Wt,exportToPNG:async()=>{if(!nr.current||!Pt.current||!ia.current)throw new Error("Gantt container not found");let E=nr.current,I=Pt.current,G=Qa.current||I.querySelector(".gantt-grid-scroll"),Q=ia.current,de=G?.scrollTop||0,ye=Q.scrollTop,Xe=E.style.overflow,Je=E.style.height,pa=I.style.overflow;try{let Jt=G?.querySelector(".gantt-taskgrid-content"),ba=Q.querySelector("svg"),ur=Jt?.scrollHeight||G?.scrollHeight||600,Pr=ba?.getBoundingClientRect().height||Q.scrollHeight,en=(E.querySelector('[style*="z-index: 100"]')?.offsetHeight||48)+Math.max(ur,Pr)+20;G&&(G.scrollTop=0),Q.scrollTop=0,E.style.overflow="visible",E.style.height=`${en}px`,I.style.overflow="visible",await new Promise(Nn=>setTimeout(Nn,100));let no=await htmlToImage.toPng(E,{backgroundColor:Dt.bgPrimary,pixelRatio:2,filter:Nn=>{if(!(Nn instanceof Element))return !0;let Xs=window.getComputedStyle(Nn),ss=parseInt(Xs.zIndex,10);return (isNaN(ss)||ss<50)&&Xs.position!=="fixed"}});return await(await fetch(no)).blob()}finally{E.style.overflow=Xe,E.style.height=Je,I.style.overflow=pa,G&&(G.scrollTop=de),Q.scrollTop=ye;}},exportToPDF:async E=>{await Pe.exportToPDF(N,E);},exportToExcel:async E=>{await Pe.exportToExcel(N,E,kl.current);},exportToJSON:()=>Pe.exportToJSON(N),exportToCSV:()=>Pe.exportToCSV(N),importFromJSON:E=>{let I=Pe.importFromJSON(E);U(I);},getTasks:()=>N,refresh:()=>{U(E=>[...E]);},clearAll:()=>{U([]);},scrollToToday:()=>{let E=ia.current,I=ua.current;if(!E||!I)return;let Q=(new Date().getTime()-I.startDate.getTime())/(1e3*60*60*24),de=I.timeScale==="day"?60:I.timeScale==="week"?20:8,ye=Q*de*I.zoom,Xe=E.clientWidth,Je=Math.max(0,ye-Xe/2);E.scrollTo({left:Je,behavior:"smooth"});}}),[N,Ne,q,et,Nt,Wt,Dt,oo]);let yf=react.useCallback(E=>{Qe(I=>I.map(G=>G.id===E?{...G,visible:!G.visible}:G));},[]),xf=react.useCallback((E,I)=>{Qe(G=>G.map(Q=>{if(Q.id!==E)return Q;let de=Q.minWidth??100,ye=Q.maxWidth??800,Xe=Math.max(de,Math.min(ye,I));return {...Q,width:Xe}}));},[]),vf=react.useCallback(E=>{U(I=>{let G=Ud(I,E),Q=de=>{for(let ye of de){if(ye.id===E){oa.current.set(E,ye.isExpanded??true);return}ye.subtasks?.length&&Q(ye.subtasks);}};return Q(G),wa(),G}),a.onTaskToggleExpand?.(E);},[a,wa]),Fo=react.useCallback((E,I)=>{if(pe&&pe(E,I)===false)return;let Q=Pe.findTaskById(N,E)?.progress,de=Xe=>Xe.map(Je=>Je.id===E?{...Je,...I}:Je.subtasks?{...Je,subtasks:de(Je.subtasks)}:Je);U(Xe=>de(Xe));let ye=Pe.findTaskById(de(N),E);ye&&(X?.(ye),We?.(ye),I.progress!==void 0&&Q!==void 0&&I.progress!==Q&&Re?.(E,Q,I.progress));},[N,X,pe,We,Re]),wf=react.useCallback((E,I,G)=>{if(E.length===0)return;let Q=new Set(E),de=ye=>ye.map(Xe=>{let Je=Q.has(Xe.id)?{...Xe,[I]:G}:Xe;return Je.subtasks?{...Je,subtasks:de(Je.subtasks)}:Je});U(ye=>{let Xe=de(ye);return a.onBulkFill?.(E,I,G,Xe),Xe});},[a]),kf=react.useCallback(E=>{E.length!==0&&(br.current+=1,ao.current=true,U(I=>zr(Rd(I,E))),a.onTaskIndent?.(E[0]));},[a]),Cf=react.useCallback(E=>{E.length!==0&&(br.current+=1,ao.current=true,U(I=>zr(Od(I,E))),a.onTaskOutdent?.(E[0]));},[a]),Tf=react.useCallback((E,I,G)=>{br.current+=1,ao.current=true,U(Q=>zr(vm(Q,E,I,G))),a.onTaskReparent?.(E,I,G);},[a]),Nf=react.useCallback((E,I)=>{E.length!==0&&(br.current+=1,ao.current=true,U(G=>$d(G,E,I)),a.onTaskMove?.(E[0],I));},[a]),xl=react.useCallback(async E=>{let I=[];for(let G of E)je&&await Promise.resolve(je(G))===false||I.push(G);I.length!==0&&(a.onMultiTaskDelete?a.onMultiTaskDelete(I):(U(G=>zr(Hd(G,I))),I.forEach(G=>a.onTaskDelete?.(G))),Oe&&I.forEach(G=>Oe(G)));},[a,je,Oe]),Df=react.useCallback(E=>{a.onTaskDuplicate?E.forEach(I=>{let G=Pe.findTaskById(N,I);G&&a.onTaskDuplicate(G);}):U(I=>Ds(I,E).tasks);},[a,N]),Sf=react.useCallback((E,I)=>{U(G=>{let{tasks:Q,newTask:de}=xm(G,E,I);return He&&He(de)===false?G:(a.onTaskCreate?.(de.parentId,de.position||0),rt?.(de),Q)});},[a,He,rt]),Ef=react.useCallback((E,I)=>{U(G=>zd(G,E,I)),a.onTaskRename?.(E,I);},[a]),vl=react.useCallback(E=>{let{onTaskAddSubtask:I}=a;if(I){let G=Wn(N,E);if(G){I(G);return}}U(G=>{let{tasks:Q}=Wd(G,E);return a.onTaskCreate?.(E,0),Q});},[a,N]),Mf=react.useCallback((E,I)=>{let G=Math.max(0,Math.min(100,Math.round(I))),Q={progress:G};G===100?Q.status="completed":G>0?Q.status="in-progress":Q.status="todo",Fo(E.id,Q);},[Fo]),Pf=react.useCallback((E,I,G)=>{let Q=!E.startDate&&!E.endDate,de=E.startDate?Math.round((I.getTime()-E.startDate.getTime())/(1e3*60*60*24)):0,ye=Jt=>Jt.map(ba=>ba.id===E.id?{...ba,startDate:I,endDate:G,...E.segments&&{segments:E.segments}}:ba.subtasks?{...ba,subtasks:ye(ba.subtasks)}:ba),Xe=ye(N),Je=Xe;Xe=Pe.autoScheduleDependents(Xe,E.id,de),Xe=zr(Xe),U(Xe);let pa={...E,startDate:I,endDate:G};if(Q&&a?.onTaskDateChange?a.onTaskDateChange(E,I,G):X?.(pa),Ce&&de!==0){let Jt=Pe.flattenTasks(Je),ba=Pe.flattenTasks(Xe),ur=[];for(let Pr of ba){if(Pr.id===E.id)continue;let Ao=Jt.find(no=>no.id===Pr.id);if(!Ao)continue;let Tn=Pr.startDate?.getTime()!==Ao.startDate?.getTime(),en=Pr.endDate?.getTime()!==Ao.endDate?.getTime();(Tn||en)&&ur.push(Pr);}ur.length>0&&Ce(ur);}},[N,X,Ce,a]),Ff=react.useCallback((E,I)=>{B?.(E,I),J({isOpen:true,x:I.clientX,y:I.clientY,task:E});},[B]),Af=react.useCallback((E,I)=>{let G=Pe.splitTask(N,E.id,I);U(G),J({isOpen:false,x:0,y:0,task:null});},[N]),ou=react.useCallback(E=>{let I=Pe.findTaskById(N,E.id)||E;V?.(I),R||ue(I);},[N,V,R]),nu=react.useCallback((E,I,G)=>{let Q=new Map,de=Jt=>{Jt.forEach(ba=>{ba.dependencies&&Q.set(ba.id,ba.dependencies),ba.subtasks&&de(ba.subtasks);});};de(G);let ye=Q.get(I)||[];Q.set(I,[...ye,E]);let Xe=new Set,Je=new Set,pa=Jt=>{if(!Xe.has(Jt)){Xe.add(Jt),Je.add(Jt);let ba=Q.get(Jt)||[];for(let ur of ba){if(!Xe.has(ur)&&pa(ur))return true;if(Je.has(ur))return true}}return Je.delete(Jt),false};return pa(I)},[]),su=react.useCallback((E,I)=>{if(nu(E.id,I,yo.current)){console.warn("Cannot create dependency: would create a circular dependency"),alert(`Cannot create this dependency: it would create a circular dependency chain.
|
|
366
|
+
`})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:i&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:L,initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1,height:m?"auto":500},exit:{opacity:0,y:20,scale:.95},transition:{type:"spring",damping:25,stiffness:300},className:`fixed ${ue[B]} z-[99999] w-96 rounded-2xl overflow-hidden flex flex-col`,style:{background:Oe,backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)",border:`1px solid ${tt}`,boxShadow:wt},children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{background:pt,borderBottom:`1px solid ${Ue}`},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2.5",children:[jsxRuntime.jsx("div",{style:{width:28,height:28,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:ot,border:`1px solid ${Et}`,color:"#00E5CC"},children:jsxRuntime.jsx(Am,{size:14})}),jsxRuntime.jsx("span",{style:{fontSize:12,fontWeight:600,fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.06em",textTransform:"uppercase",color:ge},children:"AI Assistant"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{onClick:()=>p(z=>!z),className:"p-1.5 rounded-lg transition-colors",style:{color:mt},onMouseEnter:z=>{z.currentTarget.style.background=O,z.currentTarget.style.color=k;},onMouseLeave:z=>{z.currentTarget.style.background="transparent",z.currentTarget.style.color=mt;},children:jsxRuntime.jsx(Kv,{})}),jsxRuntime.jsx("button",{onClick:()=>u(false),className:"p-1.5 rounded-lg transition-colors",style:{color:mt},onMouseEnter:z=>{z.currentTarget.style.background=O,z.currentTarget.style.color=k;},onMouseLeave:z=>{z.currentTarget.style.background="transparent",z.currentTarget.style.color=mt;},children:jsxRuntime.jsx(_v,{})})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:!m&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"flex flex-col flex-1 min-h-0",children:[jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",style:{maxHeight:350},children:[g.length===0&&v&&jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("p",{className:"text-xs text-center",style:{color:Z,fontFamily:"'JetBrains Mono', monospace"},children:"Try asking me to edit your Gantt chart:"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:Ce.slice(0,4).map((z,ne)=>jsxRuntime.jsx("button",{onClick:()=>xe(z),className:"text-xs px-3 py-1.5 rounded-full transition-all",style:{background:ve,color:re,border:`1px solid ${$}`},onMouseEnter:Ve=>{Ve.currentTarget.style.borderColor=Ye,Ve.currentTarget.style.color="#00E5CC";},onMouseLeave:Ve=>{Ve.currentTarget.style.borderColor=$,Ve.currentTarget.style.color=re;},children:z.length>30?z.slice(0,30)+"...":z},ne))})]}),g.map(z=>jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex ${z.role==="user"?"justify-end":"justify-start"}`,children:jsxRuntime.jsxs("div",{className:`max-w-[85%] rounded-2xl px-4 py-2.5 ${z.role==="user"?"rounded-br-md":"rounded-bl-md"}`,style:{background:z.role==="user"?Te:ze,color:z.role==="user"?"#00E5CC":Ze,border:z.role==="user"?`1px solid ${Fe}`:`1px solid ${Le}`},children:[z.isLoading?jsxRuntime.jsx(qv,{}):jsxRuntime.jsx("p",{className:"text-sm whitespace-pre-wrap",children:z.content}),z.command&&jsxRuntime.jsxs("div",{className:"mt-2 text-xs px-2 py-1 rounded-md inline-flex items-center gap-1",style:{background:z.command.success?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:z.command.success?"#10B981":"#EF4444",border:`1px solid ${z.command.success?"rgba(16,185,129,0.2)":"rgba(239,68,68,0.2)"}`},children:[z.command.success?"\u2713":"\u2717",jsxRuntime.jsx("span",{className:"capitalize",children:z.command.type.replace(/_/g," ")})]})]})},z.id)),jsxRuntime.jsx("div",{ref:oe})]}),jsxRuntime.jsxs("form",{onSubmit:z=>{if(F&&ee.length>0){z.preventDefault();return}J(z);},className:"p-3 relative",style:{borderTop:`1px solid ${st}`},children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{children:F&&ee.length>0&&jsxRuntime.jsx(framerMotion.motion.div,{ref:Y,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.12},className:"absolute bottom-full left-3 right-3 mb-1 rounded-lg overflow-hidden z-10",style:{background:Ft,border:`1px solid ${Ct}`,boxShadow:St,backdropFilter:"blur(12px)"},children:ee.map((z,ne)=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>At(z),className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-colors",style:{background:ne===C?ct:"transparent",color:fa},onMouseEnter:()=>_(ne),children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold flex-shrink-0",style:{background:H,border:`1px solid ${se}`,color:"#00E5CC"},children:z.name.split(" ").map(Ve=>Ve[0]).join("").slice(0,2).toUpperCase()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-sm font-medium truncate",children:z.name}),z.email&&jsxRuntime.jsx("div",{className:"text-xs truncate",style:{color:xa},children:z.email})]})]},z.id))})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 rounded-xl px-4 py-2",style:{background:yt,border:`1px solid ${xt}`},children:[jsxRuntime.jsx("input",{ref:W,type:"text",value:x,onChange:z=>ke(z.target.value),onKeyDown:z=>{kt(z);},placeholder:V,disabled:b,className:"flex-1 bg-transparent text-sm outline-none",style:{color:$t,fontFamily:"Inter, sans-serif"}}),jsxRuntime.jsx("button",{type:"submit",disabled:!x.trim()||b,className:"p-2 rounded-lg transition-all disabled:opacity-30",style:{background:x.trim()?ut:"transparent",color:x.trim()?"#00E5CC":Mt,border:x.trim()?`1px solid ${Gt}`:"1px solid transparent"},children:jsxRuntime.jsx(jv,{})})]}),jsxRuntime.jsx("p",{className:"text-[10px] text-center mt-2",style:{color:It,fontFamily:"'JetBrains Mono', monospace"},children:"Enter to send \xB7 Esc to close"})]})]})})]})})]})}function Lm(e,t=50){let[a,r]=react.useState({past:[],present:e,future:[]}),n=react.useRef(false),s=react.useCallback((i,u=true)=>{r(m=>{let p=typeof i=="function"?i(m.present):i;if(n.current)return {...m,present:p};if(!u)return {...m,present:p};let g=[...m.past,m.present];return g.length>t&&g.shift(),{past:g,present:p,future:[]}});},[t]),o=react.useCallback(()=>{r(i=>{if(i.past.length===0)return i;let u=i.past[i.past.length-1],m=i.past.slice(0,i.past.length-1);return n.current=true,setTimeout(()=>{n.current=false;},0),{past:m,present:u,future:[i.present,...i.future]}});},[]),l=react.useCallback(()=>{r(i=>{if(i.future.length===0)return i;let u=i.future[0],m=i.future.slice(1);return n.current=true,setTimeout(()=>{n.current=false;},0),{past:[...i.past,i.present],present:u,future:m}});},[]),d=react.useCallback(()=>{r(i=>({past:[],present:i.present,future:[]}));},[]);return {state:a.present,setState:s,undo:o,redo:l,canUndo:a.past.length>0,canRedo:a.future.length>0,clearHistory:d}}function Im({undo:e,redo:t,canUndo:a,canRedo:r,enabled:n=true}){react.useEffect(()=>{if(!n)return;let s=o=>{let l=navigator.platform.toUpperCase().indexOf("MAC")>=0,d=l?o.metaKey:o.ctrlKey;if(d&&o.key==="z"&&!o.shiftKey&&a){o.preventDefault(),e();return}if(r){if(!l&&d&&o.key==="y"){o.preventDefault(),t();return}if(l&&d&&o.shiftKey&&o.key==="z"){o.preventDefault(),t();return}}};return window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s);}},[e,t,a,r,n]);}var Qv={taskTooltip:e=>{let t=[`<strong>${e.name}</strong>`];if(e.startDate&&e.endDate){t.push(`${Pe.formatDate(e.startDate)} - ${Pe.formatDate(e.endDate)}`);let a=Pe.calculateDuration(e.startDate,e.endDate);t.push(`Duration: ${a} days`);}if(e.progress!==void 0&&t.push(`Progress: ${e.progress}%`),e.status&&t.push(`Status: ${e.status}`),e.assignees&&e.assignees.length>0){let a=e.assignees.map(r=>r.name).join(", ");t.push(`Assigned: ${a}`);}return e.dependencies&&e.dependencies.length>0&&t.push(`Dependencies: ${e.dependencies.length}`),t.join("<br/>")},taskLabel:e=>e.name,gridCell:(e,t,a)=>a,taskClass:e=>{let t=[];return e.isCriticalPath&&t.push("critical-path"),e.status==="completed"?t.push("completed"):e.status==="in-progress"?t.push("in-progress"):e.status==="todo"&&t.push("todo"),e.isMilestone&&t.push("milestone"),t.join(" ")},milestoneContent:e=>`\u25C6 ${e.name}`,dateFormat:e=>Pe.formatDate(e),durationFormat:e=>e===1?"1 day":`${e} days`,progressFormat:e=>`${e}%`};function Bm(e){return {...Qv,...e}}var s2=e=>{switch(e){case "compact":return 36;case "comfortable":return 42;case "spacious":return 52;default:return 42}},$m=react.forwardRef(function({tasks:t,config:a={},onTasksChange:r},n){let{theme:s,timeScale:o="week",rowDensity:l="comfortable",showThemeSelector:d=true,showExportButton:i=true,onExportSuccess:u,projectName:m,availableUsers:p=[],templates:g,enableAutoCriticalPath:f=true,persistExpandedState:x,persistFilter:y,persistColumns:b,clearFiltersKey:h,aiAssistant:v,locale:w="en",customTranslations:D,showCreateTaskButton:S=false,createTaskLabel:M,onCreateTask:T,taskFilter:F,onTaskFilterChange:A,toolbarRightContent:C,showBaseline:_,viewMode:W,onViewModeChange:oe,projectForecast:L,onThemeChange:Y,onTaskClick:K,onTaskDblClick:V,onTaskContextMenu:B,onTaskUpdate:X,onDependentTasksScheduled:Ce,onProgressChange:Re,onTaskEdit:R,onTaskAddSubtask:ae,onTaskMarkIncomplete:be,onTaskSetInProgress:Ie,onDependencyCreate:De,onDependencyDelete:Ee,onBeforeTaskAdd:He,onAfterTaskAdd:rt,onBeforeTaskUpdate:pe,onAfterTaskUpdate:We,onBeforeTaskDelete:je,onAfterTaskDelete:Oe,permissions:tt,onCopySnapshotLink:wt}=a,Ue=react.useContext(Si)?.theme,[ot,Et]=react.useState(Ue||s||"dark"),[ge,mt]=react.useState(o),[k,O]=react.useState(l),[Z,ve]=react.useState(1),[$,re]=react.useState("all"),[Ye,Te]=react.useState(W||"execution"),Fe=W??Ye,ze=react.useCallback(E=>{Te(E),oe?.(E);},[oe]),Le=_??Fe==="oracle",[Ze,st]=react.useState(a.showCriticalPath!==false),[yt,xt]=react.useState(a.showDependencies!==false),[$t,ut]=react.useState(a.highlightWeekends!==false),Gt=react.useCallback(E=>{st(E),a.onShowCriticalPathChange?.(E);},[a.onShowCriticalPathChange]),Mt=react.useCallback(E=>{xt(E),a.onShowDependenciesChange?.(E);},[a.onShowDependenciesChange]),It=react.useCallback(E=>{ut(E),a.onHighlightWeekendsChange?.(E);},[a.onHighlightWeekendsChange]);react.useEffect(()=>{a.onTimeScaleChange?.(ge);},[ge]),react.useEffect(()=>{a.onZoomChange?.(Z);},[Z]);let Ft=react.useRef(a.onDateRangeChange);Ft.current=a.onDateRangeChange;let Ct=react.useCallback(()=>y?typeof y=="string"?y:"gantt-filter-state":null,[y]),[St,ct]=react.useState(()=>{if(!y)return "all";try{let E=typeof y=="string"?y:"gantt-filter-state",I=localStorage.getItem(E);if(I){let G=JSON.parse(I);if(G.taskFilter)return G.taskFilter}}catch(E){console.warn("[GanttBoard] Error loading filter state from localStorage:",E);}return "all"}),fa=F??St,xa=A??ct,[H,se]=react.useState(()=>{if(!y)return false;try{let E=typeof y=="string"?y:"gantt-filter-state",I=localStorage.getItem(E);if(I){let G=JSON.parse(I);if(typeof G.hideCompleted=="boolean")return G.hideCompleted}}catch(E){console.warn("[GanttBoard] Error loading hideCompleted state from localStorage:",E);}return false});react.useEffect(()=>{let E=Ct();if(E)try{let I={taskFilter:fa,hideCompleted:H};localStorage.setItem(E,JSON.stringify(I));}catch(I){console.warn("[GanttBoard] Error saving filter state to localStorage:",I);}},[fa,H,Ct]);let at=react.useRef(h);react.useEffect(()=>{if(at.current!==h&&h!==void 0){ct("all"),se(false);let E=Ct();if(E)try{localStorage.removeItem(E);}catch(I){console.warn("[GanttBoard] Error clearing filter state from localStorage:",I);}}at.current=h;},[h,Ct]);let[Xt,ee]=react.useState(0),[ke,At]=react.useState(false),[kt,lt]=react.useState(null),[dt,J]=react.useState({isOpen:false,x:0,y:0,task:null}),[xe,ue]=react.useState(null),[z,ne]=react.useState(null);react.useEffect(()=>{Ue&&Ue!==ot&&Et(Ue);},[Ue]),react.useEffect(()=>{s&&s!==ot&&Et(s);},[s]);let Ve=react.useCallback(E=>{Et(E),Y?.(E);},[Y]),{state:N,setState:U,undo:Ne,redo:q,canUndo:et,canRedo:Nt,clearHistory:Ht}=Lm(t,50),Fa=react.useMemo(()=>{let E=(I,G=0)=>{let Q=G;for(let de of I)de.subtasks?.length&&(Q=Math.max(Q,E(de.subtasks,G+1)));return Q};return E(N)+1},[N]),va=react.useCallback(()=>x?typeof x=="string"?x:"gantt-expanded-tasks":null,[x]),oa=react.useRef(new Map),cr=react.useRef(false);if(!cr.current&&x){cr.current=true;let E=typeof x=="string"?x:"gantt-expanded-tasks";try{let I=localStorage.getItem(E);if(I){let G=JSON.parse(I);Array.isArray(G)&&(oa.current=new Map(G));}}catch(I){console.warn("[GanttBoard] Error loading expanded state from localStorage:",I);}}let wa=react.useCallback(()=>{let E=va();if(E)try{let I=Array.from(oa.current.entries());localStorage.setItem(E,JSON.stringify(I));}catch(I){console.warn("[GanttBoard] Error saving expanded state to localStorage:",I);}},[va]),br=react.useRef(0),yo=react.useRef(N);react.useEffect(()=>{yo.current=N;},[N]);let ao=react.useRef(false),ro=react.useCallback(E=>{re(E),br.current+=1,U(I=>{let G=(de,ye=0)=>de.map(Xe=>{let Je=E==="all"||ye<E-1;return Xe.subtasks?.length&&oa.current.set(Xe.id,Je),{...Xe,isExpanded:Je,subtasks:Xe.subtasks?G(Xe.subtasks,ye+1):void 0}}),Q=G(I);return wa(),Q});},[U,wa]);react.useEffect(()=>{if(br.current>0){br.current-=1;return}let E=G=>{let Q=new Map;for(let de of G){let ye=de.id;Q.get(ye)||Q.set(ye,de);}return Array.from(Q.values())},I=G=>G.map(Q=>{let de=oa.current.get(Q.id),ye=de!==void 0?{...Q,isExpanded:de}:Q;if(ye.subtasks?.length){let Xe=E(ye.subtasks);return {...ye,subtasks:I(Xe)}}return ye});if(oa.current.size>0)U(zr(I(t)));else {let G=Q=>Q.map(de=>de.subtasks?.length?{...de,subtasks:E(G(de.subtasks))}:de);U(zr(G(t)));}},[t,U]);let xo=react.useRef(t),P=react.useRef(true);react.useEffect(()=>{if(P.current){P.current=false,xo.current=N;return}if(ao.current){ao.current=false,xo.current=N;return}if(!r)return;let E=JSON.stringify(xo.current),I=JSON.stringify(N);E!==I&&(xo.current=N,r(N));},[N,r]);let te=react.useMemo(()=>Pd(w,D),[w,D]),he=react.useCallback(E=>[{id:"name",label:E.columns.taskName,width:400,minWidth:200,maxWidth:2e3,visible:true,sortable:true,resizable:true},{id:"startDate",label:E.columns.startDate,width:110,minWidth:80,maxWidth:200,visible:false,sortable:true,resizable:true},{id:"endDate",label:E.columns.endDate,width:110,minWidth:80,maxWidth:200,visible:false,sortable:true,resizable:true},{id:"duration",label:E.columns.duration,width:80,minWidth:60,maxWidth:150,visible:false,sortable:true,resizable:true},{id:"assignees",label:E.columns.assignees,width:120,minWidth:80,maxWidth:300,visible:false,sortable:false,resizable:true},{id:"status",label:E.columns.status,width:100,minWidth:70,maxWidth:180,visible:false,sortable:true,resizable:true},{id:"progress",label:E.columns.progress,width:120,minWidth:80,maxWidth:200,visible:false,sortable:true,resizable:true},{id:"priority",label:E.columns.priority,width:90,minWidth:70,maxWidth:150,visible:false,sortable:true,resizable:true}],[]),Se=react.useMemo(()=>b?typeof b=="string"?b:"gantt-columns-state":null,[b]),[Me,Qe]=react.useState(()=>{let E=he(te);if(!b)return E;try{let I=typeof b=="string"?b:"gantt-columns-state",G=localStorage.getItem(I);if(!G)return E;let Q=JSON.parse(G),de=new Map(Q.map(ye=>[ye.id,ye]));return E.map(ye=>{let Xe=de.get(ye.id);return Xe?{...ye,visible:Xe.visible??ye.visible,width:Xe.width??ye.width}:ye})}catch(I){return console.warn("[GanttBoard] Error loading columns state from localStorage:",I),E}}),fe=react.useRef(Se);react.useEffect(()=>{if(fe.current===Se)return;fe.current=Se;let E=he(te);if(!Se){Qe(E);return}try{let I=localStorage.getItem(Se);if(!I){Qe(E);return}let G=JSON.parse(I),Q=new Map(G.map(de=>[de.id,de]));Qe(E.map(de=>{let ye=Q.get(de.id);return ye?{...de,visible:ye.visible??de.visible,width:ye.width??de.width}:de}));}catch(I){console.warn("[GanttBoard] Error reloading columns state from localStorage:",I),Qe(E);}},[Se,he,te]),react.useEffect(()=>{if(Se&&fe.current===Se)try{let E=Me.map(I=>({id:I.id,visible:I.visible,width:I.width}));localStorage.setItem(Se,JSON.stringify(E));}catch(E){console.warn("[GanttBoard] Error saving columns state to localStorage:",E);}},[Me,Se]),react.useEffect(()=>{Qe(E=>E.map(I=>({...I,label:te.columns[I.id==="name"?"taskName":I.id]||I.label})));},[te]);let Ge=react.useMemo(()=>Me.filter(I=>I.visible).reduce((I,G)=>I+G.width,0),[Me]),nt=react.useRef(Me.filter(E=>E.visible).map(E=>E.id).join(","));react.useEffect(()=>{let E=Me.filter(Q=>Q.visible),I=E.map(Q=>Q.id).join(","),G=nt.current;if(I!==G){let Q=E.some(ye=>ye.id!=="name"),de=G.includes(",");Q?!de&&Q&<(null):lt(null),nt.current=I;}},[Me]);let vt=60,na=.6,jt=react.useMemo(()=>{let I=Ge+vt,G=typeof window<"u"?window.innerWidth*na:800,Q=Math.max(I,G);return kt!==null?Math.max(200,Math.min(kt,Q)):Math.max(200,I)},[kt,Ge]),Pt=react.useRef(null),Qa=react.useRef(null),ia=react.useRef(null),nr=react.useRef(null),ua=react.useRef(null),Dt=react.useMemo(()=>Qp(ot),[ot]),Vr=react.useMemo(()=>({theme:Dt,themeName:ot}),[Dt,ot]),Za=react.useMemo(()=>Bm(g),[g]),rs=react.useMemo(()=>{if(!f)return N;let E=Pe.calculateCriticalPathFull(N),I=G=>G.map(Q=>{let de=E.get(Q.id),ye=Q.subtasks?I(Q.subtasks):void 0,Xe=ye?.some(pa=>pa.isCriticalPath||pa.subtasks&&pa.subtasks.some(Jt=>Jt.isCriticalPath))||false,Je=de?de.isCritical:Xe;return {...Q,isCriticalPath:Je,cpmData:de||void 0,subtasks:ye}});return I(N)},[N,f]),Ys=react.useMemo(()=>Pe.flattenTasks(N).some(I=>I.dependencies&&I.dependencies.length>0),[N]),os=react.useMemo(()=>{let E=(I,G="")=>[...I].sort((de,ye)=>(de.position??0)-(ye.position??0)).map((de,ye)=>{let Xe=ye+1,Je=G?`${G}.${Xe}`:`${Xe}.0`,pa=G?`${G}.${Xe}`:`${Xe}`;return {...de,wbsCode:Je,subtasks:de.subtasks?.length?E(de.subtasks,pa):de.subtasks}});return E(rs)},[rs]),vo=react.useMemo(()=>{if(fa==="all"&&!H)return os;let E=I=>{let G=[];for(let Q of I){let de=Q.subtasks?.length?E(Q.subtasks):void 0,ye=false;if(H)ye=Q.progress<100;else switch(fa){case "all":ye=true;break;case "incomplete":ye=Q.progress<100;break;case "in_progress":ye=Q.progress>0&&Q.progress<100;break;case "completed":ye=Q.progress===100;break}(ye||de&&de.length>0)&&G.push({...Q,subtasks:de});}return G};return E(os)},[os,fa,H]),oo=s2(k);Im({undo:Ne,redo:q,canUndo:et,canRedo:Nt,enabled:true}),react.useImperativeHandle(n,()=>({getTask:E=>Pe.findTaskById(N,E),addTask:(E,I)=>{U(G=>{if(!I)return [...G,{...E,level:0}];let Q=de=>de.map(ye=>ye.id===I?{...ye,subtasks:[...ye.subtasks||[],{...E,parentId:I,level:(ye.level||0)+1}],isExpanded:true}:ye.subtasks?{...ye,subtasks:Q(ye.subtasks)}:ye);return Q(G)});},updateTask:(E,I)=>{U(G=>{let Q=de=>de.map(ye=>ye.id===E?{...ye,...I}:ye.subtasks?{...ye,subtasks:Q(ye.subtasks)}:ye);return Q(G)});},deleteTask:E=>{U(I=>{let G=Q=>Q.filter(de=>de.id===E?false:(de.subtasks&&(de.subtasks=G(de.subtasks)),true));return G(I)});},deleteTasks:E=>{U(I=>Hd(I,E));},duplicateTask:E=>{if(a.onTaskDuplicate){let I=Pe.findTaskById(N,E);I&&a.onTaskDuplicate(I);}else U(I=>Ds(I,[E]).tasks);},splitTask:(E,I,G=3)=>{U(Q=>Pe.splitTask(Q,E,I,G));},calculateEndDate:Pe.calculateEndDate,calculateDuration:Pe.calculateDuration,validateDependency:(E,I)=>!Pe.validateDependencies(N,E,I),getAllTasks:()=>Pe.flattenTasks(N),getTasksByStatus:E=>Pe.flattenTasks(N).filter(I=>I.status===E),getTasksByParent:E=>E?Pe.findTaskById(N,E)?.subtasks||[]:N.filter(G=>!G.parentId),getCriticalPath:()=>Pe.flattenTasks(N).filter(E=>E.isCriticalPath),indentTask:E=>{U(I=>zr(Rd(I,[E])));},outdentTask:E=>{U(I=>zr(Od(I,[E])));},moveTask:(E,I)=>{U(G=>$d(G,[E],I));},createSubtask:async E=>{let{tasks:I,newTask:G}=Wd(N,E);if(He){let Q=He({...G,parentId:E});if((Q instanceof Promise?await Q:Q)===false)return}U(zr(I)),rt&&rt({...G,parentId:E});},scrollToTask:E=>{let G=Pe.flattenTasks(N).findIndex(Q=>Q.id===E);if(G!==-1&&Pt.current){let Q=G*oo;Pt.current.scrollTo({top:Q,behavior:"smooth"}),ia.current&&ia.current.scrollTo({top:Q,behavior:"smooth"});}},highlightTask:(E,I=2e3)=>{},expandTask:E=>{U(I=>{let G=Q=>Q.map(de=>de.id===E?{...de,isExpanded:true}:de.subtasks?{...de,subtasks:G(de.subtasks)}:de);return G(I)});},collapseTask:E=>{U(I=>{let G=Q=>Q.map(de=>de.id===E?{...de,isExpanded:false}:de.subtasks?{...de,subtasks:G(de.subtasks)}:de);return G(I)});},expandAll:()=>{U(E=>{let I=G=>G.map(Q=>({...Q,isExpanded:true,subtasks:Q.subtasks?I(Q.subtasks):void 0}));return I(E)});},collapseAll:()=>{U(E=>{let I=G=>G.map(Q=>({...Q,isExpanded:false,subtasks:Q.subtasks?I(Q.subtasks):void 0}));return I(E)});},collapseToLevel:E=>{ro(E);},undo:Ne,redo:q,canUndo:()=>et,canRedo:()=>Nt,clearHistory:Ht,exportToPNG:async()=>{if(!nr.current||!Pt.current||!ia.current)throw new Error("Gantt container not found");let E=nr.current,I=Pt.current,G=Qa.current||I.querySelector(".gantt-grid-scroll"),Q=ia.current,de=G?.scrollTop||0,ye=Q.scrollTop,Xe=E.style.overflow,Je=E.style.height,pa=I.style.overflow;try{let Jt=G?.querySelector(".gantt-taskgrid-content"),ba=Q.querySelector("svg"),ur=Jt?.scrollHeight||G?.scrollHeight||600,Pr=ba?.getBoundingClientRect().height||Q.scrollHeight,en=(E.querySelector('[style*="z-index: 100"]')?.offsetHeight||48)+Math.max(ur,Pr)+20;G&&(G.scrollTop=0),Q.scrollTop=0,E.style.overflow="visible",E.style.height=`${en}px`,I.style.overflow="visible",await new Promise(Nn=>setTimeout(Nn,100));let no=await htmlToImage.toPng(E,{backgroundColor:Dt.bgPrimary,pixelRatio:2,filter:Nn=>{if(!(Nn instanceof Element))return !0;let Xs=window.getComputedStyle(Nn),ss=parseInt(Xs.zIndex,10);return (isNaN(ss)||ss<50)&&Xs.position!=="fixed"}});return await(await fetch(no)).blob()}finally{E.style.overflow=Xe,E.style.height=Je,I.style.overflow=pa,G&&(G.scrollTop=de),Q.scrollTop=ye;}},exportToPDF:async E=>{await Pe.exportToPDF(N,E);},exportToExcel:async E=>{await Pe.exportToExcel(N,E,kl.current);},exportToJSON:()=>Pe.exportToJSON(N),exportToCSV:()=>Pe.exportToCSV(N),importFromJSON:E=>{let I=Pe.importFromJSON(E);U(I);},getTasks:()=>N,refresh:()=>{U(E=>[...E]);},clearAll:()=>{U([]);},scrollToToday:()=>{let E=ia.current,I=ua.current;if(!E||!I)return;let Q=(new Date().getTime()-I.startDate.getTime())/(1e3*60*60*24),de=I.timeScale==="day"?60:I.timeScale==="week"?20:8,ye=Q*de*I.zoom,Xe=E.clientWidth,Je=Math.max(0,ye-Xe/2);E.scrollTo({left:Je,behavior:"smooth"});}}),[N,Ne,q,et,Nt,Ht,Dt,oo]);let yf=react.useCallback(E=>{Qe(I=>I.map(G=>G.id===E?{...G,visible:!G.visible}:G));},[]),xf=react.useCallback((E,I)=>{Qe(G=>G.map(Q=>{if(Q.id!==E)return Q;let de=Q.minWidth??100,ye=Q.maxWidth??800,Xe=Math.max(de,Math.min(ye,I));return {...Q,width:Xe}}));},[]),vf=react.useCallback(E=>{U(I=>{let G=Ud(I,E),Q=de=>{for(let ye of de){if(ye.id===E){oa.current.set(E,ye.isExpanded??true);return}ye.subtasks?.length&&Q(ye.subtasks);}};return Q(G),wa(),G}),a.onTaskToggleExpand?.(E);},[a,wa]),Fo=react.useCallback((E,I)=>{if(pe&&pe(E,I)===false)return;let Q=Pe.findTaskById(N,E)?.progress,de=Xe=>Xe.map(Je=>Je.id===E?{...Je,...I}:Je.subtasks?{...Je,subtasks:de(Je.subtasks)}:Je);U(Xe=>de(Xe));let ye=Pe.findTaskById(de(N),E);ye&&(X?.(ye),We?.(ye),I.progress!==void 0&&Q!==void 0&&I.progress!==Q&&Re?.(E,Q,I.progress));},[N,X,pe,We,Re]),wf=react.useCallback((E,I,G)=>{if(E.length===0)return;let Q=new Set(E),de=ye=>ye.map(Xe=>{let Je=Q.has(Xe.id)?{...Xe,[I]:G}:Xe;return Je.subtasks?{...Je,subtasks:de(Je.subtasks)}:Je});U(ye=>{let Xe=de(ye);return a.onBulkFill?.(E,I,G,Xe),Xe});},[a]),kf=react.useCallback(E=>{E.length!==0&&(br.current+=1,ao.current=true,U(I=>zr(Rd(I,E))),a.onTaskIndent?.(E[0]));},[a]),Cf=react.useCallback(E=>{E.length!==0&&(br.current+=1,ao.current=true,U(I=>zr(Od(I,E))),a.onTaskOutdent?.(E[0]));},[a]),Tf=react.useCallback((E,I,G)=>{br.current+=1,ao.current=true,U(Q=>zr(vm(Q,E,I,G))),a.onTaskReparent?.(E,I,G);},[a]),Nf=react.useCallback((E,I)=>{E.length!==0&&(br.current+=1,ao.current=true,U(G=>$d(G,E,I)),a.onTaskMove?.(E[0],I));},[a]),xl=react.useCallback(async E=>{let I=[];for(let G of E)je&&await Promise.resolve(je(G))===false||I.push(G);I.length!==0&&(a.onMultiTaskDelete?a.onMultiTaskDelete(I):(U(G=>zr(Hd(G,I))),I.forEach(G=>a.onTaskDelete?.(G))),Oe&&I.forEach(G=>Oe(G)));},[a,je,Oe]),Df=react.useCallback(E=>{a.onTaskDuplicate?E.forEach(I=>{let G=Pe.findTaskById(N,I);G&&a.onTaskDuplicate(G);}):U(I=>Ds(I,E).tasks);},[a,N]),Sf=react.useCallback((E,I)=>{U(G=>{let{tasks:Q,newTask:de}=xm(G,E,I);return He&&He(de)===false?G:(a.onTaskCreate?.(de.parentId,de.position||0),rt?.(de),Q)});},[a,He,rt]),Ef=react.useCallback((E,I)=>{U(G=>zd(G,E,I)),a.onTaskRename?.(E,I);},[a]),vl=react.useCallback(E=>{let{onTaskAddSubtask:I}=a;if(I){let G=Wn(N,E);if(G){I(G);return}}U(G=>{let{tasks:Q}=Wd(G,E);return a.onTaskCreate?.(E,0),Q});},[a,N]),Mf=react.useCallback((E,I)=>{let G=Math.max(0,Math.min(100,Math.round(I))),Q={progress:G};G===100?Q.status="completed":G>0?Q.status="in-progress":Q.status="todo",Fo(E.id,Q);},[Fo]),Pf=react.useCallback((E,I,G)=>{let Q=!E.startDate&&!E.endDate,de=E.startDate?Math.round((I.getTime()-E.startDate.getTime())/(1e3*60*60*24)):0,ye=Jt=>Jt.map(ba=>ba.id===E.id?{...ba,startDate:I,endDate:G,...E.segments&&{segments:E.segments}}:ba.subtasks?{...ba,subtasks:ye(ba.subtasks)}:ba),Xe=ye(N),Je=Xe;Xe=Pe.autoScheduleDependents(Xe,E.id,de),Xe=zr(Xe),U(Xe);let pa={...E,startDate:I,endDate:G};if(Q&&a?.onTaskDateChange?a.onTaskDateChange(E,I,G):X?.(pa),Ce&&de!==0){let Jt=Pe.flattenTasks(Je),ba=Pe.flattenTasks(Xe),ur=[];for(let Pr of ba){if(Pr.id===E.id)continue;let Ao=Jt.find(no=>no.id===Pr.id);if(!Ao)continue;let Tn=Pr.startDate?.getTime()!==Ao.startDate?.getTime(),en=Pr.endDate?.getTime()!==Ao.endDate?.getTime();(Tn||en)&&ur.push(Pr);}ur.length>0&&Ce(ur);}},[N,X,Ce,a]),Ff=react.useCallback((E,I)=>{B?.(E,I),J({isOpen:true,x:I.clientX,y:I.clientY,task:E});},[B]),Af=react.useCallback((E,I)=>{let G=Pe.splitTask(N,E.id,I);U(G),J({isOpen:false,x:0,y:0,task:null});},[N]),ou=react.useCallback(E=>{let I=Pe.findTaskById(N,E.id)||E;V?.(I),R||ue(I);},[N,V,R]),nu=react.useCallback((E,I,G)=>{let Q=new Map,de=Jt=>{Jt.forEach(ba=>{ba.dependencies&&Q.set(ba.id,ba.dependencies),ba.subtasks&&de(ba.subtasks);});};de(G);let ye=Q.get(I)||[];Q.set(I,[...ye,E]);let Xe=new Set,Je=new Set,pa=Jt=>{if(!Xe.has(Jt)){Xe.add(Jt),Je.add(Jt);let ba=Q.get(Jt)||[];for(let ur of ba){if(!Xe.has(ur)&&pa(ur))return true;if(Je.has(ur))return true}}return Je.delete(Jt),false};return pa(I)},[]),su=react.useCallback((E,I)=>{if(nu(E.id,I,yo.current)){console.warn("Cannot create dependency: would create a circular dependency"),alert(`Cannot create this dependency: it would create a circular dependency chain.
|
|
367
367
|
|
|
368
|
-
Task dependencies must flow in one direction only.`);return}let G=Q=>Q.map(de=>{if(de.id===I){let ye=de.dependencies||[];if(!ye.includes(E.id))return {...de,dependencies:[...ye,E.id]}}return de.subtasks?{...de,subtasks:G(de.subtasks)}:de});br.current+=1,U(Q=>G(Q)),De?.(E.id,I);},[De,nu]),iu=react.useCallback((E,I)=>{let G=Q=>Q.map(de=>{if(de.id===E&&de.dependencies){let ye=de.dependencies.filter(Xe=>Xe!==I);return {...de,dependencies:ye}}return de.subtasks?{...de,subtasks:G(de.subtasks)}:de});br.current+=1,U(Q=>G(Q)),Ee?.(E,I);},[Ee]),{startDate:wo,endDate:wl}=react.useMemo(()=>{let E=N.filter(ye=>ye.startDate&&ye.endDate);if(E.length===0){let ye=new Date,Xe=new Date(ye);Xe.setDate(Xe.getDate()-30);let Je=new Date(ye);return Je.setDate(Je.getDate()+60),{startDate:Xe,endDate:Je}}let I=E.flatMap(ye=>[ye.startDate,ye.endDate]).filter(ye=>ye!==void 0),G=new Date(Math.min(...I.map(ye=>ye.getTime()))),Q=new Date(Math.max(...I.map(ye=>ye.getTime()))),de=ge==="day"?7:ge==="week"?14:30;return G.setDate(G.getDate()-de),Q.setDate(Q.getDate()+de),{startDate:G,endDate:Q}},[N,ge]);react.useEffect(()=>{Ft.current?.(wo,wl);},[wo,wl]);let Lf=react.useCallback(async()=>{if(!nr.current||!Pt.current||!ia.current)return;await new Promise(en=>setTimeout(en,200));let E=nr.current,I=Pt.current,G=Qa.current||I.querySelector(".gantt-grid-scroll"),Q=ia.current,de=G?.scrollTop||0,ye=G?.scrollLeft||0,Xe=Q.scrollTop,Je=Q.scrollLeft,pa=E.style.overflow,Jt=E.style.height,ba=G?.style.overflow||"",ur=Q.style.overflow,Pr=I.style.overflow,Ao=E.style.width,Tn=Q.style.width;try{let en=G?.querySelector(".gantt-taskgrid-content"),no=Q.querySelector("svg"),Nl=no?.getAttribute("height")?parseInt(no.getAttribute("height"),10):no?.getBoundingClientRect().height||0,Nn=en?.scrollHeight||G?.scrollHeight||600,Xs=Math.max(Nl,Q.scrollHeight),ss=no?.getAttribute("width")?parseInt(no.getAttribute("width"),10):no?.getBoundingClientRect().width||Q.scrollWidth,Uf=E.querySelector('[style*="z-index: 100"]')?.offsetHeight||48,Dl=Math.max(Nn,Xs,Nl),uu=Uf+Dl+50,pu=(G?.offsetWidth||I.offsetWidth||300)+ss+10;G&&(G.scrollTop=0,G.scrollLeft=0),Q.scrollTop=0,Q.scrollLeft=0,E.style.overflow="visible",E.style.height=`${uu}px`,E.style.width=`${pu}px`,I.style.overflow="visible",G&&(G.style.overflow="visible",G.style.height=`${Dl+50}px`),Q.style.overflow="visible",Q.style.height=`${Dl+50}px`,Q.style.width=`${ss+10}px`,await new Promise(Js=>setTimeout(Js,150));let Wf=await htmlToImage.toPng(E,{backgroundColor:Dt.bgPrimary,pixelRatio:2,width:pu,height:uu,skipFonts:!1,filter:Js=>{if(!(Js instanceof Element))return !0;let mu=window.getComputedStyle(Js),gu=parseInt(mu.zIndex,10);return !(!isNaN(gu)&&gu>=50||mu.position==="fixed")}}),Sl=document.createElement("a");Sl.download=`gantt-chart-${new Date().toISOString().slice(0,10)}.png`,Sl.href=Wf,Sl.click();}finally{E.style.overflow=pa,E.style.height=Jt,E.style.width=Ao,I.style.overflow=Pr,G&&(G.style.overflow=ba,G.style.height="",G.scrollTop=de,G.scrollLeft=ye),Q.style.overflow=ur,Q.style.height="",Q.style.width=Tn,Q.scrollTop=Xe,Q.scrollLeft=Je;}u?.("png");},[Dt,u]),If=react.useCallback(async()=>{await Pe.exportToPDF(N),u?.("pdf");},[N,u]),kl=react.useRef({rateMap:a.rateMap,defaultRate:a.defaultRate,projectName:m});kl.current={rateMap:a.rateMap,defaultRate:a.defaultRate,projectName:m};let Bf=react.useCallback(async()=>{if(a.onExportExcel){await a.onExportExcel(),u?.("excel");return}let E=new Date,I=de=>String(de).padStart(2,"0"),G=`${E.getFullYear()}-${I(E.getMonth()+1)}-${I(E.getDate())}_${I(E.getHours())}${I(E.getMinutes())}`,Q=m?m.replace(/[^a-zA-Z0-9áéíóúñÁÉÍÓÚÑ _-]/g,""):"Project";await Pe.exportToExcel(N,`${Q}_${G}.xlsx`,kl.current),u?.("excel");},[N,m,u,a.onExportExcel]),Rf=react.useCallback(()=>{let E=Pe.exportToCSV(N),I=new Blob([E],{type:"text/csv;charset=utf-8;"}),G=document.createElement("a");G.href=URL.createObjectURL(I),G.download="gantt-chart.csv",G.click(),URL.revokeObjectURL(G.href),u?.("csv");},[N,u]),Of=react.useCallback(()=>{let E=Pe.exportToJSON(N),I=new Blob([E],{type:"application/json;charset=utf-8;"}),G=document.createElement("a");G.href=URL.createObjectURL(I),G.download="gantt-chart.json",G.click(),URL.revokeObjectURL(G.href),u?.("json");},[N,u]),$f=react.useCallback(()=>{Pe.exportToMSProject(N,"Gantt Project","project.xml"),u?.("msproject");},[N,u]),Hf=E=>{E.preventDefault(),At(true);},Cn=react.useRef(false),[Cl,lu]=react.useState(false),ns=react.useRef({x:0,y:0,scrollLeft:0,scrollTop:0});react.useEffect(()=>{let E=ia.current,I=Pt.current?.querySelector(".gantt-grid-scroll");if(!E||!I)return;let G=()=>{if(Cn.current)return;Cn.current=true;let Je=E.scrollTop;ee(Je),I.scrollTop=Je,requestAnimationFrame(()=>{Cn.current=false;});},Q=()=>{if(Cn.current)return;Cn.current=true;let Je=I.scrollTop;ee(Je),E.scrollTop=Je,requestAnimationFrame(()=>{Cn.current=false;});},de=Je=>{if(ke&&I){let Jt=I.parentElement?.getBoundingClientRect()?.left||0,ba=Je.clientX-Jt,ur=200,Pr=Ge+vt,Ao=window.innerWidth*na,Tn=Math.max(Pr,Ao);ba>=ur&&ba<=Tn&&it(ba);}if(Cl&&E){let pa=Je.clientX-ns.current.x,Jt=Je.clientY-ns.current.y;E.scrollLeft=ns.current.scrollLeft-pa,E.scrollTop=ns.current.scrollTop-Jt;}},ye=()=>{At(false),lu(false);},Xe=Je=>{if(Je.button!==0)return;let pa=Je.target;pa.closest("[data-task-bar]")||pa.closest("[data-dependency-line]")||pa.closest("button")||pa.closest('[role="button"]')||pa.tagName==="rect"&&pa.getAttribute("data-clickable")==="true"||(lu(true),ns.current={x:Je.clientX,y:Je.clientY,scrollLeft:E.scrollLeft,scrollTop:E.scrollTop},Je.preventDefault());};return E.addEventListener("scroll",G),I.addEventListener("scroll",Q),E.addEventListener("mousedown",Xe),document.addEventListener("mousemove",de),document.addEventListener("mouseup",ye),()=>{E.removeEventListener("scroll",G),I.removeEventListener("scroll",Q),E.removeEventListener("mousedown",Xe),document.removeEventListener("mousemove",de),document.removeEventListener("mouseup",ye);}},[ke,Cl,Ge]),ua.current={startDate:wo,timeScale:ge,zoom:Z};let Tl=a.onTodayVisibilityChange,du=react.useRef(null);react.useEffect(()=>{if(!Tl)return;let E=ia.current;if(!E)return;let I=ge==="day"?60:ge==="week"?20:8,G=()=>{let ye=(new Date().getTime()-wo.getTime())/(1e3*60*60*24)*I*Z,Xe=E.scrollLeft,Je=Xe+E.clientWidth,pa=ye>=Xe&&ye<=Je;du.current!==pa&&(du.current=pa,Tl(pa));};return G(),E.addEventListener("scroll",G,{passive:true}),window.addEventListener("resize",G),()=>{E.removeEventListener("scroll",G),window.removeEventListener("resize",G);}},[Tl,wo,ge,Z]);let cu=react.useRef(false),zf=react.useRef(null);return react.useLayoutEffect(()=>{if(cu.current||N.length===0||!ia.current)return;cu.current=true,zf.current=wo;let E=ia.current,I=new Date,G=ge==="day"?60:ge==="week"?20:8,Q=(I.getTime()-wo.getTime())/(1e3*60*60*24),de=E.clientWidth,Xe=Q*G*Z-de/2;Q>=0&&de>0&&(E.scrollLeft=Math.max(0,Xe));},[N.length,wo,ge,Z]),jsxRuntime.jsx($n.Provider,{value:te,children:jsxRuntime.jsx(Al.Provider,{value:Vr,children:jsxRuntime.jsxs("div",{ref:nr,className:"flex flex-col h-full w-full",style:{backgroundColor:Dt.bgPrimary,fontFamily:"Inter, sans-serif",minHeight:0,...Dt.dotGrid&&{backgroundImage:`radial-gradient(circle, ${Dt.dotGrid} 1px, transparent 1px)`,backgroundSize:"24px 24px"},...a.disableScrollSync&&{scrollBehavior:"auto",overflowAnchor:"none"}},children:[jsxRuntime.jsx("div",{style:{position:"relative",zIndex:100},children:jsxRuntime.jsx(Mi,{theme:Dt,timeScale:ge,onTimeScaleChange:ht,zoom:Z,onZoomChange:ve,currentTheme:ot,onThemeChange:Ve,rowDensity:k,onRowDensityChange:O,showThemeSelector:d,showCreateTaskButton:S&&tt?.canCreateTask!==false&&!tt?.canCreateSubtaskOnly,createTaskLabel:M,onCreateTask:T,taskFilter:fa,onTaskFilterChange:xa,hideCompleted:H,onHideCompletedChange:se,toolbarRightContent:C,wbsLevel:$,onWbsLevelChange:ro,maxWbsDepth:Va,viewMode:Fe,onViewModeChange:ze,projectForecast:L,onExportPNG:i?Lf:void 0,onExportPDF:i?If:void 0,onExportExcel:i?Bf:void 0,onExportCSV:i?Rf:void 0,onExportJSON:i?Of:void 0,onExportMSProject:i?$f:void 0,showCriticalPath:Ze,onShowCriticalPathChange:Gt,showDependencies:yt,onShowDependenciesChange:Mt,highlightWeekends:$t,onHighlightWeekendsChange:It,showBaseline:Le,onShowBaselineChange:E=>{E&&Fe!=="oracle"&&ze("oracle"),!E&&Fe==="oracle"&&ze("execution");},onCopySnapshotLink:wt,hasDependencies:Ys})}),jsxRuntime.jsxs("div",{ref:Pt,className:"flex-1 flex min-h-0",style:{position:"relative",zIndex:1,overflow:"clip",overflowClipMargin:"100px"},children:[jsxRuntime.jsx("div",{ref:Qa,className:"gantt-grid-scroll flex-shrink-0",style:{width:jt,overflowX:"auto",overflowY:"scroll",scrollbarWidth:"none",msOverflowStyle:"none"},children:jsxRuntime.jsx(Ai,{tasks:vo,theme:Dt,rowHeight:oo,availableUsers:p,templates:Za,showCriticalPath:Ze,onTaskClick:K,onTaskDblClick:ou,onTaskContextMenu:B,onTaskToggle:vf,scrollTop:Xt,columns:Me,onToggleColumn:yf,onColumnResize:xf,onTaskUpdate:Fo,onBulkFill:wf,onTaskIndent:kf,onTaskOutdent:Cf,onTaskMove:Nf,onMultiTaskDelete:xl,onTaskDuplicate:Df,onTaskCreate:Sf,onTaskRename:Ef,onCreateSubtask:vl,onOpenTaskModal:K?E=>K(E):void 0,onDeleteRequest:(E,I)=>ne({taskId:E,taskName:I}),onTaskReparent:Tf,scrollContainerRef:Qa})}),jsxRuntime.jsx("div",{className:"flex-shrink-0 cursor-col-resize hover:bg-[#00E5CC]/50 transition-colors h-full",style:{width:1,backgroundColor:Dt.border,zIndex:15},onMouseDown:Hf}),jsxRuntime.jsx("div",{ref:ia,className:"gantt-timeline-scroll flex-1",style:{minHeight:0,overflowX:"auto",overflowY:"auto",cursor:Cl?"grabbing":"grab",...a.disableScrollSync&&{scrollBehavior:"auto",overflowAnchor:"none"}},children:jsxRuntime.jsx(zi,{tasks:vo,theme:Dt,rowHeight:oo,timeScale:ge,startDate:wo,endDate:wl,zoom:Z,locale:w,templates:Za,dependencyLineStyle:a?.dependencyLineStyle,showTaskBarLabels:a?.showTaskBarLabels!==false,onTaskClick:K,onTaskDblClick:ou,onTaskContextMenu:Ff,onTaskDateChange:Pf,onTaskProgressDrag:Mf,onDependencyCreate:su,onDependencyDelete:iu,showBaseline:Le,showCriticalPath:Ze,showDependencies:yt,highlightWeekends:$t,canEditTask:tt?.canEditTask,workingDaysConfig:a?.workingDaysConfig})})]}),dt.task&&jsxRuntime.jsx(zn,{isOpen:dt.isOpen,x:dt.x,y:dt.y,theme:Dt,onClose:()=>J({isOpen:false,x:0,y:0,task:null}),items:(()=>{let E=dt.task;if(!E)return [];let I=Pe.findTaskById(N,E.id)||E,G=I.subtasks&&I.subtasks.length>0,Q=tt?.canCreateTask!==false,de=tt?.canDeleteTask!==false;if(G){let Jt=[],ba=tt?.canDuplicateTask!==false;return Q&&Jt.push({id:"addSubtask",label:te.contextMenu?.addSubtask||"Add Subtask",icon:ga.Add,onClick:()=>{ae?ae(I):vl(I.id);}}),ba&&Jt.push({id:"duplicate",label:te.contextMenu?.duplicateTask||"Duplicate Task",icon:ga.Duplicate,onClick:()=>{a.onTaskDuplicate?a.onTaskDuplicate(I):U(ur=>Ds(ur,[I.id]).tasks),J({isOpen:false,x:0,y:0,task:null});}}),de&&(Jt.length>0&&Jt.push({id:"separator-delete",label:"",separator:true,onClick:()=>{}}),Jt.push({id:"delete",label:te.contextMenu?.deleteTask||"Delete Task",icon:ga.Delete,onClick:()=>{ne({taskId:I.id,taskName:I.name});}})),Jt}let ye=tt?.canUpdateTask!==false,Xe=tt?.canDuplicateTask!==false,Je=[];return ye&&Je.push({id:"edit",label:te.contextMenu?.editTask||"Edit Task",icon:ga.Pencil,onClick:()=>{R?R(I):ue(I);}}),Q&&Je.push({id:"addSubtask",label:te.contextMenu?.addSubtask||"Add Subtask",icon:ga.Add,onClick:()=>{ae?ae(I):vl(I.id);}}),Je.length>0&&ye&&Je.push({id:"separator-status",label:"",separator:true,onClick:()=>{}}),ye&&(Je.push({id:"markIncomplete",label:te.contextMenu?.markIncomplete||"Mark Incomplete",icon:ga.MarkIncomplete,onClick:()=>{be?be(I):Fo(I.id,{status:"todo",progress:0});},disabled:I.status==="todo"}),Je.push({id:"setInProgress",label:te.contextMenu?.setInProgress||"Set In Progress",icon:ga.SetInProgress,onClick:()=>{Ie?Ie(I):Fo(I.id,{status:"in-progress"});},disabled:I.status==="in-progress"}),Je.push({id:"markComplete",label:te.contextMenu?.markComplete||"Mark Complete",icon:ga.MarkComplete,onClick:()=>{Fo(I.id,{status:"completed",progress:100});},disabled:I.status==="completed"})),(Xe||ye&&I.startDate&&I.endDate)&&Je.length>0&&Je.push({id:"separator-advanced",label:"",separator:true,onClick:()=>{}}),Xe&&Je.push({id:"duplicate",label:te.contextMenu?.duplicateTask||"Duplicate Task",icon:ga.Duplicate,onClick:()=>{a.onTaskDuplicate?a.onTaskDuplicate(I):U(Jt=>Ds(Jt,[I.id]).tasks),J({isOpen:false,x:0,y:0,task:null});}}),ye&&I.startDate&&I.endDate&&Je.push({id:"split",label:te.contextMenu?.splitTask||"Split Task",icon:ga.Split,onClick:()=>{let Jt=I.startDate.getTime(),ba=I.endDate.getTime(),ur=Jt+(ba-Jt)/2,Pr=new Date(ur);Af(I,Pr);}}),de&&(Je.length>0&&Je.push({id:"separator-delete",label:"",separator:true,onClick:()=>{}}),Je.push({id:"delete",label:te.contextMenu?.deleteTask||"Delete Task",icon:ga.Delete,onClick:()=>{ne({taskId:I.id,taskName:I.name});}})),Je})()}),jsxRuntime.jsx(To,{task:xe,isOpen:!!xe,onClose:()=>ue(null),onTaskUpdate:E=>{xe&&(Fo(xe.id,E),ue(null));},theme:ot==="light"?"light":"dark",locale:w==="es"?"es":"en",availableUsers:p,availableTasks:t}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:z&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[10000] flex items-center justify-center p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:()=>ne(null),children:jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},onClick:E=>E.stopPropagation(),className:"w-full max-w-md rounded-xl shadow-2xl overflow-hidden",style:{backgroundColor:Dt.bgSecondary,border:`1px solid ${Dt.border}`},children:[jsxRuntime.jsx("div",{className:"px-6 py-4",style:{borderBottom:`1px solid ${Dt.border}`},children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0",style:{backgroundColor:"rgba(239, 68, 68, 0.2)"},children:jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-5 h-5",style:{color:"#EF4444"}})}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("h3",{className:"text-lg font-semibold",style:{color:Dt.textPrimary,fontFamily:"Inter, sans-serif"},children:[te.contextMenu?.deleteTask||"Delete Task","?"]}),jsxRuntime.jsx("p",{className:"text-sm mt-1",style:{color:Dt.textSecondary,fontFamily:"Inter, sans-serif"},children:w==="es"?"Esta acci\xF3n no se puede deshacer":"This action cannot be undone"})]})]})}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsxs("p",{className:"text-sm leading-relaxed",style:{color:Dt.textSecondary,fontFamily:"Inter, sans-serif"},children:[w==="es"?"Est\xE1s a punto de eliminar la tarea":"You are about to delete the task"," ",jsxRuntime.jsxs("span",{className:"font-semibold",style:{color:Dt.textPrimary},children:['"',z.taskName,'"']}),"."]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 flex items-center justify-end gap-3",style:{backgroundColor:Dt.bgPrimary,borderTop:`1px solid ${Dt.border}`},children:[jsxRuntime.jsx("button",{onClick:()=>ne(null),className:"px-4 py-2 text-sm font-medium rounded-lg transition-colors",style:{color:Dt.textSecondary,fontFamily:"Inter, sans-serif"},onMouseEnter:E=>{E.currentTarget.style.backgroundColor=Dt.hoverBg;},onMouseLeave:E=>{E.currentTarget.style.backgroundColor="transparent";},children:w==="es"?"Cancelar":"Cancel"}),jsxRuntime.jsxs("button",{onClick:()=>{xl([z.taskId]),ne(null);},className:"px-4 py-2 text-sm font-medium text-white rounded-lg transition-colors flex items-center gap-2",style:{backgroundColor:"#EF4444",fontFamily:"Inter, sans-serif"},onMouseEnter:E=>{E.currentTarget.style.backgroundColor="#DC2626";},onMouseLeave:E=>{E.currentTarget.style.backgroundColor="#EF4444";},children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),w==="es"?"Eliminar":"Delete"]})]})]})})}),v?.enabled&&jsxRuntime.jsx(Vi,{tasks:N,theme:Dt,config:v,onTasksUpdate:U,onTaskUpdate:Fo,onTaskCreate:E=>{U(I=>[...I,E]);},onTaskDelete:E=>{xl([E]);},onDependencyCreate:(E,I)=>{let G=Pe.findTaskById(N,E);G&&su(G,I);},onDependencyDelete:iu})]})})})});function h2(e){if(e<60)return `${e}m`;let t=Math.floor(e/60),a=e%60;return a===0?`${t}h`:`${t}h ${a}m`}function y2(e){if(!e||e.trim()==="")return null;let t=e.trim().toLowerCase(),a=t.match(/(\d+)h\s*(\d+)m/);if(a&&a[1]&&a[2]){let l=parseInt(a[1],10),d=parseInt(a[2],10);return l*60+d}let r=t.match(/(\d+)h/);if(r&&r[1])return parseInt(r[1],10)*60;let n=t.match(/(\d+)m/);if(n&&n[1])return parseInt(n[1],10);let s=t.match(/(\d+)d/);if(s&&s[1])return parseInt(s[1],10)*480;let o=t.match(/^(\d+)$/);return o&&o[1]?parseInt(o[1],10)*60:null}var jd=[{id:"todo",title:"Por Hacer",color:"#6B7280"},{id:"in-progress",title:"En Progreso",color:"#F59E0B"},{id:"completed",title:"Completada",color:"#10B981"}],_d=[{id:"low",label:"Baja",color:"#10B981",icon:"\u{1F7E2}"},{id:"medium",label:"Media",color:"#F59E0B",icon:"\u{1F7E1}"},{id:"high",label:"Alta",color:"#F97316",icon:"\u{1F7E0}"},{id:"urgent",label:"Urgente",color:"#EF4444",icon:"\u{1F534}"}];function Um({isOpen:e,onClose:t,task:a,availableTasks:r=[],availableUsers:n=[],onSubmit:s,isLoading:o=false,mode:l=a?"edit":"create",theme:d="dark",customStatuses:i=[],availableTags:u=[],onCreateTag:m,attachments:p=[],onUploadAttachments:g,onDeleteAttachment:f,defaultStatus:x}){let y=[...jd,...i.filter(k=>!jd.some(O=>O.id===k.id))],b=gt[d]||gt.dark,[h,v]=react.useState(false),[w,D]=react.useState(false),[S,M]=react.useState(false),[T,F]=react.useState(false),[A,C]=react.useState({top:0,left:0}),[_,W]=react.useState(null),[oe,L]=react.useState(new Date),[Y,K]=react.useState({top:0,left:0}),[V,B]=react.useState(false),[X,Ce]=react.useState([]),[Re,R]=react.useState(false),[ae,be]=react.useState(""),Ie=react.useRef(null),De=react.useRef(null),Ee=react.useRef(null),He=react.useRef(null),rt=react.useRef(null),[pe,We]=react.useState({name:"",description:"",progress:0,status:"todo",priority:"medium",isMilestone:false,color:"#00E5CC",assignees:[],dependencies:[],tags:[],parentId:null,location:"",equipment:""}),[je,Oe]=react.useState({});react.useEffect(()=>{a?(We({name:a.name,description:a.description||"",startDate:a.startDate,endDate:a.endDate,progress:a.progress,status:a.status||"todo",priority:a.priority||"medium",isMilestone:a.isMilestone||false,color:a.color||"#00E5CC",assignees:a.assignees||[],dependencies:a.dependencies||[],tags:a.tags||[],parentId:a.parentId||null,location:a.location||"",equipment:a.equipment||""}),(a.dependencies&&a.dependencies.length>0||a.isMilestone)&&B(true)):(We({name:"",description:"",progress:0,status:x||"todo",priority:"medium",isMilestone:false,color:"#00E5CC",assignees:[],dependencies:[],pendingFiles:[],tags:[],parentId:null,location:"",equipment:""}),B(false),Ce([]));},[a,e,x]),react.useEffect(()=>{let k=O=>{Ie.current&&!Ie.current.contains(O.target)&&v(false),De.current&&!De.current.contains(O.target)&&D(false),Ee.current&&!Ee.current.contains(O.target)&&M(false),He.current&&!He.current.contains(O.target)&&F(false);};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]);let tt=()=>{let k={};return pe.name.trim()||(k.name="El nombre es requerido"),pe.startDate&&pe.endDate&&pe.startDate>pe.endDate&&(k.endDate="La fecha de fin debe ser posterior a la de inicio"),Oe(k),Object.keys(k).length===0},wt=async k=>{if(k.preventDefault(),!!tt())try{let O=l==="create"&&X.length>0?{...pe,pendingFiles:X}:pe;await s(O),Ce([]),t();}catch(O){console.error("Error submitting task:",O);}},pt=(k,O)=>{We(Z=>{let ve={...Z,[k]:O};if(k==="status"){let $=O;$==="todo"?ve.progress=0:$==="in-progress"?(Z.progress===0||Z.progress===100)&&(ve.progress=50):$==="completed"||$==="closed"?ve.progress=100:($==="in-review"||$==="review")&&(ve.progress=75);}if(k==="progress"){let $=typeof O=="number"?O:parseInt(O,10);$===100&&Z.status!=="completed"?ve.status="completed":$>0&&$<100&&Z.status==="todo"?ve.status="in-progress":$===0&&Z.status!=="todo"&&(ve.status="todo");}return ve}),je[k]&&Oe(Z=>{let ve={...Z};return delete ve[k],ve});},Ue=y.find(k=>k.id===pe.status)??jd[0],ot=_d.find(k=>k.id===pe.priority)??_d[1],Et=sn.find(k=>k.value===pe.color)??sn[0],ge=d==="dark",ht={backgroundColor:ge?"#1d1f27":b.bgSecondary,border:`1px solid ${ge?"rgba(65,71,84,0.1)":b.borderLight}`,color:b.textPrimary};return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999]",style:{backgroundColor:ge?"rgba(0, 0, 0, 0.85)":"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)"},onClick:t}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.15,ease:[.4,0,.2,1]},className:"fixed inset-0 z-[9999] flex items-center justify-center p-4 pointer-events-none",children:jsxRuntime.jsx("div",{className:"w-full max-w-[640px] rounded-xl pointer-events-auto flex flex-col","data-theme":d,style:{backgroundColor:ge?"#0a0a0a":b.bgPrimary,border:`1px solid ${ge?"rgba(65,71,84,0.1)":b.border}`,boxShadow:ge?"0 8px 48px rgba(0, 0, 0, 0.8)":"0 8px 32px rgba(0, 0, 0, 0.12)",maxHeight:"90vh"},onClick:k=>k.stopPropagation(),children:jsxRuntime.jsxs("form",{onSubmit:wt,className:"flex flex-col overflow-hidden flex-1",style:{fontFamily:"'Inter', system-ui, sans-serif"},children:[jsxRuntime.jsxs("header",{className:"px-8 pt-8 pb-4 space-y-4 flex-shrink-0",children:[jsxRuntime.jsx("input",{type:"text",value:pe.name,onChange:k=>pt("name",k.target.value),className:"w-full bg-transparent border-none p-0 focus:outline-none focus:ring-0",style:{color:b.textPrimary,fontSize:30,fontWeight:700,fontFamily:"'Inter', system-ui, sans-serif"},placeholder:"Nombre de la tarea",disabled:o,autoFocus:true}),je.name&&jsxRuntime.jsxs("p",{className:"text-xs text-red-400 flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-3 h-3"}),je.name]}),jsxRuntime.jsx("textarea",{value:pe.description||"",onChange:k=>pt("description",k.target.value),className:"w-full bg-transparent border-none p-0 focus:outline-none focus:ring-0 resize-none task-form-description",style:{color:b.textPrimary,fontSize:16,fontFamily:"'Inter', system-ui, sans-serif","--placeholder-color":b.textTertiary},placeholder:"Agregar descripci\xF3n...",rows:2,disabled:o})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto px-8 py-4 space-y-6",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[jsxRuntime.jsxs("div",{ref:Ie,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!o&&v(!h),className:"flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:{...ht,borderColor:Ue.color,backgroundColor:`${Ue.color}15`},disabled:o,children:[jsxRuntime.jsx(lucideReact.CircleDot,{className:"w-3.5 h-3.5",style:{color:Ue.color}}),jsxRuntime.jsx("span",{style:{color:Ue.color},children:Ue.title}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3",style:{color:Ue.color}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:h&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:"absolute left-0 top-full mt-1 z-50 min-w-[140px] rounded-lg overflow-hidden",style:{backgroundColor:ge?"#0a0a0a":b.bgPrimary,backdropFilter:ge?"blur(16px)":void 0,border:`1px solid ${ge?"#262626":b.border}`,boxShadow:ge?"0 8px 24px rgba(0, 0, 0, 0.5)":"0 8px 24px rgba(0, 0, 0, 0.12)"},children:y.map(k=>jsxRuntime.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",style:{color:b.textPrimary},onMouseEnter:O=>O.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:O=>O.currentTarget.style.backgroundColor="transparent",onClick:()=>{pt("status",k.id),v(false);},children:[jsxRuntime.jsx(lucideReact.CircleDot,{className:"w-3.5 h-3.5",style:{color:k.color}}),k.title,pe.status===k.id&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 ml-auto",style:{color:b.accent}})]},k.id))})})]}),jsxRuntime.jsxs("div",{ref:De,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!o&&D(!w),className:"flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:ht,disabled:o,children:[jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5",style:{color:ot.color}}),jsxRuntime.jsx("span",{children:ot.label}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3",style:{color:b.textTertiary}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:w&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:"absolute left-0 top-full mt-1 z-50 min-w-[130px] rounded-lg overflow-hidden",style:{backgroundColor:ge?"#0a0a0a":b.bgPrimary,backdropFilter:ge?"blur(16px)":void 0,border:`1px solid ${ge?"#262626":b.border}`,boxShadow:ge?"0 8px 24px rgba(0, 0, 0, 0.5)":"0 8px 24px rgba(0, 0, 0, 0.12)"},children:_d.map(k=>jsxRuntime.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",style:{color:b.textPrimary},onMouseEnter:O=>O.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:O=>O.currentTarget.style.backgroundColor="transparent",onClick:()=>{pt("priority",k.id),D(false);},children:[jsxRuntime.jsx("span",{children:k.icon}),k.label,pe.priority===k.id&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 ml-auto",style:{color:b.accent}})]},k.id))})})]}),n.length>0&&jsxRuntime.jsxs("div",{ref:Ee,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!o&&M(!S),className:"flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:ht,disabled:o,children:[pe.assignees&&pe.assignees.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"flex -space-x-1",children:pe.assignees.slice(0,3).map((k,O)=>jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] text-white font-medium border-2",style:{backgroundColor:k.color||b.accent,borderColor:b.bgSecondary},children:k.initials},O))}),pe.assignees.length>3&&jsxRuntime.jsxs("span",{style:{color:b.textTertiary},children:["+",pe.assignees.length-3]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Users,{className:"w-3.5 h-3.5",style:{color:b.textTertiary}}),jsxRuntime.jsx("span",{style:{color:b.textTertiary},children:"Asignar"})]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3",style:{color:b.textTertiary}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:S&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:"absolute left-0 top-full mt-1 z-50 min-w-[180px] max-h-[200px] overflow-y-auto rounded-lg",style:{backgroundColor:ge?"#0a0a0a":b.bgPrimary,backdropFilter:ge?"blur(16px)":void 0,border:`1px solid ${ge?"#262626":b.border}`,boxShadow:ge?"0 8px 24px rgba(0, 0, 0, 0.5)":"0 8px 24px rgba(0, 0, 0, 0.12)"},children:n.map(k=>{let O=pe.assignees?.some(Z=>Z.name===k.name);return jsxRuntime.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",style:{color:b.textPrimary},onMouseEnter:Z=>Z.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:Z=>Z.currentTarget.style.backgroundColor="transparent",onClick:()=>{let Z=O?(pe.assignees||[]).filter(ve=>ve.name!==k.name):[...pe.assignees||[],{name:k.name,avatar:k.avatar,initials:k.name.split(" ").map(ve=>ve[0]).join("").toUpperCase().slice(0,2),color:b.accent}];pt("assignees",Z);},children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs text-white font-medium flex-shrink-0",style:{backgroundColor:b.accent},children:k.name.charAt(0).toUpperCase()}),jsxRuntime.jsx("span",{className:"truncate flex-1 text-left",children:k.name}),jsxRuntime.jsx("div",{className:"w-4 flex-shrink-0 flex justify-end",children:O&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:b.accent}})})]},k.id)})})})]}),jsxRuntime.jsxs("div",{ref:He,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>{if(!o)if(T)F(false);else {if(He.current){let k=He.current.getBoundingClientRect(),O=window.innerHeight,Z=120,$=O-k.bottom<Z?k.top-Z-8:k.bottom+8;C({top:$,left:k.left});}F(true);}},className:"flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:ht,disabled:o,children:[jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full",style:{backgroundColor:pe.color}}),jsxRuntime.jsx("span",{children:Et.name}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3",style:{color:b.textTertiary}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:T&&jsxRuntime.jsxs(Qt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0",style:{zIndex:99998},onClick:()=>F(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.12},className:"rounded-lg",style:{position:"fixed",top:`${A.top}px`,left:`${A.left}px`,zIndex:99999,backgroundColor:ge?"#0a0a0a":b.bgPrimary,backdropFilter:ge?"blur(16px)":void 0,border:`1px solid ${ge?"#262626":b.border}`,boxShadow:ge?"0 8px 24px rgba(0, 0, 0, 0.5)":"0 4px 20px rgba(0, 0, 0, 0.25)"},onClick:k=>k.stopPropagation(),children:jsxRuntime.jsx("div",{style:{padding:"6px 8px"},children:jsxRuntime.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(6, 28px)",gap:"2px"},children:sn.slice(0,18).map(k=>{let O=pe.color===k.value;return jsxRuntime.jsx("button",{type:"button",onClick:Z=>{Z.preventDefault(),Z.stopPropagation(),pt("color",k.value),F(false);},style:{width:"28px",height:"28px",borderRadius:"6px",backgroundColor:"transparent",cursor:"pointer",border:"none",display:"flex",alignItems:"center",justifyContent:"center",padding:0},title:k.name,children:jsxRuntime.jsx("span",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:k.value,outline:O?`2px solid ${k.value}`:"none",outlineOffset:"2px",pointerEvents:"none",display:"block"}})},k.value)})})})})]})})]}),u.length>0||m?jsxRuntime.jsx(Ro,{selectedTags:pe.tags||[],availableTags:u,onChange:k=>pt("tags",k),onCreateTag:m,theme:b,disabled:o}):null]}),jsxRuntime.jsxs("section",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 items-end",children:[jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("label",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.1em",textTransform:"uppercase",color:b.textTertiary,display:"block"},children:"Rango de Fechas"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",style:{backgroundColor:ge?"#191b22":b.bgSecondary,borderRadius:8,border:`1px solid ${ge?"rgba(65,71,84,0.05)":b.borderLight}`,padding:"10px 16px"},children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-5 h-5",style:{color:"#00E5CC"}}),jsxRuntime.jsxs("div",{ref:rt,className:"flex items-center gap-2 flex-1 relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>{if(!o&&!pe.isMilestone)if(_==="start")W(null);else {if(rt.current){let k=rt.current.getBoundingClientRect();K({top:k.bottom+8,left:Math.max(16,k.left-40)});}W("start"),L(pe.startDate||new Date);}},className:"px-3 py-1.5 rounded-lg text-sm transition-colors",style:{...ht,opacity:pe.isMilestone?.5:1,cursor:pe.isMilestone?"not-allowed":"pointer"},disabled:o||pe.isMilestone,children:pe.startDate?pe.startDate.toLocaleDateString("es-ES",{day:"numeric",month:"short"}):"Inicio"}),jsxRuntime.jsx("span",{style:{color:b.textTertiary},children:"\u2192"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{if(!o&&!pe.isMilestone)if(_==="end")W(null);else {if(rt.current){let k=rt.current.getBoundingClientRect();K({top:k.bottom+8,left:Math.max(16,k.left-40)});}W("end"),L(pe.endDate||pe.startDate||new Date);}},className:"px-3 py-1.5 rounded-lg text-sm transition-colors",style:{...ht,opacity:pe.isMilestone?.5:1,cursor:pe.isMilestone?"not-allowed":"pointer"},disabled:o||pe.isMilestone,children:pe.endDate?pe.endDate.toLocaleDateString("es-ES",{day:"numeric",month:"short"}):"Fin"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:_&&jsxRuntime.jsxs(Qt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0",style:{zIndex:99998},onClick:()=>W(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"rounded-xl shadow-2xl overflow-hidden flex",style:{position:"fixed",top:`${Y.top}px`,left:`${Y.left}px`,zIndex:99999,backgroundColor:ge?"#0a0a0a":b.bgPrimary,border:`1px solid ${ge?"#262626":b.border}`,boxShadow:ge?"0 8px 32px rgba(0, 0, 0, 0.6)":"0 8px 24px rgba(0, 0, 0, 0.12)"},onClick:k=>k.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"w-40 py-2",style:{borderRight:`1px solid ${ge?"#262626":b.border}`},children:[(()=>{let k=new Date,O=new Date(k);O.setDate(k.getDate()+1);let Z=new Date(k);Z.setDate(k.getDate()+7);let ve=new Date(k);return ve.setDate(k.getDate()+14),[{label:"Hoy",date:k},{label:"Ma\xF1ana",date:O},{label:"Pr\xF3xima semana",date:Z},{label:"2 semanas",date:ve}].map((re,Ye)=>jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-2 text-sm text-left transition-colors",style:{color:b.textPrimary},onMouseEnter:Te=>Te.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:Te=>Te.currentTarget.style.backgroundColor="transparent",onClick:()=>{_==="start"?(pt("startDate",re.date),(!pe.endDate||re.date>pe.endDate)&&pt("endDate",re.date),W("end")):(pt("endDate",re.date),(!pe.startDate||re.date<pe.startDate)&&pt("startDate",re.date),W(null));},children:re.label},Ye))})(),jsxRuntime.jsx("div",{style:{borderTop:`1px solid ${b.border}`,margin:"0.5rem 0"}}),jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-2 text-sm text-left transition-colors",style:{color:"#EF4444"},onMouseEnter:k=>k.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:k=>k.currentTarget.style.backgroundColor="transparent",onClick:()=>{pt("startDate",void 0),pt("endDate",void 0),W(null);},children:"Borrar fechas"})]}),jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>L(new Date(oe.getFullYear(),oe.getMonth()-1)),className:"p-1 rounded",onMouseEnter:k=>k.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:k=>k.currentTarget.style.backgroundColor="transparent",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4",style:{color:b.textSecondary}})}),jsxRuntime.jsx("span",{className:"text-sm font-medium",style:{color:b.textPrimary,fontFamily:"JetBrains Mono, monospace"},children:oe.toLocaleDateString("es-ES",{month:"long",year:"numeric"})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>L(new Date(oe.getFullYear(),oe.getMonth()+1)),className:"p-1 rounded",onMouseEnter:k=>k.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:k=>k.currentTarget.style.backgroundColor="transparent",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4",style:{color:b.textSecondary}})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-1",children:["D","L","M","M","J","V","S"].map((k,O)=>jsxRuntime.jsx("div",{className:"w-7 h-7 flex items-center justify-center text-xs",style:{color:b.textTertiary},children:k},O))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:(()=>{let k=oe.getFullYear(),O=oe.getMonth(),Z=new Date(k,O,1).getDay(),ve=new Date(k,O+1,0).getDate(),$=new Date,re=[];for(let Te=Z-1;Te>=0;Te--)re.push({day:new Date(k,O,-Te).getDate(),date:new Date(k,O-1,new Date(k,O,-Te).getDate()),isCurrentMonth:false});for(let Te=1;Te<=ve;Te++)re.push({day:Te,date:new Date(k,O,Te),isCurrentMonth:true});let Ye=42-re.length;for(let Te=1;Te<=Ye;Te++)re.push({day:Te,date:new Date(k,O+1,Te),isCurrentMonth:false});return re.map((Te,Fe)=>{let ze=Te.date.toDateString()===$.toDateString(),Le=pe.startDate?.toDateString()===Te.date.toDateString(),Ze=pe.endDate?.toDateString()===Te.date.toDateString(),st=pe.startDate&&pe.endDate&&Te.date>=pe.startDate&&Te.date<=pe.endDate;return jsxRuntime.jsx("button",{type:"button",className:"w-7 h-7 rounded-full flex items-center justify-center text-xs transition-colors",style:{color:Te.isCurrentMonth?Le||Ze?"#FFF":b.textPrimary:b.textTertiary,backgroundColor:Le?b.accent:Ze?"#7C3AED":st?"rgba(124, 58, 237, 0.2)":"transparent",boxShadow:ze&&!Le&&!Ze?`inset 0 0 0 1px ${b.accent}`:"none"},onClick:()=>{_==="start"?(pt("startDate",Te.date),pe.endDate&&Te.date>pe.endDate&&pt("endDate",Te.date),W("end")):(pt("endDate",Te.date),pe.startDate&&Te.date<pe.startDate&&pt("startDate",Te.date),W(null));},children:Te.day},Fe)})})()})]})]})]})})]}),je.endDate&&jsxRuntime.jsx("span",{className:"text-xs text-red-400",children:je.endDate})]})]}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("label",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.1em",textTransform:"uppercase",color:b.textTertiary},children:"Progreso Inicial"}),jsxRuntime.jsxs("span",{style:{fontSize:10,fontWeight:700,color:"#00E5CC"},children:[pe.progress,"%"]})]}),jsxRuntime.jsx("div",{className:"h-2 w-full rounded-full overflow-hidden cursor-pointer",style:{backgroundColor:ge?"#33343c":"#E5E7EB"},onClick:k=>{if(o)return;let O=k.currentTarget.getBoundingClientRect(),Z=Math.round((k.clientX-O.left)/O.width*100/5)*5;pt("progress",Math.max(0,Math.min(100,Z)));},children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${pe.progress}%`,backgroundColor:"#00E5CC"}})})]})]}),jsxRuntime.jsxs("div",{style:{borderTop:`1px solid ${ge?"rgba(65,71,84,0.05)":b.borderLight}`,paddingTop:16},children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>B(!V),className:"flex items-center gap-2 w-full py-2 transition-colors",style:{color:b.textPrimary},children:[jsxRuntime.jsx(lucideReact.ChevronDown,{className:`w-4 h-4 transition-transform ${V?"":"-rotate-90"}`,style:{color:b.textTertiary}}),jsxRuntime.jsx("span",{style:{fontSize:16,fontWeight:700,fontFamily:"'Inter', system-ui, sans-serif"},children:"Opciones Avanzadas"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:V&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:jsxRuntime.jsxs("div",{className:"pt-3 space-y-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{color:b.textTertiary},children:[jsxRuntime.jsx("path",{d:"M12 6v6l4 2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"})]}),jsxRuntime.jsx("span",{className:"text-xs",style:{color:b.textTertiary},children:"Horas Estimadas"})]}),jsxRuntime.jsx("input",{type:"text",placeholder:"Ej: 8 (=8h), 2h 30m, 45m, 1d (1 d\xEDa = 8h)",value:pe.effortMinutes?h2(pe.effortMinutes):"",onChange:k=>{let O=y2(k.target.value);pt("effortMinutes",O);},className:"w-full px-3 py-2 rounded-lg text-sm transition-colors",style:{backgroundColor:b.bgSecondary,color:b.textPrimary,border:`1px solid ${b.borderLight}`}})]}),r.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{color:b.textTertiary},children:jsxRuntime.jsx("path",{d:"M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"})}),jsxRuntime.jsx("span",{className:"text-xs",style:{color:b.textTertiary},children:"Fase Padre"})]}),jsxRuntime.jsxs("select",{value:pe.parentId||"",onChange:k=>pt("parentId",k.target.value||null),className:"w-full px-3 py-2 rounded-lg text-sm transition-colors appearance-none cursor-pointer",style:{backgroundColor:b.bgSecondary,color:b.textPrimary,border:`1px solid ${b.borderLight}`},disabled:o,children:[jsxRuntime.jsx("option",{value:"",children:"\u2014 Sin fase padre (ra\xEDz) \u2014"}),r.filter(k=>k.id!==a?.id).map(k=>jsxRuntime.jsx("option",{value:k.id,children:k.name},k.id))]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[jsxRuntime.jsx("span",{style:{fontSize:14},children:"\u{1F4CD}"}),jsxRuntime.jsx("span",{className:"text-xs",style:{color:b.textTertiary},children:"Ubicaci\xF3n"})]}),jsxRuntime.jsx("input",{type:"text",placeholder:"Ej: Zona Norte, Piso 3",value:pe.location||"",onChange:k=>pt("location",k.target.value),className:"w-full px-3 py-2 rounded-lg text-sm transition-colors",style:{backgroundColor:b.bgSecondary,color:b.textPrimary,border:`1px solid ${b.borderLight}`},disabled:o})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[jsxRuntime.jsx("span",{style:{fontSize:14},children:"\u{1F527}"}),jsxRuntime.jsx("span",{className:"text-xs",style:{color:b.textTertiary},children:"Activo / Equipo"})]}),jsxRuntime.jsx("input",{type:"text",placeholder:"Ej: CMC-256",value:pe.equipment||"",onChange:k=>pt("equipment",k.target.value),className:"w-full px-3 py-2 rounded-lg text-sm transition-colors",style:{backgroundColor:b.bgSecondary,color:b.textPrimary,border:`1px solid ${b.borderLight}`},disabled:o})]})]}),(g||p.length>0||l==="create")&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{color:b.textTertiary},children:jsxRuntime.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})}),jsxRuntime.jsxs("span",{className:"text-xs",style:{color:b.textTertiary},children:["Adjuntos ",l==="create"?X.length>0&&`(${X.length})`:p.length>0&&`(${p.length})`]})]}),l==="create"?jsxRuntime.jsx(uo,{cardId:"pending",attachments:X.map((k,O)=>({id:`pending-${O}`,cardId:"pending",name:k.name,size:k.size,type:k.type,url:URL.createObjectURL(k),uploadedAt:new Date().toISOString(),uploadedBy:"current-user"})),onUpload:k=>Ce(O=>[...O,...k]),onDelete:k=>{let O=parseInt(k.replace("pending-",""),10);Ce(Z=>Z.filter((ve,$)=>$!==O));},maxSizeMB:10,maxFiles:20}):jsxRuntime.jsx(uo,{cardId:a?.id||"new",attachments:p,onUpload:g&&a?.id?k=>g(a.id,k):void 0,onDelete:f,maxSizeMB:10,maxFiles:20}),l==="create"&&X.length>0&&jsxRuntime.jsxs("p",{className:"text-xs mt-1",style:{color:b.textTertiary},children:[X.length," archivo(s) se subir\xE1n al crear la tarea"]})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-3 cursor-pointer p-2 rounded-lg transition-colors",onMouseEnter:k=>k.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:k=>k.currentTarget.style.backgroundColor="transparent",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:pe.isMilestone,onChange:k=>pt("isMilestone",k.target.checked),className:"w-4 h-4 rounded",style:{accentColor:b.accent},disabled:o}),jsxRuntime.jsx(lucideReact.Milestone,{className:"w-4 h-4 text-yellow-500"}),jsxRuntime.jsx("span",{className:"text-sm",style:{color:b.textPrimary},children:"Marcar como hito"})]}),r.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-xs mb-2",style:{color:b.textTertiary},children:[jsxRuntime.jsx(lucideReact.Link2,{className:"w-3.5 h-3.5"}),"Dependencias"]}),pe.dependencies&&pe.dependencies.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:pe.dependencies.map(k=>{let O=r.find(Z=>Z.id===k);return jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",style:{backgroundColor:`${b.accent}20`,color:b.accent},children:[O?.name||k.slice(0,8),jsxRuntime.jsx("button",{type:"button",onClick:()=>{let Z=(pe.dependencies||[]).filter(ve=>ve!==k);pt("dependencies",Z);},className:"ml-0.5 rounded-full p-0.5 transition-colors hover:bg-white/20",disabled:o,children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},k)})}),jsxRuntime.jsxs("button",{type:"button",onClick:()=>{R(!Re),be("");},className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-colors",style:{backgroundColor:b.bgSecondary,color:b.textSecondary},disabled:o,children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:"Agregar dependencia"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Re&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{R(false),be("");}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:"absolute left-0 top-full mt-1 z-50 rounded-lg overflow-hidden min-w-[280px] max-h-[280px]",style:{backgroundColor:ge?"#0a0a0a":b.bgPrimary,backdropFilter:ge?"blur(16px)":void 0,border:`1px solid ${ge?"#262626":b.border}`,boxShadow:ge?"0 8px 24px rgba(0, 0, 0, 0.5)":"0 8px 24px rgba(0, 0, 0, 0.12)"},children:[jsxRuntime.jsx("div",{className:"p-2",style:{borderBottom:`1px solid ${b.border}`},children:jsxRuntime.jsx("input",{type:"text",value:ae,onChange:k=>be(k.target.value),placeholder:"Buscar tarea...",className:"w-full px-3 py-2 rounded-md text-xs outline-none",style:{backgroundColor:b.bgSecondary,color:b.textPrimary},autoFocus:true})}),jsxRuntime.jsxs("div",{className:"max-h-[200px] overflow-y-auto",children:[r.filter(k=>k.id!==a?.id).filter(k=>ae===""||k.name.toLowerCase().includes(ae.toLowerCase())).map(k=>{let O=pe.dependencies?.includes(k.id);return jsxRuntime.jsxs("button",{type:"button",onClick:()=>{let Z=pe.dependencies||[],ve;O?ve=Z.filter($=>$!==k.id):ve=[...Z,k.id],pt("dependencies",ve);},className:"w-full flex items-center gap-3 px-3 py-2 text-xs transition-colors text-left",style:{backgroundColor:O?`${b.accent}10`:"transparent"},onMouseEnter:Z=>{O||(Z.currentTarget.style.backgroundColor=b.hoverBg);},onMouseLeave:Z=>{Z.currentTarget.style.backgroundColor=O?`${b.accent}10`:"transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0",style:{backgroundColor:O?b.accent:"transparent",borderColor:O?b.accent:b.borderLight},children:O&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:"block truncate",style:{color:b.textPrimary},children:k.name}),jsxRuntime.jsx("span",{className:"text-[10px]",style:{color:b.textTertiary},children:k.id.slice(0,8)})]})]},k.id)}),r.filter(k=>k.id!==a?.id).length===0&&jsxRuntime.jsx("div",{className:"px-3 py-4 text-xs text-center",style:{color:b.textTertiary},children:"No hay tareas disponibles"})]})]})]})})]})]})})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-6 px-8 py-5 flex-shrink-0",style:{borderTop:`1px solid ${ge?"rgba(65,71,84,0.1)":b.border}`,backgroundColor:ge?"rgba(25,27,34,0.2)":void 0},children:[jsxRuntime.jsx("button",{type:"button",onClick:t,className:"text-sm font-semibold transition-colors",style:{color:b.textTertiary},onMouseEnter:k=>k.currentTarget.style.color=b.textPrimary,onMouseLeave:k=>k.currentTarget.style.color=b.textTertiary,disabled:o,children:"Cancelar"}),jsxRuntime.jsx("button",{type:"submit",disabled:o,className:"px-8 py-3 font-bold rounded-lg transition-all flex items-center gap-2",style:{backgroundColor:"#00E5CC",color:"#FFF",fontSize:14,fontFamily:"'Inter', system-ui, sans-serif",boxShadow:"0 4px 20px rgba(0, 123, 255, 0.2)"},onMouseEnter:k=>!o&&(k.currentTarget.style.filter="brightness(1.1)"),onMouseLeave:k=>!o&&(k.currentTarget.style.filter="brightness(1)"),children:o?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Guardando..."]}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:l==="create"?"Crear Tarea":"Guardar"})})]})]})})})]})})}var Wm=`You are a Gantt chart AI assistant. You help users edit project tasks using natural language commands.
|
|
368
|
+
Task dependencies must flow in one direction only.`);return}let G=Q=>Q.map(de=>{if(de.id===I){let ye=de.dependencies||[];if(!ye.includes(E.id))return {...de,dependencies:[...ye,E.id]}}return de.subtasks?{...de,subtasks:G(de.subtasks)}:de});br.current+=1,U(Q=>G(Q)),De?.(E.id,I);},[De,nu]),iu=react.useCallback((E,I)=>{let G=Q=>Q.map(de=>{if(de.id===E&&de.dependencies){let ye=de.dependencies.filter(Xe=>Xe!==I);return {...de,dependencies:ye}}return de.subtasks?{...de,subtasks:G(de.subtasks)}:de});br.current+=1,U(Q=>G(Q)),Ee?.(E,I);},[Ee]),{startDate:wo,endDate:wl}=react.useMemo(()=>{let E=N.filter(ye=>ye.startDate&&ye.endDate);if(E.length===0){let ye=new Date,Xe=new Date(ye);Xe.setDate(Xe.getDate()-30);let Je=new Date(ye);return Je.setDate(Je.getDate()+60),{startDate:Xe,endDate:Je}}let I=E.flatMap(ye=>[ye.startDate,ye.endDate]).filter(ye=>ye!==void 0),G=new Date(Math.min(...I.map(ye=>ye.getTime()))),Q=new Date(Math.max(...I.map(ye=>ye.getTime()))),de=ge==="day"?7:ge==="week"?14:30;return G.setDate(G.getDate()-de),Q.setDate(Q.getDate()+de),{startDate:G,endDate:Q}},[N,ge]);react.useEffect(()=>{Ft.current?.(wo,wl);},[wo,wl]);let Lf=react.useCallback(async()=>{if(!nr.current||!Pt.current||!ia.current)return;await new Promise(en=>setTimeout(en,200));let E=nr.current,I=Pt.current,G=Qa.current||I.querySelector(".gantt-grid-scroll"),Q=ia.current,de=G?.scrollTop||0,ye=G?.scrollLeft||0,Xe=Q.scrollTop,Je=Q.scrollLeft,pa=E.style.overflow,Jt=E.style.height,ba=G?.style.overflow||"",ur=Q.style.overflow,Pr=I.style.overflow,Ao=E.style.width,Tn=Q.style.width;try{let en=G?.querySelector(".gantt-taskgrid-content"),no=Q.querySelector("svg"),Nl=no?.getAttribute("height")?parseInt(no.getAttribute("height"),10):no?.getBoundingClientRect().height||0,Nn=en?.scrollHeight||G?.scrollHeight||600,Xs=Math.max(Nl,Q.scrollHeight),ss=no?.getAttribute("width")?parseInt(no.getAttribute("width"),10):no?.getBoundingClientRect().width||Q.scrollWidth,Uf=E.querySelector('[style*="z-index: 100"]')?.offsetHeight||48,Dl=Math.max(Nn,Xs,Nl),uu=Uf+Dl+50,pu=(G?.offsetWidth||I.offsetWidth||300)+ss+10;G&&(G.scrollTop=0,G.scrollLeft=0),Q.scrollTop=0,Q.scrollLeft=0,E.style.overflow="visible",E.style.height=`${uu}px`,E.style.width=`${pu}px`,I.style.overflow="visible",G&&(G.style.overflow="visible",G.style.height=`${Dl+50}px`),Q.style.overflow="visible",Q.style.height=`${Dl+50}px`,Q.style.width=`${ss+10}px`,await new Promise(Js=>setTimeout(Js,150));let Wf=await htmlToImage.toPng(E,{backgroundColor:Dt.bgPrimary,pixelRatio:2,width:pu,height:uu,skipFonts:!1,filter:Js=>{if(!(Js instanceof Element))return !0;let mu=window.getComputedStyle(Js),gu=parseInt(mu.zIndex,10);return !(!isNaN(gu)&&gu>=50||mu.position==="fixed")}}),Sl=document.createElement("a");Sl.download=`gantt-chart-${new Date().toISOString().slice(0,10)}.png`,Sl.href=Wf,Sl.click();}finally{E.style.overflow=pa,E.style.height=Jt,E.style.width=Ao,I.style.overflow=Pr,G&&(G.style.overflow=ba,G.style.height="",G.scrollTop=de,G.scrollLeft=ye),Q.style.overflow=ur,Q.style.height="",Q.style.width=Tn,Q.scrollTop=Xe,Q.scrollLeft=Je;}u?.("png");},[Dt,u]),If=react.useCallback(async()=>{await Pe.exportToPDF(N),u?.("pdf");},[N,u]),kl=react.useRef({rateMap:a.rateMap,defaultRate:a.defaultRate,projectName:m});kl.current={rateMap:a.rateMap,defaultRate:a.defaultRate,projectName:m};let Bf=react.useCallback(async()=>{if(a.onExportExcel){await a.onExportExcel(),u?.("excel");return}let E=new Date,I=de=>String(de).padStart(2,"0"),G=`${E.getFullYear()}-${I(E.getMonth()+1)}-${I(E.getDate())}_${I(E.getHours())}${I(E.getMinutes())}`,Q=m?m.replace(/[^a-zA-Z0-9áéíóúñÁÉÍÓÚÑ _-]/g,""):"Project";await Pe.exportToExcel(N,`${Q}_${G}.xlsx`,kl.current),u?.("excel");},[N,m,u,a.onExportExcel]),Rf=react.useCallback(()=>{let E=Pe.exportToCSV(N),I=new Blob([E],{type:"text/csv;charset=utf-8;"}),G=document.createElement("a");G.href=URL.createObjectURL(I),G.download="gantt-chart.csv",G.click(),URL.revokeObjectURL(G.href),u?.("csv");},[N,u]),Of=react.useCallback(()=>{let E=Pe.exportToJSON(N),I=new Blob([E],{type:"application/json;charset=utf-8;"}),G=document.createElement("a");G.href=URL.createObjectURL(I),G.download="gantt-chart.json",G.click(),URL.revokeObjectURL(G.href),u?.("json");},[N,u]),$f=react.useCallback(()=>{Pe.exportToMSProject(N,"Gantt Project","project.xml"),u?.("msproject");},[N,u]),Hf=E=>{E.preventDefault(),At(true);},Cn=react.useRef(false),[Cl,lu]=react.useState(false),ns=react.useRef({x:0,y:0,scrollLeft:0,scrollTop:0});react.useEffect(()=>{let E=ia.current,I=Pt.current?.querySelector(".gantt-grid-scroll");if(!E||!I)return;let G=()=>{if(Cn.current)return;Cn.current=true;let Je=E.scrollTop;ee(Je),I.scrollTop=Je,requestAnimationFrame(()=>{Cn.current=false;});},Q=()=>{if(Cn.current)return;Cn.current=true;let Je=I.scrollTop;ee(Je),E.scrollTop=Je,requestAnimationFrame(()=>{Cn.current=false;});},de=Je=>{if(ke&&I){let Jt=I.parentElement?.getBoundingClientRect()?.left||0,ba=Je.clientX-Jt,ur=200,Pr=Ge+vt,Ao=window.innerWidth*na,Tn=Math.max(Pr,Ao);ba>=ur&&ba<=Tn&<(ba);}if(Cl&&E){let pa=Je.clientX-ns.current.x,Jt=Je.clientY-ns.current.y;E.scrollLeft=ns.current.scrollLeft-pa,E.scrollTop=ns.current.scrollTop-Jt;}},ye=()=>{At(false),lu(false);},Xe=Je=>{if(Je.button!==0)return;let pa=Je.target;pa.closest("[data-task-bar]")||pa.closest("[data-dependency-line]")||pa.closest("button")||pa.closest('[role="button"]')||pa.tagName==="rect"&&pa.getAttribute("data-clickable")==="true"||(lu(true),ns.current={x:Je.clientX,y:Je.clientY,scrollLeft:E.scrollLeft,scrollTop:E.scrollTop},Je.preventDefault());};return E.addEventListener("scroll",G),I.addEventListener("scroll",Q),E.addEventListener("mousedown",Xe),document.addEventListener("mousemove",de),document.addEventListener("mouseup",ye),()=>{E.removeEventListener("scroll",G),I.removeEventListener("scroll",Q),E.removeEventListener("mousedown",Xe),document.removeEventListener("mousemove",de),document.removeEventListener("mouseup",ye);}},[ke,Cl,Ge]),ua.current={startDate:wo,timeScale:ge,zoom:Z};let Tl=a.onTodayVisibilityChange,du=react.useRef(null);react.useEffect(()=>{if(!Tl)return;let E=ia.current;if(!E)return;let I=ge==="day"?60:ge==="week"?20:8,G=()=>{let ye=(new Date().getTime()-wo.getTime())/(1e3*60*60*24)*I*Z,Xe=E.scrollLeft,Je=Xe+E.clientWidth,pa=ye>=Xe&&ye<=Je;du.current!==pa&&(du.current=pa,Tl(pa));};return G(),E.addEventListener("scroll",G,{passive:true}),window.addEventListener("resize",G),()=>{E.removeEventListener("scroll",G),window.removeEventListener("resize",G);}},[Tl,wo,ge,Z]);let cu=react.useRef(false),zf=react.useRef(null);return react.useLayoutEffect(()=>{if(cu.current||N.length===0||!ia.current)return;cu.current=true,zf.current=wo;let E=ia.current,I=new Date,G=ge==="day"?60:ge==="week"?20:8,Q=(I.getTime()-wo.getTime())/(1e3*60*60*24),de=E.clientWidth,Xe=Q*G*Z-de/2;Q>=0&&de>0&&(E.scrollLeft=Math.max(0,Xe));},[N.length,wo,ge,Z]),jsxRuntime.jsx($n.Provider,{value:te,children:jsxRuntime.jsx(Al.Provider,{value:Vr,children:jsxRuntime.jsxs("div",{ref:nr,className:"flex flex-col h-full w-full",style:{backgroundColor:Dt.bgPrimary,fontFamily:"Inter, sans-serif",minHeight:0,...Dt.dotGrid&&{backgroundImage:`radial-gradient(circle, ${Dt.dotGrid} 1px, transparent 1px)`,backgroundSize:"24px 24px"},...a.disableScrollSync&&{scrollBehavior:"auto",overflowAnchor:"none"}},children:[jsxRuntime.jsx("div",{style:{position:"relative",zIndex:100},children:jsxRuntime.jsx(Mi,{theme:Dt,timeScale:ge,onTimeScaleChange:mt,zoom:Z,onZoomChange:ve,currentTheme:ot,onThemeChange:Ve,rowDensity:k,onRowDensityChange:O,showThemeSelector:d,showCreateTaskButton:S&&tt?.canCreateTask!==false&&!tt?.canCreateSubtaskOnly,createTaskLabel:M,onCreateTask:T,taskFilter:fa,onTaskFilterChange:xa,hideCompleted:H,onHideCompletedChange:se,toolbarRightContent:C,wbsLevel:$,onWbsLevelChange:ro,maxWbsDepth:Fa,viewMode:Fe,onViewModeChange:ze,projectForecast:L,onExportPNG:i?Lf:void 0,onExportPDF:i?If:void 0,onExportExcel:i?Bf:void 0,onExportCSV:i?Rf:void 0,onExportJSON:i?Of:void 0,onExportMSProject:i?$f:void 0,showCriticalPath:Ze,onShowCriticalPathChange:Gt,showDependencies:yt,onShowDependenciesChange:Mt,highlightWeekends:$t,onHighlightWeekendsChange:It,showBaseline:Le,onShowBaselineChange:E=>{E&&Fe!=="oracle"&&ze("oracle"),!E&&Fe==="oracle"&&ze("execution");},onCopySnapshotLink:wt,hasDependencies:Ys})}),jsxRuntime.jsxs("div",{ref:Pt,className:"flex-1 flex min-h-0",style:{position:"relative",zIndex:1,overflow:"clip",overflowClipMargin:"100px"},children:[jsxRuntime.jsx("div",{ref:Qa,className:"gantt-grid-scroll flex-shrink-0",style:{width:jt,overflowX:"auto",overflowY:"scroll",scrollbarWidth:"none",msOverflowStyle:"none"},children:jsxRuntime.jsx(Ai,{tasks:vo,theme:Dt,rowHeight:oo,availableUsers:p,templates:Za,showCriticalPath:Ze,onTaskClick:K,onTaskDblClick:ou,onTaskContextMenu:B,onTaskToggle:vf,scrollTop:Xt,columns:Me,onToggleColumn:yf,onColumnResize:xf,onTaskUpdate:Fo,onBulkFill:wf,onTaskIndent:kf,onTaskOutdent:Cf,onTaskMove:Nf,onMultiTaskDelete:xl,onTaskDuplicate:Df,onTaskCreate:Sf,onTaskRename:Ef,onCreateSubtask:vl,onOpenTaskModal:K?E=>K(E):void 0,onDeleteRequest:(E,I)=>ne({taskId:E,taskName:I}),onTaskReparent:Tf,scrollContainerRef:Qa})}),jsxRuntime.jsx("div",{className:"flex-shrink-0 cursor-col-resize hover:bg-[#00E5CC]/50 transition-colors h-full",style:{width:1,backgroundColor:Dt.border,zIndex:15},onMouseDown:Hf}),jsxRuntime.jsx("div",{ref:ia,className:"gantt-timeline-scroll flex-1",style:{minHeight:0,overflowX:"auto",overflowY:"auto",cursor:Cl?"grabbing":"grab",...a.disableScrollSync&&{scrollBehavior:"auto",overflowAnchor:"none"}},children:jsxRuntime.jsx(zi,{tasks:vo,theme:Dt,rowHeight:oo,timeScale:ge,startDate:wo,endDate:wl,zoom:Z,locale:w,templates:Za,dependencyLineStyle:a?.dependencyLineStyle,showTaskBarLabels:a?.showTaskBarLabels!==false,onTaskClick:K,onTaskDblClick:ou,onTaskContextMenu:Ff,onTaskDateChange:Pf,onTaskProgressDrag:Mf,onDependencyCreate:su,onDependencyDelete:iu,showBaseline:Le,showCriticalPath:Ze,showDependencies:yt,highlightWeekends:$t,canEditTask:tt?.canEditTask,workingDaysConfig:a?.workingDaysConfig})})]}),dt.task&&jsxRuntime.jsx(zn,{isOpen:dt.isOpen,x:dt.x,y:dt.y,theme:Dt,onClose:()=>J({isOpen:false,x:0,y:0,task:null}),items:(()=>{let E=dt.task;if(!E)return [];let I=Pe.findTaskById(N,E.id)||E,G=I.subtasks&&I.subtasks.length>0,Q=tt?.canCreateTask!==false,de=tt?.canDeleteTask!==false;if(G){let Jt=[],ba=tt?.canDuplicateTask!==false;return Q&&Jt.push({id:"addSubtask",label:te.contextMenu?.addSubtask||"Add Subtask",icon:ga.Add,onClick:()=>{ae?ae(I):vl(I.id);}}),ba&&Jt.push({id:"duplicate",label:te.contextMenu?.duplicateTask||"Duplicate Task",icon:ga.Duplicate,onClick:()=>{a.onTaskDuplicate?a.onTaskDuplicate(I):U(ur=>Ds(ur,[I.id]).tasks),J({isOpen:false,x:0,y:0,task:null});}}),de&&(Jt.length>0&&Jt.push({id:"separator-delete",label:"",separator:true,onClick:()=>{}}),Jt.push({id:"delete",label:te.contextMenu?.deleteTask||"Delete Task",icon:ga.Delete,onClick:()=>{ne({taskId:I.id,taskName:I.name});}})),Jt}let ye=tt?.canUpdateTask!==false,Xe=tt?.canDuplicateTask!==false,Je=[];return ye&&Je.push({id:"edit",label:te.contextMenu?.editTask||"Edit Task",icon:ga.Pencil,onClick:()=>{R?R(I):ue(I);}}),Q&&Je.push({id:"addSubtask",label:te.contextMenu?.addSubtask||"Add Subtask",icon:ga.Add,onClick:()=>{ae?ae(I):vl(I.id);}}),Je.length>0&&ye&&Je.push({id:"separator-status",label:"",separator:true,onClick:()=>{}}),ye&&(Je.push({id:"markIncomplete",label:te.contextMenu?.markIncomplete||"Mark Incomplete",icon:ga.MarkIncomplete,onClick:()=>{be?be(I):Fo(I.id,{status:"todo",progress:0});},disabled:I.status==="todo"}),Je.push({id:"setInProgress",label:te.contextMenu?.setInProgress||"Set In Progress",icon:ga.SetInProgress,onClick:()=>{Ie?Ie(I):Fo(I.id,{status:"in-progress"});},disabled:I.status==="in-progress"}),Je.push({id:"markComplete",label:te.contextMenu?.markComplete||"Mark Complete",icon:ga.MarkComplete,onClick:()=>{Fo(I.id,{status:"completed",progress:100});},disabled:I.status==="completed"})),(Xe||ye&&I.startDate&&I.endDate)&&Je.length>0&&Je.push({id:"separator-advanced",label:"",separator:true,onClick:()=>{}}),Xe&&Je.push({id:"duplicate",label:te.contextMenu?.duplicateTask||"Duplicate Task",icon:ga.Duplicate,onClick:()=>{a.onTaskDuplicate?a.onTaskDuplicate(I):U(Jt=>Ds(Jt,[I.id]).tasks),J({isOpen:false,x:0,y:0,task:null});}}),ye&&I.startDate&&I.endDate&&Je.push({id:"split",label:te.contextMenu?.splitTask||"Split Task",icon:ga.Split,onClick:()=>{let Jt=I.startDate.getTime(),ba=I.endDate.getTime(),ur=Jt+(ba-Jt)/2,Pr=new Date(ur);Af(I,Pr);}}),de&&(Je.length>0&&Je.push({id:"separator-delete",label:"",separator:true,onClick:()=>{}}),Je.push({id:"delete",label:te.contextMenu?.deleteTask||"Delete Task",icon:ga.Delete,onClick:()=>{ne({taskId:I.id,taskName:I.name});}})),Je})()}),jsxRuntime.jsx(To,{task:xe,isOpen:!!xe,onClose:()=>ue(null),onTaskUpdate:E=>{xe&&(Fo(xe.id,E),ue(null));},theme:ot==="light"?"light":"dark",locale:w==="es"?"es":"en",availableUsers:p,availableTasks:t}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:z&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[10000] flex items-center justify-center p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:()=>ne(null),children:jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},onClick:E=>E.stopPropagation(),className:"w-full max-w-md rounded-xl shadow-2xl overflow-hidden",style:{backgroundColor:Dt.bgSecondary,border:`1px solid ${Dt.border}`},children:[jsxRuntime.jsx("div",{className:"px-6 py-4",style:{borderBottom:`1px solid ${Dt.border}`},children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0",style:{backgroundColor:"rgba(239, 68, 68, 0.2)"},children:jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-5 h-5",style:{color:"#EF4444"}})}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("h3",{className:"text-lg font-semibold",style:{color:Dt.textPrimary,fontFamily:"Inter, sans-serif"},children:[te.contextMenu?.deleteTask||"Delete Task","?"]}),jsxRuntime.jsx("p",{className:"text-sm mt-1",style:{color:Dt.textSecondary,fontFamily:"Inter, sans-serif"},children:w==="es"?"Esta acci\xF3n no se puede deshacer":"This action cannot be undone"})]})]})}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsxs("p",{className:"text-sm leading-relaxed",style:{color:Dt.textSecondary,fontFamily:"Inter, sans-serif"},children:[w==="es"?"Est\xE1s a punto de eliminar la tarea":"You are about to delete the task"," ",jsxRuntime.jsxs("span",{className:"font-semibold",style:{color:Dt.textPrimary},children:['"',z.taskName,'"']}),"."]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 flex items-center justify-end gap-3",style:{backgroundColor:Dt.bgPrimary,borderTop:`1px solid ${Dt.border}`},children:[jsxRuntime.jsx("button",{onClick:()=>ne(null),className:"px-4 py-2 text-sm font-medium rounded-lg transition-colors",style:{color:Dt.textSecondary,fontFamily:"Inter, sans-serif"},onMouseEnter:E=>{E.currentTarget.style.backgroundColor=Dt.hoverBg;},onMouseLeave:E=>{E.currentTarget.style.backgroundColor="transparent";},children:w==="es"?"Cancelar":"Cancel"}),jsxRuntime.jsxs("button",{onClick:()=>{xl([z.taskId]),ne(null);},className:"px-4 py-2 text-sm font-medium text-white rounded-lg transition-colors flex items-center gap-2",style:{backgroundColor:"#EF4444",fontFamily:"Inter, sans-serif"},onMouseEnter:E=>{E.currentTarget.style.backgroundColor="#DC2626";},onMouseLeave:E=>{E.currentTarget.style.backgroundColor="#EF4444";},children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),w==="es"?"Eliminar":"Delete"]})]})]})})}),v?.enabled&&jsxRuntime.jsx(Vi,{tasks:N,theme:Dt,config:v,onTasksUpdate:U,onTaskUpdate:Fo,onTaskCreate:E=>{U(I=>[...I,E]);},onTaskDelete:E=>{xl([E]);},onDependencyCreate:(E,I)=>{let G=Pe.findTaskById(N,E);G&&su(G,I);},onDependencyDelete:iu})]})})})});function h2(e){if(e<60)return `${e}m`;let t=Math.floor(e/60),a=e%60;return a===0?`${t}h`:`${t}h ${a}m`}function y2(e){if(!e||e.trim()==="")return null;let t=e.trim().toLowerCase(),a=t.match(/(\d+)h\s*(\d+)m/);if(a&&a[1]&&a[2]){let l=parseInt(a[1],10),d=parseInt(a[2],10);return l*60+d}let r=t.match(/(\d+)h/);if(r&&r[1])return parseInt(r[1],10)*60;let n=t.match(/(\d+)m/);if(n&&n[1])return parseInt(n[1],10);let s=t.match(/(\d+)d/);if(s&&s[1])return parseInt(s[1],10)*480;let o=t.match(/^(\d+)$/);return o&&o[1]?parseInt(o[1],10)*60:null}var jd=[{id:"todo",title:"Por Hacer",color:"#6B7280"},{id:"in-progress",title:"En Progreso",color:"#F59E0B"},{id:"completed",title:"Completada",color:"#10B981"}],_d=[{id:"low",label:"Baja",color:"#10B981",icon:"\u{1F7E2}"},{id:"medium",label:"Media",color:"#F59E0B",icon:"\u{1F7E1}"},{id:"high",label:"Alta",color:"#F97316",icon:"\u{1F7E0}"},{id:"urgent",label:"Urgente",color:"#EF4444",icon:"\u{1F534}"}];function Um({isOpen:e,onClose:t,task:a,availableTasks:r=[],availableUsers:n=[],onSubmit:s,isLoading:o=false,mode:l=a?"edit":"create",theme:d="dark",customStatuses:i=[],availableTags:u=[],onCreateTag:m,attachments:p=[],onUploadAttachments:g,onDeleteAttachment:f,defaultStatus:x}){let y=[...jd,...i.filter(k=>!jd.some(O=>O.id===k.id))],b=ft[d]||ft.dark,[h,v]=react.useState(false),[w,D]=react.useState(false),[S,M]=react.useState(false),[T,F]=react.useState(false),[A,C]=react.useState({top:0,left:0}),[_,W]=react.useState(null),[oe,L]=react.useState(new Date),[Y,K]=react.useState({top:0,left:0}),[V,B]=react.useState(false),[X,Ce]=react.useState([]),[Re,R]=react.useState(false),[ae,be]=react.useState(""),Ie=react.useRef(null),De=react.useRef(null),Ee=react.useRef(null),He=react.useRef(null),rt=react.useRef(null),[pe,We]=react.useState({name:"",description:"",progress:0,status:"todo",priority:"medium",isMilestone:false,color:"#00E5CC",assignees:[],dependencies:[],tags:[],parentId:null,location:"",equipment:""}),[je,Oe]=react.useState({});react.useEffect(()=>{a?(We({name:a.name,description:a.description||"",startDate:a.startDate,endDate:a.endDate,progress:a.progress,status:a.status||"todo",priority:a.priority||"medium",isMilestone:a.isMilestone||false,color:a.color||"#00E5CC",assignees:a.assignees||[],dependencies:a.dependencies||[],tags:a.tags||[],parentId:a.parentId||null,location:a.location||"",equipment:a.equipment||""}),(a.dependencies&&a.dependencies.length>0||a.isMilestone)&&B(true)):(We({name:"",description:"",progress:0,status:x||"todo",priority:"medium",isMilestone:false,color:"#00E5CC",assignees:[],dependencies:[],pendingFiles:[],tags:[],parentId:null,location:"",equipment:""}),B(false),Ce([]));},[a,e,x]),react.useEffect(()=>{let k=O=>{Ie.current&&!Ie.current.contains(O.target)&&v(false),De.current&&!De.current.contains(O.target)&&D(false),Ee.current&&!Ee.current.contains(O.target)&&M(false),He.current&&!He.current.contains(O.target)&&F(false);};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]);let tt=()=>{let k={};return pe.name.trim()||(k.name="El nombre es requerido"),pe.startDate&&pe.endDate&&pe.startDate>pe.endDate&&(k.endDate="La fecha de fin debe ser posterior a la de inicio"),Oe(k),Object.keys(k).length===0},wt=async k=>{if(k.preventDefault(),!!tt())try{let O=l==="create"&&X.length>0?{...pe,pendingFiles:X}:pe;await s(O),Ce([]),t();}catch(O){console.error("Error submitting task:",O);}},pt=(k,O)=>{We(Z=>{let ve={...Z,[k]:O};if(k==="status"){let $=O;$==="todo"?ve.progress=0:$==="in-progress"?(Z.progress===0||Z.progress===100)&&(ve.progress=50):$==="completed"||$==="closed"?ve.progress=100:($==="in-review"||$==="review")&&(ve.progress=75);}if(k==="progress"){let $=typeof O=="number"?O:parseInt(O,10);$===100&&Z.status!=="completed"?ve.status="completed":$>0&&$<100&&Z.status==="todo"?ve.status="in-progress":$===0&&Z.status!=="todo"&&(ve.status="todo");}return ve}),je[k]&&Oe(Z=>{let ve={...Z};return delete ve[k],ve});},Ue=y.find(k=>k.id===pe.status)??jd[0],ot=_d.find(k=>k.id===pe.priority)??_d[1],Et=sn.find(k=>k.value===pe.color)??sn[0],ge=d==="dark",mt={backgroundColor:ge?"#1d1f27":b.bgSecondary,border:`1px solid ${ge?"rgba(65,71,84,0.1)":b.borderLight}`,color:b.textPrimary};return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999]",style:{backgroundColor:ge?"rgba(0, 0, 0, 0.85)":"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)"},onClick:t}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.15,ease:[.4,0,.2,1]},className:"fixed inset-0 z-[9999] flex items-center justify-center p-4 pointer-events-none",children:jsxRuntime.jsx("div",{className:"w-full max-w-[640px] rounded-xl pointer-events-auto flex flex-col","data-theme":d,style:{backgroundColor:ge?"#0a0a0a":b.bgPrimary,border:`1px solid ${ge?"rgba(65,71,84,0.1)":b.border}`,boxShadow:ge?"0 8px 48px rgba(0, 0, 0, 0.8)":"0 8px 32px rgba(0, 0, 0, 0.12)",maxHeight:"90vh"},onClick:k=>k.stopPropagation(),children:jsxRuntime.jsxs("form",{onSubmit:wt,className:"flex flex-col overflow-hidden flex-1",style:{fontFamily:"'Inter', system-ui, sans-serif"},children:[jsxRuntime.jsxs("header",{className:"px-8 pt-8 pb-4 space-y-4 flex-shrink-0",children:[jsxRuntime.jsx("input",{type:"text",value:pe.name,onChange:k=>pt("name",k.target.value),className:"w-full bg-transparent border-none p-0 focus:outline-none focus:ring-0",style:{color:b.textPrimary,fontSize:30,fontWeight:700,fontFamily:"'Inter', system-ui, sans-serif"},placeholder:"Nombre de la tarea",disabled:o,autoFocus:true}),je.name&&jsxRuntime.jsxs("p",{className:"text-xs text-red-400 flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-3 h-3"}),je.name]}),jsxRuntime.jsx("textarea",{value:pe.description||"",onChange:k=>pt("description",k.target.value),className:"w-full bg-transparent border-none p-0 focus:outline-none focus:ring-0 resize-none task-form-description",style:{color:b.textPrimary,fontSize:16,fontFamily:"'Inter', system-ui, sans-serif","--placeholder-color":b.textTertiary},placeholder:"Agregar descripci\xF3n...",rows:2,disabled:o})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto px-8 py-4 space-y-6",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[jsxRuntime.jsxs("div",{ref:Ie,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!o&&v(!h),className:"flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:{...mt,borderColor:Ue.color,backgroundColor:`${Ue.color}15`},disabled:o,children:[jsxRuntime.jsx(lucideReact.CircleDot,{className:"w-3.5 h-3.5",style:{color:Ue.color}}),jsxRuntime.jsx("span",{style:{color:Ue.color},children:Ue.title}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3",style:{color:Ue.color}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:h&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:"absolute left-0 top-full mt-1 z-50 min-w-[140px] rounded-lg overflow-hidden",style:{backgroundColor:ge?"#0a0a0a":b.bgPrimary,backdropFilter:ge?"blur(16px)":void 0,border:`1px solid ${ge?"#262626":b.border}`,boxShadow:ge?"0 8px 24px rgba(0, 0, 0, 0.5)":"0 8px 24px rgba(0, 0, 0, 0.12)"},children:y.map(k=>jsxRuntime.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",style:{color:b.textPrimary},onMouseEnter:O=>O.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:O=>O.currentTarget.style.backgroundColor="transparent",onClick:()=>{pt("status",k.id),v(false);},children:[jsxRuntime.jsx(lucideReact.CircleDot,{className:"w-3.5 h-3.5",style:{color:k.color}}),k.title,pe.status===k.id&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 ml-auto",style:{color:b.accent}})]},k.id))})})]}),jsxRuntime.jsxs("div",{ref:De,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!o&&D(!w),className:"flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:mt,disabled:o,children:[jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5",style:{color:ot.color}}),jsxRuntime.jsx("span",{children:ot.label}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3",style:{color:b.textTertiary}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:w&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:"absolute left-0 top-full mt-1 z-50 min-w-[130px] rounded-lg overflow-hidden",style:{backgroundColor:ge?"#0a0a0a":b.bgPrimary,backdropFilter:ge?"blur(16px)":void 0,border:`1px solid ${ge?"#262626":b.border}`,boxShadow:ge?"0 8px 24px rgba(0, 0, 0, 0.5)":"0 8px 24px rgba(0, 0, 0, 0.12)"},children:_d.map(k=>jsxRuntime.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",style:{color:b.textPrimary},onMouseEnter:O=>O.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:O=>O.currentTarget.style.backgroundColor="transparent",onClick:()=>{pt("priority",k.id),D(false);},children:[jsxRuntime.jsx("span",{children:k.icon}),k.label,pe.priority===k.id&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 ml-auto",style:{color:b.accent}})]},k.id))})})]}),n.length>0&&jsxRuntime.jsxs("div",{ref:Ee,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!o&&M(!S),className:"flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:mt,disabled:o,children:[pe.assignees&&pe.assignees.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"flex -space-x-1",children:pe.assignees.slice(0,3).map((k,O)=>jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] text-white font-medium border-2",style:{backgroundColor:k.color||b.accent,borderColor:b.bgSecondary},children:k.initials},O))}),pe.assignees.length>3&&jsxRuntime.jsxs("span",{style:{color:b.textTertiary},children:["+",pe.assignees.length-3]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Users,{className:"w-3.5 h-3.5",style:{color:b.textTertiary}}),jsxRuntime.jsx("span",{style:{color:b.textTertiary},children:"Asignar"})]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3",style:{color:b.textTertiary}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:S&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:"absolute left-0 top-full mt-1 z-50 min-w-[180px] max-h-[200px] overflow-y-auto rounded-lg",style:{backgroundColor:ge?"#0a0a0a":b.bgPrimary,backdropFilter:ge?"blur(16px)":void 0,border:`1px solid ${ge?"#262626":b.border}`,boxShadow:ge?"0 8px 24px rgba(0, 0, 0, 0.5)":"0 8px 24px rgba(0, 0, 0, 0.12)"},children:n.map(k=>{let O=pe.assignees?.some(Z=>Z.name===k.name);return jsxRuntime.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",style:{color:b.textPrimary},onMouseEnter:Z=>Z.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:Z=>Z.currentTarget.style.backgroundColor="transparent",onClick:()=>{let Z=O?(pe.assignees||[]).filter(ve=>ve.name!==k.name):[...pe.assignees||[],{name:k.name,avatar:k.avatar,initials:k.name.split(" ").map(ve=>ve[0]).join("").toUpperCase().slice(0,2),color:b.accent}];pt("assignees",Z);},children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs text-white font-medium flex-shrink-0",style:{backgroundColor:b.accent},children:k.name.charAt(0).toUpperCase()}),jsxRuntime.jsx("span",{className:"truncate flex-1 text-left",children:k.name}),jsxRuntime.jsx("div",{className:"w-4 flex-shrink-0 flex justify-end",children:O&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:b.accent}})})]},k.id)})})})]}),jsxRuntime.jsxs("div",{ref:He,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>{if(!o)if(T)F(false);else {if(He.current){let k=He.current.getBoundingClientRect(),O=window.innerHeight,Z=120,$=O-k.bottom<Z?k.top-Z-8:k.bottom+8;C({top:$,left:k.left});}F(true);}},className:"flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:mt,disabled:o,children:[jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full",style:{backgroundColor:pe.color}}),jsxRuntime.jsx("span",{children:Et.name}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3",style:{color:b.textTertiary}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:T&&jsxRuntime.jsxs(Qt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0",style:{zIndex:99998},onClick:()=>F(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.12},className:"rounded-lg",style:{position:"fixed",top:`${A.top}px`,left:`${A.left}px`,zIndex:99999,backgroundColor:ge?"#0a0a0a":b.bgPrimary,backdropFilter:ge?"blur(16px)":void 0,border:`1px solid ${ge?"#262626":b.border}`,boxShadow:ge?"0 8px 24px rgba(0, 0, 0, 0.5)":"0 4px 20px rgba(0, 0, 0, 0.25)"},onClick:k=>k.stopPropagation(),children:jsxRuntime.jsx("div",{style:{padding:"6px 8px"},children:jsxRuntime.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(6, 28px)",gap:"2px"},children:sn.slice(0,18).map(k=>{let O=pe.color===k.value;return jsxRuntime.jsx("button",{type:"button",onClick:Z=>{Z.preventDefault(),Z.stopPropagation(),pt("color",k.value),F(false);},style:{width:"28px",height:"28px",borderRadius:"6px",backgroundColor:"transparent",cursor:"pointer",border:"none",display:"flex",alignItems:"center",justifyContent:"center",padding:0},title:k.name,children:jsxRuntime.jsx("span",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:k.value,outline:O?`2px solid ${k.value}`:"none",outlineOffset:"2px",pointerEvents:"none",display:"block"}})},k.value)})})})})]})})]}),u.length>0||m?jsxRuntime.jsx(Ro,{selectedTags:pe.tags||[],availableTags:u,onChange:k=>pt("tags",k),onCreateTag:m,theme:b,disabled:o}):null]}),jsxRuntime.jsxs("section",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 items-end",children:[jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("label",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.1em",textTransform:"uppercase",color:b.textTertiary,display:"block"},children:"Rango de Fechas"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",style:{backgroundColor:ge?"#191b22":b.bgSecondary,borderRadius:8,border:`1px solid ${ge?"rgba(65,71,84,0.05)":b.borderLight}`,padding:"10px 16px"},children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-5 h-5",style:{color:"#00E5CC"}}),jsxRuntime.jsxs("div",{ref:rt,className:"flex items-center gap-2 flex-1 relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>{if(!o&&!pe.isMilestone)if(_==="start")W(null);else {if(rt.current){let k=rt.current.getBoundingClientRect();K({top:k.bottom+8,left:Math.max(16,k.left-40)});}W("start"),L(pe.startDate||new Date);}},className:"px-3 py-1.5 rounded-lg text-sm transition-colors",style:{...mt,opacity:pe.isMilestone?.5:1,cursor:pe.isMilestone?"not-allowed":"pointer"},disabled:o||pe.isMilestone,children:pe.startDate?pe.startDate.toLocaleDateString("es-ES",{day:"numeric",month:"short"}):"Inicio"}),jsxRuntime.jsx("span",{style:{color:b.textTertiary},children:"\u2192"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{if(!o&&!pe.isMilestone)if(_==="end")W(null);else {if(rt.current){let k=rt.current.getBoundingClientRect();K({top:k.bottom+8,left:Math.max(16,k.left-40)});}W("end"),L(pe.endDate||pe.startDate||new Date);}},className:"px-3 py-1.5 rounded-lg text-sm transition-colors",style:{...mt,opacity:pe.isMilestone?.5:1,cursor:pe.isMilestone?"not-allowed":"pointer"},disabled:o||pe.isMilestone,children:pe.endDate?pe.endDate.toLocaleDateString("es-ES",{day:"numeric",month:"short"}):"Fin"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:_&&jsxRuntime.jsxs(Qt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0",style:{zIndex:99998},onClick:()=>W(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"rounded-xl shadow-2xl overflow-hidden flex",style:{position:"fixed",top:`${Y.top}px`,left:`${Y.left}px`,zIndex:99999,backgroundColor:ge?"#0a0a0a":b.bgPrimary,border:`1px solid ${ge?"#262626":b.border}`,boxShadow:ge?"0 8px 32px rgba(0, 0, 0, 0.6)":"0 8px 24px rgba(0, 0, 0, 0.12)"},onClick:k=>k.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"w-40 py-2",style:{borderRight:`1px solid ${ge?"#262626":b.border}`},children:[(()=>{let k=new Date,O=new Date(k);O.setDate(k.getDate()+1);let Z=new Date(k);Z.setDate(k.getDate()+7);let ve=new Date(k);return ve.setDate(k.getDate()+14),[{label:"Hoy",date:k},{label:"Ma\xF1ana",date:O},{label:"Pr\xF3xima semana",date:Z},{label:"2 semanas",date:ve}].map((re,Ye)=>jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-2 text-sm text-left transition-colors",style:{color:b.textPrimary},onMouseEnter:Te=>Te.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:Te=>Te.currentTarget.style.backgroundColor="transparent",onClick:()=>{_==="start"?(pt("startDate",re.date),(!pe.endDate||re.date>pe.endDate)&&pt("endDate",re.date),W("end")):(pt("endDate",re.date),(!pe.startDate||re.date<pe.startDate)&&pt("startDate",re.date),W(null));},children:re.label},Ye))})(),jsxRuntime.jsx("div",{style:{borderTop:`1px solid ${b.border}`,margin:"0.5rem 0"}}),jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-2 text-sm text-left transition-colors",style:{color:"#EF4444"},onMouseEnter:k=>k.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:k=>k.currentTarget.style.backgroundColor="transparent",onClick:()=>{pt("startDate",void 0),pt("endDate",void 0),W(null);},children:"Borrar fechas"})]}),jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>L(new Date(oe.getFullYear(),oe.getMonth()-1)),className:"p-1 rounded",onMouseEnter:k=>k.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:k=>k.currentTarget.style.backgroundColor="transparent",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4",style:{color:b.textSecondary}})}),jsxRuntime.jsx("span",{className:"text-sm font-medium",style:{color:b.textPrimary,fontFamily:"JetBrains Mono, monospace"},children:oe.toLocaleDateString("es-ES",{month:"long",year:"numeric"})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>L(new Date(oe.getFullYear(),oe.getMonth()+1)),className:"p-1 rounded",onMouseEnter:k=>k.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:k=>k.currentTarget.style.backgroundColor="transparent",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4",style:{color:b.textSecondary}})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-1",children:["D","L","M","M","J","V","S"].map((k,O)=>jsxRuntime.jsx("div",{className:"w-7 h-7 flex items-center justify-center text-xs",style:{color:b.textTertiary},children:k},O))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:(()=>{let k=oe.getFullYear(),O=oe.getMonth(),Z=new Date(k,O,1).getDay(),ve=new Date(k,O+1,0).getDate(),$=new Date,re=[];for(let Te=Z-1;Te>=0;Te--)re.push({day:new Date(k,O,-Te).getDate(),date:new Date(k,O-1,new Date(k,O,-Te).getDate()),isCurrentMonth:false});for(let Te=1;Te<=ve;Te++)re.push({day:Te,date:new Date(k,O,Te),isCurrentMonth:true});let Ye=42-re.length;for(let Te=1;Te<=Ye;Te++)re.push({day:Te,date:new Date(k,O+1,Te),isCurrentMonth:false});return re.map((Te,Fe)=>{let ze=Te.date.toDateString()===$.toDateString(),Le=pe.startDate?.toDateString()===Te.date.toDateString(),Ze=pe.endDate?.toDateString()===Te.date.toDateString(),st=pe.startDate&&pe.endDate&&Te.date>=pe.startDate&&Te.date<=pe.endDate;return jsxRuntime.jsx("button",{type:"button",className:"w-7 h-7 rounded-full flex items-center justify-center text-xs transition-colors",style:{color:Te.isCurrentMonth?Le||Ze?"#FFF":b.textPrimary:b.textTertiary,backgroundColor:Le?b.accent:Ze?"#7C3AED":st?"rgba(124, 58, 237, 0.2)":"transparent",boxShadow:ze&&!Le&&!Ze?`inset 0 0 0 1px ${b.accent}`:"none"},onClick:()=>{_==="start"?(pt("startDate",Te.date),pe.endDate&&Te.date>pe.endDate&&pt("endDate",Te.date),W("end")):(pt("endDate",Te.date),pe.startDate&&Te.date<pe.startDate&&pt("startDate",Te.date),W(null));},children:Te.day},Fe)})})()})]})]})]})})]}),je.endDate&&jsxRuntime.jsx("span",{className:"text-xs text-red-400",children:je.endDate})]})]}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("label",{style:{fontSize:10,fontWeight:700,letterSpacing:"0.1em",textTransform:"uppercase",color:b.textTertiary},children:"Progreso Inicial"}),jsxRuntime.jsxs("span",{style:{fontSize:10,fontWeight:700,color:"#00E5CC"},children:[pe.progress,"%"]})]}),jsxRuntime.jsx("div",{className:"h-2 w-full rounded-full overflow-hidden cursor-pointer",style:{backgroundColor:ge?"#33343c":"#E5E7EB"},onClick:k=>{if(o)return;let O=k.currentTarget.getBoundingClientRect(),Z=Math.round((k.clientX-O.left)/O.width*100/5)*5;pt("progress",Math.max(0,Math.min(100,Z)));},children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${pe.progress}%`,backgroundColor:"#00E5CC"}})})]})]}),jsxRuntime.jsxs("div",{style:{borderTop:`1px solid ${ge?"rgba(65,71,84,0.05)":b.borderLight}`,paddingTop:16},children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>B(!V),className:"flex items-center gap-2 w-full py-2 transition-colors",style:{color:b.textPrimary},children:[jsxRuntime.jsx(lucideReact.ChevronDown,{className:`w-4 h-4 transition-transform ${V?"":"-rotate-90"}`,style:{color:b.textTertiary}}),jsxRuntime.jsx("span",{style:{fontSize:16,fontWeight:700,fontFamily:"'Inter', system-ui, sans-serif"},children:"Opciones Avanzadas"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:V&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:jsxRuntime.jsxs("div",{className:"pt-3 space-y-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{color:b.textTertiary},children:[jsxRuntime.jsx("path",{d:"M12 6v6l4 2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"})]}),jsxRuntime.jsx("span",{className:"text-xs",style:{color:b.textTertiary},children:"Horas Estimadas"})]}),jsxRuntime.jsx("input",{type:"text",placeholder:"Ej: 8 (=8h), 2h 30m, 45m, 1d (1 d\xEDa = 8h)",value:pe.effortMinutes?h2(pe.effortMinutes):"",onChange:k=>{let O=y2(k.target.value);pt("effortMinutes",O);},className:"w-full px-3 py-2 rounded-lg text-sm transition-colors",style:{backgroundColor:b.bgSecondary,color:b.textPrimary,border:`1px solid ${b.borderLight}`}})]}),r.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{color:b.textTertiary},children:jsxRuntime.jsx("path",{d:"M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"})}),jsxRuntime.jsx("span",{className:"text-xs",style:{color:b.textTertiary},children:"Fase Padre"})]}),jsxRuntime.jsxs("select",{value:pe.parentId||"",onChange:k=>pt("parentId",k.target.value||null),className:"w-full px-3 py-2 rounded-lg text-sm transition-colors appearance-none cursor-pointer",style:{backgroundColor:b.bgSecondary,color:b.textPrimary,border:`1px solid ${b.borderLight}`},disabled:o,children:[jsxRuntime.jsx("option",{value:"",children:"\u2014 Sin fase padre (ra\xEDz) \u2014"}),r.filter(k=>k.id!==a?.id).map(k=>jsxRuntime.jsx("option",{value:k.id,children:k.name},k.id))]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[jsxRuntime.jsx("span",{style:{fontSize:14},children:"\u{1F4CD}"}),jsxRuntime.jsx("span",{className:"text-xs",style:{color:b.textTertiary},children:"Ubicaci\xF3n"})]}),jsxRuntime.jsx("input",{type:"text",placeholder:"Ej: Zona Norte, Piso 3",value:pe.location||"",onChange:k=>pt("location",k.target.value),className:"w-full px-3 py-2 rounded-lg text-sm transition-colors",style:{backgroundColor:b.bgSecondary,color:b.textPrimary,border:`1px solid ${b.borderLight}`},disabled:o})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[jsxRuntime.jsx("span",{style:{fontSize:14},children:"\u{1F527}"}),jsxRuntime.jsx("span",{className:"text-xs",style:{color:b.textTertiary},children:"Activo / Equipo"})]}),jsxRuntime.jsx("input",{type:"text",placeholder:"Ej: CMC-256",value:pe.equipment||"",onChange:k=>pt("equipment",k.target.value),className:"w-full px-3 py-2 rounded-lg text-sm transition-colors",style:{backgroundColor:b.bgSecondary,color:b.textPrimary,border:`1px solid ${b.borderLight}`},disabled:o})]})]}),(g||p.length>0||l==="create")&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{color:b.textTertiary},children:jsxRuntime.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})}),jsxRuntime.jsxs("span",{className:"text-xs",style:{color:b.textTertiary},children:["Adjuntos ",l==="create"?X.length>0&&`(${X.length})`:p.length>0&&`(${p.length})`]})]}),l==="create"?jsxRuntime.jsx(uo,{cardId:"pending",attachments:X.map((k,O)=>({id:`pending-${O}`,cardId:"pending",name:k.name,size:k.size,type:k.type,url:URL.createObjectURL(k),uploadedAt:new Date().toISOString(),uploadedBy:"current-user"})),onUpload:k=>Ce(O=>[...O,...k]),onDelete:k=>{let O=parseInt(k.replace("pending-",""),10);Ce(Z=>Z.filter((ve,$)=>$!==O));},maxSizeMB:10,maxFiles:20}):jsxRuntime.jsx(uo,{cardId:a?.id||"new",attachments:p,onUpload:g&&a?.id?k=>g(a.id,k):void 0,onDelete:f,maxSizeMB:10,maxFiles:20}),l==="create"&&X.length>0&&jsxRuntime.jsxs("p",{className:"text-xs mt-1",style:{color:b.textTertiary},children:[X.length," archivo(s) se subir\xE1n al crear la tarea"]})]}),jsxRuntime.jsxs("label",{className:"flex items-center gap-3 cursor-pointer p-2 rounded-lg transition-colors",onMouseEnter:k=>k.currentTarget.style.backgroundColor=b.hoverBg,onMouseLeave:k=>k.currentTarget.style.backgroundColor="transparent",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:pe.isMilestone,onChange:k=>pt("isMilestone",k.target.checked),className:"w-4 h-4 rounded",style:{accentColor:b.accent},disabled:o}),jsxRuntime.jsx(lucideReact.Milestone,{className:"w-4 h-4 text-yellow-500"}),jsxRuntime.jsx("span",{className:"text-sm",style:{color:b.textPrimary},children:"Marcar como hito"})]}),r.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("label",{className:"flex items-center gap-2 text-xs mb-2",style:{color:b.textTertiary},children:[jsxRuntime.jsx(lucideReact.Link2,{className:"w-3.5 h-3.5"}),"Dependencias"]}),pe.dependencies&&pe.dependencies.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:pe.dependencies.map(k=>{let O=r.find(Z=>Z.id===k);return jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",style:{backgroundColor:`${b.accent}20`,color:b.accent},children:[O?.name||k.slice(0,8),jsxRuntime.jsx("button",{type:"button",onClick:()=>{let Z=(pe.dependencies||[]).filter(ve=>ve!==k);pt("dependencies",Z);},className:"ml-0.5 rounded-full p-0.5 transition-colors hover:bg-white/20",disabled:o,children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},k)})}),jsxRuntime.jsxs("button",{type:"button",onClick:()=>{R(!Re),be("");},className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-colors",style:{backgroundColor:b.bgSecondary,color:b.textSecondary},disabled:o,children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:"Agregar dependencia"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Re&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{R(false),be("");}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:"absolute left-0 top-full mt-1 z-50 rounded-lg overflow-hidden min-w-[280px] max-h-[280px]",style:{backgroundColor:ge?"#0a0a0a":b.bgPrimary,backdropFilter:ge?"blur(16px)":void 0,border:`1px solid ${ge?"#262626":b.border}`,boxShadow:ge?"0 8px 24px rgba(0, 0, 0, 0.5)":"0 8px 24px rgba(0, 0, 0, 0.12)"},children:[jsxRuntime.jsx("div",{className:"p-2",style:{borderBottom:`1px solid ${b.border}`},children:jsxRuntime.jsx("input",{type:"text",value:ae,onChange:k=>be(k.target.value),placeholder:"Buscar tarea...",className:"w-full px-3 py-2 rounded-md text-xs outline-none",style:{backgroundColor:b.bgSecondary,color:b.textPrimary},autoFocus:true})}),jsxRuntime.jsxs("div",{className:"max-h-[200px] overflow-y-auto",children:[r.filter(k=>k.id!==a?.id).filter(k=>ae===""||k.name.toLowerCase().includes(ae.toLowerCase())).map(k=>{let O=pe.dependencies?.includes(k.id);return jsxRuntime.jsxs("button",{type:"button",onClick:()=>{let Z=pe.dependencies||[],ve;O?ve=Z.filter($=>$!==k.id):ve=[...Z,k.id],pt("dependencies",ve);},className:"w-full flex items-center gap-3 px-3 py-2 text-xs transition-colors text-left",style:{backgroundColor:O?`${b.accent}10`:"transparent"},onMouseEnter:Z=>{O||(Z.currentTarget.style.backgroundColor=b.hoverBg);},onMouseLeave:Z=>{Z.currentTarget.style.backgroundColor=O?`${b.accent}10`:"transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0",style:{backgroundColor:O?b.accent:"transparent",borderColor:O?b.accent:b.borderLight},children:O&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:"block truncate",style:{color:b.textPrimary},children:k.name}),jsxRuntime.jsx("span",{className:"text-[10px]",style:{color:b.textTertiary},children:k.id.slice(0,8)})]})]},k.id)}),r.filter(k=>k.id!==a?.id).length===0&&jsxRuntime.jsx("div",{className:"px-3 py-4 text-xs text-center",style:{color:b.textTertiary},children:"No hay tareas disponibles"})]})]})]})})]})]})})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-6 px-8 py-5 flex-shrink-0",style:{borderTop:`1px solid ${ge?"rgba(65,71,84,0.1)":b.border}`,backgroundColor:ge?"rgba(25,27,34,0.2)":void 0},children:[jsxRuntime.jsx("button",{type:"button",onClick:t,className:"text-sm font-semibold transition-colors",style:{color:b.textTertiary},onMouseEnter:k=>k.currentTarget.style.color=b.textPrimary,onMouseLeave:k=>k.currentTarget.style.color=b.textTertiary,disabled:o,children:"Cancelar"}),jsxRuntime.jsx("button",{type:"submit",disabled:o,className:"px-8 py-3 font-bold rounded-lg transition-all flex items-center gap-2",style:{backgroundColor:"#00E5CC",color:"#FFF",fontSize:14,fontFamily:"'Inter', system-ui, sans-serif",boxShadow:"0 4px 20px rgba(0, 123, 255, 0.2)"},onMouseEnter:k=>!o&&(k.currentTarget.style.filter="brightness(1.1)"),onMouseLeave:k=>!o&&(k.currentTarget.style.filter="brightness(1)"),children:o?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Guardando..."]}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:l==="create"?"Crear Tarea":"Guardar"})})]})]})})})]})})}var Wm=`You are a Gantt chart AI assistant. You help users edit project tasks using natural language commands.
|
|
369
369
|
|
|
370
370
|
AVAILABLE COMMANDS:
|
|
371
371
|
1. move_task - Move a task to a different date
|
|
@@ -410,7 +410,7 @@ If ambiguous, ask for clarification in the message field.`;function Vm(e){return
|
|
|
410
410
|
${Gm(e).map(r=>{let n=r.startDate?r.startDate.toISOString().split("T")[0]:"no date",s=r.endDate?r.endDate.toISOString().split("T")[0]:"no date",o=r.dependencies?.length?`deps: [${r.dependencies.join(", ")}]`:"";return `- ${r.id}: "${r.name}" (${n} to ${s}, ${r.progress}%, ${r.status||"todo"}) ${o}`}).join(`
|
|
411
411
|
`)}
|
|
412
412
|
|
|
413
|
-
Today's date: ${new Date().toISOString().split("T")[0]}`}function Gm(e){let t=[],a=r=>{for(let n of r)t.push(n),n.subtasks?.length&&a(n.subtasks);};return a(e),t}function Mo(e,t){let a=Gm(e),r=t.toLowerCase().trim(),n=a.find(l=>l.name.toLowerCase()===r);if(n)return n;let s=a.find(l=>l.name.toLowerCase().includes(r));if(s)return s;let o=r.split(/\s+/);return a.find(l=>{let d=l.name.toLowerCase();return o.every(i=>d.includes(i))})}function Kd(e,t=new Date){let a=e.toLowerCase().trim(),r=new Date(t);if(r.setHours(0,0,0,0),a==="today"||a==="hoy")return r;if(a==="tomorrow"||a==="ma\xF1ana"){let p=new Date(r);return p.setDate(p.getDate()+1),p}if(a==="yesterday"||a==="ayer"){let p=new Date(r);return p.setDate(p.getDate()-1),p}if(a==="next week"||a==="la pr\xF3xima semana"){let p=new Date(r);return p.setDate(p.getDate()+7),p}let n=a.match(/(?:next\s+)?(monday|tuesday|wednesday|thursday|friday|saturday|sunday|lunes|martes|miércoles|miercoles|jueves|viernes|sábado|sabado|domingo)/i);if(n){let g={sunday:0,domingo:0,monday:1,lunes:1,tuesday:2,martes:2,wednesday:3,mi\u00E9rcoles:3,miercoles:3,thursday:4,jueves:4,friday:5,viernes:5,saturday:6,s\u00E1bado:6,sabado:6}[n[1].toLowerCase()];if(g!==void 0){let f=new Date(r),x=f.getDay(),y=g-x;return y<=0&&(y+=7),f.setDate(f.getDate()+y),f}}let s=a.match(/in\s+(\d+)\s+(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(s&&s[1]&&s[2]){let p=parseInt(s[1],10),g=s[2].toLowerCase(),f=new Date(r);return g==="day"||g==="d\xEDa"||g==="dias"?f.setDate(f.getDate()+p):g==="week"||g==="semana"||g==="semanas"?f.setDate(f.getDate()+p*7):(g==="month"||g==="mes"||g==="meses")&&f.setMonth(f.getMonth()+p),f}if(a.match(/(\d{4})-(\d{2})-(\d{2})/))return new Date(a);let l=a.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})/);if(l&&l[1]&&l[2]&&l[3]){let p=parseInt(l[1],10),g=parseInt(l[2],10)-1,f=parseInt(l[3],10);return new Date(f,g,p)}let d={enero:0,febrero:1,marzo:2,abril:3,mayo:4,junio:5,julio:6,agosto:7,septiembre:8,octubre:9,noviembre:10,diciembre:11},i=a.match(/(\d{1,2})\s+de\s+(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)(?:\s+de\s+(\d{4}))?/i);if(i&&i[1]&&i[2]){let p=parseInt(i[1],10),g=d[i[2].toLowerCase()],f=i[3]?parseInt(i[3],10):r.getFullYear();if(g!==void 0)return new Date(f,g,p)}let u={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},m=a.match(/(january|february|march|april|may|june|july|august|september|october|november|december)\s+(\d{1,2})(?:,?\s+(\d{4}))?/i);if(m&&m[1]&&m[2]){let p=u[m[1].toLowerCase()],g=parseInt(m[2],10),f=m[3]?parseInt(m[3],10):r.getFullYear();if(p!==void 0)return new Date(f,p,g)}return null}function qd(e){let a=e.toLowerCase().trim().match(/(\d+)\s*(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(a&&a[1]&&a[2]){let r=parseInt(a[1],10),n=a[2].toLowerCase();if(n==="day"||n==="d\xEDa"||n==="dias")return r;if(n==="week"||n==="semana"||n==="semanas")return r*7;if(n==="month"||n==="mes"||n==="meses")return r*30}return null}function Yd(e){let t=e.match(/(\d+)(?:\s*%)?/);if(t&&t[1]){let a=parseInt(t[1],10);return Math.max(0,Math.min(100,a))}return null}function jm(e){let t=e.toLowerCase().trim();return t.includes("todo")||t.includes("pendiente")||t.includes("por hacer")?"todo":t.includes("in progress")||t.includes("in-progress")||t.includes("en progreso")||t.includes("working")||t.includes("trabajando")?"in-progress":t.includes("done")||t.includes("complete")||t.includes("finished")||t.includes("completado")||t.includes("terminado")||t.includes("hecho")?"completed":null}function _m(e,t){let a=e.toLowerCase().trim(),r=a.match(/(?:move|mover|mueve)\s+(?:la\s+tarea\s+)?["""]?(.+?)["""]?\s+(?:to|a|para)\s+(?:la\s+fecha\s+)?(.+)/i);if(r&&r[1]&&r[2]){let i=r[1].trim(),u=r[2].trim(),m=Mo(t,i),p=Kd(u);if(!m)return {type:"move_task",taskName:i,message:`Could not find a task named "${i}". Please check the task name and try again.`,success:false,error:"Task not found"};if(!p)return {type:"move_task",taskId:m.id,taskName:m.name,message:`Could not parse the date "${u}". Try using formats like "next Monday", "in 3 days", or "2024-01-15".`,success:false,error:"Invalid date"};let g=m.startDate&&m.endDate?Math.round((m.endDate.getTime()-m.startDate.getTime())/(1e3*60*60*24)):1,f=new Date(p);return f.setDate(f.getDate()+g),{type:"move_task",taskId:m.id,taskName:m.name,updates:{startDate:p,endDate:f},message:`Moved "${m.name}" to ${p.toLocaleDateString()}.`,success:true}}let n=a.match(/(?:extend|extender|extiende|alargar)\s+["""]?(.+?)["""]?\s+(?:by|por)\s+(.+)/i);if(n&&n[1]&&n[2]){let i=n[1].trim(),u=n[2].trim(),m=Mo(t,i),p=qd(u);if(!m)return {type:"resize_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"};if(!p||!m.endDate)return {type:"resize_task",taskId:m.id,taskName:m.name,message:`Could not parse the duration "${u}".`,success:false,error:"Invalid duration"};let g=new Date(m.endDate);return g.setDate(g.getDate()+p),{type:"resize_task",taskId:m.id,taskName:m.name,updates:{endDate:g},message:`Extended "${m.name}" by ${p} days. New end date: ${g.toLocaleDateString()}.`,success:true}}let s=a.match(/(?:set|establecer|poner)\s+["""]?(.+?)["""]?\s+(?:progress|progreso)\s+(?:to|a|en)\s+(.+)/i);if(s&&s[1]&&s[2]){let i=s[1].trim(),u=s[2].trim(),m=Mo(t,i),p=Yd(u);return m?p===null?{type:"set_progress",taskId:m.id,taskName:m.name,message:`Could not parse the progress value "${u}".`,success:false,error:"Invalid progress"}:{type:"set_progress",taskId:m.id,taskName:m.name,updates:{progress:p},message:`Set "${m.name}" progress to ${p}%.`,success:true}:{type:"set_progress",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let o=a.match(/(?:rename|renombrar|cambiar nombre de)\s+["""]?(.+?)["""]?\s+(?:to|a|por)\s+["""]?(.+?)["""]?$/i);if(o&&o[1]&&o[2]){let i=o[1].trim(),u=o[2].trim(),m=Mo(t,i);return m?{type:"rename_task",taskId:m.id,taskName:m.name,updates:{name:u},message:`Renamed "${m.name}" to "${u}".`,success:true}:{type:"rename_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let l=a.match(/(?:link|vincular|conectar)\s+["""]?(.+?)["""]?\s+(?:to|a|con)\s+["""]?(.+?)["""]?$/i);if(l&&l[1]&&l[2]){let i=l[1].trim(),u=l[2].trim(),m=Mo(t,i),p=Mo(t,u);return m?p?{type:"link_tasks",taskId:p.id,taskName:p.name,dependencyFrom:m.id,dependencyTo:p.id,message:`Linked "${m.name}" \u2192 "${p.name}".`,success:true}:{type:"link_tasks",taskName:u,message:`Could not find a task named "${u}".`,success:false,error:"Target task not found"}:{type:"link_tasks",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Source task not found"}}let d=a.match(/(?:delete|eliminar|borrar|remove|quitar)\s+["""]?(.+?)["""]?$/i);if(d&&d[1]){let i=d[1].trim(),u=Mo(t,i);return u?{type:"delete_task",taskId:u.id,taskName:u.name,message:`Deleted "${u.name}".`,success:true}:{type:"delete_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}return null}function Km(e){if(!e||typeof e!="object")return {type:"unknown",message:"Invalid response from AI",success:false,error:"Invalid response format"};let t=e;return {type:t.type||"unknown",taskId:typeof t.taskId=="string"?t.taskId:void 0,taskName:typeof t.taskName=="string"?t.taskName:void 0,updates:t.updates,newTask:t.newTask,dependencyFrom:typeof t.dependencyFrom=="string"?t.dependencyFrom:void 0,dependencyTo:typeof t.dependencyTo=="string"?t.dependencyTo:void 0,message:typeof t.message=="string"?t.message:"Command processed",success:typeof t.success=="boolean"?t.success:false,error:typeof t.error=="string"?t.error:void 0}}function x2(e){if(e)switch(e.toUpperCase()){case "TODO":case "BLOCKED":return "todo";case "IN_PROGRESS":case "REVIEW":return "in-progress";case "DONE":return "completed";default:return "todo"}}function v2(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return e||"TODO"}}function _i(e,t=[],a=[]){let r=e.assignedUserIds?.map(u=>{let m=a.find(p=>p.id===u);return m?{name:m.name,initials:m.initials,color:m.color}:null}).filter(u=>u!==null),n=t.filter(u=>u.metadata?.parentCardId===e.id).map(u=>_i(u,t,a)),s;e.dependencies&&(typeof e.dependencies[0]=="string"?s=e.dependencies:s=e.dependencies.filter(u=>u.type==="finish-to-start").map(u=>u.taskId));let o=u=>{if(u)return typeof u=="string"?new Date(u):u},l=o(e.startDate),d=o(e.endDate),i=e.metadata?.isMilestone===true||l&&d&&Math.abs(d.getTime()-l.getTime())<=864e5;return {id:e.id,name:e.title,startDate:l,endDate:d,progress:e.progress||0,status:x2(e.metadata?.status),assignees:r?.length?r:void 0,dependencies:s?.length?s:void 0,subtasks:n?.length?n:void 0,isExpanded:e.metadata?.isExpanded===true,isMilestone:i,isCriticalPath:e.metadata?.isCriticalPath===true}}function qm(e,t=[]){let a;return e.assignees&&e.assignees.length>0&&(a=e.assignees.map(r=>t.find(s=>s.name===r.name||s.initials===r.initials)?.id).filter(r=>r!==void 0)),{id:e.id,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,assignedUserIds:a?.length?a:void 0,metadata:{status:v2(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function Ym(e,t=[]){return e.filter(r=>!r.metadata?.parentCardId).map(r=>_i(r,e,t))}var Xd={columns:{name:"Task ID / Name",startDate:"Start Date",endDate:"End Date",progress:"Progress",status:"Status",assignees:"Assignees",priority:"Priority",actions:"Actions",estimatedTime:"Estimated",quotedTime:"Quoted",elapsedTime:"Executed",tags:"Tags",scheduleVariance:"Sched / Var",hoursBar:"Hours (Spent / Allocated)",teamLoad:"Team Load",blockers:"Blockers",weight:"Weight"},toolbar:{search:"Search",searchPlaceholder:"Search tasks...",filter:"Filter",clearFilters:"Clear Filters",export:"Export",columns:"Columns",newTask:"New Task"},filters:{status:"Status",assignees:"Assignees",dateRange:"Date Range",showCompleted:"Show Completed",all:"All",none:"None"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",viewDetails:"View Details"},empty:{noTasks:"No tasks yet",noResults:"No tasks match your filters",addFirstTask:"Add your first task"},pagination:{showing:"Showing",of:"of",tasks:"tasks",previous:"Previous",next:"Next"},bulk:{selected:"selected",delete:"Delete",move:"Move to",assignTo:"Assign to"}},Jd={columns:{name:"ID Tarea / Nombre",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",status:"Estado",assignees:"Asignados",priority:"Prioridad",actions:"Acciones",estimatedTime:"Estimado",quotedTime:"Ofertado",elapsedTime:"Ejecutado",tags:"Etiquetas",scheduleVariance:"Prog / Var",hoursBar:"Horas (Usado / Asignado)",teamLoad:"Equipo",blockers:"Bloqueantes",weight:"Peso"},toolbar:{search:"Buscar",searchPlaceholder:"Buscar tareas...",filter:"Filtrar",clearFilters:"Limpiar Filtros",export:"Exportar",columns:"Columnas",newTask:"Nueva Tarea"},filters:{status:"Estado",assignees:"Asignados",dateRange:"Rango de Fechas",showCompleted:"Mostrar Completadas",all:"Todos",none:"Ninguno"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",viewDetails:"Ver Detalles"},empty:{noTasks:"Sin tareas a\xFAn",noResults:"Ninguna tarea coincide con los filtros",addFirstTask:"Agrega tu primera tarea"},pagination:{showing:"Mostrando",of:"de",tasks:"tareas",previous:"Anterior",next:"Siguiente"},bulk:{selected:"seleccionadas",delete:"Eliminar",move:"Mover a",assignTo:"Asignar a"}},Ki={en:Xd,es:Jd};function Qd(e){return Ki[e]||Ki.en}function qi(e,t){let a=Qd(e);return t?{columns:{...a.columns,...t.columns},toolbar:{...a.toolbar,...t.toolbar},filters:{...a.filters,...t.filters},status:{...a.status,...t.status},actions:{...a.actions,...t.actions},empty:{...a.empty,...t.empty},pagination:{...a.pagination,...t.pagination},bulk:{...a.bulk,...t.bulk}}:a}var Zd=[{value:"todo",icon:lucideReact.Circle,color:"text-gray-400"},{value:"in-progress",icon:lucideReact.PlayCircle,color:"text-[#3B9EFF]"},{value:"completed",icon:lucideReact.CheckCircle2,color:"text-[#3BF06E]"}];function Xm(e){let t=e?.toLowerCase()||"todo";return t==="inprogress"||t==="in-progress"||t==="in_progress"?"in-progress":t==="completed"||t==="done"||t==="complete"?"completed":"todo"}function Jm({value:e,onChange:t,isDark:a,translations:r,disabled:n=false}){let[s,o]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let g=f=>{l.current&&!l.current.contains(f.target)&&o(false);};return s&&document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[s]);let d=Xm(e),i=Zd[0],u=Zd.find(g=>g.value===d)??i,m=u.icon,p=g=>{switch(Xm(g)){case "completed":return r.completed;case "in-progress":return r.inProgress;default:return r.todo}};return n||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(m,{className:c("w-4 h-4 flex-shrink-0",u.color)}),jsxRuntime.jsx("span",{className:c("text-sm whitespace-nowrap",a?"text-white/60":"text-gray-500"),children:p(e)})]}):jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:g=>{g.stopPropagation(),o(!s);},className:c("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx(m,{className:c("w-4 h-4 flex-shrink-0",u.color)}),jsxRuntime.jsx("span",{className:c("text-sm whitespace-nowrap",a?"text-white/60":"text-gray-500"),children:p(e)}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-3 h-3",a?"text-white/30":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:c("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[140px]",a?"bg-[#1A1A1A] border-[#222]":"bg-white border-gray-200"),children:Zd.map(g=>{let f=g.icon;return jsxRuntime.jsxs("button",{onClick:x=>{x.stopPropagation(),t(g.value),o(false);},className:c("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",d===g.value&&(a?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx(f,{className:c("w-4 h-4",g.color)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:p(g.value)})]},g.value)})})]})}var ec=[{value:"urgent",label:{en:"Urgent",es:"Urgente"},color:"text-[#FF2D20]",bg:"bg-[#FF2D20]"},{value:"high",label:{en:"High",es:"Alta"},color:"text-[#FF2D20]",bg:"bg-[#FF2D20]"},{value:"medium",label:{en:"Medium",es:"Media"},color:"text-[#FFD60A]",bg:"bg-[#FFD60A]"},{value:"low",label:{en:"Low",es:"Baja"},color:"text-[#3B9EFF]",bg:"bg-[#3B9EFF]"},{value:"none",label:{en:"None",es:"Ninguna"},color:"text-gray-400",bg:"bg-gray-400"}];function Zm({value:e="none",onChange:t,isDark:a,locale:r,disabled:n=false}){let[s,o]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let u=m=>{l.current&&!l.current.contains(m.target)&&o(false);};return s&&document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[s]);let d=ec.find(u=>u.value===e)??ec[4],i=r==="es"?"es":"en";return n||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Flag,{className:c("w-4 h-4",d.color)}),jsxRuntime.jsx("span",{className:c("text-sm",a?"text-white/60":"text-gray-500"),children:d.label[i]})]}):jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:u=>{u.stopPropagation(),o(!s);},className:c("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Flag,{className:c("w-4 h-4",d.color)}),jsxRuntime.jsx("span",{className:c("text-sm",a?"text-white/60":"text-gray-500"),children:d.label[i]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-3 h-3",a?"text-white/30":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:c("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px]",a?"bg-[#1A1A1A] border-[#222]":"bg-white border-gray-200"),children:ec.map(u=>jsxRuntime.jsxs("button",{onClick:m=>{m.stopPropagation(),t(u.value),o(false);},className:c("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",e===u.value&&(a?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:c("w-2 h-2 rounded-full",u.bg)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:u.label[i]})]},u.value))})]})}function As(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function tc(e){let t=["bg-[#00E5CC]","bg-green-500","bg-purple-500","bg-pink-500","bg-yellow-500","bg-red-500","bg-indigo-500","bg-[#00E5CC]"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"bg-[#00E5CC]"}function ac({value:e=[],availableUsers:t=[],onChange:a,isDark:r,locale:n,disabled:s=false}){let[o,l]=react.useState(false),[d,i]=react.useState(""),u=react.useRef(null),m=react.useRef(null);react.useEffect(()=>{let x=y=>{u.current&&!u.current.contains(y.target)&&(l(false),i(""));};return o&&document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]),react.useEffect(()=>{o&&m.current&&m.current.focus();},[o]);let p=t.filter(x=>x.name.toLowerCase().includes(d.toLowerCase())),g=x=>e.some(y=>y.name===x),f=x=>{if(a){if(g(x.name))a(e.filter(y=>y.name!==x.name));else {let y={name:x.name,initials:As(x.name),color:x.color||tc(x.name).replace("bg-","").replace("-500",""),avatar:x.avatarUrl,id:x.id};a([...e,y]);}l(false),i("");}};return s||!a?e.length===0?jsxRuntime.jsx("span",{className:c("text-sm",r?"text-white/30":"text-gray-400"),children:"-"}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-2",children:[e.slice(0,3).map((x,y)=>jsxRuntime.jsx("div",{className:c("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white border-2",r?"border-[#0D0D0D]":"border-white",!x.avatar&&tc(x.name)),style:x.color&&!x.avatar?{backgroundColor:x.color}:void 0,title:x.name,children:x.avatar?jsxRuntime.jsx("img",{src:x.avatar,alt:x.name,className:"w-full h-full rounded-full object-cover"}):x.initials||As(x.name)},`${x.name}-${y}`)),e.length>3&&jsxRuntime.jsxs("div",{className:c("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium border-2",r?"bg-[#1A1A1A] border-[#0D0D0D] text-white":"bg-gray-200 border-white text-gray-600"),children:["+",e.length-3]})]}):jsxRuntime.jsxs("div",{ref:u,className:"relative",children:[jsxRuntime.jsx("button",{onClick:x=>{x.stopPropagation(),l(!o);},className:c("flex items-center gap-1 px-2 py-1 rounded transition-colors",r?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:e.length===0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.User,{className:c("w-4 h-4",r?"text-white/30":"text-gray-400")}),jsxRuntime.jsx(lucideReact.Plus,{className:c("w-3 h-3",r?"text-white/30":"text-gray-400")})]}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-1",children:[e.slice(0,2).map((x,y)=>jsxRuntime.jsx("div",{className:c("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-medium text-white border",r?"border-[#0D0D0D]":"border-white",!x.avatar&&tc(x.name)),style:x.color&&!x.avatar?{backgroundColor:x.color}:void 0,children:x.avatar?jsxRuntime.jsx("img",{src:x.avatar,alt:x.name,className:"w-full h-full rounded-full object-cover"}):x.initials||As(x.name)},`${x.name}-${y}`)),e.length>2&&jsxRuntime.jsxs("span",{className:c("text-xs ml-1",r?"text-white/60":"text-gray-500"),children:["+",e.length-2]})]})}),o&&jsxRuntime.jsxs("div",{className:"absolute z-50 top-full left-0 mt-1.5 rounded-lg overflow-hidden",style:{width:260,backgroundColor:r?"rgba(17, 17, 17, 0.98)":"rgba(255, 255, 255, 0.98)",border:`1px solid ${r?"rgba(255,255,255,0.10)":"rgba(0,0,0,0.1)"}`,boxShadow:r?"0 8px 24px rgba(0,0,0,0.5)":"0 8px 24px rgba(0,0,0,0.12)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",style:{padding:"8px 10px",borderBottom:`1px solid ${r?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`},children:[jsxRuntime.jsx(lucideReact.Search,{className:"flex-shrink-0",style:{width:14,height:14,color:r?"rgba(255,255,255,0.20)":"#94A3B8"}}),jsxRuntime.jsx("input",{ref:m,type:"text",value:d,onChange:x=>i(x.target.value),placeholder:n==="es"?"Buscar miembros...":"Search members...",onClick:x=>x.stopPropagation(),style:{flex:1,fontSize:12,color:r?"rgba(255,255,255,0.92)":"#0F172A",backgroundColor:"transparent",border:"none",outline:"none",fontFamily:"Inter, sans-serif"}})]}),e.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",style:{padding:"6px 10px",borderBottom:`1px solid ${r?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`},children:e.map((x,y)=>jsxRuntime.jsxs("span",{className:"flex items-center gap-1",style:{fontSize:11,padding:"2px 6px 2px 4px",borderRadius:4,backgroundColor:x.color?`${x.color}20`:r?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)",color:x.color||(r?"#fff":"#334155")},children:[jsxRuntime.jsx("span",{className:"flex items-center justify-center",style:{width:16,height:16,borderRadius:"50%",backgroundColor:x.color||"#00E5CC",fontSize:8,fontWeight:700,color:"#fff"},children:x.avatar?jsxRuntime.jsx("img",{src:x.avatar,alt:x.name,className:"w-full h-full rounded-full object-cover"}):x.initials||As(x.name)}),x.name.split(" ")[0],jsxRuntime.jsx("button",{onClick:b=>{b.stopPropagation(),a(e.filter(h=>h.name!==x.name));},className:"flex items-center justify-center",style:{width:14,height:14,borderRadius:3,border:"none",background:"transparent",color:"inherit",cursor:"pointer",opacity:.7},children:jsxRuntime.jsx(lucideReact.X,{style:{width:10,height:10}})})]},`${x.name}-${y}`))}),jsxRuntime.jsx("div",{style:{maxHeight:200,overflowY:"auto",padding:4},children:p.length===0?jsxRuntime.jsx("div",{style:{padding:"12px 10px",fontSize:12,color:r?"rgba(255,255,255,0.35)":"#94A3B8",textAlign:"center"},children:n==="es"?"No se encontraron miembros":"No members found"}):p.map(x=>{let y=g(x.name);return jsxRuntime.jsxs("button",{onClick:b=>{b.stopPropagation(),f(x);},className:"flex items-center w-full",style:{gap:8,padding:"6px 10px",borderRadius:4,border:"none",cursor:"pointer",backgroundColor:y?r?"rgba(0, 229, 204, 0.12)":"rgba(0, 229, 204, 0.08)":"transparent",color:r?"rgba(255,255,255,0.92)":"#0F172A",fontSize:12,textAlign:"left",transition:"background-color 0.1s"},onMouseEnter:b=>{y||(b.currentTarget.style.backgroundColor=r?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)");},onMouseLeave:b=>{y||(b.currentTarget.style.backgroundColor="transparent");},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center flex-shrink-0",style:{width:24,height:24,borderRadius:"50%",backgroundColor:x.color||"#00E5CC",fontSize:9,fontWeight:700,color:"#fff"},children:x.avatarUrl?jsxRuntime.jsx("img",{src:x.avatarUrl,alt:x.name,className:"w-full h-full rounded-full object-cover"}):As(x.name)}),jsxRuntime.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.name}),y&&jsxRuntime.jsx("div",{className:"flex items-center justify-center",style:{width:16,height:16,borderRadius:4,backgroundColor:"rgba(96, 165, 250, 0.2)"},children:jsxRuntime.jsx("div",{style:{width:8,height:8,borderRadius:2,backgroundColor:"#60A5FA"}})})]},x.id)})})]})]})}function ng({startDate:e,endDate:t,onChange:a,singleDateMode:r=false,singleDateField:n="end",isDark:s,locale:o,disabled:l=false,placeholder:d}){let[i,u]=react.useState(false),[m,p]=react.useState(n),[g,f]=react.useState(()=>{let C=n==="start"?e:t;if(C){let _=C instanceof Date?C:new Date(C);return new Date(_.getFullYear(),_.getMonth(),1)}return new Date(new Date().getFullYear(),new Date().getMonth(),1)}),x=react.useRef(null),y=react.useRef(null),b=react.useRef(null),[h,v]=react.useState(null),w=e?e instanceof Date?e:new Date(e):null,D=t?t instanceof Date?t:new Date(t):null;react.useEffect(()=>{let C=_=>{let W=_.target;x.current&&x.current.contains(W)||b.current&&b.current.contains(W)||u(false);};return i&&document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[i]),react.useLayoutEffect(()=>{if(!i){v(null);return}let C=()=>{let _=y.current?.getBoundingClientRect();if(!_)return;let W=520,oe=360,L=window.innerHeight-_.bottom,Y=L<oe&&_.top>L,K=Y?_.top-4:_.bottom+4,V=Math.min(Math.max(_.left,8),window.innerWidth-W-8);v({top:K,left:V,flipUp:Y});};return C(),window.addEventListener("scroll",C,true),window.addEventListener("resize",C),()=>{window.removeEventListener("scroll",C,true),window.removeEventListener("resize",C);}},[i]),react.useEffect(()=>{i&&p(r?n:"start");},[i,r,n]);let S=C=>C?C.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"}):d||"-",M=react.useCallback(()=>{let C=g.getFullYear(),_=g.getMonth(),W=new Date(C,_,1),L=new Date(C,_+1,0).getDate(),Y=W.getDay(),K=[],B=new Date(C,_,0).getDate();for(let Ce=Y-1;Ce>=0;Ce--)K.push({date:new Date(C,_-1,B-Ce),isCurrentMonth:false});for(let Ce=1;Ce<=L;Ce++)K.push({date:new Date(C,_,Ce),isCurrentMonth:true});let X=42-K.length;for(let Ce=1;Ce<=X;Ce++)K.push({date:new Date(C,_+1,Ce),isCurrentMonth:false});return K},[g]),T=C=>{if(r)n==="start"?a(C,D||void 0):a(w||void 0,C),u(false);else if(m==="start"){let _=D&&C>D?C:D;a(C,_||void 0),p("end");}else {let _=w&&C<w?C:w;a(_||void 0,C),u(false);}},F=()=>{let C=new Date,_=new Date(C);_.setDate(C.getDate()+1);let W=new Date(C);W.setDate(C.getDate()+((6-C.getDay()+7)%7||7));let oe=new Date(C);oe.setDate(C.getDate()+((1-C.getDay()+7)%7||7));let L=new Date(C);L.setDate(C.getDate()+(6-C.getDay()+7)%7+7);let Y=new Date(C);Y.setDate(C.getDate()+14);let K=new Date(C);return K.setDate(C.getDate()+28),[{label:o==="es"?"Hoy":"Today",date:C,display:C.toLocaleDateString(o==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:o==="es"?"Ma\xF1ana":"Tomorrow",date:_,display:_.toLocaleDateString(o==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:o==="es"?"Este fin de semana":"This weekend",date:W,display:o==="es"?"s\xE1b.":"sat."},{label:o==="es"?"Pr\xF3xima semana":"Next week",date:oe,display:o==="es"?"lun.":"mon."},{label:o==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:L,display:L.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:o==="es"?"2 semanas":"2 weeks",date:Y,display:Y.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:o==="es"?"4 semanas":"4 weeks",date:K,display:K.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}]};if(l){let C=r&&n==="start"?w:D;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:c("w-4 h-4",s?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm",s?"text-white/60":"text-gray-500"),children:S(C)})]})}let A=r&&n==="start"?w:D;return jsxRuntime.jsxs("div",{ref:x,className:"relative",children:[jsxRuntime.jsxs("button",{ref:y,onClick:C=>{C.stopPropagation(),u(!i);let _=n==="start"?w:D;_&&f(new Date(_.getFullYear(),_.getMonth(),1));},className:c("flex items-center gap-2 px-2 py-1 rounded transition-colors",s?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:c("w-4 h-4",s?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm",s?"text-white/60":"text-gray-500"),children:S(A)})]}),i&&h&&reactDom.createPortal(jsxRuntime.jsxs("div",{ref:b,className:c("rounded-xl shadow-2xl overflow-hidden flex",s?"bg-[#1A1A1A] border border-[#222]":"bg-white border border-gray-200"),style:{position:"fixed",top:h.flipUp?void 0:h.top,bottom:h.flipUp?window.innerHeight-h.top:void 0,left:h.left,zIndex:10001},onClick:C=>C.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:c("w-44 py-2 border-r",s?"border-[#222]":"border-gray-200"),children:[F().map((C,_)=>jsxRuntime.jsxs("button",{className:c("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",s?"hover:bg-white/[0.05] text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>T(C.date),children:[jsxRuntime.jsx("span",{children:C.label}),jsxRuntime.jsx("span",{className:c("text-xs",s?"text-white/30":"text-gray-400"),children:C.display})]},_)),jsxRuntime.jsx("div",{className:c("border-t mt-2 pt-2",s?"border-[#222]":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{r?n==="start"?a(void 0,D||void 0):a(w||void 0,void 0):a(void 0,void 0),u(false);},className:c("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",s?"hover:bg-white/[0.05] text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:o==="es"?"Quitar fecha":"Clear date"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[!r&&jsxRuntime.jsx("div",{className:c("text-xs mb-3 px-2 py-1 rounded",s?"bg-white/[0.03] text-white/60":"bg-gray-100 text-gray-600"),children:m==="start"?o==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":o==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:c("font-medium",s?"text-white":"text-gray-900"),children:g.toLocaleDateString(o==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>f(new Date),className:c("p-1 rounded text-sm transition-colors",s?"hover:bg-white/[0.05] text-white":"hover:bg-gray-100 text-gray-700"),children:o==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>f(new Date(g.getFullYear(),g.getMonth()-1)),className:c("p-1 rounded",s?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:c("w-4 h-4",s?"text-white":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:()=>f(new Date(g.getFullYear(),g.getMonth()+1)),className:c("p-1 rounded",s?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:c("w-4 h-4",s?"text-white":"text-gray-600")})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(o==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(C=>jsxRuntime.jsx("div",{className:c("w-8 h-8 flex items-center justify-center text-xs",s?"text-white/30":"text-gray-400"),children:C},C))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:M().map((C,_)=>{let W=C.date.toDateString()===new Date().toDateString(),oe=w?.toDateString()===C.date.toDateString(),L=D?.toDateString()===C.date.toDateString(),Y=oe||L,K=!r&&w&&D&&C.date>=w&&C.date<=D;return jsxRuntime.jsx("button",{onClick:()=>T(new Date(C.date)),className:c("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!C.isCurrentMonth&&(s?"text-white/20":"text-gray-300"),C.isCurrentMonth&&(s?"text-white":"text-gray-900"),W&&"ring-2 ring-[#00E5CC]",oe&&"bg-[#00E5CC] text-white",L&&!oe&&"bg-[#7C3AED] text-white",K&&!Y&&(s?"bg-[#7C3AED]/20":"bg-purple-100"),!Y&&(s?"hover:bg-white/[0.05]":"hover:bg-gray-100")),children:C.date.getDate()},_)})})]})]}),document.body)]})}function Qi({value:e,onChange:t,isDark:a,locale:r,disabled:n=false,dateField:s="end",startDate:o,endDate:l}){let d=e?e instanceof Date?e:new Date(e):null;return jsxRuntime.jsx(ng,{startDate:s==="start"?d:o||null,endDate:s==="end"?d:l||null,onChange:(p,g)=>{t&&t(s==="start"?p:g);},singleDateMode:true,singleDateField:s,isDark:a,locale:r,disabled:n||!t,placeholder:"-"})}function Yn(e=600){let[t,a]=react.useState(false),r=react.useRef(null),n=react.useCallback(()=>{r.current&&clearTimeout(r.current),a(true),r.current=setTimeout(()=>{a(false);},e);},[e]);return react.useEffect(()=>()=>{r.current&&clearTimeout(r.current);},[]),{isFlashing:t,triggerFlash:n}}function Zi(e,t={}){let{enabled:a=true,duration:r=400,steps:n=8}=t,[s,o]=react.useState(e),[l,d]=react.useState(false),i=react.useRef(e),u=react.useRef([]);return react.useEffect(()=>{if(u.current.forEach(clearTimeout),u.current=[],!a||e===i.current||e===void 0){o(e),i.current=e;return}let m=i.current??0,p=e,g=p-m,f=r/n;d(true);for(let x=1;x<=n;x++){let y=setTimeout(()=>{let b=x/n,h=1-Math.pow(1-b,3),v=Math.round(m+g*h);o(v),x===n&&(d(false),o(p));},f*x);u.current.push(y);}return i.current=e,()=>{u.current.forEach(clearTimeout),u.current=[];}},[e,a,r,n]),{displayValue:s,isAnimating:l}}function sg(e,t={}){let{delay:a=1500,onCancel:r}=t,[n,s]=react.useState(null),[o,l]=react.useState(0),d=react.useRef(null),i=react.useRef(null),u=react.useCallback(g=>{d.current&&clearTimeout(d.current),i.current&&clearInterval(i.current),s(g),l(0);let f=Date.now();i.current=setInterval(()=>{let x=Date.now()-f,y=Math.min(x/a*100,100);l(y);},16),d.current=setTimeout(()=>{i.current&&clearInterval(i.current),e?.(g),s(null),l(0);},a);},[a,e]),m=react.useCallback(()=>{d.current&&clearTimeout(d.current),i.current&&clearInterval(i.current),s(null),l(0),r?.();},[r]);return react.useEffect(()=>()=>{d.current&&clearTimeout(d.current),i.current&&clearInterval(i.current);},[]),{pendingValue:n,isPending:n!==null,progress:o,startChange:u,cancelChange:m}}function lg({value:e=0,onChange:t,isDark:a,disabled:r=false,enableSlotMachine:n=true,enableSaveFlash:s=true}){let[o,l]=react.useState(false),[d,i]=react.useState(""),u=react.useRef(null),{isFlashing:m,triggerFlash:p}=Yn(),{displayValue:g,isAnimating:f}=Zi(e,{enabled:n,duration:300,steps:6}),x=w=>{if(r||!t)return;w.stopPropagation();let D=w.currentTarget.getBoundingClientRect(),S=w.clientX-D.left,M=Math.round(S/D.width*100),T=Math.max(0,Math.min(100,M));T!==e&&(t(T),s&&p());},y=react.useCallback(w=>{r||!t||(w.stopPropagation(),i(String(e)),l(true));},[r,t,e]);react.useEffect(()=>{o&&u.current&&(u.current.focus(),u.current.select());},[o]);let b=react.useCallback(()=>{l(false);let w=parseInt(d,10);if(!isNaN(w)&&t){let D=Math.max(0,Math.min(100,w));D!==e&&(t(D),s&&p());}},[d,t,e,s,p]),h=react.useCallback(w=>{w.key==="Enter"&&b(),w.key==="Escape"&&l(false);},[b]),v=g??e;return jsxRuntime.jsxs("div",{className:c("flex items-center gap-2 w-full rounded px-1 py-0.5 transition-[background-color] duration-300",m&&(a?"bg-[#3BF06E]/30":"bg-[#3BF06E]/20")),children:[v>0?jsxRuntime.jsx("div",{onClick:x,className:c("flex-1 h-2 rounded-full overflow-hidden",a?"bg-white/[0.05]":"bg-gray-200",!r&&t&&"cursor-pointer"),children:jsxRuntime.jsx("div",{className:c("h-full rounded-full transition-[width]",v===100?"bg-[#3BF06E]":"bg-[#3B9EFF]",f&&"transition-none"),style:{width:`${v}%`}})}):jsxRuntime.jsx("div",{className:"flex-1"}),o?jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",onClick:w=>w.stopPropagation(),children:[jsxRuntime.jsx("input",{ref:u,value:d,onChange:w=>i(w.target.value.replace(/[^0-9]/g,"")),onBlur:b,onKeyDown:h,maxLength:3,className:c("w-8 text-xs text-right tabular-nums font-mono rounded border px-1 py-0 outline-none",a?"bg-white/10 border-white/20 text-white focus:border-[#00E5CC]":"bg-white border-gray-300 text-gray-900 focus:border-[#00E5CC]")}),jsxRuntime.jsx("span",{className:c("text-xs font-mono",a?"text-white/40":"text-gray-400"),children:"%"})]}):jsxRuntime.jsxs("span",{onClick:y,className:c("text-xs w-8 text-right tabular-nums font-mono rounded px-1",v===0?a?"text-[#6B7280]":"text-gray-400":a?"text-white/60":"text-gray-500",!r&&t&&"cursor-pointer hover:bg-white/[0.08]",f&&"font-medium scale-105"),title:!r&&t?"Click to edit":void 0,children:[v,"%"]})]})}function ug({value:e="",onChange:t,isDark:a,placeholder:r="-",disabled:n=false}){let[s,o]=react.useState(false),[l,d]=react.useState(e),i=react.useRef(null);react.useEffect(()=>{s&&i.current&&(i.current.focus(),i.current.select());},[s]),react.useEffect(()=>{d(e);},[e]);let u=()=>{l!==e&&t?.(l),o(false);},m=p=>{p.key==="Enter"?u():p.key==="Escape"&&(d(e),o(false));};return n||!t?jsxRuntime.jsx("span",{className:c("text-sm truncate",a?"text-white/60":"text-gray-500"),children:e||r}):s?jsxRuntime.jsx("input",{ref:i,type:"text",value:l,onChange:p=>d(p.target.value),onBlur:u,onKeyDown:m,onClick:p=>p.stopPropagation(),className:c("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/[0.03] border-[#00E5CC] text-white":"bg-white border-[#00E5CC] text-gray-900")}):jsxRuntime.jsx("button",{onClick:p=>{p.stopPropagation(),o(true);},className:c("text-sm truncate text-left w-full px-2 py-1 rounded transition-colors",a?"text-white/60 hover:bg-white/[0.05]":"text-gray-500 hover:bg-gray-100",!e&&(a?"text-white/30":"text-gray-400")),children:e||r})}function gg({value:e,onChange:t,isDark:a,placeholder:r="-",min:n,max:s,disabled:o=false,enableSlotMachine:l=true,enableSaveFlash:d=true}){let[i,u]=react.useState(false),[m,p]=react.useState(e?.toString()||""),g=react.useRef(null),{isFlashing:f,triggerFlash:x}=Yn(),{displayValue:y,isAnimating:b}=Zi(e,{enabled:l&&!i});react.useEffect(()=>{i&&g.current&&(g.current.focus(),g.current.select());},[i]),react.useEffect(()=>{p(e?.toString()||"");},[e]);let h=()=>{let w=parseFloat(m);if(!isNaN(w)){let D=w;n!==void 0&&(D=Math.max(n,D)),s!==void 0&&(D=Math.min(s,D)),D!==e&&(t?.(D),d&&x());}u(false);},v=w=>{w.key==="Enter"?h():w.key==="Escape"&&(p(e?.toString()||""),u(false));};return o||!t?jsxRuntime.jsx("span",{className:c("text-sm font-mono",a?"text-white/60":"text-gray-500",b&&"font-medium"),children:y!==void 0?y:r}):i?jsxRuntime.jsx("input",{ref:g,type:"number",value:m,onChange:w=>p(w.target.value),onBlur:h,onKeyDown:v,onClick:w=>w.stopPropagation(),min:n,max:s,className:c("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/[0.03] border-[#00E5CC] text-white":"bg-white border-[#00E5CC] text-gray-900")}):jsxRuntime.jsx("button",{onClick:w=>{w.stopPropagation(),u(true);},className:c("text-sm text-left w-full px-2 py-1 rounded transition-[background-color] duration-300",a?"text-white/60 hover:bg-white/[0.05]":"text-gray-500 hover:bg-gray-100",y===void 0&&(a?"text-white/30":"text-gray-400"),f&&(a?"bg-green-500/30":"bg-green-500/20"),b&&"font-medium scale-105"),children:y!==void 0?y:r})}function fg({value:e,options:t=[],onChange:a,isDark:r,placeholder:n="-",disabled:s=false}){let[o,l]=react.useState(false),d=react.useRef(null);return react.useEffect(()=>{let i=u=>{d.current&&!d.current.contains(u.target)&&l(false);};return o&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[o]),s||!a?jsxRuntime.jsx("span",{className:c("text-sm",r?"text-white/60":"text-gray-500"),children:e||n}):jsxRuntime.jsxs("div",{ref:d,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:i=>{i.stopPropagation(),l(!o);},className:c("flex items-center gap-2 px-2 py-1 rounded transition-colors min-w-[80px]",r?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{className:c("text-sm flex-1 text-left truncate",r?"text-white/60":"text-gray-500",!e&&(r?"text-white/30":"text-gray-400")),children:e||n}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-3 h-3 flex-shrink-0",r?"text-white/30":"text-gray-400")})]}),o&&jsxRuntime.jsx("div",{className:c("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px] max-h-48 overflow-y-auto",r?"bg-[#1A1A1A] border-[#222]":"bg-white border-gray-200"),children:t.length===0?jsxRuntime.jsx("p",{className:c("px-3 py-2 text-sm",r?"text-white/30":"text-gray-400"),children:"No options"}):t.map(i=>jsxRuntime.jsxs("button",{onClick:u=>{u.stopPropagation(),a(i),l(false);},className:c("w-full flex items-center justify-between gap-2 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/[0.05]":"hover:bg-gray-100",e===i&&(r?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:i}),e===i&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-[#00E5CC]"})]},i))})]})}function hg({value:e=false,onChange:t,isDark:a,disabled:r=false,enableDelayedConfirm:n=true,confirmDelay:s=1500}){let{pendingValue:o,isPending:l,progress:d,startChange:i,cancelChange:u}=sg(t,{delay:s}),m=g=>{g.stopPropagation(),!r&&t&&(n?l?u():i(!e):t(!e));},p=l?o:e;return jsxRuntime.jsxs("div",{className:"relative inline-flex items-center gap-1",children:[jsxRuntime.jsxs("button",{onClick:m,disabled:r||!t,className:c("relative w-5 h-5 rounded border-2 flex items-center justify-center transition-[border-color,background-color,box-shadow]",p?"bg-[#00E5CC] border-[#00E5CC]":a?"border-[#333] hover:border-[#6B7280]":"border-gray-300 hover:border-gray-400",(r||!t)&&"opacity-50 cursor-not-allowed",l&&"ring-2 ring-offset-1",l&&p&&"ring-green-500/50",l&&!p&&"ring-red-500/50",l&&(a?"ring-offset-[#050505]":"ring-offset-white")),children:[l&&jsxRuntime.jsx("svg",{className:"absolute inset-0 w-full h-full -rotate-90",viewBox:"0 0 20 20",children:jsxRuntime.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:p?"#22C55E":"#EF4444",strokeWidth:"2",strokeDasharray:`${d/100*50.26} 50.26`,className:"transition-all duration-100"})}),l?jsxRuntime.jsx(lucideReact.Loader2,{className:"w-3 h-3 text-white animate-spin"}):p?jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"}):null]}),l&&jsxRuntime.jsx("button",{onClick:g=>{g.stopPropagation(),u();},className:c("w-4 h-4 rounded-full flex items-center justify-center transition-colors",a?"bg-red-500/20 hover:bg-red-500/40 text-red-400":"bg-red-100 hover:bg-red-200 text-red-500"),title:"Cancelar",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]})}function vg({value:e=[],isDark:t,maxVisible:a=2}){if(e.length===0)return jsxRuntime.jsx("span",{className:c("text-sm",t?"text-white/30":"text-gray-400"),children:"-"});let r=e.slice(0,a),n=e.length-a;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[r.map(s=>jsxRuntime.jsx("span",{className:"inline-flex items-center px-2 py-0.5 text-[9px] font-mono uppercase tracking-wide rounded",style:{backgroundColor:s.color?`${s.color}20`:t?"rgba(255,255,255,0.05)":"#F3F4F6",color:s.color||(t?"rgba(255,255,255,0.5)":"#6B7280")},children:s.name},s.id)),n>0&&jsxRuntime.jsxs("span",{className:c("inline-flex items-center px-2 py-0.5 text-xs rounded-full",t?"bg-white/[0.05] text-white/60":"bg-gray-100 text-gray-500"),children:["+",n]})]})}function o1(e,t="en"){if(e==null||e===0||!e||Number(e)===0)return "-";let a=Math.floor(e/60),r=e%60;return a===0?`${r}m`:r===0?`${a}h`:`${a}h ${r}m`}function n1(e){let t=e.trim().toLowerCase();if(!t||t==="-")return null;let a=t.match(/^(\d+):(\d+)$/);if(a&&a[1]&&a[2]){let l=parseInt(a[1],10),d=parseInt(a[2],10);return l*60+d}let r=t.match(/^(\d+\.?\d*)\s*h\s*(\d+)?\s*(m|min)?$/);if(r&&r[1]){let l=parseFloat(r[1]),d=r[2]?parseInt(r[2],10):0;return Math.round(l*60)+d}let n=t.match(/^(\d+\.?\d*)\s*h$/);if(n&&n[1])return Math.round(parseFloat(n[1])*60);let s=t.match(/^(\d+)\s*(m|min)$/);if(s&&s[1])return parseInt(s[1],10);let o=parseFloat(t);return isNaN(o)?null:Math.round(o*60)}function Mr({value:e,onChange:t,isDark:a,locale:r="en",placeholder:n,disabled:s=false,enableSaveFlash:o=true,isBlurred:l=false,lens:d="hours",hourlyRate:i=0,financialOverride:u}){let[m,p]=react.useState(false),[g,f]=react.useState(""),x=react.useRef(null),{isFlashing:y,triggerFlash:b}=Yn(),h=d==="financial"&&(i>0||u!=null),v=u??(e?e/60*i:0),w=h&&(u!=null?u>0:e)?`$${Math.round(v).toLocaleString("en-US")}`:o1(e,r);react.useEffect(()=>{m&&x.current&&(x.current.focus(),x.current.select());},[m]),react.useEffect(()=>{if(e){let T=Math.floor(e/60),F=e%60;T>0&&F>0?f(`${T}h ${F}m`):T>0?f(`${T}h`):f(`${F}m`);}else f("");},[e,m]);let D=()=>{let T=n1(g);T!==e&&(t?.(T),o&&b()),p(false);},S=T=>{T.key==="Enter"?D():T.key==="Escape"&&p(false);};if(l)return jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",title:r==="es"?"No tienes permisos para ver este dato":"You don't have permission to view this data",children:[jsxRuntime.jsx(lucideReact.Clock,{className:c("w-3.5 h-3.5 flex-shrink-0",a?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm select-none blur-[4px] opacity-60 pointer-events-none",a?"text-white/60":"text-gray-500"),"aria-hidden":"true",children:"\u2022\u2022\u2022\u2022"})]});let M=h?lucideReact.DollarSign:lucideReact.Clock;return s||!t?!e||e===0?null:jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[jsxRuntime.jsx(M,{className:c("w-3.5 h-3.5 flex-shrink-0",a?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm font-mono",a?"text-white/60":"text-gray-500"),children:w})]}):m?jsxRuntime.jsx("input",{ref:x,type:"text",value:g,onChange:T=>f(T.target.value),onBlur:D,onKeyDown:S,onClick:T=>T.stopPropagation(),placeholder:"8 (=8h), 1h 30m",className:c("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/[0.03] border-[#00E5CC] text-white placeholder:text-white/30":"bg-white border-[#00E5CC] text-gray-900 placeholder:text-gray-400")}):jsxRuntime.jsxs("button",{onClick:T=>{T.stopPropagation(),p(true);},className:c("flex items-center justify-center gap-1 text-sm w-full px-1.5 py-1 rounded transition-[background-color] duration-300 overflow-hidden",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",e!=null&&e>0?a?"text-white/60":"text-gray-600":a?"text-white/30":"text-gray-400",y&&(a?"bg-green-500/30":"bg-green-500/20")),children:[e!=null&&e>0&&jsxRuntime.jsx(M,{className:c("w-3 h-3 flex-shrink-0",a?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:"truncate font-mono",children:w})]})}function Tg({startDate:e,endDate:t,scheduleVariance:a,isDark:r,locale:n="en",hasTimeAllocated:s=true}){if(!e&&!t)return jsxRuntime.jsx("span",{className:c("text-[11px] font-mono",r?"text-white/30":"text-gray-400"),children:"-"});let o=d=>d.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"short",day:"numeric"}),l=()=>{if(a==null)return null;let d=n==="es";return a===0?s?jsxRuntime.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#10B981",fontWeight:600},children:d?"En Tiempo":"On Track"}):jsxRuntime.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:r?"rgba(255,255,255,0.3)":"#94A3B8",fontWeight:500},children:d?"Tiempo no asignado":"No time allocated"}):a>0?jsxRuntime.jsxs("span",{className:"font-mono",style:{fontSize:"10px",color:"#3BF06E",fontWeight:600},children:["+",a,"d ",d?"Adelante":"Early"]}):jsxRuntime.jsxs("span",{className:"font-mono",style:{fontSize:"10px",color:"#F87171",fontWeight:600},children:[a,"d ",d?"Atraso":"Delay"]})};return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[jsxRuntime.jsxs("span",{className:c("text-[11px] font-mono",r?"text-white/60":"text-gray-500"),children:[e?o(e):"\u2014",jsxRuntime.jsx("span",{className:r?"text-white/20 mx-1":"text-gray-300 mx-1",children:"vs"}),t?o(t):"\u2014"]}),l()]})}function Dg({task:e,isDark:t,locale:a="en",onLogTime:r,onEstimateUpdate:n,onSoldEffortUpdate:s,onOpenTimeLog:o,lens:l="hours",hourlyRate:d=0}){let i=a==="es",u=l==="financial"&&d>0,m=K=>u?`$${Math.round(K*d).toLocaleString("en-US")}`:`${K}h`,[p,g]=react.useState(false),[f,x]=react.useState(false),[y,b]=react.useState(null),h=react.useRef(null),v=e.timeLoggedMinutes||0,w=e.effortMinutes||0,D=e.soldEffortMinutes||0,S=Math.round(v/60*10)/10,M=Math.round(w/60*10)/10,T=w>0?v/w*100:0,F=T>100?Math.round((v-w)/60*10)/10:0,A=T>100?"#EF4444":"#00E5CC";react.useEffect(()=>{if(!f&&!y)return;let K=V=>{h.current&&!h.current.contains(V.target)&&(x(false),b(null));};return document.addEventListener("mousedown",K),()=>document.removeEventListener("mousedown",K)},[f,y]);let C=K=>{if(K.stopPropagation(),r&&!n&&!s){b("log");return}if(r||n||s){x(V=>!V),b(null);return}o&&o(e);},_=K=>{x(false),b(K);},W=async(K,V)=>{y==="log"&&r&&K?r(e,K,V):y==="estimate"&&n?n(e,K):y==="quoted"&&s&&s(e,K),b(null);},oe=r||n||s||o,L=[{mode:"log",icon:lucideReact.Clock,label:i?"Registrar tiempo":"Log time",show:!!r},{mode:"estimate",icon:lucideReact.Target,label:i?"Estimaci\xF3n":"Estimate",show:!!n},{mode:"quoted",icon:lucideReact.DollarSign,label:i?"T. Ofertado":"Quoted time",show:!!s}].filter(K=>K.show),Y=y==="estimate"?w:y==="quoted"?D:void 0;return w===0&&v===0&&D===0?jsxRuntime.jsxs("div",{ref:h,className:"relative flex items-center gap-2",onClick:K=>K.stopPropagation(),onMouseEnter:()=>g(true),onMouseLeave:()=>g(false),children:[jsxRuntime.jsx("span",{className:c("text-[11px] font-mono",t?"text-white/30":"text-gray-400"),children:"\u2014"}),p&&oe&&jsxRuntime.jsx("button",{onClick:C,className:"flex items-center justify-center w-6 h-6 rounded-md transition-colors",style:{color:t?"rgba(255,255,255,0.35)":"#9CA3AF",backgroundColor:"transparent"},onMouseEnter:K=>{K.currentTarget.style.color=t?"rgba(255,255,255,0.8)":"#374151",K.currentTarget.style.backgroundColor=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:K=>{K.currentTarget.style.color=t?"rgba(255,255,255,0.35)":"#9CA3AF",K.currentTarget.style.backgroundColor="transparent";},title:i?"+ Tiempo":"+ Time",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:f&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.1},className:"absolute right-0 top-full mt-1 z-50",style:{background:t?"rgba(10,10,10,0.95)":"#FFFFFF",border:t?"1px solid rgba(255,255,255,0.10)":"1px solid #E5E7EB",borderRadius:8,boxShadow:t?"0 8px 32px rgba(0,0,0,0.6)":"0 8px 32px rgba(0,0,0,0.12)",backdropFilter:"blur(16px)",overflow:"hidden",minWidth:160},children:L.map(K=>jsxRuntime.jsxs("button",{onClick:V=>{V.stopPropagation(),_(K.mode);},className:"w-full flex items-center gap-2 px-3 py-2 text-left transition-colors",style:{fontSize:11,fontFamily:"'JetBrains Mono', monospace",color:t?"rgba(255,255,255,0.7)":"#374151",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:V=>{V.target.style.background=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:V=>{V.target.style.background="transparent";},children:[jsxRuntime.jsx(K.icon,{style:{width:12,height:12,flexShrink:0,opacity:.5}}),K.label]},K.mode))})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsx("div",{className:"absolute right-0 top-full mt-1 z-50",children:jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.12},children:jsxRuntime.jsx(io,{mode:y,locale:a,isDark:t,currentValue:Y||void 0,onSave:W,onClose:()=>b(null)})})})})]}):jsxRuntime.jsxs("div",{ref:h,className:"relative flex items-center gap-2 w-full",onClick:K=>K.stopPropagation(),onMouseEnter:()=>g(true),onMouseLeave:()=>g(false),children:[jsxRuntime.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",style:{padding:"8px 12px",borderRadius:"4px",border:t?"1px solid #333":"1px solid #E5E7EB",backgroundColor:t?"#1A1A1A":"#F9FAFB"},children:[(()=>{let K=v===0,B=(w>0?v/w:0)>1.1;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"font-mono",style:{fontSize:13,fontWeight:700,color:K?t?"#4B5563":"#9CA3AF":t?"#FFFFFF":"#111827"},children:m(S)}),w>0&&jsxRuntime.jsxs("span",{className:"font-mono",style:{fontSize:11,color:t?"rgba(255,255,255,0.3)":"#9CA3AF"},children:["/ ",m(M)]}),F>0&&jsxRuntime.jsxs("span",{className:"font-mono px-1.5 py-0.5 rounded",style:{fontSize:10,color:B?"#EF4444":t?"rgba(255,255,255,0.5)":"#6B7280",backgroundColor:B?"rgba(239,68,68,0.15)":"transparent"},children:["+",m(F)," ",i?"Excedido":"Over"]})]})})(),w>0&&jsxRuntime.jsx("div",{className:"w-full overflow-hidden",style:{height:3,backgroundColor:t?"#333":"#E5E7EB",borderRadius:2},children:jsxRuntime.jsx("div",{style:{height:"100%",width:`${Math.min(T,100)}%`,backgroundColor:A,borderRadius:2,transition:"width 0.3s"}})})]}),oe&&jsxRuntime.jsx("button",{onClick:C,className:"flex-shrink-0 flex items-center justify-center w-7 h-7 rounded-md transition-all duration-150",style:{opacity:p?1:0,pointerEvents:p?"auto":"none",color:t?"rgba(255,255,255,0.35)":"#9CA3AF",backgroundColor:"transparent",border:"none"},onMouseEnter:K=>{K.currentTarget.style.color=t?"rgba(255,255,255,0.8)":"#374151",K.currentTarget.style.backgroundColor=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:K=>{K.currentTarget.style.color=t?"rgba(255,255,255,0.35)":"#9CA3AF",K.currentTarget.style.backgroundColor="transparent";},title:i?"+ Tiempo":"+ Time",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:f&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.1},className:"absolute right-0 top-full mt-1 z-50",style:{background:t?"rgba(10,10,10,0.95)":"#FFFFFF",border:t?"1px solid rgba(255,255,255,0.10)":"1px solid #E5E7EB",borderRadius:8,boxShadow:t?"0 8px 32px rgba(0,0,0,0.6)":"0 8px 32px rgba(0,0,0,0.12)",backdropFilter:"blur(16px)",overflow:"hidden",minWidth:160},children:L.map(K=>jsxRuntime.jsxs("button",{onClick:V=>{V.stopPropagation(),_(K.mode);},className:"w-full flex items-center gap-2 px-3 py-2 text-left transition-colors",style:{fontSize:11,fontFamily:"'JetBrains Mono', monospace",color:t?"rgba(255,255,255,0.7)":"#374151",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:V=>{V.target.style.background=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:V=>{V.target.style.background="transparent";},children:[jsxRuntime.jsx(K.icon,{style:{width:12,height:12,flexShrink:0,opacity:.5}}),K.label]},K.mode))})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsx("div",{className:"absolute right-0 top-full mt-1 z-50",children:jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.12},children:jsxRuntime.jsx(io,{mode:y,locale:a,isDark:t,currentValue:Y||void 0,onSave:W,onClose:()=>b(null)})})})})]})}function p1(e){let t=new Map;function a(r){if(r.assignees)for(let n of r.assignees)n.name&&!t.has(n.name)&&t.set(n.name,n);if(r.subtasks)for(let n of r.subtasks)a(n);}return a(e),Array.from(t.values())}function m1(e){return e>100?{bg:"rgba(239,68,68,0.15)",text:"#EF4444"}:e>=86?{bg:"rgba(245,158,11,0.15)",text:"#F59E0B"}:e>=61?{bg:"rgba(0,229,204,0.15)",text:"#00E5CC"}:{bg:"rgba(34,197,94,0.15)",text:"#22C55E"}}function Sg({assignee:e,size:t=28,isDark:a}){let r=t===28?"w-7 h-7":t===24?"w-6 h-6":"w-5 h-5",n=t===28?"text-[10px]":"text-[9px]";return e.avatar?jsxRuntime.jsx("img",{src:e.avatar,alt:e.name,className:c(r,"rounded-full object-cover ring-1 flex-shrink-0",a?"ring-white/10":"ring-gray-200")}):jsxRuntime.jsx("div",{className:c(r,"rounded-full flex items-center justify-center font-bold text-white ring-1 flex-shrink-0",n,a?"ring-white/10":"ring-gray-200"),style:{backgroundColor:e.color||"#6B7280"},children:e.initials||e.name?.charAt(0)?.toUpperCase()||"?"})}function Eg({task:e,isDark:t,locale:a="en"}){let r=a==="es",n=!!e.hasChildren,s=e.assignees?.[0],o=e.teamLoad;if(n){let u=p1(e);if(u.length===0)return null;let m=u.slice(0,3),p=u.length-3;return jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("div",{className:"flex -space-x-2",children:m.map((g,f)=>jsxRuntime.jsx(Sg,{assignee:g,size:24,isDark:t},g.name+f))}),p>0&&jsxRuntime.jsxs("span",{className:c("ml-1 text-[10px] font-mono",t?"text-white/40":"text-gray-400"),title:u.slice(3).map(g=>g.name).join(", "),children:["+",p]})]})}if(!s)return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:c("w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0",t?"bg-white/5":"bg-gray-100"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5",style:{color:"#4B5563"}})}),jsxRuntime.jsx("span",{className:c("text-[11px]",t?"text-white/30":"text-gray-400"),children:r?"Sin asignar":"Unassigned"})]});let l=o?.percentage??0,d=!!o&&l>0,i=d?m1(l):null;return jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Sg,{assignee:s,size:28,isDark:t}),jsxRuntime.jsx("span",{className:c("text-[13px] truncate",t?"text-white":"text-gray-900"),style:{maxWidth:"100px"},children:s.name})]}),d&&i&&jsxRuntime.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono uppercase tracking-wide w-fit font-semibold",style:{backgroundColor:i.bg,color:i.text},children:[l,"% LOAD"]})]})}var g1={critical:"bg-[#FF2D20]/15 text-[#FF2D20]",warning:"bg-[#FFD60A]/15 text-[#FFD60A]",info:"bg-[#3B9EFF]/15 text-[#3B9EFF]"};function Pg({blockers:e,isDark:t,locale:a="en"}){return !e||e.length===0?jsxRuntime.jsx("span",{className:c("text-[9px] font-mono uppercase tracking-wide",t?"text-white/20":"text-gray-400"),children:a==="es"?"Ninguno":"None"}):jsxRuntime.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:e.map((r,n)=>jsxRuntime.jsxs("span",{className:c("px-1.5 py-0.5 rounded text-[9px] font-mono uppercase tracking-wide whitespace-nowrap",g1[r.severity]),children:[r.type," #",r.id]},`${r.type}-${r.id}-${n}`))})}function M1(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function P1(e){let t=["blue","green","purple","pink","yellow","red","indigo","teal"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"blue"}function Rg({state:e,onClose:t,isDark:a,locale:r,onTaskEdit:n,onTaskDuplicate:s,onTaskDelete:o,onTaskUpdate:l,onColumnHide:d,onColumnSort:i,availableUsers:u=[],onOpenTimeLog:m,onReportBlocker:p,onCopyTaskLink:g,onTaskMove:f,onTaskIndent:x,onTaskOutdent:y}){let b=react.useRef(null),h=r==="es"?Lg.es:Lg.en;if(react.useEffect(()=>{let M=F=>{b.current&&!b.current.contains(F.target)&&t();},T=F=>{F.key==="Escape"&&t();};return document.addEventListener("mousedown",M),document.addEventListener("keydown",T),()=>{document.removeEventListener("mousedown",M),document.removeEventListener("keydown",T);}},[t]),!e.isOpen)return null;let v=()=>{if(!e.task)return [];let M=[];return n&&M.push({id:"edit",label:h.edit,icon:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),onClick:()=>{n(e.task),t();}}),M.push({id:"sep1",label:"",icon:null,separator:true}),l&&(M.push({id:"status",label:h.changeStatus,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),submenu:[{id:"status-todo",label:h.todo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4 text-gray-400"}),onClick:()=>{l({...e.task,status:"todo",progress:0}),t();}},{id:"status-in-progress",label:h.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4 text-[#00E5CC]"}),onClick:()=>{l({...e.task,status:"in-progress",progress:e.task.progress||50}),t();}},{id:"status-completed",label:h.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4 text-green-500"}),onClick:()=>{l({...e.task,status:"completed",progress:100}),t();}}]}),M.push({id:"priority",label:h.changePriority,icon:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),submenu:[{id:"priority-urgent",label:h.urgent,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),onClick:()=>{l({...e.task,priority:"urgent"}),t();}},{id:"priority-high",label:h.high,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-orange-500"}),onClick:()=>{l({...e.task,priority:"high"}),t();}},{id:"priority-medium",label:h.medium,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),onClick:()=>{l({...e.task,priority:"medium"}),t();}},{id:"priority-low",label:h.low,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-[#00E5CC]"}),onClick:()=>{l({...e.task,priority:"low"}),t();}}]}),u.length>0&&M.push({id:"assign",label:h.assignUser,icon:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),submenu:u.slice(0,5).map(T=>({id:`assign-${T.id}`,label:T.name,icon:jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] text-white bg-[#00E5CC]",children:T.name.charAt(0).toUpperCase()}),onClick:()=>{let F=e.task.assignees||[],C=F.some(_=>_.name===T.name)?F.filter(_=>_.name!==T.name):[...F,{name:T.name,initials:M1(T.name),color:T.color||P1(T.name),avatar:T.avatarUrl}];l({...e.task,assignees:C}),t();}}))})),m&&M.push({id:"log-time",label:h.logTime,icon:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),onClick:()=>{m(e.task),t();}}),p&&M.push({id:"report-blocker",label:h.reportBlocker,icon:jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-4 h-4"}),onClick:()=>{p(e.task),t();}}),g&&M.push({id:"copy-link",label:h.copyLink,icon:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),onClick:()=>{g(e.task),t();}}),M.push({id:"sep2",label:"",icon:null,separator:true}),s&&M.push({id:"duplicate",label:h.duplicate,icon:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),onClick:()=>{s(e.task),t();}}),(f||x||y)&&(M.push({id:"sep3",label:"",icon:null,separator:true}),f&&(M.push({id:"move-up",label:h.moveUp,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{f(e.task.id,"up"),t();}}),M.push({id:"move-down",label:h.moveDown,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{f(e.task.id,"down"),t();}})),x&&M.push({id:"indent",label:h.indent,icon:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"}),onClick:()=>{x(e.task.id),t();}}),y&&M.push({id:"outdent",label:h.outdent,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4 -rotate-90"}),onClick:()=>{y(e.task.id),t();}})),o&&M.push({id:"delete",label:h.delete,icon:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),danger:true,onClick:()=>{o(e.task.id),t();}}),M},w=()=>{if(!e.columnId)return [];let M=[];return i&&(M.push({id:"sort-asc",label:h.sortAsc,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"asc"),t();}}),M.push({id:"sort-desc",label:h.sortDesc,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"desc"),t();}})),d&&e.columnId!=="name"&&(M.push({id:"sep-hide",label:"",icon:null,separator:true}),M.push({id:"hide",label:h.hideColumn,icon:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),onClick:()=>{d(e.columnId),t();}})),M},D=e.type==="task"?v():w(),S={position:"fixed",left:e.x,top:e.y,zIndex:9999};return jsxRuntime.jsx("div",{ref:b,style:S,className:c("py-1 rounded-lg shadow-xl border min-w-[180px]",a?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:D.map(M=>M.separator?jsxRuntime.jsx("div",{className:c("my-1 h-px",a?"bg-white/[0.05]":"bg-gray-200")},M.id):M.submenu?jsxRuntime.jsx(F1,{item:M,isDark:a},M.id):jsxRuntime.jsxs("button",{onClick:M.onClick,className:c("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",M.danger?"text-red-500 hover:text-red-600":a?"text-white":"text-gray-700"),children:[jsxRuntime.jsx("span",{className:c(M.danger?"text-red-500":a?"text-white/60":"text-gray-400"),children:M.icon}),M.label]},M.id))})}function F1({item:e,isDark:t}){let[a,r]=react.useState(false),n=react.useRef();return jsxRuntime.jsxs("div",{className:"relative",onMouseEnter:()=>{n.current&&clearTimeout(n.current),r(true);},onMouseLeave:()=>{n.current=setTimeout(()=>r(false),150);},children:[jsxRuntime.jsxs("button",{className:c("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/[0.05] text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-white/60":"text-gray-400",children:e.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:e.label}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:c("w-4 h-4",t?"text-white/30":"text-gray-400")})]}),a&&e.submenu&&jsxRuntime.jsx("div",{className:c("absolute left-full top-0 ml-1 py-1 rounded-lg shadow-xl border min-w-[160px]",t?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:e.submenu.map(l=>jsxRuntime.jsxs("button",{onClick:l.onClick,className:c("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/[0.05] text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-white/60":"text-gray-400",children:l.icon}),l.label]},l.id))})]})}var Lg={en:{edit:"Edit",changeStatus:"Change status",changePriority:"Change priority",assignUser:"Assign user",duplicate:"Duplicate",moveUp:"Move up",moveDown:"Move down",indent:"Make subtask",outdent:"Remove from parent",delete:"Delete",todo:"To Do",inProgress:"In Progress",completed:"Completed",urgent:"Urgent",high:"High",medium:"Medium",low:"Low",sortAsc:"Sort A \u2192 Z",sortDesc:"Sort Z \u2192 A",hideColumn:"Hide column",logTime:"Log Time",reportBlocker:"Report Blocker",copyLink:"Copy Link"},es:{edit:"Editar",changeStatus:"Cambiar estado",changePriority:"Cambiar prioridad",assignUser:"Asignar usuario",duplicate:"Duplicar",moveUp:"Mover arriba",moveDown:"Mover abajo",indent:"Convertir en subtarea",outdent:"Sacar de subtarea",delete:"Eliminar",todo:"Pendiente",inProgress:"En Progreso",completed:"Completado",urgent:"Urgente",high:"Alta",medium:"Media",low:"Baja",sortAsc:"Ordenar A \u2192 Z",sortDesc:"Ordenar Z \u2192 A",hideColumn:"Ocultar columna",logTime:"Registrar Tiempo",reportBlocker:"Reportar Bloqueante",copyLink:"Copiar Enlace"}};var Gg={name:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),status:jsxRuntime.jsx(lucideReact.CircleDot,{className:"w-4 h-4"}),priority:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),assignees:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),startDate:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),endDate:jsxRuntime.jsx(lucideReact.CalendarCheck,{className:"w-4 h-4"}),progress:jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"}),tags:jsxRuntime.jsx(lucideReact.Tag,{className:"w-4 h-4"}),estimatedTime:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),quotedTime:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),elapsedTime:jsxRuntime.jsx(lucideReact.Timer,{className:"w-4 h-4"}),effortMinutes:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),timeLoggedMinutes:jsxRuntime.jsx(lucideReact.Timer,{className:"w-4 h-4"}),soldEffortMinutes:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),scheduleVariance:jsxRuntime.jsx(lucideReact.CalendarClock,{className:"w-4 h-4"}),hoursBar:jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),teamLoad:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),blockers:jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-4 h-4"}),weight:jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"}),text:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),number:jsxRuntime.jsx(lucideReact.Hash,{className:"w-4 h-4"}),date:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),dropdown:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}),checkbox:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-4 h-4"})},q1=["name","status","priority","startDate","endDate","progress","tags","effortMinutes","timeLoggedMinutes","soldEffortMinutes","weight"];function _g({isOpen:e,onClose:t,columns:a,customFields:r=[],onColumnsChange:n,onCreateCustomField:s,isDark:o,locale:l}){let[d,i]=react.useState(""),[u,m]=react.useState(null),[p,g]=react.useState(null),f=react.useRef(null),x=l==="es"?jg.es:jg.en;react.useLayoutEffect(()=>{if(!e||!f.current)return;let M=()=>{if(!f.current)return;let T=f.current.parentElement;if(T){let _=T.getBoundingClientRect();g({top:_.bottom+4,right:window.innerWidth-_.right});}let F=f.current.getBoundingClientRect(),C=window.innerHeight-F.top-20;m(Math.max(300,C));};return requestAnimationFrame(M),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[e]),react.useEffect(()=>{if(!e)return;let M=setTimeout(()=>{let T=A=>{f.current&&!f.current.contains(A.target)&&t();},F=A=>{A.key==="Escape"&&t();};document.addEventListener("mousedown",T),document.addEventListener("keydown",F),f._cleanup=()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",F);};},100);return ()=>{clearTimeout(M),f._cleanup&&f._cleanup();}},[e,t]);let y=react.useMemo(()=>{let M=new Set([...q1]);return a.forEach(T=>{T.type&&T.type!=="assignees"&&M.add(T.type);}),Array.from(M)},[a]);if(!e)return null;let b=M=>{let T=x.columns[M];if(T)return T;let F=a.find(A=>A.type===M);return F?.label?F.label:M},h=M=>{if(M==="name")return;let T=a.map(F=>F.id===M?{...F,visible:!F.visible}:F);n(T);},v=(M,T)=>{let F=a.find(C=>C.type===M&&(!T||C.customFieldId===T));if(F){h(F.id);return}let A={id:T||M,type:M,label:T?r.find(C=>C.id===T)?.name||M:b(M),width:120,visible:true,sortable:true,resizable:true,customFieldId:T};n([...a,A]);},w=y.filter(M=>M!=="assignees"&&b(M).toLowerCase().includes(d.toLowerCase())),D=r.filter(M=>M.name.toLowerCase().includes(d.toLowerCase())),S=o?"#00E5FF":"#00E5CC";return jsxRuntime.jsxs("div",{ref:f,style:{...u?{maxHeight:`${u}px`}:{},...p?{top:p.top,right:p.right}:{},background:o?"#111114":"#FFFFFF",border:`1px solid ${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.08)"}`,boxShadow:o?"0 8px 32px rgba(0,0,0,0.7)":"0 8px 32px rgba(0,0,0,0.12)",zIndex:99999},className:"fixed w-64 rounded-xl flex flex-col",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5",style:{borderBottom:`1px solid ${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`},children:[jsxRuntime.jsx("span",{style:{fontSize:10,fontWeight:600,letterSpacing:"0.08em",color:o?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",fontFamily:"JetBrains Mono, monospace"},children:x.title.toUpperCase()}),jsxRuntime.jsx("button",{onClick:t,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors",style:{color:o?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"},onMouseEnter:M=>{M.currentTarget.style.backgroundColor=o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",M.currentTarget.style.color=o?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.6)";},onMouseLeave:M=>{M.currentTarget.style.backgroundColor="transparent",M.currentTarget.style.color=o?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)";},children:jsxRuntime.jsx(lucideReact.X,{className:"w-3.5 h-3.5"})})]}),jsxRuntime.jsx("div",{className:"px-3 py-2",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5",style:{color:o?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.25)"}}),jsxRuntime.jsx("input",{type:"text",value:d,onChange:M=>i(M.target.value),placeholder:x.searchPlaceholder,style:{fontSize:12,background:o?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)",border:`1px solid ${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,color:o?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.8)"},className:"w-full pl-8 pr-3 py-1.5 rounded-lg outline-none placeholder:opacity-40 transition-colors focus:border-[var(--focus-border)]",ref:M=>{M&&M.style.setProperty("--focus-border",S);},onFocus:M=>{M.currentTarget.style.borderColor=S,M.currentTarget.style.background=o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)";},onBlur:M=>{M.currentTarget.style.borderColor=o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)",M.currentTarget.style.background=o?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)";}})]})}),jsxRuntime.jsxs("div",{className:"overflow-y-auto flex-1 min-h-0 overscroll-contain px-2 pb-2",onWheel:M=>M.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"mb-1",children:[jsxRuntime.jsx("div",{className:"px-1.5 py-1.5",style:{fontSize:9,fontWeight:600,letterSpacing:"0.1em",color:o?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.3)",fontFamily:"JetBrains Mono, monospace"},children:x.standardFields.toUpperCase()}),jsxRuntime.jsx("div",{className:"space-y-px",children:w.map(M=>{let T=a.find(C=>C.type===M&&!C.customFieldId),F=T?.visible??false,A=M==="name";return jsxRuntime.jsxs("button",{onClick:()=>{A||(T?h(T.id):v(M));},disabled:A,className:"w-full flex items-center gap-2.5 px-2 py-[5px] rounded-md transition-colors",style:{opacity:A?.4:1,cursor:A?"not-allowed":"pointer"},onMouseEnter:C=>{A||(C.currentTarget.style.backgroundColor=o?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.04)");},onMouseLeave:C=>{C.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center flex-shrink-0 transition-all",style:{background:F?S:"transparent",border:F?`1.5px solid ${S}`:`1.5px solid ${o?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`,boxShadow:F?`0 0 6px ${S}40`:"none"},children:F&&jsxRuntime.jsx(lucideReact.Check,{className:"w-2.5 h-2.5 text-white",strokeWidth:3})}),jsxRuntime.jsx("span",{className:"flex-shrink-0 [&>svg]:w-3.5 [&>svg]:h-3.5",style:{color:F?S:o?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"},children:Gg[M]}),jsxRuntime.jsx("span",{className:"truncate",style:{fontSize:12,fontWeight:F?500:400,color:F?o?"rgba(255,255,255,0.9)":"rgba(0,0,0,0.85)":o?"rgba(255,255,255,0.55)":"rgba(0,0,0,0.5)",maxWidth:"160px"},title:b(M),children:b(M)})]},M)})})]}),D.length>0&&jsxRuntime.jsxs("div",{className:"mt-1",children:[jsxRuntime.jsx("div",{className:"px-1.5 py-1.5",style:{fontSize:9,fontWeight:600,letterSpacing:"0.1em",color:o?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.3)",fontFamily:"JetBrains Mono, monospace",borderTop:`1px solid ${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,paddingTop:8,marginTop:4},children:x.customFields.toUpperCase()}),jsxRuntime.jsx("div",{className:"space-y-px",children:D.map(M=>{let F=a.find(A=>A.customFieldId===M.id)?.visible??false;return jsxRuntime.jsxs("button",{onClick:()=>v(M.type,M.id),className:"w-full flex items-center gap-2.5 px-2 py-[5px] rounded-md transition-colors",onMouseEnter:A=>{A.currentTarget.style.backgroundColor=o?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.04)";},onMouseLeave:A=>{A.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center flex-shrink-0 transition-all",style:{background:F?S:"transparent",border:F?`1.5px solid ${S}`:`1.5px solid ${o?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`,boxShadow:F?`0 0 6px ${S}40`:"none"},children:F&&jsxRuntime.jsx(lucideReact.Check,{className:"w-2.5 h-2.5 text-white",strokeWidth:3})}),jsxRuntime.jsx("span",{className:"flex-shrink-0 [&>svg]:w-3.5 [&>svg]:h-3.5",style:{color:F?S:o?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"},children:Gg[M.type]||jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"})}),jsxRuntime.jsx("span",{style:{fontSize:12,fontWeight:F?500:400,color:F?o?"rgba(255,255,255,0.9)":"rgba(0,0,0,0.85)":o?"rgba(255,255,255,0.55)":"rgba(0,0,0,0.5)"},children:M.name})]},M.id)})})]})]})]})}var jg={en:{title:"Columns",searchPlaceholder:"Search fields...",standardFields:"Standard Fields",customFields:"Custom Fields",columns:{name:"Name",status:"Status",priority:"Priority",startDate:"Start Date",endDate:"End Date",progress:"Progress",tags:"Tags",estimatedTime:"Estimated",quotedTime:"Quoted",elapsedTime:"Time Spent",soldEffortMinutes:"Quoted",effortMinutes:"Estimated",timeLoggedMinutes:"Executed",text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox",weight:"Weight"}},es:{title:"Columnas",searchPlaceholder:"Buscar campos...",standardFields:"Campos Est\xE1ndar",customFields:"Campos Personalizados",columns:{name:"Nombre",status:"Estado",priority:"Prioridad",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",tags:"Etiquetas",estimatedTime:"Estimado",quotedTime:"Ofertado",elapsedTime:"Ejecutado",soldEffortMinutes:"Ofertado",effortMinutes:"Estimado",timeLoggedMinutes:"Ejecutado",text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla",weight:"Peso"}}};var rw=[{type:"text",icon:jsxRuntime.jsx(lucideReact.Type,{className:"w-5 h-5"})},{type:"number",icon:jsxRuntime.jsx(lucideReact.Hash,{className:"w-5 h-5"})},{type:"date",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-5 h-5"})},{type:"dropdown",icon:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-5 h-5"})},{type:"checkbox",icon:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-5 h-5"})}];function Yg({isOpen:e,onClose:t,onSave:a,isDark:r,locale:n}){let[s,o]=react.useState(""),[l,d]=react.useState("text"),[i,u]=react.useState([""]),m=n==="es"?qg.es:qg.en;react.useEffect(()=>{e&&(o(""),d("text"),u([""]));},[e]),react.useEffect(()=>{let y=b=>{b.key==="Escape"&&t();};return e&&document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,t]);let p=()=>{if(!s.trim())return;let y={name:s.trim(),type:l};l==="dropdown"&&(y.options=i.filter(b=>b.trim())),a(y),t();},g=()=>{u([...i,""]);},f=(y,b)=>{let h=[...i];h[y]=b,u(h);},x=y=>{i.length>1&&u(i.filter((b,h)=>h!==y));};return e?jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),jsxRuntime.jsxs("div",{className:c("relative w-full max-w-md rounded-xl shadow-2xl border",r?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:c("flex items-center justify-between px-6 py-4 border-b",r?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h2",{className:c("text-lg font-semibold",r?"text-white":"text-gray-900"),children:m.title}),jsxRuntime.jsx("button",{onClick:t,className:c("p-1 rounded",r?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:c("w-5 h-5",r?"text-white/60":"text-gray-400")})})]}),jsxRuntime.jsxs("div",{className:"p-6 space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:c("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:m.fieldName}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:y=>o(y.target.value),placeholder:m.fieldNamePlaceholder,className:c("w-full px-4 py-2.5 rounded-lg border outline-none focus:ring-2 focus:ring-[#00E5CC]/30",r?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),autoFocus:true})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:c("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:m.fieldType}),jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-2",children:rw.map(y=>jsxRuntime.jsxs("button",{onClick:()=>d(y.type),className:c("flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors",l===y.type?"border-[#00E5CC] bg-[#00E5CC]/10":r?"border-[#222] hover:border-white/20":"border-gray-200 hover:border-gray-300"),children:[jsxRuntime.jsx("span",{className:l===y.type?"text-[#00E5CC]":r?"text-white/60":"text-gray-400",children:y.icon}),jsxRuntime.jsx("span",{className:c("text-xs",l===y.type?"text-[#00E5CC]":r?"text-white/60":"text-gray-500"),children:m.types[y.type]})]},y.type))})]}),l==="dropdown"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:c("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:m.options}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[i.map((y,b)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:y,onChange:h=>f(b,h.target.value),placeholder:`${m.option} ${b+1}`,className:c("flex-1 px-3 py-2 rounded-lg border outline-none focus:ring-2 focus:ring-[#00E5CC]/30",r?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")}),i.length>1&&jsxRuntime.jsx("button",{onClick:()=>x(b),className:c("p-2 rounded-lg transition-colors",r?"hover:bg-white/[0.05] text-white/60":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},b)),jsxRuntime.jsxs("button",{onClick:g,className:c("flex items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors",r?"text-[#00E5CC] hover:bg-white/[0.05]":"text-[#00C4AE] hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),m.addOption]})]})]})]}),jsxRuntime.jsxs("div",{className:c("flex items-center justify-end gap-3 px-6 py-4 border-t",r?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("button",{onClick:t,className:c("px-4 py-2 text-sm font-medium rounded-lg transition-colors",r?"text-white/60 hover:bg-white/[0.05]":"text-gray-600 hover:bg-gray-100"),children:m.cancel}),jsxRuntime.jsx("button",{onClick:p,disabled:!s.trim(),className:c("px-4 py-2 text-sm font-medium rounded-lg transition-colors","bg-[#00E5CC] text-white hover:bg-[#005FCC]",!s.trim()&&"opacity-50 cursor-not-allowed"),children:m.create})]})]})]}):null}var qg={en:{title:"Create Custom Field",fieldName:"Field Name",fieldNamePlaceholder:"Enter field name...",fieldType:"Field Type",options:"Options",option:"Option",addOption:"Add option",cancel:"Cancel",create:"Create Field",types:{text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Crear Campo Personalizado",fieldName:"Nombre del Campo",fieldNamePlaceholder:"Ingresa el nombre...",fieldType:"Tipo de Campo",options:"Opciones",option:"Opci\xF3n",addOption:"Agregar opci\xF3n",cancel:"Cancelar",create:"Crear Campo",types:{text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var Qg={en:{filters:"Filters",filterByStatus:"FILTER BY STATUS",showAll:"Show All",completed:"Completed",inProgress:"In Progress",toDo:"To Do / Pending",hideCompleted:"Hide Completed Tasks"},es:{filters:"Filtros",filterByStatus:"FILTRAR POR ESTADO",showAll:"Mostrar Todo",completed:"Completadas",inProgress:"En Progreso",toDo:"Por Hacer / Pendiente",hideCompleted:"Ocultar Tareas Completadas"}};function Zg({value:e,hideCompleted:t,onChange:a,onHideCompletedChange:r,isDark:n,locale:s}){let[o,l]=react.useState(false),d=react.useRef(null),i=react.useRef(0),u=s==="es"?Qg.es:Qg.en;react.useEffect(()=>{if(!o)return;let g=x=>{Date.now()-i.current<100||d.current&&!d.current.contains(x.target)&&l(false);},f=x=>{x.key==="Escape"&&l(false);};return document.addEventListener("mousedown",g),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",f);}},[o]);let m=[{value:"all",label:u.showAll,icon:jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}),color:"text-[#00E5CC]"},{value:"completed",label:u.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),color:"text-green-500"},{value:"in-progress",label:u.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),color:"text-[#00E5CC]"},{value:"todo",label:u.toDo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),color:"text-gray-400"}],p=e!=="all"||t;return jsxRuntime.jsxs("div",{ref:d,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:g=>{g.stopPropagation(),o||(i.current=Date.now()),l(f=>!f);},className:c("flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] font-medium transition-all border",n?"border-[#222] hover:bg-white/[0.05] text-white/70":"border-gray-200 hover:bg-gray-100 text-gray-700",p&&(n?"bg-[#00E5CC]/20 border-[#00E5CC]/50 text-[#00E5CC]":"bg-[#00E5CC]/15 border-[#00E5CC]/15 text-[#00C4AE]"),o&&(n?"bg-white/[0.05]":"bg-gray-100")),style:{fontFamily:"Inter, sans-serif"},children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),u.filters,p&&jsxRuntime.jsx("span",{className:c("w-2 h-2 rounded-full","bg-[#00E5CC]")})]}),o&&jsxRuntime.jsxs("div",{className:c("absolute left-0 top-full mt-2 w-72 rounded-lg shadow-xl border z-50",n?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:[jsxRuntime.jsx("div",{className:c("px-4 py-3 border-b",n?"border-[#222]":"border-gray-200"),children:jsxRuntime.jsx("span",{className:c("text-xs font-medium uppercase tracking-wider",n?"text-white/30":"text-gray-400"),children:u.filterByStatus})}),jsxRuntime.jsx("div",{className:"py-2",children:m.map(g=>{let f=e===g.value&&!t,x=()=>g.value==="all"?f?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}):jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-400"}):g.icon;return jsxRuntime.jsxs("button",{onClick:()=>{a(g.value),r(false),l(false);},className:c("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",n?"hover:bg-white/[0.05]":"hover:bg-gray-100",f&&(n?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:c(f?g.color:"text-gray-400","flex-shrink-0"),children:x()}),jsxRuntime.jsx("span",{className:c("flex-1 text-left whitespace-nowrap",n?"text-white":"text-gray-900"),children:g.label}),f&&jsxRuntime.jsx(lucideReact.Check,{className:c("w-4 h-4 flex-shrink-0","text-[#00E5CC]")})]},g.value)})}),jsxRuntime.jsx("div",{className:c("my-2 mx-4 h-px",n?"bg-white/[0.05]":"bg-gray-200")}),jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs("button",{onClick:()=>{let g=!t;r(g),g&&a("all"),l(false);},className:c("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",n?"hover:bg-white/[0.05]":"hover:bg-gray-100",t&&(n?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:c("w-4 h-4 flex-shrink-0",t?"text-[#00E5CC]":n?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("flex-1 text-left whitespace-nowrap",n?"text-white":"text-gray-900"),children:u.hideCompleted}),t&&jsxRuntime.jsx(lucideReact.Check,{className:c("w-4 h-4 flex-shrink-0","text-[#00E5CC]")})]})})]})]})}function e0(e){if(e<=0)return "0h";let t=Math.floor(e/60),a=e%60;return a>0?`${t}h ${a}m`:`${t}h`}function hn(e){return `$${Math.round(e).toLocaleString("es-CO")}`}function t0({data:e,isDark:t,locale:a="en",onClose:r,lens:n="hours",onUnassignedTaskClick:s}){let o=a==="es",l=n==="financial";return jsxRuntime.jsxs("div",{className:c("w-[260px] xl:w-[320px] flex-shrink-0 overflow-y-auto border-l",t?"bg-[#141414] border-[#222]":"bg-gray-50 border-gray-200"),children:[jsxRuntime.jsxs("div",{className:c("px-5 py-4 border-b flex items-center justify-between",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:c("text-[11px] font-mono uppercase tracking-wider font-bold",t?"text-white/60":"text-gray-600"),children:l?o?"SALUD FINANCIERA":"FINANCIAL HEALTH":o?"SALUD DEL PROYECTO":"PROJECT HEALTH"}),r&&jsxRuntime.jsx("button",{onClick:r,className:c("p-1 rounded transition-colors",t?"text-white/30 hover:text-white/60 hover:bg-white/[0.05]":"text-gray-400 hover:text-gray-600 hover:bg-gray-200"),title:o?"Cerrar panel":"Close panel",children:jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 1l10 10M11 1L1 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),l&&(e.totalOffered!==void 0||e.totalEstimated!==void 0)&&(()=>{let d=e.totalOffered??0,i=e.totalEstimated??0,u=e.totalExecuted??0,m=d-u,p=d>0?Math.round(m/d*100):0,g=d>0?Math.min(Math.round(u/d*100),120):0,f=u>d&&d>0,x=f?"#F87171":"#00E5CC";return jsxRuntime.jsxs("div",{className:c("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:c("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:o?"PRESUPUESTO":"BUDGET"}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"V. Oferta":"Offered Value"}),jsxRuntime.jsx("span",{className:c("text-[11px] font-mono font-bold",t?"text-white/80":"text-gray-800"),children:hn(d)})]}),(()=>{let y=e.totalEstimatedLabor??0,b=e.totalEstimatedEquipment??0,h=e.totalEstimatedTravel??0,v=b>0||h>0,w=(D,S)=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between pl-3",children:[jsxRuntime.jsx("span",{className:c("text-[10px]",t?"text-white/40":"text-gray-400"),children:D}),jsxRuntime.jsx("span",{className:c("text-[10px] font-mono",t?"text-white/55":"text-gray-500"),children:hn(S)})]});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"Estimado":"Estimated"}),jsxRuntime.jsx("span",{className:c("text-[11px] font-mono font-bold",t?"text-white/80":"text-gray-800"),children:hn(i)})]}),v&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[w(o?"Mano de obra":"Labor",y),b>0&&w(o?"Activos":"Equipment",b),h>0&&w(o?"Vi\xE1ticos":"Travel",h)]})]})})(),u>0&&(()=>{let y=e.totalExecutedLabor??0,b=e.totalExecutedEquipment??0,h=e.totalExecutedTravel??0,v=b>0||h>0,w=(D,S)=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between pl-3",children:[jsxRuntime.jsx("span",{className:c("text-[10px]",t?"text-white/40":"text-gray-400"),children:D}),jsxRuntime.jsx("span",{className:c("text-[10px] font-mono",t?"text-white/55":"text-gray-500"),children:hn(S)})]});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"Ejecutado":"Executed"}),jsxRuntime.jsx("span",{className:c("text-[11px] font-mono font-bold",f?"text-[#F87171]":t?"text-white/80":"text-gray-800"),children:hn(u)})]}),v&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[w(o?"Mano de obra":"Labor",y),b>0&&w(o?"Activos":"Equipment",b),h>0&&w(o?"Vi\xE1ticos":"Travel",h)]})]})})(),d>0&&jsxRuntime.jsx("div",{className:c("w-full h-2.5 rounded-full overflow-hidden mt-2",t?"bg-white/[0.06]":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(g,100)}%`,backgroundColor:x}})}),jsxRuntime.jsxs("div",{className:c("mt-2 px-3 py-2 rounded-lg text-center font-mono text-sm font-bold",m>=0?t?"bg-[#00E5CC]/10 text-[#00E5CC]":"bg-emerald-50 text-emerald-600":t?"bg-[#F87171]/10 text-[#F87171]":"bg-red-50 text-red-600"),children:[m>=0?`+${hn(m)} ${o?"Disp.":"Avail."}`:`${hn(Math.abs(m))} ${o?"P\xE9rdida":"Loss"}`,d>0&&jsxRuntime.jsxs("span",{className:"text-[10px] ml-1 opacity-60",children:["(",p,"%)"]})]})]})]})})(),(e.totalHoursSpentMinutes!==void 0||e.totalHoursAllocatedMinutes!==void 0)&&(()=>{let d=e.totalHoursSpentMinutes??0,i=e.totalHoursAllocatedMinutes??0,u=i>0?Math.min(Math.round(d/i*100),100):0,g=(i>0?d/i:0)>1.1?"#F87171":u>=90?"#FFD60A":"#3BF06E";return jsxRuntime.jsxs("div",{className:c("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:c("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:o?"HORAS DEL PROYECTO":"PROJECT HOURS"}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"Usado":"Spent"}),jsxRuntime.jsx("span",{className:c("text-[11px] font-mono font-bold",t?"text-white/80":"text-gray-800"),children:e0(d)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"Asignado":"Allocated"}),jsxRuntime.jsx("span",{className:c("text-[11px] font-mono",t?"text-white/60":"text-gray-600"),children:e0(i)})]}),i>0&&jsxRuntime.jsx("div",{className:c("w-full h-1.5 rounded-full overflow-hidden mt-1",t?"bg-white/[0.06]":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${u}%`,backgroundColor:g}})})]})]})})(),(e.openRFIs!==void 0||e.submittalsApprovalPercent!==void 0)&&jsxRuntime.jsxs("div",{className:c("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:c("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:o?"SALUD T\xC9CNICA":"TECHNICAL HEALTH"}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[e.openRFIs!==void 0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"RFIs Abiertos":"Open RFIs"}),jsxRuntime.jsx("span",{className:c("px-2 py-0.5 rounded text-[11px] font-mono font-bold",e.openRFIs>0?"bg-[#F87171]/15 text-[#F87171]":"bg-[#3BF06E]/15 text-[#3BF06E]"),children:e.openRFIs})]}),e.submittalsApprovalPercent!==void 0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"Aprobaci\xF3n Submittals":"Submittals Approval"}),jsxRuntime.jsxs("span",{className:c("text-[11px] font-mono font-bold",e.submittalsApprovalPercent>=80?"text-[#3BF06E]":"text-[#FFD60A]"),children:[e.submittalsApprovalPercent,"%"]})]})]})]}),e.unassignedCount!=null&&e.unassignedCount>0&&jsxRuntime.jsxs("div",{className:c("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:c("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:o?"TAREAS SIN ASIGNAR":"UNASSIGNED TASKS"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[jsxRuntime.jsx("div",{className:c("flex items-center justify-center w-10 h-10 rounded-lg font-mono text-lg font-bold",e.unassignedCount>=10?"bg-[#F87171]/15 text-[#F87171]":"bg-[#FFD60A]/15 text-[#FFD60A]"),children:e.unassignedCount}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:c("text-xs font-medium",t?"text-white/80":"text-gray-700"),children:e.unassignedCount===1?o?"tarea pendiente":"pending task":o?"tareas pendientes":"pending tasks"}),jsxRuntime.jsx("p",{className:c("text-[10px]",t?"text-white/40":"text-gray-400"),children:o?"sin recurso asignado":"without assigned resource"})]})]}),e.unassignedTasks&&e.unassignedTasks.length>0&&jsxRuntime.jsx("div",{className:c("space-y-1.5 overflow-y-auto scrollbar-slim",e.unassignedTasks.length>5?"max-h-[170px]":""),children:e.unassignedTasks.map(d=>jsxRuntime.jsxs("button",{onClick:()=>s?.(d.id),className:c("flex items-center gap-2 px-2.5 py-1.5 rounded-md text-[11px] w-full text-left transition-colors",t?"bg-white/[0.04] text-white/70 hover:bg-white/[0.08] hover:text-white":"bg-gray-50 text-gray-600 hover:bg-gray-100 hover:text-gray-900",s&&"cursor-pointer"),children:[jsxRuntime.jsx("span",{className:c("w-1.5 h-1.5 rounded-full flex-shrink-0",(e.unassignedCount??0)>=10?"bg-[#F87171]":"bg-[#FFD60A]")}),jsxRuntime.jsx("span",{className:"truncate",children:d.name})]},d.id))})]}),e.scheduleVarianceDays!==void 0&&jsxRuntime.jsxs("div",{className:c("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:c("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:o?"VARIACI\xD3N DE CRONOGRAMA":"SCHEDULE VARIANCE"}),(()=>{let d=e.scheduleVarianceDays??0,i=d>0,u=d<0,m=e.scheduleVarianceLabel||(i?`+${d} ${o?"D\xEDas ADELANTE":"Days AHEAD"}`:u?`${d} ${o?"D\xEDas ATR\xC1S":"Days BEHIND"}`:o?"EN TIEMPO":"ON TRACK");return jsxRuntime.jsx("div",{className:c("px-3 py-2 rounded-lg text-center font-mono text-sm font-bold",i&&"bg-[#3BF06E]/15 text-[#3BF06E]",u&&"bg-[#F87171]/15 text-[#F87171]",!i&&!u&&"bg-[#3B9EFF]/15 text-[#3B9EFF]"),children:m})})()]}),e.teams&&e.teams.length>0&&jsxRuntime.jsxs("div",{className:"px-5 py-4",children:[jsxRuntime.jsx("h4",{className:c("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:o?"DISPONIBILIDAD DEL EQUIPO":"TEAM AVAILABILITY"}),jsxRuntime.jsx("div",{className:"space-y-3",children:e.teams.map((d,i)=>{let u=d.utilizationPercent>=100?"#F87171":d.utilizationPercent>=80?"#FFD60A":d.color||"#3BF06E";return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:d.name}),jsxRuntime.jsxs("span",{className:c("text-[10px] font-mono",t?"text-white/40":"text-gray-500"),children:[d.utilizationPercent,"%"]})]}),jsxRuntime.jsx("div",{className:c("w-full h-1.5 rounded-full overflow-hidden",t?"bg-white/[0.06]":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(d.utilizationPercent,100)}%`,backgroundColor:u}})})]},`${d.name}-${i}`)})})]})]})}var xw=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true}];function d0(e,t=0,a=[]){let r=[];for(let n of e){let s=[...a,n.id];r.push({...n,level:t,hasChildren:(n.subtasks?.length||0)>0,parentPath:s}),n.subtasks?.length&&n.isExpanded!==false&&r.push(...d0(n.subtasks,t+1,s));}return r}function vw(e){let t=e.subtasks;if(!t?.length)return null;let a=new Date,r=0,n=0;for(let s of t){if(!s.startDate||!s.endDate)continue;let o=s.startDate.getTime(),d=s.endDate.getTime()-o;if(d<=0)continue;let u=Math.max(0,Math.min(a.getTime()-o,d))/d*100;if(u<=0)continue;let m=(s.progress||0)/u;r+=m,n++;}return n>0?r/n:null}function es(e){if(!e.subtasks?.length)return {spent:0,allocated:0,quoted:0};let t=0,a=0,r=0;for(let n of e.subtasks)if(n.subtasks?.length){let s=es(n);t+=s.spent>0?s.spent:n.timeLoggedMinutes??0,a+=s.allocated>0?s.allocated:n.effortMinutes??0,r+=s.quoted>0?s.quoted:n.soldEffortMinutes??0;}else t+=n.timeLoggedMinutes??0,a+=n.effortMinutes??0,r+=n.soldEffortMinutes??0;return {spent:t,allocated:a,quoted:r}}function Zn(e){if(e<=0)return "0h";let t=Math.floor(e/60),a=e%60;return a>0?`${t}h ${a}m`:`${t}h`}function ww({value:e,onChange:t,isDark:a}){let[r,n]=react.useState(false),[s,o]=react.useState(String(e||""));return r?jsxRuntime.jsx("input",{autoFocus:true,type:"text",inputMode:"decimal",value:s,onClick:l=>l.stopPropagation(),onChange:l=>o(l.target.value.replace(/[^0-9.]/g,"")),onBlur:()=>{let l=parseFloat(s);!isNaN(l)&&l>=0&&l<=100?t(l):s===""&&t(0),n(false);},onKeyDown:l=>{l.key==="Enter"&&l.target.blur(),l.key==="Escape"&&(o(String(e||"")),n(false));},className:c("w-14 text-xs text-right font-mono px-1 py-0.5 rounded border outline-none",a?"bg-white/5 border-[#00E5CC]/50 text-white":"bg-gray-50 border-[#00E5CC] text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"}}):jsxRuntime.jsx("button",{onClick:l=>{l.stopPropagation(),o(String(e||"")),n(true);},className:c("text-xs font-mono cursor-pointer hover:underline",e>0?a?"text-white/80":"text-gray-700":a?"text-white/30":"text-gray-300"),style:{fontFamily:"JetBrains Mono, monospace"},children:e>0?`${e}%`:"\u2014"})}function i0(e){if(e.length===0)return 0;let t=0,a=0,r=0;for(let l of e){let d=l.weight||0;d>0&&(t+=(l.progress||0)*d,a+=d,r+=1);}let n=r/e.length;if(a>=99&&n>=.95)return Math.round(t/a*10)/10;if(e.reduce((l,d)=>l+(d.effort_minutes||0),0)>0){let l=0,d=0;for(let i of e){let u=i.effort_minutes||60;l+=(i.progress||0)*u,d+=u;}return Math.round(l/d*10)/10}let o=e.reduce((l,d)=>l+(d.progress||0),0);return Math.round(o/e.length*10)/10}function xc(e,t=[]){for(let a of e)a.subtasks&&a.subtasks.length>0?xc(a.subtasks,t):t.push({progress:a.progress||0,weight:a.weight||0,effort_minutes:a.effort_minutes??a.effortMinutes});return t}function c0({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:n,className:s,style:o,availableUsers:l=[],customFields:d=[],toolbarRightContent:i,onColumnHeaderClick:u,columnsWithFilter:m,filterDotColor:p="#00E5CC"}){let{theme:g="dark",locale:f="en",customTranslations:x,showSearch:y=true,showHierarchy:b=true,tableColumns:h,allowColumnCustomization:v=true,allowColumnResize:w=true,enableContextMenu:D=true,showCreateTaskButton:S=false,onCreateTask:M,persistFilter:T=false,financialBlur:F,healthSidebar:A,lens:C="hours",hourlyRate:_=0,rateMap:W,aggregateParentHours:oe=false,showProjectTotals:L=false,totalsDollarOverride:Y}=t,K=qi(f,x),V=g==="dark",B=P=>{if(!W||!P.assignees||P.assignees.length===0)return _;let te=0,he=0;for(let Me of P.assignees){let Qe=Me.id?W[Me.id]:void 0;if(Qe==null||Qe<=0)continue;let fe=typeof Me.estimatedMinutes=="number"?Me.estimatedMinutes:0;fe>0&&(te+=Qe*fe,he+=fe);}if(he>0)return te/he;let Se=P.assignees.map(Me=>Me.id?W[Me.id]:void 0).filter(Me=>Me!=null&&Me>0);return Se.length===0?_:Se.reduce((Me,Qe)=>Me+Qe,0)/Se.length},X=P=>{let te=0,he=0,Se=0,Me=Qe=>{for(let fe of Qe)if(fe.subtasks&&fe.subtasks.length>0){let Ge={s:te,a:he,q:Se};if(Me(fe.subtasks),te-Ge.s+(he-Ge.a)+(Se-Ge.q)===0){let vt=B(fe);te+=(fe.timeLoggedMinutes??0)/60*vt,he+=(fe.effortMinutes??0)/60*vt,Se+=(fe.soldEffortMinutes??0)/60*vt;}}else {let Ge=B(fe);te+=(fe.timeLoggedMinutes??0)/60*Ge,he+=(fe.effortMinutes??0)/60*Ge,Se+=(fe.soldEffortMinutes??0)/60*Ge;}};return P.subtasks&&Me(P.subtasks),{dollarSpent:te,dollarAllocated:he,dollarQuoted:Se}},Ce=react.useCallback(()=>{if(!T||typeof window>"u")return {statusFilter:"all",hideCompleted:false};try{let P=localStorage.getItem(T);if(P){let te=JSON.parse(P);return {statusFilter:te.statusFilter||"all",hideCompleted:te.hideCompleted||!1}}}catch(P){console.error("Error loading persisted filter:",P);}return {statusFilter:"all",hideCompleted:false}},[T]),Re=react.useMemo(()=>{function P(te){let he=0,Se=0,Me=0,Qe=0,fe=0,Ge=0;for(let nt of te)if(nt.subtasks&&nt.subtasks.length>0){let vt=P(nt.subtasks);if(vt.spent+vt.allocated+vt.quoted>0)he+=vt.spent,Se+=vt.allocated,Me+=vt.quoted,Qe+=vt.dollarSpent,fe+=vt.dollarAllocated,Ge+=vt.dollarQuoted;else {let jt=nt.timeLoggedMinutes??0,Pt=nt.effortMinutes??0,Qa=nt.soldEffortMinutes??0;he+=jt,Se+=Pt,Me+=Qa;let ia=B(nt);Qe+=jt/60*ia,fe+=Pt/60*ia,Ge+=Qa/60*ia;}}else {let vt=nt.timeLoggedMinutes??0,na=nt.effortMinutes??0,jt=nt.soldEffortMinutes??0;he+=vt,Se+=na,Me+=jt;let Pt=B(nt);Qe+=vt/60*Pt,fe+=na/60*Pt,Ge+=jt/60*Pt;}return {spent:he,allocated:Se,quoted:Me,dollarSpent:Qe,dollarAllocated:fe,dollarQuoted:Ge}}return P(e)},[e]),R=react.useMemo(()=>{let P=new Map;function te(he){let Se=0;for(let Me of he)if(Me.subtasks&&Me.subtasks.length>0){let Qe=te(Me.subtasks);P.set(Me.id,Qe),Se+=Qe;}else Se+=Me.weight||0;return Se}return te(e),P},[e]),ae=react.useMemo(()=>!A?.enabled||!A.data?A:{...A,data:{...A.data,totalHoursSpentMinutes:Re.spent,totalHoursAllocatedMinutes:Re.allocated}},[A,Re]),[be,Ie]=react.useState(true),[De,Ee]=react.useState(null),[He,rt]=react.useState("position"),[pe,We]=react.useState("asc"),[je,Oe]=react.useState(""),[tt,wt]=react.useState(()=>Ce().statusFilter),[pt,Ue]=react.useState(()=>Ce().hideCompleted),[ot,Et]=react.useState(h||xw),[ge,ht]=react.useState(false),[k,O]=react.useState(false),[Z,ve]=react.useState({isOpen:false,x:0,y:0,type:"task"}),[$,re]=react.useState(null),[Ye,Te]=react.useState(false),[Fe,ze]=react.useState(null),[Le,Ze]=react.useState(null),[st,yt]=react.useState(null),xt=react.useRef(0),$t=react.useRef(false),ut=!!(a.onTaskMove||a.onTaskReparent),Gt=react.useCallback((P,te)=>{ut&&(te.preventDefault(),xt.current=te.clientY,re(P),$t.current=false,Te(false),yt({x:te.clientX,y:te.clientY}));},[ut]),Mt=react.useCallback(P=>{if(!$||(Math.abs(P.clientY-xt.current)>5&&!$t.current&&($t.current=true,Te(true)),yt({x:P.clientX,y:P.clientY}),!$t.current))return;let he=document.querySelectorAll("[data-listview-row]"),Se=null,Me=null;he.forEach(Qe=>{let fe=Qe.getBoundingClientRect(),Ge=Qe.getAttribute("data-listview-row");if(Ge&&Ge!==$&&P.clientY>=fe.top&&P.clientY<=fe.bottom){Se=Ge;let nt=P.clientY-fe.top,vt=fe.height;Me=nt<vt*.25?"above":nt>vt*.75?"below":"child";}}),ze(Se),Ze(Me);},[$]),It=react.useCallback(()=>{if($t.current&&$&&Fe&&Le){if(Le==="child"&&a.onTaskReparent)a.onTaskReparent($,Fe);else if(Le==="above"||Le==="below"){let P=(Se,Me,Qe=null)=>{for(let fe of Se){if(fe.id===Me)return Qe;if(fe.subtasks){let Ge=P(fe.subtasks,Me,fe.id);if(Ge!==void 0)return Ge}}},te=P(e,$,null),he=P(e,Fe,null);if(a.onTaskReparent){let Se=(vt,na)=>{if(na===null)return vt;for(let jt of vt){if(jt.id===na)return jt.subtasks||[];if(jt.subtasks){let Pt=Se(jt.subtasks,na);if(Pt.length>0||jt.subtasks.some(Qa=>Qa.id===na))return Pt}}return []},Me=Se(e,he??null),Qe=Me.findIndex(vt=>vt.id===Fe),fe=te===he,Ge=fe?Me.findIndex(vt=>vt.id===$):-1,nt=Le==="below"?Qe+1:Qe;fe&&Ge!==-1&&Ge<Qe&&(nt-=1),a.onTaskReparent($,he??null,Math.max(0,nt));}}}re(null),ze(null),Ze(null),yt(null),$t.current=false,Te(false);},[$,Fe,Le,e,a]);react.useEffect(()=>{if($)return document.addEventListener("mousemove",Mt),document.addEventListener("mouseup",It),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",Mt),document.removeEventListener("mouseup",It),document.body.style.cursor="",document.body.style.userSelect="";}},[$,Mt,It]);let[Ft,Ct]=react.useState("all"),[St,ct]=react.useState(false),fa=react.useRef(null),xa=react.useRef(null),H=react.useMemo(()=>{let P=0;function te(he,Se){for(let Me of he)Se>P&&(P=Se),Me.subtasks?.length&&te(Me.subtasks,Se+1);}return te(e,1),P},[e]);react.useEffect(()=>{if(!St)return;let P=te=>{fa.current?.contains(te.target)||xa.current?.contains(te.target)||ct(false);};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[St]),react.useEffect(()=>{if(Ft==="all"){let he=function(Se){for(let Me of Se)Me.subtasks?.length&&(Me.isExpanded===false&&a.onTaskToggleExpand?.(Me.id),he(Me.subtasks));};he(e);}else {let he=function(Se,Me){for(let Qe of Se)if(Qe.subtasks?.length){let fe=Me<Ft,Ge=Qe.isExpanded!==false;fe!==Ge&&a.onTaskToggleExpand?.(Qe.id),he(Qe.subtasks,Me+1);}};he(e,1);}},[Ft]);let[se,at]=react.useState(null),[Xt,ee]=react.useState(0),[ke,At]=react.useState(0),kt=react.useRef(null),[it,dt]=react.useState(null),[J,xe]=react.useState(null);react.useEffect(()=>{h&&Et(P=>{if(P.length===h.length){let te=true;for(let he=0;he<P.length;he++){let Se=P[he],Me=h[he];if(!Se||!Me||Se.id!==Me.id||Se.visible!==Me.visible||Se.width!==Me.width||Se.label!==Me.label){te=false;break}}if(te)return P}return h});},[h]),react.useEffect(()=>{if(!(!T||typeof window>"u"))try{localStorage.setItem(T,JSON.stringify({statusFilter:tt,hideCompleted:pt}));}catch(P){console.error("Error persisting filter state:",P);}},[T,tt,pt]);let ue=react.useMemo(()=>{let P=new Set;function te(he){for(let Se of he)Se.subtasks?.length&&(Se.isExpanded!==false&&P.add(Se.id),te(Se.subtasks));}return te(e),P},[e]),z=react.useMemo(()=>ot.filter(P=>P.visible),[ot]),ne=react.useCallback(P=>{a.onTaskToggleExpand?.(P);},[a]),Ve=react.useCallback(P=>{He===P?We(te=>te==="asc"?"desc":"asc"):(rt(P),We("asc")),a.onSortChange?.({column:P,direction:pe==="asc"?"desc":"asc"});},[He,pe,a]),N=react.useCallback(P=>{Et(P),a.onColumnsChange?.(P);},[a]),U=react.useCallback(P=>{let te=ot.map(he=>he.id===P?{...he,visible:false}:he);N(te);},[ot,N]),Ne=react.useCallback((P,te)=>{rt(P),We(te);},[]),q=react.useCallback((P,te,he)=>{D&&(P.preventDefault(),ve({isOpen:true,x:P.clientX,y:P.clientY,type:te?"task":"header",task:te,columnId:he}));},[D]),et=react.useCallback(()=>{ve(P=>({...P,isOpen:false}));},[]),Nt=react.useCallback((P,te)=>{if(!w)return;P.preventDefault(),P.stopPropagation();let he=ot.find(Se=>Se.id===te);he&&(at(te),ee(P.clientX),At(he.width));},[ot,w]);react.useEffect(()=>{if(!se)return;let P=ot,te=Se=>{let Me=Se.clientX-Xt,Qe=Math.max(50,ke+Me);P=P.map(fe=>fe.id===se?{...fe,width:Qe}:fe),Et(P);},he=()=>{a.onColumnsChange?.(P),at(null);};return document.addEventListener("mousemove",te),document.addEventListener("mouseup",he),()=>{document.removeEventListener("mousemove",te),document.removeEventListener("mouseup",he);}},[se,Xt,ke,a]);let Wt=react.useCallback((P,te)=>{if(te==="name"){P.preventDefault();return}dt(te),P.dataTransfer.effectAllowed="move",P.dataTransfer.setData("text/plain",te),P.currentTarget instanceof HTMLElement&&(P.currentTarget.style.opacity="0.5");},[]),Va=react.useCallback(P=>{P.currentTarget instanceof HTMLElement&&(P.currentTarget.style.opacity="1"),dt(null),xe(null);},[]),va=react.useCallback((P,te)=>{P.preventDefault(),te!=="name"&&(P.dataTransfer.dropEffect="move",xe(te));},[]),oa=react.useCallback(()=>{xe(null);},[]),cr=react.useCallback((P,te)=>{if(P.preventDefault(),!it||it===te||te==="name")return;let he=[...ot],Se=he.findIndex(fe=>fe.id===it),Me=he.findIndex(fe=>fe.id===te);if(Se===-1||Me===-1)return;let Qe=he.splice(Se,1);Qe[0]&&(he.splice(Me,0,Qe[0]),N(he),dt(null),xe(null));},[it,ot,N]),wa=react.useCallback(async P=>{if(a.onCreateCustomField){let te={...P,id:`cf_${Date.now()}`,projectId:""};await a.onCreateCustomField(te);}O(false);},[a]),br=react.useCallback(P=>P.progress===100||P.status==="completed"?"completed":P.progress&&P.progress>0||P.status==="in-progress"?"in-progress":"todo",[]),yo=react.useMemo(()=>{let P=d0(e);if(je.trim()){let te=je.toLowerCase();P=P.filter(he=>he.name.toLowerCase().includes(te));}if(tt!=="all"){let te=new Set(P.filter(he=>br(he)===tt).flatMap(he=>he.parentPath));P=P.filter(he=>te.has(he.id));}if(pt){let te=new Set(P.filter(he=>br(he)!=="completed").flatMap(he=>he.parentPath));P=P.filter(he=>te.has(he.id));}return P.sort((te,he)=>{let Se,Me;switch(He){case "name":Se=te.name.toLowerCase(),Me=he.name.toLowerCase();break;case "startDate":Se=te.startDate?.getTime()||0,Me=he.startDate?.getTime()||0;break;case "endDate":Se=te.endDate?.getTime()||0,Me=he.endDate?.getTime()||0;break;case "progress":Se=te.progress||0,Me=he.progress||0;break;case "status":Se=te.status||"todo",Me=he.status||"todo";break;case "priority":let Qe={urgent:0,high:1,medium:2,low:3,none:4};Se=Qe[te.priority]??4,Me=Qe[he.priority]??4;break;case "position":return 0;default:return 0}return Se<Me?pe==="asc"?-1:1:Se>Me?pe==="asc"?1:-1:0}),P},[e,je,tt,pt,He,pe,br]),ao=react.useCallback((P,te)=>{let he=Qe=>{a.onTaskUpdate?.({...P,...Qe});},Se=Qe=>Qe?P.customFields?.find(Ge=>Ge.fieldId===Qe)?.value:void 0,Me=(Qe,fe)=>{if(!Qe)return;let nt=[...P.customFields||[]],vt=nt.findIndex(na=>na.fieldId===Qe);vt>=0?nt[vt]={fieldId:Qe,value:fe}:nt.push({fieldId:Qe,value:fe}),he({customFields:nt});};switch(te.type){case "name":return null;case "status":return jsxRuntime.jsx(Jm,{value:P.status||(P.progress===100?"completed":P.progress&&P.progress>0?"in-progress":"todo"),onChange:fe=>{he({status:fe,progress:fe==="completed"?100:fe==="in-progress"?50:0});},isDark:V,locale:f,translations:K.status});case "priority":return jsxRuntime.jsx(Zm,{value:P.priority,onChange:fe=>he({priority:fe}),isDark:V,locale:f});case "assignees":{let fe=P.hasChildren,Ge=P.assignees||[];if(fe&&P.subtasks?.length){let nt=new Map,vt=na=>{(na||[]).forEach(jt=>{(jt.assignees||[]).forEach(Pt=>{nt.has(Pt.name)||nt.set(Pt.name,Pt);}),jt.subtasks?.length&&vt(jt.subtasks);});};vt(P.subtasks),Ge=Array.from(nt.values());}else fe&&(Ge=[]);return jsxRuntime.jsx(ac,{value:Ge,availableUsers:l,onChange:nt=>he({assignees:nt}),isDark:V,locale:f,disabled:fe})}case "startDate":return jsxRuntime.jsx(Qi,{value:P.startDate,onChange:fe=>he({startDate:fe}),isDark:V,locale:f,dateField:"start",startDate:P.startDate,endDate:P.endDate});case "endDate":return jsxRuntime.jsx(Qi,{value:P.endDate,onChange:fe=>he({endDate:fe}),isDark:V,locale:f,dateField:"end",startDate:P.startDate,endDate:P.endDate});case "progress":{let fe=!!(P.subtasks&&P.subtasks.length>0),Ge=fe?i0(xc(P.subtasks||[])):P.progress||0;return jsxRuntime.jsx(lg,{value:Ge,onChange:fe?void 0:nt=>{let vt=nt===100?"completed":nt>0?"in-progress":"todo";he({progress:nt,status:vt});},isDark:V,disabled:fe})}case "tags":return jsxRuntime.jsx(vg,{value:P.tags||[],isDark:V});case "text":return jsxRuntime.jsx(ug,{value:Se(te.customFieldId)||"",onChange:fe=>Me(te.customFieldId,fe),isDark:V});case "number":return jsxRuntime.jsx(gg,{value:Se(te.customFieldId)||0,onChange:fe=>Me(te.customFieldId,fe),isDark:V});case "date":let Qe=Se(te.customFieldId);return jsxRuntime.jsx(Qi,{value:Qe?new Date(Qe):void 0,onChange:fe=>Me(te.customFieldId,fe),isDark:V,locale:f});case "dropdown":return jsxRuntime.jsx(fg,{value:Se(te.customFieldId)||"",options:te.options||[],onChange:fe=>Me(te.customFieldId,fe),isDark:V});case "checkbox":return jsxRuntime.jsx(hg,{value:Se(te.customFieldId)||false,onChange:fe=>Me(te.customFieldId,fe),isDark:V});case "estimatedTime":{let fe=P.status==="completed"||P.progress===100;return jsxRuntime.jsx(Mr,{value:P.estimatedTime,onChange:Ge=>he({estimatedTime:Ge}),isDark:V,locale:f,disabled:fe,lens:C,hourlyRate:B(P)})}case "quotedTime":{let fe=P.status==="completed"||P.progress===100,Ge=F?.enabled&&(!F.columns||F.columns.includes("quotedTime"));return jsxRuntime.jsx(Mr,{value:P.quotedTime,onChange:nt=>he({quotedTime:nt}),isDark:V,locale:f,disabled:fe,isBlurred:Ge,lens:C,hourlyRate:B(P)})}case "elapsedTime":{let fe=P.status==="completed"||P.progress===100,Ge=P.executedDollarsCanonical;return jsxRuntime.jsx(Mr,{value:P.elapsedTime,onChange:nt=>he({elapsedTime:nt}),isDark:V,locale:f,disabled:fe,lens:C,hourlyRate:B(P),financialOverride:Ge})}case "effortMinutes":{if(oe&&P.subtasks&&P.subtasks.length>0){let{allocated:na}=es(P);if(C==="financial"){let jt=X(P),Pt=Math.round(jt.dollarAllocated),Qa=Math.round(jt.dollarQuoted),ia=Qa-Pt;return jsxRuntime.jsxs("div",{className:"flex flex-col",children:[Pt>0?jsxRuntime.jsxs("span",{className:c("text-sm font-mono",V?"text-white/60":"text-gray-500"),children:["$",Pt.toLocaleString("es-CO")]}):null,ia!==0&&Pt>0&&Qa>0&&jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",ia>0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[ia>0?"+":"",Math.abs(ia)>=1e3?`$${(ia/1e3).toFixed(1)}K`:`$${ia}`]})]})}return jsxRuntime.jsx(Mr,{value:na>0?na:void 0,isDark:V,locale:f,disabled:true,lens:C,hourlyRate:_})}let fe=P.status==="completed"||P.progress===100,Ge=P.effortMinutes||0,nt=P.soldEffortMinutes||0,vt=B(P);if(C==="financial"&&vt&&Ge>0&&nt>0){let na=Math.round(Ge/60*vt),Pt=Math.round(nt/60*vt)-na;return jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx(Mr,{value:Ge,onChange:Qa=>he({effortMinutes:Qa}),isDark:V,locale:f,disabled:fe,lens:C,hourlyRate:B(P)}),Pt!==0&&jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",Pt>=0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Pt>0?"+":"",Math.abs(Pt)>=1e3?`$${(Pt/1e3).toFixed(1)}K`:`$${Pt}`]})]})}return jsxRuntime.jsx(Mr,{value:Ge,onChange:na=>he({effortMinutes:na}),isDark:V,locale:f,disabled:fe,lens:C,hourlyRate:B(P)})}case "timeLoggedMinutes":{let fe=P.executedDollarsCanonical;if(oe&&P.subtasks&&P.subtasks.length>0){let{spent:nt}=es(P);return jsxRuntime.jsx(Mr,{value:nt>0?nt:void 0,isDark:V,locale:f,disabled:true,lens:C,hourlyRate:B(P),financialOverride:fe})}let Ge=P.status==="completed"||P.progress===100;return jsxRuntime.jsx(Mr,{value:P.timeLoggedMinutes,onChange:a.onLogTime?nt=>{a.onLogTime?.(P,nt);}:void 0,isDark:V,locale:f,placeholder:f==="es"?"Agregar":"Add",disabled:Ge,lens:C,hourlyRate:B(P),financialOverride:fe})}case "soldEffortMinutes":{if(oe&&P.subtasks&&P.subtasks.length>0){let{quoted:nt}=es(P),vt=F?.enabled&&(!F.columns||F.columns.includes("soldEffortMinutes"));return jsxRuntime.jsx(Mr,{value:nt>0?nt:void 0,isDark:V,locale:f,disabled:true,isBlurred:vt,lens:C,hourlyRate:B(P)})}let fe=P.status==="completed"||P.progress===100,Ge=F?.enabled&&(!F.columns||F.columns.includes("soldEffortMinutes"));return jsxRuntime.jsx(Mr,{value:P.soldEffortMinutes,onChange:nt=>he({soldEffortMinutes:nt}),isDark:V,locale:f,disabled:fe,isBlurred:Ge,lens:C,hourlyRate:B(P)})}case "scheduleVariance":{let fe=P.effortMinutes||0,Ge=P.soldEffortMinutes||0,nt=P.timeLoggedMinutes||0,vt=fe>0||Ge>0||nt>0;return jsxRuntime.jsx(Tg,{startDate:P.startDate,endDate:P.endDate,scheduleVariance:P.scheduleVariance,isDark:V,locale:f,hasTimeAllocated:vt})}case "hoursBar":{if(oe&&P.hasChildren){let{spent:fe,allocated:Ge,quoted:nt}=es(P),vt=fe>Ge&&Ge>0;return jsxRuntime.jsxs("span",{className:c("text-[11px] font-mono flex items-center gap-1.5",V?"text-white/50":"text-gray-500"),children:[jsxRuntime.jsx("span",{className:c("font-bold",vt?"text-[#FF453A]":V?"text-white/80":"text-gray-800"),children:Zn(fe)}),Ge>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" / ",jsxRuntime.jsx("span",{className:V?"text-white/60":"text-gray-600",children:Zn(Ge)})]}),nt>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" / ",jsxRuntime.jsx("span",{className:V?"text-amber-400/70":"text-amber-600",children:Zn(nt)})]})]})}return jsxRuntime.jsx(Dg,{task:P,isDark:V,locale:f,onLogTime:a.onLogTime,onEstimateUpdate:a.onEstimateUpdate,onSoldEffortUpdate:a.onSoldEffortUpdate,showSoldEffort:t.showSoldEffort,onOpenTimeLog:a.onOpenTimeLog,lens:C,hourlyRate:B(P)})}case "teamLoad":return P.hasChildren||P.subtasks&&P.subtasks.length>0?jsxRuntime.jsx(Eg,{task:P,isDark:V,locale:f}):jsxRuntime.jsx(ac,{value:P.assignees||[],availableUsers:l,onChange:Ge=>{a.onTaskUpdate?.({...P,assignees:Ge});},isDark:V,locale:f});case "blockers":return jsxRuntime.jsx(Pg,{blockers:P.blockers,isDark:V,locale:f});case "weight":{let fe=R.get(P.id);if(fe!==void 0)return jsxRuntime.jsx("span",{className:c("text-xs font-mono",fe>0?V?"text-white/50":"text-gray-400":V?"text-white/30":"text-gray-300"),style:{fontFamily:"JetBrains Mono, monospace"},children:fe>0?`${Number(fe.toFixed(2))}%`:"\u2014"});let Ge=P.weight||0;return jsxRuntime.jsx(ww,{value:Ge,onChange:nt=>he({weight:nt}),isDark:V})}default:return jsxRuntime.jsx("span",{className:c("text-sm",V?"text-white/60":"text-gray-500"),children:"-"})}},[a,V,f,l,K,oe,R]),ro=react.useCallback(P=>{let he={name:K.columns.name,status:K.columns.status,priority:K.columns.priority,assignees:K.columns.assignees,startDate:K.columns.startDate,endDate:K.columns.endDate,progress:K.columns.progress,tags:K.columns.tags||(f==="es"?"Etiquetas":"Tags"),estimatedTime:K.columns.estimatedTime||(f==="es"?"Estimado":"Estimated"),quotedTime:K.columns.quotedTime||(f==="es"?"Ofertado":"Quoted"),elapsedTime:K.columns.elapsedTime||(f==="es"?"Ejecutado":"Executed"),soldEffortMinutes:K.columns.soldEffortMinutes||(f==="es"?"Ofertado":"Quoted"),effortMinutes:K.columns.effortMinutes||(f==="es"?"Estimado":"Estimated"),timeLoggedMinutes:K.columns.timeLoggedMinutes||(f==="es"?"Ejecutado":"Executed"),scheduleVariance:K.columns.scheduleVariance||(f==="es"?"Prog / Var":"Sched / Var"),hoursBar:K.columns.hoursBar||(f==="es"?"Horas (Usado / Asignado)":"Hours (Spent / Allocated)"),teamLoad:K.columns.teamLoad||(f==="es"?"Equipo":"Team"),blockers:K.columns.blockers||(f==="es"?"Bloqueantes":"Blockers"),weight:K.columns.weight||(f==="es"?"Peso":"Weight")}[P.type]||P.label;return typeof he=="string"?he:String(he||P.type)},[K,f]),xo=react.useMemo(()=>{let he=z.reduce((Me,Qe)=>Me+Qe.width,0)+(v?48:0),Se={};for(let Me of z)Se[Me.id]=`${Me.width/he*100}%`;return Se},[z,v]);return r?jsxRuntime.jsx("div",{className:c("flex-1 flex items-center justify-center",V?"bg-[#0D0D0D]":"bg-white",s),style:o,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#00E5CC]"}),jsxRuntime.jsxs("p",{className:c("text-sm",V?"text-white/60":"text-gray-600"),children:[K.empty.noTasks,"..."]})]})}):n?jsxRuntime.jsx("div",{className:c("flex-1 flex items-center justify-center",V?"bg-[#0D0D0D]":"bg-white",s),style:o,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:c("text-lg font-semibold mb-2",V?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:c("text-sm",V?"text-white/60":"text-gray-600"),children:typeof n=="string"?n:n.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:c("flex-1 flex items-center justify-center",V?"bg-[#0D0D0D]":"bg-white",s),style:o,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#00E5CC]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.List,{className:"w-8 h-8 text-[#00E5CC]"})}),jsxRuntime.jsx("h3",{className:c("text-lg font-semibold mb-2",V?"text-white":"text-gray-900"),children:K.empty.noTasks}),jsxRuntime.jsx("p",{className:c("text-sm",V?"text-white/60":"text-gray-600"),children:K.empty.addFirstTask})]})}):jsxRuntime.jsxs("div",{ref:kt,className:c(V?"bg-[#0D0D0D]":"bg-white",se&&"select-none",s),style:{display:"flex",flexDirection:"column",flex:"1 1 0%",width:"100%",height:"100%",overflow:"hidden",minHeight:0,...o},children:[jsxRuntime.jsx("div",{className:c("flex-shrink-0 px-6 py-4 border-b",V?"border-[#222]":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsxs("div",{className:c("text-sm",V?"text-white/60":"text-gray-600"),children:[yo.length," ",K.pagination.tasks]}),y&&jsxRuntime.jsxs("div",{className:"relative flex-1 max-w-md",children:[jsxRuntime.jsx(lucideReact.Search,{className:c("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",V?"text-white/60":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:je,onChange:P=>Oe(P.target.value),placeholder:K.toolbar.searchPlaceholder,className:c("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#00E5CC]/30",V?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30 font-mono":"bg-gray-100 border-gray-200 text-gray-900 placeholder:text-gray-400")})]}),jsxRuntime.jsx("div",{className:"flex-1"}),i&&jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:i}),b&&H>1&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("button",{ref:fa,onClick:()=>ct(!St),className:c("flex items-center gap-1.5 px-2 py-1.5 rounded-lg border transition-colors text-[11px] font-medium",V?St?"bg-[#00E5CC]/10 border-[#00E5CC]/40 text-[#00E5CC]":"bg-white/[0.03] border-[#333] text-white/50 hover:text-white/70 hover:bg-white/[0.05]":St?"bg-[#00E5CC]/15 border-[#00E5CC] text-[#00C4AE]":"bg-gray-100 border-gray-200 text-gray-500 hover:text-gray-700 hover:bg-gray-200"),style:{fontFamily:"'JetBrains Mono', monospace"},children:[jsxRuntime.jsx(lucideReact.Layers,{className:"w-3.5 h-3.5"}),Ft==="all"?f==="es"?"Todos":"All":`L${Ft}`]}),St&&jsxRuntime.jsx("div",{ref:xa,className:c("absolute top-full mt-1 right-0 w-24 rounded-lg border overflow-hidden z-50 shadow-lg",V?"bg-[#1A1A1A] border-[#333]":"bg-white border-gray-200"),children:[{value:"all",label:f==="es"?"Todos":"All"},...Array.from({length:Math.min(H,5)},(P,te)=>({value:te+1,label:`L${te+1}`}))].map(P=>jsxRuntime.jsxs("button",{onClick:()=>{Ct(P.value),ct(false);},className:c("w-full px-3 py-2 text-left text-xs transition-colors flex items-center justify-between",V?Ft===P.value?"bg-[#00E5CC]/10 text-[#00E5CC]":"text-white/60 hover:bg-white/[0.05] hover:text-white/80":Ft===P.value?"bg-[#00E5CC]/15 text-[#00C4AE]":"text-gray-600 hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{children:P.label}),Ft===P.value&&jsxRuntime.jsx("span",{className:"text-[#00E5CC]",children:"\u2713"})]},String(P.value)))})]}),jsxRuntime.jsx(Zg,{value:tt,hideCompleted:pt,onChange:wt,onHideCompletedChange:Ue,isDark:V,locale:f}),ae?.enabled&&ae.data&&!be&&jsxRuntime.jsx("button",{onClick:()=>Ie(true),className:c("flex items-center justify-center w-8 h-8 rounded-lg border transition-colors",V?"border-[#333] text-white/40 hover:text-white/70 hover:bg-white/[0.05]":"border-gray-200 text-gray-400 hover:text-gray-600 hover:bg-gray-100"),title:f==="es"?"Abrir panel de salud":"Open health panel",children:jsxRuntime.jsx(lucideReact.PanelRight,{className:"w-4 h-4"})}),t.toolbarEndContent,S&&M&&jsxRuntime.jsxs(framerMotion.motion.button,{onClick:M,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-[transform,box-shadow]",style:{background:"linear-gradient(135deg, #00E5CC 0%, #005FCC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 123, 255, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 123, 255, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:K.toolbar.newTask})]})]})}),jsxRuntime.jsxs("div",{style:{display:"flex",flex:"1 1 0%",overflow:"hidden",minHeight:0},children:[jsxRuntime.jsx("div",{style:{flex:"1 1 0%",overflow:"auto",minHeight:0},children:jsxRuntime.jsxs("div",{style:{width:"100%"},children:[jsxRuntime.jsxs("div",{className:c("flex-shrink-0 flex items-center border-b text-[10px] font-bold uppercase tracking-wider sticky top-0 z-10",V?"border-[#222] bg-[#1A1A1A] font-mono text-white/70":"border-gray-200 bg-gray-50 text-gray-600"),children:[ut&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),z.map(P=>{let te=P.id!=="name",he=J===P.id&&it!==P.id;return jsxRuntime.jsxs("div",{className:c("relative flex items-center gap-2 px-4 py-2 transition-all duration-150 group",V?"text-white/60":"text-gray-500",te&&"cursor-grab",P.type!=="name"&&"justify-center",it===P.id&&"opacity-50",he&&(V?"bg-[#00E5CC]/20 border-l-2 border-l-[#00E5CC]":"bg-[#00E5CC]/15 border-l-2 border-l-[#00E5CC]")),style:{width:xo[P.id],minWidth:P.minWidth},draggable:te,onDragStart:te?Se=>Wt(Se,P.id):void 0,onDragEnd:te?Va:void 0,onDragOver:te?Se=>va(Se,P.id):void 0,onDragLeave:te?oa:void 0,onDrop:te?Se=>cr(Se,P.id):void 0,onContextMenu:Se=>q(Se,void 0,P.id),children:[te&&jsxRuntime.jsx(lucideReact.GripVertical,{className:c("w-3 h-3 flex-shrink-0 transition-opacity",V?"text-white/20 group-hover:text-white/50":"text-gray-300 group-hover:text-gray-500")}),u?jsxRuntime.jsxs("button",{draggable:false,onClick:Se=>{let Me=Se.currentTarget.getBoundingClientRect();u(P.id,Me);},className:"flex items-center gap-1.5 hover:text-[#00E5CC]",children:[ro(P),m?.includes(P.id)&&jsxRuntime.jsx("span",{title:"filtered",style:{width:6,height:6,borderRadius:"50%",background:p,display:"inline-block",flexShrink:0}}),He===P.id&&jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3 text-[#00E5CC]"})]}):P.sortable?jsxRuntime.jsxs("button",{draggable:false,onClick:()=>Ve(P.id),className:"flex items-center gap-1 hover:text-[#00E5CC]",children:[ro(P),m?.includes(P.id)&&jsxRuntime.jsx("span",{title:"filtered",style:{width:6,height:6,borderRadius:"50%",background:p,display:"inline-block",flexShrink:0}}),jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:c("w-3 h-3",He===P.id&&"text-[#00E5CC]")})]}):jsxRuntime.jsxs("span",{draggable:false,className:"flex items-center gap-1.5",children:[ro(P),m?.includes(P.id)&&jsxRuntime.jsx("span",{title:"filtered",style:{width:6,height:6,borderRadius:"50%",background:p,display:"inline-block",flexShrink:0}})]}),w&&P.resizable&&jsxRuntime.jsx("div",{className:c("absolute right-0 top-0 bottom-0 w-1 cursor-col-resize group","hover:bg-[#00E5CC]",se===P.id&&"bg-[#00E5CC]"),onMouseDown:Se=>Nt(Se,P.id)})]},P.id)}),v&&jsxRuntime.jsxs("div",{className:"relative flex items-center justify-center w-12 flex-shrink-0",children:[jsxRuntime.jsx("button",{onClick:P=>{P.stopPropagation(),ht(te=>!te);},className:c("p-0.5 rounded transition-colors",V?"hover:bg-white/[0.05] text-white/60 hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600",ge&&(V?"bg-white/[0.05]":"bg-gray-200")),title:f==="es"?"Agregar columna":"Add column",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3 h-3"})}),jsxRuntime.jsx(_g,{isOpen:ge,onClose:()=>ht(false),columns:ot,customFields:d,onColumnsChange:N,onCreateCustomField:()=>{ht(false),O(true);},isDark:V,locale:f})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"popLayout",children:yo.map((P,te)=>{let he=ue.has(P.id),Se=Math.min(te*.01,.2),Me=P.hasChildren&&P.level===0,Qe=P.subtasks?.length||0;if(Me){let{spent:jt,allocated:Pt,quoted:Qa}=es(P),ia=vw(P);return jsxRuntime.jsxs(framerMotion.motion.div,{"data-task-id":P.id,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:Se},className:c("flex items-center border-y cursor-pointer transition-colors duration-500",V?"border-[#222] bg-[#222]":"border-gray-200 bg-gray-100",De===P.id&&(V?"!bg-[#FFD60A]/15":"!bg-yellow-100")),onClick:()=>a.onTaskClick?.(P),children:[ut&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),z.map(nr=>jsxRuntime.jsx("div",{className:c("flex items-center px-4 py-3 min-h-[56px]",nr.type!=="name"&&"justify-center"),style:{width:xo[nr.id],minWidth:nr.minWidth},children:nr.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[jsxRuntime.jsx("button",{onClick:ua=>{ua.stopPropagation(),ne(P.id);},className:c("p-0.5 rounded flex-shrink-0 mt-0.5",V?"hover:bg-white/[0.05]":"hover:bg-gray-200"),children:he?jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-4 h-4",V?"text-white/40":"text-gray-500")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:c("w-4 h-4",V?"text-white/40":"text-gray-500")})}),jsxRuntime.jsx("span",{onClick:ua=>{ua.stopPropagation(),ne(P.id);},className:"flex-shrink-0 cursor-pointer mt-0.5",children:he?jsxRuntime.jsx(lucideReact.FolderOpen,{className:"w-4 h-4",style:{color:V?"#FFD60A":"#B45309"}}):jsxRuntime.jsx(lucideReact.Folder,{className:"w-4 h-4",style:{color:V?"#FFD60A":"#B45309"}})}),P.wbsCode&&jsxRuntime.jsx("span",{className:"text-[10px] font-mono flex-shrink-0 mt-1",style:{color:V?"#FFD60A":"#B45309"},children:P.wbsCode}),jsxRuntime.jsxs("div",{className:"flex flex-col min-w-0",children:[jsxRuntime.jsx("span",{className:c("text-[13px] font-bold uppercase tracking-wide",V?"text-white":"text-gray-900"),style:{fontFamily:"Inter, system-ui, sans-serif"},children:P.name}),jsxRuntime.jsxs("span",{className:c("text-[10px] font-mono",V?"text-white/30":"text-gray-500"),children:["(",Qe," ",f==="es"?Qe===1?"Tarea":"Tareas":Qe===1?"Item":"Items",")"]}),ia!==null&&jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono px-1.5 py-0.5 rounded w-fit mt-0.5",ia>=1?"text-[#32D74B] bg-[#32D74B]/10":ia>=.8?"text-[#FFD60A] bg-[#FFD60A]/10":"text-[#FF453A] bg-[#FF453A]/10"),children:["Avg SPI: ",ia.toFixed(2)]})]})]}):nr.type==="timeLoggedMinutes"?C==="financial"?(()=>{let ua=P.executedDollarsCanonical,Dt=ua!=null?Math.round(ua):Math.round(X(P).dollarSpent);return Dt>0?jsxRuntime.jsxs("span",{className:c("text-sm font-mono",V?"text-white/60":"text-gray-500"),children:["$",Dt.toLocaleString("en-US")]}):null})():jsxRuntime.jsx(Mr,{value:jt>0?jt:void 0,isDark:V,locale:f,disabled:true,lens:C,hourlyRate:B(P)}):nr.type==="soldEffortMinutes"?C==="financial"?(()=>{let ua=X(P),Dt=Math.round(ua.dollarQuoted);return Dt>0?jsxRuntime.jsxs("span",{className:c("text-sm font-mono",V?"text-white/60":"text-gray-500"),children:["$",Dt.toLocaleString("en-US")]}):null})():jsxRuntime.jsx(Mr,{value:Qa>0?Qa:void 0,isDark:V,locale:f,disabled:true,lens:C,hourlyRate:B(P)}):nr.type==="effortMinutes"?C==="financial"?(()=>{let ua=X(P),Dt=Math.round(ua.dollarAllocated),Vr=Math.round(ua.dollarQuoted),Za=Vr-Dt;return jsxRuntime.jsxs("div",{className:"flex flex-col",children:[Dt>0?jsxRuntime.jsxs("span",{className:c("text-sm font-mono",V?"text-white/60":"text-gray-500"),children:["$",Dt.toLocaleString("es-CO")]}):null,Za!==0&&Dt>0&&Vr>0&&jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",Za>0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Za>0?"+":"",Math.abs(Za)>=1e3?`$${(Za/1e3).toFixed(1)}K`:`$${Za}`]})]})})():jsxRuntime.jsx(Mr,{value:Pt>0?Pt:void 0,isDark:V,locale:f,disabled:true,lens:C,hourlyRate:B(P)}):ao(P,nr)},nr.id)),v&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]},P.id)}let fe=$===P.id,Ge=Fe===P.id,nt=Ge&&Le==="above",vt=Ge&&Le==="below",na=Ge&&Le==="child";return jsxRuntime.jsxs(framerMotion.motion.div,{"data-task-id":P.id,"data-listview-row":P.id,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:Se},className:c("flex items-center border-b transition-colors relative group",V?"border-[#222] hover:bg-white/[0.05]":"border-gray-100 hover:bg-gray-50",De===P.id&&(V?"!bg-[#FFD60A]/15":"!bg-yellow-100")),style:{opacity:fe?.4:1,backgroundColor:na?V?"rgba(0, 229, 204,0.08)":"rgba(0, 229, 204,0.05)":void 0,boxShadow:na?"inset 0 0 0 2px #00E5CC":void 0},onClick:()=>a.onTaskClick?.(P),onDoubleClick:()=>a.onTaskDoubleClick?.(P),onContextMenu:jt=>q(jt,P),children:[nt&&jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:"#00E5CC",zIndex:10}}),vt&&jsxRuntime.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:2,backgroundColor:"#00E5CC",zIndex:10}}),ut&&jsxRuntime.jsx("div",{className:"flex-shrink-0 flex items-center justify-center w-5 cursor-grab opacity-0 group-hover:opacity-40 hover:!opacity-80 transition-opacity",onMouseDown:jt=>Gt(P.id,jt),style:{color:V?"#888":"#999"},children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-3 h-3"})}),z.map(jt=>jsxRuntime.jsx("div",{className:c("flex items-center px-4 py-3 min-h-[56px]",jt.type!=="name"&&"justify-center"),style:{width:xo[jt.id],minWidth:jt.minWidth},children:jt.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[b&&P.level>0&&jsxRuntime.jsx("div",{style:{width:`${P.level*24}px`},className:"flex-shrink-0"}),b&&P.hasChildren&&jsxRuntime.jsx("button",{onClick:Pt=>{Pt.stopPropagation(),ne(P.id);},className:c("p-0.5 rounded flex-shrink-0",V?"hover:bg-white/[0.05]":"hover:bg-gray-200"),children:he?jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-4 h-4",V?"text-white/60":"text-gray-400")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:c("w-4 h-4",V?"text-white/60":"text-gray-400")})}),b&&!P.hasChildren&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),jsxRuntime.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[(P.wbsCode||P.taskCode)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[P.wbsCode&&jsxRuntime.jsx("span",{className:c("text-[10px] font-mono",V?"text-[#00E5CC]":"text-[#00C4AE]"),children:P.wbsCode}),P.taskCode&&jsxRuntime.jsx("span",{className:c("text-[10px] font-mono",V?"text-white/40":"text-gray-400"),children:P.taskCode})]}),jsxRuntime.jsx("span",{className:c("truncate",P.hasChildren?"text-[14px] font-bold":"text-[13px] font-normal",P.progress===100?V?"line-through text-white/50":"line-through text-gray-400":P.hasChildren?V?"text-white":"text-gray-900":V?"text-[#D1D5DB]":"text-gray-600"),children:P.name}),P.tags?.[0]&&jsxRuntime.jsx("span",{className:"text-[9px] font-mono uppercase tracking-wide px-1.5 py-0.5 rounded w-fit",style:{backgroundColor:`${P.tags[0].color}20`,color:P.tags[0].color},children:P.tags[0].name})]})]}):ao(P,jt)},jt.id)),v&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]},P.id)})}),L&&yo.length>0&&(()=>{let{spent:P,allocated:te,quoted:he}=Re,Se=te-P,Me=Se<0,Qe=Me?`+${Zn(Math.abs(Se))} ${f==="es"?"EXCEDIDO":"OVER"}`:`+${Zn(Se)} ${f==="es"?"AHORRADO":"SAVED"}`,fe=C==="financial"&&_>0,Ge=Y?.breakdown,nt=!!Ge&&((Ge.equipment??0)>0||(Ge.travel??0)>0),vt=Ge?.laborSpent!=null?Ge.laborSpent:Y?.spent!=null?Y.spent:Re.dollarSpent,na=Ge?.laborAllocated!=null?Ge.laborAllocated:Y?.allocated!=null?Y.allocated:Re.dollarAllocated,jt=Y?.quoted!=null?Y.quoted:Re.dollarQuoted,Pt=(ua,Dt)=>{if(fe){let Vr=Dt??ua/60*_;return `$${Math.round(Vr).toLocaleString("es-CO")}`}return Zn(ua)},Qa=fe?Math.abs(na-vt):0,ia=fe?`+$${Qa.toLocaleString("es-CO",{minimumFractionDigits:0,maximumFractionDigits:0})} ${Me?f==="es"?"EXCEDIDO":"OVER":f==="es"?"AHORRADO":"SAVED"}`:Qe,nr=fe&&nt?f==="es"?"solo mano de obra":"labor only":void 0;return jsxRuntime.jsxs("div",{className:c("flex items-center sticky bottom-0 z-[5]",V?"border-t border-[#2A2A3A]":"border-t border-gray-300"),style:{backgroundColor:V?"rgba(13, 17, 23, 0.95)":"rgba(255, 255, 255, 0.95)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[ut&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),z.map(ua=>jsxRuntime.jsx("div",{className:c("flex items-center px-4 py-3",ua.type!=="name"&&"justify-center"),style:{width:xo[ua.id],minWidth:ua.minWidth},children:ua.type==="name"?jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:c("text-[11px] font-black uppercase tracking-widest",V?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:f==="es"?"TOTAL PROYECTO":"TOTAL PROJECT"}),nr&&jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono mt-0.5 flex items-center gap-1",V?"text-white/35":"text-gray-400"),children:[jsxRuntime.jsx(lucideReact.Info,{className:"w-2.5 h-2.5"}),nr]})]}):ua.type==="hoursBar"?jsxRuntime.jsxs("div",{className:"flex flex-col items-center w-full",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:c("text-[12px] font-bold",V?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:Pt(P,fe?vt:void 0)}),jsxRuntime.jsx("span",{className:c("text-[11px]",V?"text-white/40":"text-gray-400"),children:"/"}),jsxRuntime.jsx("span",{className:c("text-[11px]",V?"text-white/50":"text-gray-500"),style:{fontFamily:"JetBrains Mono, monospace"},children:Pt(te,fe?na:void 0)})]}),te>0&&jsxRuntime.jsx("span",{className:c("text-[10px] font-semibold mt-0.5 whitespace-nowrap",Me?"text-[#FF453A]":"text-[#32D74B]"),style:{fontFamily:"JetBrains Mono, monospace"},children:fe?ia:Qe})]}):ua.type==="soldEffortMinutes"?jsxRuntime.jsx("span",{className:c("text-[12px] font-bold",V?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:he>0?Pt(he,fe?jt:void 0):"\u2013"}):ua.type==="effortMinutes"?(()=>{if(fe&&he>0&&te>0){let Dt=Math.round(jt),Vr=Math.round(na),Za=Dt-Vr,rs=Dt>0?Math.round(Za/Dt*100):0;return jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx("span",{className:c("text-[12px] font-bold",V?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:Pt(te,na)}),jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",Za>=0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Za>=0?"+":"",Math.abs(Za)>=1e3?`$${(Za/1e3).toFixed(1)}K`:`$${Za}`,jsxRuntime.jsxs("span",{className:"ml-0.5 opacity-60",children:["(",rs,"%)"]})]})]})}return jsxRuntime.jsx("span",{className:c("text-[12px] font-bold",V?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:te>0?Pt(te,fe?na:void 0):"\u2013"})})():ua.type==="timeLoggedMinutes"?jsxRuntime.jsx("span",{className:c("text-[12px] font-bold",V?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:P>0?Pt(P,fe?vt:void 0):"\u2013"}):ua.type==="progress"?(()=>{let Dt=i0(xc(e||[]));return jsxRuntime.jsxs("span",{className:c("text-[12px] font-bold font-mono",V?"text-[#00E5CC]":"text-[#00C4AE]"),style:{fontFamily:"JetBrains Mono, monospace"},children:[Dt,"%"]})})():ua.type==="weight"?(()=>{let Dt=e||[],Vr=[],Za=vo=>{for(let oo of vo)Vr.push(oo),oo.subtasks?.length&&Za(oo.subtasks);};Za(Dt);let Ys=Vr.filter(vo=>!vo.subtasks?.length||vo.subtasks.length===0).reduce((vo,oo)=>vo+(oo.weight||0),0),os=Math.abs(Ys-100)<.1;return jsxRuntime.jsxs("span",{className:c("text-[12px] font-bold font-mono",os?V?"text-[#22C55E]":"text-green-600":"text-[#EF4444]"),style:{fontFamily:"JetBrains Mono, monospace"},children:[Number(Ys.toFixed(1)),"%"]})})():jsxRuntime.jsx("span",{className:c("text-[11px]",V?"text-white/30":"text-gray-300"),children:"\u2013"})},ua.id)),v&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]})})(),yo.length===0&&je&&jsxRuntime.jsx("div",{className:"flex items-center justify-center py-12",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(lucideReact.List,{className:c("w-12 h-12 mx-auto mb-4",V?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("p",{className:c(V?"text-white/60":"text-gray-600"),children:K.empty.noResults})]})})]})}),ae?.enabled&&ae.data&&be&&jsxRuntime.jsx(t0,{data:ae.data,isDark:V,locale:f,onClose:()=>Ie(false),lens:t?.lens,onUnassignedTaskClick:P=>{let te=document.querySelector(`[data-task-id="${P}"]`);te&&(te.scrollIntoView({behavior:"smooth",block:"center"}),Ee(P),setTimeout(()=>Ee(null),2e3));}})]}),jsxRuntime.jsx(Rg,{state:Z,onClose:et,isDark:V,locale:f,onTaskEdit:a.onTaskEdit,onTaskDuplicate:a.onTaskDuplicate,onTaskDelete:a.onTaskDelete,onTaskUpdate:a.onTaskUpdate,onColumnHide:U,onColumnSort:Ne,availableUsers:l,onOpenTimeLog:a.onOpenTimeLog,onReportBlocker:a.onReportBlocker,onCopyTaskLink:a.onCopyTaskLink,onTaskMove:a.onTaskMove,onTaskIndent:a.onTaskIndent,onTaskOutdent:a.onTaskOutdent}),Ye&&st&&$&&reactDom.createPortal(jsxRuntime.jsx("div",{style:{position:"fixed",left:st.x+12,top:st.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let te=Pe.flattenTasks(e).find(he=>he.id===$);return te?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg",style:{backgroundColor:V?"rgba(10,10,10,0.9)":"rgba(255,255,255,0.95)",border:`1px solid ${V?"rgba(255,255,255,0.1)":"#e5e7eb"}`,backdropFilter:"blur(8px)",boxShadow:"0 4px 12px rgba(0,0,0,0.3)"},children:[jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-3 h-3",style:{color:"#00E5CC"}}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:V?"#e6edf3":"#111827"},children:te.name})]}):null})()}),document.body),jsxRuntime.jsx(Yg,{isOpen:k,onClose:()=>O(false),onSave:wa,isDark:V,locale:f})]})}var u0=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"priority",type:"priority",label:"Priority",width:100,visible:false,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true},{id:"tags",type:"tags",label:"Tags",width:150,visible:false,sortable:false,resizable:true},{id:"soldEffortMinutes",type:"soldEffortMinutes",label:"Quoted",width:100,visible:false,sortable:true,resizable:true},{id:"effortMinutes",type:"effortMinutes",label:"Estimated",width:100,visible:false,sortable:true,resizable:true},{id:"timeLoggedMinutes",type:"timeLoggedMinutes",label:"Executed",width:100,visible:false,sortable:true,resizable:true},{id:"scheduleVariance",type:"scheduleVariance",label:"Sched / Var",width:180,visible:false,sortable:true,resizable:true},{id:"hoursBar",type:"hoursBar",label:"Hours",width:200,visible:false,sortable:true,resizable:true},{id:"teamLoad",type:"teamLoad",label:"Team Load",width:160,visible:false,sortable:true,resizable:true},{id:"blockers",type:"blockers",label:"Blockers",width:150,visible:false,sortable:false,resizable:true},{id:"weight",type:"weight",label:"Weight",width:80,visible:false,sortable:true,resizable:true}],p0=[{type:"name",labelKey:"columns.name",icon:"Type"},{type:"status",labelKey:"columns.status",icon:"CircleDot"},{type:"priority",labelKey:"columns.priority",icon:"Flag"},{type:"assignees",labelKey:"columns.assignees",icon:"Users"},{type:"startDate",labelKey:"columns.startDate",icon:"Calendar"},{type:"endDate",labelKey:"columns.endDate",icon:"CalendarCheck"},{type:"progress",labelKey:"columns.progress",icon:"BarChart"},{type:"tags",labelKey:"columns.tags",icon:"Tag"},{type:"effortMinutes",labelKey:"columns.effortMinutes",icon:"Clock"},{type:"timeLoggedMinutes",labelKey:"columns.timeLoggedMinutes",icon:"Timer"},{type:"soldEffortMinutes",labelKey:"columns.soldEffortMinutes",icon:"FileText"},{type:"scheduleVariance",labelKey:"columns.scheduleVariance",icon:"CalendarClock"},{type:"hoursBar",labelKey:"columns.hoursBar",icon:"BarChart3"},{type:"teamLoad",labelKey:"columns.teamLoad",icon:"Users"},{type:"blockers",labelKey:"columns.blockers",icon:"AlertTriangle"},{type:"weight",labelKey:"columns.weight",icon:"Scale"}],m0=[{type:"text",labelKey:"customFields.text",icon:"Type"},{type:"number",labelKey:"customFields.number",icon:"Hash"},{type:"date",labelKey:"customFields.date",icon:"Calendar"},{type:"dropdown",labelKey:"customFields.dropdown",icon:"ChevronDown"},{type:"checkbox",labelKey:"customFields.checkbox",icon:"CheckSquare"}];var vc={bgPrimary:"#0D0D0D",bgSecondary:"#141414",bgHover:"rgba(255,255,255,0.05)",bgSelected:"#0D131E",bgAlternate:"#141414",border:"#222222",borderLight:"#1A1A1A",textPrimary:"rgba(255,255,255,0.9)",textSecondary:"rgba(255,255,255,0.6)",textMuted:"rgba(255,255,255,0.3)",accent:"#00E5CC",accentHover:"#2979FF",accentLight:"rgba(0,123,255,0.15)",statusTodo:"rgba(255,255,255,0.4)",statusInProgress:"#00E5CC",statusCompleted:"#34D399",focusRing:"#00E5CC",checkboxBg:"#1A1A1A",checkboxChecked:"#00E5CC",bgGroupHeader:"#222222",headerBg:"#1A1A1A",neonRed:"#FF2D20",neonGreen:"#3BF06E",neonAmber:"#FFD60A",neonBlue:"#3B9EFF"},wc={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgSelected:"#dbeafe",bgAlternate:"#f9fafb",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",checkboxBg:"#ffffff",checkboxChecked:"#0969da",bgGroupHeader:"#F3F4F6",headerBg:"#F9FAFB",neonRed:"#DC2626",neonGreen:"#16A34A",neonAmber:"#D97706",neonBlue:"#00E5CC"},kc={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgSelected:"#0f4c7520",bgAlternate:"#1a1a2e80",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",checkboxBg:"#1f3460",checkboxChecked:"#6366f1",bgGroupHeader:"#1f3460",headerBg:"#16213e",neonRed:"#EF4444",neonGreen:"#34D399",neonAmber:"#FBBF24",neonBlue:"#6366F1"},sl={dark:vc,light:wc,neutral:kc};function g0(e){return sl[e]||sl.dark}var Cc={navigation:{today:"Today",previous:"Previous",next:"Next",month:"Month",week:"Week",day:"Day"},weekdays:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weekdaysFull:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{allDay:"All day",moreEvents:"+{count} more",noEvents:"No tasks",newTask:"New Task",viewAll:"View all",week:"Week",backlogTitle:"BACKLOG / UNSCHEDULED",systemStatus:"SYSTEM STATUS",budgetUtil:"Budget Util.",variance:"VARIANCE",cost:"COST",estimate:"Est",sold:"Sold",cashOut:"Cash Out",typeToAdd:"Type to add (e.g., Crane Inspection)",critical:"CRITICAL",blocker:"Blocker",risk:"Risk",delay:"delay",days:"Days"},tooltips:{progress:"Progress",status:"Status",assignees:"Assignees",duration:"Duration",days:"days"}},Tc={navigation:{today:"Hoy",previous:"Anterior",next:"Siguiente",month:"Mes",week:"Semana",day:"D\xEDa"},weekdays:{sun:"Dom",mon:"Lun",tue:"Mar",wed:"Mi\xE9",thu:"Jue",fri:"Vie",sat:"S\xE1b"},weekdaysFull:{sunday:"Domingo",monday:"Lunes",tuesday:"Martes",wednesday:"Mi\xE9rcoles",thursday:"Jueves",friday:"Viernes",saturday:"S\xE1bado"},months:{january:"Enero",february:"Febrero",march:"Marzo",april:"Abril",may:"Mayo",june:"Junio",july:"Julio",august:"Agosto",september:"Septiembre",october:"Octubre",november:"Noviembre",december:"Diciembre"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{allDay:"Todo el d\xEDa",moreEvents:"+{count} m\xE1s",noEvents:"Sin tareas",newTask:"Nueva Tarea",viewAll:"Ver todo",week:"Semana",backlogTitle:"BACKLOG / SIN FECHA",systemStatus:"ESTADO DEL SISTEMA",budgetUtil:"Util. Presupuesto",variance:"VARIANZA",cost:"COSTO",estimate:"Est",sold:"Vendido",cashOut:"Desembolso",typeToAdd:"Escribe para agregar (ej: Inspecci\xF3n)",critical:"CR\xCDTICO",blocker:"Bloqueador",risk:"Riesgo",delay:"retraso",days:"D\xEDas"},tooltips:{progress:"Progreso",status:"Estado",assignees:"Asignados",duration:"Duraci\xF3n",days:"d\xEDas"}},il={en:Cc,es:Tc};function $s(e){return il[e]||il.en}function ll(e,t){let a=$s(e);return t?{navigation:{...a.navigation,...t.navigation},weekdays:{...a.weekdays,...t.weekdays},weekdaysFull:{...a.weekdaysFull,...t.weekdaysFull},months:{...a.months,...t.months},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},tooltips:{...a.tooltips,...t.tooltips}}:a}function f0(e){let t=$s(e);return [t.months.january,t.months.february,t.months.march,t.months.april,t.months.may,t.months.june,t.months.july,t.months.august,t.months.september,t.months.october,t.months.november,t.months.december]}function b0(e,t=0,a=true){let r=$s(e),n=a?[r.weekdays.sun,r.weekdays.mon,r.weekdays.tue,r.weekdays.wed,r.weekdays.thu,r.weekdays.fri,r.weekdays.sat]:[r.weekdaysFull.sunday,r.weekdaysFull.monday,r.weekdaysFull.tuesday,r.weekdaysFull.wednesday,r.weekdaysFull.thursday,r.weekdaysFull.friday,r.weekdaysFull.saturday];return [...n.slice(t),...n.slice(0,t)]}function zs(e){let t=[];function a(r){for(let n of r)t.push(n),n.subtasks?.length&&a(n.subtasks);}return a(e),t}function Dc(e,t){if(!t.startDate||!t.endDate)return false;let a=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(t.startDate.getFullYear(),t.startDate.getMonth(),t.startDate.getDate()),n=new Date(t.endDate.getFullYear(),t.endDate.getMonth(),t.endDate.getDate());return a>=r&&a<=n}function x0({task:e,isDark:t}){return e.progress===100||e.status==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-emerald-400 flex-shrink-0"}):e.progress&&e.progress>0||e.status==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3 h-3 text-[#007FFF] flex-shrink-0"}):jsxRuntime.jsx(lucideReact.Circle,{className:c("w-3 h-3 flex-shrink-0",t?"text-white/40":"text-gray-400")})}var k0=26,Mw=22,Pw=10;function v0(e,t){let a=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return Math.round((a-r)/(1e3*60*60*24))}function Sc(e,t="hours",a=0){if(!e||e<=0)return null;if(t==="financial"&&a>0){let n=Math.round(e/60*a);return n>=1e3?`$${(n/1e3).toFixed(1)}k`:`$${n}`}let r=Math.round(e/480);return r>0?`${r}d`:null}function C0(e,t="hours",a=0){if(e.soldEffortMinutes==null||e.effortMinutes==null)return null;let r=e.soldEffortMinutes-e.effortMinutes;if(r===0)return null;let n=r<0,s;if(t==="financial"&&a>0){let o=Math.round(Math.abs(r/60)*a);s=o>=1e3?`$${(o/1e3).toFixed(1)}k`:`$${o}`;}else {let o=Math.round(Math.abs(r)/60);s=o>=1e3?`$${(o/1e3).toFixed(1)}k`:`$${o}`;}return {text:`${n?"-":"+"}${s}`,isNegative:n}}function w0(e,t="hours",a=0){if(t==="financial"&&a>0){let n=Math.round(Math.abs(e/60)*a);return n>=1e3?`$${(n/1e3).toFixed(1)}k`:`$${n}`}let r=Math.round(Math.abs(e)/60);return r>=1e3?`$${(r/1e3).toFixed(1)}k`:`$${r}`}function Fw({segment:e,isDark:t,onClick:a,blurFinancials:r,isSelected:n,t:s,lens:o="hours",hourlyRate:l=0}){let{task:d,spanCols:i,lane:u,isStart:m,isEnd:p}=e,g=d.progress===100||d.status==="completed",f=d.isCriticalPath,x=m&&p?"rounded":m?"rounded-l":p?"rounded-r":"",y=p?Sc(d.effortMinutes,o,l):null,b=p?C0(d,o,l):null,h=p?d.blockers?.find(v=>v.severity==="critical"):null;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:v=>{v.stopPropagation(),a();},whileHover:{scale:1.005},className:c("absolute flex items-center gap-1.5 px-2 text-xs cursor-pointer overflow-hidden",x,g?t?"text-emerald-400":"bg-emerald-500/10 text-emerald-600 border border-emerald-200":f?t?"text-white/90":"bg-red-50 border border-red-200 text-red-700 hover:border-red-300":t?"text-white/90":"bg-gray-50 border border-gray-200 text-gray-700 hover:border-[#00E5CC]"),style:{top:`${u*k0}px`,left:"1px",width:`calc(${i*100}% - 2px)`,height:`${Mw}px`,zIndex:10,...t?g?{background:"rgba(16, 185, 129, 0.28)",border:"1px solid rgba(16, 185, 129, 0.50)",boxShadow:"0 0 14px rgba(16, 185, 129, 0.2), inset 0 0 14px rgba(16, 185, 129, 0.1)"}:f?{background:"rgba(239, 68, 68, 0.35)",border:"1px solid rgba(239, 68, 68, 0.65)",boxShadow:"0 0 18px rgba(239, 68, 68, 0.3), inset 0 0 18px rgba(239, 68, 68, 0.15)"}:{background:"rgba(18, 100, 255, 0.38)",border:"1px solid rgba(18, 100, 255, 0.65)",boxShadow:"0 0 18px rgba(18, 100, 255, 0.28), inset 0 0 18px rgba(18, 100, 255, 0.14)"}:{},borderLeftWidth:m?"3px":void 0,borderLeftColor:m?f?"#EF4444":g?"#10B981":"#1264FF":void 0,...n?{boxShadow:t?"0 0 0 1.5px rgba(0, 229, 255, 0.7), 0 0 12px rgba(0, 229, 255, 0.3)":"0 0 0 1.5px rgba(0, 229, 204, 0.7), 0 0 12px rgba(0, 229, 204, 0.2)",zIndex:20}:{}},children:[f&&m&&jsxRuntime.jsxs("span",{className:"text-[9px] font-mono font-bold text-red-400 uppercase tracking-wider flex-shrink-0",children:[s.labels.critical,":"]}),jsxRuntime.jsx("span",{className:"truncate flex-1 text-left font-medium",children:d.name}),p&&(y||b)&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0 text-[9px] font-mono text-white/35 ml-1",children:[y&&jsxRuntime.jsxs("span",{children:[s.labels.estimate,": ",y]}),b&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"text-white/15",children:"|"}),jsxRuntime.jsx("span",{className:c(b.isNegative?"text-red-400":"text-emerald-400",r&&"blur-sm select-none"),children:b.text})]})]}),h&&jsxRuntime.jsxs("span",{className:"flex-shrink-0 text-[8px] font-mono px-1.5 py-0.5 rounded bg-red-500/20 text-red-400 border border-red-500/30 ml-1",children:[s.labels.blocker,": ",h.type]}),d.progress>0&&d.progress<100&&jsxRuntime.jsx("div",{className:"absolute bottom-0 left-0 h-[2px] bg-[#1264FF]",style:{width:`${d.progress}%`}})]})}function T0({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:n=false,error:s,className:o,style:l,availableTags:d=[],onCreateTag:i,attachmentsByTask:u,comments:m,onAddComment:p,currentUser:g,mentionableUsers:f,onUploadCommentAttachments:x,onTaskOpen:y,enableTimeTracking:b,timeTrackingSummary:h,timeEntries:v,timerState:w,onLogTime:D,onUpdateEstimate:S,onUpdateSoldEffort:M,onStartTimer:T,onStopTimer:F,onDiscardTimer:A,blurFinancials:C=false,suppressDetailModal:_=false,lens:W="hours",hourlyRate:oe=0}){let{theme:L="dark",locale:Y="en",customTranslations:K,showBacklog:V=true}=t,B=ll(Y,K),X=L==="dark"||L==="neutral",[Ce,Re]=react.useState(r||new Date),[R,ae]=react.useState(null),[be,Ie]=react.useState(null),[De,Ee]=react.useState(null),[He,rt]=react.useState({}),pe=3,We=3,je=react.useCallback($=>{Ie($.id),_||ae($),y?.($.id);},[_,y]),[Oe,tt]=react.useState(null),wt=react.useCallback(()=>{Re(new Date(Ce.getFullYear(),Ce.getMonth()-1,1));},[Ce]),pt=react.useCallback(()=>{Re(new Date(Ce.getFullYear(),Ce.getMonth()+1,1));},[Ce]),Ue=react.useCallback(()=>{Re(new Date);},[]),ot=react.useMemo(()=>{let $=Ce.getFullYear(),re=Ce.getMonth(),Ye=new Date($,re,1),Te=new Date($,re+1,0),Fe=Ye.getDay(),ze=Te.getDate(),Le=zs(e),Ze=new Date;Ze.setHours(0,0,0,0);let st=[],yt=Fe,xt=new Date($,re,0).getDate();for(let ut=yt-1;ut>=0;ut--){let Gt=new Date($,re-1,xt-ut);st.push({date:Gt,isCurrentMonth:false,isToday:false,isWeekend:Gt.getDay()===0||Gt.getDay()===6,events:Le.filter(Mt=>Dc(Gt,Mt)).map(Mt=>({id:Mt.id,title:Mt.name,start:Mt.startDate,end:Mt.endDate,task:Mt}))});}for(let ut=1;ut<=ze;ut++){let Gt=new Date($,re,ut),Mt=Gt.getTime()===Ze.getTime();st.push({date:Gt,isCurrentMonth:true,isToday:Mt,isWeekend:Gt.getDay()===0||Gt.getDay()===6,events:Le.filter(It=>Dc(Gt,It)).map(It=>({id:It.id,title:It.name,start:It.startDate,end:It.endDate,task:It}))});}let $t=42-st.length;for(let ut=1;ut<=$t;ut++){let Gt=new Date($,re+1,ut);st.push({date:Gt,isCurrentMonth:false,isToday:false,isWeekend:Gt.getDay()===0||Gt.getDay()===6,events:Le.filter(Mt=>Dc(Gt,Mt)).map(Mt=>({id:Mt.id,title:Mt.name,start:Mt.startDate,end:Mt.endDate,task:Mt}))});}return st},[Ce,e]),Et=react.useMemo(()=>zs(e).filter($=>!$.startDate||!$.endDate),[e]),ge=react.useMemo(()=>{let $=zs(e),re=0,Ye=0,Te=0,Fe=0,ze=0;$.forEach(xt=>{xt.effortMinutes&&(re+=xt.effortMinutes),xt.soldEffortMinutes&&(Ye+=xt.soldEffortMinutes),xt.scheduleVariance!=null&&(Te+=xt.scheduleVariance,Fe++),xt.soldEffortMinutes&&xt.effortMinutes&&(ze+=xt.soldEffortMinutes-xt.effortMinutes);});let Le=Ye>0?Math.min(100,Math.round(re/Ye*100)):0,Ze=Fe>0?Math.round(Te/Fe):0,yt=`${ze<0?"-":"+"}${w0(ze,W,oe)}`;return {budgetUtil:Le,avgVariance:Ze,costDisplay:yt,hasCostData:Ye>0}},[e,W,oe]),ht=react.useMemo(()=>{let $=[0,0,0,0,0,0];return ot.forEach((re,Ye)=>{let Te=Math.floor(Ye/7);re.events.forEach(Fe=>{if(Fe.task.startDate&&Fe.task.soldEffortMinutes){let ze=new Date(Fe.task.startDate),Le=re.date;ze.getFullYear()===Le.getFullYear()&&ze.getMonth()===Le.getMonth()&&ze.getDate()===Le.getDate()&&Te<$.length&&($[Te]-=Fe.task.soldEffortMinutes);}});}),$},[ot]),k=react.useMemo(()=>{let $=zs(e),re=new Map,Ye=new Set,Te=[0,0,0,0,0,0];if(ot.length===0)return {segmentsByCell:re,multiDayTaskIds:Ye,maxLanesPerRow:Te};let Fe=yt=>new Date(yt.getFullYear(),yt.getMonth(),yt.getDate()),ze=Fe(ot[0].date),Le=Fe(ot[ot.length-1].date),Ze=[];for(let yt of $){if(!yt.startDate||!yt.endDate)continue;let xt=Fe(yt.startDate),$t=Fe(yt.endDate);if(xt.getTime()===$t.getTime()||$t<ze||xt>Le)continue;let ut=xt<ze?ze:xt,Gt=$t>Le?Le:$t,Mt=v0(ut,ze),It=v0(Gt,ze);Mt<0||Mt>41||It<0||It>41||Mt!==It&&(Ye.add(yt.id),Ze.push({task:yt,startIdx:Mt,endIdx:It}));}Ze.sort((yt,xt)=>yt.startIdx!==xt.startIdx?yt.startIdx-xt.startIdx:xt.endIdx-xt.startIdx-(yt.endIdx-yt.startIdx));let st=[[],[],[],[],[],[]];for(let{task:yt,startIdx:xt,endIdx:$t}of Ze){let ut=Math.floor(xt/7),Gt=Math.floor($t/7),Mt=Fe(yt.startDate),It=Fe(yt.endDate),Ft=false;for(let Ct=ut;Ct<=Gt;Ct++){let St=Ct===ut?xt%7:0,ct=Ct===Gt?$t%7:6,fa=ct-St+1,xa=0,H=st[Ct]??[];for(st[Ct]||(st[Ct]=H);xa<H.length&&(H[xa]??-1)>=St;)xa++;if(xa>=Pw){Ft=true;break}xa>=H.length?H.push(ct):H[xa]=ct,Te[Ct]=Math.max(Te[Ct]??0,xa+1);let se=Ct===ut&&Mt>=ze,at=Ct===Gt&&It<=Le,Xt=Ct*7+St,ee={taskId:yt.id,task:yt,rowIndex:Ct,startCol:St,endCol:ct,spanCols:fa,lane:xa,isStart:se,isEnd:at};re.has(Xt)||re.set(Xt,[]),re.get(Xt).push(ee);}Ft&&(Ye.delete(yt.id),re.forEach((Ct,St)=>{let ct=Ct.filter(fa=>fa.taskId!==yt.id);ct.length===0?re.delete(St):re.set(St,ct);}));}return {segmentsByCell:re,multiDayTaskIds:Ye,maxLanesPerRow:Te}},[ot,e]),O=Y==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Z=Ce.toLocaleDateString(Y==="es"?"es-ES":"en-US",{month:"long",year:"numeric"}),ve=Z.charAt(0).toUpperCase()+Z.slice(1);return n?jsxRuntime.jsx("div",{className:c("flex-1 flex items-center justify-center",X?"bg-[#050505]":"bg-white",o),style:l,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#007FFF]"}),jsxRuntime.jsxs("p",{className:c("text-sm font-mono",X?"text-white/30":"text-gray-600"),children:[B.labels.noEvents,"..."]})]})}):s?jsxRuntime.jsx("div",{className:c("flex-1 flex items-center justify-center",X?"bg-[#050505]":"bg-white",o),style:l,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:c("w-12 h-12 rounded-full flex items-center justify-center",X?"bg-red-500/10 border border-red-500/20":"bg-red-500/10"),children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:c("text-lg font-semibold mb-2",X?"text-white/90":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:c("text-sm",X?"text-white/40":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:c("flex-1 flex items-center justify-center",X?"bg-[#050505]":"bg-white",o),style:l,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:c("w-16 h-16 mx-auto mb-4 rounded-2xl flex items-center justify-center",X?"bg-[#007FFF]/10 border border-[#007FFF]/20":"bg-[#00E5CC]/10"),children:jsxRuntime.jsx(lucideReact.Calendar,{className:c("w-8 h-8",X?"text-[#007FFF]":"text-[#00E5CC]")})}),jsxRuntime.jsx("h3",{className:c("text-lg font-semibold mb-2",X?"text-white/90":"text-gray-900"),children:B.labels.noEvents}),jsxRuntime.jsx("p",{className:c("text-sm",X?"text-white/30":"text-gray-600"),children:B.labels.newTask})]})}):jsxRuntime.jsxs("div",{className:c("flex-1 flex flex-col w-full h-full overflow-hidden",X?"bg-[#050505]":"bg-white",o),style:l,children:[jsxRuntime.jsxs("div",{className:"flex flex-1 overflow-hidden relative",children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col min-w-0 relative overflow-hidden",children:[jsxRuntime.jsxs("div",{className:c("flex-shrink-0 h-10 flex items-center justify-between px-4 z-20",X?"bg-[#050505] border-b border-[#222]":"bg-white border-b border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[jsxRuntime.jsxs("div",{className:c("flex items-center gap-1.5 pl-2.5 pr-2 py-1 rounded-md text-xs transition-all",X?"bg-[#111] border border-white/10":"bg-gray-100 border border-gray-200"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:c("w-3.5 h-3.5",X?"text-[#007FFF]":"text-[#00E5CC]")}),jsxRuntime.jsx("span",{className:c("font-medium",X?"text-white":"text-gray-900"),children:Y==="es"?"Calendario":"Calendar"})]}),jsxRuntime.jsx("div",{className:c("h-4 w-px",X?"bg-white/10":"bg-gray-200")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 select-none",children:[jsxRuntime.jsx("button",{onClick:wt,className:c("w-6 h-6 flex items-center justify-center rounded transition-colors",X?"text-white/50 hover:text-white hover:bg-white/5":"text-gray-500 hover:text-gray-900 hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("span",{className:c("text-sm font-semibold tracking-tight min-w-[150px] text-center",X?"text-white":"text-gray-900"),children:ve}),jsxRuntime.jsx("button",{onClick:pt,className:c("w-6 h-6 flex items-center justify-center rounded transition-colors",X?"text-white/50 hover:text-white hover:bg-white/5":"text-gray-500 hover:text-gray-900 hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[t.toolbarRightContent&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t.toolbarRightContent,jsxRuntime.jsx("div",{className:c("h-4 w-px",X?"bg-white/10":"bg-gray-200")})]}),jsxRuntime.jsx("button",{onClick:Ue,className:c("px-2.5 py-1 text-xs rounded-md transition-all font-medium",X?"bg-white/5 border border-white/10 text-white/70 hover:bg-white/10 hover:text-white":"bg-gray-100 border border-gray-200 text-gray-700 hover:bg-gray-200"),children:B.navigation.today})]})]}),jsxRuntime.jsx("div",{className:c("grid grid-cols-7 sticky top-0 z-10",X?"bg-[#050505] border-b border-[#222]":"bg-white border-b border-gray-200"),children:O.map($=>jsxRuntime.jsx("div",{className:c("py-2 text-center text-[10px] font-bold uppercase tracking-widest",X?"text-white/60 font-mono":"text-gray-500"),children:$},$))}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:jsxRuntime.jsx("div",{className:c("grid grid-cols-7 min-h-[800px]",X?"bg-[#050505]":"bg-white"),style:{gridAutoRows:"minmax(140px, auto)"},onClick:()=>Ie(null),children:ot.map(($,re)=>{let Ye=re%7===6,Te=re>=35;return jsxRuntime.jsxs("div",{className:c("min-h-[140px] p-2 transition-colors flex flex-col relative group overflow-visible",!Ye&&(X?"border-r border-[#222]":"border-r border-gray-200"),!Te&&(X?"border-b border-[#222]":"border-b border-gray-200"),X?$.isCurrentMonth?"bg-[#050505] hover:bg-white/[0.02]":"bg-[#080808] opacity-50":$.isCurrentMonth?"bg-white hover:bg-gray-50":"bg-gray-50 opacity-50",$.isToday&&X&&"ring-1 ring-[#007FFF]/40 ring-inset bg-[#007FFF]/[0.03]",$.isToday&&!X&&"ring-2 ring-[#00E5CC] ring-inset"),children:[jsxRuntime.jsx("span",{className:c("text-xs font-mono select-none relative z-20",$.isToday?X?"text-[#007FFF] font-bold":"text-[#00C4AE] font-bold":$.isCurrentMonth?X?"text-white/60":"text-gray-900":X?"text-white/20":"text-gray-400"),children:String($.date.getDate()).padStart(2,"0")}),(()=>{let Fe=Math.floor(re/7),ze=(k.maxLanesPerRow[Fe]??0)*k0,Le=k.segmentsByCell.get(re);return ze===0&&!Le?null:jsxRuntime.jsx("div",{className:"relative -mx-2 overflow-visible",style:{minHeight:`${ze}px`,zIndex:5},children:Le?.map(Ze=>jsxRuntime.jsx(Fw,{segment:Ze,isDark:X,blurFinancials:C,isSelected:be===Ze.taskId,t:B,lens:W,hourlyRate:oe,onClick:()=>{je(Ze.task),a.onEventClick?.({id:Ze.task.id,title:Ze.task.name,start:Ze.task.startDate,end:Ze.task.endDate,task:Ze.task});}},Ze.taskId))})})(),(()=>{let Fe=$.events.filter(ze=>ze.task.isMilestone&&!k.multiDayTaskIds.has(ze.id));return Fe.length===0?null:jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-0.5 px-0.5",children:[Fe.slice(0,4).map(ze=>jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 flex-shrink-0 cursor-pointer",title:ze.title,onClick:Le=>{Le.stopPropagation(),je(ze.task);}},ze.id)),Fe.length>4&&jsxRuntime.jsxs("span",{className:c("text-[8px] font-mono",X?"text-white/30":"text-gray-400"),children:["+",Fe.length-4]})]})})(),(()=>{let Fe=[];$.events.forEach(Le=>{Le.task.blockers?.forEach(Ze=>{(Ze.severity==="warning"||Ze.severity==="critical")&&Fe.push({taskId:Le.id,type:Ze.type,severity:Ze.severity,variance:Le.task.scheduleVariance});});});let ze=Fe[0];return ze?jsxRuntime.jsx("div",{className:"mt-0.5 px-0.5",children:jsxRuntime.jsxs("div",{className:c("text-[8px] font-mono px-1.5 py-0.5 rounded flex items-center gap-1",ze.severity==="critical"?"bg-red-500/15 text-red-400 border border-red-500/20":"bg-amber-500/15 text-amber-400 border border-amber-500/20"),children:[jsxRuntime.jsx("span",{children:"\u26A0"}),jsxRuntime.jsxs("span",{className:"truncate",children:[B.labels.risk,": ",ze.type,ze.variance?` (+${Math.abs(ze.variance)}d ${B.labels.delay})`:""]})]})}):null})(),(()=>{let Fe=$.events.filter(st=>!k.multiDayTaskIds.has(st.id)),ze=He[re]||pe,Le=Fe.slice(0,ze),Ze=Fe.length-ze;return jsxRuntime.jsxs("div",{className:"mt-1 space-y-0.5 flex-1",children:[Le.map(st=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{je(st.task),a.onEventClick?.(st);},whileHover:{scale:1.01},className:c("w-full flex items-center gap-1.5 px-1.5 py-1 rounded text-[11px] transition-all text-left",st.task.progress===100||st.task.status==="completed"?X?"text-emerald-400":"bg-emerald-500/10 text-emerald-600":X?"text-white/90":"bg-gray-50 border border-gray-200 text-gray-700 hover:border-[#00E5CC]"),style:X?st.task.progress===100||st.task.status==="completed"?{background:"rgba(16, 185, 129, 0.28)",border:"1px solid rgba(16, 185, 129, 0.50)",boxShadow:"0 0 14px rgba(16, 185, 129, 0.2), inset 0 0 14px rgba(16, 185, 129, 0.1)"}:st.task.isCriticalPath?{background:"rgba(239, 68, 68, 0.35)",border:"1px solid rgba(239, 68, 68, 0.65)",boxShadow:"0 0 18px rgba(239, 68, 68, 0.3), inset 0 0 18px rgba(239, 68, 68, 0.15)"}:{background:"rgba(18, 100, 255, 0.38)",border:"1px solid rgba(18, 100, 255, 0.65)",boxShadow:"0 0 18px rgba(18, 100, 255, 0.28), inset 0 0 18px rgba(18, 100, 255, 0.14)"}:void 0,children:[jsxRuntime.jsx("span",{className:c("flex-shrink-0 text-[9px]",st.task.isMilestone?X?"text-amber-400":"text-amber-600":st.task.isCriticalPath?"text-red-400":X?"text-[#1264FF]":"text-gray-400"),children:st.task.isMilestone?"\u25C6":"\u25CF"}),jsxRuntime.jsx("span",{className:"truncate flex-1",children:st.title})]},st.id)),Ze>0&&jsxRuntime.jsxs("button",{onClick:st=>{st.stopPropagation(),rt(yt=>({...yt,[re]:ze+We}));},className:c("text-[10px] px-1.5 py-0.5 cursor-pointer font-mono font-medium uppercase tracking-wide transition-all rounded",X?"text-white/25 hover:text-white/50 hover:bg-white/5":"text-gray-400 hover:text-gray-600"),children:["+",Ze," ",Y==="es"?"m\xE1s":"more"]}),ze>pe&&Fe.length>pe&&jsxRuntime.jsx("button",{onClick:st=>{st.stopPropagation(),rt(yt=>({...yt,[re]:pe}));},className:c("text-[10px] px-1.5 py-0.5 cursor-pointer font-mono font-medium uppercase tracking-wide transition-all rounded",X?"text-white/25 hover:text-white/50 hover:bg-white/5":"text-gray-400 hover:text-gray-600"),children:Y==="es"?"menos":"less"})]})})(),$.isCurrentMonth&&a.onTaskCreate&&jsxRuntime.jsx("div",{className:"flex items-center justify-end mt-1",children:(()=>{let Fe=re>=28,ze=re%7>=5;return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:Le=>{Le.stopPropagation(),tt(Oe===re?null:re);},className:c("w-5 h-5 rounded flex items-center justify-center transition-all",Oe===re?"opacity-100 bg-[#007FFF] text-white":"opacity-0 group-hover:opacity-100",X?"hover:bg-[#007FFF] text-white/30 hover:text-white":"hover:bg-[#00E5CC] text-gray-400 hover:text-white"),children:jsxRuntime.jsx(lucideReact.Plus,{className:c("w-3.5 h-3.5 transition-transform",Oe===re&&"rotate-45")})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Oe===re&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>tt(null)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:Fe?-5:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:Fe?-5:5,scale:.95},transition:{duration:.12},className:c("absolute w-[320px] rounded-lg shadow-2xl z-50",Fe?"bottom-full mb-1":"top-full mt-1",ze?"right-0":"left-0",X?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08] shadow-[0_8px_32px_rgba(0,0,0,0.6)]":"bg-white border border-gray-200 shadow-xl"),children:jsxRuntime.jsx(ln,{onSubmit:Le=>{a.onTaskCreate?.({name:Le.name,startDate:Le.startDate||$.date,endDate:Le.endDate||$.date,priority:Le.priority,assignees:Le.assignee?[Le.assignee]:void 0}),tt(null);},onCancel:()=>tt(null),availableUsers:t.availableUsers,isDark:X,locale:Y==="es"?"es":"en",defaultDate:$.date,dropdownDirection:Fe?"up":"down"})})]})})]})})()}),re%7===6&&(()=>{let Fe=Math.floor(re/7),ze=ht[Fe];if(!ze||ze===0)return null;let Le=w0(ze,W,oe);return jsxRuntime.jsxs("div",{className:c("absolute bottom-1 right-2 text-[9px] font-mono font-bold tabular-nums z-20",ze<0?"text-red-400":"text-emerald-400",C&&"blur-sm select-none"),children:[B.labels.cashOut,": ",ze<0?"-":"+",Le]})})()]},re)})})})]}),V&&jsxRuntime.jsxs("aside",{className:c("w-[280px] flex-shrink-0 flex flex-col overflow-hidden",X?"bg-[#050505] border-l border-[#222]":"bg-white border-l border-gray-200"),children:[jsxRuntime.jsxs("div",{className:c("flex-shrink-0 h-14 flex items-center justify-between px-4",X?"bg-[#080808] border-b border-[#222]":"bg-gray-50 border-b border-gray-200"),children:[jsxRuntime.jsx("span",{className:c("text-[10px] font-mono font-bold uppercase tracking-[0.2em]",X?"text-white/40":"text-gray-500"),children:B.labels.backlogTitle}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsx("span",{className:c("text-[10px] font-mono tabular-nums",X?"text-white/20":"text-gray-400"),children:Et.length})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:Et.length===0?jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[jsxRuntime.jsx("div",{className:c("w-10 h-10 rounded-xl flex items-center justify-center mb-3",X?"bg-white/5":"bg-gray-100"),children:jsxRuntime.jsx(lucideReact.Calendar,{className:c("w-5 h-5",X?"text-white/20":"text-gray-400")})}),jsxRuntime.jsx("p",{className:c("text-xs font-mono",X?"text-white/20":"text-gray-400"),children:Y==="es"?"Sin tareas pendientes":"No unscheduled tasks"})]}):Et.map($=>jsxRuntime.jsxs("button",{onClick:()=>{je($);},className:c("w-full text-left rounded-md p-3 transition-all group/card",X?"bg-[#0A0A0A] border border-white/[0.05] hover:border-white/[0.12] hover:bg-[#0E0E0E]":"bg-white border border-gray-100 hover:border-gray-200 hover:shadow-sm"),children:[jsxRuntime.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[jsxRuntime.jsx("div",{className:c("w-1 h-1 rounded-full mt-1.5 flex-shrink-0",X?"bg-white/20":"bg-gray-300")}),jsxRuntime.jsx("span",{className:c("text-sm font-medium leading-snug line-clamp-2",X?"text-white/80 group-hover/card:text-white":"text-gray-800"),children:$.name})]}),$.tags&&$.tags.length>0&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-1 ml-3",children:[$.tags.slice(0,3).map(re=>jsxRuntime.jsx("span",{className:"text-[9px] font-mono uppercase tracking-wider px-1.5 py-0.5 rounded",style:{backgroundColor:`${re.color}15`,color:re.color,border:`1px solid ${re.color}30`},children:re.name},re.id)),$.tags.length>3&&jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono px-1 py-0.5",X?"text-white/20":"text-gray-400"),children:["+",$.tags.length-3]})]}),($.effortMinutes||$.soldEffortMinutes)&&jsxRuntime.jsxs("div",{className:c("flex items-center gap-2 mt-1.5 ml-3 text-[9px] font-mono",X?"text-white/25":"text-gray-400",C&&"blur-sm select-none"),children:[Sc($.effortMinutes,W,oe)&&jsxRuntime.jsxs("span",{children:[B.labels.estimate,": ",Sc($.effortMinutes,W,oe)]}),(()=>{let re=C0($,W,oe);return re?jsxRuntime.jsx("span",{className:re.isNegative?"text-red-400":"text-emerald-400",children:re.text}):null})()]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mt-2 ml-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[$.priority&&jsxRuntime.jsx(lucideReact.Flag,{className:c("w-3 h-3",$.priority==="urgent"||$.priority==="high"?"text-red-400":$.priority==="medium"?"text-yellow-400":"text-green-400")}),jsxRuntime.jsx(x0,{task:$,isDark:X})]}),$.assignees&&$.assignees.length>0&&jsxRuntime.jsx("div",{className:"flex -space-x-1",children:$.assignees.slice(0,2).map((re,Ye)=>jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[8px] font-mono font-bold text-white ring-1 ring-[#050505]",style:{backgroundColor:re.color||"#007FFF"},title:re.name,children:re.initials||re.name?.slice(0,2).toUpperCase()},Ye))})]})]},$.id))}),a.onTaskCreate&&jsxRuntime.jsx("div",{className:c("flex-shrink-0 px-3 py-2.5 border-t",X?"border-[#222] bg-[#080808]":"border-gray-200 bg-gray-50"),children:jsxRuntime.jsx("input",{type:"text",placeholder:B.labels.typeToAdd,className:c("w-full text-[11px] font-mono bg-transparent outline-none",X?"text-white/70 placeholder:text-white/15":"text-gray-700 placeholder:text-gray-400"),onKeyDown:$=>{$.key==="Enter"&&$.target.value.trim()&&(a.onTaskCreate?.({name:$.target.value.trim()}),$.target.value="");}})}),ge.hasCostData&&jsxRuntime.jsxs("div",{className:c("flex-shrink-0 px-4 py-3 border-t space-y-2.5",X?"border-[#222] bg-[#080808]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsxs("div",{className:c("text-[10px] font-mono font-bold uppercase tracking-[0.2em]",X?"text-white/40":"text-gray-500"),children:["\u25C8 ",B.labels.systemStatus]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:c("text-[10px] font-mono",X?"text-white/40":"text-gray-500"),children:B.labels.budgetUtil}),jsxRuntime.jsxs("span",{className:c("text-[10px] font-mono font-bold tabular-nums",X?"text-white/60":"text-gray-700",C&&"blur-sm select-none"),children:[ge.budgetUtil,"%"]})]}),jsxRuntime.jsx("div",{className:c("h-1.5 rounded-full overflow-hidden",X?"bg-white/5":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${ge.budgetUtil}%`,background:ge.budgetUtil>90?"#EF4444":ge.budgetUtil>70?"#F59E0B":"linear-gradient(to right, #00E5CC, #8B5CF6)"}})})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[jsxRuntime.jsxs("div",{className:c("rounded-md px-2 py-1.5 text-center",X?"bg-white/[0.03] border border-white/[0.06]":"bg-gray-100 border border-gray-200"),children:[jsxRuntime.jsx("div",{className:c("text-[8px] font-mono uppercase tracking-wider mb-0.5",X?"text-white/25":"text-gray-400"),children:B.labels.variance}),jsxRuntime.jsxs("div",{className:c("text-[11px] font-mono font-bold tabular-nums",ge.avgVariance>0?"text-emerald-400":ge.avgVariance<0?"text-red-400":X?"text-white/50":"text-gray-600"),children:[ge.avgVariance>0?"+":"",ge.avgVariance," ",B.labels.days]})]}),jsxRuntime.jsxs("div",{className:c("rounded-md px-2 py-1.5 text-center",X?"bg-white/[0.03] border border-white/[0.06]":"bg-gray-100 border border-gray-200"),children:[jsxRuntime.jsx("div",{className:c("text-[8px] font-mono uppercase tracking-wider mb-0.5",X?"text-white/25":"text-gray-400"),children:B.labels.cost}),jsxRuntime.jsx("div",{className:c("text-[11px] font-mono font-bold tabular-nums",ge.costDisplay.startsWith("-")?"text-red-400":"text-emerald-400",C&&"blur-sm select-none"),children:ge.costDisplay})]})]})]})]})]}),!_&&jsxRuntime.jsx(To,{task:R,isOpen:!!R,onClose:()=>ae(null),onTaskUpdate:$=>{a.onTaskUpdate?.($),ae($);},theme:L==="dark"?"dark":"light",locale:Y,availableUsers:t.availableUsers?.map($=>({id:$.id,name:$.name,avatar:$.avatar,initials:$.name?.slice(0,2).toUpperCase()||"U",color:"#8B5CF6"}))||[],availableTags:d,onCreateTag:i,attachments:R?u?.get(R.id)||[]:[],onUploadAttachments:a.onUploadAttachments,onDeleteAttachment:a.onDeleteAttachment,availableTasks:zs(e).filter($=>$.id!==R?.id),comments:m?.filter($=>$.taskId===R?.id).map($=>({...$,createdAt:$.createdAt instanceof Date?$.createdAt:new Date($.createdAt),updatedAt:$.updatedAt instanceof Date?$.updatedAt:$.updatedAt?new Date($.updatedAt):void 0})),onAddComment:p,currentUser:g,mentionableUsers:f,onUploadCommentAttachments:x,enableTimeTracking:b,timeTrackingSummary:h,timeEntries:v,isTimerRunning:w?.isRunning,timerElapsedSeconds:w?.elapsedSeconds,onTimeLog:D,onEstimateUpdate:S,onSoldEffortUpdate:M,onTimerStart:T,onTimerStop:F,onTimerDiscard:A,blurFinancials:C}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:De&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>Ee(null),className:"fixed inset-0 bg-black/50 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:c("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[320px] max-h-[400px] rounded-xl shadow-2xl z-50 overflow-hidden",X?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08]":"bg-white border border-gray-200"),children:[jsxRuntime.jsxs("div",{className:c("px-4 py-3 border-b flex items-center justify-between",X?"border-white/[0.08] bg-[#080808]":"border-gray-200"),children:[jsxRuntime.jsx("span",{className:c("font-medium text-sm",X?"text-white/90":"text-gray-900"),children:De.date.toLocaleDateString(Y==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>Ee(null),className:c("p-1 rounded",X?"hover:bg-white/10 text-white/40":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),jsxRuntime.jsx("div",{className:"p-3 max-h-[320px] overflow-y-auto space-y-1.5",children:De.events.map($=>jsxRuntime.jsxs("button",{onClick:()=>{Ee(null),je($.task);},className:c("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",X?"hover:bg-white/5 border border-white/5":"hover:bg-gray-50 border border-gray-100"),children:[jsxRuntime.jsx(x0,{task:$.task,isDark:X}),jsxRuntime.jsx("span",{className:c("text-sm truncate flex-1",X?"text-white/80":"text-gray-900"),children:$.title}),($.task.priority==="high"||$.task.priority==="urgent")&&jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5 text-red-400"})]},$.id))})]})]})})]})}var Ec={bgPrimary:"#050505",bgSecondary:"#080808",bgHover:"rgba(255, 255, 255, 0.02)",bgToday:"rgba(0, 229, 204, 0.08)",bgWeekend:"#050505",bgOtherMonth:"#080808",border:"#222222",borderLight:"#1a1a1a",textPrimary:"rgba(255, 255, 255, 0.90)",textSecondary:"rgba(255, 255, 255, 0.60)",textMuted:"rgba(255, 255, 255, 0.30)",textToday:"#007FFF",accent:"#007FFF",accentHover:"#3399FF",accentLight:"rgba(0, 229, 204, 0.15)",statusTodo:"rgba(255, 255, 255, 0.40)",statusInProgress:"#007FFF",statusCompleted:"#34D399",focusRing:"#007FFF",glass:"rgba(20, 20, 20, 0.6)",glassBorder:"rgba(255, 255, 255, 0.08)",glassHover:"rgba(255, 255, 255, 0.05)",neonRed:"#FF2E2E",glowBlue:"0 0 10px rgba(0, 229, 204, 0.3)",glowRed:"0 0 10px rgba(255, 46, 46, 0.4)"},Mc={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgToday:"#dbeafe",bgWeekend:"#f9fafb",bgOtherMonth:"#f3f4f680",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",textToday:"#0969da",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",glass:"rgba(255, 255, 255, 0.8)",glassBorder:"rgba(0, 0, 0, 0.08)",glassHover:"rgba(0, 0, 0, 0.04)",neonRed:"#DC2626",glowBlue:"0 0 10px rgba(0, 229, 204, 0.15)",glowRed:"0 0 10px rgba(220, 38, 38, 0.2)"},Pc={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgToday:"#6366f120",bgWeekend:"#16213e80",bgOtherMonth:"#1a1a2e50",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",textToday:"#818cf8",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",glass:"rgba(26, 26, 46, 0.6)",glassBorder:"rgba(255, 255, 255, 0.06)",glassHover:"rgba(255, 255, 255, 0.04)",neonRed:"#EF4444",glowBlue:"0 0 10px rgba(99, 102, 241, 0.3)",glowRed:"0 0 10px rgba(239, 68, 68, 0.3)"},ul={dark:Ec,light:Mc,neutral:Pc};function N0(e){return ul[e]||ul.dark}function Lw({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:n,onUnstack:s,onDeleteStack:o,className:l}){let[d,i]=react.useState(false),u=react.useMemo(()=>t.filter(g=>e.cardIds.includes(g.id)),[t,e.cardIds]),m=react.useMemo(()=>{let g=u.length,f=new Set(u.flatMap(b=>b.assignedUserIds||[])).size,x=u.map(b=>b.priority).filter(Boolean),y=new Set(u.flatMap(b=>b.labels||[])).size;return {totalCards:g,uniqueAssignees:f,priorities:x,labels:y}},[u]),p=()=>{n?.(e.id);};return jsxRuntime.jsxs("div",{className:c("card-stack",!e.isExpanded&&"card-stack-collapsed",l),onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:p,children:[jsxRuntime.jsxs("div",{className:"card-stack-header-left",children:[jsxRuntime.jsx("button",{className:"card-stack-toggle","aria-label":e.isExpanded?"Collapse":"Expand",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:c("card-stack-chevron",e.isExpanded&&"expanded"),children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})})}),jsxRuntime.jsx("h3",{className:"card-stack-title",children:e.title}),jsxRuntime.jsx("div",{className:"card-stack-badge",children:m.totalCards}),jsxRuntime.jsxs("div",{className:"card-stack-strategy",children:[e.strategy==="ai-similarity"&&"\u2728 AI",e.strategy==="manual"&&"\u{1F464} Manual",e.strategy==="labels"&&"\u{1F3F7}\uFE0F Labels",e.strategy==="assignee"&&"\u{1F465} Assignee",e.strategy==="priority"&&"\u{1F3AF} Priority",e.strategy==="epic"&&"\u{1F4DA} Epic"]})]}),d&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:g=>{g.stopPropagation(),o?.(e.id);},"aria-label":"Delete stack",children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})})]}),!e.isExpanded&&jsxRuntime.jsxs("div",{className:"card-stack-summary",children:[jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxRuntime.jsxs("span",{children:[m.uniqueAssignees," assignees"]})]}),m.labels>0&&jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsxs("span",{children:[m.labels," labels"]})]}),e.confidence&&jsxRuntime.jsx("div",{className:"card-stack-summary-item",children:jsxRuntime.jsxs("span",{className:"card-stack-confidence",children:[Math.round(e.confidence*100),"% match"]})})]}),e.isExpanded&&jsxRuntime.jsx("div",{className:"card-stack-content",children:u.length===0?jsxRuntime.jsxs("div",{className:"card-stack-empty",children:[jsxRuntime.jsx("p",{children:"No cards in this stack"}),jsxRuntime.jsx("span",{children:"Drag cards here or delete this stack"})]}):jsxRuntime.jsx("div",{className:"card-stack-cards",children:u.map(g=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsxRuntime.jsx("div",{onClick:()=>r?.(g),children:a(g)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(g),children:[jsxRuntime.jsx("h4",{children:g.title}),g.description&&jsxRuntime.jsxs("p",{children:[g.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:f=>{f.stopPropagation(),s?.(e.id,g.id);},"aria-label":"Remove from stack",children:jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},g.id))})})]})}var S0={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function Ws(e){switch(e.type){case "created":return "Created card";case "status_changed":return `Changed status from "${e.changes.status?.from}" to "${e.changes.status?.to}"`;case "assignee_changed":return "Changed assignee";case "priority_changed":return `Changed priority from ${e.changes.priority?.from} to ${e.changes.priority?.to}`;case "moved":return `Moved from ${e.metadata?.fromColumn||"unknown"} to ${e.metadata?.toColumn||"unknown"}`;case "title_updated":return "Updated title";case "description_updated":return "Updated description";case "dates_changed":return "Changed dates";case "labels_changed":return "Updated labels";case "dependency_added":return "Added dependency";case "dependency_removed":return "Removed dependency";case "comment_added":return "Added comment";case "archived":return "Archived card";case "restored":return "Restored card";default:return "Updated card"}}function Vs(e){return {created:"\u2728",status_changed:"\u{1F504}",assignee_changed:"\u{1F464}",priority_changed:"\u{1F3AF}",moved:"\u27A1\uFE0F",title_updated:"\u270F\uFE0F",description_updated:"\u{1F4DD}",dates_changed:"\u{1F4C5}",labels_changed:"\u{1F3F7}\uFE0F",dependency_added:"\u{1F517}",dependency_removed:"\u26D3\uFE0F\u200D\u{1F4A5}",comment_added:"\u{1F4AC}",archived:"\u{1F4E6}",restored:"\u267B\uFE0F"}[e]||"\u{1F4CC}"}function E0(e){return {created:"#10b981",status_changed:"#00E5CC",assignee_changed:"#8b5cf6",priority_changed:"#f59e0b",moved:"#00E5CC",title_updated:"#6366f1",description_updated:"#6366f1",dates_changed:"#ec4899",labels_changed:"#00E5CC",dependency_added:"#a855f7",dependency_removed:"#ef4444",comment_added:"#84cc16",archived:"#6b7280",restored:"#10b981"}[e]||"#6b7280"}function M0({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:n,selectedEventId:s,config:o,className:l}){let d=react.useMemo(()=>({...S0,...o}),[o]),[i,u]=react.useState(new Set),m=react.useRef(null),p=react.useMemo(()=>{if(!d.groupByDay)return [{date:null,events:e}];let h=new Map;return e.forEach(v=>{let w=v.timestamp.toISOString().split("T")[0],D=h.get(w);D?D.push(v):h.set(w,[v]);}),Array.from(h.entries()).sort((v,w)=>w[0].localeCompare(v[0])).map(([v,w])=>({date:new Date(v),events:w.sort((D,S)=>S.timestamp.getTime()-D.timestamp.getTime())}))},[e,d.groupByDay]),{uniqueUsers:g,uniqueTypes:f}=react.useMemo(()=>{let h=new Set,v=new Set;return e.forEach(w=>{h.add(w.userId),v.add(w.type);}),{uniqueUsers:Array.from(h),uniqueTypes:Array.from(v)}},[e]),x=h=>{u(v=>{let w=new Set(v);return w.has(h)?w.delete(h):w.add(h),w});},y=h=>{let w=new Date().getTime()-h.getTime(),D=Math.floor(w/6e4),S=Math.floor(w/36e5),M=Math.floor(w/864e5);return D<1?"just now":D<60?`${D}m ago`:S<24?`${S}h ago`:M<7?`${M}d ago`:h.toLocaleDateString()},b=react.useMemo(()=>{let h=0;return t.types&&t.types.length>0&&h++,t.users&&t.users.length>0&&h++,t.dateRange&&h++,t.searchTerm&&h++,h},[t]);return react.useEffect(()=>{if(s&&m.current){let h=m.current.querySelector(`[data-event-id="${s}"]`);h&&h.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxRuntime.jsxs("div",{className:c("history-timeline-empty",l),children:[jsxRuntime.jsx("div",{className:"history-timeline-empty-icon",children:"\u{1F4DC}"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-text",children:"No history events yet"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-subtext",children:"Changes to this card will appear here"})]}):jsxRuntime.jsxs("div",{className:c("history-timeline",d.compact&&"compact",l),children:[jsxRuntime.jsxs("div",{className:"history-timeline-filters",children:[jsxRuntime.jsxs("div",{className:"history-timeline-filter-group",children:[jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.types?.[0]||"",onChange:h=>{let v=h.target.value;a({...t,types:v?[v]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),f.map(h=>jsxRuntime.jsxs("option",{value:h,children:[Vs(h)," ",h.replace("_"," ")]},h))]}),g.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:h=>{let v=h.target.value;a({...t,users:v?[v]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),g.map(h=>jsxRuntime.jsx("option",{value:h,children:h},h))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:h=>a({...t,searchTerm:h.target.value})})]}),b>0&&jsxRuntime.jsxs("button",{className:"history-timeline-filter-clear",onClick:r,children:["Clear filters (",b,")"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-container",ref:m,children:p.map(h=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[d.groupByDay&&h.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:h.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[h.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:h.events.map((v,w)=>{let D=i.has(v.id),S=s===v.id,M=E0(v.type);return jsxRuntime.jsxs("div",{"data-event-id":v.id,className:c("history-timeline-event",D&&"expanded",S&&"selected"),onClick:()=>n?.(v),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:M},children:d.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:Vs(v.type)})}),w<h.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:M}})]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-content",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header-left",children:[d.showAvatars&&v.userAvatar&&jsxRuntime.jsx("img",{src:v.userAvatar,alt:v.userName||v.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:v.userName||v.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:Ws(v)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:d.useRelativeTime?y(v.timestamp):v.timestamp.toLocaleString()})]}),Object.keys(v.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:T=>{T.stopPropagation(),x(v.id);},children:[D?"\u25BC":"\u25B6"," Show changes"]}),D&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(v.changes).map(([T,F])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[T,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(F.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(F.to)})]})]},T)),v.metadata&&Object.keys(v.metadata).length>0&&jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata",children:[jsxRuntime.jsx("div",{className:"history-timeline-event-metadata-title",children:"Additional Info:"}),Object.entries(v.metadata).map(([T,F])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[T,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(F)})]},T))]})]})]})]},v.id)})})]},h.date?.toISOString()||"all"))})]})}function F0({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:n,onPrevious:s,onNext:o,onGoToEvent:l,onSpeedChange:d,className:i}){let u=[.5,1,1.5,2,3],m=react.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),p=react.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:c("history-replay-empty",i),children:[jsxRuntime.jsx("div",{className:"history-replay-empty-icon",children:"\u23F3"}),jsxRuntime.jsx("p",{className:"history-replay-empty-text",children:"No history to replay"})]}):e?jsxRuntime.jsxs("div",{className:c("history-replay",i),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:m&&Vs(m.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:m&&Ws(m)}),jsxRuntime.jsxs("div",{className:"history-replay-event-meta",children:[jsxRuntime.jsxs("span",{className:"history-replay-event-index",children:["Event ",e.currentIndex+1," of ",e.totalEvents]}),jsxRuntime.jsx("span",{className:"history-replay-event-time",children:m&&m.timestamp.toLocaleString()})]})]})]}),jsxRuntime.jsxs("div",{className:"history-replay-progress-container",children:[jsxRuntime.jsx("input",{type:"range",className:"history-replay-progress-slider",min:"0",max:e.totalEvents-1,value:e.currentIndex,onChange:g=>l(parseInt(g.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${p}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((g,f)=>jsxRuntime.jsx("div",{className:c("history-replay-progress-marker",f===e.currentIndex&&"active"),style:{left:`${f/(e.totalEvents-1)*100}%`},onClick:()=>l(f),title:Ws(g)},g.id))})]}),jsxRuntime.jsxs("div",{className:"history-replay-controls",children:[jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:s,disabled:!e.canGoBack,title:"Previous event (\u2190)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"19 20 9 12 19 4 19 20"}),jsxRuntime.jsx("line",{x1:"5",y1:"19",x2:"5",y2:"5"})]})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-control-play",onClick:n,title:e.isPlaying?"Pause (Space)":"Play (Space)",children:e.isPlaying?jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[jsxRuntime.jsx("rect",{x:"6",y:"4",width:"4",height:"16"}),jsxRuntime.jsx("rect",{x:"14",y:"4",width:"4",height:"16"})]}):jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:o,disabled:!e.canGoForward,title:"Next event (\u2192)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"5 4 15 12 5 20 5 4"}),jsxRuntime.jsx("line",{x1:"19",y1:"5",x2:"19",y2:"19"})]})}),jsxRuntime.jsxs("div",{className:"history-replay-speed",children:[jsxRuntime.jsx("label",{className:"history-replay-speed-label",children:"Speed:"}),jsxRuntime.jsx("div",{className:"history-replay-speed-buttons",children:u.map(g=>jsxRuntime.jsxs("button",{className:c("history-replay-speed-btn",e.speed===g&&"active"),onClick:()=>d(g),children:[g,"x"]},g))})]}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-stop",onClick:r,title:"Stop replay (Esc)",children:jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("rect",{x:"6",y:"6",width:"12",height:"12"})})})]}),jsxRuntime.jsxs("div",{className:"history-replay-shortcuts",children:[jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Space"})," Play/Pause"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2190"})," Previous"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2192"})," Next"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Esc"})," Stop"]})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-header",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-title",children:"Card State at This Point"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-time",children:m&&m.timestamp.toLocaleDateString()})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-content",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Title:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.title})]}),e.cardState.description&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Description:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.description})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Priority:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.priority||"None"})]}),e.cardState.labels&&e.cardState.labels.length>0&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Labels:"}),jsxRuntime.jsx("div",{className:"history-replay-card-preview-labels",children:e.cardState.labels.map(g=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:g},g))})]})]})]})]}):jsxRuntime.jsxs("div",{className:c("history-replay-start",i),children:[jsxRuntime.jsxs("button",{className:"history-replay-start-button",onClick:a,children:[jsxRuntime.jsx("svg",{className:"history-replay-start-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),jsxRuntime.jsx("span",{children:"Start Time Travel"})]}),jsxRuntime.jsxs("p",{className:"history-replay-start-hint",children:["Replay ",t.length," events from this card's history"]})]})}function Fc(e){return {blocks:"#ef4444",blocked_by:"#dc2626",depends_on:"#f59e0b",required_by:"#d97706",relates_to:"#6b7280",duplicates:"#8b5cf6",parent_of:"#00E5CC",child_of:"#00C4AE",similar_to:"#10b981"}[e]||"#6b7280"}function Ac(e){return {blocks:"Blocks",blocked_by:"Blocked by",depends_on:"Depends on",required_by:"Required by",relates_to:"Relates to",duplicates:"Duplicates",parent_of:"Parent of",child_of:"Child of",similar_to:"Similar to"}[e]||e}function A0(e){return {blocks:"\u{1F6AB}",blocked_by:"\u26D4",depends_on:"\u{1F517}",required_by:"\u{1F4CC}",relates_to:"\u{1F504}",duplicates:"\u{1F4CB}",parent_of:"\u{1F4C2}",child_of:"\u{1F4C4}",similar_to:"\u{1F50D}"}[e]||"\u{1F517}"}function L0(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function Hw(e,t,a,r,n,s=100){let o=e.map(d=>({...d,x:d.x??a/2+Math.random()*100-50,y:d.y??r/2+Math.random()*100-50,vx:0,vy:0})),l=new Map(o.map(d=>[d.id,d]));for(let d=0;d<s;d++){let i=1-d/s;o.forEach(u=>{let m=a/2,p=r/2;u.vx+=(m-u.x)*n.centerForce*i,u.vy+=(p-u.y)*n.centerForce*i,o.forEach(g=>{if(u.id===g.id)return;let f=u.x-g.x,x=u.y-g.y,y=Math.sqrt(f*f+x*x)||1,b=n.chargeStrength*i/(y*y);u.vx+=f/y*b,u.vy+=x/y*b;});}),t.forEach(u=>{let m=l.get(typeof u.source=="string"?u.source:u.source.id),p=l.get(typeof u.target=="string"?u.target:u.target.id);if(!m||!p)return;let g=p.x-m.x,f=p.y-m.y,x=Math.sqrt(g*g+f*f)||1,y=(x-n.linkDistance)/x*n.forceStrength*i;m.vx+=g*y,m.vy+=f*y,p.vx-=g*y,p.vy-=f*y;}),o.forEach(u=>{u.fx!==null&&u.fx!==void 0?(u.x=u.fx,u.vx=0):u.x+=u.vx,u.fy!==null&&u.fy!==void 0?(u.y=u.fy,u.vy=0):u.y+=u.vy,u.x=Math.max(n.nodeSize,Math.min(a-n.nodeSize,u.x)),u.y=Math.max(n.nodeSize,Math.min(r-n.nodeSize,u.y)),u.vx*=.9,u.vy*=.9;});}return o}function I0({nodes:e,edges:t,config:a,filter:r,onFilterChange:n,criticalPath:s,stats:o,onInteraction:l,className:d}){let i=react.useRef(null),[u,m]=react.useState([]),[p,g]=react.useState(null),[f,x]=react.useState(null),[y,b]=react.useState(null),[h,v]=react.useState(1),[w,D]=react.useState({x:0,y:0});react.useEffect(()=>{if(e.length===0)return;let W=Hw(e,t,a.width,a.height,a,150);m(W);},[e,t,a]);let S=react.useCallback((W,oe)=>{a.enableDragging&&(oe.stopPropagation(),g(W));},[a.enableDragging]),M=react.useCallback(W=>{if(!p||!i.current)return;let L=i.current.getBoundingClientRect(),Y=(W.clientX-L.left-w.x)/h,K=(W.clientY-L.top-w.y)/h;m(V=>V.map(B=>B.id===p?{...B,x:Y,y:K,fx:Y,fy:K}:B));},[p,h,w]),T=react.useCallback(()=>{g(null);},[]),F=react.useCallback((W,oe)=>{oe.stopPropagation(),l?.({type:"node-click",node:W,position:{x:oe.clientX,y:oe.clientY}});},[l]),A=react.useCallback((W,oe)=>{oe.stopPropagation(),l?.({type:"edge-click",edge:W,position:{x:oe.clientX,y:oe.clientY}});},[l]),C=react.useCallback(W=>{let oe=u.find(L=>L.id===W);return oe?{x:oe.x,y:oe.y}:{x:0,y:0}},[u]),_=react.useCallback(W=>{if(W.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return W.card.columnId==="done"?"#10b981":"#00E5CC";case "priority":let oe=W.card.priority;return oe==="URGENT"?"#ef4444":oe==="HIGH"?"#f59e0b":oe==="MEDIUM"?"#00E5CC":"#6b7280";case "assignee":return W.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#00E5CC"}},[a.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:c("relationships-graph-empty",d),children:[jsxRuntime.jsx("div",{className:"relationships-graph-empty-icon",children:"\u{1F517}"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-text",children:"No relationships to display"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-subtext",children:"Add relationships between cards to see the graph"})]}):jsxRuntime.jsxs("div",{className:c("relationships-graph",d),children:[jsxRuntime.jsxs("div",{className:"relationships-graph-controls",children:[jsxRuntime.jsxs("div",{className:"relationships-graph-stats",children:[jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:o.totalNodes}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Cards"})]}),jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:o.totalEdges}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Relations"})]}),s&&jsxRuntime.jsxs("span",{className:"relationships-graph-stat relationships-graph-stat-critical",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:s.cardIds.length}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Critical Path"})]})]}),a.enableZoom&&jsxRuntime.jsxs("div",{className:"relationships-graph-zoom-controls",children:[jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>v(W=>Math.min(W+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(h*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>v(W=>Math.max(W-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{v(1),D({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(W=>W.type))).map(W=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:Fc(W)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[A0(W)," ",Ac(W)]})]},W))}),jsxRuntime.jsxs("svg",{ref:i,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:M,onMouseUp:T,onMouseLeave:T,children:[jsxRuntime.jsxs("g",{transform:`translate(${w.x}, ${w.y}) scale(${h})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map(W=>{let oe=C(typeof W.source=="string"?W.source:W.source.id),L=C(typeof W.target=="string"?W.target:W.target.id),Y=L0(W.type),K=y===W.id,V=W.onCriticalPath;return jsxRuntime.jsxs("g",{className:c("relationships-graph-edge",K&&"hovered",V&&"critical"),onMouseEnter:()=>b(W.id),onMouseLeave:()=>b(null),onClick:B=>A(W,B),children:[jsxRuntime.jsx("line",{x1:oe.x,y1:oe.y,x2:L.x,y2:L.y,stroke:Fc(W.type),strokeWidth:V?a.edgeWidth*2:a.edgeWidth,strokeOpacity:K?1:.6,markerEnd:Y?"url(#arrowhead)":void 0}),a.showEdgeLabels&&K&&jsxRuntime.jsx("text",{x:(oe.x+L.x)/2,y:(oe.y+L.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:Ac(W.type)})]},W.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:u.map(W=>{let oe=f===W.id,L=W.onCriticalPath;return jsxRuntime.jsxs("g",{className:c("relationships-graph-node",oe&&"hovered",L&&"critical"),transform:`translate(${W.x}, ${W.y})`,onMouseDown:Y=>S(W.id,Y),onMouseEnter:()=>x(W.id),onMouseLeave:()=>x(null),onClick:Y=>F(W,Y),children:[jsxRuntime.jsx("circle",{r:L?a.nodeSize*1.2:a.nodeSize,fill:_(W),stroke:L?"#fbbf24":"#ffffff",strokeWidth:L?3:2,opacity:oe?1:.9}),a.showLabels&&jsxRuntime.jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:W.card.title.length>20?W.card.title.substring(0,20)+"...":W.card.title})]},W.id)})})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:jsxRuntime.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#6b7280"})})})]})]})}function O0({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:n}){let[s,o]=react.useState(""),[l,d]=react.useState(false),[i,u]=react.useState(null),[m,p]=react.useState(null),g=react.useRef(null),f=l||n;react.useEffect(()=>{e&&g.current&&g.current.focus();},[e]),react.useEffect(()=>{let h=v=>{v.key==="Escape"&&!f&&x();};if(e)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,f]);let x=()=>{f||(o(""),u(null),p(null),t());},y=async()=>{if(!(!s.trim()||f)){d(true),u(null),p(null);try{let h=await r(s.trim());p(h);}catch(h){u(h instanceof Error?h.message:"Failed to generate plan");}finally{d(false);}}},b=()=>{m&&(a(m),x());};return e?jsxRuntime.jsxs(Qt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:x}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-2xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:h=>h.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-[#00E5CC]",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Generate Project Plan with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete Kanban board"})]}),jsxRuntime.jsx("button",{onClick:x,disabled:f,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:m?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Plan Generated Successfully!"})]}),m.explanation&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-[#00E5CC]/10 border border-[#00E5CC]/30",children:jsxRuntime.jsx("p",{className:"text-sm text-white/90",children:m.explanation})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",m.columns.length,")"]}),jsxRuntime.jsx("div",{className:"flex gap-2 flex-wrap",children:m.columns.map((h,v)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:h.title},v))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",m.cards.length,")"]}),jsxRuntime.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[m.cards.slice(0,10).map((h,v)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:h.title}),h.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:h.description})]}),h.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${h.priority==="URGENT"?"bg-red-500/20 text-red-400":h.priority==="HIGH"?"bg-orange-500/20 text-orange-400":h.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-[#00E5CC]/20 text-[#00E5CC]"}`,children:h.priority})]})},v)),m.cards.length>10&&jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",m.cards.length-10," more tasks..."]})]})]})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description"}),jsxRuntime.jsx("textarea",{ref:g,value:s,onChange:h=>o(h.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-[#00E5CC]/50 transition-all resize-none",disabled:f}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),i&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:i}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((h,v)=>jsxRuntime.jsx("button",{onClick:()=>o(h),disabled:f,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:h},v))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:f&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[#00E5CC] text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:x,disabled:f,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),m?jsxRuntime.jsx("button",{onClick:b,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Plan to Board"}):jsxRuntime.jsx("button",{onClick:y,disabled:!s.trim()||f,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #00E5CC 0%, #00E5CC 100%)",color:"#ffffff"},children:f?"Generating...":"Generate Plan"})]})]})]})})]}):null}var Lc={"gpt-4-turbo":{provider:"openai",name:"GPT-4 Turbo",contextWindow:128e3,costPer1kInput:.01,costPer1kOutput:.03,supportsVision:true,supportsJSON:true},"gpt-4":{provider:"openai",name:"GPT-4",contextWindow:8192,costPer1kInput:.03,costPer1kOutput:.06,supportsVision:false,supportsJSON:true},"gpt-3.5-turbo":{provider:"openai",name:"GPT-3.5 Turbo",contextWindow:16385,costPer1kInput:5e-4,costPer1kOutput:.0015,supportsVision:false,supportsJSON:true},"claude-3-5-sonnet-20241022":{provider:"anthropic",name:"Claude 3.5 Sonnet",contextWindow:2e5,costPer1kInput:.003,costPer1kOutput:.015,supportsVision:true,supportsJSON:true},"claude-3-opus-20240229":{provider:"anthropic",name:"Claude 3 Opus",contextWindow:2e5,costPer1kInput:.015,costPer1kOutput:.075,supportsVision:true,supportsJSON:true},"claude-3-haiku-20240307":{provider:"anthropic",name:"Claude 3 Haiku",contextWindow:2e5,costPer1kInput:25e-5,costPer1kOutput:.00125,supportsVision:true,supportsJSON:true}};var Uw={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},Ww={generatePlan:{enabled:true,minPlanTier:"hobby",estimatedTokens:2e3},predictRisks:{enabled:true,minPlanTier:"pro",estimatedTokens:1500},suggestAssignee:{enabled:true,minPlanTier:"hobby",estimatedTokens:800},generateReport:{enabled:true,minPlanTier:"enterprise",estimatedTokens:3e3},generateSubtasks:{enabled:true,minPlanTier:"hobby",estimatedTokens:1e3}};function Vw(e,t,a){let r=Lc[e];if(!r)throw new Error(`Unknown model: ${e}`);let n=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return n+s}function Gs(e){return `$${e.toFixed(4)}`}var Ic=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=Vw(t.model,t.inputTokens,t.outputTokens),r={...t,id:`op_${Date.now()}_${Math.random().toString(36).substring(7)}`,timestamp:new Date,cost:a};return this.operations.push(r),this.listeners.forEach(n=>n(r)),this.operations.length>1e3&&(this.operations=this.operations.slice(-1e3)),r}getStats(t){let a=this.operations;t&&(a=a.filter(m=>m.timestamp>=t.start&&m.timestamp<=t.end));let r=a.length,n=a.reduce((m,p)=>m+p.cost,0),s=a.reduce((m,p)=>m+p.inputTokens,0),o=a.reduce((m,p)=>m+p.outputTokens,0),l=a.filter(m=>m.success),d=a.reduce((m,p)=>m+p.duration,0),i={},u={};return a.forEach(m=>{i[m.feature]=(i[m.feature]||0)+1,u[m.feature]=(u[m.feature]||0)+m.cost;}),{totalOperations:r,totalCost:n,totalInputTokens:s,totalOutputTokens:o,operationsByFeature:i,costsByFeature:u,averageDuration:r>0?d/r:0,successRate:r>0?l.length/r:0}}getRecentOperations(t=10){return this.operations.slice(-t).reverse()}checkLimit(t,a="month"){let n={hobby:{month:50,day:5},pro:{month:500,day:50},enterprise:{month:2e3,day:200}}[t][a],s=new Date,o=new Date;a==="month"?o.setMonth(s.getMonth()-1):o.setDate(s.getDate()-1);let l=this.operations.filter(u=>u.timestamp>=o).length,d=Math.max(0,n-l),i=l/n*100;return {used:l,limit:n,remaining:d,percentUsed:i,isExceeded:l>=n}}subscribe(t){return this.listeners.push(t),()=>{let a=this.listeners.indexOf(t);a>-1&&this.listeners.splice(a,1);}}clear(){this.operations=[];}export(){return JSON.stringify(this.operations,null,2)}},xn=new Ic;function z0({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,n]=react.useState(xn.getStats()),[s,o]=react.useState(xn.checkLimit(a));if(react.useEffect(()=>{if(!e)return;let d=setInterval(()=>{n(xn.getStats()),o(xn.checkLimit(a));},1e3);return ()=>clearInterval(d)},[e,a]),react.useEffect(()=>{let d=i=>{i.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e,t]),!e)return null;let l=xn.getRecentOperations(5);return jsxRuntime.jsxs(Qt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:t}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:d=>d.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-white",children:"AI Usage Dashboard"}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Monitor your AI consumption and costs"})]}),jsxRuntime.jsx("button",{onClick:t,className:"text-white/60 hover:text-white transition-colors",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-xl bg-gradient-to-r from-[#00E5CC]/10 to-purple-500/10 border border-[#00E5CC]/30",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-white/90",children:["Monthly Usage (",a.toUpperCase(),")"]}),jsxRuntime.jsxs("span",{className:"text-sm font-bold text-white",children:[s.used," / ",s.limit]})]}),jsxRuntime.jsx("div",{className:"w-full h-2 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full transition-all",style:{width:`${Math.min(100,s.percentUsed)}%`,background:s.percentUsed>90?"#EF4444":s.percentUsed>70?"#F59E0B":"#10B981"}})}),jsxRuntime.jsxs("p",{className:"text-xs text-white/60 mt-2",children:[s.remaining," operations remaining this month"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Total Cost"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-green-400 mt-1",children:Gs(r.totalCost)})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Operations"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-[#00E5CC] mt-1",children:r.totalOperations})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Tokens Used"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-400 mt-1",children:(r.totalInputTokens+r.totalOutputTokens).toLocaleString()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:[r.totalInputTokens.toLocaleString()," in /"," ",r.totalOutputTokens.toLocaleString()," out"]})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Success Rate"}),jsxRuntime.jsxs("p",{className:"text-2xl font-bold text-green-400 mt-1",children:[(r.successRate*100).toFixed(1),"%"]}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:["Avg: ",r.averageDuration.toFixed(0),"ms"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Usage by Feature"}),jsxRuntime.jsx("div",{className:"space-y-2",children:Object.entries(r.operationsByFeature).map(([d,i])=>{let u=r.costsByFeature[d]||0,m=r.totalOperations>0?i/r.totalOperations*100:0;return jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90 capitalize",children:d.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[i," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Gs(u)})]})]}),jsxRuntime.jsx("div",{className:"w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full bg-[#00E5CC]",style:{width:`${m}%`}})})]},d)})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),l.length===0?jsxRuntime.jsx("p",{className:"text-sm text-white/50 text-center py-8",children:"No operations yet. Start using AI features!"}):jsxRuntime.jsx("div",{className:"space-y-2",children:l.map(d=>jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90 capitalize",children:d.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(d.timestamp).toLocaleTimeString()," \u2022"," ",d.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[d.inputTokens+d.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Gs(d.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${d.success?"bg-green-400":"bg-red-400"}`})]})]},d.id))})]})]}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("p",{className:"text-xs text-white/50",children:"Costs are estimates. Actual API charges may vary."}),jsxRuntime.jsx("button",{onClick:t,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80",children:"Close"})]})]})})]})}function V0({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:n,projectName:s}){let[o,l]=react.useState(""),[d,i]=react.useState(""),[u,m]=react.useState(""),[p,g]=react.useState(false),[f,x]=react.useState(null),[y,b]=react.useState(null),[h,v]=react.useState(null),w=react.useRef(null),D=p||n;react.useEffect(()=>{e&&w.current&&w.current.focus();},[e]),react.useEffect(()=>{let A=C=>{C.key==="Escape"&&!D&&S();};if(e)return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[e,D]);let S=()=>{D||(l(""),i(""),m(""),x(null),b(null),v(null),t());},M=async()=>{if(!(!o.trim()||D)){g(true),x(null),b(null),v(null);try{let A=await r({prompt:o.trim(),projectName:s||"Mi Proyecto",startDate:d||void 0,endDate:u||void 0});b(A.tasks.tasks),v({from_cache:A.from_cache,tokens_used:A.tokens_used,mock_mode:A.mock_mode,similarity:A.similarity,tokens_saved:A.tokens_saved});}catch(A){x(A instanceof Error?A.message:"Failed to generate tasks");}finally{g(false);}}},T=()=>{y&&(a(y),S());};if(!e)return null;let F=h?.similarity?((h.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(Qt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:S}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:A=>A.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-[#00E5CC]",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"9",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"14",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"19",width:"18",height:"2",rx:"1",fill:"currentColor"})]}),"Generate Gantt Tasks with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete task timeline"})]}),jsxRuntime.jsx("button",{onClick:S,disabled:D,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:y?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Tasks Generated Successfully!"})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[h?.mock_mode&&jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",children:"Mock Mode"}),h?.from_cache?jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-[#00E5CC]/20 text-[#00E5CC] border border-[#00E5CC]/30",children:["From Cache (",F,"% similar)"]}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-green-500/20 text-green-400 border border-green-500/30",children:"AI Generated"}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-purple-500/20 text-purple-400 border border-purple-500/30",children:[h?.tokens_used||0," tokens"]}),h?.tokens_saved&&jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:[h.tokens_saved," tokens saved"]}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-pink-500/20 text-pink-400 border border-pink-500/30",children:[y.length," tasks"]})]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:y.map((A,C)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 hover:bg-white/10 transition-colors",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/50",children:["#",C+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:A.name})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-xs text-white/60",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-white/40",children:[jsxRuntime.jsx("rect",{x:"1",y:"2",width:"10",height:"8",rx:"1",stroke:"currentColor"}),jsxRuntime.jsx("path",{d:"M1 4h10",stroke:"currentColor"})]}),A.start," \u2192 ",A.end]}),jsxRuntime.jsxs("span",{children:[A.duration," days"]}),A.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-[#00E5CC]",children:["Depends: ",A.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${A.priority==="high"?"bg-red-500/20 text-red-400":A.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-[#00E5CC]/20 text-[#00E5CC]"}`,children:A.priority})]})},A.id))})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description *"}),jsxRuntime.jsx("textarea",{ref:w,value:o,onChange:A=>l(A.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-[#00E5CC]/50 transition-all resize-none",disabled:D}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Start Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:d,onChange:A=>i(A.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-[#00E5CC]/50 transition-all",disabled:D})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"End Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:u,onChange:A=>m(A.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-[#00E5CC]/50 transition-all",disabled:D})]})]}),f&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:f}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((A,C)=>jsxRuntime.jsx("button",{onClick:()=>l(A),disabled:D,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:A},C))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:D&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[#00E5CC] text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:S,disabled:D,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),y?jsxRuntime.jsx("button",{onClick:T,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Tasks to Gantt"}):jsxRuntime.jsx("button",{onClick:M,disabled:!o.trim()||D,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #00E5CC 0%, #00E5CC 100%)",color:"#ffffff"},children:D?"Generating...":"Generate Tasks"})]})]})]})})]})}function gl({initialBoard:e,onPersist:t}){let[a,r]=react.useState(e),n=react.useCallback(y=>{t&&ti(()=>Promise.resolve(t(y)),{maxAttempts:3,initialDelay:1e3,onRetry:(b,h,v)=>{console.warn(`Retry attempt ${h} after ${v}ms: ${b.message}`);}}).then(b=>{b.success||console.error(`Failed to persist board after ${b.attempts} attempts:`,b.error);});},[t]),s=react.useCallback(async(y,b,h)=>{r(v=>{let w=v.cards.find(A=>A.id===y);if(!w)return v;let D=w.columnId,S={...w,columnId:b,position:h},M=v.cards.map(A=>A.id===y?S:A),T=v.columns.map(A=>{if(A.id===D)return {...A,cardIds:A.cardIds.filter(C=>C!==y)};if(A.id===b){let C=M.filter(_=>_.columnId===b).sort((_,W)=>_.position-W.position);return {...A,cardIds:C.map(_=>_.id)}}return A}),F={...v,cards:M,columns:T};return n(F),F});},[n]),o=react.useCallback(async(y,b)=>{r(h=>{let v=h.cards.map(D=>D.id===y?{...D,...b}:D),w={...h,cards:v};return n(w),w});},[n]),l=react.useCallback(async y=>{let b=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(h=>{let v={...y,id:b},w=h.columns.map(S=>S.id===y.columnId?{...S,cardIds:[...S.cardIds,b]}:S),D={...h,cards:[...h.cards,v],columns:w};return n(D),D});},[n]),d=react.useCallback(async y=>{r(b=>{let h=b.cards.find(S=>S.id===y);if(!h)return b;let v=b.cards.filter(S=>S.id!==y),w=b.columns.map(S=>S.id===h.columnId?{...S,cardIds:S.cardIds.filter(M=>M!==y)}:S),D={...b,cards:v,columns:w};return n(D),D});},[n]),i=react.useCallback(async y=>{let b=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(h=>{let v={...y,id:b,cardIds:[]},w={...h,columns:[...h.columns,v]};return n(w),w});},[n]),u=react.useCallback(async(y,b)=>{r(h=>{let v=h.columns.map(D=>D.id===y?{...D,...b}:D),w={...h,columns:v};return n(w),w});},[n]),m=react.useCallback(async y=>{r(b=>{let h=b.cards.filter(D=>D.columnId!==y),v=b.columns.filter(D=>D.id!==y),w={...b,cards:h,columns:v};return n(w),w});},[n]),p=react.useCallback(y=>{let b=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return l(y),b},[l]),g=react.useCallback(y=>{let b=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return i(y),b},[i]),f=react.useCallback(()=>{r(y=>{let b={...y,cards:[],columns:[]};return n(b),b});},[n]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:o,onCardCreate:l,onCardDelete:d,onColumnCreate:i,onColumnUpdate:u,onColumnDelete:m},setBoard:r,helpers:{addCard:p,addColumn:g,deleteCard:d,deleteColumn:m,clearBoard:f}}}function j0({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:n,helpers:s}=gl({initialBoard:e,onPersist:a}),o=react.useMemo(()=>({addCard:(d,i,u={})=>{s.addCard({title:i,columnId:d,position:r.cards.filter(m=>m.columnId===d).length,...u});},addColumn:(d,i)=>{let u=r.columns.length>0?Math.max(...r.columns.map(m=>m.position)):0;s.addColumn({title:d,position:i??u+1e3});},reset:s.clearBoard}),[r.cards,r.columns,s]);return {props:react.useMemo(()=>({board:r,callbacks:n,availableUsers:t}),[r,n,t]),board:r,callbacks:n,utils:o}}var js={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},K0={by:"none",order:"asc"};function q0({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,n]=react.useState({...js,...e}),[s,o]=react.useState({...K0,...t}),l=react.useCallback(x=>{n(y=>({...y,...x}));},[]),d=react.useCallback(x=>{o(y=>({...y,...x}));},[]),i=react.useCallback(()=>{n(js),o(K0);},[]),u=react.useCallback(()=>{a&&n({...js,assignees:[a]});},[a]),m=react.useCallback(()=>{n({...js,dateFilter:"overdue"});},[]),p=react.useCallback(()=>{n({...js,priorities:["HIGH","URGENT"]});},[]),g=react.useMemo(()=>r.dateFilter!=="all"||r.priorities.length>0||r.assignees.length>0||r.labels.length>0||r.columns.length>0||r.search!==""||s.by!=="none",[r,s]),f=react.useCallback(x=>{let y=[...x];if(r.search){let b=r.search.toLowerCase();y=y.filter(h=>h.title.toLowerCase().includes(b)||h.description?.toLowerCase().includes(b));}if(r.dateFilter!=="all"){let b=new Date,h=b.getFullYear(),v=String(b.getMonth()+1).padStart(2,"0"),w=String(b.getDate()).padStart(2,"0"),D=`${h}-${v}-${w}`;y=y.filter(S=>{if(!S.endDate&&!S.dueDate)return false;let M=S.endDate||S.dueDate;if(!M)return false;let T;if(typeof M=="string")T=M.split("T")[0]||M;else {let F=M.getUTCFullYear(),A=String(M.getUTCMonth()+1).padStart(2,"0"),C=String(M.getUTCDate()).padStart(2,"0");T=`${F}-${A}-${C}`;}switch(r.dateFilter){case "overdue":return T<D;case "today":return T===D;case "this-week":let F=new Date(D+"T00:00:00"),A=new Date(T+"T00:00:00"),C=new Date(F);return C.setDate(C.getDate()+7),A>=F&&A<=C;case "custom":if(r.dateRange){let _=typeof M=="string"?new Date(M):M;return _>=r.dateRange.start&&_<=r.dateRange.end}return true;default:return true}});}return r.priorities.length>0&&(y=y.filter(b=>b.priority&&r.priorities.includes(b.priority))),r.assignees.length>0&&(y=y.filter(b=>(b.assignedUserIds||(b.assigneeId?[b.assigneeId]:[])).some(v=>r.assignees.includes(v)))),r.labels.length>0&&(y=y.filter(b=>b.labels&&b.labels.some(h=>r.labels.includes(h)))),r.columns.length>0&&(y=y.filter(b=>r.columns.includes(b.columnId))),s.by!=="none"&&y.sort((b,h)=>{let v=0;switch(s.by){case "created":let w=b.createdAt?new Date(b.createdAt).getTime():0,D=h.createdAt?new Date(h.createdAt).getTime():0;v=w-D;break;case "priority":let S={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},M=S[b.priority||"LOW"],T=S[h.priority||"LOW"];v=M-T;break;case "dueDate":let F=b.endDate||b.dueDate,A=h.endDate||h.dueDate;if(!F)return 1;if(!A)return -1;let C=typeof F=="string"?new Date(F).getTime():F.getTime(),_=typeof A=="string"?new Date(A).getTime():A.getTime();v=C-_;break;case "title":v=b.title.localeCompare(h.title);break;case "estimate":let W=b.estimatedTime||0,oe=h.estimatedTime||0;v=W-oe;break;default:v=0;}return s.order==="asc"?v:-v}),y},[r,s]);return {filters:r,sort:s,setFilters:l,setSort:d,resetFilters:i,filterMyTasks:u,filterOverdue:m,filterHighPriority:p,applyFilters:f,hasActiveFilters:g}}var X0,J0;if(typeof window<"u")try{let e=Qs("ai");X0=e.generateObject,J0=e.generateText;}catch{}function Q0(e={}){let[t,a]=react.useState(false),[r,n]=react.useState(null),s=!!(X0&&J0&&e.apiKey),o=react.useCallback(async m=>{if(!s)throw new Error('AI features require the "ai" package and an API key. Install with: npm install ai');a(true),n(null);try{return console.log("Generating plan for:",m),{columns:[{title:"To Do",position:1e3,cardIds:[]},{title:"In Progress",position:2e3,cardIds:[]},{title:"Done",position:3e3,cardIds:[]}],cards:[{title:"Generated task from AI",description:`Based on: ${m}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(p){let g=p instanceof Error?p:new Error("Failed to generate plan");throw n(g),g}finally{a(false);}},[s]),l=react.useCallback(async m=>{if(!s)throw new Error("AI features not available");a(true),n(null);try{return console.log("Suggesting assignee for:",m.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(p){let g=p instanceof Error?p:new Error("Failed to suggest assignee");throw n(g),g}finally{a(false);}},[s]),d=react.useCallback(async m=>{if(!s)throw new Error("AI features not available");a(true),n(null);try{return console.log("Analyzing board for risks..."),[{type:"RISK_OVERLOAD",severity:"HIGH",title:"Column overload detected",description:'Too many cards in "In Progress"',confidence:.9,suggestedAction:'Consider moving some cards back to "To Do"'}]}catch(p){let g=p instanceof Error?p:new Error("Failed to predict risks");throw n(g),g}finally{a(false);}},[s]),i=react.useCallback(async m=>{if(!s)throw new Error("AI features not available");a(true),n(null);try{return console.log("Generating subtasks for:",m.title),[{title:`Subtask 1 for: ${m.title}`,position:m.position+.1,columnId:m.columnId},{title:`Subtask 2 for: ${m.title}`,position:m.position+.2,columnId:m.columnId}]}catch(p){let g=p instanceof Error?p:new Error("Failed to generate subtasks");throw n(g),g}finally{a(false);}},[s]),u=react.useCallback(async m=>{if(!s)throw new Error("AI features not available");a(true),n(null);try{return console.log("Estimating effort for:",m.title),{hours:8,confidence:.75}}catch(p){let g=p instanceof Error?p:new Error("Failed to estimate effort");throw n(g),g}finally{a(false);}},[s]);return {onGeneratePlan:o,onSuggestAssignee:l,onPredictRisks:d,onGenerateSubtasks:i,onEstimateEffort:u,isAvailable:s,isLoading:t,error:r}}function Rc(){let[e,t]=react.useState(()=>core.selectionStore.getState());react.useEffect(()=>core.selectionStore.subscribe(n=>{t(n);}),[]);let a=react.useCallback(r=>{core.selectionStore.setState(r);},[]);return [e,a]}function Z0(e){let{cards:t}=e,[a,r]=Rc(),n=react.useCallback(m=>a.selectedCardIds.includes(m),[a.selectedCardIds]),s=react.useCallback((m,p)=>{if(!p){r({selectedCardIds:[m],lastSelectedCardId:m});return}let g=p.ctrlKey||p.metaKey,f=p.shiftKey;if(g)a.selectedCardIds.includes(m)?r({selectedCardIds:a.selectedCardIds.filter(x=>x!==m),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,m],lastSelectedCardId:m});else if(f&&a.lastSelectedCardId){let x=t.find(b=>b.id===m),y=t.find(b=>b.id===a.lastSelectedCardId);if(x&&y&&x.columnId===y.columnId){let b=t.filter(T=>T.columnId===x.columnId).sort((T,F)=>T.position-F.position),h=b.findIndex(T=>T.id===a.lastSelectedCardId),v=b.findIndex(T=>T.id===m),[w,D]=h<v?[h,v]:[v,h],S=b.slice(w,D+1).map(T=>T.id),M=Array.from(new Set([...a.selectedCardIds,...S]));r({selectedCardIds:M,lastSelectedCardId:m});}else r({selectedCardIds:[m],lastSelectedCardId:m});}else r({selectedCardIds:[m],lastSelectedCardId:m});},[t,a,r]),o=react.useCallback(m=>{r({selectedCardIds:a.selectedCardIds.filter(p=>p!==m),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),l=react.useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),d=react.useCallback(()=>{r({selectedCardIds:t.map(m=>m.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),i=react.useCallback(m=>{a.selectedCardIds.includes(m)?o(m):r({selectedCardIds:[...a.selectedCardIds,m],lastSelectedCardId:m});},[a,o,r]),u=react.useCallback(()=>t.filter(m=>a.selectedCardIds.includes(m.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:n,selectCard:s,deselectCard:o,clearSelection:l,selectAll:d,toggleCard:i,getSelectedCards:u}}var ef={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function tf(e){let{cards:t,config:a,aiService:r}=e,n=react.useMemo(()=>({...ef,...a}),[a]),[s,o]=react.useState([]),l=react.useCallback((x,y,b,h,v)=>{if(y.length<n.minCardsPerStack){console.warn(`Cannot create stack: minimum ${n.minCardsPerStack} cards required`);return}let w={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:x,cardIds:y,columnId:b,strategy:h,color:v,isExpanded:true,position:s.filter(D=>D.columnId===b).length,createdAt:new Date};o(D=>[...D,w]);},[n.minCardsPerStack,s]),d=react.useCallback(x=>{o(y=>y.filter(b=>b.id!==x));},[]),i=react.useCallback(x=>{o(y=>y.map(b=>b.id===x?{...b,isExpanded:!b.isExpanded}:b));},[]),u=react.useCallback((x,y)=>{o(b=>b.map(h=>h.id===x&&!h.cardIds.includes(y)?{...h,cardIds:[...h.cardIds,y]}:h));},[]),m=react.useCallback((x,y)=>{o(b=>b.map(h=>{if(h.id===x){let v=h.cardIds.filter(w=>w!==y);return v.length<n.minCardsPerStack?null:{...h,cardIds:v}}return h}).filter(h=>h!==null));},[n.minCardsPerStack]),p=react.useCallback(x=>s.filter(y=>y.columnId===x).sort((y,b)=>y.position-b.position),[s]),g=react.useCallback(async x=>{let y=t.filter(D=>D.columnId===x);if(y.length<n.minCardsPerStack*2)return [];let b=[],h=new Map;y.forEach(D=>{D.labels&&D.labels.length>0&&D.labels.forEach(S=>{h.has(S)||h.set(S,[]),h.get(S).push(D);});}),h.forEach((D,S)=>{D.length>=n.minCardsPerStack&&b.push({stack:{title:`\u{1F4CC} ${S}`,cardIds:D.map(M=>M.id),columnId:x,strategy:"labels",color:"#00E5CC"},reason:`${D.length} cards with label "${S}"`,confidence:.85});});let v=new Map;y.forEach(D=>{D.assignedUserIds&&D.assignedUserIds.length>0&&D.assignedUserIds.forEach(S=>{v.has(S)||v.set(S,[]),v.get(S).push(D);});}),v.forEach((D,S)=>{D.length>=n.minCardsPerStack&&b.push({stack:{title:`\u{1F464} Assigned to user-${S.slice(-4)}`,cardIds:D.map(M=>M.id),columnId:x,strategy:"assignee",color:"#8b5cf6"},reason:`${D.length} cards assigned to the same user`,confidence:.8});});let w=new Map;if(y.forEach(D=>{D.priority&&(w.has(D.priority)||w.set(D.priority,[]),w.get(D.priority).push(D));}),w.forEach((D,S)=>{if(D.length>=n.minCardsPerStack){let M={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[S.toLowerCase()]||"\u26AA";b.push({stack:{title:`${M} ${S} Priority`,cardIds:D.map(T=>T.id),columnId:x,strategy:"priority",color:S==="high"||S==="urgent"?"#ef4444":"#10b981"},reason:`${D.length} cards with ${S} priority`,confidence:.75});}}),r&&n.enableAutoStacking)for(let D of y){let M=(await r.findSimilar(D,y)).filter(T=>T.similarity>=n.autoStackConfidenceThreshold);if(M.length>=n.minCardsPerStack-1){let T=[D.id,...M.map(A=>A.card.id)],F=M.reduce((A,C)=>A+C.similarity,0)/M.length;b.push({stack:{title:`\u2728 Similar to "${D.title.substring(0,30)}${D.title.length>30?"...":""}"`,cardIds:T,columnId:x,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${M.length+1} similar tasks`,confidence:F});}}return b.filter(D=>D.confidence>=n.autoStackConfidenceThreshold).sort((D,S)=>S.confidence-D.confidence).slice(0,5)},[t,n,r]),f=react.useCallback(x=>{l(x.stack.title,x.stack.cardIds,x.stack.columnId,x.stack.strategy,x.stack.color);},[l]);return react.useEffect(()=>{n.enableAutoStacking&&s.length===0&&new Set(t.map(y=>y.columnId)).forEach(async y=>{let b=await g(y),h=b[0];b.length>0&&h&&h.confidence>=.9&&f(h);});},[]),{stacks:s,createStack:l,deleteStack:d,toggleStack:i,addToStack:u,removeFromStack:m,getStacksForColumn:p,getSuggestions:g,applySuggestion:f,config:n}}var af=react.createContext(null);function rf({children:e,initialData:t,onStateChange:a}){let r=react.useRef();if(!r.current){let s=new Map,o=new Map;t?.columns?.forEach(d=>{let{Column:i}=Qs("@libxai/core");s.set(d.id,new i(d));}),t?.cards?.forEach(d=>{let{Card:i}=Qs("@libxai/core");o.set(d.id,new i(d));});let l=null;if(t?.board){let{Board:d}=Qs("@libxai/core");l=new d(t.board);}r.current=new core.BoardStore({board:l,columns:s,cards:o});}let n=r.current;return react.useEffect(()=>{if(a)return n.subscribeAll(s=>{a(n.getState());})},[n,a]),jsxRuntime.jsx(af.Provider,{value:{store:n},children:e})}function fl(){let e=react.useContext(af);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function Ks(){let e=fl(),[t,a]=react.useState(e.getBoard()),[r,n]=react.useState(e.getAllColumns()),[s,o]=react.useState(e.getAllCards());react.useEffect(()=>e.subscribeAll(()=>{a(e.getBoard()),n(e.getAllColumns()),o(e.getAllCards());}),[e]);let l=react.useCallback(h=>{e.updateBoard(h);},[e]),d=react.useCallback(h=>{e.addColumn(h);},[e]),i=react.useCallback((h,v)=>{e.updateColumn(h,v);},[e]),u=react.useCallback(h=>{e.deleteColumn(h);},[e]),m=react.useCallback(h=>e.getColumn(h),[e]),p=react.useCallback(h=>{e.addCard(h);},[e]),g=react.useCallback((h,v)=>{e.updateCard(h,v);},[e]),f=react.useCallback(h=>{e.deleteCard(h);},[e]),x=react.useCallback((h,v,w)=>{e.moveCard(h,v,w);},[e]),y=react.useCallback(h=>e.getCard(h),[e]),b=react.useCallback(h=>e.getCardsByColumn(h),[e]);return {board:t,columns:r,cards:s,updateBoard:l,addColumn:d,updateColumn:i,deleteColumn:u,getColumn:m,addCard:p,updateCard:g,deleteCard:f,moveCard:x,getCard:y,getCardsByColumn:b}}function nf(e){let{cards:t}=Ks();return react.useMemo(()=>e?t.filter(a=>{if(e.searchQuery){let r=e.searchQuery.toLowerCase(),n=a.title.toLowerCase().includes(r),s=a.description?.toLowerCase().includes(r);if(!n&&!s)return false}return !(e.priorities&&e.priorities.length>0&&(!a.priority||!e.priorities.includes(a.priority))||e.statuses&&e.statuses.length>0&&(!a.status||!e.statuses.includes(a.status))||e.assignedUserIds&&e.assignedUserIds.length>0&&!e.assignedUserIds.some(n=>a.isAssignedTo(n))||e.labels&&e.labels.length>0&&!e.labels.some(n=>a.hasLabel(n))||e.columnIds&&e.columnIds.length>0&&!e.columnIds.includes(a.columnId)||e.isOverdue!==void 0&&e.isOverdue!==a.isOverdue())}):t,[t,e])}function sf(e="position",t="asc"){let{cards:a}=Ks();return react.useMemo(()=>[...a].sort((n,s)=>{let o=0;switch(e){case "title":o=n.title.localeCompare(s.title);break;case "priority":{let l={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},d=n.priority?l[n.priority]:0,i=s.priority?l[s.priority]:0;o=d-i;break}case "createdAt":o=n.createdAt.getTime()-s.createdAt.getTime();break;case "updatedAt":o=n.updatedAt.getTime()-s.updatedAt.getTime();break;case "position":o=n.position-s.position;break}return t==="asc"?o:-o}),[a,e,t])}var bl=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=hu.child("PluginManager");}setContext(t){this.context=t;}register(t){if(!t.id||!t.name||!t.version)throw new Error("Plugin must have id, name, and version");if(this.plugins.has(t.id)&&this.pluginLogger.warn(`Plugin ${t.id} is already registered, overwriting...`),t.dependencies){for(let a of t.dependencies)if(!this.plugins.has(a))throw new Error(`Plugin ${t.id} depends on ${a} which is not registered`)}this.plugins.set(t.id,t),t.defaultConfig&&this.config.set(t.id,{...t.defaultConfig}),this.enabled.add(t.id),this.pluginLogger.info(`Plugin registered: ${t.name} v${t.version}`),t.onInit&&this.context&&Promise.resolve(t.onInit(this.context)).catch(a=>{this.pluginLogger.error(`Failed to initialize plugin ${t.id}`,a,{plugin:t.id});});}unregister(t){let a=this.plugins.get(t);if(!a){this.pluginLogger.warn(`Plugin ${t} is not registered`);return}a.onDestroy&&Promise.resolve(a.onDestroy()).catch(r=>{this.pluginLogger.error(`Failed to destroy plugin ${t}`,r);}),this.plugins.delete(t),this.enabled.delete(t),this.config.delete(t),this.pluginLogger.info(`Plugin unregistered: ${a.name}`);}getPlugin(t){return this.plugins.get(t)}getPlugins(){return Array.from(this.plugins.values())}hasPlugin(t){return this.plugins.has(t)}setEnabled(t,a){if(!this.plugins.has(t))throw new Error(`Plugin ${t} is not registered`);a?(this.enabled.add(t),this.pluginLogger.info(`Plugin enabled: ${t}`)):(this.enabled.delete(t),this.pluginLogger.info(`Plugin disabled: ${t}`));}isEnabled(t){return this.enabled.has(t)}getConfig(t,a){return this.config.get(t)?.[a]}setConfig(t,a,r){this.config.has(t)||this.config.set(t,{});let n=this.config.get(t);n[a]=r,this.pluginLogger.debug(`Plugin config set: ${t}.${a}`,{value:r});}async executeHook(t,a,r){let n=r;for(let s of this.plugins.values()){if(!this.enabled.has(s.id))continue;let o=s[t];if(typeof o=="function")try{let l=await Promise.resolve(o.apply(s,a));l!==void 0&&(n=l,a[0]=l);}catch(l){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,l,{plugin:s.id,hook:t});}}return n}async executeHookParallel(t,a){let r=[];for(let n of this.plugins.values()){if(!this.enabled.has(n.id))continue;let s=n[t];typeof s=="function"&&r.push(Promise.resolve(s.apply(n,a)).catch(o=>{this.pluginLogger.error(`Plugin hook failed: ${n.id}.${t}`,o,{plugin:n.id,hook:t});}));}await Promise.all(r);}},s5=new bl;function df({items:e,height:t,estimateSize:a,renderItem:r,className:n="",overscan:s=5,horizontal:o=false,gap:l=0,getItemKey:d}){let i=react.useRef(null),u=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>i.current,estimateSize:()=>a,overscan:s,horizontal:o,gap:l}),m=u.getVirtualItems(),p={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},g=o?{width:`${u.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${u.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:i,style:p,className:n,children:jsxRuntime.jsx("div",{style:g,children:m.map(f=>{let x=e[f.index];if(!x)return null;let y=d?d(x,f.index):f.index,b={position:"absolute",top:o?0:f.start,left:o?f.start:0,width:o?f.size:"100%",height:o?"100%":f.size};return jsxRuntime.jsx("div",{style:b,"data-index":f.index,children:r(x,f.index)},y)})})})}function cf(e){return reactVirtual.useVirtualizer({count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateSize,overscan:e.overscan??5,horizontal:e.horizontal??false,gap:e.gap??0})}function pf({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:n,className:s="",overscan:o=3,gap:l=16,getItemKey:d,horizontal:i=true}){let u=react.useRef(null),m=reactVirtual.useVirtualizer({horizontal:i,count:e.length,getScrollElement:()=>u.current,estimateSize:()=>r,overscan:o,gap:l}),p=m.getVirtualItems(),g={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},f={width:`${m.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:u,style:g,className:s,children:jsxRuntime.jsx("div",{style:f,children:p.map(x=>{let y=e[x.index];if(!y)return null;let b=d?d(y,x.index):x.index,h={position:"absolute",top:0,left:x.start,width:x.size,height:"100%"};return jsxRuntime.jsx("div",{style:h,"data-index":x.index,children:n(y,x.index)},b)})})})}function mf(e){let t=reactVirtual.useVirtualizer({horizontal:true,count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateColumnWidth,overscan:e.overscan??3,gap:e.gap??0});return {columnVirtualizer:t,virtualColumns:t.getVirtualItems(),totalWidth:t.getTotalSize()}}function gf(e,t=10){return e>t}var zc={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},Uc={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},Wc={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},Vc={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Gc={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},jc={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},_c={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},Kc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",smooth:"cubic-bezier(0.4, 0.0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0.0, 0.6, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},qc={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},Yc={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Xc={column:{width:320,minWidth:280,maxWidth:400,gap:16,padding:12,headerHeight:48},card:{minHeight:80,maxHeight:400,padding:12,gap:8},board:{padding:16,gap:16}},Jc={timeline:{headerHeight:60,rowHeight:44,minRowHeight:32,maxRowHeight:80,taskPadding:4,gridLineWidth:1},task:{height:28,minHeight:20,maxHeight:40,borderRadius:4,padding:6},dependency:{lineWidth:2,arrowSize:8},scale:{day:{columnWidth:40,minColumnWidth:30,maxColumnWidth:60},week:{columnWidth:80,minColumnWidth:60,maxColumnWidth:120},month:{columnWidth:120,minColumnWidth:80,maxColumnWidth:200},quarter:{columnWidth:200,minColumnWidth:150,maxColumnWidth:300}},milestone:{size:16,rotation:45}},hl={spacing:zc,borderRadius:Uc,fontSize:Wc,fontWeight:Vc,lineHeight:Gc,zIndex:jc,duration:_c,easing:Kc,shadows:qc,opacity:Yc,kanban:Xc,gantt:Jc};function ff(e,t,a){return e[t]??a}function Qc(e,t="",a={}){for(let[r,n]of Object.entries(e)){let s=t?`${t}-${r}`:r;typeof n=="object"&&n!==null&&!Array.isArray(n)?Qc(n,s,a):(typeof n=="string"||typeof n=="number")&&(a[s]=n);}return a}function d5(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function Zc(e="asakaa"){let t=Qc(hl),a=[];for(let[r,n]of Object.entries(t)){let s=`--${e}-${r}`,o=d5(n);a.push(` ${s}: ${o};`);}return `:root {
|
|
413
|
+
Today's date: ${new Date().toISOString().split("T")[0]}`}function Gm(e){let t=[],a=r=>{for(let n of r)t.push(n),n.subtasks?.length&&a(n.subtasks);};return a(e),t}function Mo(e,t){let a=Gm(e),r=t.toLowerCase().trim(),n=a.find(l=>l.name.toLowerCase()===r);if(n)return n;let s=a.find(l=>l.name.toLowerCase().includes(r));if(s)return s;let o=r.split(/\s+/);return a.find(l=>{let d=l.name.toLowerCase();return o.every(i=>d.includes(i))})}function Kd(e,t=new Date){let a=e.toLowerCase().trim(),r=new Date(t);if(r.setHours(0,0,0,0),a==="today"||a==="hoy")return r;if(a==="tomorrow"||a==="ma\xF1ana"){let p=new Date(r);return p.setDate(p.getDate()+1),p}if(a==="yesterday"||a==="ayer"){let p=new Date(r);return p.setDate(p.getDate()-1),p}if(a==="next week"||a==="la pr\xF3xima semana"){let p=new Date(r);return p.setDate(p.getDate()+7),p}let n=a.match(/(?:next\s+)?(monday|tuesday|wednesday|thursday|friday|saturday|sunday|lunes|martes|miércoles|miercoles|jueves|viernes|sábado|sabado|domingo)/i);if(n){let g={sunday:0,domingo:0,monday:1,lunes:1,tuesday:2,martes:2,wednesday:3,mi\u00E9rcoles:3,miercoles:3,thursday:4,jueves:4,friday:5,viernes:5,saturday:6,s\u00E1bado:6,sabado:6}[n[1].toLowerCase()];if(g!==void 0){let f=new Date(r),x=f.getDay(),y=g-x;return y<=0&&(y+=7),f.setDate(f.getDate()+y),f}}let s=a.match(/in\s+(\d+)\s+(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(s&&s[1]&&s[2]){let p=parseInt(s[1],10),g=s[2].toLowerCase(),f=new Date(r);return g==="day"||g==="d\xEDa"||g==="dias"?f.setDate(f.getDate()+p):g==="week"||g==="semana"||g==="semanas"?f.setDate(f.getDate()+p*7):(g==="month"||g==="mes"||g==="meses")&&f.setMonth(f.getMonth()+p),f}if(a.match(/(\d{4})-(\d{2})-(\d{2})/))return new Date(a);let l=a.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})/);if(l&&l[1]&&l[2]&&l[3]){let p=parseInt(l[1],10),g=parseInt(l[2],10)-1,f=parseInt(l[3],10);return new Date(f,g,p)}let d={enero:0,febrero:1,marzo:2,abril:3,mayo:4,junio:5,julio:6,agosto:7,septiembre:8,octubre:9,noviembre:10,diciembre:11},i=a.match(/(\d{1,2})\s+de\s+(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)(?:\s+de\s+(\d{4}))?/i);if(i&&i[1]&&i[2]){let p=parseInt(i[1],10),g=d[i[2].toLowerCase()],f=i[3]?parseInt(i[3],10):r.getFullYear();if(g!==void 0)return new Date(f,g,p)}let u={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},m=a.match(/(january|february|march|april|may|june|july|august|september|october|november|december)\s+(\d{1,2})(?:,?\s+(\d{4}))?/i);if(m&&m[1]&&m[2]){let p=u[m[1].toLowerCase()],g=parseInt(m[2],10),f=m[3]?parseInt(m[3],10):r.getFullYear();if(p!==void 0)return new Date(f,p,g)}return null}function qd(e){let a=e.toLowerCase().trim().match(/(\d+)\s*(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(a&&a[1]&&a[2]){let r=parseInt(a[1],10),n=a[2].toLowerCase();if(n==="day"||n==="d\xEDa"||n==="dias")return r;if(n==="week"||n==="semana"||n==="semanas")return r*7;if(n==="month"||n==="mes"||n==="meses")return r*30}return null}function Yd(e){let t=e.match(/(\d+)(?:\s*%)?/);if(t&&t[1]){let a=parseInt(t[1],10);return Math.max(0,Math.min(100,a))}return null}function jm(e){let t=e.toLowerCase().trim();return t.includes("todo")||t.includes("pendiente")||t.includes("por hacer")?"todo":t.includes("in progress")||t.includes("in-progress")||t.includes("en progreso")||t.includes("working")||t.includes("trabajando")?"in-progress":t.includes("done")||t.includes("complete")||t.includes("finished")||t.includes("completado")||t.includes("terminado")||t.includes("hecho")?"completed":null}function _m(e,t){let a=e.toLowerCase().trim(),r=a.match(/(?:move|mover|mueve)\s+(?:la\s+tarea\s+)?["""]?(.+?)["""]?\s+(?:to|a|para)\s+(?:la\s+fecha\s+)?(.+)/i);if(r&&r[1]&&r[2]){let i=r[1].trim(),u=r[2].trim(),m=Mo(t,i),p=Kd(u);if(!m)return {type:"move_task",taskName:i,message:`Could not find a task named "${i}". Please check the task name and try again.`,success:false,error:"Task not found"};if(!p)return {type:"move_task",taskId:m.id,taskName:m.name,message:`Could not parse the date "${u}". Try using formats like "next Monday", "in 3 days", or "2024-01-15".`,success:false,error:"Invalid date"};let g=m.startDate&&m.endDate?Math.round((m.endDate.getTime()-m.startDate.getTime())/(1e3*60*60*24)):1,f=new Date(p);return f.setDate(f.getDate()+g),{type:"move_task",taskId:m.id,taskName:m.name,updates:{startDate:p,endDate:f},message:`Moved "${m.name}" to ${p.toLocaleDateString()}.`,success:true}}let n=a.match(/(?:extend|extender|extiende|alargar)\s+["""]?(.+?)["""]?\s+(?:by|por)\s+(.+)/i);if(n&&n[1]&&n[2]){let i=n[1].trim(),u=n[2].trim(),m=Mo(t,i),p=qd(u);if(!m)return {type:"resize_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"};if(!p||!m.endDate)return {type:"resize_task",taskId:m.id,taskName:m.name,message:`Could not parse the duration "${u}".`,success:false,error:"Invalid duration"};let g=new Date(m.endDate);return g.setDate(g.getDate()+p),{type:"resize_task",taskId:m.id,taskName:m.name,updates:{endDate:g},message:`Extended "${m.name}" by ${p} days. New end date: ${g.toLocaleDateString()}.`,success:true}}let s=a.match(/(?:set|establecer|poner)\s+["""]?(.+?)["""]?\s+(?:progress|progreso)\s+(?:to|a|en)\s+(.+)/i);if(s&&s[1]&&s[2]){let i=s[1].trim(),u=s[2].trim(),m=Mo(t,i),p=Yd(u);return m?p===null?{type:"set_progress",taskId:m.id,taskName:m.name,message:`Could not parse the progress value "${u}".`,success:false,error:"Invalid progress"}:{type:"set_progress",taskId:m.id,taskName:m.name,updates:{progress:p},message:`Set "${m.name}" progress to ${p}%.`,success:true}:{type:"set_progress",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let o=a.match(/(?:rename|renombrar|cambiar nombre de)\s+["""]?(.+?)["""]?\s+(?:to|a|por)\s+["""]?(.+?)["""]?$/i);if(o&&o[1]&&o[2]){let i=o[1].trim(),u=o[2].trim(),m=Mo(t,i);return m?{type:"rename_task",taskId:m.id,taskName:m.name,updates:{name:u},message:`Renamed "${m.name}" to "${u}".`,success:true}:{type:"rename_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let l=a.match(/(?:link|vincular|conectar)\s+["""]?(.+?)["""]?\s+(?:to|a|con)\s+["""]?(.+?)["""]?$/i);if(l&&l[1]&&l[2]){let i=l[1].trim(),u=l[2].trim(),m=Mo(t,i),p=Mo(t,u);return m?p?{type:"link_tasks",taskId:p.id,taskName:p.name,dependencyFrom:m.id,dependencyTo:p.id,message:`Linked "${m.name}" \u2192 "${p.name}".`,success:true}:{type:"link_tasks",taskName:u,message:`Could not find a task named "${u}".`,success:false,error:"Target task not found"}:{type:"link_tasks",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Source task not found"}}let d=a.match(/(?:delete|eliminar|borrar|remove|quitar)\s+["""]?(.+?)["""]?$/i);if(d&&d[1]){let i=d[1].trim(),u=Mo(t,i);return u?{type:"delete_task",taskId:u.id,taskName:u.name,message:`Deleted "${u.name}".`,success:true}:{type:"delete_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}return null}function Km(e){if(!e||typeof e!="object")return {type:"unknown",message:"Invalid response from AI",success:false,error:"Invalid response format"};let t=e;return {type:t.type||"unknown",taskId:typeof t.taskId=="string"?t.taskId:void 0,taskName:typeof t.taskName=="string"?t.taskName:void 0,updates:t.updates,newTask:t.newTask,dependencyFrom:typeof t.dependencyFrom=="string"?t.dependencyFrom:void 0,dependencyTo:typeof t.dependencyTo=="string"?t.dependencyTo:void 0,message:typeof t.message=="string"?t.message:"Command processed",success:typeof t.success=="boolean"?t.success:false,error:typeof t.error=="string"?t.error:void 0}}function x2(e){if(e)switch(e.toUpperCase()){case "TODO":case "BLOCKED":return "todo";case "IN_PROGRESS":case "REVIEW":return "in-progress";case "DONE":return "completed";default:return "todo"}}function v2(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return e||"TODO"}}function _i(e,t=[],a=[]){let r=e.assignedUserIds?.map(u=>{let m=a.find(p=>p.id===u);return m?{name:m.name,initials:m.initials,color:m.color}:null}).filter(u=>u!==null),n=t.filter(u=>u.metadata?.parentCardId===e.id).map(u=>_i(u,t,a)),s;e.dependencies&&(typeof e.dependencies[0]=="string"?s=e.dependencies:s=e.dependencies.filter(u=>u.type==="finish-to-start").map(u=>u.taskId));let o=u=>{if(u)return typeof u=="string"?new Date(u):u},l=o(e.startDate),d=o(e.endDate),i=e.metadata?.isMilestone===true||l&&d&&Math.abs(d.getTime()-l.getTime())<=864e5;return {id:e.id,name:e.title,startDate:l,endDate:d,progress:e.progress||0,status:x2(e.metadata?.status),assignees:r?.length?r:void 0,dependencies:s?.length?s:void 0,subtasks:n?.length?n:void 0,isExpanded:e.metadata?.isExpanded===true,isMilestone:i,isCriticalPath:e.metadata?.isCriticalPath===true}}function qm(e,t=[]){let a;return e.assignees&&e.assignees.length>0&&(a=e.assignees.map(r=>t.find(s=>s.name===r.name||s.initials===r.initials)?.id).filter(r=>r!==void 0)),{id:e.id,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,assignedUserIds:a?.length?a:void 0,metadata:{status:v2(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function Ym(e,t=[]){return e.filter(r=>!r.metadata?.parentCardId).map(r=>_i(r,e,t))}var Xd={columns:{name:"Task ID / Name",startDate:"Start Date",endDate:"End Date",progress:"Progress",status:"Status",assignees:"Assignees",priority:"Priority",actions:"Actions",estimatedTime:"Estimated",quotedTime:"Quoted",elapsedTime:"Executed",tags:"Tags",scheduleVariance:"Sched / Var",hoursBar:"Hours (Spent / Allocated)",teamLoad:"Team Load",blockers:"Blockers",weight:"Weight"},toolbar:{search:"Search",searchPlaceholder:"Search tasks...",filter:"Filter",clearFilters:"Clear Filters",export:"Export",columns:"Columns",newTask:"New Task"},filters:{status:"Status",assignees:"Assignees",dateRange:"Date Range",showCompleted:"Show Completed",all:"All",none:"None"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",viewDetails:"View Details"},empty:{noTasks:"No tasks yet",noResults:"No tasks match your filters",addFirstTask:"Add your first task"},pagination:{showing:"Showing",of:"of",tasks:"tasks",previous:"Previous",next:"Next"},bulk:{selected:"selected",delete:"Delete",move:"Move to",assignTo:"Assign to"}},Jd={columns:{name:"ID Tarea / Nombre",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",status:"Estado",assignees:"Asignados",priority:"Prioridad",actions:"Acciones",estimatedTime:"Estimado",quotedTime:"Ofertado",elapsedTime:"Ejecutado",tags:"Etiquetas",scheduleVariance:"Prog / Var",hoursBar:"Horas (Usado / Asignado)",teamLoad:"Equipo",blockers:"Bloqueantes",weight:"Peso"},toolbar:{search:"Buscar",searchPlaceholder:"Buscar tareas...",filter:"Filtrar",clearFilters:"Limpiar Filtros",export:"Exportar",columns:"Columnas",newTask:"Nueva Tarea"},filters:{status:"Estado",assignees:"Asignados",dateRange:"Rango de Fechas",showCompleted:"Mostrar Completadas",all:"Todos",none:"Ninguno"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",viewDetails:"Ver Detalles"},empty:{noTasks:"Sin tareas a\xFAn",noResults:"Ninguna tarea coincide con los filtros",addFirstTask:"Agrega tu primera tarea"},pagination:{showing:"Mostrando",of:"de",tasks:"tareas",previous:"Anterior",next:"Siguiente"},bulk:{selected:"seleccionadas",delete:"Eliminar",move:"Mover a",assignTo:"Asignar a"}},Ki={en:Xd,es:Jd};function Qd(e){return Ki[e]||Ki.en}function qi(e,t){let a=Qd(e);return t?{columns:{...a.columns,...t.columns},toolbar:{...a.toolbar,...t.toolbar},filters:{...a.filters,...t.filters},status:{...a.status,...t.status},actions:{...a.actions,...t.actions},empty:{...a.empty,...t.empty},pagination:{...a.pagination,...t.pagination},bulk:{...a.bulk,...t.bulk}}:a}var Zd=[{value:"todo",icon:lucideReact.Circle,color:"text-gray-400"},{value:"in-progress",icon:lucideReact.PlayCircle,color:"text-[#3B9EFF]"},{value:"completed",icon:lucideReact.CheckCircle2,color:"text-[#3BF06E]"}];function Xm(e){let t=e?.toLowerCase()||"todo";return t==="inprogress"||t==="in-progress"||t==="in_progress"?"in-progress":t==="completed"||t==="done"||t==="complete"?"completed":"todo"}function Jm({value:e,onChange:t,isDark:a,translations:r,disabled:n=false}){let[s,o]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let g=f=>{l.current&&!l.current.contains(f.target)&&o(false);};return s&&document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[s]);let d=Xm(e),i=Zd[0],u=Zd.find(g=>g.value===d)??i,m=u.icon,p=g=>{switch(Xm(g)){case "completed":return r.completed;case "in-progress":return r.inProgress;default:return r.todo}};return n||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(m,{className:c("w-4 h-4 flex-shrink-0",u.color)}),jsxRuntime.jsx("span",{className:c("text-sm whitespace-nowrap",a?"text-white/60":"text-gray-500"),children:p(e)})]}):jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:g=>{g.stopPropagation(),o(!s);},className:c("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx(m,{className:c("w-4 h-4 flex-shrink-0",u.color)}),jsxRuntime.jsx("span",{className:c("text-sm whitespace-nowrap",a?"text-white/60":"text-gray-500"),children:p(e)}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-3 h-3",a?"text-white/30":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:c("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[140px]",a?"bg-[#1A1A1A] border-[#222]":"bg-white border-gray-200"),children:Zd.map(g=>{let f=g.icon;return jsxRuntime.jsxs("button",{onClick:x=>{x.stopPropagation(),t(g.value),o(false);},className:c("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",d===g.value&&(a?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx(f,{className:c("w-4 h-4",g.color)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:p(g.value)})]},g.value)})})]})}var ec=[{value:"urgent",label:{en:"Urgent",es:"Urgente"},color:"text-[#FF2D20]",bg:"bg-[#FF2D20]"},{value:"high",label:{en:"High",es:"Alta"},color:"text-[#FF2D20]",bg:"bg-[#FF2D20]"},{value:"medium",label:{en:"Medium",es:"Media"},color:"text-[#FFD60A]",bg:"bg-[#FFD60A]"},{value:"low",label:{en:"Low",es:"Baja"},color:"text-[#3B9EFF]",bg:"bg-[#3B9EFF]"},{value:"none",label:{en:"None",es:"Ninguna"},color:"text-gray-400",bg:"bg-gray-400"}];function Zm({value:e="none",onChange:t,isDark:a,locale:r,disabled:n=false}){let[s,o]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let u=m=>{l.current&&!l.current.contains(m.target)&&o(false);};return s&&document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[s]);let d=ec.find(u=>u.value===e)??ec[4],i=r==="es"?"es":"en";return n||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Flag,{className:c("w-4 h-4",d.color)}),jsxRuntime.jsx("span",{className:c("text-sm",a?"text-white/60":"text-gray-500"),children:d.label[i]})]}):jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:u=>{u.stopPropagation(),o(!s);},className:c("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Flag,{className:c("w-4 h-4",d.color)}),jsxRuntime.jsx("span",{className:c("text-sm",a?"text-white/60":"text-gray-500"),children:d.label[i]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-3 h-3",a?"text-white/30":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:c("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px]",a?"bg-[#1A1A1A] border-[#222]":"bg-white border-gray-200"),children:ec.map(u=>jsxRuntime.jsxs("button",{onClick:m=>{m.stopPropagation(),t(u.value),o(false);},className:c("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",e===u.value&&(a?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:c("w-2 h-2 rounded-full",u.bg)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:u.label[i]})]},u.value))})]})}function As(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function tc(e){let t=["bg-[#00E5CC]","bg-green-500","bg-purple-500","bg-pink-500","bg-yellow-500","bg-red-500","bg-indigo-500","bg-[#00E5CC]"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"bg-[#00E5CC]"}function ac({value:e=[],availableUsers:t=[],onChange:a,isDark:r,locale:n,disabled:s=false}){let[o,l]=react.useState(false),[d,i]=react.useState(""),u=react.useRef(null),m=react.useRef(null);react.useEffect(()=>{let x=y=>{u.current&&!u.current.contains(y.target)&&(l(false),i(""));};return o&&document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]),react.useEffect(()=>{o&&m.current&&m.current.focus();},[o]);let p=t.filter(x=>x.name.toLowerCase().includes(d.toLowerCase())),g=x=>e.some(y=>y.name===x),f=x=>{if(a){if(g(x.name))a(e.filter(y=>y.name!==x.name));else {let y={name:x.name,initials:As(x.name),color:x.color||tc(x.name).replace("bg-","").replace("-500",""),avatar:x.avatarUrl,id:x.id};a([...e,y]);}l(false),i("");}};return s||!a?e.length===0?jsxRuntime.jsx("span",{className:c("text-sm",r?"text-white/30":"text-gray-400"),children:"-"}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-2",children:[e.slice(0,3).map((x,y)=>jsxRuntime.jsx("div",{className:c("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white border-2",r?"border-[#0D0D0D]":"border-white",!x.avatar&&tc(x.name)),style:x.color&&!x.avatar?{backgroundColor:x.color}:void 0,title:x.name,children:x.avatar?jsxRuntime.jsx("img",{src:x.avatar,alt:x.name,className:"w-full h-full rounded-full object-cover"}):x.initials||As(x.name)},`${x.name}-${y}`)),e.length>3&&jsxRuntime.jsxs("div",{className:c("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium border-2",r?"bg-[#1A1A1A] border-[#0D0D0D] text-white":"bg-gray-200 border-white text-gray-600"),children:["+",e.length-3]})]}):jsxRuntime.jsxs("div",{ref:u,className:"relative",children:[jsxRuntime.jsx("button",{onClick:x=>{x.stopPropagation(),l(!o);},className:c("flex items-center gap-1 px-2 py-1 rounded transition-colors",r?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:e.length===0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.User,{className:c("w-4 h-4",r?"text-white/30":"text-gray-400")}),jsxRuntime.jsx(lucideReact.Plus,{className:c("w-3 h-3",r?"text-white/30":"text-gray-400")})]}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-1",children:[e.slice(0,2).map((x,y)=>jsxRuntime.jsx("div",{className:c("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-medium text-white border",r?"border-[#0D0D0D]":"border-white",!x.avatar&&tc(x.name)),style:x.color&&!x.avatar?{backgroundColor:x.color}:void 0,children:x.avatar?jsxRuntime.jsx("img",{src:x.avatar,alt:x.name,className:"w-full h-full rounded-full object-cover"}):x.initials||As(x.name)},`${x.name}-${y}`)),e.length>2&&jsxRuntime.jsxs("span",{className:c("text-xs ml-1",r?"text-white/60":"text-gray-500"),children:["+",e.length-2]})]})}),o&&jsxRuntime.jsxs("div",{className:"absolute z-50 top-full left-0 mt-1.5 rounded-lg overflow-hidden",style:{width:260,backgroundColor:r?"rgba(17, 17, 17, 0.98)":"rgba(255, 255, 255, 0.98)",border:`1px solid ${r?"rgba(255,255,255,0.10)":"rgba(0,0,0,0.1)"}`,boxShadow:r?"0 8px 24px rgba(0,0,0,0.5)":"0 8px 24px rgba(0,0,0,0.12)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",style:{padding:"8px 10px",borderBottom:`1px solid ${r?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`},children:[jsxRuntime.jsx(lucideReact.Search,{className:"flex-shrink-0",style:{width:14,height:14,color:r?"rgba(255,255,255,0.20)":"#94A3B8"}}),jsxRuntime.jsx("input",{ref:m,type:"text",value:d,onChange:x=>i(x.target.value),placeholder:n==="es"?"Buscar miembros...":"Search members...",onClick:x=>x.stopPropagation(),style:{flex:1,fontSize:12,color:r?"rgba(255,255,255,0.92)":"#0F172A",backgroundColor:"transparent",border:"none",outline:"none",fontFamily:"Inter, sans-serif"}})]}),e.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",style:{padding:"6px 10px",borderBottom:`1px solid ${r?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`},children:e.map((x,y)=>jsxRuntime.jsxs("span",{className:"flex items-center gap-1",style:{fontSize:11,padding:"2px 6px 2px 4px",borderRadius:4,backgroundColor:x.color?`${x.color}20`:r?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)",color:x.color||(r?"#fff":"#334155")},children:[jsxRuntime.jsx("span",{className:"flex items-center justify-center",style:{width:16,height:16,borderRadius:"50%",backgroundColor:x.color||"#00E5CC",fontSize:8,fontWeight:700,color:"#fff"},children:x.avatar?jsxRuntime.jsx("img",{src:x.avatar,alt:x.name,className:"w-full h-full rounded-full object-cover"}):x.initials||As(x.name)}),x.name.split(" ")[0],jsxRuntime.jsx("button",{onClick:b=>{b.stopPropagation(),a(e.filter(h=>h.name!==x.name));},className:"flex items-center justify-center",style:{width:14,height:14,borderRadius:3,border:"none",background:"transparent",color:"inherit",cursor:"pointer",opacity:.7},children:jsxRuntime.jsx(lucideReact.X,{style:{width:10,height:10}})})]},`${x.name}-${y}`))}),jsxRuntime.jsx("div",{style:{maxHeight:200,overflowY:"auto",padding:4},children:p.length===0?jsxRuntime.jsx("div",{style:{padding:"12px 10px",fontSize:12,color:r?"rgba(255,255,255,0.35)":"#94A3B8",textAlign:"center"},children:n==="es"?"No se encontraron miembros":"No members found"}):p.map(x=>{let y=g(x.name);return jsxRuntime.jsxs("button",{onClick:b=>{b.stopPropagation(),f(x);},className:"flex items-center w-full",style:{gap:8,padding:"6px 10px",borderRadius:4,border:"none",cursor:"pointer",backgroundColor:y?r?"rgba(0, 229, 204, 0.12)":"rgba(0, 229, 204, 0.08)":"transparent",color:r?"rgba(255,255,255,0.92)":"#0F172A",fontSize:12,textAlign:"left",transition:"background-color 0.1s"},onMouseEnter:b=>{y||(b.currentTarget.style.backgroundColor=r?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)");},onMouseLeave:b=>{y||(b.currentTarget.style.backgroundColor="transparent");},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center flex-shrink-0",style:{width:24,height:24,borderRadius:"50%",backgroundColor:x.color||"#00E5CC",fontSize:9,fontWeight:700,color:"#fff"},children:x.avatarUrl?jsxRuntime.jsx("img",{src:x.avatarUrl,alt:x.name,className:"w-full h-full rounded-full object-cover"}):As(x.name)}),jsxRuntime.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.name}),y&&jsxRuntime.jsx("div",{className:"flex items-center justify-center",style:{width:16,height:16,borderRadius:4,backgroundColor:"rgba(96, 165, 250, 0.2)"},children:jsxRuntime.jsx("div",{style:{width:8,height:8,borderRadius:2,backgroundColor:"#60A5FA"}})})]},x.id)})})]})]})}function ng({startDate:e,endDate:t,onChange:a,singleDateMode:r=false,singleDateField:n="end",isDark:s,locale:o,disabled:l=false,placeholder:d}){let[i,u]=react.useState(false),[m,p]=react.useState(n),[g,f]=react.useState(()=>{let C=n==="start"?e:t;if(C){let _=C instanceof Date?C:new Date(C);return new Date(_.getFullYear(),_.getMonth(),1)}return new Date(new Date().getFullYear(),new Date().getMonth(),1)}),x=react.useRef(null),y=react.useRef(null),b=react.useRef(null),[h,v]=react.useState(null),w=e?e instanceof Date?e:new Date(e):null,D=t?t instanceof Date?t:new Date(t):null;react.useEffect(()=>{let C=_=>{let W=_.target;x.current&&x.current.contains(W)||b.current&&b.current.contains(W)||u(false);};return i&&document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[i]),react.useLayoutEffect(()=>{if(!i){v(null);return}let C=()=>{let _=y.current?.getBoundingClientRect();if(!_)return;let W=520,oe=360,L=window.innerHeight-_.bottom,Y=L<oe&&_.top>L,K=Y?_.top-4:_.bottom+4,V=Math.min(Math.max(_.left,8),window.innerWidth-W-8);v({top:K,left:V,flipUp:Y});};return C(),window.addEventListener("scroll",C,true),window.addEventListener("resize",C),()=>{window.removeEventListener("scroll",C,true),window.removeEventListener("resize",C);}},[i]),react.useEffect(()=>{i&&p(r?n:"start");},[i,r,n]);let S=C=>C?C.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"}):d||"-",M=react.useCallback(()=>{let C=g.getFullYear(),_=g.getMonth(),W=new Date(C,_,1),L=new Date(C,_+1,0).getDate(),Y=W.getDay(),K=[],B=new Date(C,_,0).getDate();for(let Ce=Y-1;Ce>=0;Ce--)K.push({date:new Date(C,_-1,B-Ce),isCurrentMonth:false});for(let Ce=1;Ce<=L;Ce++)K.push({date:new Date(C,_,Ce),isCurrentMonth:true});let X=42-K.length;for(let Ce=1;Ce<=X;Ce++)K.push({date:new Date(C,_+1,Ce),isCurrentMonth:false});return K},[g]),T=C=>{if(r)n==="start"?a(C,D||void 0):a(w||void 0,C),u(false);else if(m==="start"){let _=D&&C>D?C:D;a(C,_||void 0),p("end");}else {let _=w&&C<w?C:w;a(_||void 0,C),u(false);}},F=()=>{let C=new Date,_=new Date(C);_.setDate(C.getDate()+1);let W=new Date(C);W.setDate(C.getDate()+((6-C.getDay()+7)%7||7));let oe=new Date(C);oe.setDate(C.getDate()+((1-C.getDay()+7)%7||7));let L=new Date(C);L.setDate(C.getDate()+(6-C.getDay()+7)%7+7);let Y=new Date(C);Y.setDate(C.getDate()+14);let K=new Date(C);return K.setDate(C.getDate()+28),[{label:o==="es"?"Hoy":"Today",date:C,display:C.toLocaleDateString(o==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:o==="es"?"Ma\xF1ana":"Tomorrow",date:_,display:_.toLocaleDateString(o==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:o==="es"?"Este fin de semana":"This weekend",date:W,display:o==="es"?"s\xE1b.":"sat."},{label:o==="es"?"Pr\xF3xima semana":"Next week",date:oe,display:o==="es"?"lun.":"mon."},{label:o==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:L,display:L.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:o==="es"?"2 semanas":"2 weeks",date:Y,display:Y.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:o==="es"?"4 semanas":"4 weeks",date:K,display:K.toLocaleDateString(o==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}]};if(l){let C=r&&n==="start"?w:D;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:c("w-4 h-4",s?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm",s?"text-white/60":"text-gray-500"),children:S(C)})]})}let A=r&&n==="start"?w:D;return jsxRuntime.jsxs("div",{ref:x,className:"relative",children:[jsxRuntime.jsxs("button",{ref:y,onClick:C=>{C.stopPropagation(),u(!i);let _=n==="start"?w:D;_&&f(new Date(_.getFullYear(),_.getMonth(),1));},className:c("flex items-center gap-2 px-2 py-1 rounded transition-colors",s?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:c("w-4 h-4",s?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm",s?"text-white/60":"text-gray-500"),children:S(A)})]}),i&&h&&reactDom.createPortal(jsxRuntime.jsxs("div",{ref:b,className:c("rounded-xl shadow-2xl overflow-hidden flex",s?"bg-[#1A1A1A] border border-[#222]":"bg-white border border-gray-200"),style:{position:"fixed",top:h.flipUp?void 0:h.top,bottom:h.flipUp?window.innerHeight-h.top:void 0,left:h.left,zIndex:10001},onClick:C=>C.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:c("w-44 py-2 border-r",s?"border-[#222]":"border-gray-200"),children:[F().map((C,_)=>jsxRuntime.jsxs("button",{className:c("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",s?"hover:bg-white/[0.05] text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>T(C.date),children:[jsxRuntime.jsx("span",{children:C.label}),jsxRuntime.jsx("span",{className:c("text-xs",s?"text-white/30":"text-gray-400"),children:C.display})]},_)),jsxRuntime.jsx("div",{className:c("border-t mt-2 pt-2",s?"border-[#222]":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{r?n==="start"?a(void 0,D||void 0):a(w||void 0,void 0):a(void 0,void 0),u(false);},className:c("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",s?"hover:bg-white/[0.05] text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:o==="es"?"Quitar fecha":"Clear date"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[!r&&jsxRuntime.jsx("div",{className:c("text-xs mb-3 px-2 py-1 rounded",s?"bg-white/[0.03] text-white/60":"bg-gray-100 text-gray-600"),children:m==="start"?o==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":o==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:c("font-medium",s?"text-white":"text-gray-900"),children:g.toLocaleDateString(o==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>f(new Date),className:c("p-1 rounded text-sm transition-colors",s?"hover:bg-white/[0.05] text-white":"hover:bg-gray-100 text-gray-700"),children:o==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>f(new Date(g.getFullYear(),g.getMonth()-1)),className:c("p-1 rounded",s?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:c("w-4 h-4",s?"text-white":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:()=>f(new Date(g.getFullYear(),g.getMonth()+1)),className:c("p-1 rounded",s?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:c("w-4 h-4",s?"text-white":"text-gray-600")})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(o==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(C=>jsxRuntime.jsx("div",{className:c("w-8 h-8 flex items-center justify-center text-xs",s?"text-white/30":"text-gray-400"),children:C},C))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:M().map((C,_)=>{let W=C.date.toDateString()===new Date().toDateString(),oe=w?.toDateString()===C.date.toDateString(),L=D?.toDateString()===C.date.toDateString(),Y=oe||L,K=!r&&w&&D&&C.date>=w&&C.date<=D;return jsxRuntime.jsx("button",{onClick:()=>T(new Date(C.date)),className:c("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!C.isCurrentMonth&&(s?"text-white/20":"text-gray-300"),C.isCurrentMonth&&(s?"text-white":"text-gray-900"),W&&"ring-2 ring-[#00E5CC]",oe&&"bg-[#00E5CC] text-white",L&&!oe&&"bg-[#7C3AED] text-white",K&&!Y&&(s?"bg-[#7C3AED]/20":"bg-purple-100"),!Y&&(s?"hover:bg-white/[0.05]":"hover:bg-gray-100")),children:C.date.getDate()},_)})})]})]}),document.body)]})}function Qi({value:e,onChange:t,isDark:a,locale:r,disabled:n=false,dateField:s="end",startDate:o,endDate:l}){let d=e?e instanceof Date?e:new Date(e):null;return jsxRuntime.jsx(ng,{startDate:s==="start"?d:o||null,endDate:s==="end"?d:l||null,onChange:(p,g)=>{t&&t(s==="start"?p:g);},singleDateMode:true,singleDateField:s,isDark:a,locale:r,disabled:n||!t,placeholder:"-"})}function Yn(e=600){let[t,a]=react.useState(false),r=react.useRef(null),n=react.useCallback(()=>{r.current&&clearTimeout(r.current),a(true),r.current=setTimeout(()=>{a(false);},e);},[e]);return react.useEffect(()=>()=>{r.current&&clearTimeout(r.current);},[]),{isFlashing:t,triggerFlash:n}}function Zi(e,t={}){let{enabled:a=true,duration:r=400,steps:n=8}=t,[s,o]=react.useState(e),[l,d]=react.useState(false),i=react.useRef(e),u=react.useRef([]);return react.useEffect(()=>{if(u.current.forEach(clearTimeout),u.current=[],!a||e===i.current||e===void 0){o(e),i.current=e;return}let m=i.current??0,p=e,g=p-m,f=r/n;d(true);for(let x=1;x<=n;x++){let y=setTimeout(()=>{let b=x/n,h=1-Math.pow(1-b,3),v=Math.round(m+g*h);o(v),x===n&&(d(false),o(p));},f*x);u.current.push(y);}return i.current=e,()=>{u.current.forEach(clearTimeout),u.current=[];}},[e,a,r,n]),{displayValue:s,isAnimating:l}}function sg(e,t={}){let{delay:a=1500,onCancel:r}=t,[n,s]=react.useState(null),[o,l]=react.useState(0),d=react.useRef(null),i=react.useRef(null),u=react.useCallback(g=>{d.current&&clearTimeout(d.current),i.current&&clearInterval(i.current),s(g),l(0);let f=Date.now();i.current=setInterval(()=>{let x=Date.now()-f,y=Math.min(x/a*100,100);l(y);},16),d.current=setTimeout(()=>{i.current&&clearInterval(i.current),e?.(g),s(null),l(0);},a);},[a,e]),m=react.useCallback(()=>{d.current&&clearTimeout(d.current),i.current&&clearInterval(i.current),s(null),l(0),r?.();},[r]);return react.useEffect(()=>()=>{d.current&&clearTimeout(d.current),i.current&&clearInterval(i.current);},[]),{pendingValue:n,isPending:n!==null,progress:o,startChange:u,cancelChange:m}}function lg({value:e=0,onChange:t,isDark:a,disabled:r=false,enableSlotMachine:n=true,enableSaveFlash:s=true}){let[o,l]=react.useState(false),[d,i]=react.useState(""),u=react.useRef(null),{isFlashing:m,triggerFlash:p}=Yn(),{displayValue:g,isAnimating:f}=Zi(e,{enabled:n,duration:300,steps:6}),x=w=>{if(r||!t)return;w.stopPropagation();let D=w.currentTarget.getBoundingClientRect(),S=w.clientX-D.left,M=Math.round(S/D.width*100),T=Math.max(0,Math.min(100,M));T!==e&&(t(T),s&&p());},y=react.useCallback(w=>{r||!t||(w.stopPropagation(),i(String(e)),l(true));},[r,t,e]);react.useEffect(()=>{o&&u.current&&(u.current.focus(),u.current.select());},[o]);let b=react.useCallback(()=>{l(false);let w=parseInt(d,10);if(!isNaN(w)&&t){let D=Math.max(0,Math.min(100,w));D!==e&&(t(D),s&&p());}},[d,t,e,s,p]),h=react.useCallback(w=>{w.key==="Enter"&&b(),w.key==="Escape"&&l(false);},[b]),v=g??e;return jsxRuntime.jsxs("div",{className:c("flex items-center gap-2 w-full rounded px-1 py-0.5 transition-[background-color] duration-300",m&&(a?"bg-[#3BF06E]/30":"bg-[#3BF06E]/20")),children:[v>0?jsxRuntime.jsx("div",{onClick:x,className:c("flex-1 h-2 rounded-full overflow-hidden",a?"bg-white/[0.05]":"bg-gray-200",!r&&t&&"cursor-pointer"),children:jsxRuntime.jsx("div",{className:c("h-full rounded-full transition-[width]",v===100?"bg-[#3BF06E]":"bg-[#3B9EFF]",f&&"transition-none"),style:{width:`${v}%`}})}):jsxRuntime.jsx("div",{className:"flex-1"}),o?jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",onClick:w=>w.stopPropagation(),children:[jsxRuntime.jsx("input",{ref:u,value:d,onChange:w=>i(w.target.value.replace(/[^0-9]/g,"")),onBlur:b,onKeyDown:h,maxLength:3,className:c("w-8 text-xs text-right tabular-nums font-mono rounded border px-1 py-0 outline-none",a?"bg-white/10 border-white/20 text-white focus:border-[#00E5CC]":"bg-white border-gray-300 text-gray-900 focus:border-[#00E5CC]")}),jsxRuntime.jsx("span",{className:c("text-xs font-mono",a?"text-white/40":"text-gray-400"),children:"%"})]}):jsxRuntime.jsxs("span",{onClick:y,className:c("text-xs w-8 text-right tabular-nums font-mono rounded px-1",v===0?a?"text-[#6B7280]":"text-gray-400":a?"text-white/60":"text-gray-500",!r&&t&&"cursor-pointer hover:bg-white/[0.08]",f&&"font-medium scale-105"),title:!r&&t?"Click to edit":void 0,children:[v,"%"]})]})}function ug({value:e="",onChange:t,isDark:a,placeholder:r="-",disabled:n=false}){let[s,o]=react.useState(false),[l,d]=react.useState(e),i=react.useRef(null);react.useEffect(()=>{s&&i.current&&(i.current.focus(),i.current.select());},[s]),react.useEffect(()=>{d(e);},[e]);let u=()=>{l!==e&&t?.(l),o(false);},m=p=>{p.key==="Enter"?u():p.key==="Escape"&&(d(e),o(false));};return n||!t?jsxRuntime.jsx("span",{className:c("text-sm truncate",a?"text-white/60":"text-gray-500"),children:e||r}):s?jsxRuntime.jsx("input",{ref:i,type:"text",value:l,onChange:p=>d(p.target.value),onBlur:u,onKeyDown:m,onClick:p=>p.stopPropagation(),className:c("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/[0.03] border-[#00E5CC] text-white":"bg-white border-[#00E5CC] text-gray-900")}):jsxRuntime.jsx("button",{onClick:p=>{p.stopPropagation(),o(true);},className:c("text-sm truncate text-left w-full px-2 py-1 rounded transition-colors",a?"text-white/60 hover:bg-white/[0.05]":"text-gray-500 hover:bg-gray-100",!e&&(a?"text-white/30":"text-gray-400")),children:e||r})}function gg({value:e,onChange:t,isDark:a,placeholder:r="-",min:n,max:s,disabled:o=false,enableSlotMachine:l=true,enableSaveFlash:d=true}){let[i,u]=react.useState(false),[m,p]=react.useState(e?.toString()||""),g=react.useRef(null),{isFlashing:f,triggerFlash:x}=Yn(),{displayValue:y,isAnimating:b}=Zi(e,{enabled:l&&!i});react.useEffect(()=>{i&&g.current&&(g.current.focus(),g.current.select());},[i]),react.useEffect(()=>{p(e?.toString()||"");},[e]);let h=()=>{let w=parseFloat(m);if(!isNaN(w)){let D=w;n!==void 0&&(D=Math.max(n,D)),s!==void 0&&(D=Math.min(s,D)),D!==e&&(t?.(D),d&&x());}u(false);},v=w=>{w.key==="Enter"?h():w.key==="Escape"&&(p(e?.toString()||""),u(false));};return o||!t?jsxRuntime.jsx("span",{className:c("text-sm font-mono",a?"text-white/60":"text-gray-500",b&&"font-medium"),children:y!==void 0?y:r}):i?jsxRuntime.jsx("input",{ref:g,type:"number",value:m,onChange:w=>p(w.target.value),onBlur:h,onKeyDown:v,onClick:w=>w.stopPropagation(),min:n,max:s,className:c("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/[0.03] border-[#00E5CC] text-white":"bg-white border-[#00E5CC] text-gray-900")}):jsxRuntime.jsx("button",{onClick:w=>{w.stopPropagation(),u(true);},className:c("text-sm text-left w-full px-2 py-1 rounded transition-[background-color] duration-300",a?"text-white/60 hover:bg-white/[0.05]":"text-gray-500 hover:bg-gray-100",y===void 0&&(a?"text-white/30":"text-gray-400"),f&&(a?"bg-green-500/30":"bg-green-500/20"),b&&"font-medium scale-105"),children:y!==void 0?y:r})}function fg({value:e,options:t=[],onChange:a,isDark:r,placeholder:n="-",disabled:s=false}){let[o,l]=react.useState(false),d=react.useRef(null);return react.useEffect(()=>{let i=u=>{d.current&&!d.current.contains(u.target)&&l(false);};return o&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[o]),s||!a?jsxRuntime.jsx("span",{className:c("text-sm",r?"text-white/60":"text-gray-500"),children:e||n}):jsxRuntime.jsxs("div",{ref:d,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:i=>{i.stopPropagation(),l(!o);},className:c("flex items-center gap-2 px-2 py-1 rounded transition-colors min-w-[80px]",r?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{className:c("text-sm flex-1 text-left truncate",r?"text-white/60":"text-gray-500",!e&&(r?"text-white/30":"text-gray-400")),children:e||n}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-3 h-3 flex-shrink-0",r?"text-white/30":"text-gray-400")})]}),o&&jsxRuntime.jsx("div",{className:c("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px] max-h-48 overflow-y-auto",r?"bg-[#1A1A1A] border-[#222]":"bg-white border-gray-200"),children:t.length===0?jsxRuntime.jsx("p",{className:c("px-3 py-2 text-sm",r?"text-white/30":"text-gray-400"),children:"No options"}):t.map(i=>jsxRuntime.jsxs("button",{onClick:u=>{u.stopPropagation(),a(i),l(false);},className:c("w-full flex items-center justify-between gap-2 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/[0.05]":"hover:bg-gray-100",e===i&&(r?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:i}),e===i&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-[#00E5CC]"})]},i))})]})}function hg({value:e=false,onChange:t,isDark:a,disabled:r=false,enableDelayedConfirm:n=true,confirmDelay:s=1500}){let{pendingValue:o,isPending:l,progress:d,startChange:i,cancelChange:u}=sg(t,{delay:s}),m=g=>{g.stopPropagation(),!r&&t&&(n?l?u():i(!e):t(!e));},p=l?o:e;return jsxRuntime.jsxs("div",{className:"relative inline-flex items-center gap-1",children:[jsxRuntime.jsxs("button",{onClick:m,disabled:r||!t,className:c("relative w-5 h-5 rounded border-2 flex items-center justify-center transition-[border-color,background-color,box-shadow]",p?"bg-[#00E5CC] border-[#00E5CC]":a?"border-[#333] hover:border-[#6B7280]":"border-gray-300 hover:border-gray-400",(r||!t)&&"opacity-50 cursor-not-allowed",l&&"ring-2 ring-offset-1",l&&p&&"ring-green-500/50",l&&!p&&"ring-red-500/50",l&&(a?"ring-offset-[#050505]":"ring-offset-white")),children:[l&&jsxRuntime.jsx("svg",{className:"absolute inset-0 w-full h-full -rotate-90",viewBox:"0 0 20 20",children:jsxRuntime.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:p?"#22C55E":"#EF4444",strokeWidth:"2",strokeDasharray:`${d/100*50.26} 50.26`,className:"transition-all duration-100"})}),l?jsxRuntime.jsx(lucideReact.Loader2,{className:"w-3 h-3 text-white animate-spin"}):p?jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"}):null]}),l&&jsxRuntime.jsx("button",{onClick:g=>{g.stopPropagation(),u();},className:c("w-4 h-4 rounded-full flex items-center justify-center transition-colors",a?"bg-red-500/20 hover:bg-red-500/40 text-red-400":"bg-red-100 hover:bg-red-200 text-red-500"),title:"Cancelar",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]})}function vg({value:e=[],isDark:t,maxVisible:a=2}){if(e.length===0)return jsxRuntime.jsx("span",{className:c("text-sm",t?"text-white/30":"text-gray-400"),children:"-"});let r=e.slice(0,a),n=e.length-a;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[r.map(s=>jsxRuntime.jsx("span",{className:"inline-flex items-center px-2 py-0.5 text-[9px] font-mono uppercase tracking-wide rounded",style:{backgroundColor:s.color?`${s.color}20`:t?"rgba(255,255,255,0.05)":"#F3F4F6",color:s.color||(t?"rgba(255,255,255,0.5)":"#6B7280")},children:s.name},s.id)),n>0&&jsxRuntime.jsxs("span",{className:c("inline-flex items-center px-2 py-0.5 text-xs rounded-full",t?"bg-white/[0.05] text-white/60":"bg-gray-100 text-gray-500"),children:["+",n]})]})}function o1(e,t="en"){if(e==null||e===0||!e||Number(e)===0)return "-";let a=Math.floor(e/60),r=e%60;return a===0?`${r}m`:r===0?`${a}h`:`${a}h ${r}m`}function n1(e){let t=e.trim().toLowerCase();if(!t||t==="-")return null;let a=t.match(/^(\d+):(\d+)$/);if(a&&a[1]&&a[2]){let l=parseInt(a[1],10),d=parseInt(a[2],10);return l*60+d}let r=t.match(/^(\d+\.?\d*)\s*h\s*(\d+)?\s*(m|min)?$/);if(r&&r[1]){let l=parseFloat(r[1]),d=r[2]?parseInt(r[2],10):0;return Math.round(l*60)+d}let n=t.match(/^(\d+\.?\d*)\s*h$/);if(n&&n[1])return Math.round(parseFloat(n[1])*60);let s=t.match(/^(\d+)\s*(m|min)$/);if(s&&s[1])return parseInt(s[1],10);let o=parseFloat(t);return isNaN(o)?null:Math.round(o*60)}function Mr({value:e,onChange:t,isDark:a,locale:r="en",placeholder:n,disabled:s=false,enableSaveFlash:o=true,isBlurred:l=false,lens:d="hours",hourlyRate:i=0,financialOverride:u}){let[m,p]=react.useState(false),[g,f]=react.useState(""),x=react.useRef(null),{isFlashing:y,triggerFlash:b}=Yn(),h=d==="financial"&&(i>0||u!=null),v=u??(e?e/60*i:0),w=h&&(u!=null?u>0:e)?`$${Math.round(v).toLocaleString("en-US")}`:o1(e,r);react.useEffect(()=>{m&&x.current&&(x.current.focus(),x.current.select());},[m]),react.useEffect(()=>{if(e){let T=Math.floor(e/60),F=e%60;T>0&&F>0?f(`${T}h ${F}m`):T>0?f(`${T}h`):f(`${F}m`);}else f("");},[e,m]);let D=()=>{let T=n1(g);T!==e&&(t?.(T),o&&b()),p(false);},S=T=>{T.key==="Enter"?D():T.key==="Escape"&&p(false);};if(l)return jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",title:r==="es"?"No tienes permisos para ver este dato":"You don't have permission to view this data",children:[jsxRuntime.jsx(lucideReact.Clock,{className:c("w-3.5 h-3.5 flex-shrink-0",a?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm select-none blur-[4px] opacity-60 pointer-events-none",a?"text-white/60":"text-gray-500"),"aria-hidden":"true",children:"\u2022\u2022\u2022\u2022"})]});let M=h?lucideReact.DollarSign:lucideReact.Clock;return s||!t?!e||e===0?null:jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[jsxRuntime.jsx(M,{className:c("w-3.5 h-3.5 flex-shrink-0",a?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("text-sm font-mono",a?"text-white/60":"text-gray-500"),children:w})]}):m?jsxRuntime.jsx("input",{ref:x,type:"text",value:g,onChange:T=>f(T.target.value),onBlur:D,onKeyDown:S,onClick:T=>T.stopPropagation(),placeholder:"8 (=8h), 1h 30m",className:c("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/[0.03] border-[#00E5CC] text-white placeholder:text-white/30":"bg-white border-[#00E5CC] text-gray-900 placeholder:text-gray-400")}):jsxRuntime.jsxs("button",{onClick:T=>{T.stopPropagation(),p(true);},className:c("flex items-center justify-center gap-1 text-sm w-full px-1.5 py-1 rounded transition-[background-color] duration-300 overflow-hidden",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",e!=null&&e>0?a?"text-white/60":"text-gray-600":a?"text-white/30":"text-gray-400",y&&(a?"bg-green-500/30":"bg-green-500/20")),children:[e!=null&&e>0&&jsxRuntime.jsx(M,{className:c("w-3 h-3 flex-shrink-0",a?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:"truncate font-mono",children:w})]})}function Tg({startDate:e,endDate:t,scheduleVariance:a,isDark:r,locale:n="en",hasTimeAllocated:s=true}){if(!e&&!t)return jsxRuntime.jsx("span",{className:c("text-[11px] font-mono",r?"text-white/30":"text-gray-400"),children:"-"});let o=d=>d.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"short",day:"numeric"}),l=()=>{if(a==null)return null;let d=n==="es";return a===0?s?jsxRuntime.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#10B981",fontWeight:600},children:d?"En Tiempo":"On Track"}):jsxRuntime.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:r?"rgba(255,255,255,0.3)":"#94A3B8",fontWeight:500},children:d?"Tiempo no asignado":"No time allocated"}):a>0?jsxRuntime.jsxs("span",{className:"font-mono",style:{fontSize:"10px",color:"#3BF06E",fontWeight:600},children:["+",a,"d ",d?"Adelante":"Early"]}):jsxRuntime.jsxs("span",{className:"font-mono",style:{fontSize:"10px",color:"#F87171",fontWeight:600},children:[a,"d ",d?"Atraso":"Delay"]})};return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[jsxRuntime.jsxs("span",{className:c("text-[11px] font-mono",r?"text-white/60":"text-gray-500"),children:[e?o(e):"\u2014",jsxRuntime.jsx("span",{className:r?"text-white/20 mx-1":"text-gray-300 mx-1",children:"vs"}),t?o(t):"\u2014"]}),l()]})}function Dg({task:e,isDark:t,locale:a="en",onLogTime:r,onEstimateUpdate:n,onSoldEffortUpdate:s,onOpenTimeLog:o,lens:l="hours",hourlyRate:d=0}){let i=a==="es",u=l==="financial"&&d>0,m=K=>u?`$${Math.round(K*d).toLocaleString("en-US")}`:`${K}h`,[p,g]=react.useState(false),[f,x]=react.useState(false),[y,b]=react.useState(null),h=react.useRef(null),v=e.timeLoggedMinutes||0,w=e.effortMinutes||0,D=e.soldEffortMinutes||0,S=Math.round(v/60*10)/10,M=Math.round(w/60*10)/10,T=w>0?v/w*100:0,F=T>100?Math.round((v-w)/60*10)/10:0,A=T>100?"#EF4444":"#00E5CC";react.useEffect(()=>{if(!f&&!y)return;let K=V=>{h.current&&!h.current.contains(V.target)&&(x(false),b(null));};return document.addEventListener("mousedown",K),()=>document.removeEventListener("mousedown",K)},[f,y]);let C=K=>{if(K.stopPropagation(),r&&!n&&!s){b("log");return}if(r||n||s){x(V=>!V),b(null);return}o&&o(e);},_=K=>{x(false),b(K);},W=async(K,V)=>{y==="log"&&r&&K?r(e,K,V):y==="estimate"&&n?n(e,K):y==="quoted"&&s&&s(e,K),b(null);},oe=r||n||s||o,L=[{mode:"log",icon:lucideReact.Clock,label:i?"Registrar tiempo":"Log time",show:!!r},{mode:"estimate",icon:lucideReact.Target,label:i?"Estimaci\xF3n":"Estimate",show:!!n},{mode:"quoted",icon:lucideReact.DollarSign,label:i?"T. Ofertado":"Quoted time",show:!!s}].filter(K=>K.show),Y=y==="estimate"?w:y==="quoted"?D:void 0;return w===0&&v===0&&D===0?jsxRuntime.jsxs("div",{ref:h,className:"relative flex items-center gap-2",onClick:K=>K.stopPropagation(),onMouseEnter:()=>g(true),onMouseLeave:()=>g(false),children:[jsxRuntime.jsx("span",{className:c("text-[11px] font-mono",t?"text-white/30":"text-gray-400"),children:"\u2014"}),p&&oe&&jsxRuntime.jsx("button",{onClick:C,className:"flex items-center justify-center w-6 h-6 rounded-md transition-colors",style:{color:t?"rgba(255,255,255,0.35)":"#9CA3AF",backgroundColor:"transparent"},onMouseEnter:K=>{K.currentTarget.style.color=t?"rgba(255,255,255,0.8)":"#374151",K.currentTarget.style.backgroundColor=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:K=>{K.currentTarget.style.color=t?"rgba(255,255,255,0.35)":"#9CA3AF",K.currentTarget.style.backgroundColor="transparent";},title:i?"+ Tiempo":"+ Time",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:f&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.1},className:"absolute right-0 top-full mt-1 z-50",style:{background:t?"rgba(10,10,10,0.95)":"#FFFFFF",border:t?"1px solid rgba(255,255,255,0.10)":"1px solid #E5E7EB",borderRadius:8,boxShadow:t?"0 8px 32px rgba(0,0,0,0.6)":"0 8px 32px rgba(0,0,0,0.12)",backdropFilter:"blur(16px)",overflow:"hidden",minWidth:160},children:L.map(K=>jsxRuntime.jsxs("button",{onClick:V=>{V.stopPropagation(),_(K.mode);},className:"w-full flex items-center gap-2 px-3 py-2 text-left transition-colors",style:{fontSize:11,fontFamily:"'JetBrains Mono', monospace",color:t?"rgba(255,255,255,0.7)":"#374151",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:V=>{V.target.style.background=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:V=>{V.target.style.background="transparent";},children:[jsxRuntime.jsx(K.icon,{style:{width:12,height:12,flexShrink:0,opacity:.5}}),K.label]},K.mode))})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsx("div",{className:"absolute right-0 top-full mt-1 z-50",children:jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.12},children:jsxRuntime.jsx(io,{mode:y,locale:a,isDark:t,currentValue:Y||void 0,onSave:W,onClose:()=>b(null)})})})})]}):jsxRuntime.jsxs("div",{ref:h,className:"relative flex items-center gap-2 w-full",onClick:K=>K.stopPropagation(),onMouseEnter:()=>g(true),onMouseLeave:()=>g(false),children:[jsxRuntime.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",style:{padding:"8px 12px",borderRadius:"4px",border:t?"1px solid #333":"1px solid #E5E7EB",backgroundColor:t?"#1A1A1A":"#F9FAFB"},children:[(()=>{let K=v===0,B=(w>0?v/w:0)>1.1;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"font-mono",style:{fontSize:13,fontWeight:700,color:K?t?"#4B5563":"#9CA3AF":t?"#FFFFFF":"#111827"},children:m(S)}),w>0&&jsxRuntime.jsxs("span",{className:"font-mono",style:{fontSize:11,color:t?"rgba(255,255,255,0.3)":"#9CA3AF"},children:["/ ",m(M)]}),F>0&&jsxRuntime.jsxs("span",{className:"font-mono px-1.5 py-0.5 rounded",style:{fontSize:10,color:B?"#EF4444":t?"rgba(255,255,255,0.5)":"#6B7280",backgroundColor:B?"rgba(239,68,68,0.15)":"transparent"},children:["+",m(F)," ",i?"Excedido":"Over"]})]})})(),w>0&&jsxRuntime.jsx("div",{className:"w-full overflow-hidden",style:{height:3,backgroundColor:t?"#333":"#E5E7EB",borderRadius:2},children:jsxRuntime.jsx("div",{style:{height:"100%",width:`${Math.min(T,100)}%`,backgroundColor:A,borderRadius:2,transition:"width 0.3s"}})})]}),oe&&jsxRuntime.jsx("button",{onClick:C,className:"flex-shrink-0 flex items-center justify-center w-7 h-7 rounded-md transition-all duration-150",style:{opacity:p?1:0,pointerEvents:p?"auto":"none",color:t?"rgba(255,255,255,0.35)":"#9CA3AF",backgroundColor:"transparent",border:"none"},onMouseEnter:K=>{K.currentTarget.style.color=t?"rgba(255,255,255,0.8)":"#374151",K.currentTarget.style.backgroundColor=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:K=>{K.currentTarget.style.color=t?"rgba(255,255,255,0.35)":"#9CA3AF",K.currentTarget.style.backgroundColor="transparent";},title:i?"+ Tiempo":"+ Time",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:f&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.1},className:"absolute right-0 top-full mt-1 z-50",style:{background:t?"rgba(10,10,10,0.95)":"#FFFFFF",border:t?"1px solid rgba(255,255,255,0.10)":"1px solid #E5E7EB",borderRadius:8,boxShadow:t?"0 8px 32px rgba(0,0,0,0.6)":"0 8px 32px rgba(0,0,0,0.12)",backdropFilter:"blur(16px)",overflow:"hidden",minWidth:160},children:L.map(K=>jsxRuntime.jsxs("button",{onClick:V=>{V.stopPropagation(),_(K.mode);},className:"w-full flex items-center gap-2 px-3 py-2 text-left transition-colors",style:{fontSize:11,fontFamily:"'JetBrains Mono', monospace",color:t?"rgba(255,255,255,0.7)":"#374151",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:V=>{V.target.style.background=t?"rgba(255,255,255,0.06)":"#F3F4F6";},onMouseLeave:V=>{V.target.style.background="transparent";},children:[jsxRuntime.jsx(K.icon,{style:{width:12,height:12,flexShrink:0,opacity:.5}}),K.label]},K.mode))})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsx("div",{className:"absolute right-0 top-full mt-1 z-50",children:jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-4},transition:{duration:.12},children:jsxRuntime.jsx(io,{mode:y,locale:a,isDark:t,currentValue:Y||void 0,onSave:W,onClose:()=>b(null)})})})})]})}function p1(e){let t=new Map;function a(r){if(r.assignees)for(let n of r.assignees)n.name&&!t.has(n.name)&&t.set(n.name,n);if(r.subtasks)for(let n of r.subtasks)a(n);}return a(e),Array.from(t.values())}function m1(e){return e>100?{bg:"rgba(239,68,68,0.15)",text:"#EF4444"}:e>=86?{bg:"rgba(245,158,11,0.15)",text:"#F59E0B"}:e>=61?{bg:"rgba(0,229,204,0.15)",text:"#00E5CC"}:{bg:"rgba(34,197,94,0.15)",text:"#22C55E"}}function Sg({assignee:e,size:t=28,isDark:a}){let r=t===28?"w-7 h-7":t===24?"w-6 h-6":"w-5 h-5",n=t===28?"text-[10px]":"text-[9px]";return e.avatar?jsxRuntime.jsx("img",{src:e.avatar,alt:e.name,className:c(r,"rounded-full object-cover ring-1 flex-shrink-0",a?"ring-white/10":"ring-gray-200")}):jsxRuntime.jsx("div",{className:c(r,"rounded-full flex items-center justify-center font-bold text-white ring-1 flex-shrink-0",n,a?"ring-white/10":"ring-gray-200"),style:{backgroundColor:e.color||"#6B7280"},children:e.initials||e.name?.charAt(0)?.toUpperCase()||"?"})}function Eg({task:e,isDark:t,locale:a="en"}){let r=a==="es",n=!!e.hasChildren,s=e.assignees?.[0],o=e.teamLoad;if(n){let u=p1(e);if(u.length===0)return null;let m=u.slice(0,3),p=u.length-3;return jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("div",{className:"flex -space-x-2",children:m.map((g,f)=>jsxRuntime.jsx(Sg,{assignee:g,size:24,isDark:t},g.name+f))}),p>0&&jsxRuntime.jsxs("span",{className:c("ml-1 text-[10px] font-mono",t?"text-white/40":"text-gray-400"),title:u.slice(3).map(g=>g.name).join(", "),children:["+",p]})]})}if(!s)return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:c("w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0",t?"bg-white/5":"bg-gray-100"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5",style:{color:"#4B5563"}})}),jsxRuntime.jsx("span",{className:c("text-[11px]",t?"text-white/30":"text-gray-400"),children:r?"Sin asignar":"Unassigned"})]});let l=o?.percentage??0,d=!!o&&l>0,i=d?m1(l):null;return jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Sg,{assignee:s,size:28,isDark:t}),jsxRuntime.jsx("span",{className:c("text-[13px] truncate",t?"text-white":"text-gray-900"),style:{maxWidth:"100px"},children:s.name})]}),d&&i&&jsxRuntime.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono uppercase tracking-wide w-fit font-semibold",style:{backgroundColor:i.bg,color:i.text},children:[l,"% LOAD"]})]})}var g1={critical:"bg-[#FF2D20]/15 text-[#FF2D20]",warning:"bg-[#FFD60A]/15 text-[#FFD60A]",info:"bg-[#3B9EFF]/15 text-[#3B9EFF]"};function Pg({blockers:e,isDark:t,locale:a="en"}){return !e||e.length===0?jsxRuntime.jsx("span",{className:c("text-[9px] font-mono uppercase tracking-wide",t?"text-white/20":"text-gray-400"),children:a==="es"?"Ninguno":"None"}):jsxRuntime.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:e.map((r,n)=>jsxRuntime.jsxs("span",{className:c("px-1.5 py-0.5 rounded text-[9px] font-mono uppercase tracking-wide whitespace-nowrap",g1[r.severity]),children:[r.type," #",r.id]},`${r.type}-${r.id}-${n}`))})}function M1(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function P1(e){let t=["blue","green","purple","pink","yellow","red","indigo","teal"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"blue"}function Rg({state:e,onClose:t,isDark:a,locale:r,onTaskEdit:n,onTaskDuplicate:s,onTaskDelete:o,onTaskUpdate:l,onColumnHide:d,onColumnSort:i,availableUsers:u=[],onOpenTimeLog:m,onReportBlocker:p,onCopyTaskLink:g,onTaskMove:f,onTaskIndent:x,onTaskOutdent:y}){let b=react.useRef(null),h=r==="es"?Lg.es:Lg.en;if(react.useEffect(()=>{let M=F=>{b.current&&!b.current.contains(F.target)&&t();},T=F=>{F.key==="Escape"&&t();};return document.addEventListener("mousedown",M),document.addEventListener("keydown",T),()=>{document.removeEventListener("mousedown",M),document.removeEventListener("keydown",T);}},[t]),!e.isOpen)return null;let v=()=>{if(!e.task)return [];let M=[];return n&&M.push({id:"edit",label:h.edit,icon:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),onClick:()=>{n(e.task),t();}}),M.push({id:"sep1",label:"",icon:null,separator:true}),l&&(M.push({id:"status",label:h.changeStatus,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),submenu:[{id:"status-todo",label:h.todo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4 text-gray-400"}),onClick:()=>{l({...e.task,status:"todo",progress:0}),t();}},{id:"status-in-progress",label:h.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4 text-[#00E5CC]"}),onClick:()=>{l({...e.task,status:"in-progress",progress:e.task.progress||50}),t();}},{id:"status-completed",label:h.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4 text-green-500"}),onClick:()=>{l({...e.task,status:"completed",progress:100}),t();}}]}),M.push({id:"priority",label:h.changePriority,icon:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),submenu:[{id:"priority-urgent",label:h.urgent,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),onClick:()=>{l({...e.task,priority:"urgent"}),t();}},{id:"priority-high",label:h.high,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-orange-500"}),onClick:()=>{l({...e.task,priority:"high"}),t();}},{id:"priority-medium",label:h.medium,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),onClick:()=>{l({...e.task,priority:"medium"}),t();}},{id:"priority-low",label:h.low,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-[#00E5CC]"}),onClick:()=>{l({...e.task,priority:"low"}),t();}}]}),u.length>0&&M.push({id:"assign",label:h.assignUser,icon:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),submenu:u.slice(0,5).map(T=>({id:`assign-${T.id}`,label:T.name,icon:jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] text-white bg-[#00E5CC]",children:T.name.charAt(0).toUpperCase()}),onClick:()=>{let F=e.task.assignees||[],C=F.some(_=>_.name===T.name)?F.filter(_=>_.name!==T.name):[...F,{name:T.name,initials:M1(T.name),color:T.color||P1(T.name),avatar:T.avatarUrl}];l({...e.task,assignees:C}),t();}}))})),m&&M.push({id:"log-time",label:h.logTime,icon:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),onClick:()=>{m(e.task),t();}}),p&&M.push({id:"report-blocker",label:h.reportBlocker,icon:jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-4 h-4"}),onClick:()=>{p(e.task),t();}}),g&&M.push({id:"copy-link",label:h.copyLink,icon:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),onClick:()=>{g(e.task),t();}}),M.push({id:"sep2",label:"",icon:null,separator:true}),s&&M.push({id:"duplicate",label:h.duplicate,icon:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),onClick:()=>{s(e.task),t();}}),(f||x||y)&&(M.push({id:"sep3",label:"",icon:null,separator:true}),f&&(M.push({id:"move-up",label:h.moveUp,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{f(e.task.id,"up"),t();}}),M.push({id:"move-down",label:h.moveDown,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{f(e.task.id,"down"),t();}})),x&&M.push({id:"indent",label:h.indent,icon:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"}),onClick:()=>{x(e.task.id),t();}}),y&&M.push({id:"outdent",label:h.outdent,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4 -rotate-90"}),onClick:()=>{y(e.task.id),t();}})),o&&M.push({id:"delete",label:h.delete,icon:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),danger:true,onClick:()=>{o(e.task.id),t();}}),M},w=()=>{if(!e.columnId)return [];let M=[];return i&&(M.push({id:"sort-asc",label:h.sortAsc,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"asc"),t();}}),M.push({id:"sort-desc",label:h.sortDesc,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"desc"),t();}})),d&&e.columnId!=="name"&&(M.push({id:"sep-hide",label:"",icon:null,separator:true}),M.push({id:"hide",label:h.hideColumn,icon:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),onClick:()=>{d(e.columnId),t();}})),M},D=e.type==="task"?v():w(),S={position:"fixed",left:e.x,top:e.y,zIndex:9999};return jsxRuntime.jsx("div",{ref:b,style:S,className:c("py-1 rounded-lg shadow-xl border min-w-[180px]",a?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:D.map(M=>M.separator?jsxRuntime.jsx("div",{className:c("my-1 h-px",a?"bg-white/[0.05]":"bg-gray-200")},M.id):M.submenu?jsxRuntime.jsx(F1,{item:M,isDark:a},M.id):jsxRuntime.jsxs("button",{onClick:M.onClick,className:c("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/[0.05]":"hover:bg-gray-100",M.danger?"text-red-500 hover:text-red-600":a?"text-white":"text-gray-700"),children:[jsxRuntime.jsx("span",{className:c(M.danger?"text-red-500":a?"text-white/60":"text-gray-400"),children:M.icon}),M.label]},M.id))})}function F1({item:e,isDark:t}){let[a,r]=react.useState(false),n=react.useRef();return jsxRuntime.jsxs("div",{className:"relative",onMouseEnter:()=>{n.current&&clearTimeout(n.current),r(true);},onMouseLeave:()=>{n.current=setTimeout(()=>r(false),150);},children:[jsxRuntime.jsxs("button",{className:c("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/[0.05] text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-white/60":"text-gray-400",children:e.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:e.label}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:c("w-4 h-4",t?"text-white/30":"text-gray-400")})]}),a&&e.submenu&&jsxRuntime.jsx("div",{className:c("absolute left-full top-0 ml-1 py-1 rounded-lg shadow-xl border min-w-[160px]",t?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:e.submenu.map(l=>jsxRuntime.jsxs("button",{onClick:l.onClick,className:c("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/[0.05] text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-white/60":"text-gray-400",children:l.icon}),l.label]},l.id))})]})}var Lg={en:{edit:"Edit",changeStatus:"Change status",changePriority:"Change priority",assignUser:"Assign user",duplicate:"Duplicate",moveUp:"Move up",moveDown:"Move down",indent:"Make subtask",outdent:"Remove from parent",delete:"Delete",todo:"To Do",inProgress:"In Progress",completed:"Completed",urgent:"Urgent",high:"High",medium:"Medium",low:"Low",sortAsc:"Sort A \u2192 Z",sortDesc:"Sort Z \u2192 A",hideColumn:"Hide column",logTime:"Log Time",reportBlocker:"Report Blocker",copyLink:"Copy Link"},es:{edit:"Editar",changeStatus:"Cambiar estado",changePriority:"Cambiar prioridad",assignUser:"Asignar usuario",duplicate:"Duplicar",moveUp:"Mover arriba",moveDown:"Mover abajo",indent:"Convertir en subtarea",outdent:"Sacar de subtarea",delete:"Eliminar",todo:"Pendiente",inProgress:"En Progreso",completed:"Completado",urgent:"Urgente",high:"Alta",medium:"Media",low:"Baja",sortAsc:"Ordenar A \u2192 Z",sortDesc:"Ordenar Z \u2192 A",hideColumn:"Ocultar columna",logTime:"Registrar Tiempo",reportBlocker:"Reportar Bloqueante",copyLink:"Copiar Enlace"}};var Gg={name:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),status:jsxRuntime.jsx(lucideReact.CircleDot,{className:"w-4 h-4"}),priority:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),assignees:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),startDate:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),endDate:jsxRuntime.jsx(lucideReact.CalendarCheck,{className:"w-4 h-4"}),progress:jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"}),tags:jsxRuntime.jsx(lucideReact.Tag,{className:"w-4 h-4"}),estimatedTime:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),quotedTime:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),elapsedTime:jsxRuntime.jsx(lucideReact.Timer,{className:"w-4 h-4"}),effortMinutes:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),timeLoggedMinutes:jsxRuntime.jsx(lucideReact.Timer,{className:"w-4 h-4"}),soldEffortMinutes:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),scheduleVariance:jsxRuntime.jsx(lucideReact.CalendarClock,{className:"w-4 h-4"}),hoursBar:jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),teamLoad:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),blockers:jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-4 h-4"}),weight:jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"}),text:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),number:jsxRuntime.jsx(lucideReact.Hash,{className:"w-4 h-4"}),date:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),dropdown:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}),checkbox:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-4 h-4"})},q1=["name","status","priority","startDate","endDate","progress","tags","effortMinutes","timeLoggedMinutes","soldEffortMinutes","weight"];function _g({isOpen:e,onClose:t,columns:a,customFields:r=[],onColumnsChange:n,onCreateCustomField:s,isDark:o,locale:l}){let[d,i]=react.useState(""),[u,m]=react.useState(null),[p,g]=react.useState(null),f=react.useRef(null),x=l==="es"?jg.es:jg.en;react.useLayoutEffect(()=>{if(!e||!f.current)return;let M=()=>{if(!f.current)return;let T=f.current.parentElement;if(T){let _=T.getBoundingClientRect();g({top:_.bottom+4,right:window.innerWidth-_.right});}let F=f.current.getBoundingClientRect(),C=window.innerHeight-F.top-20;m(Math.max(300,C));};return requestAnimationFrame(M),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[e]),react.useEffect(()=>{if(!e)return;let M=setTimeout(()=>{let T=A=>{f.current&&!f.current.contains(A.target)&&t();},F=A=>{A.key==="Escape"&&t();};document.addEventListener("mousedown",T),document.addEventListener("keydown",F),f._cleanup=()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",F);};},100);return ()=>{clearTimeout(M),f._cleanup&&f._cleanup();}},[e,t]);let y=react.useMemo(()=>{let M=new Set([...q1]);return a.forEach(T=>{T.type&&T.type!=="assignees"&&M.add(T.type);}),Array.from(M)},[a]);if(!e)return null;let b=M=>{let T=x.columns[M];if(T)return T;let F=a.find(A=>A.type===M);return F?.label?F.label:M},h=M=>{if(M==="name")return;let T=a.map(F=>F.id===M?{...F,visible:!F.visible}:F);n(T);},v=(M,T)=>{let F=a.find(C=>C.type===M&&(!T||C.customFieldId===T));if(F){h(F.id);return}let A={id:T||M,type:M,label:T?r.find(C=>C.id===T)?.name||M:b(M),width:120,visible:true,sortable:true,resizable:true,customFieldId:T};n([...a,A]);},w=y.filter(M=>M!=="assignees"&&b(M).toLowerCase().includes(d.toLowerCase())),D=r.filter(M=>M.name.toLowerCase().includes(d.toLowerCase())),S=o?"#00E5FF":"#00E5CC";return jsxRuntime.jsxs("div",{ref:f,style:{...u?{maxHeight:`${u}px`}:{},...p?{top:p.top,right:p.right}:{},background:o?"#111114":"#FFFFFF",border:`1px solid ${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.08)"}`,boxShadow:o?"0 8px 32px rgba(0,0,0,0.7)":"0 8px 32px rgba(0,0,0,0.12)",zIndex:99999},className:"fixed w-64 rounded-xl flex flex-col",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5",style:{borderBottom:`1px solid ${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`},children:[jsxRuntime.jsx("span",{style:{fontSize:10,fontWeight:600,letterSpacing:"0.08em",color:o?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.35)",fontFamily:"JetBrains Mono, monospace"},children:x.title.toUpperCase()}),jsxRuntime.jsx("button",{onClick:t,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors",style:{color:o?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"},onMouseEnter:M=>{M.currentTarget.style.backgroundColor=o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",M.currentTarget.style.color=o?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.6)";},onMouseLeave:M=>{M.currentTarget.style.backgroundColor="transparent",M.currentTarget.style.color=o?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)";},children:jsxRuntime.jsx(lucideReact.X,{className:"w-3.5 h-3.5"})})]}),jsxRuntime.jsx("div",{className:"px-3 py-2",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5",style:{color:o?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.25)"}}),jsxRuntime.jsx("input",{type:"text",value:d,onChange:M=>i(M.target.value),placeholder:x.searchPlaceholder,style:{fontSize:12,background:o?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)",border:`1px solid ${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,color:o?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.8)"},className:"w-full pl-8 pr-3 py-1.5 rounded-lg outline-none placeholder:opacity-40 transition-colors focus:border-[var(--focus-border)]",ref:M=>{M&&M.style.setProperty("--focus-border",S);},onFocus:M=>{M.currentTarget.style.borderColor=S,M.currentTarget.style.background=o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)";},onBlur:M=>{M.currentTarget.style.borderColor=o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)",M.currentTarget.style.background=o?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)";}})]})}),jsxRuntime.jsxs("div",{className:"overflow-y-auto flex-1 min-h-0 overscroll-contain px-2 pb-2",onWheel:M=>M.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"mb-1",children:[jsxRuntime.jsx("div",{className:"px-1.5 py-1.5",style:{fontSize:9,fontWeight:600,letterSpacing:"0.1em",color:o?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.3)",fontFamily:"JetBrains Mono, monospace"},children:x.standardFields.toUpperCase()}),jsxRuntime.jsx("div",{className:"space-y-px",children:w.map(M=>{let T=a.find(C=>C.type===M&&!C.customFieldId),F=T?.visible??false,A=M==="name";return jsxRuntime.jsxs("button",{onClick:()=>{A||(T?h(T.id):v(M));},disabled:A,className:"w-full flex items-center gap-2.5 px-2 py-[5px] rounded-md transition-colors",style:{opacity:A?.4:1,cursor:A?"not-allowed":"pointer"},onMouseEnter:C=>{A||(C.currentTarget.style.backgroundColor=o?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.04)");},onMouseLeave:C=>{C.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center flex-shrink-0 transition-all",style:{background:F?S:"transparent",border:F?`1.5px solid ${S}`:`1.5px solid ${o?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`,boxShadow:F?`0 0 6px ${S}40`:"none"},children:F&&jsxRuntime.jsx(lucideReact.Check,{className:"w-2.5 h-2.5 text-white",strokeWidth:3})}),jsxRuntime.jsx("span",{className:"flex-shrink-0 [&>svg]:w-3.5 [&>svg]:h-3.5",style:{color:F?S:o?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"},children:Gg[M]}),jsxRuntime.jsx("span",{className:"truncate",style:{fontSize:12,fontWeight:F?500:400,color:F?o?"rgba(255,255,255,0.9)":"rgba(0,0,0,0.85)":o?"rgba(255,255,255,0.55)":"rgba(0,0,0,0.5)",maxWidth:"160px"},title:b(M),children:b(M)})]},M)})})]}),D.length>0&&jsxRuntime.jsxs("div",{className:"mt-1",children:[jsxRuntime.jsx("div",{className:"px-1.5 py-1.5",style:{fontSize:9,fontWeight:600,letterSpacing:"0.1em",color:o?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.3)",fontFamily:"JetBrains Mono, monospace",borderTop:`1px solid ${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,paddingTop:8,marginTop:4},children:x.customFields.toUpperCase()}),jsxRuntime.jsx("div",{className:"space-y-px",children:D.map(M=>{let F=a.find(A=>A.customFieldId===M.id)?.visible??false;return jsxRuntime.jsxs("button",{onClick:()=>v(M.type,M.id),className:"w-full flex items-center gap-2.5 px-2 py-[5px] rounded-md transition-colors",onMouseEnter:A=>{A.currentTarget.style.backgroundColor=o?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.04)";},onMouseLeave:A=>{A.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center flex-shrink-0 transition-all",style:{background:F?S:"transparent",border:F?`1.5px solid ${S}`:`1.5px solid ${o?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.15)"}`,boxShadow:F?`0 0 6px ${S}40`:"none"},children:F&&jsxRuntime.jsx(lucideReact.Check,{className:"w-2.5 h-2.5 text-white",strokeWidth:3})}),jsxRuntime.jsx("span",{className:"flex-shrink-0 [&>svg]:w-3.5 [&>svg]:h-3.5",style:{color:F?S:o?"rgba(255,255,255,0.3)":"rgba(0,0,0,0.3)"},children:Gg[M.type]||jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"})}),jsxRuntime.jsx("span",{style:{fontSize:12,fontWeight:F?500:400,color:F?o?"rgba(255,255,255,0.9)":"rgba(0,0,0,0.85)":o?"rgba(255,255,255,0.55)":"rgba(0,0,0,0.5)"},children:M.name})]},M.id)})})]})]})]})}var jg={en:{title:"Columns",searchPlaceholder:"Search fields...",standardFields:"Standard Fields",customFields:"Custom Fields",columns:{name:"Name",status:"Status",priority:"Priority",startDate:"Start Date",endDate:"End Date",progress:"Progress",tags:"Tags",estimatedTime:"Estimated",quotedTime:"Quoted",elapsedTime:"Time Spent",soldEffortMinutes:"Quoted",effortMinutes:"Estimated",timeLoggedMinutes:"Executed",text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox",weight:"Weight"}},es:{title:"Columnas",searchPlaceholder:"Buscar campos...",standardFields:"Campos Est\xE1ndar",customFields:"Campos Personalizados",columns:{name:"Nombre",status:"Estado",priority:"Prioridad",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",tags:"Etiquetas",estimatedTime:"Estimado",quotedTime:"Ofertado",elapsedTime:"Ejecutado",soldEffortMinutes:"Ofertado",effortMinutes:"Estimado",timeLoggedMinutes:"Ejecutado",text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla",weight:"Peso"}}};var rw=[{type:"text",icon:jsxRuntime.jsx(lucideReact.Type,{className:"w-5 h-5"})},{type:"number",icon:jsxRuntime.jsx(lucideReact.Hash,{className:"w-5 h-5"})},{type:"date",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-5 h-5"})},{type:"dropdown",icon:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-5 h-5"})},{type:"checkbox",icon:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-5 h-5"})}];function Yg({isOpen:e,onClose:t,onSave:a,isDark:r,locale:n}){let[s,o]=react.useState(""),[l,d]=react.useState("text"),[i,u]=react.useState([""]),m=n==="es"?qg.es:qg.en;react.useEffect(()=>{e&&(o(""),d("text"),u([""]));},[e]),react.useEffect(()=>{let y=b=>{b.key==="Escape"&&t();};return e&&document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,t]);let p=()=>{if(!s.trim())return;let y={name:s.trim(),type:l};l==="dropdown"&&(y.options=i.filter(b=>b.trim())),a(y),t();},g=()=>{u([...i,""]);},f=(y,b)=>{let h=[...i];h[y]=b,u(h);},x=y=>{i.length>1&&u(i.filter((b,h)=>h!==y));};return e?jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),jsxRuntime.jsxs("div",{className:c("relative w-full max-w-md rounded-xl shadow-2xl border",r?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:c("flex items-center justify-between px-6 py-4 border-b",r?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h2",{className:c("text-lg font-semibold",r?"text-white":"text-gray-900"),children:m.title}),jsxRuntime.jsx("button",{onClick:t,className:c("p-1 rounded",r?"hover:bg-white/[0.05]":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:c("w-5 h-5",r?"text-white/60":"text-gray-400")})})]}),jsxRuntime.jsxs("div",{className:"p-6 space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:c("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:m.fieldName}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:y=>o(y.target.value),placeholder:m.fieldNamePlaceholder,className:c("w-full px-4 py-2.5 rounded-lg border outline-none focus:ring-2 focus:ring-[#00E5CC]/30",r?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),autoFocus:true})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:c("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:m.fieldType}),jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-2",children:rw.map(y=>jsxRuntime.jsxs("button",{onClick:()=>d(y.type),className:c("flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors",l===y.type?"border-[#00E5CC] bg-[#00E5CC]/10":r?"border-[#222] hover:border-white/20":"border-gray-200 hover:border-gray-300"),children:[jsxRuntime.jsx("span",{className:l===y.type?"text-[#00E5CC]":r?"text-white/60":"text-gray-400",children:y.icon}),jsxRuntime.jsx("span",{className:c("text-xs",l===y.type?"text-[#00E5CC]":r?"text-white/60":"text-gray-500"),children:m.types[y.type]})]},y.type))})]}),l==="dropdown"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:c("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:m.options}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[i.map((y,b)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:y,onChange:h=>f(b,h.target.value),placeholder:`${m.option} ${b+1}`,className:c("flex-1 px-3 py-2 rounded-lg border outline-none focus:ring-2 focus:ring-[#00E5CC]/30",r?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")}),i.length>1&&jsxRuntime.jsx("button",{onClick:()=>x(b),className:c("p-2 rounded-lg transition-colors",r?"hover:bg-white/[0.05] text-white/60":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},b)),jsxRuntime.jsxs("button",{onClick:g,className:c("flex items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors",r?"text-[#00E5CC] hover:bg-white/[0.05]":"text-[#00C4AE] hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),m.addOption]})]})]})]}),jsxRuntime.jsxs("div",{className:c("flex items-center justify-end gap-3 px-6 py-4 border-t",r?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("button",{onClick:t,className:c("px-4 py-2 text-sm font-medium rounded-lg transition-colors",r?"text-white/60 hover:bg-white/[0.05]":"text-gray-600 hover:bg-gray-100"),children:m.cancel}),jsxRuntime.jsx("button",{onClick:p,disabled:!s.trim(),className:c("px-4 py-2 text-sm font-medium rounded-lg transition-colors","bg-[#00E5CC] text-white hover:bg-[#005FCC]",!s.trim()&&"opacity-50 cursor-not-allowed"),children:m.create})]})]})]}):null}var qg={en:{title:"Create Custom Field",fieldName:"Field Name",fieldNamePlaceholder:"Enter field name...",fieldType:"Field Type",options:"Options",option:"Option",addOption:"Add option",cancel:"Cancel",create:"Create Field",types:{text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Crear Campo Personalizado",fieldName:"Nombre del Campo",fieldNamePlaceholder:"Ingresa el nombre...",fieldType:"Tipo de Campo",options:"Opciones",option:"Opci\xF3n",addOption:"Agregar opci\xF3n",cancel:"Cancelar",create:"Crear Campo",types:{text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var Qg={en:{filters:"Filters",filterByStatus:"FILTER BY STATUS",showAll:"Show All",completed:"Completed",inProgress:"In Progress",toDo:"To Do / Pending",hideCompleted:"Hide Completed Tasks"},es:{filters:"Filtros",filterByStatus:"FILTRAR POR ESTADO",showAll:"Mostrar Todo",completed:"Completadas",inProgress:"En Progreso",toDo:"Por Hacer / Pendiente",hideCompleted:"Ocultar Tareas Completadas"}};function Zg({value:e,hideCompleted:t,onChange:a,onHideCompletedChange:r,isDark:n,locale:s}){let[o,l]=react.useState(false),d=react.useRef(null),i=react.useRef(0),u=s==="es"?Qg.es:Qg.en;react.useEffect(()=>{if(!o)return;let g=x=>{Date.now()-i.current<100||d.current&&!d.current.contains(x.target)&&l(false);},f=x=>{x.key==="Escape"&&l(false);};return document.addEventListener("mousedown",g),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",f);}},[o]);let m=[{value:"all",label:u.showAll,icon:jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}),color:"text-[#00E5CC]"},{value:"completed",label:u.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),color:"text-green-500"},{value:"in-progress",label:u.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),color:"text-[#00E5CC]"},{value:"todo",label:u.toDo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),color:"text-gray-400"}],p=e!=="all"||t;return jsxRuntime.jsxs("div",{ref:d,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:g=>{g.stopPropagation(),o||(i.current=Date.now()),l(f=>!f);},className:c("flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] font-medium transition-all border",n?"border-[#222] hover:bg-white/[0.05] text-white/70":"border-gray-200 hover:bg-gray-100 text-gray-700",p&&(n?"bg-[#00E5CC]/20 border-[#00E5CC]/50 text-[#00E5CC]":"bg-[#00E5CC]/15 border-[#00E5CC]/15 text-[#00C4AE]"),o&&(n?"bg-white/[0.05]":"bg-gray-100")),style:{fontFamily:"Inter, sans-serif"},children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),u.filters,p&&jsxRuntime.jsx("span",{className:c("w-2 h-2 rounded-full","bg-[#00E5CC]")})]}),o&&jsxRuntime.jsxs("div",{className:c("absolute left-0 top-full mt-2 w-72 rounded-lg shadow-xl border z-50",n?"bg-[#0D0D0D] border-[#222]":"bg-white border-gray-200"),children:[jsxRuntime.jsx("div",{className:c("px-4 py-3 border-b",n?"border-[#222]":"border-gray-200"),children:jsxRuntime.jsx("span",{className:c("text-xs font-medium uppercase tracking-wider",n?"text-white/30":"text-gray-400"),children:u.filterByStatus})}),jsxRuntime.jsx("div",{className:"py-2",children:m.map(g=>{let f=e===g.value&&!t,x=()=>g.value==="all"?f?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}):jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-400"}):g.icon;return jsxRuntime.jsxs("button",{onClick:()=>{a(g.value),r(false),l(false);},className:c("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",n?"hover:bg-white/[0.05]":"hover:bg-gray-100",f&&(n?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:c(f?g.color:"text-gray-400","flex-shrink-0"),children:x()}),jsxRuntime.jsx("span",{className:c("flex-1 text-left whitespace-nowrap",n?"text-white":"text-gray-900"),children:g.label}),f&&jsxRuntime.jsx(lucideReact.Check,{className:c("w-4 h-4 flex-shrink-0","text-[#00E5CC]")})]},g.value)})}),jsxRuntime.jsx("div",{className:c("my-2 mx-4 h-px",n?"bg-white/[0.05]":"bg-gray-200")}),jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs("button",{onClick:()=>{let g=!t;r(g),g&&a("all"),l(false);},className:c("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",n?"hover:bg-white/[0.05]":"hover:bg-gray-100",t&&(n?"bg-white/[0.03]":"bg-gray-50")),children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:c("w-4 h-4 flex-shrink-0",t?"text-[#00E5CC]":n?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("span",{className:c("flex-1 text-left whitespace-nowrap",n?"text-white":"text-gray-900"),children:u.hideCompleted}),t&&jsxRuntime.jsx(lucideReact.Check,{className:c("w-4 h-4 flex-shrink-0","text-[#00E5CC]")})]})})]})]})}function e0(e){if(e<=0)return "0h";let t=Math.floor(e/60),a=e%60;return a>0?`${t}h ${a}m`:`${t}h`}function hn(e){return `$${Math.round(e).toLocaleString("es-CO")}`}function t0({data:e,isDark:t,locale:a="en",onClose:r,lens:n="hours",onUnassignedTaskClick:s}){let o=a==="es",l=n==="financial";return jsxRuntime.jsxs("div",{className:c("w-[260px] xl:w-[320px] flex-shrink-0 overflow-y-auto border-l",t?"bg-[#141414] border-[#222]":"bg-gray-50 border-gray-200"),children:[jsxRuntime.jsxs("div",{className:c("px-5 py-4 border-b flex items-center justify-between",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:c("text-[11px] font-mono uppercase tracking-wider font-bold",t?"text-white/60":"text-gray-600"),children:l?o?"SALUD FINANCIERA":"FINANCIAL HEALTH":o?"SALUD DEL PROYECTO":"PROJECT HEALTH"}),r&&jsxRuntime.jsx("button",{onClick:r,className:c("p-1 rounded transition-colors",t?"text-white/30 hover:text-white/60 hover:bg-white/[0.05]":"text-gray-400 hover:text-gray-600 hover:bg-gray-200"),title:o?"Cerrar panel":"Close panel",children:jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 1l10 10M11 1L1 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),l&&(e.totalOffered!==void 0||e.totalEstimated!==void 0)&&(()=>{let d=e.totalOffered??0,i=e.totalEstimated??0,u=e.totalExecuted??0,m=d-u,p=d>0?Math.round(m/d*100):0,g=d>0?Math.min(Math.round(u/d*100),120):0,f=u>d&&d>0,x=f?"#F87171":"#00E5CC";return jsxRuntime.jsxs("div",{className:c("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:c("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:o?"PRESUPUESTO":"BUDGET"}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"V. Oferta":"Offered Value"}),jsxRuntime.jsx("span",{className:c("text-[11px] font-mono font-bold",t?"text-white/80":"text-gray-800"),children:hn(d)})]}),(()=>{let y=e.totalEstimatedLabor??0,b=e.totalEstimatedEquipment??0,h=e.totalEstimatedTravel??0,v=b>0||h>0,w=(D,S)=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between pl-3",children:[jsxRuntime.jsx("span",{className:c("text-[10px]",t?"text-white/40":"text-gray-400"),children:D}),jsxRuntime.jsx("span",{className:c("text-[10px] font-mono",t?"text-white/55":"text-gray-500"),children:hn(S)})]});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"Estimado":"Estimated"}),jsxRuntime.jsx("span",{className:c("text-[11px] font-mono font-bold",t?"text-white/80":"text-gray-800"),children:hn(i)})]}),v&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[w(o?"Mano de obra":"Labor",y),b>0&&w(o?"Activos":"Equipment",b),h>0&&w(o?"Vi\xE1ticos":"Travel",h)]})]})})(),u>0&&(()=>{let y=e.totalExecutedLabor??0,b=e.totalExecutedEquipment??0,h=e.totalExecutedTravel??0,v=b>0||h>0,w=(D,S)=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between pl-3",children:[jsxRuntime.jsx("span",{className:c("text-[10px]",t?"text-white/40":"text-gray-400"),children:D}),jsxRuntime.jsx("span",{className:c("text-[10px] font-mono",t?"text-white/55":"text-gray-500"),children:hn(S)})]});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"Ejecutado":"Executed"}),jsxRuntime.jsx("span",{className:c("text-[11px] font-mono font-bold",f?"text-[#F87171]":t?"text-white/80":"text-gray-800"),children:hn(u)})]}),v&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[w(o?"Mano de obra":"Labor",y),b>0&&w(o?"Activos":"Equipment",b),h>0&&w(o?"Vi\xE1ticos":"Travel",h)]})]})})(),d>0&&jsxRuntime.jsx("div",{className:c("w-full h-2.5 rounded-full overflow-hidden mt-2",t?"bg-white/[0.06]":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(g,100)}%`,backgroundColor:x}})}),jsxRuntime.jsxs("div",{className:c("mt-2 px-3 py-2 rounded-lg text-center font-mono text-sm font-bold",m>=0?t?"bg-[#00E5CC]/10 text-[#00E5CC]":"bg-emerald-50 text-emerald-600":t?"bg-[#F87171]/10 text-[#F87171]":"bg-red-50 text-red-600"),children:[m>=0?`+${hn(m)} ${o?"Disp.":"Avail."}`:`${hn(Math.abs(m))} ${o?"P\xE9rdida":"Loss"}`,d>0&&jsxRuntime.jsxs("span",{className:"text-[10px] ml-1 opacity-60",children:["(",p,"%)"]})]})]})]})})(),(e.totalHoursSpentMinutes!==void 0||e.totalHoursAllocatedMinutes!==void 0)&&(()=>{let d=e.totalHoursSpentMinutes??0,i=e.totalHoursAllocatedMinutes??0,u=i>0?Math.min(Math.round(d/i*100),100):0,g=(i>0?d/i:0)>1.1?"#F87171":u>=90?"#FFD60A":"#3BF06E";return jsxRuntime.jsxs("div",{className:c("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:c("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:o?"HORAS DEL PROYECTO":"PROJECT HOURS"}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"Usado":"Spent"}),jsxRuntime.jsx("span",{className:c("text-[11px] font-mono font-bold",t?"text-white/80":"text-gray-800"),children:e0(d)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"Asignado":"Allocated"}),jsxRuntime.jsx("span",{className:c("text-[11px] font-mono",t?"text-white/60":"text-gray-600"),children:e0(i)})]}),i>0&&jsxRuntime.jsx("div",{className:c("w-full h-1.5 rounded-full overflow-hidden mt-1",t?"bg-white/[0.06]":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${u}%`,backgroundColor:g}})})]})]})})(),(e.openRFIs!==void 0||e.submittalsApprovalPercent!==void 0)&&jsxRuntime.jsxs("div",{className:c("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:c("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:o?"SALUD T\xC9CNICA":"TECHNICAL HEALTH"}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[e.openRFIs!==void 0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"RFIs Abiertos":"Open RFIs"}),jsxRuntime.jsx("span",{className:c("px-2 py-0.5 rounded text-[11px] font-mono font-bold",e.openRFIs>0?"bg-[#F87171]/15 text-[#F87171]":"bg-[#3BF06E]/15 text-[#3BF06E]"),children:e.openRFIs})]}),e.submittalsApprovalPercent!==void 0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:o?"Aprobaci\xF3n Submittals":"Submittals Approval"}),jsxRuntime.jsxs("span",{className:c("text-[11px] font-mono font-bold",e.submittalsApprovalPercent>=80?"text-[#3BF06E]":"text-[#FFD60A]"),children:[e.submittalsApprovalPercent,"%"]})]})]})]}),e.unassignedCount!=null&&e.unassignedCount>0&&jsxRuntime.jsxs("div",{className:c("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:c("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:o?"TAREAS SIN ASIGNAR":"UNASSIGNED TASKS"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[jsxRuntime.jsx("div",{className:c("flex items-center justify-center w-10 h-10 rounded-lg font-mono text-lg font-bold",e.unassignedCount>=10?"bg-[#F87171]/15 text-[#F87171]":"bg-[#FFD60A]/15 text-[#FFD60A]"),children:e.unassignedCount}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:c("text-xs font-medium",t?"text-white/80":"text-gray-700"),children:e.unassignedCount===1?o?"tarea pendiente":"pending task":o?"tareas pendientes":"pending tasks"}),jsxRuntime.jsx("p",{className:c("text-[10px]",t?"text-white/40":"text-gray-400"),children:o?"sin recurso asignado":"without assigned resource"})]})]}),e.unassignedTasks&&e.unassignedTasks.length>0&&jsxRuntime.jsx("div",{className:c("space-y-1.5 overflow-y-auto scrollbar-slim",e.unassignedTasks.length>5?"max-h-[170px]":""),children:e.unassignedTasks.map(d=>jsxRuntime.jsxs("button",{onClick:()=>s?.(d.id),className:c("flex items-center gap-2 px-2.5 py-1.5 rounded-md text-[11px] w-full text-left transition-colors",t?"bg-white/[0.04] text-white/70 hover:bg-white/[0.08] hover:text-white":"bg-gray-50 text-gray-600 hover:bg-gray-100 hover:text-gray-900",s&&"cursor-pointer"),children:[jsxRuntime.jsx("span",{className:c("w-1.5 h-1.5 rounded-full flex-shrink-0",(e.unassignedCount??0)>=10?"bg-[#F87171]":"bg-[#FFD60A]")}),jsxRuntime.jsx("span",{className:"truncate",children:d.name})]},d.id))})]}),e.scheduleVarianceDays!==void 0&&jsxRuntime.jsxs("div",{className:c("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsxRuntime.jsx("h4",{className:c("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:o?"VARIACI\xD3N DE CRONOGRAMA":"SCHEDULE VARIANCE"}),(()=>{let d=e.scheduleVarianceDays??0,i=d>0,u=d<0,m=e.scheduleVarianceLabel||(i?`+${d} ${o?"D\xEDas ADELANTE":"Days AHEAD"}`:u?`${d} ${o?"D\xEDas ATR\xC1S":"Days BEHIND"}`:o?"EN TIEMPO":"ON TRACK");return jsxRuntime.jsx("div",{className:c("px-3 py-2 rounded-lg text-center font-mono text-sm font-bold",i&&"bg-[#3BF06E]/15 text-[#3BF06E]",u&&"bg-[#F87171]/15 text-[#F87171]",!i&&!u&&"bg-[#3B9EFF]/15 text-[#3B9EFF]"),children:m})})()]}),e.teams&&e.teams.length>0&&jsxRuntime.jsxs("div",{className:"px-5 py-4",children:[jsxRuntime.jsx("h4",{className:c("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:o?"DISPONIBILIDAD DEL EQUIPO":"TEAM AVAILABILITY"}),jsxRuntime.jsx("div",{className:"space-y-3",children:e.teams.map((d,i)=>{let u=d.utilizationPercent>=100?"#F87171":d.utilizationPercent>=80?"#FFD60A":d.color||"#3BF06E";return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:c("text-xs",t?"text-white/60":"text-gray-600"),children:d.name}),jsxRuntime.jsxs("span",{className:c("text-[10px] font-mono",t?"text-white/40":"text-gray-500"),children:[d.utilizationPercent,"%"]})]}),jsxRuntime.jsx("div",{className:c("w-full h-1.5 rounded-full overflow-hidden",t?"bg-white/[0.06]":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(d.utilizationPercent,100)}%`,backgroundColor:u}})})]},`${d.name}-${i}`)})})]})]})}var xw=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true}];function d0(e,t=0,a=[]){let r=[];for(let n of e){let s=[...a,n.id];r.push({...n,level:t,hasChildren:(n.subtasks?.length||0)>0,parentPath:s}),n.subtasks?.length&&n.isExpanded!==false&&r.push(...d0(n.subtasks,t+1,s));}return r}function vw(e){let t=e.subtasks;if(!t?.length)return null;let a=new Date,r=0,n=0;for(let s of t){if(!s.startDate||!s.endDate)continue;let o=s.startDate.getTime(),d=s.endDate.getTime()-o;if(d<=0)continue;let u=Math.max(0,Math.min(a.getTime()-o,d))/d*100;if(u<=0)continue;let m=(s.progress||0)/u;r+=m,n++;}return n>0?r/n:null}function es(e){if(!e.subtasks?.length)return {spent:0,allocated:0,quoted:0};let t=0,a=0,r=0;for(let n of e.subtasks)if(n.subtasks?.length){let s=es(n);t+=s.spent>0?s.spent:n.timeLoggedMinutes??0,a+=s.allocated>0?s.allocated:n.effortMinutes??0,r+=s.quoted>0?s.quoted:n.soldEffortMinutes??0;}else t+=n.timeLoggedMinutes??0,a+=n.effortMinutes??0,r+=n.soldEffortMinutes??0;return {spent:t,allocated:a,quoted:r}}function Zn(e){if(e<=0)return "0h";let t=Math.floor(e/60),a=e%60;return a>0?`${t}h ${a}m`:`${t}h`}function ww({value:e,onChange:t,isDark:a}){let[r,n]=react.useState(false),[s,o]=react.useState(String(e||""));return r?jsxRuntime.jsx("input",{autoFocus:true,type:"text",inputMode:"decimal",value:s,onClick:l=>l.stopPropagation(),onChange:l=>o(l.target.value.replace(/[^0-9.]/g,"")),onBlur:()=>{let l=parseFloat(s);!isNaN(l)&&l>=0&&l<=100?t(l):s===""&&t(0),n(false);},onKeyDown:l=>{l.key==="Enter"&&l.target.blur(),l.key==="Escape"&&(o(String(e||"")),n(false));},className:c("w-14 text-xs text-right font-mono px-1 py-0.5 rounded border outline-none",a?"bg-white/5 border-[#00E5CC]/50 text-white":"bg-gray-50 border-[#00E5CC] text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"}}):jsxRuntime.jsx("button",{onClick:l=>{l.stopPropagation(),o(String(e||"")),n(true);},className:c("text-xs font-mono cursor-pointer hover:underline",e>0?a?"text-white/80":"text-gray-700":a?"text-white/30":"text-gray-300"),style:{fontFamily:"JetBrains Mono, monospace"},children:e>0?`${e}%`:"\u2014"})}function i0(e){if(e.length===0)return 0;let t=0,a=0,r=0;for(let l of e){let d=l.weight||0;d>0&&(t+=(l.progress||0)*d,a+=d,r+=1);}let n=r/e.length;if(a>=99&&n>=.95)return Math.round(t/a*10)/10;if(e.reduce((l,d)=>l+(d.effort_minutes||0),0)>0){let l=0,d=0;for(let i of e){let u=i.effort_minutes||60;l+=(i.progress||0)*u,d+=u;}return Math.round(l/d*10)/10}let o=e.reduce((l,d)=>l+(d.progress||0),0);return Math.round(o/e.length*10)/10}function xc(e,t=[]){for(let a of e)a.subtasks&&a.subtasks.length>0?xc(a.subtasks,t):t.push({progress:a.progress||0,weight:a.weight||0,effort_minutes:a.effort_minutes??a.effortMinutes});return t}function c0({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:n,className:s,style:o,availableUsers:l=[],customFields:d=[],toolbarRightContent:i,onColumnHeaderClick:u,columnsWithFilter:m,filterDotColor:p="#00E5CC"}){let{theme:g="dark",locale:f="en",customTranslations:x,showSearch:y=true,showHierarchy:b=true,tableColumns:h,allowColumnCustomization:v=true,allowColumnResize:w=true,enableContextMenu:D=true,showCreateTaskButton:S=false,onCreateTask:M,persistFilter:T=false,financialBlur:F,healthSidebar:A,lens:C="hours",hourlyRate:_=0,rateMap:W,aggregateParentHours:oe=false,showProjectTotals:L=false,totalsDollarOverride:Y}=t,K=qi(f,x),V=g==="dark",B=P=>{if(!W||!P.assignees||P.assignees.length===0)return _;let te=0,he=0;for(let Me of P.assignees){let Qe=Me.id?W[Me.id]:void 0;if(Qe==null||Qe<=0)continue;let fe=typeof Me.estimatedMinutes=="number"?Me.estimatedMinutes:0;fe>0&&(te+=Qe*fe,he+=fe);}if(he>0)return te/he;let Se=P.assignees.map(Me=>Me.id?W[Me.id]:void 0).filter(Me=>Me!=null&&Me>0);return Se.length===0?_:Se.reduce((Me,Qe)=>Me+Qe,0)/Se.length},X=P=>{let te=0,he=0,Se=0,Me=Qe=>{for(let fe of Qe)if(fe.subtasks&&fe.subtasks.length>0){let Ge={s:te,a:he,q:Se};if(Me(fe.subtasks),te-Ge.s+(he-Ge.a)+(Se-Ge.q)===0){let vt=B(fe);te+=(fe.timeLoggedMinutes??0)/60*vt,he+=(fe.effortMinutes??0)/60*vt,Se+=(fe.soldEffortMinutes??0)/60*vt;}}else {let Ge=B(fe);te+=(fe.timeLoggedMinutes??0)/60*Ge,he+=(fe.effortMinutes??0)/60*Ge,Se+=(fe.soldEffortMinutes??0)/60*Ge;}};return P.subtasks&&Me(P.subtasks),{dollarSpent:te,dollarAllocated:he,dollarQuoted:Se}},Ce=react.useCallback(()=>{if(!T||typeof window>"u")return {statusFilter:"all",hideCompleted:false};try{let P=localStorage.getItem(T);if(P){let te=JSON.parse(P);return {statusFilter:te.statusFilter||"all",hideCompleted:te.hideCompleted||!1}}}catch(P){console.error("Error loading persisted filter:",P);}return {statusFilter:"all",hideCompleted:false}},[T]),Re=react.useMemo(()=>{function P(te){let he=0,Se=0,Me=0,Qe=0,fe=0,Ge=0;for(let nt of te)if(nt.subtasks&&nt.subtasks.length>0){let vt=P(nt.subtasks);if(vt.spent+vt.allocated+vt.quoted>0)he+=vt.spent,Se+=vt.allocated,Me+=vt.quoted,Qe+=vt.dollarSpent,fe+=vt.dollarAllocated,Ge+=vt.dollarQuoted;else {let jt=nt.timeLoggedMinutes??0,Pt=nt.effortMinutes??0,Qa=nt.soldEffortMinutes??0;he+=jt,Se+=Pt,Me+=Qa;let ia=B(nt);Qe+=jt/60*ia,fe+=Pt/60*ia,Ge+=Qa/60*ia;}}else {let vt=nt.timeLoggedMinutes??0,na=nt.effortMinutes??0,jt=nt.soldEffortMinutes??0;he+=vt,Se+=na,Me+=jt;let Pt=B(nt);Qe+=vt/60*Pt,fe+=na/60*Pt,Ge+=jt/60*Pt;}return {spent:he,allocated:Se,quoted:Me,dollarSpent:Qe,dollarAllocated:fe,dollarQuoted:Ge}}return P(e)},[e]),R=react.useMemo(()=>{let P=new Map;function te(he){let Se=0;for(let Me of he)if(Me.subtasks&&Me.subtasks.length>0){let Qe=te(Me.subtasks);P.set(Me.id,Qe),Se+=Qe;}else Se+=Me.weight||0;return Se}return te(e),P},[e]),ae=react.useMemo(()=>!A?.enabled||!A.data?A:{...A,data:{...A.data,totalHoursSpentMinutes:Re.spent,totalHoursAllocatedMinutes:Re.allocated}},[A,Re]),[be,Ie]=react.useState(true),[De,Ee]=react.useState(null),[He,rt]=react.useState("position"),[pe,We]=react.useState("asc"),[je,Oe]=react.useState(""),[tt,wt]=react.useState(()=>Ce().statusFilter),[pt,Ue]=react.useState(()=>Ce().hideCompleted),[ot,Et]=react.useState(h||xw),[ge,mt]=react.useState(false),[k,O]=react.useState(false),[Z,ve]=react.useState({isOpen:false,x:0,y:0,type:"task"}),[$,re]=react.useState(null),[Ye,Te]=react.useState(false),[Fe,ze]=react.useState(null),[Le,Ze]=react.useState(null),[st,yt]=react.useState(null),xt=react.useRef(0),$t=react.useRef(false),ut=!!(a.onTaskMove||a.onTaskReparent),Gt=react.useCallback((P,te)=>{ut&&(te.preventDefault(),xt.current=te.clientY,re(P),$t.current=false,Te(false),yt({x:te.clientX,y:te.clientY}));},[ut]),Mt=react.useCallback(P=>{if(!$||(Math.abs(P.clientY-xt.current)>5&&!$t.current&&($t.current=true,Te(true)),yt({x:P.clientX,y:P.clientY}),!$t.current))return;let he=document.querySelectorAll("[data-listview-row]"),Se=null,Me=null;he.forEach(Qe=>{let fe=Qe.getBoundingClientRect(),Ge=Qe.getAttribute("data-listview-row");if(Ge&&Ge!==$&&P.clientY>=fe.top&&P.clientY<=fe.bottom){Se=Ge;let nt=P.clientY-fe.top,vt=fe.height;Me=nt<vt*.25?"above":nt>vt*.75?"below":"child";}}),ze(Se),Ze(Me);},[$]),It=react.useCallback(()=>{if($t.current&&$&&Fe&&Le){if(Le==="child"&&a.onTaskReparent)a.onTaskReparent($,Fe);else if(Le==="above"||Le==="below"){let P=(Se,Me,Qe=null)=>{for(let fe of Se){if(fe.id===Me)return Qe;if(fe.subtasks){let Ge=P(fe.subtasks,Me,fe.id);if(Ge!==void 0)return Ge}}},te=P(e,$,null),he=P(e,Fe,null);if(a.onTaskReparent){let Se=(vt,na)=>{if(na===null)return vt;for(let jt of vt){if(jt.id===na)return jt.subtasks||[];if(jt.subtasks){let Pt=Se(jt.subtasks,na);if(Pt.length>0||jt.subtasks.some(Qa=>Qa.id===na))return Pt}}return []},Me=Se(e,he??null),Qe=Me.findIndex(vt=>vt.id===Fe),fe=te===he,Ge=fe?Me.findIndex(vt=>vt.id===$):-1,nt=Le==="below"?Qe+1:Qe;fe&&Ge!==-1&&Ge<Qe&&(nt-=1),a.onTaskReparent($,he??null,Math.max(0,nt));}}}re(null),ze(null),Ze(null),yt(null),$t.current=false,Te(false);},[$,Fe,Le,e,a]);react.useEffect(()=>{if($)return document.addEventListener("mousemove",Mt),document.addEventListener("mouseup",It),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",Mt),document.removeEventListener("mouseup",It),document.body.style.cursor="",document.body.style.userSelect="";}},[$,Mt,It]);let[Ft,Ct]=react.useState("all"),[St,ct]=react.useState(false),fa=react.useRef(null),xa=react.useRef(null),H=react.useMemo(()=>{let P=0;function te(he,Se){for(let Me of he)Se>P&&(P=Se),Me.subtasks?.length&&te(Me.subtasks,Se+1);}return te(e,1),P},[e]);react.useEffect(()=>{if(!St)return;let P=te=>{fa.current?.contains(te.target)||xa.current?.contains(te.target)||ct(false);};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[St]),react.useEffect(()=>{if(Ft==="all"){let he=function(Se){for(let Me of Se)Me.subtasks?.length&&(Me.isExpanded===false&&a.onTaskToggleExpand?.(Me.id),he(Me.subtasks));};he(e);}else {let he=function(Se,Me){for(let Qe of Se)if(Qe.subtasks?.length){let fe=Me<Ft,Ge=Qe.isExpanded!==false;fe!==Ge&&a.onTaskToggleExpand?.(Qe.id),he(Qe.subtasks,Me+1);}};he(e,1);}},[Ft]);let[se,at]=react.useState(null),[Xt,ee]=react.useState(0),[ke,At]=react.useState(0),kt=react.useRef(null),[lt,dt]=react.useState(null),[J,xe]=react.useState(null);react.useEffect(()=>{h&&Et(P=>{if(P.length===h.length){let te=true;for(let he=0;he<P.length;he++){let Se=P[he],Me=h[he];if(!Se||!Me||Se.id!==Me.id||Se.visible!==Me.visible||Se.width!==Me.width||Se.label!==Me.label){te=false;break}}if(te)return P}return h});},[h]),react.useEffect(()=>{if(!(!T||typeof window>"u"))try{localStorage.setItem(T,JSON.stringify({statusFilter:tt,hideCompleted:pt}));}catch(P){console.error("Error persisting filter state:",P);}},[T,tt,pt]);let ue=react.useMemo(()=>{let P=new Set;function te(he){for(let Se of he)Se.subtasks?.length&&(Se.isExpanded!==false&&P.add(Se.id),te(Se.subtasks));}return te(e),P},[e]),z=react.useMemo(()=>ot.filter(P=>P.visible),[ot]),ne=react.useCallback(P=>{a.onTaskToggleExpand?.(P);},[a]),Ve=react.useCallback(P=>{He===P?We(te=>te==="asc"?"desc":"asc"):(rt(P),We("asc")),a.onSortChange?.({column:P,direction:pe==="asc"?"desc":"asc"});},[He,pe,a]),N=react.useCallback(P=>{Et(P),a.onColumnsChange?.(P);},[a]),U=react.useCallback(P=>{let te=ot.map(he=>he.id===P?{...he,visible:false}:he);N(te);},[ot,N]),Ne=react.useCallback((P,te)=>{rt(P),We(te);},[]),q=react.useCallback((P,te,he)=>{D&&(P.preventDefault(),ve({isOpen:true,x:P.clientX,y:P.clientY,type:te?"task":"header",task:te,columnId:he}));},[D]),et=react.useCallback(()=>{ve(P=>({...P,isOpen:false}));},[]),Nt=react.useCallback((P,te)=>{if(!w)return;P.preventDefault(),P.stopPropagation();let he=ot.find(Se=>Se.id===te);he&&(at(te),ee(P.clientX),At(he.width));},[ot,w]);react.useEffect(()=>{if(!se)return;let P=ot,te=Se=>{let Me=Se.clientX-Xt,Qe=Math.max(50,ke+Me);P=P.map(fe=>fe.id===se?{...fe,width:Qe}:fe),Et(P);},he=()=>{a.onColumnsChange?.(P),at(null);};return document.addEventListener("mousemove",te),document.addEventListener("mouseup",he),()=>{document.removeEventListener("mousemove",te),document.removeEventListener("mouseup",he);}},[se,Xt,ke,a]);let Ht=react.useCallback((P,te)=>{if(te==="name"){P.preventDefault();return}dt(te),P.dataTransfer.effectAllowed="move",P.dataTransfer.setData("text/plain",te),P.currentTarget instanceof HTMLElement&&(P.currentTarget.style.opacity="0.5");},[]),Fa=react.useCallback(P=>{P.currentTarget instanceof HTMLElement&&(P.currentTarget.style.opacity="1"),dt(null),xe(null);},[]),va=react.useCallback((P,te)=>{P.preventDefault(),te!=="name"&&(P.dataTransfer.dropEffect="move",xe(te));},[]),oa=react.useCallback(()=>{xe(null);},[]),cr=react.useCallback((P,te)=>{if(P.preventDefault(),!lt||lt===te||te==="name")return;let he=[...ot],Se=he.findIndex(fe=>fe.id===lt),Me=he.findIndex(fe=>fe.id===te);if(Se===-1||Me===-1)return;let Qe=he.splice(Se,1);Qe[0]&&(he.splice(Me,0,Qe[0]),N(he),dt(null),xe(null));},[lt,ot,N]),wa=react.useCallback(async P=>{if(a.onCreateCustomField){let te={...P,id:`cf_${Date.now()}`,projectId:""};await a.onCreateCustomField(te);}O(false);},[a]),br=react.useCallback(P=>P.progress===100||P.status==="completed"?"completed":P.progress&&P.progress>0||P.status==="in-progress"?"in-progress":"todo",[]),yo=react.useMemo(()=>{let P=d0(e);if(je.trim()){let te=je.toLowerCase();P=P.filter(he=>he.name.toLowerCase().includes(te));}if(tt!=="all"){let te=new Set(P.filter(he=>br(he)===tt).flatMap(he=>he.parentPath));P=P.filter(he=>te.has(he.id));}if(pt){let te=new Set(P.filter(he=>br(he)!=="completed").flatMap(he=>he.parentPath));P=P.filter(he=>te.has(he.id));}return P.sort((te,he)=>{let Se,Me;switch(He){case "name":Se=te.name.toLowerCase(),Me=he.name.toLowerCase();break;case "startDate":Se=te.startDate?.getTime()||0,Me=he.startDate?.getTime()||0;break;case "endDate":Se=te.endDate?.getTime()||0,Me=he.endDate?.getTime()||0;break;case "progress":Se=te.progress||0,Me=he.progress||0;break;case "status":Se=te.status||"todo",Me=he.status||"todo";break;case "priority":let Qe={urgent:0,high:1,medium:2,low:3,none:4};Se=Qe[te.priority]??4,Me=Qe[he.priority]??4;break;case "position":return 0;default:return 0}return Se<Me?pe==="asc"?-1:1:Se>Me?pe==="asc"?1:-1:0}),P},[e,je,tt,pt,He,pe,br]),ao=react.useCallback((P,te)=>{let he=Qe=>{a.onTaskUpdate?.({...P,...Qe});},Se=Qe=>Qe?P.customFields?.find(Ge=>Ge.fieldId===Qe)?.value:void 0,Me=(Qe,fe)=>{if(!Qe)return;let nt=[...P.customFields||[]],vt=nt.findIndex(na=>na.fieldId===Qe);vt>=0?nt[vt]={fieldId:Qe,value:fe}:nt.push({fieldId:Qe,value:fe}),he({customFields:nt});};switch(te.type){case "name":return null;case "status":return jsxRuntime.jsx(Jm,{value:P.status||(P.progress===100?"completed":P.progress&&P.progress>0?"in-progress":"todo"),onChange:fe=>{he({status:fe,progress:fe==="completed"?100:fe==="in-progress"?50:0});},isDark:V,locale:f,translations:K.status});case "priority":return jsxRuntime.jsx(Zm,{value:P.priority,onChange:fe=>he({priority:fe}),isDark:V,locale:f});case "assignees":{let fe=P.hasChildren,Ge=P.assignees||[];if(fe&&P.subtasks?.length){let nt=new Map,vt=na=>{(na||[]).forEach(jt=>{(jt.assignees||[]).forEach(Pt=>{nt.has(Pt.name)||nt.set(Pt.name,Pt);}),jt.subtasks?.length&&vt(jt.subtasks);});};vt(P.subtasks),Ge=Array.from(nt.values());}else fe&&(Ge=[]);return jsxRuntime.jsx(ac,{value:Ge,availableUsers:l,onChange:nt=>he({assignees:nt}),isDark:V,locale:f,disabled:fe})}case "startDate":return jsxRuntime.jsx(Qi,{value:P.startDate,onChange:fe=>he({startDate:fe}),isDark:V,locale:f,dateField:"start",startDate:P.startDate,endDate:P.endDate});case "endDate":return jsxRuntime.jsx(Qi,{value:P.endDate,onChange:fe=>he({endDate:fe}),isDark:V,locale:f,dateField:"end",startDate:P.startDate,endDate:P.endDate});case "progress":{let fe=!!(P.subtasks&&P.subtasks.length>0),Ge=fe?i0(xc(P.subtasks||[])):P.progress||0;return jsxRuntime.jsx(lg,{value:Ge,onChange:fe?void 0:nt=>{let vt=nt===100?"completed":nt>0?"in-progress":"todo";he({progress:nt,status:vt});},isDark:V,disabled:fe})}case "tags":return jsxRuntime.jsx(vg,{value:P.tags||[],isDark:V});case "text":return jsxRuntime.jsx(ug,{value:Se(te.customFieldId)||"",onChange:fe=>Me(te.customFieldId,fe),isDark:V});case "number":return jsxRuntime.jsx(gg,{value:Se(te.customFieldId)||0,onChange:fe=>Me(te.customFieldId,fe),isDark:V});case "date":let Qe=Se(te.customFieldId);return jsxRuntime.jsx(Qi,{value:Qe?new Date(Qe):void 0,onChange:fe=>Me(te.customFieldId,fe),isDark:V,locale:f});case "dropdown":return jsxRuntime.jsx(fg,{value:Se(te.customFieldId)||"",options:te.options||[],onChange:fe=>Me(te.customFieldId,fe),isDark:V});case "checkbox":return jsxRuntime.jsx(hg,{value:Se(te.customFieldId)||false,onChange:fe=>Me(te.customFieldId,fe),isDark:V});case "estimatedTime":{let fe=P.status==="completed"||P.progress===100;return jsxRuntime.jsx(Mr,{value:P.estimatedTime,onChange:Ge=>he({estimatedTime:Ge}),isDark:V,locale:f,disabled:fe,lens:C,hourlyRate:B(P)})}case "quotedTime":{let fe=P.status==="completed"||P.progress===100,Ge=F?.enabled&&(!F.columns||F.columns.includes("quotedTime"));return jsxRuntime.jsx(Mr,{value:P.quotedTime,onChange:nt=>he({quotedTime:nt}),isDark:V,locale:f,disabled:fe,isBlurred:Ge,lens:C,hourlyRate:B(P)})}case "elapsedTime":{let fe=P.status==="completed"||P.progress===100,Ge=P.executedDollarsCanonical;return jsxRuntime.jsx(Mr,{value:P.elapsedTime,onChange:nt=>he({elapsedTime:nt}),isDark:V,locale:f,disabled:fe,lens:C,hourlyRate:B(P),financialOverride:Ge})}case "effortMinutes":{if(oe&&P.subtasks&&P.subtasks.length>0){let{allocated:na}=es(P);if(C==="financial"){let jt=X(P),Pt=Math.round(jt.dollarAllocated),Qa=Math.round(jt.dollarQuoted),ia=Qa-Pt;return jsxRuntime.jsxs("div",{className:"flex flex-col",children:[Pt>0?jsxRuntime.jsxs("span",{className:c("text-sm font-mono",V?"text-white/60":"text-gray-500"),children:["$",Pt.toLocaleString("es-CO")]}):null,ia!==0&&Pt>0&&Qa>0&&jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",ia>0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[ia>0?"+":"",Math.abs(ia)>=1e3?`$${(ia/1e3).toFixed(1)}K`:`$${ia}`]})]})}return jsxRuntime.jsx(Mr,{value:na>0?na:void 0,isDark:V,locale:f,disabled:true,lens:C,hourlyRate:_})}let fe=P.status==="completed"||P.progress===100,Ge=P.effortMinutes||0,nt=P.soldEffortMinutes||0,vt=B(P);if(C==="financial"&&vt&&Ge>0&&nt>0){let na=Math.round(Ge/60*vt),Pt=Math.round(nt/60*vt)-na;return jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx(Mr,{value:Ge,onChange:Qa=>he({effortMinutes:Qa}),isDark:V,locale:f,disabled:fe,lens:C,hourlyRate:B(P)}),Pt!==0&&jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",Pt>=0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Pt>0?"+":"",Math.abs(Pt)>=1e3?`$${(Pt/1e3).toFixed(1)}K`:`$${Pt}`]})]})}return jsxRuntime.jsx(Mr,{value:Ge,onChange:na=>he({effortMinutes:na}),isDark:V,locale:f,disabled:fe,lens:C,hourlyRate:B(P)})}case "timeLoggedMinutes":{let fe=P.executedDollarsCanonical;if(oe&&P.subtasks&&P.subtasks.length>0){let{spent:nt}=es(P);return jsxRuntime.jsx(Mr,{value:nt>0?nt:void 0,isDark:V,locale:f,disabled:true,lens:C,hourlyRate:B(P),financialOverride:fe})}let Ge=P.status==="completed"||P.progress===100;return jsxRuntime.jsx(Mr,{value:P.timeLoggedMinutes,onChange:a.onLogTime?nt=>{a.onLogTime?.(P,nt);}:void 0,isDark:V,locale:f,placeholder:f==="es"?"Agregar":"Add",disabled:Ge,lens:C,hourlyRate:B(P),financialOverride:fe})}case "soldEffortMinutes":{if(oe&&P.subtasks&&P.subtasks.length>0){let{quoted:nt}=es(P),vt=F?.enabled&&(!F.columns||F.columns.includes("soldEffortMinutes"));return jsxRuntime.jsx(Mr,{value:nt>0?nt:void 0,isDark:V,locale:f,disabled:true,isBlurred:vt,lens:C,hourlyRate:B(P)})}let fe=P.status==="completed"||P.progress===100,Ge=F?.enabled&&(!F.columns||F.columns.includes("soldEffortMinutes"));return jsxRuntime.jsx(Mr,{value:P.soldEffortMinutes,onChange:nt=>he({soldEffortMinutes:nt}),isDark:V,locale:f,disabled:fe,isBlurred:Ge,lens:C,hourlyRate:B(P)})}case "scheduleVariance":{let fe=P.effortMinutes||0,Ge=P.soldEffortMinutes||0,nt=P.timeLoggedMinutes||0,vt=fe>0||Ge>0||nt>0;return jsxRuntime.jsx(Tg,{startDate:P.startDate,endDate:P.endDate,scheduleVariance:P.scheduleVariance,isDark:V,locale:f,hasTimeAllocated:vt})}case "hoursBar":{if(oe&&P.hasChildren){let{spent:fe,allocated:Ge,quoted:nt}=es(P),vt=fe>Ge&&Ge>0;return jsxRuntime.jsxs("span",{className:c("text-[11px] font-mono flex items-center gap-1.5",V?"text-white/50":"text-gray-500"),children:[jsxRuntime.jsx("span",{className:c("font-bold",vt?"text-[#FF453A]":V?"text-white/80":"text-gray-800"),children:Zn(fe)}),Ge>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" / ",jsxRuntime.jsx("span",{className:V?"text-white/60":"text-gray-600",children:Zn(Ge)})]}),nt>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" / ",jsxRuntime.jsx("span",{className:V?"text-amber-400/70":"text-amber-600",children:Zn(nt)})]})]})}return jsxRuntime.jsx(Dg,{task:P,isDark:V,locale:f,onLogTime:a.onLogTime,onEstimateUpdate:a.onEstimateUpdate,onSoldEffortUpdate:a.onSoldEffortUpdate,showSoldEffort:t.showSoldEffort,onOpenTimeLog:a.onOpenTimeLog,lens:C,hourlyRate:B(P)})}case "teamLoad":return P.hasChildren||P.subtasks&&P.subtasks.length>0?jsxRuntime.jsx(Eg,{task:P,isDark:V,locale:f}):jsxRuntime.jsx(ac,{value:P.assignees||[],availableUsers:l,onChange:Ge=>{a.onTaskUpdate?.({...P,assignees:Ge});},isDark:V,locale:f});case "blockers":return jsxRuntime.jsx(Pg,{blockers:P.blockers,isDark:V,locale:f});case "weight":{let fe=R.get(P.id);if(fe!==void 0)return jsxRuntime.jsx("span",{className:c("text-xs font-mono",fe>0?V?"text-white/50":"text-gray-400":V?"text-white/30":"text-gray-300"),style:{fontFamily:"JetBrains Mono, monospace"},children:fe>0?`${Number(fe.toFixed(2))}%`:"\u2014"});let Ge=P.weight||0;return jsxRuntime.jsx(ww,{value:Ge,onChange:nt=>he({weight:nt}),isDark:V})}default:return jsxRuntime.jsx("span",{className:c("text-sm",V?"text-white/60":"text-gray-500"),children:"-"})}},[a,V,f,l,K,oe,R]),ro=react.useCallback(P=>{let he={name:K.columns.name,status:K.columns.status,priority:K.columns.priority,assignees:K.columns.assignees,startDate:K.columns.startDate,endDate:K.columns.endDate,progress:K.columns.progress,tags:K.columns.tags||(f==="es"?"Etiquetas":"Tags"),estimatedTime:K.columns.estimatedTime||(f==="es"?"Estimado":"Estimated"),quotedTime:K.columns.quotedTime||(f==="es"?"Ofertado":"Quoted"),elapsedTime:K.columns.elapsedTime||(f==="es"?"Ejecutado":"Executed"),soldEffortMinutes:K.columns.soldEffortMinutes||(f==="es"?"Ofertado":"Quoted"),effortMinutes:K.columns.effortMinutes||(f==="es"?"Estimado":"Estimated"),timeLoggedMinutes:K.columns.timeLoggedMinutes||(f==="es"?"Ejecutado":"Executed"),scheduleVariance:K.columns.scheduleVariance||(f==="es"?"Prog / Var":"Sched / Var"),hoursBar:K.columns.hoursBar||(f==="es"?"Horas (Usado / Asignado)":"Hours (Spent / Allocated)"),teamLoad:K.columns.teamLoad||(f==="es"?"Equipo":"Team"),blockers:K.columns.blockers||(f==="es"?"Bloqueantes":"Blockers"),weight:K.columns.weight||(f==="es"?"Peso":"Weight")}[P.type]||P.label;return typeof he=="string"?he:String(he||P.type)},[K,f]),xo=react.useMemo(()=>{let he=z.reduce((Me,Qe)=>Me+Qe.width,0)+(v?48:0),Se={};for(let Me of z)Se[Me.id]=`${Me.width/he*100}%`;return Se},[z,v]);return r?jsxRuntime.jsx("div",{className:c("flex-1 flex items-center justify-center",V?"bg-[#0D0D0D]":"bg-white",s),style:o,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#00E5CC]"}),jsxRuntime.jsxs("p",{className:c("text-sm",V?"text-white/60":"text-gray-600"),children:[K.empty.noTasks,"..."]})]})}):n?jsxRuntime.jsx("div",{className:c("flex-1 flex items-center justify-center",V?"bg-[#0D0D0D]":"bg-white",s),style:o,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:c("text-lg font-semibold mb-2",V?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:c("text-sm",V?"text-white/60":"text-gray-600"),children:typeof n=="string"?n:n.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:c("flex-1 flex items-center justify-center",V?"bg-[#0D0D0D]":"bg-white",s),style:o,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#00E5CC]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.List,{className:"w-8 h-8 text-[#00E5CC]"})}),jsxRuntime.jsx("h3",{className:c("text-lg font-semibold mb-2",V?"text-white":"text-gray-900"),children:K.empty.noTasks}),jsxRuntime.jsx("p",{className:c("text-sm",V?"text-white/60":"text-gray-600"),children:K.empty.addFirstTask})]})}):jsxRuntime.jsxs("div",{ref:kt,className:c(V?"bg-[#0D0D0D]":"bg-white",se&&"select-none",s),style:{display:"flex",flexDirection:"column",flex:"1 1 0%",width:"100%",height:"100%",overflow:"hidden",minHeight:0,...o},children:[jsxRuntime.jsx("div",{className:c("flex-shrink-0 px-6 py-4 border-b",V?"border-[#222]":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsxs("div",{className:c("text-sm",V?"text-white/60":"text-gray-600"),children:[yo.length," ",K.pagination.tasks]}),y&&jsxRuntime.jsxs("div",{className:"relative flex-1 max-w-md",children:[jsxRuntime.jsx(lucideReact.Search,{className:c("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",V?"text-white/60":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:je,onChange:P=>Oe(P.target.value),placeholder:K.toolbar.searchPlaceholder,className:c("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#00E5CC]/30",V?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30 font-mono":"bg-gray-100 border-gray-200 text-gray-900 placeholder:text-gray-400")})]}),jsxRuntime.jsx("div",{className:"flex-1"}),i&&jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:i}),b&&H>1&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("button",{ref:fa,onClick:()=>ct(!St),className:c("flex items-center gap-1.5 px-2 py-1.5 rounded-lg border transition-colors text-[11px] font-medium",V?St?"bg-[#00E5CC]/10 border-[#00E5CC]/40 text-[#00E5CC]":"bg-white/[0.03] border-[#333] text-white/50 hover:text-white/70 hover:bg-white/[0.05]":St?"bg-[#00E5CC]/15 border-[#00E5CC] text-[#00C4AE]":"bg-gray-100 border-gray-200 text-gray-500 hover:text-gray-700 hover:bg-gray-200"),style:{fontFamily:"'JetBrains Mono', monospace"},children:[jsxRuntime.jsx(lucideReact.Layers,{className:"w-3.5 h-3.5"}),Ft==="all"?f==="es"?"Todos":"All":`L${Ft}`]}),St&&jsxRuntime.jsx("div",{ref:xa,className:c("absolute top-full mt-1 right-0 w-24 rounded-lg border overflow-hidden z-50 shadow-lg",V?"bg-[#1A1A1A] border-[#333]":"bg-white border-gray-200"),children:[{value:"all",label:f==="es"?"Todos":"All"},...Array.from({length:Math.min(H,5)},(P,te)=>({value:te+1,label:`L${te+1}`}))].map(P=>jsxRuntime.jsxs("button",{onClick:()=>{Ct(P.value),ct(false);},className:c("w-full px-3 py-2 text-left text-xs transition-colors flex items-center justify-between",V?Ft===P.value?"bg-[#00E5CC]/10 text-[#00E5CC]":"text-white/60 hover:bg-white/[0.05] hover:text-white/80":Ft===P.value?"bg-[#00E5CC]/15 text-[#00C4AE]":"text-gray-600 hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{children:P.label}),Ft===P.value&&jsxRuntime.jsx("span",{className:"text-[#00E5CC]",children:"\u2713"})]},String(P.value)))})]}),jsxRuntime.jsx(Zg,{value:tt,hideCompleted:pt,onChange:wt,onHideCompletedChange:Ue,isDark:V,locale:f}),ae?.enabled&&ae.data&&!be&&jsxRuntime.jsx("button",{onClick:()=>Ie(true),className:c("flex items-center justify-center w-8 h-8 rounded-lg border transition-colors",V?"border-[#333] text-white/40 hover:text-white/70 hover:bg-white/[0.05]":"border-gray-200 text-gray-400 hover:text-gray-600 hover:bg-gray-100"),title:f==="es"?"Abrir panel de salud":"Open health panel",children:jsxRuntime.jsx(lucideReact.PanelRight,{className:"w-4 h-4"})}),t.toolbarEndContent,S&&M&&jsxRuntime.jsxs(framerMotion.motion.button,{onClick:M,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-[transform,box-shadow]",style:{background:"linear-gradient(135deg, #00E5CC 0%, #005FCC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 123, 255, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 123, 255, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:K.toolbar.newTask})]})]})}),jsxRuntime.jsxs("div",{style:{display:"flex",flex:"1 1 0%",overflow:"hidden",minHeight:0},children:[jsxRuntime.jsx("div",{style:{flex:"1 1 0%",overflow:"auto",minHeight:0},children:jsxRuntime.jsxs("div",{style:{width:"100%"},children:[jsxRuntime.jsxs("div",{className:c("flex-shrink-0 flex items-center border-b text-[10px] font-bold uppercase tracking-wider sticky top-0 z-10",V?"border-[#222] bg-[#1A1A1A] font-mono text-white/70":"border-gray-200 bg-gray-50 text-gray-600"),children:[ut&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),z.map(P=>{let te=P.id!=="name",he=J===P.id&<!==P.id;return jsxRuntime.jsxs("div",{className:c("relative flex items-center gap-2 px-4 py-2 transition-all duration-150 group",V?"text-white/60":"text-gray-500",te&&"cursor-grab",P.type!=="name"&&"justify-center",lt===P.id&&"opacity-50",he&&(V?"bg-[#00E5CC]/20 border-l-2 border-l-[#00E5CC]":"bg-[#00E5CC]/15 border-l-2 border-l-[#00E5CC]")),style:{width:xo[P.id],minWidth:P.minWidth},draggable:te,onDragStart:te?Se=>Ht(Se,P.id):void 0,onDragEnd:te?Fa:void 0,onDragOver:te?Se=>va(Se,P.id):void 0,onDragLeave:te?oa:void 0,onDrop:te?Se=>cr(Se,P.id):void 0,onContextMenu:Se=>q(Se,void 0,P.id),children:[te&&jsxRuntime.jsx(lucideReact.GripVertical,{className:c("w-3 h-3 flex-shrink-0 transition-opacity",V?"text-white/20 group-hover:text-white/50":"text-gray-300 group-hover:text-gray-500")}),u?jsxRuntime.jsxs("button",{draggable:false,onClick:Se=>{let Me=Se.currentTarget.getBoundingClientRect();u(P.id,Me);},className:"flex items-center gap-1.5 hover:text-[#00E5CC]",children:[ro(P),m?.includes(P.id)&&jsxRuntime.jsx("span",{title:"filtered",style:{width:6,height:6,borderRadius:"50%",background:p,display:"inline-block",flexShrink:0}}),He===P.id&&jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-3 h-3 text-[#00E5CC]"})]}):P.sortable?jsxRuntime.jsxs("button",{draggable:false,onClick:()=>Ve(P.id),className:"flex items-center gap-1 hover:text-[#00E5CC]",children:[ro(P),m?.includes(P.id)&&jsxRuntime.jsx("span",{title:"filtered",style:{width:6,height:6,borderRadius:"50%",background:p,display:"inline-block",flexShrink:0}}),jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:c("w-3 h-3",He===P.id&&"text-[#00E5CC]")})]}):jsxRuntime.jsxs("span",{draggable:false,className:"flex items-center gap-1.5",children:[ro(P),m?.includes(P.id)&&jsxRuntime.jsx("span",{title:"filtered",style:{width:6,height:6,borderRadius:"50%",background:p,display:"inline-block",flexShrink:0}})]}),w&&P.resizable&&jsxRuntime.jsx("div",{className:c("absolute right-0 top-0 bottom-0 w-1 cursor-col-resize group","hover:bg-[#00E5CC]",se===P.id&&"bg-[#00E5CC]"),onMouseDown:Se=>Nt(Se,P.id)})]},P.id)}),v&&jsxRuntime.jsxs("div",{className:"relative flex items-center justify-center w-12 flex-shrink-0",children:[jsxRuntime.jsx("button",{onClick:P=>{P.stopPropagation(),mt(te=>!te);},className:c("p-0.5 rounded transition-colors",V?"hover:bg-white/[0.05] text-white/60 hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600",ge&&(V?"bg-white/[0.05]":"bg-gray-200")),title:f==="es"?"Agregar columna":"Add column",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3 h-3"})}),jsxRuntime.jsx(_g,{isOpen:ge,onClose:()=>mt(false),columns:ot,customFields:d,onColumnsChange:N,onCreateCustomField:()=>{mt(false),O(true);},isDark:V,locale:f})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"popLayout",children:yo.map((P,te)=>{let he=ue.has(P.id),Se=Math.min(te*.01,.2),Me=P.hasChildren&&P.level===0,Qe=P.subtasks?.length||0;if(Me){let{spent:jt,allocated:Pt,quoted:Qa}=es(P),ia=vw(P);return jsxRuntime.jsxs(framerMotion.motion.div,{"data-task-id":P.id,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:Se},className:c("flex items-center border-y cursor-pointer transition-colors duration-500",V?"border-[#222] bg-[#222]":"border-gray-200 bg-gray-100",De===P.id&&(V?"!bg-[#FFD60A]/15":"!bg-yellow-100")),onClick:()=>a.onTaskClick?.(P),children:[ut&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),z.map(nr=>jsxRuntime.jsx("div",{className:c("flex items-center px-4 py-3 min-h-[56px]",nr.type!=="name"&&"justify-center"),style:{width:xo[nr.id],minWidth:nr.minWidth},children:nr.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[jsxRuntime.jsx("button",{onClick:ua=>{ua.stopPropagation(),ne(P.id);},className:c("p-0.5 rounded flex-shrink-0 mt-0.5",V?"hover:bg-white/[0.05]":"hover:bg-gray-200"),children:he?jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-4 h-4",V?"text-white/40":"text-gray-500")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:c("w-4 h-4",V?"text-white/40":"text-gray-500")})}),jsxRuntime.jsx("span",{onClick:ua=>{ua.stopPropagation(),ne(P.id);},className:"flex-shrink-0 cursor-pointer mt-0.5",children:he?jsxRuntime.jsx(lucideReact.FolderOpen,{className:"w-4 h-4",style:{color:V?"#FFD60A":"#B45309"}}):jsxRuntime.jsx(lucideReact.Folder,{className:"w-4 h-4",style:{color:V?"#FFD60A":"#B45309"}})}),P.wbsCode&&jsxRuntime.jsx("span",{className:"text-[10px] font-mono flex-shrink-0 mt-1",style:{color:V?"#FFD60A":"#B45309"},children:P.wbsCode}),jsxRuntime.jsxs("div",{className:"flex flex-col min-w-0",children:[jsxRuntime.jsx("span",{className:c("text-[13px] font-bold uppercase tracking-wide",V?"text-white":"text-gray-900"),style:{fontFamily:"Inter, system-ui, sans-serif"},children:P.name}),jsxRuntime.jsxs("span",{className:c("text-[10px] font-mono",V?"text-white/30":"text-gray-500"),children:["(",Qe," ",f==="es"?Qe===1?"Tarea":"Tareas":Qe===1?"Item":"Items",")"]}),ia!==null&&jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono px-1.5 py-0.5 rounded w-fit mt-0.5",ia>=1?"text-[#32D74B] bg-[#32D74B]/10":ia>=.8?"text-[#FFD60A] bg-[#FFD60A]/10":"text-[#FF453A] bg-[#FF453A]/10"),children:["Avg SPI: ",ia.toFixed(2)]})]})]}):nr.type==="timeLoggedMinutes"?C==="financial"?(()=>{let ua=P.executedDollarsCanonical,Dt=ua!=null?Math.round(ua):Math.round(X(P).dollarSpent);return Dt>0?jsxRuntime.jsxs("span",{className:c("text-sm font-mono",V?"text-white/60":"text-gray-500"),children:["$",Dt.toLocaleString("en-US")]}):null})():jsxRuntime.jsx(Mr,{value:jt>0?jt:void 0,isDark:V,locale:f,disabled:true,lens:C,hourlyRate:B(P)}):nr.type==="soldEffortMinutes"?C==="financial"?(()=>{let ua=X(P),Dt=Math.round(ua.dollarQuoted);return Dt>0?jsxRuntime.jsxs("span",{className:c("text-sm font-mono",V?"text-white/60":"text-gray-500"),children:["$",Dt.toLocaleString("en-US")]}):null})():jsxRuntime.jsx(Mr,{value:Qa>0?Qa:void 0,isDark:V,locale:f,disabled:true,lens:C,hourlyRate:B(P)}):nr.type==="effortMinutes"?C==="financial"?(()=>{let ua=X(P),Dt=Math.round(ua.dollarAllocated),Vr=Math.round(ua.dollarQuoted),Za=Vr-Dt;return jsxRuntime.jsxs("div",{className:"flex flex-col",children:[Dt>0?jsxRuntime.jsxs("span",{className:c("text-sm font-mono",V?"text-white/60":"text-gray-500"),children:["$",Dt.toLocaleString("es-CO")]}):null,Za!==0&&Dt>0&&Vr>0&&jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",Za>0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Za>0?"+":"",Math.abs(Za)>=1e3?`$${(Za/1e3).toFixed(1)}K`:`$${Za}`]})]})})():jsxRuntime.jsx(Mr,{value:Pt>0?Pt:void 0,isDark:V,locale:f,disabled:true,lens:C,hourlyRate:B(P)}):ao(P,nr)},nr.id)),v&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]},P.id)}let fe=$===P.id,Ge=Fe===P.id,nt=Ge&&Le==="above",vt=Ge&&Le==="below",na=Ge&&Le==="child";return jsxRuntime.jsxs(framerMotion.motion.div,{"data-task-id":P.id,"data-listview-row":P.id,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:Se},className:c("flex items-center border-b transition-colors relative group",V?"border-[#222] hover:bg-white/[0.05]":"border-gray-100 hover:bg-gray-50",De===P.id&&(V?"!bg-[#FFD60A]/15":"!bg-yellow-100")),style:{opacity:fe?.4:1,backgroundColor:na?V?"rgba(0, 229, 204,0.08)":"rgba(0, 229, 204,0.05)":void 0,boxShadow:na?"inset 0 0 0 2px #00E5CC":void 0},onClick:()=>a.onTaskClick?.(P),onDoubleClick:()=>a.onTaskDoubleClick?.(P),onContextMenu:jt=>q(jt,P),children:[nt&&jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:"#00E5CC",zIndex:10}}),vt&&jsxRuntime.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:2,backgroundColor:"#00E5CC",zIndex:10}}),ut&&jsxRuntime.jsx("div",{className:"flex-shrink-0 flex items-center justify-center w-5 cursor-grab opacity-0 group-hover:opacity-40 hover:!opacity-80 transition-opacity",onMouseDown:jt=>Gt(P.id,jt),style:{color:V?"#888":"#999"},children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-3 h-3"})}),z.map(jt=>jsxRuntime.jsx("div",{className:c("flex items-center px-4 py-3 min-h-[56px]",jt.type!=="name"&&"justify-center"),style:{width:xo[jt.id],minWidth:jt.minWidth},children:jt.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[b&&P.level>0&&jsxRuntime.jsx("div",{style:{width:`${P.level*24}px`},className:"flex-shrink-0"}),b&&P.hasChildren&&jsxRuntime.jsx("button",{onClick:Pt=>{Pt.stopPropagation(),ne(P.id);},className:c("p-0.5 rounded flex-shrink-0",V?"hover:bg-white/[0.05]":"hover:bg-gray-200"),children:he?jsxRuntime.jsx(lucideReact.ChevronDown,{className:c("w-4 h-4",V?"text-white/60":"text-gray-400")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:c("w-4 h-4",V?"text-white/60":"text-gray-400")})}),b&&!P.hasChildren&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),jsxRuntime.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[(P.wbsCode||P.taskCode)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[P.wbsCode&&jsxRuntime.jsx("span",{className:c("text-[10px] font-mono",V?"text-[#00E5CC]":"text-[#00C4AE]"),children:P.wbsCode}),P.taskCode&&jsxRuntime.jsx("span",{className:c("text-[10px] font-mono",V?"text-white/40":"text-gray-400"),children:P.taskCode})]}),jsxRuntime.jsx("span",{className:c("truncate",P.hasChildren?"text-[14px] font-bold":"text-[13px] font-normal",P.progress===100?V?"line-through text-white/50":"line-through text-gray-400":P.hasChildren?V?"text-white":"text-gray-900":V?"text-[#D1D5DB]":"text-gray-600"),children:P.name}),P.tags?.[0]&&jsxRuntime.jsx("span",{className:"text-[9px] font-mono uppercase tracking-wide px-1.5 py-0.5 rounded w-fit",style:{backgroundColor:`${P.tags[0].color}20`,color:P.tags[0].color},children:P.tags[0].name})]})]}):ao(P,jt)},jt.id)),v&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]},P.id)})}),L&&yo.length>0&&(()=>{let{spent:P,allocated:te,quoted:he}=Re,Se=te-P,Me=Se<0,Qe=Me?`+${Zn(Math.abs(Se))} ${f==="es"?"EXCEDIDO":"OVER"}`:`+${Zn(Se)} ${f==="es"?"AHORRADO":"SAVED"}`,fe=C==="financial"&&_>0,Ge=Y?.breakdown,nt=!!Ge&&((Ge.equipment??0)>0||(Ge.travel??0)>0),vt=Ge?.laborSpent!=null?Ge.laborSpent:Y?.spent!=null?Y.spent:Re.dollarSpent,na=Ge?.laborAllocated!=null?Ge.laborAllocated:Y?.allocated!=null?Y.allocated:Re.dollarAllocated,jt=Y?.quoted!=null?Y.quoted:Re.dollarQuoted,Pt=(ua,Dt)=>{if(fe){let Vr=Dt??ua/60*_;return `$${Math.round(Vr).toLocaleString("es-CO")}`}return Zn(ua)},Qa=fe?Math.abs(na-vt):0,ia=fe?`+$${Qa.toLocaleString("es-CO",{minimumFractionDigits:0,maximumFractionDigits:0})} ${Me?f==="es"?"EXCEDIDO":"OVER":f==="es"?"AHORRADO":"SAVED"}`:Qe,nr=fe&&nt?f==="es"?"solo mano de obra":"labor only":void 0;return jsxRuntime.jsxs("div",{className:c("flex items-center sticky bottom-0 z-[5]",V?"border-t border-[#2A2A3A]":"border-t border-gray-300"),style:{backgroundColor:V?"rgba(13, 17, 23, 0.95)":"rgba(255, 255, 255, 0.95)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[ut&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),z.map(ua=>jsxRuntime.jsx("div",{className:c("flex items-center px-4 py-3",ua.type!=="name"&&"justify-center"),style:{width:xo[ua.id],minWidth:ua.minWidth},children:ua.type==="name"?jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:c("text-[11px] font-black uppercase tracking-widest",V?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:f==="es"?"TOTAL PROYECTO":"TOTAL PROJECT"}),nr&&jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono mt-0.5 flex items-center gap-1",V?"text-white/35":"text-gray-400"),children:[jsxRuntime.jsx(lucideReact.Info,{className:"w-2.5 h-2.5"}),nr]})]}):ua.type==="hoursBar"?jsxRuntime.jsxs("div",{className:"flex flex-col items-center w-full",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:c("text-[12px] font-bold",V?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:Pt(P,fe?vt:void 0)}),jsxRuntime.jsx("span",{className:c("text-[11px]",V?"text-white/40":"text-gray-400"),children:"/"}),jsxRuntime.jsx("span",{className:c("text-[11px]",V?"text-white/50":"text-gray-500"),style:{fontFamily:"JetBrains Mono, monospace"},children:Pt(te,fe?na:void 0)})]}),te>0&&jsxRuntime.jsx("span",{className:c("text-[10px] font-semibold mt-0.5 whitespace-nowrap",Me?"text-[#FF453A]":"text-[#32D74B]"),style:{fontFamily:"JetBrains Mono, monospace"},children:fe?ia:Qe})]}):ua.type==="soldEffortMinutes"?jsxRuntime.jsx("span",{className:c("text-[12px] font-bold",V?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:he>0?Pt(he,fe?jt:void 0):"\u2013"}):ua.type==="effortMinutes"?(()=>{if(fe&&he>0&&te>0){let Dt=Math.round(jt),Vr=Math.round(na),Za=Dt-Vr,rs=Dt>0?Math.round(Za/Dt*100):0;return jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx("span",{className:c("text-[12px] font-bold",V?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:Pt(te,na)}),jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",Za>=0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Za>=0?"+":"",Math.abs(Za)>=1e3?`$${(Za/1e3).toFixed(1)}K`:`$${Za}`,jsxRuntime.jsxs("span",{className:"ml-0.5 opacity-60",children:["(",rs,"%)"]})]})]})}return jsxRuntime.jsx("span",{className:c("text-[12px] font-bold",V?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:te>0?Pt(te,fe?na:void 0):"\u2013"})})():ua.type==="timeLoggedMinutes"?jsxRuntime.jsx("span",{className:c("text-[12px] font-bold",V?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:P>0?Pt(P,fe?vt:void 0):"\u2013"}):ua.type==="progress"?(()=>{let Dt=i0(xc(e||[]));return jsxRuntime.jsxs("span",{className:c("text-[12px] font-bold font-mono",V?"text-[#00E5CC]":"text-[#00C4AE]"),style:{fontFamily:"JetBrains Mono, monospace"},children:[Dt,"%"]})})():ua.type==="weight"?(()=>{let Dt=e||[],Vr=[],Za=vo=>{for(let oo of vo)Vr.push(oo),oo.subtasks?.length&&Za(oo.subtasks);};Za(Dt);let Ys=Vr.filter(vo=>!vo.subtasks?.length||vo.subtasks.length===0).reduce((vo,oo)=>vo+(oo.weight||0),0),os=Math.abs(Ys-100)<.1;return jsxRuntime.jsxs("span",{className:c("text-[12px] font-bold font-mono",os?V?"text-[#22C55E]":"text-green-600":"text-[#EF4444]"),style:{fontFamily:"JetBrains Mono, monospace"},children:[Number(Ys.toFixed(1)),"%"]})})():jsxRuntime.jsx("span",{className:c("text-[11px]",V?"text-white/30":"text-gray-300"),children:"\u2013"})},ua.id)),v&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]})})(),yo.length===0&&je&&jsxRuntime.jsx("div",{className:"flex items-center justify-center py-12",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(lucideReact.List,{className:c("w-12 h-12 mx-auto mb-4",V?"text-white/30":"text-gray-400")}),jsxRuntime.jsx("p",{className:c(V?"text-white/60":"text-gray-600"),children:K.empty.noResults})]})})]})}),ae?.enabled&&ae.data&&be&&jsxRuntime.jsx(t0,{data:ae.data,isDark:V,locale:f,onClose:()=>Ie(false),lens:t?.lens,onUnassignedTaskClick:P=>{let te=document.querySelector(`[data-task-id="${P}"]`);te&&(te.scrollIntoView({behavior:"smooth",block:"center"}),Ee(P),setTimeout(()=>Ee(null),2e3));}})]}),jsxRuntime.jsx(Rg,{state:Z,onClose:et,isDark:V,locale:f,onTaskEdit:a.onTaskEdit,onTaskDuplicate:a.onTaskDuplicate,onTaskDelete:a.onTaskDelete,onTaskUpdate:a.onTaskUpdate,onColumnHide:U,onColumnSort:Ne,availableUsers:l,onOpenTimeLog:a.onOpenTimeLog,onReportBlocker:a.onReportBlocker,onCopyTaskLink:a.onCopyTaskLink,onTaskMove:a.onTaskMove,onTaskIndent:a.onTaskIndent,onTaskOutdent:a.onTaskOutdent}),Ye&&st&&$&&reactDom.createPortal(jsxRuntime.jsx("div",{style:{position:"fixed",left:st.x+12,top:st.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let te=Pe.flattenTasks(e).find(he=>he.id===$);return te?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg",style:{backgroundColor:V?"rgba(10,10,10,0.9)":"rgba(255,255,255,0.95)",border:`1px solid ${V?"rgba(255,255,255,0.1)":"#e5e7eb"}`,backdropFilter:"blur(8px)",boxShadow:"0 4px 12px rgba(0,0,0,0.3)"},children:[jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-3 h-3",style:{color:"#00E5CC"}}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:V?"#e6edf3":"#111827"},children:te.name})]}):null})()}),document.body),jsxRuntime.jsx(Yg,{isOpen:k,onClose:()=>O(false),onSave:wa,isDark:V,locale:f})]})}var u0=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"priority",type:"priority",label:"Priority",width:100,visible:false,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true},{id:"tags",type:"tags",label:"Tags",width:150,visible:false,sortable:false,resizable:true},{id:"soldEffortMinutes",type:"soldEffortMinutes",label:"Quoted",width:100,visible:false,sortable:true,resizable:true},{id:"effortMinutes",type:"effortMinutes",label:"Estimated",width:100,visible:false,sortable:true,resizable:true},{id:"timeLoggedMinutes",type:"timeLoggedMinutes",label:"Executed",width:100,visible:false,sortable:true,resizable:true},{id:"scheduleVariance",type:"scheduleVariance",label:"Sched / Var",width:180,visible:false,sortable:true,resizable:true},{id:"hoursBar",type:"hoursBar",label:"Hours",width:200,visible:false,sortable:true,resizable:true},{id:"teamLoad",type:"teamLoad",label:"Team Load",width:160,visible:false,sortable:true,resizable:true},{id:"blockers",type:"blockers",label:"Blockers",width:150,visible:false,sortable:false,resizable:true},{id:"weight",type:"weight",label:"Weight",width:80,visible:false,sortable:true,resizable:true}],p0=[{type:"name",labelKey:"columns.name",icon:"Type"},{type:"status",labelKey:"columns.status",icon:"CircleDot"},{type:"priority",labelKey:"columns.priority",icon:"Flag"},{type:"assignees",labelKey:"columns.assignees",icon:"Users"},{type:"startDate",labelKey:"columns.startDate",icon:"Calendar"},{type:"endDate",labelKey:"columns.endDate",icon:"CalendarCheck"},{type:"progress",labelKey:"columns.progress",icon:"BarChart"},{type:"tags",labelKey:"columns.tags",icon:"Tag"},{type:"effortMinutes",labelKey:"columns.effortMinutes",icon:"Clock"},{type:"timeLoggedMinutes",labelKey:"columns.timeLoggedMinutes",icon:"Timer"},{type:"soldEffortMinutes",labelKey:"columns.soldEffortMinutes",icon:"FileText"},{type:"scheduleVariance",labelKey:"columns.scheduleVariance",icon:"CalendarClock"},{type:"hoursBar",labelKey:"columns.hoursBar",icon:"BarChart3"},{type:"teamLoad",labelKey:"columns.teamLoad",icon:"Users"},{type:"blockers",labelKey:"columns.blockers",icon:"AlertTriangle"},{type:"weight",labelKey:"columns.weight",icon:"Scale"}],m0=[{type:"text",labelKey:"customFields.text",icon:"Type"},{type:"number",labelKey:"customFields.number",icon:"Hash"},{type:"date",labelKey:"customFields.date",icon:"Calendar"},{type:"dropdown",labelKey:"customFields.dropdown",icon:"ChevronDown"},{type:"checkbox",labelKey:"customFields.checkbox",icon:"CheckSquare"}];var vc={bgPrimary:"#0D0D0D",bgSecondary:"#141414",bgHover:"rgba(255,255,255,0.05)",bgSelected:"#0D131E",bgAlternate:"#141414",border:"#222222",borderLight:"#1A1A1A",textPrimary:"rgba(255,255,255,0.9)",textSecondary:"rgba(255,255,255,0.6)",textMuted:"rgba(255,255,255,0.3)",accent:"#00E5CC",accentHover:"#2979FF",accentLight:"rgba(0,123,255,0.15)",statusTodo:"rgba(255,255,255,0.4)",statusInProgress:"#00E5CC",statusCompleted:"#34D399",focusRing:"#00E5CC",checkboxBg:"#1A1A1A",checkboxChecked:"#00E5CC",bgGroupHeader:"#222222",headerBg:"#1A1A1A",neonRed:"#FF2D20",neonGreen:"#3BF06E",neonAmber:"#FFD60A",neonBlue:"#3B9EFF"},wc={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgSelected:"#dbeafe",bgAlternate:"#f9fafb",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",checkboxBg:"#ffffff",checkboxChecked:"#0969da",bgGroupHeader:"#F3F4F6",headerBg:"#F9FAFB",neonRed:"#DC2626",neonGreen:"#16A34A",neonAmber:"#D97706",neonBlue:"#00E5CC"},kc={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgSelected:"#0f4c7520",bgAlternate:"#1a1a2e80",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",checkboxBg:"#1f3460",checkboxChecked:"#6366f1",bgGroupHeader:"#1f3460",headerBg:"#16213e",neonRed:"#EF4444",neonGreen:"#34D399",neonAmber:"#FBBF24",neonBlue:"#6366F1"},sl={dark:vc,light:wc,neutral:kc};function g0(e){return sl[e]||sl.dark}var Cc={navigation:{today:"Today",previous:"Previous",next:"Next",month:"Month",week:"Week",day:"Day"},weekdays:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weekdaysFull:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{allDay:"All day",moreEvents:"+{count} more",noEvents:"No tasks",newTask:"New Task",viewAll:"View all",week:"Week",backlogTitle:"BACKLOG / UNSCHEDULED",systemStatus:"SYSTEM STATUS",budgetUtil:"Budget Util.",variance:"VARIANCE",cost:"COST",estimate:"Est",sold:"Sold",cashOut:"Cash Out",typeToAdd:"Type to add (e.g., Crane Inspection)",critical:"CRITICAL",blocker:"Blocker",risk:"Risk",delay:"delay",days:"Days"},tooltips:{progress:"Progress",status:"Status",assignees:"Assignees",duration:"Duration",days:"days"}},Tc={navigation:{today:"Hoy",previous:"Anterior",next:"Siguiente",month:"Mes",week:"Semana",day:"D\xEDa"},weekdays:{sun:"Dom",mon:"Lun",tue:"Mar",wed:"Mi\xE9",thu:"Jue",fri:"Vie",sat:"S\xE1b"},weekdaysFull:{sunday:"Domingo",monday:"Lunes",tuesday:"Martes",wednesday:"Mi\xE9rcoles",thursday:"Jueves",friday:"Viernes",saturday:"S\xE1bado"},months:{january:"Enero",february:"Febrero",march:"Marzo",april:"Abril",may:"Mayo",june:"Junio",july:"Julio",august:"Agosto",september:"Septiembre",october:"Octubre",november:"Noviembre",december:"Diciembre"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{allDay:"Todo el d\xEDa",moreEvents:"+{count} m\xE1s",noEvents:"Sin tareas",newTask:"Nueva Tarea",viewAll:"Ver todo",week:"Semana",backlogTitle:"BACKLOG / SIN FECHA",systemStatus:"ESTADO DEL SISTEMA",budgetUtil:"Util. Presupuesto",variance:"VARIANZA",cost:"COSTO",estimate:"Est",sold:"Vendido",cashOut:"Desembolso",typeToAdd:"Escribe para agregar (ej: Inspecci\xF3n)",critical:"CR\xCDTICO",blocker:"Bloqueador",risk:"Riesgo",delay:"retraso",days:"D\xEDas"},tooltips:{progress:"Progreso",status:"Estado",assignees:"Asignados",duration:"Duraci\xF3n",days:"d\xEDas"}},il={en:Cc,es:Tc};function $s(e){return il[e]||il.en}function ll(e,t){let a=$s(e);return t?{navigation:{...a.navigation,...t.navigation},weekdays:{...a.weekdays,...t.weekdays},weekdaysFull:{...a.weekdaysFull,...t.weekdaysFull},months:{...a.months,...t.months},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},tooltips:{...a.tooltips,...t.tooltips}}:a}function f0(e){let t=$s(e);return [t.months.january,t.months.february,t.months.march,t.months.april,t.months.may,t.months.june,t.months.july,t.months.august,t.months.september,t.months.october,t.months.november,t.months.december]}function b0(e,t=0,a=true){let r=$s(e),n=a?[r.weekdays.sun,r.weekdays.mon,r.weekdays.tue,r.weekdays.wed,r.weekdays.thu,r.weekdays.fri,r.weekdays.sat]:[r.weekdaysFull.sunday,r.weekdaysFull.monday,r.weekdaysFull.tuesday,r.weekdaysFull.wednesday,r.weekdaysFull.thursday,r.weekdaysFull.friday,r.weekdaysFull.saturday];return [...n.slice(t),...n.slice(0,t)]}function zs(e){let t=[];function a(r){for(let n of r)t.push(n),n.subtasks?.length&&a(n.subtasks);}return a(e),t}function Dc(e,t){if(!t.startDate||!t.endDate)return false;let a=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(t.startDate.getFullYear(),t.startDate.getMonth(),t.startDate.getDate()),n=new Date(t.endDate.getFullYear(),t.endDate.getMonth(),t.endDate.getDate());return a>=r&&a<=n}function x0({task:e,isDark:t}){return e.progress===100||e.status==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-emerald-400 flex-shrink-0"}):e.progress&&e.progress>0||e.status==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3 h-3 text-[#007FFF] flex-shrink-0"}):jsxRuntime.jsx(lucideReact.Circle,{className:c("w-3 h-3 flex-shrink-0",t?"text-white/40":"text-gray-400")})}var k0=26,Mw=22,Pw=10;function v0(e,t){let a=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return Math.round((a-r)/(1e3*60*60*24))}function Sc(e,t="hours",a=0){if(!e||e<=0)return null;if(t==="financial"&&a>0){let n=Math.round(e/60*a);return n>=1e3?`$${(n/1e3).toFixed(1)}k`:`$${n}`}let r=Math.round(e/480);return r>0?`${r}d`:null}function C0(e,t="hours",a=0){if(e.soldEffortMinutes==null||e.effortMinutes==null)return null;let r=e.soldEffortMinutes-e.effortMinutes;if(r===0)return null;let n=r<0,s;if(t==="financial"&&a>0){let o=Math.round(Math.abs(r/60)*a);s=o>=1e3?`$${(o/1e3).toFixed(1)}k`:`$${o}`;}else {let o=Math.round(Math.abs(r)/60);s=o>=1e3?`$${(o/1e3).toFixed(1)}k`:`$${o}`;}return {text:`${n?"-":"+"}${s}`,isNegative:n}}function w0(e,t="hours",a=0){if(t==="financial"&&a>0){let n=Math.round(Math.abs(e/60)*a);return n>=1e3?`$${(n/1e3).toFixed(1)}k`:`$${n}`}let r=Math.round(Math.abs(e)/60);return r>=1e3?`$${(r/1e3).toFixed(1)}k`:`$${r}`}function Fw({segment:e,isDark:t,onClick:a,blurFinancials:r,isSelected:n,t:s,lens:o="hours",hourlyRate:l=0}){let{task:d,spanCols:i,lane:u,isStart:m,isEnd:p}=e,g=d.progress===100||d.status==="completed",f=d.isCriticalPath,x=m&&p?"rounded":m?"rounded-l":p?"rounded-r":"",y=p?Sc(d.effortMinutes,o,l):null,b=p?C0(d,o,l):null,h=p?d.blockers?.find(v=>v.severity==="critical"):null;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:v=>{v.stopPropagation(),a();},whileHover:{scale:1.005},className:c("absolute flex items-center gap-1.5 px-2 text-xs cursor-pointer overflow-hidden",x,g?t?"text-emerald-400":"bg-emerald-500/10 text-emerald-600 border border-emerald-200":f?t?"text-white/90":"bg-red-50 border border-red-200 text-red-700 hover:border-red-300":t?"text-white/90":"bg-gray-50 border border-gray-200 text-gray-700 hover:border-[#00E5CC]"),style:{top:`${u*k0}px`,left:"1px",width:`calc(${i*100}% - 2px)`,height:`${Mw}px`,zIndex:10,...t?g?{background:"rgba(16, 185, 129, 0.28)",border:"1px solid rgba(16, 185, 129, 0.50)",boxShadow:"0 0 14px rgba(16, 185, 129, 0.2), inset 0 0 14px rgba(16, 185, 129, 0.1)"}:f?{background:"rgba(239, 68, 68, 0.35)",border:"1px solid rgba(239, 68, 68, 0.65)",boxShadow:"0 0 18px rgba(239, 68, 68, 0.3), inset 0 0 18px rgba(239, 68, 68, 0.15)"}:{background:"rgba(18, 100, 255, 0.38)",border:"1px solid rgba(18, 100, 255, 0.65)",boxShadow:"0 0 18px rgba(18, 100, 255, 0.28), inset 0 0 18px rgba(18, 100, 255, 0.14)"}:{},borderLeftWidth:m?"3px":void 0,borderLeftColor:m?f?"#EF4444":g?"#10B981":"#1264FF":void 0,...n?{boxShadow:t?"0 0 0 1.5px rgba(0, 229, 255, 0.7), 0 0 12px rgba(0, 229, 255, 0.3)":"0 0 0 1.5px rgba(0, 229, 204, 0.7), 0 0 12px rgba(0, 229, 204, 0.2)",zIndex:20}:{}},children:[f&&m&&jsxRuntime.jsxs("span",{className:"text-[9px] font-mono font-bold text-red-400 uppercase tracking-wider flex-shrink-0",children:[s.labels.critical,":"]}),jsxRuntime.jsx("span",{className:"truncate flex-1 text-left font-medium",children:d.name}),p&&(y||b)&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0 text-[9px] font-mono text-white/35 ml-1",children:[y&&jsxRuntime.jsxs("span",{children:[s.labels.estimate,": ",y]}),b&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"text-white/15",children:"|"}),jsxRuntime.jsx("span",{className:c(b.isNegative?"text-red-400":"text-emerald-400",r&&"blur-sm select-none"),children:b.text})]})]}),h&&jsxRuntime.jsxs("span",{className:"flex-shrink-0 text-[8px] font-mono px-1.5 py-0.5 rounded bg-red-500/20 text-red-400 border border-red-500/30 ml-1",children:[s.labels.blocker,": ",h.type]}),d.progress>0&&d.progress<100&&jsxRuntime.jsx("div",{className:"absolute bottom-0 left-0 h-[2px] bg-[#1264FF]",style:{width:`${d.progress}%`}})]})}function T0({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:n=false,error:s,className:o,style:l,availableTags:d=[],onCreateTag:i,attachmentsByTask:u,comments:m,onAddComment:p,currentUser:g,mentionableUsers:f,onUploadCommentAttachments:x,onTaskOpen:y,enableTimeTracking:b,timeTrackingSummary:h,timeEntries:v,timerState:w,onLogTime:D,onUpdateEstimate:S,onUpdateSoldEffort:M,onStartTimer:T,onStopTimer:F,onDiscardTimer:A,blurFinancials:C=false,suppressDetailModal:_=false,lens:W="hours",hourlyRate:oe=0}){let{theme:L="dark",locale:Y="en",customTranslations:K,showBacklog:V=true}=t,B=ll(Y,K),X=L==="dark"||L==="neutral",[Ce,Re]=react.useState(r||new Date),[R,ae]=react.useState(null),[be,Ie]=react.useState(null),[De,Ee]=react.useState(null),[He,rt]=react.useState({}),pe=3,We=3,je=react.useCallback($=>{Ie($.id),_||ae($),y?.($.id);},[_,y]),[Oe,tt]=react.useState(null),wt=react.useCallback(()=>{Re(new Date(Ce.getFullYear(),Ce.getMonth()-1,1));},[Ce]),pt=react.useCallback(()=>{Re(new Date(Ce.getFullYear(),Ce.getMonth()+1,1));},[Ce]),Ue=react.useCallback(()=>{Re(new Date);},[]),ot=react.useMemo(()=>{let $=Ce.getFullYear(),re=Ce.getMonth(),Ye=new Date($,re,1),Te=new Date($,re+1,0),Fe=Ye.getDay(),ze=Te.getDate(),Le=zs(e),Ze=new Date;Ze.setHours(0,0,0,0);let st=[],yt=Fe,xt=new Date($,re,0).getDate();for(let ut=yt-1;ut>=0;ut--){let Gt=new Date($,re-1,xt-ut);st.push({date:Gt,isCurrentMonth:false,isToday:false,isWeekend:Gt.getDay()===0||Gt.getDay()===6,events:Le.filter(Mt=>Dc(Gt,Mt)).map(Mt=>({id:Mt.id,title:Mt.name,start:Mt.startDate,end:Mt.endDate,task:Mt}))});}for(let ut=1;ut<=ze;ut++){let Gt=new Date($,re,ut),Mt=Gt.getTime()===Ze.getTime();st.push({date:Gt,isCurrentMonth:true,isToday:Mt,isWeekend:Gt.getDay()===0||Gt.getDay()===6,events:Le.filter(It=>Dc(Gt,It)).map(It=>({id:It.id,title:It.name,start:It.startDate,end:It.endDate,task:It}))});}let $t=42-st.length;for(let ut=1;ut<=$t;ut++){let Gt=new Date($,re+1,ut);st.push({date:Gt,isCurrentMonth:false,isToday:false,isWeekend:Gt.getDay()===0||Gt.getDay()===6,events:Le.filter(Mt=>Dc(Gt,Mt)).map(Mt=>({id:Mt.id,title:Mt.name,start:Mt.startDate,end:Mt.endDate,task:Mt}))});}return st},[Ce,e]),Et=react.useMemo(()=>zs(e).filter($=>!$.startDate||!$.endDate),[e]),ge=react.useMemo(()=>{let $=zs(e),re=0,Ye=0,Te=0,Fe=0,ze=0;$.forEach(xt=>{xt.effortMinutes&&(re+=xt.effortMinutes),xt.soldEffortMinutes&&(Ye+=xt.soldEffortMinutes),xt.scheduleVariance!=null&&(Te+=xt.scheduleVariance,Fe++),xt.soldEffortMinutes&&xt.effortMinutes&&(ze+=xt.soldEffortMinutes-xt.effortMinutes);});let Le=Ye>0?Math.min(100,Math.round(re/Ye*100)):0,Ze=Fe>0?Math.round(Te/Fe):0,yt=`${ze<0?"-":"+"}${w0(ze,W,oe)}`;return {budgetUtil:Le,avgVariance:Ze,costDisplay:yt,hasCostData:Ye>0}},[e,W,oe]),mt=react.useMemo(()=>{let $=[0,0,0,0,0,0];return ot.forEach((re,Ye)=>{let Te=Math.floor(Ye/7);re.events.forEach(Fe=>{if(Fe.task.startDate&&Fe.task.soldEffortMinutes){let ze=new Date(Fe.task.startDate),Le=re.date;ze.getFullYear()===Le.getFullYear()&&ze.getMonth()===Le.getMonth()&&ze.getDate()===Le.getDate()&&Te<$.length&&($[Te]-=Fe.task.soldEffortMinutes);}});}),$},[ot]),k=react.useMemo(()=>{let $=zs(e),re=new Map,Ye=new Set,Te=[0,0,0,0,0,0];if(ot.length===0)return {segmentsByCell:re,multiDayTaskIds:Ye,maxLanesPerRow:Te};let Fe=yt=>new Date(yt.getFullYear(),yt.getMonth(),yt.getDate()),ze=Fe(ot[0].date),Le=Fe(ot[ot.length-1].date),Ze=[];for(let yt of $){if(!yt.startDate||!yt.endDate)continue;let xt=Fe(yt.startDate),$t=Fe(yt.endDate);if(xt.getTime()===$t.getTime()||$t<ze||xt>Le)continue;let ut=xt<ze?ze:xt,Gt=$t>Le?Le:$t,Mt=v0(ut,ze),It=v0(Gt,ze);Mt<0||Mt>41||It<0||It>41||Mt!==It&&(Ye.add(yt.id),Ze.push({task:yt,startIdx:Mt,endIdx:It}));}Ze.sort((yt,xt)=>yt.startIdx!==xt.startIdx?yt.startIdx-xt.startIdx:xt.endIdx-xt.startIdx-(yt.endIdx-yt.startIdx));let st=[[],[],[],[],[],[]];for(let{task:yt,startIdx:xt,endIdx:$t}of Ze){let ut=Math.floor(xt/7),Gt=Math.floor($t/7),Mt=Fe(yt.startDate),It=Fe(yt.endDate),Ft=false;for(let Ct=ut;Ct<=Gt;Ct++){let St=Ct===ut?xt%7:0,ct=Ct===Gt?$t%7:6,fa=ct-St+1,xa=0,H=st[Ct]??[];for(st[Ct]||(st[Ct]=H);xa<H.length&&(H[xa]??-1)>=St;)xa++;if(xa>=Pw){Ft=true;break}xa>=H.length?H.push(ct):H[xa]=ct,Te[Ct]=Math.max(Te[Ct]??0,xa+1);let se=Ct===ut&&Mt>=ze,at=Ct===Gt&&It<=Le,Xt=Ct*7+St,ee={taskId:yt.id,task:yt,rowIndex:Ct,startCol:St,endCol:ct,spanCols:fa,lane:xa,isStart:se,isEnd:at};re.has(Xt)||re.set(Xt,[]),re.get(Xt).push(ee);}Ft&&(Ye.delete(yt.id),re.forEach((Ct,St)=>{let ct=Ct.filter(fa=>fa.taskId!==yt.id);ct.length===0?re.delete(St):re.set(St,ct);}));}return {segmentsByCell:re,multiDayTaskIds:Ye,maxLanesPerRow:Te}},[ot,e]),O=Y==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Z=Ce.toLocaleDateString(Y==="es"?"es-ES":"en-US",{month:"long",year:"numeric"}),ve=Z.charAt(0).toUpperCase()+Z.slice(1);return n?jsxRuntime.jsx("div",{className:c("flex-1 flex items-center justify-center",X?"bg-[#050505]":"bg-white",o),style:l,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#007FFF]"}),jsxRuntime.jsxs("p",{className:c("text-sm font-mono",X?"text-white/30":"text-gray-600"),children:[B.labels.noEvents,"..."]})]})}):s?jsxRuntime.jsx("div",{className:c("flex-1 flex items-center justify-center",X?"bg-[#050505]":"bg-white",o),style:l,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:c("w-12 h-12 rounded-full flex items-center justify-center",X?"bg-red-500/10 border border-red-500/20":"bg-red-500/10"),children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:c("text-lg font-semibold mb-2",X?"text-white/90":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:c("text-sm",X?"text-white/40":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:c("flex-1 flex items-center justify-center",X?"bg-[#050505]":"bg-white",o),style:l,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:c("w-16 h-16 mx-auto mb-4 rounded-2xl flex items-center justify-center",X?"bg-[#007FFF]/10 border border-[#007FFF]/20":"bg-[#00E5CC]/10"),children:jsxRuntime.jsx(lucideReact.Calendar,{className:c("w-8 h-8",X?"text-[#007FFF]":"text-[#00E5CC]")})}),jsxRuntime.jsx("h3",{className:c("text-lg font-semibold mb-2",X?"text-white/90":"text-gray-900"),children:B.labels.noEvents}),jsxRuntime.jsx("p",{className:c("text-sm",X?"text-white/30":"text-gray-600"),children:B.labels.newTask})]})}):jsxRuntime.jsxs("div",{className:c("flex-1 flex flex-col w-full h-full overflow-hidden",X?"bg-[#050505]":"bg-white",o),style:l,children:[jsxRuntime.jsxs("div",{className:"flex flex-1 overflow-hidden relative",children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col min-w-0 relative overflow-hidden",children:[jsxRuntime.jsxs("div",{className:c("flex-shrink-0 h-10 flex items-center justify-between px-4 z-20",X?"bg-[#050505] border-b border-[#222]":"bg-white border-b border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[jsxRuntime.jsxs("div",{className:c("flex items-center gap-1.5 pl-2.5 pr-2 py-1 rounded-md text-xs transition-all",X?"bg-[#111] border border-white/10":"bg-gray-100 border border-gray-200"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:c("w-3.5 h-3.5",X?"text-[#007FFF]":"text-[#00E5CC]")}),jsxRuntime.jsx("span",{className:c("font-medium",X?"text-white":"text-gray-900"),children:Y==="es"?"Calendario":"Calendar"})]}),jsxRuntime.jsx("div",{className:c("h-4 w-px",X?"bg-white/10":"bg-gray-200")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 select-none",children:[jsxRuntime.jsx("button",{onClick:wt,className:c("w-6 h-6 flex items-center justify-center rounded transition-colors",X?"text-white/50 hover:text-white hover:bg-white/5":"text-gray-500 hover:text-gray-900 hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("span",{className:c("text-sm font-semibold tracking-tight min-w-[150px] text-center",X?"text-white":"text-gray-900"),children:ve}),jsxRuntime.jsx("button",{onClick:pt,className:c("w-6 h-6 flex items-center justify-center rounded transition-colors",X?"text-white/50 hover:text-white hover:bg-white/5":"text-gray-500 hover:text-gray-900 hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[t.toolbarRightContent&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t.toolbarRightContent,jsxRuntime.jsx("div",{className:c("h-4 w-px",X?"bg-white/10":"bg-gray-200")})]}),jsxRuntime.jsx("button",{onClick:Ue,className:c("px-2.5 py-1 text-xs rounded-md transition-all font-medium",X?"bg-white/5 border border-white/10 text-white/70 hover:bg-white/10 hover:text-white":"bg-gray-100 border border-gray-200 text-gray-700 hover:bg-gray-200"),children:B.navigation.today})]})]}),jsxRuntime.jsx("div",{className:c("grid grid-cols-7 sticky top-0 z-10",X?"bg-[#050505] border-b border-[#222]":"bg-white border-b border-gray-200"),children:O.map($=>jsxRuntime.jsx("div",{className:c("py-2 text-center text-[10px] font-bold uppercase tracking-widest",X?"text-white/60 font-mono":"text-gray-500"),children:$},$))}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:jsxRuntime.jsx("div",{className:c("grid grid-cols-7 min-h-[800px]",X?"bg-[#050505]":"bg-white"),style:{gridAutoRows:"minmax(140px, auto)"},onClick:()=>Ie(null),children:ot.map(($,re)=>{let Ye=re%7===6,Te=re>=35;return jsxRuntime.jsxs("div",{className:c("min-h-[140px] p-2 transition-colors flex flex-col relative group overflow-visible",!Ye&&(X?"border-r border-[#222]":"border-r border-gray-200"),!Te&&(X?"border-b border-[#222]":"border-b border-gray-200"),X?$.isCurrentMonth?"bg-[#050505] hover:bg-white/[0.02]":"bg-[#080808] opacity-50":$.isCurrentMonth?"bg-white hover:bg-gray-50":"bg-gray-50 opacity-50",$.isToday&&X&&"ring-1 ring-[#007FFF]/40 ring-inset bg-[#007FFF]/[0.03]",$.isToday&&!X&&"ring-2 ring-[#00E5CC] ring-inset"),children:[jsxRuntime.jsx("span",{className:c("text-xs font-mono select-none relative z-20",$.isToday?X?"text-[#007FFF] font-bold":"text-[#00C4AE] font-bold":$.isCurrentMonth?X?"text-white/60":"text-gray-900":X?"text-white/20":"text-gray-400"),children:String($.date.getDate()).padStart(2,"0")}),(()=>{let Fe=Math.floor(re/7),ze=(k.maxLanesPerRow[Fe]??0)*k0,Le=k.segmentsByCell.get(re);return ze===0&&!Le?null:jsxRuntime.jsx("div",{className:"relative -mx-2 overflow-visible",style:{minHeight:`${ze}px`,zIndex:5},children:Le?.map(Ze=>jsxRuntime.jsx(Fw,{segment:Ze,isDark:X,blurFinancials:C,isSelected:be===Ze.taskId,t:B,lens:W,hourlyRate:oe,onClick:()=>{je(Ze.task),a.onEventClick?.({id:Ze.task.id,title:Ze.task.name,start:Ze.task.startDate,end:Ze.task.endDate,task:Ze.task});}},Ze.taskId))})})(),(()=>{let Fe=$.events.filter(ze=>ze.task.isMilestone&&!k.multiDayTaskIds.has(ze.id));return Fe.length===0?null:jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-0.5 px-0.5",children:[Fe.slice(0,4).map(ze=>jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 flex-shrink-0 cursor-pointer",title:ze.title,onClick:Le=>{Le.stopPropagation(),je(ze.task);}},ze.id)),Fe.length>4&&jsxRuntime.jsxs("span",{className:c("text-[8px] font-mono",X?"text-white/30":"text-gray-400"),children:["+",Fe.length-4]})]})})(),(()=>{let Fe=[];$.events.forEach(Le=>{Le.task.blockers?.forEach(Ze=>{(Ze.severity==="warning"||Ze.severity==="critical")&&Fe.push({taskId:Le.id,type:Ze.type,severity:Ze.severity,variance:Le.task.scheduleVariance});});});let ze=Fe[0];return ze?jsxRuntime.jsx("div",{className:"mt-0.5 px-0.5",children:jsxRuntime.jsxs("div",{className:c("text-[8px] font-mono px-1.5 py-0.5 rounded flex items-center gap-1",ze.severity==="critical"?"bg-red-500/15 text-red-400 border border-red-500/20":"bg-amber-500/15 text-amber-400 border border-amber-500/20"),children:[jsxRuntime.jsx("span",{children:"\u26A0"}),jsxRuntime.jsxs("span",{className:"truncate",children:[B.labels.risk,": ",ze.type,ze.variance?` (+${Math.abs(ze.variance)}d ${B.labels.delay})`:""]})]})}):null})(),(()=>{let Fe=$.events.filter(st=>!k.multiDayTaskIds.has(st.id)),ze=He[re]||pe,Le=Fe.slice(0,ze),Ze=Fe.length-ze;return jsxRuntime.jsxs("div",{className:"mt-1 space-y-0.5 flex-1",children:[Le.map(st=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{je(st.task),a.onEventClick?.(st);},whileHover:{scale:1.01},className:c("w-full flex items-center gap-1.5 px-1.5 py-1 rounded text-[11px] transition-all text-left",st.task.progress===100||st.task.status==="completed"?X?"text-emerald-400":"bg-emerald-500/10 text-emerald-600":X?"text-white/90":"bg-gray-50 border border-gray-200 text-gray-700 hover:border-[#00E5CC]"),style:X?st.task.progress===100||st.task.status==="completed"?{background:"rgba(16, 185, 129, 0.28)",border:"1px solid rgba(16, 185, 129, 0.50)",boxShadow:"0 0 14px rgba(16, 185, 129, 0.2), inset 0 0 14px rgba(16, 185, 129, 0.1)"}:st.task.isCriticalPath?{background:"rgba(239, 68, 68, 0.35)",border:"1px solid rgba(239, 68, 68, 0.65)",boxShadow:"0 0 18px rgba(239, 68, 68, 0.3), inset 0 0 18px rgba(239, 68, 68, 0.15)"}:{background:"rgba(18, 100, 255, 0.38)",border:"1px solid rgba(18, 100, 255, 0.65)",boxShadow:"0 0 18px rgba(18, 100, 255, 0.28), inset 0 0 18px rgba(18, 100, 255, 0.14)"}:void 0,children:[jsxRuntime.jsx("span",{className:c("flex-shrink-0 text-[9px]",st.task.isMilestone?X?"text-amber-400":"text-amber-600":st.task.isCriticalPath?"text-red-400":X?"text-[#1264FF]":"text-gray-400"),children:st.task.isMilestone?"\u25C6":"\u25CF"}),jsxRuntime.jsx("span",{className:"truncate flex-1",children:st.title})]},st.id)),Ze>0&&jsxRuntime.jsxs("button",{onClick:st=>{st.stopPropagation(),rt(yt=>({...yt,[re]:ze+We}));},className:c("text-[10px] px-1.5 py-0.5 cursor-pointer font-mono font-medium uppercase tracking-wide transition-all rounded",X?"text-white/25 hover:text-white/50 hover:bg-white/5":"text-gray-400 hover:text-gray-600"),children:["+",Ze," ",Y==="es"?"m\xE1s":"more"]}),ze>pe&&Fe.length>pe&&jsxRuntime.jsx("button",{onClick:st=>{st.stopPropagation(),rt(yt=>({...yt,[re]:pe}));},className:c("text-[10px] px-1.5 py-0.5 cursor-pointer font-mono font-medium uppercase tracking-wide transition-all rounded",X?"text-white/25 hover:text-white/50 hover:bg-white/5":"text-gray-400 hover:text-gray-600"),children:Y==="es"?"menos":"less"})]})})(),$.isCurrentMonth&&a.onTaskCreate&&jsxRuntime.jsx("div",{className:"flex items-center justify-end mt-1",children:(()=>{let Fe=re>=28,ze=re%7>=5;return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:Le=>{Le.stopPropagation(),tt(Oe===re?null:re);},className:c("w-5 h-5 rounded flex items-center justify-center transition-all",Oe===re?"opacity-100 bg-[#007FFF] text-white":"opacity-0 group-hover:opacity-100",X?"hover:bg-[#007FFF] text-white/30 hover:text-white":"hover:bg-[#00E5CC] text-gray-400 hover:text-white"),children:jsxRuntime.jsx(lucideReact.Plus,{className:c("w-3.5 h-3.5 transition-transform",Oe===re&&"rotate-45")})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Oe===re&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>tt(null)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:Fe?-5:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:Fe?-5:5,scale:.95},transition:{duration:.12},className:c("absolute w-[320px] rounded-lg shadow-2xl z-50",Fe?"bottom-full mb-1":"top-full mt-1",ze?"right-0":"left-0",X?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08] shadow-[0_8px_32px_rgba(0,0,0,0.6)]":"bg-white border border-gray-200 shadow-xl"),children:jsxRuntime.jsx(ln,{onSubmit:Le=>{a.onTaskCreate?.({name:Le.name,startDate:Le.startDate||$.date,endDate:Le.endDate||$.date,priority:Le.priority,assignees:Le.assignee?[Le.assignee]:void 0}),tt(null);},onCancel:()=>tt(null),availableUsers:t.availableUsers,isDark:X,locale:Y==="es"?"es":"en",defaultDate:$.date,dropdownDirection:Fe?"up":"down"})})]})})]})})()}),re%7===6&&(()=>{let Fe=Math.floor(re/7),ze=mt[Fe];if(!ze||ze===0)return null;let Le=w0(ze,W,oe);return jsxRuntime.jsxs("div",{className:c("absolute bottom-1 right-2 text-[9px] font-mono font-bold tabular-nums z-20",ze<0?"text-red-400":"text-emerald-400",C&&"blur-sm select-none"),children:[B.labels.cashOut,": ",ze<0?"-":"+",Le]})})()]},re)})})})]}),V&&jsxRuntime.jsxs("aside",{className:c("w-[280px] flex-shrink-0 flex flex-col overflow-hidden",X?"bg-[#050505] border-l border-[#222]":"bg-white border-l border-gray-200"),children:[jsxRuntime.jsxs("div",{className:c("flex-shrink-0 h-14 flex items-center justify-between px-4",X?"bg-[#080808] border-b border-[#222]":"bg-gray-50 border-b border-gray-200"),children:[jsxRuntime.jsx("span",{className:c("text-[10px] font-mono font-bold uppercase tracking-[0.2em]",X?"text-white/40":"text-gray-500"),children:B.labels.backlogTitle}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsx("span",{className:c("text-[10px] font-mono tabular-nums",X?"text-white/20":"text-gray-400"),children:Et.length})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:Et.length===0?jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[jsxRuntime.jsx("div",{className:c("w-10 h-10 rounded-xl flex items-center justify-center mb-3",X?"bg-white/5":"bg-gray-100"),children:jsxRuntime.jsx(lucideReact.Calendar,{className:c("w-5 h-5",X?"text-white/20":"text-gray-400")})}),jsxRuntime.jsx("p",{className:c("text-xs font-mono",X?"text-white/20":"text-gray-400"),children:Y==="es"?"Sin tareas pendientes":"No unscheduled tasks"})]}):Et.map($=>jsxRuntime.jsxs("button",{onClick:()=>{je($);},className:c("w-full text-left rounded-md p-3 transition-all group/card",X?"bg-[#0A0A0A] border border-white/[0.05] hover:border-white/[0.12] hover:bg-[#0E0E0E]":"bg-white border border-gray-100 hover:border-gray-200 hover:shadow-sm"),children:[jsxRuntime.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[jsxRuntime.jsx("div",{className:c("w-1 h-1 rounded-full mt-1.5 flex-shrink-0",X?"bg-white/20":"bg-gray-300")}),jsxRuntime.jsx("span",{className:c("text-sm font-medium leading-snug line-clamp-2",X?"text-white/80 group-hover/card:text-white":"text-gray-800"),children:$.name})]}),$.tags&&$.tags.length>0&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-1 ml-3",children:[$.tags.slice(0,3).map(re=>jsxRuntime.jsx("span",{className:"text-[9px] font-mono uppercase tracking-wider px-1.5 py-0.5 rounded",style:{backgroundColor:`${re.color}15`,color:re.color,border:`1px solid ${re.color}30`},children:re.name},re.id)),$.tags.length>3&&jsxRuntime.jsxs("span",{className:c("text-[9px] font-mono px-1 py-0.5",X?"text-white/20":"text-gray-400"),children:["+",$.tags.length-3]})]}),($.effortMinutes||$.soldEffortMinutes)&&jsxRuntime.jsxs("div",{className:c("flex items-center gap-2 mt-1.5 ml-3 text-[9px] font-mono",X?"text-white/25":"text-gray-400",C&&"blur-sm select-none"),children:[Sc($.effortMinutes,W,oe)&&jsxRuntime.jsxs("span",{children:[B.labels.estimate,": ",Sc($.effortMinutes,W,oe)]}),(()=>{let re=C0($,W,oe);return re?jsxRuntime.jsx("span",{className:re.isNegative?"text-red-400":"text-emerald-400",children:re.text}):null})()]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mt-2 ml-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[$.priority&&jsxRuntime.jsx(lucideReact.Flag,{className:c("w-3 h-3",$.priority==="urgent"||$.priority==="high"?"text-red-400":$.priority==="medium"?"text-yellow-400":"text-green-400")}),jsxRuntime.jsx(x0,{task:$,isDark:X})]}),$.assignees&&$.assignees.length>0&&jsxRuntime.jsx("div",{className:"flex -space-x-1",children:$.assignees.slice(0,2).map((re,Ye)=>jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[8px] font-mono font-bold text-white ring-1 ring-[#050505]",style:{backgroundColor:re.color||"#007FFF"},title:re.name,children:re.initials||re.name?.slice(0,2).toUpperCase()},Ye))})]})]},$.id))}),a.onTaskCreate&&jsxRuntime.jsx("div",{className:c("flex-shrink-0 px-3 py-2.5 border-t",X?"border-[#222] bg-[#080808]":"border-gray-200 bg-gray-50"),children:jsxRuntime.jsx("input",{type:"text",placeholder:B.labels.typeToAdd,className:c("w-full text-[11px] font-mono bg-transparent outline-none",X?"text-white/70 placeholder:text-white/15":"text-gray-700 placeholder:text-gray-400"),onKeyDown:$=>{$.key==="Enter"&&$.target.value.trim()&&(a.onTaskCreate?.({name:$.target.value.trim()}),$.target.value="");}})}),ge.hasCostData&&jsxRuntime.jsxs("div",{className:c("flex-shrink-0 px-4 py-3 border-t space-y-2.5",X?"border-[#222] bg-[#080808]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsxs("div",{className:c("text-[10px] font-mono font-bold uppercase tracking-[0.2em]",X?"text-white/40":"text-gray-500"),children:["\u25C8 ",B.labels.systemStatus]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:c("text-[10px] font-mono",X?"text-white/40":"text-gray-500"),children:B.labels.budgetUtil}),jsxRuntime.jsxs("span",{className:c("text-[10px] font-mono font-bold tabular-nums",X?"text-white/60":"text-gray-700",C&&"blur-sm select-none"),children:[ge.budgetUtil,"%"]})]}),jsxRuntime.jsx("div",{className:c("h-1.5 rounded-full overflow-hidden",X?"bg-white/5":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${ge.budgetUtil}%`,background:ge.budgetUtil>90?"#EF4444":ge.budgetUtil>70?"#F59E0B":"linear-gradient(to right, #00E5CC, #8B5CF6)"}})})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[jsxRuntime.jsxs("div",{className:c("rounded-md px-2 py-1.5 text-center",X?"bg-white/[0.03] border border-white/[0.06]":"bg-gray-100 border border-gray-200"),children:[jsxRuntime.jsx("div",{className:c("text-[8px] font-mono uppercase tracking-wider mb-0.5",X?"text-white/25":"text-gray-400"),children:B.labels.variance}),jsxRuntime.jsxs("div",{className:c("text-[11px] font-mono font-bold tabular-nums",ge.avgVariance>0?"text-emerald-400":ge.avgVariance<0?"text-red-400":X?"text-white/50":"text-gray-600"),children:[ge.avgVariance>0?"+":"",ge.avgVariance," ",B.labels.days]})]}),jsxRuntime.jsxs("div",{className:c("rounded-md px-2 py-1.5 text-center",X?"bg-white/[0.03] border border-white/[0.06]":"bg-gray-100 border border-gray-200"),children:[jsxRuntime.jsx("div",{className:c("text-[8px] font-mono uppercase tracking-wider mb-0.5",X?"text-white/25":"text-gray-400"),children:B.labels.cost}),jsxRuntime.jsx("div",{className:c("text-[11px] font-mono font-bold tabular-nums",ge.costDisplay.startsWith("-")?"text-red-400":"text-emerald-400",C&&"blur-sm select-none"),children:ge.costDisplay})]})]})]})]})]}),!_&&jsxRuntime.jsx(To,{task:R,isOpen:!!R,onClose:()=>ae(null),onTaskUpdate:$=>{a.onTaskUpdate?.($),ae($);},theme:L==="dark"?"dark":"light",locale:Y,availableUsers:t.availableUsers?.map($=>({id:$.id,name:$.name,avatar:$.avatar,initials:$.name?.slice(0,2).toUpperCase()||"U",color:"#8B5CF6"}))||[],availableTags:d,onCreateTag:i,attachments:R?u?.get(R.id)||[]:[],onUploadAttachments:a.onUploadAttachments,onDeleteAttachment:a.onDeleteAttachment,availableTasks:zs(e).filter($=>$.id!==R?.id),comments:m?.filter($=>$.taskId===R?.id).map($=>({...$,createdAt:$.createdAt instanceof Date?$.createdAt:new Date($.createdAt),updatedAt:$.updatedAt instanceof Date?$.updatedAt:$.updatedAt?new Date($.updatedAt):void 0})),onAddComment:p,currentUser:g,mentionableUsers:f,onUploadCommentAttachments:x,enableTimeTracking:b,timeTrackingSummary:h,timeEntries:v,isTimerRunning:w?.isRunning,timerElapsedSeconds:w?.elapsedSeconds,onTimeLog:D,onEstimateUpdate:S,onSoldEffortUpdate:M,onTimerStart:T,onTimerStop:F,onTimerDiscard:A,blurFinancials:C}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:De&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>Ee(null),className:"fixed inset-0 bg-black/50 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:c("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[320px] max-h-[400px] rounded-xl shadow-2xl z-50 overflow-hidden",X?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08]":"bg-white border border-gray-200"),children:[jsxRuntime.jsxs("div",{className:c("px-4 py-3 border-b flex items-center justify-between",X?"border-white/[0.08] bg-[#080808]":"border-gray-200"),children:[jsxRuntime.jsx("span",{className:c("font-medium text-sm",X?"text-white/90":"text-gray-900"),children:De.date.toLocaleDateString(Y==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>Ee(null),className:c("p-1 rounded",X?"hover:bg-white/10 text-white/40":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),jsxRuntime.jsx("div",{className:"p-3 max-h-[320px] overflow-y-auto space-y-1.5",children:De.events.map($=>jsxRuntime.jsxs("button",{onClick:()=>{Ee(null),je($.task);},className:c("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",X?"hover:bg-white/5 border border-white/5":"hover:bg-gray-50 border border-gray-100"),children:[jsxRuntime.jsx(x0,{task:$.task,isDark:X}),jsxRuntime.jsx("span",{className:c("text-sm truncate flex-1",X?"text-white/80":"text-gray-900"),children:$.title}),($.task.priority==="high"||$.task.priority==="urgent")&&jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5 text-red-400"})]},$.id))})]})]})})]})}var Ec={bgPrimary:"#050505",bgSecondary:"#080808",bgHover:"rgba(255, 255, 255, 0.02)",bgToday:"rgba(0, 229, 204, 0.08)",bgWeekend:"#050505",bgOtherMonth:"#080808",border:"#222222",borderLight:"#1a1a1a",textPrimary:"rgba(255, 255, 255, 0.90)",textSecondary:"rgba(255, 255, 255, 0.60)",textMuted:"rgba(255, 255, 255, 0.30)",textToday:"#007FFF",accent:"#007FFF",accentHover:"#3399FF",accentLight:"rgba(0, 229, 204, 0.15)",statusTodo:"rgba(255, 255, 255, 0.40)",statusInProgress:"#007FFF",statusCompleted:"#34D399",focusRing:"#007FFF",glass:"rgba(20, 20, 20, 0.6)",glassBorder:"rgba(255, 255, 255, 0.08)",glassHover:"rgba(255, 255, 255, 0.05)",neonRed:"#FF2E2E",glowBlue:"0 0 10px rgba(0, 229, 204, 0.3)",glowRed:"0 0 10px rgba(255, 46, 46, 0.4)"},Mc={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgToday:"#dbeafe",bgWeekend:"#f9fafb",bgOtherMonth:"#f3f4f680",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",textToday:"#0969da",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",glass:"rgba(255, 255, 255, 0.8)",glassBorder:"rgba(0, 0, 0, 0.08)",glassHover:"rgba(0, 0, 0, 0.04)",neonRed:"#DC2626",glowBlue:"0 0 10px rgba(0, 229, 204, 0.15)",glowRed:"0 0 10px rgba(220, 38, 38, 0.2)"},Pc={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgToday:"#6366f120",bgWeekend:"#16213e80",bgOtherMonth:"#1a1a2e50",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",textToday:"#818cf8",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",glass:"rgba(26, 26, 46, 0.6)",glassBorder:"rgba(255, 255, 255, 0.06)",glassHover:"rgba(255, 255, 255, 0.04)",neonRed:"#EF4444",glowBlue:"0 0 10px rgba(99, 102, 241, 0.3)",glowRed:"0 0 10px rgba(239, 68, 68, 0.3)"},ul={dark:Ec,light:Mc,neutral:Pc};function N0(e){return ul[e]||ul.dark}function Lw({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:n,onUnstack:s,onDeleteStack:o,className:l}){let[d,i]=react.useState(false),u=react.useMemo(()=>t.filter(g=>e.cardIds.includes(g.id)),[t,e.cardIds]),m=react.useMemo(()=>{let g=u.length,f=new Set(u.flatMap(b=>b.assignedUserIds||[])).size,x=u.map(b=>b.priority).filter(Boolean),y=new Set(u.flatMap(b=>b.labels||[])).size;return {totalCards:g,uniqueAssignees:f,priorities:x,labels:y}},[u]),p=()=>{n?.(e.id);};return jsxRuntime.jsxs("div",{className:c("card-stack",!e.isExpanded&&"card-stack-collapsed",l),onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:p,children:[jsxRuntime.jsxs("div",{className:"card-stack-header-left",children:[jsxRuntime.jsx("button",{className:"card-stack-toggle","aria-label":e.isExpanded?"Collapse":"Expand",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:c("card-stack-chevron",e.isExpanded&&"expanded"),children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})})}),jsxRuntime.jsx("h3",{className:"card-stack-title",children:e.title}),jsxRuntime.jsx("div",{className:"card-stack-badge",children:m.totalCards}),jsxRuntime.jsxs("div",{className:"card-stack-strategy",children:[e.strategy==="ai-similarity"&&"\u2728 AI",e.strategy==="manual"&&"\u{1F464} Manual",e.strategy==="labels"&&"\u{1F3F7}\uFE0F Labels",e.strategy==="assignee"&&"\u{1F465} Assignee",e.strategy==="priority"&&"\u{1F3AF} Priority",e.strategy==="epic"&&"\u{1F4DA} Epic"]})]}),d&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:g=>{g.stopPropagation(),o?.(e.id);},"aria-label":"Delete stack",children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})})]}),!e.isExpanded&&jsxRuntime.jsxs("div",{className:"card-stack-summary",children:[jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxRuntime.jsxs("span",{children:[m.uniqueAssignees," assignees"]})]}),m.labels>0&&jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsxs("span",{children:[m.labels," labels"]})]}),e.confidence&&jsxRuntime.jsx("div",{className:"card-stack-summary-item",children:jsxRuntime.jsxs("span",{className:"card-stack-confidence",children:[Math.round(e.confidence*100),"% match"]})})]}),e.isExpanded&&jsxRuntime.jsx("div",{className:"card-stack-content",children:u.length===0?jsxRuntime.jsxs("div",{className:"card-stack-empty",children:[jsxRuntime.jsx("p",{children:"No cards in this stack"}),jsxRuntime.jsx("span",{children:"Drag cards here or delete this stack"})]}):jsxRuntime.jsx("div",{className:"card-stack-cards",children:u.map(g=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsxRuntime.jsx("div",{onClick:()=>r?.(g),children:a(g)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(g),children:[jsxRuntime.jsx("h4",{children:g.title}),g.description&&jsxRuntime.jsxs("p",{children:[g.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:f=>{f.stopPropagation(),s?.(e.id,g.id);},"aria-label":"Remove from stack",children:jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},g.id))})})]})}var S0={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function Ws(e){switch(e.type){case "created":return "Created card";case "status_changed":return `Changed status from "${e.changes.status?.from}" to "${e.changes.status?.to}"`;case "assignee_changed":return "Changed assignee";case "priority_changed":return `Changed priority from ${e.changes.priority?.from} to ${e.changes.priority?.to}`;case "moved":return `Moved from ${e.metadata?.fromColumn||"unknown"} to ${e.metadata?.toColumn||"unknown"}`;case "title_updated":return "Updated title";case "description_updated":return "Updated description";case "dates_changed":return "Changed dates";case "labels_changed":return "Updated labels";case "dependency_added":return "Added dependency";case "dependency_removed":return "Removed dependency";case "comment_added":return "Added comment";case "archived":return "Archived card";case "restored":return "Restored card";default:return "Updated card"}}function Vs(e){return {created:"\u2728",status_changed:"\u{1F504}",assignee_changed:"\u{1F464}",priority_changed:"\u{1F3AF}",moved:"\u27A1\uFE0F",title_updated:"\u270F\uFE0F",description_updated:"\u{1F4DD}",dates_changed:"\u{1F4C5}",labels_changed:"\u{1F3F7}\uFE0F",dependency_added:"\u{1F517}",dependency_removed:"\u26D3\uFE0F\u200D\u{1F4A5}",comment_added:"\u{1F4AC}",archived:"\u{1F4E6}",restored:"\u267B\uFE0F"}[e]||"\u{1F4CC}"}function E0(e){return {created:"#10b981",status_changed:"#00E5CC",assignee_changed:"#8b5cf6",priority_changed:"#f59e0b",moved:"#00E5CC",title_updated:"#6366f1",description_updated:"#6366f1",dates_changed:"#ec4899",labels_changed:"#00E5CC",dependency_added:"#a855f7",dependency_removed:"#ef4444",comment_added:"#84cc16",archived:"#6b7280",restored:"#10b981"}[e]||"#6b7280"}function M0({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:n,selectedEventId:s,config:o,className:l}){let d=react.useMemo(()=>({...S0,...o}),[o]),[i,u]=react.useState(new Set),m=react.useRef(null),p=react.useMemo(()=>{if(!d.groupByDay)return [{date:null,events:e}];let h=new Map;return e.forEach(v=>{let w=v.timestamp.toISOString().split("T")[0],D=h.get(w);D?D.push(v):h.set(w,[v]);}),Array.from(h.entries()).sort((v,w)=>w[0].localeCompare(v[0])).map(([v,w])=>({date:new Date(v),events:w.sort((D,S)=>S.timestamp.getTime()-D.timestamp.getTime())}))},[e,d.groupByDay]),{uniqueUsers:g,uniqueTypes:f}=react.useMemo(()=>{let h=new Set,v=new Set;return e.forEach(w=>{h.add(w.userId),v.add(w.type);}),{uniqueUsers:Array.from(h),uniqueTypes:Array.from(v)}},[e]),x=h=>{u(v=>{let w=new Set(v);return w.has(h)?w.delete(h):w.add(h),w});},y=h=>{let w=new Date().getTime()-h.getTime(),D=Math.floor(w/6e4),S=Math.floor(w/36e5),M=Math.floor(w/864e5);return D<1?"just now":D<60?`${D}m ago`:S<24?`${S}h ago`:M<7?`${M}d ago`:h.toLocaleDateString()},b=react.useMemo(()=>{let h=0;return t.types&&t.types.length>0&&h++,t.users&&t.users.length>0&&h++,t.dateRange&&h++,t.searchTerm&&h++,h},[t]);return react.useEffect(()=>{if(s&&m.current){let h=m.current.querySelector(`[data-event-id="${s}"]`);h&&h.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxRuntime.jsxs("div",{className:c("history-timeline-empty",l),children:[jsxRuntime.jsx("div",{className:"history-timeline-empty-icon",children:"\u{1F4DC}"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-text",children:"No history events yet"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-subtext",children:"Changes to this card will appear here"})]}):jsxRuntime.jsxs("div",{className:c("history-timeline",d.compact&&"compact",l),children:[jsxRuntime.jsxs("div",{className:"history-timeline-filters",children:[jsxRuntime.jsxs("div",{className:"history-timeline-filter-group",children:[jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.types?.[0]||"",onChange:h=>{let v=h.target.value;a({...t,types:v?[v]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),f.map(h=>jsxRuntime.jsxs("option",{value:h,children:[Vs(h)," ",h.replace("_"," ")]},h))]}),g.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:h=>{let v=h.target.value;a({...t,users:v?[v]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),g.map(h=>jsxRuntime.jsx("option",{value:h,children:h},h))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:h=>a({...t,searchTerm:h.target.value})})]}),b>0&&jsxRuntime.jsxs("button",{className:"history-timeline-filter-clear",onClick:r,children:["Clear filters (",b,")"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-container",ref:m,children:p.map(h=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[d.groupByDay&&h.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:h.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[h.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:h.events.map((v,w)=>{let D=i.has(v.id),S=s===v.id,M=E0(v.type);return jsxRuntime.jsxs("div",{"data-event-id":v.id,className:c("history-timeline-event",D&&"expanded",S&&"selected"),onClick:()=>n?.(v),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:M},children:d.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:Vs(v.type)})}),w<h.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:M}})]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-content",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header-left",children:[d.showAvatars&&v.userAvatar&&jsxRuntime.jsx("img",{src:v.userAvatar,alt:v.userName||v.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:v.userName||v.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:Ws(v)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:d.useRelativeTime?y(v.timestamp):v.timestamp.toLocaleString()})]}),Object.keys(v.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:T=>{T.stopPropagation(),x(v.id);},children:[D?"\u25BC":"\u25B6"," Show changes"]}),D&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(v.changes).map(([T,F])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[T,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(F.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(F.to)})]})]},T)),v.metadata&&Object.keys(v.metadata).length>0&&jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata",children:[jsxRuntime.jsx("div",{className:"history-timeline-event-metadata-title",children:"Additional Info:"}),Object.entries(v.metadata).map(([T,F])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[T,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(F)})]},T))]})]})]})]},v.id)})})]},h.date?.toISOString()||"all"))})]})}function F0({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:n,onPrevious:s,onNext:o,onGoToEvent:l,onSpeedChange:d,className:i}){let u=[.5,1,1.5,2,3],m=react.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),p=react.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:c("history-replay-empty",i),children:[jsxRuntime.jsx("div",{className:"history-replay-empty-icon",children:"\u23F3"}),jsxRuntime.jsx("p",{className:"history-replay-empty-text",children:"No history to replay"})]}):e?jsxRuntime.jsxs("div",{className:c("history-replay",i),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:m&&Vs(m.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:m&&Ws(m)}),jsxRuntime.jsxs("div",{className:"history-replay-event-meta",children:[jsxRuntime.jsxs("span",{className:"history-replay-event-index",children:["Event ",e.currentIndex+1," of ",e.totalEvents]}),jsxRuntime.jsx("span",{className:"history-replay-event-time",children:m&&m.timestamp.toLocaleString()})]})]})]}),jsxRuntime.jsxs("div",{className:"history-replay-progress-container",children:[jsxRuntime.jsx("input",{type:"range",className:"history-replay-progress-slider",min:"0",max:e.totalEvents-1,value:e.currentIndex,onChange:g=>l(parseInt(g.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${p}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((g,f)=>jsxRuntime.jsx("div",{className:c("history-replay-progress-marker",f===e.currentIndex&&"active"),style:{left:`${f/(e.totalEvents-1)*100}%`},onClick:()=>l(f),title:Ws(g)},g.id))})]}),jsxRuntime.jsxs("div",{className:"history-replay-controls",children:[jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:s,disabled:!e.canGoBack,title:"Previous event (\u2190)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"19 20 9 12 19 4 19 20"}),jsxRuntime.jsx("line",{x1:"5",y1:"19",x2:"5",y2:"5"})]})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-control-play",onClick:n,title:e.isPlaying?"Pause (Space)":"Play (Space)",children:e.isPlaying?jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[jsxRuntime.jsx("rect",{x:"6",y:"4",width:"4",height:"16"}),jsxRuntime.jsx("rect",{x:"14",y:"4",width:"4",height:"16"})]}):jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:o,disabled:!e.canGoForward,title:"Next event (\u2192)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"5 4 15 12 5 20 5 4"}),jsxRuntime.jsx("line",{x1:"19",y1:"5",x2:"19",y2:"19"})]})}),jsxRuntime.jsxs("div",{className:"history-replay-speed",children:[jsxRuntime.jsx("label",{className:"history-replay-speed-label",children:"Speed:"}),jsxRuntime.jsx("div",{className:"history-replay-speed-buttons",children:u.map(g=>jsxRuntime.jsxs("button",{className:c("history-replay-speed-btn",e.speed===g&&"active"),onClick:()=>d(g),children:[g,"x"]},g))})]}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-stop",onClick:r,title:"Stop replay (Esc)",children:jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("rect",{x:"6",y:"6",width:"12",height:"12"})})})]}),jsxRuntime.jsxs("div",{className:"history-replay-shortcuts",children:[jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Space"})," Play/Pause"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2190"})," Previous"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2192"})," Next"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Esc"})," Stop"]})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-header",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-title",children:"Card State at This Point"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-time",children:m&&m.timestamp.toLocaleDateString()})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-content",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Title:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.title})]}),e.cardState.description&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Description:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.description})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Priority:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.priority||"None"})]}),e.cardState.labels&&e.cardState.labels.length>0&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Labels:"}),jsxRuntime.jsx("div",{className:"history-replay-card-preview-labels",children:e.cardState.labels.map(g=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:g},g))})]})]})]})]}):jsxRuntime.jsxs("div",{className:c("history-replay-start",i),children:[jsxRuntime.jsxs("button",{className:"history-replay-start-button",onClick:a,children:[jsxRuntime.jsx("svg",{className:"history-replay-start-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),jsxRuntime.jsx("span",{children:"Start Time Travel"})]}),jsxRuntime.jsxs("p",{className:"history-replay-start-hint",children:["Replay ",t.length," events from this card's history"]})]})}function Fc(e){return {blocks:"#ef4444",blocked_by:"#dc2626",depends_on:"#f59e0b",required_by:"#d97706",relates_to:"#6b7280",duplicates:"#8b5cf6",parent_of:"#00E5CC",child_of:"#00C4AE",similar_to:"#10b981"}[e]||"#6b7280"}function Ac(e){return {blocks:"Blocks",blocked_by:"Blocked by",depends_on:"Depends on",required_by:"Required by",relates_to:"Relates to",duplicates:"Duplicates",parent_of:"Parent of",child_of:"Child of",similar_to:"Similar to"}[e]||e}function A0(e){return {blocks:"\u{1F6AB}",blocked_by:"\u26D4",depends_on:"\u{1F517}",required_by:"\u{1F4CC}",relates_to:"\u{1F504}",duplicates:"\u{1F4CB}",parent_of:"\u{1F4C2}",child_of:"\u{1F4C4}",similar_to:"\u{1F50D}"}[e]||"\u{1F517}"}function L0(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function Hw(e,t,a,r,n,s=100){let o=e.map(d=>({...d,x:d.x??a/2+Math.random()*100-50,y:d.y??r/2+Math.random()*100-50,vx:0,vy:0})),l=new Map(o.map(d=>[d.id,d]));for(let d=0;d<s;d++){let i=1-d/s;o.forEach(u=>{let m=a/2,p=r/2;u.vx+=(m-u.x)*n.centerForce*i,u.vy+=(p-u.y)*n.centerForce*i,o.forEach(g=>{if(u.id===g.id)return;let f=u.x-g.x,x=u.y-g.y,y=Math.sqrt(f*f+x*x)||1,b=n.chargeStrength*i/(y*y);u.vx+=f/y*b,u.vy+=x/y*b;});}),t.forEach(u=>{let m=l.get(typeof u.source=="string"?u.source:u.source.id),p=l.get(typeof u.target=="string"?u.target:u.target.id);if(!m||!p)return;let g=p.x-m.x,f=p.y-m.y,x=Math.sqrt(g*g+f*f)||1,y=(x-n.linkDistance)/x*n.forceStrength*i;m.vx+=g*y,m.vy+=f*y,p.vx-=g*y,p.vy-=f*y;}),o.forEach(u=>{u.fx!==null&&u.fx!==void 0?(u.x=u.fx,u.vx=0):u.x+=u.vx,u.fy!==null&&u.fy!==void 0?(u.y=u.fy,u.vy=0):u.y+=u.vy,u.x=Math.max(n.nodeSize,Math.min(a-n.nodeSize,u.x)),u.y=Math.max(n.nodeSize,Math.min(r-n.nodeSize,u.y)),u.vx*=.9,u.vy*=.9;});}return o}function I0({nodes:e,edges:t,config:a,filter:r,onFilterChange:n,criticalPath:s,stats:o,onInteraction:l,className:d}){let i=react.useRef(null),[u,m]=react.useState([]),[p,g]=react.useState(null),[f,x]=react.useState(null),[y,b]=react.useState(null),[h,v]=react.useState(1),[w,D]=react.useState({x:0,y:0});react.useEffect(()=>{if(e.length===0)return;let W=Hw(e,t,a.width,a.height,a,150);m(W);},[e,t,a]);let S=react.useCallback((W,oe)=>{a.enableDragging&&(oe.stopPropagation(),g(W));},[a.enableDragging]),M=react.useCallback(W=>{if(!p||!i.current)return;let L=i.current.getBoundingClientRect(),Y=(W.clientX-L.left-w.x)/h,K=(W.clientY-L.top-w.y)/h;m(V=>V.map(B=>B.id===p?{...B,x:Y,y:K,fx:Y,fy:K}:B));},[p,h,w]),T=react.useCallback(()=>{g(null);},[]),F=react.useCallback((W,oe)=>{oe.stopPropagation(),l?.({type:"node-click",node:W,position:{x:oe.clientX,y:oe.clientY}});},[l]),A=react.useCallback((W,oe)=>{oe.stopPropagation(),l?.({type:"edge-click",edge:W,position:{x:oe.clientX,y:oe.clientY}});},[l]),C=react.useCallback(W=>{let oe=u.find(L=>L.id===W);return oe?{x:oe.x,y:oe.y}:{x:0,y:0}},[u]),_=react.useCallback(W=>{if(W.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return W.card.columnId==="done"?"#10b981":"#00E5CC";case "priority":let oe=W.card.priority;return oe==="URGENT"?"#ef4444":oe==="HIGH"?"#f59e0b":oe==="MEDIUM"?"#00E5CC":"#6b7280";case "assignee":return W.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#00E5CC"}},[a.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:c("relationships-graph-empty",d),children:[jsxRuntime.jsx("div",{className:"relationships-graph-empty-icon",children:"\u{1F517}"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-text",children:"No relationships to display"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-subtext",children:"Add relationships between cards to see the graph"})]}):jsxRuntime.jsxs("div",{className:c("relationships-graph",d),children:[jsxRuntime.jsxs("div",{className:"relationships-graph-controls",children:[jsxRuntime.jsxs("div",{className:"relationships-graph-stats",children:[jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:o.totalNodes}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Cards"})]}),jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:o.totalEdges}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Relations"})]}),s&&jsxRuntime.jsxs("span",{className:"relationships-graph-stat relationships-graph-stat-critical",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:s.cardIds.length}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Critical Path"})]})]}),a.enableZoom&&jsxRuntime.jsxs("div",{className:"relationships-graph-zoom-controls",children:[jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>v(W=>Math.min(W+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(h*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>v(W=>Math.max(W-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{v(1),D({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(W=>W.type))).map(W=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:Fc(W)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[A0(W)," ",Ac(W)]})]},W))}),jsxRuntime.jsxs("svg",{ref:i,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:M,onMouseUp:T,onMouseLeave:T,children:[jsxRuntime.jsxs("g",{transform:`translate(${w.x}, ${w.y}) scale(${h})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map(W=>{let oe=C(typeof W.source=="string"?W.source:W.source.id),L=C(typeof W.target=="string"?W.target:W.target.id),Y=L0(W.type),K=y===W.id,V=W.onCriticalPath;return jsxRuntime.jsxs("g",{className:c("relationships-graph-edge",K&&"hovered",V&&"critical"),onMouseEnter:()=>b(W.id),onMouseLeave:()=>b(null),onClick:B=>A(W,B),children:[jsxRuntime.jsx("line",{x1:oe.x,y1:oe.y,x2:L.x,y2:L.y,stroke:Fc(W.type),strokeWidth:V?a.edgeWidth*2:a.edgeWidth,strokeOpacity:K?1:.6,markerEnd:Y?"url(#arrowhead)":void 0}),a.showEdgeLabels&&K&&jsxRuntime.jsx("text",{x:(oe.x+L.x)/2,y:(oe.y+L.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:Ac(W.type)})]},W.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:u.map(W=>{let oe=f===W.id,L=W.onCriticalPath;return jsxRuntime.jsxs("g",{className:c("relationships-graph-node",oe&&"hovered",L&&"critical"),transform:`translate(${W.x}, ${W.y})`,onMouseDown:Y=>S(W.id,Y),onMouseEnter:()=>x(W.id),onMouseLeave:()=>x(null),onClick:Y=>F(W,Y),children:[jsxRuntime.jsx("circle",{r:L?a.nodeSize*1.2:a.nodeSize,fill:_(W),stroke:L?"#fbbf24":"#ffffff",strokeWidth:L?3:2,opacity:oe?1:.9}),a.showLabels&&jsxRuntime.jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:W.card.title.length>20?W.card.title.substring(0,20)+"...":W.card.title})]},W.id)})})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:jsxRuntime.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#6b7280"})})})]})]})}function O0({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:n}){let[s,o]=react.useState(""),[l,d]=react.useState(false),[i,u]=react.useState(null),[m,p]=react.useState(null),g=react.useRef(null),f=l||n;react.useEffect(()=>{e&&g.current&&g.current.focus();},[e]),react.useEffect(()=>{let h=v=>{v.key==="Escape"&&!f&&x();};if(e)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,f]);let x=()=>{f||(o(""),u(null),p(null),t());},y=async()=>{if(!(!s.trim()||f)){d(true),u(null),p(null);try{let h=await r(s.trim());p(h);}catch(h){u(h instanceof Error?h.message:"Failed to generate plan");}finally{d(false);}}},b=()=>{m&&(a(m),x());};return e?jsxRuntime.jsxs(Qt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:x}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-2xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:h=>h.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-[#00E5CC]",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Generate Project Plan with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete Kanban board"})]}),jsxRuntime.jsx("button",{onClick:x,disabled:f,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:m?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Plan Generated Successfully!"})]}),m.explanation&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-[#00E5CC]/10 border border-[#00E5CC]/30",children:jsxRuntime.jsx("p",{className:"text-sm text-white/90",children:m.explanation})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",m.columns.length,")"]}),jsxRuntime.jsx("div",{className:"flex gap-2 flex-wrap",children:m.columns.map((h,v)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:h.title},v))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",m.cards.length,")"]}),jsxRuntime.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[m.cards.slice(0,10).map((h,v)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:h.title}),h.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:h.description})]}),h.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${h.priority==="URGENT"?"bg-red-500/20 text-red-400":h.priority==="HIGH"?"bg-orange-500/20 text-orange-400":h.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-[#00E5CC]/20 text-[#00E5CC]"}`,children:h.priority})]})},v)),m.cards.length>10&&jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",m.cards.length-10," more tasks..."]})]})]})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description"}),jsxRuntime.jsx("textarea",{ref:g,value:s,onChange:h=>o(h.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-[#00E5CC]/50 transition-all resize-none",disabled:f}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),i&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:i}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((h,v)=>jsxRuntime.jsx("button",{onClick:()=>o(h),disabled:f,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:h},v))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:f&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[#00E5CC] text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:x,disabled:f,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),m?jsxRuntime.jsx("button",{onClick:b,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Plan to Board"}):jsxRuntime.jsx("button",{onClick:y,disabled:!s.trim()||f,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #00E5CC 0%, #00E5CC 100%)",color:"#ffffff"},children:f?"Generating...":"Generate Plan"})]})]})]})})]}):null}var Lc={"gpt-4-turbo":{provider:"openai",name:"GPT-4 Turbo",contextWindow:128e3,costPer1kInput:.01,costPer1kOutput:.03,supportsVision:true,supportsJSON:true},"gpt-4":{provider:"openai",name:"GPT-4",contextWindow:8192,costPer1kInput:.03,costPer1kOutput:.06,supportsVision:false,supportsJSON:true},"gpt-3.5-turbo":{provider:"openai",name:"GPT-3.5 Turbo",contextWindow:16385,costPer1kInput:5e-4,costPer1kOutput:.0015,supportsVision:false,supportsJSON:true},"claude-3-5-sonnet-20241022":{provider:"anthropic",name:"Claude 3.5 Sonnet",contextWindow:2e5,costPer1kInput:.003,costPer1kOutput:.015,supportsVision:true,supportsJSON:true},"claude-3-opus-20240229":{provider:"anthropic",name:"Claude 3 Opus",contextWindow:2e5,costPer1kInput:.015,costPer1kOutput:.075,supportsVision:true,supportsJSON:true},"claude-3-haiku-20240307":{provider:"anthropic",name:"Claude 3 Haiku",contextWindow:2e5,costPer1kInput:25e-5,costPer1kOutput:.00125,supportsVision:true,supportsJSON:true}};var Uw={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},Ww={generatePlan:{enabled:true,minPlanTier:"hobby",estimatedTokens:2e3},predictRisks:{enabled:true,minPlanTier:"pro",estimatedTokens:1500},suggestAssignee:{enabled:true,minPlanTier:"hobby",estimatedTokens:800},generateReport:{enabled:true,minPlanTier:"enterprise",estimatedTokens:3e3},generateSubtasks:{enabled:true,minPlanTier:"hobby",estimatedTokens:1e3}};function Vw(e,t,a){let r=Lc[e];if(!r)throw new Error(`Unknown model: ${e}`);let n=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return n+s}function Gs(e){return `$${e.toFixed(4)}`}var Ic=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=Vw(t.model,t.inputTokens,t.outputTokens),r={...t,id:`op_${Date.now()}_${Math.random().toString(36).substring(7)}`,timestamp:new Date,cost:a};return this.operations.push(r),this.listeners.forEach(n=>n(r)),this.operations.length>1e3&&(this.operations=this.operations.slice(-1e3)),r}getStats(t){let a=this.operations;t&&(a=a.filter(m=>m.timestamp>=t.start&&m.timestamp<=t.end));let r=a.length,n=a.reduce((m,p)=>m+p.cost,0),s=a.reduce((m,p)=>m+p.inputTokens,0),o=a.reduce((m,p)=>m+p.outputTokens,0),l=a.filter(m=>m.success),d=a.reduce((m,p)=>m+p.duration,0),i={},u={};return a.forEach(m=>{i[m.feature]=(i[m.feature]||0)+1,u[m.feature]=(u[m.feature]||0)+m.cost;}),{totalOperations:r,totalCost:n,totalInputTokens:s,totalOutputTokens:o,operationsByFeature:i,costsByFeature:u,averageDuration:r>0?d/r:0,successRate:r>0?l.length/r:0}}getRecentOperations(t=10){return this.operations.slice(-t).reverse()}checkLimit(t,a="month"){let n={hobby:{month:50,day:5},pro:{month:500,day:50},enterprise:{month:2e3,day:200}}[t][a],s=new Date,o=new Date;a==="month"?o.setMonth(s.getMonth()-1):o.setDate(s.getDate()-1);let l=this.operations.filter(u=>u.timestamp>=o).length,d=Math.max(0,n-l),i=l/n*100;return {used:l,limit:n,remaining:d,percentUsed:i,isExceeded:l>=n}}subscribe(t){return this.listeners.push(t),()=>{let a=this.listeners.indexOf(t);a>-1&&this.listeners.splice(a,1);}}clear(){this.operations=[];}export(){return JSON.stringify(this.operations,null,2)}},xn=new Ic;function z0({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,n]=react.useState(xn.getStats()),[s,o]=react.useState(xn.checkLimit(a));if(react.useEffect(()=>{if(!e)return;let d=setInterval(()=>{n(xn.getStats()),o(xn.checkLimit(a));},1e3);return ()=>clearInterval(d)},[e,a]),react.useEffect(()=>{let d=i=>{i.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e,t]),!e)return null;let l=xn.getRecentOperations(5);return jsxRuntime.jsxs(Qt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:t}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:d=>d.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-white",children:"AI Usage Dashboard"}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Monitor your AI consumption and costs"})]}),jsxRuntime.jsx("button",{onClick:t,className:"text-white/60 hover:text-white transition-colors",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-xl bg-gradient-to-r from-[#00E5CC]/10 to-purple-500/10 border border-[#00E5CC]/30",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-white/90",children:["Monthly Usage (",a.toUpperCase(),")"]}),jsxRuntime.jsxs("span",{className:"text-sm font-bold text-white",children:[s.used," / ",s.limit]})]}),jsxRuntime.jsx("div",{className:"w-full h-2 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full transition-all",style:{width:`${Math.min(100,s.percentUsed)}%`,background:s.percentUsed>90?"#EF4444":s.percentUsed>70?"#F59E0B":"#10B981"}})}),jsxRuntime.jsxs("p",{className:"text-xs text-white/60 mt-2",children:[s.remaining," operations remaining this month"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Total Cost"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-green-400 mt-1",children:Gs(r.totalCost)})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Operations"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-[#00E5CC] mt-1",children:r.totalOperations})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Tokens Used"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-400 mt-1",children:(r.totalInputTokens+r.totalOutputTokens).toLocaleString()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:[r.totalInputTokens.toLocaleString()," in /"," ",r.totalOutputTokens.toLocaleString()," out"]})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Success Rate"}),jsxRuntime.jsxs("p",{className:"text-2xl font-bold text-green-400 mt-1",children:[(r.successRate*100).toFixed(1),"%"]}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:["Avg: ",r.averageDuration.toFixed(0),"ms"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Usage by Feature"}),jsxRuntime.jsx("div",{className:"space-y-2",children:Object.entries(r.operationsByFeature).map(([d,i])=>{let u=r.costsByFeature[d]||0,m=r.totalOperations>0?i/r.totalOperations*100:0;return jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90 capitalize",children:d.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[i," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Gs(u)})]})]}),jsxRuntime.jsx("div",{className:"w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full bg-[#00E5CC]",style:{width:`${m}%`}})})]},d)})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),l.length===0?jsxRuntime.jsx("p",{className:"text-sm text-white/50 text-center py-8",children:"No operations yet. Start using AI features!"}):jsxRuntime.jsx("div",{className:"space-y-2",children:l.map(d=>jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90 capitalize",children:d.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(d.timestamp).toLocaleTimeString()," \u2022"," ",d.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[d.inputTokens+d.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Gs(d.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${d.success?"bg-green-400":"bg-red-400"}`})]})]},d.id))})]})]}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("p",{className:"text-xs text-white/50",children:"Costs are estimates. Actual API charges may vary."}),jsxRuntime.jsx("button",{onClick:t,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80",children:"Close"})]})]})})]})}function V0({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:n,projectName:s}){let[o,l]=react.useState(""),[d,i]=react.useState(""),[u,m]=react.useState(""),[p,g]=react.useState(false),[f,x]=react.useState(null),[y,b]=react.useState(null),[h,v]=react.useState(null),w=react.useRef(null),D=p||n;react.useEffect(()=>{e&&w.current&&w.current.focus();},[e]),react.useEffect(()=>{let A=C=>{C.key==="Escape"&&!D&&S();};if(e)return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[e,D]);let S=()=>{D||(l(""),i(""),m(""),x(null),b(null),v(null),t());},M=async()=>{if(!(!o.trim()||D)){g(true),x(null),b(null),v(null);try{let A=await r({prompt:o.trim(),projectName:s||"Mi Proyecto",startDate:d||void 0,endDate:u||void 0});b(A.tasks.tasks),v({from_cache:A.from_cache,tokens_used:A.tokens_used,mock_mode:A.mock_mode,similarity:A.similarity,tokens_saved:A.tokens_saved});}catch(A){x(A instanceof Error?A.message:"Failed to generate tasks");}finally{g(false);}}},T=()=>{y&&(a(y),S());};if(!e)return null;let F=h?.similarity?((h.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(Qt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:S}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:A=>A.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-[#00E5CC]",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"9",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"14",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"19",width:"18",height:"2",rx:"1",fill:"currentColor"})]}),"Generate Gantt Tasks with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete task timeline"})]}),jsxRuntime.jsx("button",{onClick:S,disabled:D,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:y?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Tasks Generated Successfully!"})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[h?.mock_mode&&jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",children:"Mock Mode"}),h?.from_cache?jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-[#00E5CC]/20 text-[#00E5CC] border border-[#00E5CC]/30",children:["From Cache (",F,"% similar)"]}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-green-500/20 text-green-400 border border-green-500/30",children:"AI Generated"}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-purple-500/20 text-purple-400 border border-purple-500/30",children:[h?.tokens_used||0," tokens"]}),h?.tokens_saved&&jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:[h.tokens_saved," tokens saved"]}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-pink-500/20 text-pink-400 border border-pink-500/30",children:[y.length," tasks"]})]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:y.map((A,C)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 hover:bg-white/10 transition-colors",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/50",children:["#",C+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:A.name})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-xs text-white/60",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-white/40",children:[jsxRuntime.jsx("rect",{x:"1",y:"2",width:"10",height:"8",rx:"1",stroke:"currentColor"}),jsxRuntime.jsx("path",{d:"M1 4h10",stroke:"currentColor"})]}),A.start," \u2192 ",A.end]}),jsxRuntime.jsxs("span",{children:[A.duration," days"]}),A.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-[#00E5CC]",children:["Depends: ",A.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${A.priority==="high"?"bg-red-500/20 text-red-400":A.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-[#00E5CC]/20 text-[#00E5CC]"}`,children:A.priority})]})},A.id))})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description *"}),jsxRuntime.jsx("textarea",{ref:w,value:o,onChange:A=>l(A.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-[#00E5CC]/50 transition-all resize-none",disabled:D}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Start Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:d,onChange:A=>i(A.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-[#00E5CC]/50 transition-all",disabled:D})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"End Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:u,onChange:A=>m(A.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-[#00E5CC]/50 transition-all",disabled:D})]})]}),f&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:f}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((A,C)=>jsxRuntime.jsx("button",{onClick:()=>l(A),disabled:D,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:A},C))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:D&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-[#00E5CC] text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:S,disabled:D,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),y?jsxRuntime.jsx("button",{onClick:T,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Tasks to Gantt"}):jsxRuntime.jsx("button",{onClick:M,disabled:!o.trim()||D,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #00E5CC 0%, #00E5CC 100%)",color:"#ffffff"},children:D?"Generating...":"Generate Tasks"})]})]})]})})]})}function gl({initialBoard:e,onPersist:t}){let[a,r]=react.useState(e),n=react.useCallback(y=>{t&&ti(()=>Promise.resolve(t(y)),{maxAttempts:3,initialDelay:1e3,onRetry:(b,h,v)=>{console.warn(`Retry attempt ${h} after ${v}ms: ${b.message}`);}}).then(b=>{b.success||console.error(`Failed to persist board after ${b.attempts} attempts:`,b.error);});},[t]),s=react.useCallback(async(y,b,h)=>{r(v=>{let w=v.cards.find(A=>A.id===y);if(!w)return v;let D=w.columnId,S={...w,columnId:b,position:h},M=v.cards.map(A=>A.id===y?S:A),T=v.columns.map(A=>{if(A.id===D)return {...A,cardIds:A.cardIds.filter(C=>C!==y)};if(A.id===b){let C=M.filter(_=>_.columnId===b).sort((_,W)=>_.position-W.position);return {...A,cardIds:C.map(_=>_.id)}}return A}),F={...v,cards:M,columns:T};return n(F),F});},[n]),o=react.useCallback(async(y,b)=>{r(h=>{let v=h.cards.map(D=>D.id===y?{...D,...b}:D),w={...h,cards:v};return n(w),w});},[n]),l=react.useCallback(async y=>{let b=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(h=>{let v={...y,id:b},w=h.columns.map(S=>S.id===y.columnId?{...S,cardIds:[...S.cardIds,b]}:S),D={...h,cards:[...h.cards,v],columns:w};return n(D),D});},[n]),d=react.useCallback(async y=>{r(b=>{let h=b.cards.find(S=>S.id===y);if(!h)return b;let v=b.cards.filter(S=>S.id!==y),w=b.columns.map(S=>S.id===h.columnId?{...S,cardIds:S.cardIds.filter(M=>M!==y)}:S),D={...b,cards:v,columns:w};return n(D),D});},[n]),i=react.useCallback(async y=>{let b=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(h=>{let v={...y,id:b,cardIds:[]},w={...h,columns:[...h.columns,v]};return n(w),w});},[n]),u=react.useCallback(async(y,b)=>{r(h=>{let v=h.columns.map(D=>D.id===y?{...D,...b}:D),w={...h,columns:v};return n(w),w});},[n]),m=react.useCallback(async y=>{r(b=>{let h=b.cards.filter(D=>D.columnId!==y),v=b.columns.filter(D=>D.id!==y),w={...b,cards:h,columns:v};return n(w),w});},[n]),p=react.useCallback(y=>{let b=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return l(y),b},[l]),g=react.useCallback(y=>{let b=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return i(y),b},[i]),f=react.useCallback(()=>{r(y=>{let b={...y,cards:[],columns:[]};return n(b),b});},[n]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:o,onCardCreate:l,onCardDelete:d,onColumnCreate:i,onColumnUpdate:u,onColumnDelete:m},setBoard:r,helpers:{addCard:p,addColumn:g,deleteCard:d,deleteColumn:m,clearBoard:f}}}function j0({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:n,helpers:s}=gl({initialBoard:e,onPersist:a}),o=react.useMemo(()=>({addCard:(d,i,u={})=>{s.addCard({title:i,columnId:d,position:r.cards.filter(m=>m.columnId===d).length,...u});},addColumn:(d,i)=>{let u=r.columns.length>0?Math.max(...r.columns.map(m=>m.position)):0;s.addColumn({title:d,position:i??u+1e3});},reset:s.clearBoard}),[r.cards,r.columns,s]);return {props:react.useMemo(()=>({board:r,callbacks:n,availableUsers:t}),[r,n,t]),board:r,callbacks:n,utils:o}}var js={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},K0={by:"none",order:"asc"};function q0({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,n]=react.useState({...js,...e}),[s,o]=react.useState({...K0,...t}),l=react.useCallback(x=>{n(y=>({...y,...x}));},[]),d=react.useCallback(x=>{o(y=>({...y,...x}));},[]),i=react.useCallback(()=>{n(js),o(K0);},[]),u=react.useCallback(()=>{a&&n({...js,assignees:[a]});},[a]),m=react.useCallback(()=>{n({...js,dateFilter:"overdue"});},[]),p=react.useCallback(()=>{n({...js,priorities:["HIGH","URGENT"]});},[]),g=react.useMemo(()=>r.dateFilter!=="all"||r.priorities.length>0||r.assignees.length>0||r.labels.length>0||r.columns.length>0||r.search!==""||s.by!=="none",[r,s]),f=react.useCallback(x=>{let y=[...x];if(r.search){let b=r.search.toLowerCase();y=y.filter(h=>h.title.toLowerCase().includes(b)||h.description?.toLowerCase().includes(b));}if(r.dateFilter!=="all"){let b=new Date,h=b.getFullYear(),v=String(b.getMonth()+1).padStart(2,"0"),w=String(b.getDate()).padStart(2,"0"),D=`${h}-${v}-${w}`;y=y.filter(S=>{if(!S.endDate&&!S.dueDate)return false;let M=S.endDate||S.dueDate;if(!M)return false;let T;if(typeof M=="string")T=M.split("T")[0]||M;else {let F=M.getUTCFullYear(),A=String(M.getUTCMonth()+1).padStart(2,"0"),C=String(M.getUTCDate()).padStart(2,"0");T=`${F}-${A}-${C}`;}switch(r.dateFilter){case "overdue":return T<D;case "today":return T===D;case "this-week":let F=new Date(D+"T00:00:00"),A=new Date(T+"T00:00:00"),C=new Date(F);return C.setDate(C.getDate()+7),A>=F&&A<=C;case "custom":if(r.dateRange){let _=typeof M=="string"?new Date(M):M;return _>=r.dateRange.start&&_<=r.dateRange.end}return true;default:return true}});}return r.priorities.length>0&&(y=y.filter(b=>b.priority&&r.priorities.includes(b.priority))),r.assignees.length>0&&(y=y.filter(b=>(b.assignedUserIds||(b.assigneeId?[b.assigneeId]:[])).some(v=>r.assignees.includes(v)))),r.labels.length>0&&(y=y.filter(b=>b.labels&&b.labels.some(h=>r.labels.includes(h)))),r.columns.length>0&&(y=y.filter(b=>r.columns.includes(b.columnId))),s.by!=="none"&&y.sort((b,h)=>{let v=0;switch(s.by){case "created":let w=b.createdAt?new Date(b.createdAt).getTime():0,D=h.createdAt?new Date(h.createdAt).getTime():0;v=w-D;break;case "priority":let S={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},M=S[b.priority||"LOW"],T=S[h.priority||"LOW"];v=M-T;break;case "dueDate":let F=b.endDate||b.dueDate,A=h.endDate||h.dueDate;if(!F)return 1;if(!A)return -1;let C=typeof F=="string"?new Date(F).getTime():F.getTime(),_=typeof A=="string"?new Date(A).getTime():A.getTime();v=C-_;break;case "title":v=b.title.localeCompare(h.title);break;case "estimate":let W=b.estimatedTime||0,oe=h.estimatedTime||0;v=W-oe;break;default:v=0;}return s.order==="asc"?v:-v}),y},[r,s]);return {filters:r,sort:s,setFilters:l,setSort:d,resetFilters:i,filterMyTasks:u,filterOverdue:m,filterHighPriority:p,applyFilters:f,hasActiveFilters:g}}var X0,J0;if(typeof window<"u")try{let e=Qs("ai");X0=e.generateObject,J0=e.generateText;}catch{}function Q0(e={}){let[t,a]=react.useState(false),[r,n]=react.useState(null),s=!!(X0&&J0&&e.apiKey),o=react.useCallback(async m=>{if(!s)throw new Error('AI features require the "ai" package and an API key. Install with: npm install ai');a(true),n(null);try{return console.log("Generating plan for:",m),{columns:[{title:"To Do",position:1e3,cardIds:[]},{title:"In Progress",position:2e3,cardIds:[]},{title:"Done",position:3e3,cardIds:[]}],cards:[{title:"Generated task from AI",description:`Based on: ${m}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(p){let g=p instanceof Error?p:new Error("Failed to generate plan");throw n(g),g}finally{a(false);}},[s]),l=react.useCallback(async m=>{if(!s)throw new Error("AI features not available");a(true),n(null);try{return console.log("Suggesting assignee for:",m.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(p){let g=p instanceof Error?p:new Error("Failed to suggest assignee");throw n(g),g}finally{a(false);}},[s]),d=react.useCallback(async m=>{if(!s)throw new Error("AI features not available");a(true),n(null);try{return console.log("Analyzing board for risks..."),[{type:"RISK_OVERLOAD",severity:"HIGH",title:"Column overload detected",description:'Too many cards in "In Progress"',confidence:.9,suggestedAction:'Consider moving some cards back to "To Do"'}]}catch(p){let g=p instanceof Error?p:new Error("Failed to predict risks");throw n(g),g}finally{a(false);}},[s]),i=react.useCallback(async m=>{if(!s)throw new Error("AI features not available");a(true),n(null);try{return console.log("Generating subtasks for:",m.title),[{title:`Subtask 1 for: ${m.title}`,position:m.position+.1,columnId:m.columnId},{title:`Subtask 2 for: ${m.title}`,position:m.position+.2,columnId:m.columnId}]}catch(p){let g=p instanceof Error?p:new Error("Failed to generate subtasks");throw n(g),g}finally{a(false);}},[s]),u=react.useCallback(async m=>{if(!s)throw new Error("AI features not available");a(true),n(null);try{return console.log("Estimating effort for:",m.title),{hours:8,confidence:.75}}catch(p){let g=p instanceof Error?p:new Error("Failed to estimate effort");throw n(g),g}finally{a(false);}},[s]);return {onGeneratePlan:o,onSuggestAssignee:l,onPredictRisks:d,onGenerateSubtasks:i,onEstimateEffort:u,isAvailable:s,isLoading:t,error:r}}function Rc(){let[e,t]=react.useState(()=>core.selectionStore.getState());react.useEffect(()=>core.selectionStore.subscribe(n=>{t(n);}),[]);let a=react.useCallback(r=>{core.selectionStore.setState(r);},[]);return [e,a]}function Z0(e){let{cards:t}=e,[a,r]=Rc(),n=react.useCallback(m=>a.selectedCardIds.includes(m),[a.selectedCardIds]),s=react.useCallback((m,p)=>{if(!p){r({selectedCardIds:[m],lastSelectedCardId:m});return}let g=p.ctrlKey||p.metaKey,f=p.shiftKey;if(g)a.selectedCardIds.includes(m)?r({selectedCardIds:a.selectedCardIds.filter(x=>x!==m),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,m],lastSelectedCardId:m});else if(f&&a.lastSelectedCardId){let x=t.find(b=>b.id===m),y=t.find(b=>b.id===a.lastSelectedCardId);if(x&&y&&x.columnId===y.columnId){let b=t.filter(T=>T.columnId===x.columnId).sort((T,F)=>T.position-F.position),h=b.findIndex(T=>T.id===a.lastSelectedCardId),v=b.findIndex(T=>T.id===m),[w,D]=h<v?[h,v]:[v,h],S=b.slice(w,D+1).map(T=>T.id),M=Array.from(new Set([...a.selectedCardIds,...S]));r({selectedCardIds:M,lastSelectedCardId:m});}else r({selectedCardIds:[m],lastSelectedCardId:m});}else r({selectedCardIds:[m],lastSelectedCardId:m});},[t,a,r]),o=react.useCallback(m=>{r({selectedCardIds:a.selectedCardIds.filter(p=>p!==m),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),l=react.useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),d=react.useCallback(()=>{r({selectedCardIds:t.map(m=>m.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),i=react.useCallback(m=>{a.selectedCardIds.includes(m)?o(m):r({selectedCardIds:[...a.selectedCardIds,m],lastSelectedCardId:m});},[a,o,r]),u=react.useCallback(()=>t.filter(m=>a.selectedCardIds.includes(m.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:n,selectCard:s,deselectCard:o,clearSelection:l,selectAll:d,toggleCard:i,getSelectedCards:u}}var ef={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function tf(e){let{cards:t,config:a,aiService:r}=e,n=react.useMemo(()=>({...ef,...a}),[a]),[s,o]=react.useState([]),l=react.useCallback((x,y,b,h,v)=>{if(y.length<n.minCardsPerStack){console.warn(`Cannot create stack: minimum ${n.minCardsPerStack} cards required`);return}let w={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:x,cardIds:y,columnId:b,strategy:h,color:v,isExpanded:true,position:s.filter(D=>D.columnId===b).length,createdAt:new Date};o(D=>[...D,w]);},[n.minCardsPerStack,s]),d=react.useCallback(x=>{o(y=>y.filter(b=>b.id!==x));},[]),i=react.useCallback(x=>{o(y=>y.map(b=>b.id===x?{...b,isExpanded:!b.isExpanded}:b));},[]),u=react.useCallback((x,y)=>{o(b=>b.map(h=>h.id===x&&!h.cardIds.includes(y)?{...h,cardIds:[...h.cardIds,y]}:h));},[]),m=react.useCallback((x,y)=>{o(b=>b.map(h=>{if(h.id===x){let v=h.cardIds.filter(w=>w!==y);return v.length<n.minCardsPerStack?null:{...h,cardIds:v}}return h}).filter(h=>h!==null));},[n.minCardsPerStack]),p=react.useCallback(x=>s.filter(y=>y.columnId===x).sort((y,b)=>y.position-b.position),[s]),g=react.useCallback(async x=>{let y=t.filter(D=>D.columnId===x);if(y.length<n.minCardsPerStack*2)return [];let b=[],h=new Map;y.forEach(D=>{D.labels&&D.labels.length>0&&D.labels.forEach(S=>{h.has(S)||h.set(S,[]),h.get(S).push(D);});}),h.forEach((D,S)=>{D.length>=n.minCardsPerStack&&b.push({stack:{title:`\u{1F4CC} ${S}`,cardIds:D.map(M=>M.id),columnId:x,strategy:"labels",color:"#00E5CC"},reason:`${D.length} cards with label "${S}"`,confidence:.85});});let v=new Map;y.forEach(D=>{D.assignedUserIds&&D.assignedUserIds.length>0&&D.assignedUserIds.forEach(S=>{v.has(S)||v.set(S,[]),v.get(S).push(D);});}),v.forEach((D,S)=>{D.length>=n.minCardsPerStack&&b.push({stack:{title:`\u{1F464} Assigned to user-${S.slice(-4)}`,cardIds:D.map(M=>M.id),columnId:x,strategy:"assignee",color:"#8b5cf6"},reason:`${D.length} cards assigned to the same user`,confidence:.8});});let w=new Map;if(y.forEach(D=>{D.priority&&(w.has(D.priority)||w.set(D.priority,[]),w.get(D.priority).push(D));}),w.forEach((D,S)=>{if(D.length>=n.minCardsPerStack){let M={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[S.toLowerCase()]||"\u26AA";b.push({stack:{title:`${M} ${S} Priority`,cardIds:D.map(T=>T.id),columnId:x,strategy:"priority",color:S==="high"||S==="urgent"?"#ef4444":"#10b981"},reason:`${D.length} cards with ${S} priority`,confidence:.75});}}),r&&n.enableAutoStacking)for(let D of y){let M=(await r.findSimilar(D,y)).filter(T=>T.similarity>=n.autoStackConfidenceThreshold);if(M.length>=n.minCardsPerStack-1){let T=[D.id,...M.map(A=>A.card.id)],F=M.reduce((A,C)=>A+C.similarity,0)/M.length;b.push({stack:{title:`\u2728 Similar to "${D.title.substring(0,30)}${D.title.length>30?"...":""}"`,cardIds:T,columnId:x,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${M.length+1} similar tasks`,confidence:F});}}return b.filter(D=>D.confidence>=n.autoStackConfidenceThreshold).sort((D,S)=>S.confidence-D.confidence).slice(0,5)},[t,n,r]),f=react.useCallback(x=>{l(x.stack.title,x.stack.cardIds,x.stack.columnId,x.stack.strategy,x.stack.color);},[l]);return react.useEffect(()=>{n.enableAutoStacking&&s.length===0&&new Set(t.map(y=>y.columnId)).forEach(async y=>{let b=await g(y),h=b[0];b.length>0&&h&&h.confidence>=.9&&f(h);});},[]),{stacks:s,createStack:l,deleteStack:d,toggleStack:i,addToStack:u,removeFromStack:m,getStacksForColumn:p,getSuggestions:g,applySuggestion:f,config:n}}var af=react.createContext(null);function rf({children:e,initialData:t,onStateChange:a}){let r=react.useRef();if(!r.current){let s=new Map,o=new Map;t?.columns?.forEach(d=>{let{Column:i}=Qs("@libxai/core");s.set(d.id,new i(d));}),t?.cards?.forEach(d=>{let{Card:i}=Qs("@libxai/core");o.set(d.id,new i(d));});let l=null;if(t?.board){let{Board:d}=Qs("@libxai/core");l=new d(t.board);}r.current=new core.BoardStore({board:l,columns:s,cards:o});}let n=r.current;return react.useEffect(()=>{if(a)return n.subscribeAll(s=>{a(n.getState());})},[n,a]),jsxRuntime.jsx(af.Provider,{value:{store:n},children:e})}function fl(){let e=react.useContext(af);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function Ks(){let e=fl(),[t,a]=react.useState(e.getBoard()),[r,n]=react.useState(e.getAllColumns()),[s,o]=react.useState(e.getAllCards());react.useEffect(()=>e.subscribeAll(()=>{a(e.getBoard()),n(e.getAllColumns()),o(e.getAllCards());}),[e]);let l=react.useCallback(h=>{e.updateBoard(h);},[e]),d=react.useCallback(h=>{e.addColumn(h);},[e]),i=react.useCallback((h,v)=>{e.updateColumn(h,v);},[e]),u=react.useCallback(h=>{e.deleteColumn(h);},[e]),m=react.useCallback(h=>e.getColumn(h),[e]),p=react.useCallback(h=>{e.addCard(h);},[e]),g=react.useCallback((h,v)=>{e.updateCard(h,v);},[e]),f=react.useCallback(h=>{e.deleteCard(h);},[e]),x=react.useCallback((h,v,w)=>{e.moveCard(h,v,w);},[e]),y=react.useCallback(h=>e.getCard(h),[e]),b=react.useCallback(h=>e.getCardsByColumn(h),[e]);return {board:t,columns:r,cards:s,updateBoard:l,addColumn:d,updateColumn:i,deleteColumn:u,getColumn:m,addCard:p,updateCard:g,deleteCard:f,moveCard:x,getCard:y,getCardsByColumn:b}}function nf(e){let{cards:t}=Ks();return react.useMemo(()=>e?t.filter(a=>{if(e.searchQuery){let r=e.searchQuery.toLowerCase(),n=a.title.toLowerCase().includes(r),s=a.description?.toLowerCase().includes(r);if(!n&&!s)return false}return !(e.priorities&&e.priorities.length>0&&(!a.priority||!e.priorities.includes(a.priority))||e.statuses&&e.statuses.length>0&&(!a.status||!e.statuses.includes(a.status))||e.assignedUserIds&&e.assignedUserIds.length>0&&!e.assignedUserIds.some(n=>a.isAssignedTo(n))||e.labels&&e.labels.length>0&&!e.labels.some(n=>a.hasLabel(n))||e.columnIds&&e.columnIds.length>0&&!e.columnIds.includes(a.columnId)||e.isOverdue!==void 0&&e.isOverdue!==a.isOverdue())}):t,[t,e])}function sf(e="position",t="asc"){let{cards:a}=Ks();return react.useMemo(()=>[...a].sort((n,s)=>{let o=0;switch(e){case "title":o=n.title.localeCompare(s.title);break;case "priority":{let l={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},d=n.priority?l[n.priority]:0,i=s.priority?l[s.priority]:0;o=d-i;break}case "createdAt":o=n.createdAt.getTime()-s.createdAt.getTime();break;case "updatedAt":o=n.updatedAt.getTime()-s.updatedAt.getTime();break;case "position":o=n.position-s.position;break}return t==="asc"?o:-o}),[a,e,t])}var bl=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=hu.child("PluginManager");}setContext(t){this.context=t;}register(t){if(!t.id||!t.name||!t.version)throw new Error("Plugin must have id, name, and version");if(this.plugins.has(t.id)&&this.pluginLogger.warn(`Plugin ${t.id} is already registered, overwriting...`),t.dependencies){for(let a of t.dependencies)if(!this.plugins.has(a))throw new Error(`Plugin ${t.id} depends on ${a} which is not registered`)}this.plugins.set(t.id,t),t.defaultConfig&&this.config.set(t.id,{...t.defaultConfig}),this.enabled.add(t.id),this.pluginLogger.info(`Plugin registered: ${t.name} v${t.version}`),t.onInit&&this.context&&Promise.resolve(t.onInit(this.context)).catch(a=>{this.pluginLogger.error(`Failed to initialize plugin ${t.id}`,a,{plugin:t.id});});}unregister(t){let a=this.plugins.get(t);if(!a){this.pluginLogger.warn(`Plugin ${t} is not registered`);return}a.onDestroy&&Promise.resolve(a.onDestroy()).catch(r=>{this.pluginLogger.error(`Failed to destroy plugin ${t}`,r);}),this.plugins.delete(t),this.enabled.delete(t),this.config.delete(t),this.pluginLogger.info(`Plugin unregistered: ${a.name}`);}getPlugin(t){return this.plugins.get(t)}getPlugins(){return Array.from(this.plugins.values())}hasPlugin(t){return this.plugins.has(t)}setEnabled(t,a){if(!this.plugins.has(t))throw new Error(`Plugin ${t} is not registered`);a?(this.enabled.add(t),this.pluginLogger.info(`Plugin enabled: ${t}`)):(this.enabled.delete(t),this.pluginLogger.info(`Plugin disabled: ${t}`));}isEnabled(t){return this.enabled.has(t)}getConfig(t,a){return this.config.get(t)?.[a]}setConfig(t,a,r){this.config.has(t)||this.config.set(t,{});let n=this.config.get(t);n[a]=r,this.pluginLogger.debug(`Plugin config set: ${t}.${a}`,{value:r});}async executeHook(t,a,r){let n=r;for(let s of this.plugins.values()){if(!this.enabled.has(s.id))continue;let o=s[t];if(typeof o=="function")try{let l=await Promise.resolve(o.apply(s,a));l!==void 0&&(n=l,a[0]=l);}catch(l){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,l,{plugin:s.id,hook:t});}}return n}async executeHookParallel(t,a){let r=[];for(let n of this.plugins.values()){if(!this.enabled.has(n.id))continue;let s=n[t];typeof s=="function"&&r.push(Promise.resolve(s.apply(n,a)).catch(o=>{this.pluginLogger.error(`Plugin hook failed: ${n.id}.${t}`,o,{plugin:n.id,hook:t});}));}await Promise.all(r);}},s5=new bl;function df({items:e,height:t,estimateSize:a,renderItem:r,className:n="",overscan:s=5,horizontal:o=false,gap:l=0,getItemKey:d}){let i=react.useRef(null),u=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>i.current,estimateSize:()=>a,overscan:s,horizontal:o,gap:l}),m=u.getVirtualItems(),p={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},g=o?{width:`${u.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${u.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:i,style:p,className:n,children:jsxRuntime.jsx("div",{style:g,children:m.map(f=>{let x=e[f.index];if(!x)return null;let y=d?d(x,f.index):f.index,b={position:"absolute",top:o?0:f.start,left:o?f.start:0,width:o?f.size:"100%",height:o?"100%":f.size};return jsxRuntime.jsx("div",{style:b,"data-index":f.index,children:r(x,f.index)},y)})})})}function cf(e){return reactVirtual.useVirtualizer({count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateSize,overscan:e.overscan??5,horizontal:e.horizontal??false,gap:e.gap??0})}function pf({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:n,className:s="",overscan:o=3,gap:l=16,getItemKey:d,horizontal:i=true}){let u=react.useRef(null),m=reactVirtual.useVirtualizer({horizontal:i,count:e.length,getScrollElement:()=>u.current,estimateSize:()=>r,overscan:o,gap:l}),p=m.getVirtualItems(),g={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},f={width:`${m.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:u,style:g,className:s,children:jsxRuntime.jsx("div",{style:f,children:p.map(x=>{let y=e[x.index];if(!y)return null;let b=d?d(y,x.index):x.index,h={position:"absolute",top:0,left:x.start,width:x.size,height:"100%"};return jsxRuntime.jsx("div",{style:h,"data-index":x.index,children:n(y,x.index)},b)})})})}function mf(e){let t=reactVirtual.useVirtualizer({horizontal:true,count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateColumnWidth,overscan:e.overscan??3,gap:e.gap??0});return {columnVirtualizer:t,virtualColumns:t.getVirtualItems(),totalWidth:t.getTotalSize()}}function gf(e,t=10){return e>t}var zc={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},Uc={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},Wc={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},Vc={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Gc={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},jc={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},_c={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},Kc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",smooth:"cubic-bezier(0.4, 0.0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0.0, 0.6, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},qc={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},Yc={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Xc={column:{width:320,minWidth:280,maxWidth:400,gap:16,padding:12,headerHeight:48},card:{minHeight:80,maxHeight:400,padding:12,gap:8},board:{padding:16,gap:16}},Jc={timeline:{headerHeight:60,rowHeight:44,minRowHeight:32,maxRowHeight:80,taskPadding:4,gridLineWidth:1},task:{height:28,minHeight:20,maxHeight:40,borderRadius:4,padding:6},dependency:{lineWidth:2,arrowSize:8},scale:{day:{columnWidth:40,minColumnWidth:30,maxColumnWidth:60},week:{columnWidth:80,minColumnWidth:60,maxColumnWidth:120},month:{columnWidth:120,minColumnWidth:80,maxColumnWidth:200},quarter:{columnWidth:200,minColumnWidth:150,maxColumnWidth:300}},milestone:{size:16,rotation:45}},hl={spacing:zc,borderRadius:Uc,fontSize:Wc,fontWeight:Vc,lineHeight:Gc,zIndex:jc,duration:_c,easing:Kc,shadows:qc,opacity:Yc,kanban:Xc,gantt:Jc};function ff(e,t,a){return e[t]??a}function Qc(e,t="",a={}){for(let[r,n]of Object.entries(e)){let s=t?`${t}-${r}`:r;typeof n=="object"&&n!==null&&!Array.isArray(n)?Qc(n,s,a):(typeof n=="string"||typeof n=="number")&&(a[s]=n);}return a}function d5(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function Zc(e="asakaa"){let t=Qc(hl),a=[];for(let[r,n]of Object.entries(t)){let s=`--${e}-${r}`,o=d5(n);a.push(` ${s}: ${o};`);}return `:root {
|
|
414
414
|
${a.join(`
|
|
415
415
|
`)}
|
|
416
416
|
}`}function qs(e,t="asakaa"){let a=[],r=Qc(e);for(let[n,s]of Object.entries(r)){let o=`--${t}-color-${n}`;a.push(` ${o}: ${s};`);}return `:root {
|
|
@@ -440,5 +440,5 @@ ${qs(tu,"asakaa").split(`
|
|
|
440
440
|
`)}
|
|
441
441
|
}
|
|
442
442
|
`}var c5=({theme:e})=>{switch(e){case "dark":return 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:"M13.5 8.5C13.5 11.2614 11.2614 13.5 8.5 13.5C5.73858 13.5 3.5 11.2614 3.5 8.5C3.5 5.73858 5.73858 3.5 8.5 3.5C8.66667 3.5 8.83074 3.50926 8.99199 3.52734C8.10635 4.35233 7.5 5.53318 7.5 6.85C7.5 9.33579 9.49421 11.33 11.98 11.33C12.5933 11.33 13.1751 11.2075 13.7069 10.9844C13.5698 11.8951 13.2042 12.7349 12.6674 13.4367",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});case "light":return 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:"3",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M8 1V2M8 14V15M15 8H14M2 8H1M12.5 12.5L11.8 11.8M4.2 4.2L3.5 3.5M12.5 3.5L11.8 4.2M4.2 11.8L3.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]});case "neutral":return 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:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M5 8L8 8L8 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}};function hf({showLabels:e=true,compact:t=false,className:a=""}){let{theme:r,setTheme:n,themes:s}=Rn();return jsxRuntime.jsx("div",{className:`theme-switcher ${t?"theme-switcher--compact":""} ${a}`,children:Object.entries(s).map(([o,l])=>{let d=o,i=d===r;return jsxRuntime.jsxs("button",{onClick:()=>n(d),className:`theme-switcher__button ${i?"theme-switcher__button--active":""}`,"aria-label":`Switch to ${l.displayName} theme`,"aria-pressed":i,title:l.displayName,children:[jsxRuntime.jsx("span",{className:"theme-switcher__icon","aria-hidden":"true",children:jsxRuntime.jsx(c5,{theme:d})}),e&&!t&&jsxRuntime.jsx("span",{className:"theme-switcher__label",children:l.displayName})]},d)})})}
|
|
443
|
-
Object.defineProperty(exports,"BoardModel",{enumerable:true,get:function(){return core.Board}});Object.defineProperty(exports,"BoardStore",{enumerable:true,get:function(){return core.BoardStore}});Object.defineProperty(exports,"CardModel",{enumerable:true,get:function(){return core.Card}});Object.defineProperty(exports,"ColumnModel",{enumerable:true,get:function(){return core.Column}});Object.defineProperty(exports,"DependencyEngine",{enumerable:true,get:function(){return core.DependencyEngine}});Object.defineProperty(exports,"Store",{enumerable:true,get:function(){return core.Store}});exports.AIUsageDashboard=z0;exports.AI_FEATURES=Ww;exports.AI_MODELS=Lc;exports.AddCardButton=td;exports.AddColumnButton=Xl;exports.AttachmentUploader=uo;exports.BoardProvider=rf;exports.BulkOperationsToolbar=Ti;exports.BurnDownChart=md;exports.CUSTOM_FIELD_TYPES=m0;exports.CalendarBoard=T0;exports.Card=ko;exports.CardDetailModal=id;exports.CardDetailModalV2=cd;exports.CardHistoryReplay=F0;exports.CardHistoryTimeline=M0;exports.CardRelationshipsGraph=I0;exports.CardStack=Lw;exports.CardTemplateSelector=vd;exports.CircuitBreaker=Ml;exports.Column=Mn;exports.ColumnManager=Pi;exports.CommandPalette=od;exports.ConfigMenu=Td;exports.ContextMenu=zn;exports.DEFAULT_SHORTCUTS=ws;exports.DEFAULT_TABLE_COLUMNS=u0;exports.DEFAULT_TEMPLATES=xd;exports.DateRangePicker=is;exports.DependenciesSelector=ds;exports.DependencyLine=Es;exports.DistributionCharts=gd;exports.EditableColumnTitle=Ol;exports.ErrorBoundary=An;exports.ExportDropdown=dm;exports.ExportImportModal=kd;exports.FilterBar=Cd;exports.GANTT_AI_SYSTEM_PROMPT=Wm;exports.GanttAIAssistant=Vi;exports.GanttBoard=$m;exports.GanttI18nContext=$n;exports.GanttMilestone=$i;exports.GanttToolbar=Mi;exports.GenerateGanttTasksDialog=V0;exports.GeneratePlanModal=O0;exports.GroupBySelector=hd;exports.HealthBar=Vl;exports.KanbanBoard=Ho;exports.KanbanToolbar=ql;exports.KanbanViewAdapter=ys;exports.KeyboardShortcutsHelp=yd;exports.ListView=c0;exports.MenuIcons=ga;exports.PluginManager=bl;exports.PrioritySelector=an;exports.ProfitabilityReport=Gl;exports.QuickTaskCreate=ln;exports.RATE_LIMITS=Uw;exports.STANDARD_FIELDS=p0;exports.SwimlaneBoardView=fd;exports.TagBadge=Hl;exports.TagList=ep;exports.TagPicker=Ro;exports.TaskBar=Li;exports.TaskDetailModal=To;exports.TaskFormModal=Um;exports.TaskGrid=Ai;exports.ThemeModal=Ed;exports.ThemeProvider=Jp;exports.ThemeSwitcher=hf;exports.TimeInputPopover=io;exports.TimePill=zl;exports.TimePopover=Ul;exports.Timeline=zi;exports.UserAssignmentSelector=on;exports.VelocityChart=pd;exports.VirtualGrid=pf;exports.VirtualList=df;exports.aiUsageTracker=xn;exports.borderRadius=Uc;exports.calculatePosition=ei;exports.calendarDarkTheme=Ec;exports.calendarEnTranslations=Cc;exports.calendarEsTranslations=Tc;exports.calendarLightTheme=Mc;exports.calendarNeutralTheme=Pc;exports.calendarThemes=ul;exports.calendarTranslations=il;exports.cardToGanttTask=_i;exports.cardsToGanttTasks=Ym;exports.cn=c;exports.createKanbanView=Pp;exports.createRetryWrapper=Yf;exports.darkTheme=Nd;exports.darkTokenTheme=yl;exports.defaultTheme=Di;exports.designTokens=hl;exports.duration=_c;exports.easing=Kc;exports.exportTokensToCSS=bf;exports.findTaskByName=Mo;exports.fontSize=Wc;exports.fontWeight=Vc;exports.formatCost=Gs;exports.ganttEnTranslations=Ei;exports.ganttEsTranslations=Zp;exports.ganttTaskToCardUpdate=qm;exports.ganttThemes=
|
|
443
|
+
Object.defineProperty(exports,"BoardModel",{enumerable:true,get:function(){return core.Board}});Object.defineProperty(exports,"BoardStore",{enumerable:true,get:function(){return core.BoardStore}});Object.defineProperty(exports,"CardModel",{enumerable:true,get:function(){return core.Card}});Object.defineProperty(exports,"ColumnModel",{enumerable:true,get:function(){return core.Column}});Object.defineProperty(exports,"DependencyEngine",{enumerable:true,get:function(){return core.DependencyEngine}});Object.defineProperty(exports,"Store",{enumerable:true,get:function(){return core.Store}});exports.AIUsageDashboard=z0;exports.AI_FEATURES=Ww;exports.AI_MODELS=Lc;exports.AddCardButton=td;exports.AddColumnButton=Xl;exports.AttachmentUploader=uo;exports.BoardProvider=rf;exports.BulkOperationsToolbar=Ti;exports.BurnDownChart=md;exports.CUSTOM_FIELD_TYPES=m0;exports.CalendarBoard=T0;exports.Card=ko;exports.CardDetailModal=id;exports.CardDetailModalV2=cd;exports.CardHistoryReplay=F0;exports.CardHistoryTimeline=M0;exports.CardRelationshipsGraph=I0;exports.CardStack=Lw;exports.CardTemplateSelector=vd;exports.CircuitBreaker=Ml;exports.Column=Mn;exports.ColumnManager=Pi;exports.CommandPalette=od;exports.ConfigMenu=Td;exports.ContextMenu=zn;exports.DEFAULT_SHORTCUTS=ws;exports.DEFAULT_TABLE_COLUMNS=u0;exports.DEFAULT_TEMPLATES=xd;exports.DateRangePicker=is;exports.DependenciesSelector=ds;exports.DependencyLine=Es;exports.DistributionCharts=gd;exports.EditableColumnTitle=Ol;exports.ErrorBoundary=An;exports.ExportDropdown=dm;exports.ExportImportModal=kd;exports.FilterBar=Cd;exports.GANTT_AI_SYSTEM_PROMPT=Wm;exports.GanttAIAssistant=Vi;exports.GanttBoard=$m;exports.GanttI18nContext=$n;exports.GanttMilestone=$i;exports.GanttToolbar=Mi;exports.GenerateGanttTasksDialog=V0;exports.GeneratePlanModal=O0;exports.GroupBySelector=hd;exports.HealthBar=Vl;exports.KanbanBoard=Ho;exports.KanbanToolbar=ql;exports.KanbanViewAdapter=ys;exports.KeyboardShortcutsHelp=yd;exports.ListView=c0;exports.MenuIcons=ga;exports.PluginManager=bl;exports.PrioritySelector=an;exports.ProfitabilityReport=Gl;exports.QuickTaskCreate=ln;exports.RATE_LIMITS=Uw;exports.STANDARD_FIELDS=p0;exports.SwimlaneBoardView=fd;exports.TagBadge=Hl;exports.TagList=ep;exports.TagPicker=Ro;exports.TaskBar=Li;exports.TaskDetailModal=To;exports.TaskFormModal=Um;exports.TaskGrid=Ai;exports.ThemeModal=Ed;exports.ThemeProvider=Jp;exports.ThemeSwitcher=hf;exports.TimeInputPopover=io;exports.TimePill=zl;exports.TimePopover=Ul;exports.Timeline=zi;exports.UserAssignmentSelector=on;exports.VelocityChart=pd;exports.VirtualGrid=pf;exports.VirtualList=df;exports.aiUsageTracker=xn;exports.borderRadius=Uc;exports.calculatePosition=ei;exports.calendarDarkTheme=Ec;exports.calendarEnTranslations=Cc;exports.calendarEsTranslations=Tc;exports.calendarLightTheme=Mc;exports.calendarNeutralTheme=Pc;exports.calendarThemes=ul;exports.calendarTranslations=il;exports.cardToGanttTask=_i;exports.cardsToGanttTasks=Ym;exports.cn=c;exports.createKanbanView=Pp;exports.createRetryWrapper=Yf;exports.darkTheme=Nd;exports.darkTokenTheme=yl;exports.defaultTheme=Di;exports.designTokens=hl;exports.duration=_c;exports.easing=Kc;exports.exportTokensToCSS=bf;exports.findTaskByName=Mo;exports.fontSize=Wc;exports.fontWeight=Vc;exports.formatCost=Gs;exports.ganttEnTranslations=Ei;exports.ganttEsTranslations=Zp;exports.ganttTaskToCardUpdate=qm;exports.ganttThemes=ft;exports.ganttTokens=Jc;exports.ganttTranslations=Md;exports.ganttUtils=Pe;exports.generateCSSVariables=Zc;exports.generateCompleteCSS=au;exports.generateInitialPositions=jf;exports.generateTasksContext=Vm;exports.generateThemeVariables=qs;exports.getCalendarTheme=N0;exports.getCalendarTranslations=$s;exports.getListViewTheme=g0;exports.getListViewTranslations=Qd;exports.getMonthNames=f0;exports.getToken=ff;exports.getTranslations=em;exports.getWeekdayNames=b0;exports.kanbanTokens=Xc;exports.lightTheme=Dd;exports.lightTokenTheme=eu;exports.lineHeight=Gc;exports.listViewDarkTheme=vc;exports.listViewEnTranslations=Xd;exports.listViewEsTranslations=Jd;exports.listViewLightTheme=wc;exports.listViewNeutralTheme=kc;exports.listViewThemes=sl;exports.listViewTranslations=Ki;exports.mergeCalendarTranslations=ll;exports.mergeListViewTranslations=qi;exports.mergeTranslations=Pd;exports.neutralTheme=Sd;exports.neutralTokenTheme=tu;exports.opacity=Yc;exports.parseLocalCommand=_m;exports.parseNaturalDate=Kd;exports.parseNaturalDuration=qd;exports.parseProgress=Yd;exports.parseStatus=jm;exports.pluginManager=s5;exports.retrySyncOperation=qf;exports.retryWithBackoff=ti;exports.shadows=qc;exports.shouldVirtualizeGrid=gf;exports.spacing=zc;exports.themes=un;exports.useAI=Q0;exports.useBoard=j0;exports.useBoardCore=Ks;exports.useBoardStore=fl;exports.useCardStacking=tf;exports.useDragState=_l;exports.useFilteredCards=nf;exports.useFilters=q0;exports.useGanttI18n=Hr;exports.useKanbanState=gl;exports.useKeyboardShortcuts=qp;exports.useMultiSelect=Z0;exports.useSelectionState=Rc;exports.useSortedCards=sf;exports.useTheme=Rn;exports.useVirtualGrid=mf;exports.useVirtualList=cf;exports.validateAIResponse=Km;exports.withErrorBoundary=ad;exports.wouldCreateCircularDependency=ri;exports.zIndex=jc;//# sourceMappingURL=index.cjs.map
|
|
444
444
|
//# sourceMappingURL=index.cjs.map
|