@libxai/board 0.17.17 → 0.17.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -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'),ul=require('html2canvas'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime'),reactDropzone=require('react-dropzone'),framerMotion=require('framer-motion'),cmdk=require('cmdk'),rm=require('react-markdown'),om=require('remark-gfm'),nm=require('rehype-sanitize'),recharts=require('recharts'),lucideReact=require('lucide-react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ul__default=/*#__PURE__*/_interopDefault(ul);var rm__default=/*#__PURE__*/_interopDefault(rm);var om__default=/*#__PURE__*/_interopDefault(om);var nm__default=/*#__PURE__*/_interopDefault(nm);var Fr=(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 Br=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 [Br.Translate.toString(e),Br.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:a,easing:r}=e;return t+" "+a+"ms "+r}}});function F(...e){return tailwindMerge.twMerge(clsx.clsx(e))}function Rr(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 Vd(e){return Array.from({length:e},(t,a)=>(a+1)*1e3)}function Po(e,t){return e.length===0?1e3:t===0?Rr(null,e[0].position):t>=e.length?Rr(e[e.length-1].position,null):Rr(e[t-1].position,e[t].position)}function Fs(e,t=100){return e>t}var jd=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 Kd(e,t,a,r){let o=t*Math.pow(a,e-1),n=o*.2*Math.random();return Math.min(o+n,r)}async function Or(e,t={}){let{maxAttempts:a=3,initialDelay:r=1e3,backoffMultiplier:o=2,maxDelay:n=1e4,shouldRetry:l=jd,onRetry:c}=t,m,s=0;for(let p=1;p<=a;p++){s=p;try{return {data:await e(),attempts:s,success:!0}}catch(d){if(m=d,p===a||!l(m,p))return {error:m,attempts:s,success:false};let g=Kd(p,r,o,n);if(c)try{c(m,p,g);}catch(y){console.error("Error in retry callback:",y);}await new Promise(y=>setTimeout(y,g));}}return {error:m||new Error("Unknown error"),attempts:s,success:false}}function Yd(e,t=3){let a;for(let r=1;r<=t;r++)try{return {data:e(),success:!0}}catch(o){if(a=o,r===t)return {error:a,success:false}}return {error:a||new Error("Unknown error"),success:false}}function Xd(e,t={}){return async(...a)=>Or(()=>e(...a),t)}var Mo=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 Bs=(n=>(n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.WARN=2]="WARN",n[n.ERROR=3]="ERROR",n[n.NONE=4]="NONE",n))(Bs||{}),Ma=class Ma{constructor(t={}){this.defaultLogHandler=t=>{let{timestamp:a,level:r,message:o,component:n,...l}=t,c=`[${a}] [${r}] [${n}]`,m=Object.keys(l).length>0;switch(r){case "DEBUG":console.debug(c,o,m?l:"");break;case "INFO":console.info(c,o,m?l:"");break;case "WARN":console.warn(c,o,m?l:"");break;case "ERROR":console.error(c,o,m?l:""),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",...Ma.globalOptions};}static configure(t){Ma.globalOptions={...Ma.globalOptions,...t};}child(t){return new Ma({...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 zr((a,r)=>{this.log(0,`${t} completed`,{...r,action:t,duration:a});},true):new zr(()=>{},false)}log(t,a,r){if(!this.options.enabled||t<this.options.minLevel)return;let o={timestamp:new Date().toISOString(),level:Bs[t],message:a,component:this.options.componentName,...r};this.options.onLog(o);}};Ma.globalOptions={};var Io=Ma,zr=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}},Rs=new Io;function Jd(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 Zd(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(n=>{let l=e.columns.find(c=>c.id===n.columnId);return [n.id,Lo(n.title),Lo(n.description||""),Lo(l?.title||""),n.priority||"",(n.labels||[]).join(";"),(n.assignedUserIds||[]).join(";"),n.startDate||"",n.endDate||"",n.createdAt||"",n.updatedAt||""]});return [a.join(","),...r.map(n=>n.join(","))].join(`
|
|
2
2
|
`)}async function Qd(e,t,a){let r=t;if(!r){let l=document.querySelector(".asakaa-board");l&&(r=l.parentElement||l);}if(r)try{let l=await ul__default.default(r,{backgroundColor:"#0a0a0a",scale:1.5,logging:!1,useCORS:!0,allowTaint:!0,windowWidth:r.scrollWidth,windowHeight:r.scrollHeight}),c=l.toDataURL("image/png"),m=297,s=210,p=l.width/l.height,d=m-20,i=d/p;i>s-20&&(i=s-20,d=i*p);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,m,15,"F"),g.text(e.title||"Kanban Board",10,10);let y=(m-d)/2;return g.addImage(c,"PNG",y,20,d,i),g}catch(l){console.error("Error capturing board:",l);}let o=new jspdf.jsPDF,n=20;return o.setFontSize(20),o.text(e.title||"Kanban Board",20,n),n+=10,o.setFontSize(10),o.setTextColor(128,128,128),o.text(`Exported on ${new Date().toLocaleString()}`,20,n),n+=15,o.setTextColor(0,0,0),e.columns.forEach(l=>{let c=e.cards.filter(m=>m.columnId===l.id);n>250&&(o.addPage(),n=20),o.setFontSize(16),o.setFont("helvetica","bold"),o.text(l.title,20,n),n+=8,c.length===0?(o.setFontSize(10),o.setFont("helvetica","italic"),o.setTextColor(128,128,128),o.text("No cards in this column",20,n),o.setTextColor(0,0,0),n+=10):c.forEach(m=>{if(n>260&&(o.addPage(),n=20),o.setFontSize(12),o.setFont("helvetica","bold"),o.text(m.title,25,n),n+=6,m.description){o.setFontSize(9),o.setFont("helvetica","normal");let p=o.splitTextToSize(m.description,160);o.text(p,25,n),n+=p.length*5;}let s=[];if(m.priority&&s.push(`Priority: ${m.priority}`),m.labels&&m.labels.length>0&&s.push(`Labels: ${m.labels.join(", ")}`),m.assignedUserIds&&m.assignedUserIds.length>0&&s.push(`Assigned: ${m.assignedUserIds.length} user(s)`),m.startDate||m.endDate){let p=[];m.startDate&&p.push(`Start: ${m.startDate}`),m.endDate&&p.push(`End: ${m.endDate}`),s.push(p.join(" \u2192 "));}s.length>0&&(o.setFontSize(8),o.setTextColor(100,100,100),o.text(s.join(" \u2022 "),25,n),o.setTextColor(0,0,0),n+=5),n+=5;}),n+=5;}),o}function Lo(e){return e.includes(",")||e.includes('"')||e.includes(`
|
|
3
3
|
`)?`"${e.replace(/"/g,'""')}"`:e}async function zs(e,t,a,r){switch(t){case "json":return Jd(e,r);case "csv":return Zd(e);case "pdf":return await Qd(e,a);default:throw new Error(`Unsupported export format: ${t}`)}}function Us(e,t,a){let r=`board-export-${new Date().getTime()}`;if(t==="pdf"&&typeof e=="object"&&e!==null&&"save"in e){let p=`${r}.pdf`;e.save(p);return}if(typeof e!="string")throw new Error("Invalid content type for non-PDF export");let n=`${r}.${{json:"json",csv:"csv",pdf:"pdf"}[t]}`,l={json:"application/json",csv:"text/csv",pdf:"application/pdf"},c=new Blob([e],{type:l[t]}),m=URL.createObjectURL(c),s=document.createElement("a");s.href=m,s.download=n,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(m);}function ec(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 tc(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=Gs(t[0]),r=[],o=new Map,n=[];for(let l=1;l<t.length;l++)try{let c=Gs(t[l]||"");if(c.length>a.length){n.push(`Line ${l+1}: Too many columns`);continue}if(a.length-c.length>3){n.push(`Line ${l+1}: Column count mismatch (expected ${a.length}, got ${c.length})`);continue}for(;c.length<a.length;)c.push("");let s={};a.forEach((g,y)=>{s[g]=c[y]||"";});let p=s.Column||"Unnamed";o.has(p)||o.set(p,{id:`col-${o.size+1}`,title:p,position:o.size+1,cardIds:[]});let d=o.get(p),i={id:s["Card ID"]||`card-${l}`,title:s.Title||"Untitled",description:s.Description?s.Description:void 0,columnId:d.id,position:d.cardIds.length+1,priority:s.Priority||void 0,labels:s.Labels?s.Labels.split(";").filter(Boolean):void 0,assignedUserIds:s["Assigned Users"]?s["Assigned Users"].split(";").filter(Boolean):void 0,startDate:s["Start Date"]?s["Start Date"]:void 0,endDate:s["End Date"]?s["End Date"]:void 0,createdAt:s["Created At"]?s["Created At"]:void 0,updatedAt:s["Updated At"]?s["Updated At"]:void 0};r.push(i),d.cardIds.push(i.id);}catch(c){n.push(`Line ${l+1}: ${c instanceof Error?c.message:"Unknown error"}`);}return r.length===0?{success:!1,errors:["No valid cards found in CSV",...n]}:{success:!0,cardsImported:r.length,columnsImported:o.size,errors:n.length>0?n:void 0}}catch(t){return {success:false,errors:[`Failed to parse CSV: ${t instanceof Error?t.message:"Unknown error"}`]}}}function Gs(e){let t=[],a="",r=false;for(let o=0;o<e.length;o++){let n=e[o],l=e[o+1];n==='"'&&r&&l==='"'?(a+='"',o++):n==='"'?r=!r:n===","&&!r?(t.push(a),a=""):a+=n;}return t.push(a),t}function $s(e,t){switch(t){case "json":return ec(e);case "csv":return tc(e);default:return {success:false,errors:[`Unsupported import format: ${t}`]}}}function Ws(e){return new Promise((t,a)=>{let r=new FileReader;r.onload=o=>{o.target?.result?t(o.target.result):a(new Error("Failed to read file"));},r.onerror=()=>a(new Error("Failed to read file")),r.readAsText(e);})}var Ao=react.createContext(null);function Hs(){return react.useContext(Ao)}var _s=react.createContext(null);function Vs({children:e,themeName:t}){return jsxRuntime.jsx(_s.Provider,{value:{themeName:t},children:e})}function Va(){return react.useContext(_s)}function $e({children:e,container:t}){let[a,r]=react.useState(false),o=Hs(),n=Va();if(react.useEffect(()=>(r(true),()=>r(false)),[]),!a)return null;let l=t||(typeof document<"u"?document.body:null);if(!l)return null;if(o){let{theme:c,themeName:m}=o,s={"--asakaa-color-background-primary":c.bgPrimary,"--asakaa-color-background-secondary":c.bgSecondary,"--asakaa-color-background-card":c.bgGrid,"--asakaa-color-background-hover":c.hoverBg,"--asakaa-color-text-primary":c.textPrimary,"--asakaa-color-text-secondary":c.textSecondary,"--asakaa-color-text-tertiary":c.textTertiary,"--asakaa-color-text-inverse":c.taskBarHandle||"#FFFFFF","--asakaa-color-border-default":c.border,"--asakaa-color-border-hover":c.borderLight,"--asakaa-color-border-subtle":c.borderLight,"--asakaa-color-interactive-primary":c.accent,"--asakaa-color-interactive-primaryHover":c.accentHover,"--asakaa-color-interactive-primaryBorder":`${c.accent}4D`,"--asakaa-color-interactive-primaryBackground":`${c.accent}1A`,"--asakaa-color-interactive-primaryBackgroundHover":`${c.accent}33`,"--asakaa-color-status-success":c.statusCompleted,"--asakaa-color-status-warning":c.milestone,"--asakaa-color-status-error":c.criticalPath,"--asakaa-color-danger":c.criticalPath,"--asakaa-color-danger-border":`${c.criticalPath}4D`,"--asakaa-color-danger-background":`${c.criticalPath}14`,"--asakaa-color-danger-backgroundHover":`${c.criticalPath}26`};return reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":m,"data-gantt-portal":"true",style:s,children:e}),l)}return n?reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":n.themeName,"data-kanban-portal":"true",children:e}),l):reactDom.createPortal(e,l)}var Xs={URGENT:{label:"Urgent",color:"#E74C3C"},HIGH:{label:"High",color:"#E67E22"},MEDIUM:{label:"Normal",color:"#F1C40F"},LOW:{label:"Low",color:"#2ECC71"}},dc="#BDC3C7",cc=({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 mr({priority:e,onChange:t,className:a}){let[r,o]=react.useState(false),[n,l]=react.useState({top:0,left:0}),c=react.useRef(null),m=react.useRef(null);react.useEffect(()=>{if(r&&m.current){let i=m.current.getBoundingClientRect();l({top:i.bottom+window.scrollY+8,left:i.left+window.scrollX});}},[r]),react.useEffect(()=>{let i=g=>{c.current&&!c.current.contains(g.target)&&!m.current?.contains(g.target)&&o(false);};if(r)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[r]),react.useEffect(()=>{let i=g=>{g.key==="Escape"&&o(false);};if(r)return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[r]);let s=i=>{t(i),o(false);},p=e?Xs[e]:null,d=p?.color||dc;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:m,onClick:()=>o(!r),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?`${d}10`:"transparent",boxShadow:e?`0 0 0 2px ${d}30 inset`:"none"},title:p?.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:d,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:d,fillOpacity:e?"0.6":"0.4"})})}),r&&jsxRuntime.jsx($e,{children:jsxRuntime.jsxs("div",{ref:c,className:"priority-selector-menu",style:{position:"absolute",top:`${n.top}px`,left:`${n.left}px`,zIndex:99999,minWidth:"160px",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(Xs).map(([i,g])=>jsxRuntime.jsxs("button",{onClick:()=>s(i),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:g.color,background:"transparent"},onMouseEnter:y=>{y.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:y=>{y.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(cc,{color:g.color}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:g.label}),e===i&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},i)),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:()=>s(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:i=>{i.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:i=>{i.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"#9CA3AF",strokeWidth:"1.5",strokeDasharray:"2 2",opacity:"0.6"})}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:"Clear"}),!e&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})]})})]})}var mc=[{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 pr({startDate:e,endDate:t,onChange:a,className:r}){let[o,n]=react.useState(false),[l,c]=react.useState({top:0,left:0}),m=react.useRef(null),s=react.useRef(null),i=(Va()?.themeName||"dark")==="dark";react.useEffect(()=>{if(o&&s.current){let f=s.current.getBoundingClientRect();c({top:f.bottom+window.scrollY+8,left:f.left+window.scrollX});}},[o]),react.useEffect(()=>{let f=u=>{m.current&&!m.current.contains(u.target)&&!s.current?.contains(u.target)&&n(false);};if(o)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[o]),react.useEffect(()=>{let f=u=>{u.key==="Escape"&&n(false);};if(o)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[o]);let g=f=>{let u=new Date,w=C=>{let D=C.getFullYear(),T=String(C.getMonth()+1).padStart(2,"0"),z=String(C.getDate()).padStart(2,"0");return `${D}-${T}-${z}`},v=w(u),b=new Date(u);b.setDate(b.getDate()+f);let E=w(b);a(v,E),n(false);},y=()=>{if(!e||!t)return "Set date";let f=b=>{if(b instanceof Date)return b;if(typeof b!="string"||!b.match(/^\d{4}-\d{2}-\d{2}$/))return null;let E=b.split("-").map(Number);if(E.length!==3||E.some(z=>isNaN(z)))return null;let C=E[0],D=E[1],T=E[2];return C===void 0||D===void 0||T===void 0?null:new Date(C,D-1,T)},u=f(e),w=f(t);if(!u||!w||isNaN(u.getTime())||isNaN(w.getTime()))return "Set date";let v=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return `${v[u.getMonth()]} ${u.getDate()} \u2013 ${v[w.getMonth()]} ${w.getDate()}`},k=e&&t,h=(()=>{if(!t)return false;let f=typeof t=="string"?new Date(t):t,u=new Date;return u.setHours(0,0,0,0),f<u})();return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsxs("button",{ref:s,onClick:()=>n(!o),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:k?`${y()}`:"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:y()})]}),o&&jsxRuntime.jsx($e,{children:jsxRuntime.jsxs("div",{ref:m,className:"date-picker-menu absolute rounded-xl shadow-2xl border min-w-[320px]",style:{top:`${l.top}px`,left:`${l.left}px`,background:i?"#222326":"#FFFFFF",border:`1px solid ${i?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.12)"}`,boxShadow:i?"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)":"0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.08)",zIndex:99999},children:[jsxRuntime.jsxs("div",{className:"p-4 border-b",style:{borderColor:i?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.08)"},children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:i?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.6)"},children:"Quick Select"}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:mc.map(f=>jsxRuntime.jsx("button",{onClick:()=>g(f.days),className:"px-3 py-2.5 rounded-lg text-xs font-semibold transition-all active:scale-95 border",style:{color:i?"rgba(255, 255, 255, 0.9)":"rgba(0, 0, 0, 0.85)",borderColor:i?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.12)",background:i?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.04)"},onMouseEnter:u=>{u.currentTarget.style.background=i?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.08)",u.currentTarget.style.borderColor=i?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.2)";},onMouseLeave:u=>{u.currentTarget.style.background=i?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.04)",u.currentTarget.style.borderColor=i?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.12)";},children:f.label},f.label))})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:i?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.6)"},children:"Custom Range"}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("input",{type:"date",value:e||"",onChange:f=>a(f.target.value,t),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:i?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.04)",borderColor:i?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.12)",color:i?"rgba(255, 255, 255, 0.9)":"rgba(0, 0, 0, 0.85)",colorScheme:i?"dark":"light"}}),jsxRuntime.jsx("input",{type:"date",value:t||"",onChange:f=>a(e,f.target.value),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:i?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.04)",borderColor:i?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.12)",color:i?"rgba(255, 255, 255, 0.9)":"rgba(0, 0, 0, 0.85)",colorScheme:i?"dark":"light"}})]}),(e||t)&&jsxRuntime.jsx("button",{onClick:()=>{a(void 0,void 0),n(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:f=>{f.currentTarget.style.background="rgba(239, 68, 68, 0.2)";},onMouseLeave:f=>{f.currentTarget.style.background="rgba(239, 68, 68, 0.1)";},children:"Clear Dates"})]})]})})]})}function La({assignedUsers:e=[],availableUsers:t,onChange:a,className:r,maxVisibleAvatars:o=3}){let[n,l]=react.useState(false),[c,m]=react.useState(""),[s,p]=react.useState({top:0,left:0}),d=react.useRef(null),i=react.useRef(null);react.useEffect(()=>{if(n&&i.current){let h=i.current.getBoundingClientRect();p({top:h.bottom+window.scrollY+8,left:h.left+window.scrollX});}},[n]),react.useEffect(()=>{let h=f=>{d.current&&!d.current.contains(f.target)&&!i.current?.contains(f.target)&&(l(false),m(""));};if(n)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[n]),react.useEffect(()=>{let h=f=>{f.key==="Escape"&&(l(false),m(""));};if(n)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[n]);let g=h=>{let f=e.some(u=>u.id===h.id);a(f?e.filter(u=>u.id!==h.id):[...e,h]);},y=t.filter(h=>h.name.toLowerCase().includes(c.toLowerCase())),k=e.slice(0,o),x=e.length-o;return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:i,onClick:()=>l(!n),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:[k.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)),x>0&&jsxRuntime.jsxs("div",{className:"asakaa-avatar",children:["+",x]})]}):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"})]})})}),n&&jsxRuntime.jsx($e,{children:jsxRuntime.jsxs("div",{ref:d,className:"user-selector-menu absolute rounded-xl shadow-2xl border min-w-[300px]",style:{top:`${s.top}px`,left:`${s.left}px`,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:c,onChange:h=>m(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:y.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"}):y.map(h=>{let f=e.some(u=>u.id===h.id);return jsxRuntime.jsxs("button",{onClick:()=>g(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:u=>{u.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.1))";},onMouseLeave:u=>{u.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",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.95))"},children:h.name}),f&&jsxRuntime.jsx("span",{className:"text-lg",style:{color:"#3b82f6"},children:"\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([]),l(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 ur({currentCardId:e,dependencies:t=[],availableTasks:a,onChange:r,className:o}){let[n,l]=react.useState(false),[c,m]=react.useState(""),[s,p]=react.useState(t.length>0),[d,i]=react.useState({top:0,left:0}),g=react.useRef(null),y=react.useRef(null);react.useEffect(()=>{if(n&&y.current){let u=y.current.getBoundingClientRect();i({top:u.bottom+window.scrollY+8,left:u.left+window.scrollX});}},[n]),react.useEffect(()=>{let u=w=>{g.current&&!g.current.contains(w.target)&&!y.current?.contains(w.target)&&(l(false),m(""));};if(n)return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[n]),react.useEffect(()=>{let u=w=>{w.key==="Escape"&&(l(false),m(""));};if(n)return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[n]);let k=u=>{if(t.includes(u)){let v=t.filter(b=>b!==u);r(v),v.length===0&&p(false);}else r([...t,u]),p(true);},x=()=>{let u=!s;p(u),u||r([]);},h=a.filter(u=>u.id!==e).filter(u=>u.title.toLowerCase().includes(c.toLowerCase())||u.id.toLowerCase().includes(c.toLowerCase())),f=t.length>0?"#3B82F6":"#BDC3C7";return jsxRuntime.jsxs("div",{className:`relative ${o||""}`,children:[jsxRuntime.jsxs("button",{ref:y,onClick:()=>l(!n),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:f,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),t.length>0&&jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:f},children:t.length})]}),n&&jsxRuntime.jsx($e,{children:jsxRuntime.jsxs("div",{ref:g,className:"dependencies-selector-menu absolute rounded-xl shadow-2xl border min-w-[300px]",style:{top:`${d.top}px`,left:`${d.left}px`,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-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:x,children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center transition-all",style:{background:s?"#3b82f6":"transparent",borderColor:s?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:s&&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"})]})}),s&&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:c,onChange:u=>m(u.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:h.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"}):h.map(u=>{let w=t.includes(u.id);return jsxRuntime.jsxs("button",{onClick:()=>k(u.id),className:"w-full px-4 py-2 flex items-start gap-3 text-sm transition-colors",style:{background:"transparent"},onMouseEnter:v=>{v.currentTarget.style.background="var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))";},onMouseLeave:v=>{v.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:w?"#3b82f6":"transparent",borderColor:w?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:w&&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:u.title}),jsxRuntime.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:u.id})]})]},u.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),l(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 fa=react.memo(({card:e,render:t,onClick:a,isSelected:r,disableDrag:o,className:n,onUpdate:l,availableUsers:c=[],allCards:m=[]})=>{let{attributes:s,listeners:p,setNodeRef:d,transform:i,transition:g,isDragging:y}=sortable.useSortable({id:e.id,disabled:o,data:{type:"card",card:e}}),k={transform:Br.Transform.toString(i),transition:g};if(t)return jsxRuntime.jsx("div",{ref:d,style:k,...s,...p,onClick:()=>a?.(e),children:t(e)});let x=c.filter(h=>e.assignedUserIds?.includes(h.id));return jsxRuntime.jsxs("div",{ref:d,style:k,className:F("asakaa-card",y&&"asakaa-card-dragging",r&&"ring-2 ring-asakaa-accent-blue",n),...s,...p,onClick:h=>{h.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:h=>{h.currentTarget.style.display="none";}})}),jsxRuntime.jsx("h3",{className:"asakaa-card-title mb-2",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:h=>h.stopPropagation(),className:"priority-selector",children:jsxRuntime.jsx(mr,{priority:e.priority,onChange:h=>l?.(e.id,{priority:h})})}),jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"date-picker",children:jsxRuntime.jsx(pr,{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:(h,f)=>l?.(e.id,{startDate:h,endDate:f})})}),c.length>0&&jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"user-selector",children:jsxRuntime.jsx(La,{assignedUsers:x,availableUsers:c,onChange:h=>l?.(e.id,{assignedUserIds:h.map(f=>f.id)})})}),jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"dependencies-selector",children:jsxRuntime.jsx(ur,{currentCardId:e.id,dependencies:Array.isArray(e.dependencies)?e.dependencies.map(h=>typeof h=="string"?h:h.taskId):[],availableTasks:m,onChange:h=>l?.(e.id,{dependencies:h})})})]}),e.labels&&e.labels.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.labels.slice(0,3).map(h=>jsxRuntime.jsx("span",{className:"asakaa-label",children:h},h))})]})},(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.startDate===t.card.startDate&&e.card.endDate===t.card.endDate&&e.isSelected===t.isSelected&&JSON.stringify(e.card.labels)===JSON.stringify(t.card.labels)&&JSON.stringify(e.card.assignedUserIds)===JSON.stringify(t.card.assignedUserIds)&&JSON.stringify(e.card.dependencies)===JSON.stringify(t.card.dependencies));fa.displayName="Card";function ti({columnTitle:e,onRename:t,className:a}){let[r,o]=react.useState(false),[n,l]=react.useState(false),[c,m]=react.useState(e),[s,p]=react.useState({top:0,left:0}),d=react.useRef(null),i=react.useRef(null),g=react.useRef(null);react.useEffect(()=>{if(r&&i.current){let h=i.current.getBoundingClientRect();p({top:h.bottom+window.scrollY+8,left:h.left+window.scrollX});}},[r]),react.useEffect(()=>{let h=f=>{d.current&&!d.current.contains(f.target)&&!i.current?.contains(f.target)&&(o(false),l(false));};if(r)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[r]),react.useEffect(()=>{let h=f=>{f.key==="Escape"&&(o(false),l(false),m(e));};if(r)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[r,e]),react.useEffect(()=>{n&&g.current&&(g.current.focus(),g.current.select());},[n]);let y=()=>{l(true),m(e);},k=()=>{let h=c.trim();h&&h!==e&&t(h),l(false),o(false),m(e);},x=h=>{h.key==="Enter"?k():h.key==="Escape"&&(l(false),m(e));};return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:i,onClick:()=>o(!r),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-white/10",title:"Column options","aria-label":"Column menu",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"3",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"13",r:"1.5",fill:"currentColor"})]})}),r&&jsxRuntime.jsx($e,{children:jsxRuntime.jsx("div",{ref:d,className:"fixed rounded-xl shadow-2xl border min-w-[200px]",style:{top:`${s.top}px`,left:`${s.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:n?jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsx("label",{className:"text-xs font-bold text-white/80 uppercase tracking-wider block mb-2",children:"Rename Column"}),jsxRuntime.jsx("input",{ref:g,type:"text",value:c,onChange:h=>m(h.target.value),onKeyDown:x,onBlur:k,className:"w-full px-3 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/50 outline-none focus:border-blue-500/50 transition-all",placeholder:"Column name",maxLength:50})]}):jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs("button",{onClick:y,className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm text-white/90 hover:bg-white/10 transition-all",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M11.5 1.5L14.5 4.5L5 14H2V11L11.5 1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-medium",children:"Rename"})]})})})})]})}var Ya=react.memo(({column:e,cards:t,renderColumn:a,renderCard:r,renderHeader:o,renderEmptyState:n,onCardClick:l,onCardUpdate:c,availableUsers:m,allCards:s,enableVirtualization:p,cardHeight:d=120,isCollapsed:i,onToggleCollapse:g,onColumnRename:y,className:k})=>{let{setNodeRef:x,isOver:h}=core$1.useDroppable({id:e.id,data:{type:"column",column:e}}),f=react.useRef(null),u=p??Fs(t.length),w=reactVirtual.useVirtualizer({count:t.length,getScrollElement:()=>f.current,estimateSize:()=>d,enabled:u});if(a)return jsxRuntime.jsx("div",{ref:x,className:k,children:a(e,t)});let b=(()=>{if(!e.wipLimit)return {state:"none",percentage:0};let D=t.length/e.wipLimit*100;return t.length>e.wipLimit?{state:"exceeded",percentage:D}:D>=80?{state:"warning",percentage:D}:D>=60?{state:"approaching",percentage:D}:{state:"ok",percentage:D}})(),E=b.state==="exceeded",C=()=>"asakaa-column-count";return jsxRuntime.jsxs("div",{ref:x,className:F("asakaa-column",h&&"ring-2 ring-asakaa-accent-blue",E&&"ring-2 ring-asakaa-accent-red",k),children:[o?o(e,t.length):jsxRuntime.jsxs("div",{className:"asakaa-column-header group",children:[jsxRuntime.jsx("h2",{className:"asakaa-column-title",children:e.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:F(C()),children:[t.length,e.wipLimit&&` / ${e.wipLimit}`]}),e.wipLimit&&b.state!=="none"&&jsxRuntime.jsxs("span",{className:"text-xs font-medium flex items-center",title:`${b.percentage.toFixed(0)}% capacity${e.wipLimitType==="hard"?" (Hard limit - blocks new cards)":" (Soft limit - shows warning)"}`,children:[b.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"})]}),b.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"})]}),b.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"})}),b.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"})]})]}),y&&jsxRuntime.jsx(ti,{columnTitle:e.title,onRename:D=>y(e.id,D)}),g&&jsxRuntime.jsx("button",{onClick:g,className:"text-asakaa-text-tertiary hover:text-asakaa-text-primary","aria-label":i?"Expand column":"Collapse column",children:i?"\u25B6":"\u25BC"})]})]}),!i&&jsxRuntime.jsx("div",{ref:f,className:"asakaa-column-cards",style:{maxHeight:u?"600px":void 0},children:jsxRuntime.jsx(sortable.SortableContext,{items:t.map(D=>D.id),strategy:sortable.verticalListSortingStrategy,children:t.length===0?n?n(e):jsxRuntime.jsx("div",{className:"asakaa-drop-zone asakaa-empty",children:jsxRuntime.jsx("p",{children:"Drop cards here"})}):u?jsxRuntime.jsx("div",{style:{height:`${w.getTotalSize()}px`,position:"relative"},children:w.getVirtualItems().map(D=>{let T=t[D.index];return T?jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${D.start}px)`},children:jsxRuntime.jsx(fa,{card:T,render:r,onClick:l,onUpdate:c,availableUsers:m,allCards:s})},T.id):null})}):t.map(D=>jsxRuntime.jsx(fa,{card:D,render:r,onClick:l,onUpdate:c,availableUsers:m,allCards:s},D.id))})})]})});Ya.displayName="Column";function $o({title:e,onSave:t,className:a}){let[r,o]=react.useState(false),[n,l]=react.useState(e),c=react.useRef(null);react.useEffect(()=>{r&&c.current&&(c.current.focus(),c.current.select());},[r]);let m=()=>{let p=n.trim();p&&p!==e?t(p):l(e),o(false);},s=p=>{p.key==="Enter"?m():p.key==="Escape"&&(l(e),o(false));};return r?jsxRuntime.jsx("input",{ref:c,type:"text",value:n,onChange:p=>l(p.target.value),onBlur:m,onKeyDown:s,className:F("asakaa-column-title bg-transparent border-b-2 border-blue-500","outline-none px-1 -ml-1",a),maxLength:50}):jsxRuntime.jsx("h2",{className:F("asakaa-column-title cursor-pointer",a),onClick:()=>o(true),title:"Click to edit",children:e})}function Ho(){let[e,t]=react.useState(()=>core.dragStore.getState());react.useEffect(()=>core.dragStore.subscribe(o=>{t(o);}),[]);let a=react.useCallback(r=>{core.dragStore.setState(r);},[]);return [e,a]}function ka({board:e,callbacks:t,onCardClick:a,renderProps:r,config:o,availableUsers:n=[],className:l,style:c,isLoading:m,error:s,children:p}){let[d,i]=Ho(),g=o?.theme||"dark",k=g==="dark"||g==="neutral"?"dark":"",x=react.useCallback((C,D)=>{t.onCardUpdate?.(C,D);},[t]),h=react.useCallback((C,D)=>{t.onColumnUpdate?.(C,{title:D});},[t]),f=core$1.useSensors(core$1.useSensor(core$1.PointerSensor,{activationConstraint:{distance:8}}),core$1.useSensor(core$1.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),u=react.useMemo(()=>{let C=new Map;return e.columns.forEach(D=>{let T=D.cardIds.map(z=>e.cards.find($=>$.id===z)).filter(z=>z!==void 0).sort((z,$)=>z.position-$.position);C.set(D.id,T);}),C},[e.cards,e.columns]),w=react.useCallback(C=>{let{active:D}=C,T=e.cards.find(z=>z.id===D.id);T&&i({isDragging:true,draggedCardId:T.id,sourceColumnId:T.columnId,targetColumnId:T.columnId});},[e.cards,i]),v=react.useCallback(C=>{let{active:D,over:T}=C;if(!T||!e.cards.find(M=>M.id===D.id))return;let $=null;T.data.current?.type==="column"?$=T.id:T.data.current?.type==="card"&&($=e.cards.find(H=>H.id===T.id)?.columnId||null),$&&$!==d.targetColumnId&&i({...d,targetColumnId:$});},[e.cards,d,i]),b=react.useCallback(async C=>{let{active:D,over:T}=C;if(i({isDragging:false,draggedCardId:null,sourceColumnId:null,targetColumnId:null}),!T)return;let z=e.cards.find(S=>S.id===D.id);if(!z)return;let $,M;if(T.data.current?.type==="column"){$=T.id;let S=u.get($)||[];M=Po(S,0);}else {let S=e.cards.find(te=>te.id===T.id);if(!S)return;$=S.columnId;let U=u.get($)||[],Y=U.findIndex(te=>te.id===T.id);M=Po(U,Y);}let H=e.columns.find(S=>S.id===$);if(H&&H.wipLimit&&H.wipLimitType==="hard"){let S=u.get($)||[];if(z.columnId!==$&&S.length>=H.wipLimit){t.onWipLimitExceeded?.(H,z);return}}(z.columnId!==$||z.position!==M)&&await t.onCardMove?.(z.id,$,M);},[e.cards,e.columns,u,t,i]),E=react.useCallback(C=>{a?.(C);},[a]);return m?jsxRuntime.jsx("div",{className:F("asakaa-board",k,l),style:c,children:jsxRuntime.jsx(Fc,{columnCount:3})}):s?jsxRuntime.jsx("div",{className:F("asakaa-board",k,l),style:c,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 s=="string"?s:s.message})]})})}):jsxRuntime.jsx(Vs,{themeName:g,children:jsxRuntime.jsxs(core$1.DndContext,{sensors:f,collisionDetection:core$1.closestCorners,onDragStart:w,onDragOver:v,onDragEnd:b,children:[jsxRuntime.jsxs("div",{className:F("asakaa-board",k,l),style:c,"data-theme":g,children:[e.columns.sort((C,D)=>C.position-D.position).map(C=>{let D=u.get(C.id)||[];return jsxRuntime.jsx(Ya,{column:C,cards:D,renderCard:r?.renderCard,renderColumn:r?.renderColumn,renderHeader:r?.renderColumnHeader,renderEmptyState:r?.renderEmptyState,onCardClick:E,onCardUpdate:x,onColumnRename:h,availableUsers:n,allCards:e.cards,enableVirtualization:o?.enableVirtualization,cardHeight:o?.cardHeight},C.id)}),p]}),jsxRuntime.jsx(core$1.DragOverlay,{children:d.draggedCardId?jsxRuntime.jsx(fa,{card:e.cards.find(C=>C.id===d.draggedCardId),render:r?.renderCardOverlay||r?.renderCard,disableDrag:true,className:"opacity-90 rotate-3 shadow-2xl"}):null})]})})}function Fc({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 fr=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(ka,{board:a,callbacks:this.kanbanConfig.callbacks||{},onCardClick:this.kanbanConfig.onCardClick,renderProps:this.kanbanConfig.renderProps,config:this.kanbanConfig.config,availableUsers:this.kanbanConfig.availableUsers,className:this.kanbanConfig.className,style:this.kanbanConfig.style}));}exportToCSV(){if(!this.data)return "";let a=[["Card ID","Title","Column","Description","Labels","Assignees","Due Date","Position"]];return this.data.cards.forEach(r=>{let o=this.data.columns.find(n=>n.id===r.columnId);a.push([r.id,r.title,o?.title||"",r.description||"",r.labels?.join(", ")||"",r.assignedUserIds?.join(", ")||r.assigneeId||"",r.dueDate?.toString()||"",r.position.toString()]);}),a.map(r=>r.map(o=>`"${o}"`).join(",")).join(`
|
|
4
|
+
`);if(t.length<1||!t[0])return {success:!1,errors:["CSV file is empty or invalid"]};let a=Gs(t[0]),r=[],o=new Map,n=[];for(let l=1;l<t.length;l++)try{let c=Gs(t[l]||"");if(c.length>a.length){n.push(`Line ${l+1}: Too many columns`);continue}if(a.length-c.length>3){n.push(`Line ${l+1}: Column count mismatch (expected ${a.length}, got ${c.length})`);continue}for(;c.length<a.length;)c.push("");let s={};a.forEach((g,y)=>{s[g]=c[y]||"";});let p=s.Column||"Unnamed";o.has(p)||o.set(p,{id:`col-${o.size+1}`,title:p,position:o.size+1,cardIds:[]});let d=o.get(p),i={id:s["Card ID"]||`card-${l}`,title:s.Title||"Untitled",description:s.Description?s.Description:void 0,columnId:d.id,position:d.cardIds.length+1,priority:s.Priority||void 0,labels:s.Labels?s.Labels.split(";").filter(Boolean):void 0,assignedUserIds:s["Assigned Users"]?s["Assigned Users"].split(";").filter(Boolean):void 0,startDate:s["Start Date"]?s["Start Date"]:void 0,endDate:s["End Date"]?s["End Date"]:void 0,createdAt:s["Created At"]?s["Created At"]:void 0,updatedAt:s["Updated At"]?s["Updated At"]:void 0};r.push(i),d.cardIds.push(i.id);}catch(c){n.push(`Line ${l+1}: ${c instanceof Error?c.message:"Unknown error"}`);}return r.length===0?{success:!1,errors:["No valid cards found in CSV",...n]}:{success:!0,cardsImported:r.length,columnsImported:o.size,errors:n.length>0?n:void 0}}catch(t){return {success:false,errors:[`Failed to parse CSV: ${t instanceof Error?t.message:"Unknown error"}`]}}}function Gs(e){let t=[],a="",r=false;for(let o=0;o<e.length;o++){let n=e[o],l=e[o+1];n==='"'&&r&&l==='"'?(a+='"',o++):n==='"'?r=!r:n===","&&!r?(t.push(a),a=""):a+=n;}return t.push(a),t}function $s(e,t){switch(t){case "json":return ec(e);case "csv":return tc(e);default:return {success:false,errors:[`Unsupported import format: ${t}`]}}}function Ws(e){return new Promise((t,a)=>{let r=new FileReader;r.onload=o=>{o.target?.result?t(o.target.result):a(new Error("Failed to read file"));},r.onerror=()=>a(new Error("Failed to read file")),r.readAsText(e);})}var Ao=react.createContext(null);function Hs(){return react.useContext(Ao)}var _s=react.createContext(null);function Vs({children:e,themeName:t}){return jsxRuntime.jsx(_s.Provider,{value:{themeName:t},children:e})}function Va(){return react.useContext(_s)}function $e({children:e,container:t}){let[a,r]=react.useState(false),o=Hs(),n=Va();if(react.useEffect(()=>(r(true),()=>r(false)),[]),!a)return null;let l=t||(typeof document<"u"?document.body:null);if(!l)return null;if(o){let{theme:c,themeName:m}=o,s={"--asakaa-color-background-primary":c.bgPrimary,"--asakaa-color-background-secondary":c.bgSecondary,"--asakaa-color-background-card":c.bgGrid,"--asakaa-color-background-hover":c.hoverBg,"--asakaa-color-text-primary":c.textPrimary,"--asakaa-color-text-secondary":c.textSecondary,"--asakaa-color-text-tertiary":c.textTertiary,"--asakaa-color-text-inverse":c.taskBarHandle||"#FFFFFF","--asakaa-color-border-default":c.border,"--asakaa-color-border-hover":c.borderLight,"--asakaa-color-border-subtle":c.borderLight,"--asakaa-color-interactive-primary":c.accent,"--asakaa-color-interactive-primaryHover":c.accentHover,"--asakaa-color-interactive-primaryBorder":`${c.accent}4D`,"--asakaa-color-interactive-primaryBackground":`${c.accent}1A`,"--asakaa-color-interactive-primaryBackgroundHover":`${c.accent}33`,"--asakaa-color-status-success":c.statusCompleted,"--asakaa-color-status-warning":c.milestone,"--asakaa-color-status-error":c.criticalPath,"--asakaa-color-danger":c.criticalPath,"--asakaa-color-danger-border":`${c.criticalPath}4D`,"--asakaa-color-danger-background":`${c.criticalPath}14`,"--asakaa-color-danger-backgroundHover":`${c.criticalPath}26`};return reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":m,"data-gantt-portal":"true",style:s,children:e}),l)}return n?reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":n.themeName,"data-kanban-portal":"true",children:e}),l):reactDom.createPortal(e,l)}var Xs={URGENT:{label:"Urgent",color:"#E74C3C"},HIGH:{label:"High",color:"#E67E22"},MEDIUM:{label:"Normal",color:"#F1C40F"},LOW:{label:"Low",color:"#2ECC71"}},dc="#BDC3C7",cc=({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 mr({priority:e,onChange:t,className:a}){let[r,o]=react.useState(false),[n,l]=react.useState({top:0,left:0}),c=react.useRef(null),m=react.useRef(null);react.useEffect(()=>{if(r&&m.current){let i=m.current.getBoundingClientRect();l({top:i.bottom+window.scrollY+8,left:i.left+window.scrollX});}},[r]),react.useEffect(()=>{let i=g=>{c.current&&!c.current.contains(g.target)&&!m.current?.contains(g.target)&&o(false);};if(r)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[r]),react.useEffect(()=>{let i=g=>{g.key==="Escape"&&o(false);};if(r)return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[r]);let s=i=>{t(i),o(false);},p=e?Xs[e]:null,d=p?.color||dc;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:m,onClick:()=>o(!r),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?`${d}10`:"transparent",boxShadow:e?`0 0 0 2px ${d}30 inset`:"none"},title:p?.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:d,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:d,fillOpacity:e?"0.6":"0.4"})})}),r&&jsxRuntime.jsx($e,{children:jsxRuntime.jsxs("div",{ref:c,className:"priority-selector-menu",style:{position:"absolute",top:`${n.top}px`,left:`${n.left}px`,zIndex:99999,minWidth:"160px",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(Xs).map(([i,g])=>jsxRuntime.jsxs("button",{onClick:()=>s(i),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:g.color,background:"transparent"},onMouseEnter:y=>{y.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:y=>{y.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(cc,{color:g.color}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:g.label}),e===i&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},i)),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:()=>s(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:i=>{i.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:i=>{i.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"#9CA3AF",strokeWidth:"1.5",strokeDasharray:"2 2",opacity:"0.6"})}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:"Clear"}),!e&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})]})})]})}var mc=[{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 pr({startDate:e,endDate:t,onChange:a,className:r}){let[o,n]=react.useState(false),[l,c]=react.useState({top:0,left:0}),m=react.useRef(null),s=react.useRef(null),i=(Va()?.themeName||"dark")==="dark";react.useEffect(()=>{if(o&&s.current){let f=s.current.getBoundingClientRect();c({top:f.bottom+window.scrollY+8,left:f.left+window.scrollX});}},[o]),react.useEffect(()=>{let f=u=>{m.current&&!m.current.contains(u.target)&&!s.current?.contains(u.target)&&n(false);};if(o)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[o]),react.useEffect(()=>{let f=u=>{u.key==="Escape"&&n(false);};if(o)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[o]);let g=f=>{let u=new Date,w=C=>{let D=C.getFullYear(),T=String(C.getMonth()+1).padStart(2,"0"),z=String(C.getDate()).padStart(2,"0");return `${D}-${T}-${z}`},v=w(u),b=new Date(u);b.setDate(b.getDate()+f);let E=w(b);a(v,E),n(false);},y=()=>{if(!e||!t)return "Set date";let f=b=>{if(b instanceof Date)return b;if(typeof b!="string"||!b.match(/^\d{4}-\d{2}-\d{2}$/))return null;let E=b.split("-").map(Number);if(E.length!==3||E.some(z=>isNaN(z)))return null;let C=E[0],D=E[1],T=E[2];return C===void 0||D===void 0||T===void 0?null:new Date(C,D-1,T)},u=f(e),w=f(t);if(!u||!w||isNaN(u.getTime())||isNaN(w.getTime()))return "Set date";let v=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return `${v[u.getMonth()]} ${u.getDate()} \u2013 ${v[w.getMonth()]} ${w.getDate()}`},k=e&&t,h=(()=>{if(!t)return false;let f=typeof t=="string"?new Date(t):t,u=new Date;return u.setHours(0,0,0,0),f<u})();return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsxs("button",{ref:s,onClick:()=>n(!o),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:k?`${y()}`:"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:y()})]}),o&&jsxRuntime.jsx($e,{children:jsxRuntime.jsxs("div",{ref:m,className:"date-picker-menu absolute rounded-xl shadow-2xl border min-w-[320px]",style:{top:`${l.top}px`,left:`${l.left}px`,background:i?"#222326":"#FFFFFF",border:`1px solid ${i?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.12)"}`,boxShadow:i?"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)":"0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.08)",zIndex:99999},children:[jsxRuntime.jsxs("div",{className:"p-4 border-b",style:{borderColor:i?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.08)"},children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:i?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.6)"},children:"Quick Select"}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:mc.map(f=>jsxRuntime.jsx("button",{onClick:()=>g(f.days),className:"px-3 py-2.5 rounded-lg text-xs font-semibold transition-all active:scale-95",style:{color:i?"rgba(255, 255, 255, 0.9)":"rgba(0, 0, 0, 0.85)",border:`1px solid ${i?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.12)"}`,backgroundColor:i?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.04)"},onMouseEnter:u=>{u.currentTarget.style.backgroundColor=i?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.08)",u.currentTarget.style.border=`1px solid ${i?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.2)"}`;},onMouseLeave:u=>{u.currentTarget.style.backgroundColor=i?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.04)",u.currentTarget.style.border=`1px solid ${i?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.12)"}`;},children:f.label},f.label))})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:i?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.6)"},children:"Custom Range"}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("input",{type:"date",value:e||"",onChange:f=>a(f.target.value,t),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:i?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.04)",borderColor:i?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.12)",color:i?"rgba(255, 255, 255, 0.9)":"rgba(0, 0, 0, 0.85)",colorScheme:i?"dark":"light"}}),jsxRuntime.jsx("input",{type:"date",value:t||"",onChange:f=>a(e,f.target.value),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:i?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.04)",borderColor:i?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.12)",color:i?"rgba(255, 255, 255, 0.9)":"rgba(0, 0, 0, 0.85)",colorScheme:i?"dark":"light"}})]}),(e||t)&&jsxRuntime.jsx("button",{onClick:()=>{a(void 0,void 0),n(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:f=>{f.currentTarget.style.background="rgba(239, 68, 68, 0.2)";},onMouseLeave:f=>{f.currentTarget.style.background="rgba(239, 68, 68, 0.1)";},children:"Clear Dates"})]})]})})]})}function La({assignedUsers:e=[],availableUsers:t,onChange:a,className:r,maxVisibleAvatars:o=3}){let[n,l]=react.useState(false),[c,m]=react.useState(""),[s,p]=react.useState({top:0,left:0}),d=react.useRef(null),i=react.useRef(null);react.useEffect(()=>{if(n&&i.current){let h=i.current.getBoundingClientRect();p({top:h.bottom+window.scrollY+8,left:h.left+window.scrollX});}},[n]),react.useEffect(()=>{let h=f=>{d.current&&!d.current.contains(f.target)&&!i.current?.contains(f.target)&&(l(false),m(""));};if(n)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[n]),react.useEffect(()=>{let h=f=>{f.key==="Escape"&&(l(false),m(""));};if(n)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[n]);let g=h=>{let f=e.some(u=>u.id===h.id);a(f?e.filter(u=>u.id!==h.id):[...e,h]);},y=t.filter(h=>h.name.toLowerCase().includes(c.toLowerCase())),k=e.slice(0,o),x=e.length-o;return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:i,onClick:()=>l(!n),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:[k.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)),x>0&&jsxRuntime.jsxs("div",{className:"asakaa-avatar",children:["+",x]})]}):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"})]})})}),n&&jsxRuntime.jsx($e,{children:jsxRuntime.jsxs("div",{ref:d,className:"user-selector-menu absolute rounded-xl shadow-2xl border min-w-[300px]",style:{top:`${s.top}px`,left:`${s.left}px`,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:c,onChange:h=>m(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:y.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"}):y.map(h=>{let f=e.some(u=>u.id===h.id);return jsxRuntime.jsxs("button",{onClick:()=>g(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:u=>{u.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.1))";},onMouseLeave:u=>{u.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",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.95))"},children:h.name}),f&&jsxRuntime.jsx("span",{className:"text-lg",style:{color:"#3b82f6"},children:"\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([]),l(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 ur({currentCardId:e,dependencies:t=[],availableTasks:a,onChange:r,className:o}){let[n,l]=react.useState(false),[c,m]=react.useState(""),[s,p]=react.useState(t.length>0),[d,i]=react.useState({top:0,left:0}),g=react.useRef(null),y=react.useRef(null);react.useEffect(()=>{if(n&&y.current){let u=y.current.getBoundingClientRect();i({top:u.bottom+window.scrollY+8,left:u.left+window.scrollX});}},[n]),react.useEffect(()=>{let u=w=>{g.current&&!g.current.contains(w.target)&&!y.current?.contains(w.target)&&(l(false),m(""));};if(n)return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[n]),react.useEffect(()=>{let u=w=>{w.key==="Escape"&&(l(false),m(""));};if(n)return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[n]);let k=u=>{if(t.includes(u)){let v=t.filter(b=>b!==u);r(v),v.length===0&&p(false);}else r([...t,u]),p(true);},x=()=>{let u=!s;p(u),u||r([]);},h=a.filter(u=>u.id!==e).filter(u=>u.title.toLowerCase().includes(c.toLowerCase())||u.id.toLowerCase().includes(c.toLowerCase())),f=t.length>0?"#3B82F6":"#BDC3C7";return jsxRuntime.jsxs("div",{className:`relative ${o||""}`,children:[jsxRuntime.jsxs("button",{ref:y,onClick:()=>l(!n),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:f,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),t.length>0&&jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:f},children:t.length})]}),n&&jsxRuntime.jsx($e,{children:jsxRuntime.jsxs("div",{ref:g,className:"dependencies-selector-menu absolute rounded-xl shadow-2xl border min-w-[300px]",style:{top:`${d.top}px`,left:`${d.left}px`,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-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:x,children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center transition-all",style:{background:s?"#3b82f6":"transparent",borderColor:s?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:s&&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"})]})}),s&&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:c,onChange:u=>m(u.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:h.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"}):h.map(u=>{let w=t.includes(u.id);return jsxRuntime.jsxs("button",{onClick:()=>k(u.id),className:"w-full px-4 py-2 flex items-start gap-3 text-sm transition-colors",style:{background:"transparent"},onMouseEnter:v=>{v.currentTarget.style.background="var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))";},onMouseLeave:v=>{v.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:w?"#3b82f6":"transparent",borderColor:w?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:w&&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:u.title}),jsxRuntime.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:u.id})]})]},u.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),l(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 fa=react.memo(({card:e,render:t,onClick:a,isSelected:r,disableDrag:o,className:n,onUpdate:l,availableUsers:c=[],allCards:m=[]})=>{let{attributes:s,listeners:p,setNodeRef:d,transform:i,transition:g,isDragging:y}=sortable.useSortable({id:e.id,disabled:o,data:{type:"card",card:e}}),k={transform:Br.Transform.toString(i),transition:g};if(t)return jsxRuntime.jsx("div",{ref:d,style:k,...s,...p,onClick:()=>a?.(e),children:t(e)});let x=c.filter(h=>e.assignedUserIds?.includes(h.id));return jsxRuntime.jsxs("div",{ref:d,style:k,className:F("asakaa-card",y&&"asakaa-card-dragging",r&&"ring-2 ring-asakaa-accent-blue",n),...s,...p,onClick:h=>{h.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:h=>{h.currentTarget.style.display="none";}})}),jsxRuntime.jsx("h3",{className:"asakaa-card-title mb-2",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:h=>h.stopPropagation(),className:"priority-selector",children:jsxRuntime.jsx(mr,{priority:e.priority,onChange:h=>l?.(e.id,{priority:h})})}),jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"date-picker",children:jsxRuntime.jsx(pr,{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:(h,f)=>l?.(e.id,{startDate:h,endDate:f})})}),c.length>0&&jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"user-selector",children:jsxRuntime.jsx(La,{assignedUsers:x,availableUsers:c,onChange:h=>l?.(e.id,{assignedUserIds:h.map(f=>f.id)})})}),jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"dependencies-selector",children:jsxRuntime.jsx(ur,{currentCardId:e.id,dependencies:Array.isArray(e.dependencies)?e.dependencies.map(h=>typeof h=="string"?h:h.taskId):[],availableTasks:m,onChange:h=>l?.(e.id,{dependencies:h})})})]}),e.labels&&e.labels.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.labels.slice(0,3).map(h=>jsxRuntime.jsx("span",{className:"asakaa-label",children:h},h))})]})},(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.startDate===t.card.startDate&&e.card.endDate===t.card.endDate&&e.isSelected===t.isSelected&&JSON.stringify(e.card.labels)===JSON.stringify(t.card.labels)&&JSON.stringify(e.card.assignedUserIds)===JSON.stringify(t.card.assignedUserIds)&&JSON.stringify(e.card.dependencies)===JSON.stringify(t.card.dependencies));fa.displayName="Card";function ti({columnTitle:e,onRename:t,className:a}){let[r,o]=react.useState(false),[n,l]=react.useState(false),[c,m]=react.useState(e),[s,p]=react.useState({top:0,left:0}),d=react.useRef(null),i=react.useRef(null),g=react.useRef(null);react.useEffect(()=>{if(r&&i.current){let h=i.current.getBoundingClientRect();p({top:h.bottom+window.scrollY+8,left:h.left+window.scrollX});}},[r]),react.useEffect(()=>{let h=f=>{d.current&&!d.current.contains(f.target)&&!i.current?.contains(f.target)&&(o(false),l(false));};if(r)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[r]),react.useEffect(()=>{let h=f=>{f.key==="Escape"&&(o(false),l(false),m(e));};if(r)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[r,e]),react.useEffect(()=>{n&&g.current&&(g.current.focus(),g.current.select());},[n]);let y=()=>{l(true),m(e);},k=()=>{let h=c.trim();h&&h!==e&&t(h),l(false),o(false),m(e);},x=h=>{h.key==="Enter"?k():h.key==="Escape"&&(l(false),m(e));};return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:i,onClick:()=>o(!r),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-white/10",title:"Column options","aria-label":"Column menu",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"3",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"13",r:"1.5",fill:"currentColor"})]})}),r&&jsxRuntime.jsx($e,{children:jsxRuntime.jsx("div",{ref:d,className:"fixed rounded-xl shadow-2xl border min-w-[200px]",style:{top:`${s.top}px`,left:`${s.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:n?jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsx("label",{className:"text-xs font-bold text-white/80 uppercase tracking-wider block mb-2",children:"Rename Column"}),jsxRuntime.jsx("input",{ref:g,type:"text",value:c,onChange:h=>m(h.target.value),onKeyDown:x,onBlur:k,className:"w-full px-3 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/50 outline-none focus:border-blue-500/50 transition-all",placeholder:"Column name",maxLength:50})]}):jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs("button",{onClick:y,className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm text-white/90 hover:bg-white/10 transition-all",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M11.5 1.5L14.5 4.5L5 14H2V11L11.5 1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-medium",children:"Rename"})]})})})})]})}var Ya=react.memo(({column:e,cards:t,renderColumn:a,renderCard:r,renderHeader:o,renderEmptyState:n,onCardClick:l,onCardUpdate:c,availableUsers:m,allCards:s,enableVirtualization:p,cardHeight:d=120,isCollapsed:i,onToggleCollapse:g,onColumnRename:y,className:k})=>{let{setNodeRef:x,isOver:h}=core$1.useDroppable({id:e.id,data:{type:"column",column:e}}),f=react.useRef(null),u=p??Fs(t.length),w=reactVirtual.useVirtualizer({count:t.length,getScrollElement:()=>f.current,estimateSize:()=>d,enabled:u});if(a)return jsxRuntime.jsx("div",{ref:x,className:k,children:a(e,t)});let b=(()=>{if(!e.wipLimit)return {state:"none",percentage:0};let D=t.length/e.wipLimit*100;return t.length>e.wipLimit?{state:"exceeded",percentage:D}:D>=80?{state:"warning",percentage:D}:D>=60?{state:"approaching",percentage:D}:{state:"ok",percentage:D}})(),E=b.state==="exceeded",C=()=>"asakaa-column-count";return jsxRuntime.jsxs("div",{ref:x,className:F("asakaa-column",h&&"ring-2 ring-asakaa-accent-blue",E&&"ring-2 ring-asakaa-accent-red",k),children:[o?o(e,t.length):jsxRuntime.jsxs("div",{className:"asakaa-column-header group",children:[jsxRuntime.jsx("h2",{className:"asakaa-column-title",children:e.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:F(C()),children:[t.length,e.wipLimit&&` / ${e.wipLimit}`]}),e.wipLimit&&b.state!=="none"&&jsxRuntime.jsxs("span",{className:"text-xs font-medium flex items-center",title:`${b.percentage.toFixed(0)}% capacity${e.wipLimitType==="hard"?" (Hard limit - blocks new cards)":" (Soft limit - shows warning)"}`,children:[b.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"})]}),b.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"})]}),b.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"})}),b.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"})]})]}),y&&jsxRuntime.jsx(ti,{columnTitle:e.title,onRename:D=>y(e.id,D)}),g&&jsxRuntime.jsx("button",{onClick:g,className:"text-asakaa-text-tertiary hover:text-asakaa-text-primary","aria-label":i?"Expand column":"Collapse column",children:i?"\u25B6":"\u25BC"})]})]}),!i&&jsxRuntime.jsx("div",{ref:f,className:"asakaa-column-cards",style:{maxHeight:u?"600px":void 0},children:jsxRuntime.jsx(sortable.SortableContext,{items:t.map(D=>D.id),strategy:sortable.verticalListSortingStrategy,children:t.length===0?n?n(e):jsxRuntime.jsx("div",{className:"asakaa-drop-zone asakaa-empty",children:jsxRuntime.jsx("p",{children:"Drop cards here"})}):u?jsxRuntime.jsx("div",{style:{height:`${w.getTotalSize()}px`,position:"relative"},children:w.getVirtualItems().map(D=>{let T=t[D.index];return T?jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${D.start}px)`},children:jsxRuntime.jsx(fa,{card:T,render:r,onClick:l,onUpdate:c,availableUsers:m,allCards:s})},T.id):null})}):t.map(D=>jsxRuntime.jsx(fa,{card:D,render:r,onClick:l,onUpdate:c,availableUsers:m,allCards:s},D.id))})})]})});Ya.displayName="Column";function $o({title:e,onSave:t,className:a}){let[r,o]=react.useState(false),[n,l]=react.useState(e),c=react.useRef(null);react.useEffect(()=>{r&&c.current&&(c.current.focus(),c.current.select());},[r]);let m=()=>{let p=n.trim();p&&p!==e?t(p):l(e),o(false);},s=p=>{p.key==="Enter"?m():p.key==="Escape"&&(l(e),o(false));};return r?jsxRuntime.jsx("input",{ref:c,type:"text",value:n,onChange:p=>l(p.target.value),onBlur:m,onKeyDown:s,className:F("asakaa-column-title bg-transparent border-b-2 border-blue-500","outline-none px-1 -ml-1",a),maxLength:50}):jsxRuntime.jsx("h2",{className:F("asakaa-column-title cursor-pointer",a),onClick:()=>o(true),title:"Click to edit",children:e})}function Ho(){let[e,t]=react.useState(()=>core.dragStore.getState());react.useEffect(()=>core.dragStore.subscribe(o=>{t(o);}),[]);let a=react.useCallback(r=>{core.dragStore.setState(r);},[]);return [e,a]}function ka({board:e,callbacks:t,onCardClick:a,renderProps:r,config:o,availableUsers:n=[],className:l,style:c,isLoading:m,error:s,children:p}){let[d,i]=Ho(),g=o?.theme||"dark",k=g==="dark"||g==="neutral"?"dark":"",x=react.useCallback((C,D)=>{t.onCardUpdate?.(C,D);},[t]),h=react.useCallback((C,D)=>{t.onColumnUpdate?.(C,{title:D});},[t]),f=core$1.useSensors(core$1.useSensor(core$1.PointerSensor,{activationConstraint:{distance:8}}),core$1.useSensor(core$1.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),u=react.useMemo(()=>{let C=new Map;return e.columns.forEach(D=>{let T=D.cardIds.map(z=>e.cards.find($=>$.id===z)).filter(z=>z!==void 0).sort((z,$)=>z.position-$.position);C.set(D.id,T);}),C},[e.cards,e.columns]),w=react.useCallback(C=>{let{active:D}=C,T=e.cards.find(z=>z.id===D.id);T&&i({isDragging:true,draggedCardId:T.id,sourceColumnId:T.columnId,targetColumnId:T.columnId});},[e.cards,i]),v=react.useCallback(C=>{let{active:D,over:T}=C;if(!T||!e.cards.find(M=>M.id===D.id))return;let $=null;T.data.current?.type==="column"?$=T.id:T.data.current?.type==="card"&&($=e.cards.find(H=>H.id===T.id)?.columnId||null),$&&$!==d.targetColumnId&&i({...d,targetColumnId:$});},[e.cards,d,i]),b=react.useCallback(async C=>{let{active:D,over:T}=C;if(i({isDragging:false,draggedCardId:null,sourceColumnId:null,targetColumnId:null}),!T)return;let z=e.cards.find(S=>S.id===D.id);if(!z)return;let $,M;if(T.data.current?.type==="column"){$=T.id;let S=u.get($)||[];M=Po(S,0);}else {let S=e.cards.find(te=>te.id===T.id);if(!S)return;$=S.columnId;let U=u.get($)||[],Y=U.findIndex(te=>te.id===T.id);M=Po(U,Y);}let H=e.columns.find(S=>S.id===$);if(H&&H.wipLimit&&H.wipLimitType==="hard"){let S=u.get($)||[];if(z.columnId!==$&&S.length>=H.wipLimit){t.onWipLimitExceeded?.(H,z);return}}(z.columnId!==$||z.position!==M)&&await t.onCardMove?.(z.id,$,M);},[e.cards,e.columns,u,t,i]),E=react.useCallback(C=>{a?.(C);},[a]);return m?jsxRuntime.jsx("div",{className:F("asakaa-board",k,l),style:c,children:jsxRuntime.jsx(Fc,{columnCount:3})}):s?jsxRuntime.jsx("div",{className:F("asakaa-board",k,l),style:c,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 s=="string"?s:s.message})]})})}):jsxRuntime.jsx(Vs,{themeName:g,children:jsxRuntime.jsxs(core$1.DndContext,{sensors:f,collisionDetection:core$1.closestCorners,onDragStart:w,onDragOver:v,onDragEnd:b,children:[jsxRuntime.jsxs("div",{className:F("asakaa-board",k,l),style:c,"data-theme":g,children:[e.columns.sort((C,D)=>C.position-D.position).map(C=>{let D=u.get(C.id)||[];return jsxRuntime.jsx(Ya,{column:C,cards:D,renderCard:r?.renderCard,renderColumn:r?.renderColumn,renderHeader:r?.renderColumnHeader,renderEmptyState:r?.renderEmptyState,onCardClick:E,onCardUpdate:x,onColumnRename:h,availableUsers:n,allCards:e.cards,enableVirtualization:o?.enableVirtualization,cardHeight:o?.cardHeight},C.id)}),p]}),jsxRuntime.jsx(core$1.DragOverlay,{children:d.draggedCardId?jsxRuntime.jsx(fa,{card:e.cards.find(C=>C.id===d.draggedCardId),render:r?.renderCardOverlay||r?.renderCard,disableDrag:true,className:"opacity-90 rotate-3 shadow-2xl"}):null})]})})}function Fc({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 fr=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(ka,{board:a,callbacks:this.kanbanConfig.callbacks||{},onCardClick:this.kanbanConfig.onCardClick,renderProps:this.kanbanConfig.renderProps,config:this.kanbanConfig.config,availableUsers:this.kanbanConfig.availableUsers,className:this.kanbanConfig.className,style:this.kanbanConfig.style}));}exportToCSV(){if(!this.data)return "";let a=[["Card ID","Title","Column","Description","Labels","Assignees","Due Date","Position"]];return this.data.cards.forEach(r=>{let o=this.data.columns.find(n=>n.id===r.columnId);a.push([r.id,r.title,o?.title||"",r.description||"",r.labels?.join(", ")||"",r.assignedUserIds?.join(", ")||r.assigneeId||"",r.dueDate?.toString()||"",r.position.toString()]);}),a.map(r=>r.map(o=>`"${o}"`).join(",")).join(`
|
|
5
5
|
`)}async exportToPDF(){throw new Error("PDF export not yet implemented in ViewAdapter")}async exportToPNG(){if(!this.container)throw new Error("View not mounted");let r=await(await import('html2canvas')).default(this.container,{backgroundColor:this.options.theme==="dark"?"#1a1a1a":"#ffffff",scale:2});return new Promise((o,n)=>{r.toBlob(l=>{l?o(l):n(new Error("Failed to create PNG blob"));},"image/png");})}};function ni(e={}){return new fr(e)}var Hc=5*1024*1024,_o="asakaa-recent-uploads",ii=10;function Vo({coverImage:e,onUpload:t,onChange:a,onRemove:r,unsplashAccessKey:o,maxFileSize:n=Hc,showRecentUploads:l=true,theme:c="dark"}){let[m,s]=react.useState("upload"),[p,d]=react.useState(false),[i,g]=react.useState(0),[y,k]=react.useState(""),[x,h]=react.useState(""),[f,u]=react.useState([]),[w,v]=react.useState(false),[b,E]=react.useState([]),[C,D]=react.useState(false),[T,z]=react.useState(0),[$,M]=react.useState(null),H=react.useRef(null);react.useEffect(()=>{try{let O=localStorage.getItem(_o);if(O){let X=JSON.parse(O);E(X.slice(0,ii));}}catch(O){console.error("Failed to load recent uploads:",O);}},[]);let S=react.useCallback((O,X)=>{let Re={url:O,thumbnail:X||O,uploadedAt:new Date,usedCount:1};E(Me=>{if(Me.find(ct=>ct.url===O)){let bt=Me.map(mt=>mt.url===O?{...mt,usedCount:mt.usedCount+1}:mt).sort((mt,Kt)=>mt.usedCount!==Kt.usedCount?Kt.usedCount-mt.usedCount:new Date(Kt.uploadedAt).getTime()-new Date(mt.uploadedAt).getTime());return localStorage.setItem(_o,JSON.stringify(bt)),bt}let we=[Re,...Me].slice(0,ii);return localStorage.setItem(_o,JSON.stringify(we)),we});},[]),U=react.useCallback(async O=>{if(M(null),O.size>n){M(`File too large. Max size: ${n/(1024*1024)}MB`);return}if(!O.type.startsWith("image/")){M("Please upload an image file (JPG, PNG, GIF, WebP)");return}d(true),g(0);try{let X;t?X=await t(O):X=await _c(O);for(let Re=0;Re<=100;Re+=10)g(Re),await new Promise(Me=>setTimeout(Me,50));a(X),S(X),d(!1),g(0);}catch(X){console.error("Upload failed:",X),M("Upload failed. Please try again."),d(false),g(0);}},[n,t,a,S]),{getRootProps:Y,getInputProps:te,isDragActive:R,isDragReject:ee}=reactDropzone.useDropzone({onDrop:O=>{O.length>0&&O[0]&&U(O[0]);},accept:{"image/*":[".png",".jpg",".jpeg",".gif",".webp"]},maxSize:n,multiple:false,noClick:true});react.useEffect(()=>{let O=async X=>{let Re=X.clipboardData?.items;if(Re){for(let Me of Re)if(Me.type.startsWith("image/")){let Et=Me.getAsFile();if(Et){await U(Et);break}}}};return window.addEventListener("paste",O),()=>window.removeEventListener("paste",O)},[U]);let G=react.useCallback(()=>{if(y.trim())try{new URL(y),a(y),S(y),k(""),M(null);}catch{M("Please enter a valid URL");}},[y,a,S]),se=react.useCallback(async O=>{if(!o){M("Unsplash integration not configured");return}if(O.trim()){v(true),M(null);try{let X=await fetch(`https://api.unsplash.com/search/photos?query=${encodeURIComponent(O)}&per_page=12`,{headers:{Authorization:`Client-ID ${o}`}});if(!X.ok)throw new Error("Unsplash search failed");let Re=await X.json();u(Re.results||[]);}catch(X){console.error("Unsplash search failed:",X),M("Failed to search Unsplash. Please try again.");}finally{v(false);}}},[o]),I=react.useCallback(O=>{a(O.urls.regular),S(O.urls.regular,O.urls.thumb);},[a,S]);return e&&!C?jsxRuntime.jsxs("div",{className:"cover-image-preview","data-theme":c,children:[jsxRuntime.jsx("div",{className:"cover-image-preview-container",children:jsxRuntime.jsx("img",{src:e,alt:"Cover",style:{transform:`translateY(${T}%)`},onError:O=>{O.currentTarget.src="https://via.placeholder.com/600x200?text=Image+Not+Found";}})}),jsxRuntime.jsxs("div",{className:"cover-image-actions",children:[jsxRuntime.jsxs("button",{className:"cover-image-button",onClick:()=>D(true),children:[jsxRuntime.jsx(Kc,{}),"Reposition"]}),jsxRuntime.jsxs("button",{className:"cover-image-button",onClick:()=>{D(false),z(0),r();},children:[jsxRuntime.jsx(Yc,{}),"Change"]}),jsxRuntime.jsxs("button",{className:"cover-image-button cover-image-button-danger",onClick:r,children:[jsxRuntime.jsx(Xc,{}),"Remove"]})]})]}):jsxRuntime.jsxs("div",{className:"cover-image-manager","data-theme":c,children:[jsxRuntime.jsxs("div",{className:"cover-image-tabs",role:"tablist",children:[jsxRuntime.jsxs("button",{role:"tab","aria-selected":m==="upload",className:F("cover-image-tab",{"cover-image-tab-active":m==="upload"}),onClick:()=>s("upload"),children:[jsxRuntime.jsx(li,{}),"Upload"]}),jsxRuntime.jsxs("button",{role:"tab","aria-selected":m==="link",className:F("cover-image-tab",{"cover-image-tab-active":m==="link"}),onClick:()=>s("link"),children:[jsxRuntime.jsx(Vc,{}),"Link"]}),o&&jsxRuntime.jsxs("button",{role:"tab","aria-selected":m==="unsplash",className:F("cover-image-tab",{"cover-image-tab-active":m==="unsplash"}),onClick:()=>s("unsplash"),children:[jsxRuntime.jsx(jc,{}),"Unsplash"]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:$&&jsxRuntime.jsx(framerMotion.motion.div,{className:"cover-image-error",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:$})}),jsxRuntime.jsxs("div",{className:"cover-image-panels",children:[m==="upload"&&jsxRuntime.jsxs("div",{className:"cover-image-panel",children:[jsxRuntime.jsxs("div",{...Y(),className:F("cover-image-dropzone",{"cover-image-dropzone-active":R,"cover-image-dropzone-reject":ee}),children:[jsxRuntime.jsx("input",{...te(),ref:H}),p?jsxRuntime.jsxs("div",{className:"cover-image-uploading",children:[jsxRuntime.jsx("div",{className:"cover-image-progress",children:jsxRuntime.jsx("div",{className:"cover-image-progress-bar",style:{width:`${i}%`}})}),jsxRuntime.jsxs("p",{children:["Uploading... ",i,"%"]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(li,{size:48}),jsxRuntime.jsx("h3",{children:"Drop image here"}),jsxRuntime.jsx("p",{className:"cover-image-hint",children:"or paste from clipboard (Cmd/Ctrl+V)"}),jsxRuntime.jsx("button",{className:"cover-image-button-primary",onClick:()=>H.current?.click(),children:"Browse files"}),jsxRuntime.jsxs("p",{className:"cover-image-meta",children:["Max ",n/(1024*1024),"MB \xB7 JPG, PNG, GIF, WebP"]})]})]}),l&&b.length>0&&jsxRuntime.jsxs("div",{className:"cover-image-recent",children:[jsxRuntime.jsx("h4",{children:"Recent uploads"}),jsxRuntime.jsx("div",{className:"cover-image-recent-grid",children:b.slice(0,4).map((O,X)=>jsxRuntime.jsx("button",{className:"cover-image-recent-item",onClick:()=>a(O.url),style:{backgroundImage:`url(${O.thumbnail})`},title:"Click to use this image"},X))})]})]}),m==="link"&&jsxRuntime.jsx("div",{className:"cover-image-panel",children:jsxRuntime.jsxs("div",{className:"cover-image-url-input",children:[jsxRuntime.jsx("input",{type:"url",placeholder:"Paste image URL...",value:y,onChange:O=>k(O.target.value),onKeyDown:O=>{O.key==="Enter"&&G();}}),jsxRuntime.jsx("button",{className:"cover-image-button-primary",onClick:G,disabled:!y.trim(),children:"Add image"})]})}),m==="unsplash"&&o&&jsxRuntime.jsxs("div",{className:"cover-image-panel",children:[jsxRuntime.jsxs("div",{className:"cover-image-search",children:[jsxRuntime.jsx("input",{type:"search",placeholder:"Search Unsplash...",value:x,onChange:O=>h(O.target.value),onKeyDown:O=>{O.key==="Enter"&&se(x);}}),jsxRuntime.jsx("button",{className:"cover-image-button-primary",onClick:()=>se(x),disabled:w||!x.trim(),children:w?"Searching...":"Search"})]}),f.length>0&&jsxRuntime.jsx("div",{className:"cover-image-unsplash-grid",children:f.map(O=>jsxRuntime.jsx("button",{className:"cover-image-unsplash-item",onClick:()=>I(O),style:{backgroundImage:`url(${O.urls.small})`},title:`Photo by ${O.user.name}`},O.id))})]})]})]})}function _c(e){return new Promise((t,a)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=a,r.readAsDataURL(e);})}function li({size:e=20}){return jsxRuntime.jsxs("svg",{width:e,height:e,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-4"}),jsxRuntime.jsx("polyline",{points:"17 8 12 3 7 8"}),jsxRuntime.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}function Vc(){return jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),jsxRuntime.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}function jc(){return jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("path",{d:"M7.5 6.5H16.5V0H7.5V6.5ZM16.5 9H24V24H0V9H7.5V16.5H16.5V9Z"})})}function Kc(){return jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"7 13 12 8 17 13"}),jsxRuntime.jsx("polyline",{points:"7 17 12 12 17 17"})]})}function Yc(){return jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.2"})})}function Xc(){return 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 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})}var qa=class extends react.Component{constructor(a){super(a);this.resetError=()=>{this.setState({hasError:false,error:null,errorInfo:null});};this.state={hasError:false,error:null,errorInfo:null};}static getDerivedStateFromError(a){return {hasError:true,error:a}}componentDidCatch(a,r){let{onError:o,componentName:n}=this.props;if(process.env.NODE_ENV==="development"&&(console.error(`Error in ${n||"Component"}:`,a),console.error("Error Info:",r)),this.setState({errorInfo:r}),o)try{o(a,r);}catch(l){console.error("Error in error handler:",l);}}render(){let{hasError:a,error:r}=this.state,{children:o,fallback:n,componentName:l}=this.props;return a&&r?n?n(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:l?`Error in ${l}`:"Something went wrong"}),jsxRuntime.jsx("p",{className:"text-sm text-white/70 mb-3",children:r.message||"An unexpected error occurred"}),process.env.NODE_ENV==="development"&&jsxRuntime.jsxs("details",{className:"mb-3",children:[jsxRuntime.jsx("summary",{className:"text-xs text-white/50 cursor-pointer hover:text-white/70 mb-2",children:"Error Details (Development Only)"}),jsxRuntime.jsx("pre",{className:"text-xs text-white/60 bg-black/30 p-3 rounded overflow-auto max-h-48",children:r.stack})]}),jsxRuntime.jsx("button",{onClick:this.resetError,className:"px-4 py-2 rounded-lg text-sm font-medium transition-all hover:bg-red-600/20 border border-red-500/30",style:{color:"#EF4444"},children:"Try Again"})]})]})}):o}};function jo(e,t){let a=r=>jsxRuntime.jsx(qa,{...t,children:jsxRuntime.jsx(e,{...r})});return a.displayName=`withErrorBoundary(${e.displayName||e.name||"Component"})`,a}function Yo({board:e,onCreateCard:t,onNavigateToCard:a,onSearch:r,onChangePriority:o,onAssignUser:n,onGeneratePlan:l,onPredictRisks:c,onOpenAIUsage:m,shortcut:s="k",className:p=""}){let[d,i]=react.useState(false),[g,y]=react.useState(""),[k,x]=react.useState("home"),[h,f]=react.useState(""),[u,w]=react.useState("");react.useEffect(()=>{let C=D=>{(D.metaKey||D.ctrlKey)&&D.key===s&&(D.preventDefault(),i(T=>!T)),D.key==="Escape"&&(i(false),x("home"),y(""));};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[s]),react.useEffect(()=>{d||(x("home"),y(""),f(""),w(""));},[d]);let v=react.useCallback(()=>{i(false);},[]),b=react.useCallback(C=>{let[D,T]=C.split(":");switch(D){case "create-card":x("create-card");break;case "create-card-in":f(T||"");break;case "navigate":T?(a?.(T),v()):x("navigate");break;case "search":r?.(g),v();break;case "priority":x("priority");break;case "set-priority":u&&T&&(o?.(u,T),v());break;case "assign":x("assign");break;case "assign-user":u&&T&&(n?.(u,T),v());break;case "ai":x("ai");break;case "ai-generate-plan":l?.(),v();break;case "ai-predict-risks":c?.(),v();break;case "ai-usage":m?.(),v();break;case "back":x("home");break;}},[g,u,t,a,r,o,n,l,c,m,v]),E=react.useCallback(()=>{h&&g.trim()&&(t?.(h,g.trim()),v());},[h,g,t,v]);return d?jsxRuntime.jsx($e,{children:jsxRuntime.jsx("div",{className:"command-palette-overlay",onClick:v,children:jsxRuntime.jsx("div",{className:`command-palette ${p}`,onClick:C=>C.stopPropagation(),children:jsxRuntime.jsxs(cmdk.Command,{value:g,onValueChange:y,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:k==="create-card"&&h?"Type card title and press Enter...":k==="create-card"?"Select a column first...":"Type a command or search...",className:"command-palette-input",onKeyDown:C=>{C.key==="Enter"&&k==="create-card"&&h&&E();}}),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."}),k==="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:b,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:b,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:b,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:b,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(C=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${C.id}`,onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:C.priority==="URGENT"?"#EF4444":C.priority==="HIGH"?"#F59E0B":C.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsxRuntime.jsx("span",{children:C.title}),C.labels&&C.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:C.labels.slice(0,2).map(D=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:D},D))})]},C.id))})]}),k==="create-card"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:b,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(C=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`create-card-in:${C.id}`,onSelect:b,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:C.title}),jsxRuntime.jsxs("div",{className:"command-palette-item-count",children:[C.cardIds.length," cards"]})]},C.id))})]}),k==="navigate"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:b,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(C=>{let D=e.columns.find(T=>T.id===C.columnId);return jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${C.id}`,onSelect:b,className:"command-palette-item",keywords:[C.title,C.description||"",...C.labels||[]],children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:C.priority==="URGENT"?"#EF4444":C.priority==="HIGH"?"#F59E0B":C.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsxRuntime.jsxs("div",{className:"command-palette-item-content",children:[jsxRuntime.jsx("div",{children:C.title}),jsxRuntime.jsx("div",{className:"command-palette-item-meta",children:D?.title})]}),C.labels&&C.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:C.labels.slice(0,2).map(T=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:T},T))})]},C.id)})})]}),k==="ai"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:b,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:b,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:b,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:b,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 Qc(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 em(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 tm(e){return e.startsWith("image/")}function vr({attachments:e=[],onUpload:t,onDelete:a,maxSizeMB:r=10,allowedTypes:o,maxFiles:n=10}){let[l,c]=react.useState(false),[m,s]=react.useState(false),[p,d]=react.useState(null),i=react.useRef(null),g=react.useCallback(b=>{let E=[],C=[];return e.length+b.length>n?(C.push(`Maximum ${n} files allowed`),{valid:E,errors:C}):(b.forEach(D=>{if(D.size/1048576>r){C.push(`${D.name} is too large (max ${r}MB)`);return}if(o&&!o.some(z=>D.type.match(z))){C.push(`${D.name} has invalid file type`);return}E.push(D);}),{valid:E,errors:C})},[e.length,n,r,o]),y=react.useCallback(async b=>{let{valid:E,errors:C}=g(b);if(C.length>0){d(C.join(", ")),setTimeout(()=>d(null),5e3);return}if(E.length!==0){s(true),d(null);try{await t?.(E);}catch(D){d(D instanceof Error?D.message:"Upload failed"),setTimeout(()=>d(null),5e3);}finally{s(false);}}},[g,t]),k=react.useCallback(b=>{b.preventDefault(),b.stopPropagation(),c(true);},[]),x=react.useCallback(b=>{b.preventDefault(),b.stopPropagation(),c(false);},[]),h=react.useCallback(b=>{b.preventDefault(),b.stopPropagation();},[]),f=react.useCallback(b=>{b.preventDefault(),b.stopPropagation(),c(false);let E=Array.from(b.dataTransfer.files);y(E);},[y]),u=react.useCallback(b=>{let E=b.target.files?Array.from(b.target.files):[];y(E),i.current&&(i.current.value="");},[y]),w=react.useCallback(()=>{i.current?.click();},[]),v=react.useCallback(b=>{confirm("Are you sure you want to delete this attachment?")&&a?.(b);},[a]);return jsxRuntime.jsxs("div",{className:"attachment-uploader",children:[jsxRuntime.jsxs("div",{className:`attachment-dropzone ${l?"dragging":""} ${m?"uploading":""}`,onDragEnter:k,onDragLeave:x,onDragOver:h,onDrop:f,onClick:w,children:[jsxRuntime.jsx("input",{ref:i,type:"file",multiple:true,onChange:u,style:{display:"none"},accept:o?.join(",")}),jsxRuntime.jsx("div",{className:"attachment-dropzone-content",children:m?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:l?"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,"/",n," files"]})]})})]}),p&&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:p})]}),e.length>0&&jsxRuntime.jsx("div",{className:"attachment-list",children:e.map(b=>jsxRuntime.jsxs("div",{className:"attachment-item",children:[jsxRuntime.jsx("div",{className:"attachment-preview",children:tm(b.type)&&b.url?jsxRuntime.jsx("img",{src:b.thumbnailUrl||b.url,alt:b.name,className:"attachment-thumbnail"}):jsxRuntime.jsx("div",{className:"attachment-icon",children:em(b.type)})}),jsxRuntime.jsxs("div",{className:"attachment-info",children:[jsxRuntime.jsx("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",className:"attachment-name",title:b.name,children:b.name}),jsxRuntime.jsxs("div",{className:"attachment-meta",children:[jsxRuntime.jsx("span",{className:"attachment-size",children:Qc(b.size)}),jsxRuntime.jsx("span",{className:"attachment-separator",children:"\u2022"}),jsxRuntime.jsx("span",{className:"attachment-date",children:new Date(b.uploadedAt).toLocaleDateString()})]})]}),jsxRuntime.jsx("button",{onClick:()=>v(b.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"})})})]},b.id))})]})}function qo({card:e,isOpen:t,onClose:a,onUpdate:r,onDelete:o,availableUsers:n=[],comments:l=[],activities:c=[],aiInsights:m=[],attachments:s=[],onAddComment:p,onDeleteComment:d,onUploadAttachments:i,onDeleteAttachment:g,onSuggestAssignee:y,onGenerateSubtasks:k,onEstimateEffort:x,currentUserId:h="user-1"}){let[f,u]=react.useState("details"),[w,v]=react.useState(false),[b,E]=react.useState({}),[C,D]=react.useState(""),[T,z]=react.useState(false),[$,M]=react.useState({});if(!t||!e)return null;let H=react.useCallback(()=>{v(false),E({}),u("details"),D(""),M({}),a();},[a]),S=react.useCallback(()=>{r&&Object.keys(b).length>0&&(r(e.id,b),E({}),v(false));},[e.id,b,r]),U=react.useCallback(()=>{o&&window.confirm("Are you sure you want to delete this card?")&&(o(e.id),H());},[e.id,o,H]),Y=react.useCallback(()=>{p&&C.trim()&&(p(e.id,C.trim()),D(""));},[e.id,C,p]),te=react.useCallback(async()=>{if(y){z(true);try{let I=await y(e);M(O=>({...O,assignees:I}));}catch(I){console.error("Failed to suggest assignee:",I);}finally{z(false);}}},[e,y]),R=react.useCallback(async()=>{if(k){z(true);try{let I=await k(e);M(O=>({...O,subtasks:I}));}catch(I){console.error("Failed to generate subtasks:",I);}finally{z(false);}}},[e,k]),ee=react.useCallback(async()=>{if(x){z(true);try{let I=await x(e);M(O=>({...O,effort:I}));}catch(I){console.error("Failed to estimate effort:",I);}finally{z(false);}}},[e,x]),G={...e,...b},se=n.filter(I=>G.assignedUserIds?.includes(I.id));return jsxRuntime.jsx($e,{children:jsxRuntime.jsx("div",{className:"card-detail-overlay",onClick:H,children:jsxRuntime.jsxs("div",{className:"card-detail-modal",onClick:I=>I.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:G.priority==="URGENT"?"#EF4444":G.priority==="HIGH"?"#F59E0B":G.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),w?jsxRuntime.jsx("input",{type:"text",value:b.title??G.title,onChange:I=>E({...b,title:I.target.value}),className:"card-detail-title-input",placeholder:"Card title"}):jsxRuntime.jsx("h2",{className:"card-detail-title",children:G.title})]}),jsxRuntime.jsxs("div",{className:"card-detail-header-actions",children:[w?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{onClick:S,className:"card-detail-btn card-detail-btn-primary",children:"Save"}),jsxRuntime.jsx("button",{onClick:()=>{v(false),E({});},className:"card-detail-btn",children:"Cancel"})]}):jsxRuntime.jsxs("button",{onClick:()=>v(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:U,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:H,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:()=>u("details"),className:`card-detail-tab ${f==="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:()=>u("comments"),className:`card-detail-tab ${f==="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",l.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:l.length})]}),jsxRuntime.jsxs("button",{onClick:()=>u("activity"),className:`card-detail-tab ${f==="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",c.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:c.length})]}),jsxRuntime.jsxs("button",{onClick:()=>u("attachments"),className:`card-detail-tab ${f==="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",s.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:s.length})]}),jsxRuntime.jsxs("button",{onClick:()=>u("ai"),className:`card-detail-tab ${f==="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:[f==="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:b.description??G.description??"",onChange:I=>E({...b,description:I.target.value}),className:"card-detail-textarea",placeholder:"Add a description...",rows:4}):jsxRuntime.jsx("p",{className:"card-detail-text",children:G.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:b.assignedUserIds??G.assignedUserIds??[],onChange:I=>{let O=Array.from(I.target.selectedOptions,X=>X.value);E({...b,assignedUserIds:O});},className:"card-detail-textarea",style:{height:"120px",padding:"8px 12px"},children:n.map(I=>jsxRuntime.jsx("option",{value:I.id,children:I.name},I.id))}):jsxRuntime.jsx("div",{className:"card-detail-users",children:se.length>0?se.map(I=>jsxRuntime.jsxs("div",{className:"card-detail-user",children:[jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:I.color},children:I.initials}),jsxRuntime.jsx("span",{children:I.name})]},I.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:b.priority??G.priority??"",onChange:I=>E({...b,priority:I.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:G.priority==="URGENT"?"#EF4444":G.priority==="HIGH"?"#F59E0B":G.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsxRuntime.jsx("span",{children:G.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:G.labels&&G.labels.length>0?G.labels.map(I=>jsxRuntime.jsx("span",{className:"card-detail-label-tag",children:I},I)):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:b.startDate?new Date(b.startDate).toISOString().split("T")[0]:G.startDate?new Date(G.startDate).toISOString().split("T")[0]:"",onChange:I=>E({...b,startDate:I.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsxRuntime.jsx("span",{className:"card-detail-text",children:G.startDate?new Date(G.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:b.endDate?new Date(b.endDate).toISOString().split("T")[0]:G.endDate?new Date(G.endDate).toISOString().split("T")[0]:"",onChange:I=>E({...b,endDate:I.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsxRuntime.jsx("span",{className:"card-detail-text",children:G.endDate?new Date(G.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:b.estimatedTime??G.estimatedTime??"",onChange:I=>E({...b,estimatedTime:I.target.value?parseFloat(I.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:G.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:G.dependencies&&G.dependencies.length>0?G.dependencies.map(I=>{let O=typeof I=="string"?I:I.taskId;return jsxRuntime.jsxs("span",{className:"card-detail-dependency",children:["Card #",O.slice(-4)]},O)}):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:G.createdAt?new Date(G.createdAt).toLocaleString():"Unknown"})]})]}),f==="comments"&&jsxRuntime.jsxs("div",{className:"card-detail-comments",children:[jsxRuntime.jsxs("div",{className:"card-detail-comment-form",children:[jsxRuntime.jsx("textarea",{value:C,onChange:I=>D(I.target.value),className:"card-detail-comment-textarea",placeholder:"Write a comment...",rows:3}),jsxRuntime.jsx("button",{onClick:Y,disabled:!C.trim(),className:"card-detail-btn card-detail-btn-primary",children:"Add Comment"})]}),jsxRuntime.jsx("div",{className:"card-detail-comments-list",children:l.length>0?l.map(I=>{let O=n.find(X=>X.id===I.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:[O&&jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:O.color},children:O.initials}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"card-detail-comment-author-name",children:O?.name||"Unknown"}),jsxRuntime.jsx("div",{className:"card-detail-comment-time",children:new Date(I.createdAt).toLocaleString()})]})]}),d&&jsxRuntime.jsx("button",{onClick:()=>d(I.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:I.content})]},I.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"})]})})]}),f==="activity"&&jsxRuntime.jsx("div",{className:"card-detail-activity",children:c.length>0?jsxRuntime.jsx("div",{className:"card-detail-activity-list",children:c.map(I=>{let O=n.find(X=>X.id===I.userId);return jsxRuntime.jsxs("div",{className:"card-detail-activity-item",children:[jsxRuntime.jsxs("div",{className:"card-detail-activity-icon",children:[I.type.includes("CREATED")&&"\u2795",I.type.includes("UPDATED")&&"\u270F\uFE0F",I.type.includes("MOVED")&&"\u27A1\uFE0F",I.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",I.type.includes("COMMENT")&&"\u{1F4AC}",I.type.includes("ASSIGNED")&&"\u{1F464}",I.type.includes("PRIORITY")&&"\u{1F3AF}",I.type.includes("LABEL")&&"\u{1F3F7}\uFE0F",I.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:O?.name||"Unknown"})," ",I.type.replace(/_/g," ").toLowerCase(),I.newValue&&jsxRuntime.jsxs("span",{className:"card-detail-activity-value",children:[" ","to ",jsxRuntime.jsx("strong",{children:I.newValue})]})]}),jsxRuntime.jsx("div",{className:"card-detail-activity-time",children:new Date(I.timestamp).toLocaleString()})]})]},I.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"})]})}),f==="attachments"&&jsxRuntime.jsx("div",{className:"card-detail-attachments",children:jsxRuntime.jsx(vr,{cardId:e.id,attachments:s,onUpload:i?I=>i(e.id,I):void 0,onDelete:g,currentUserId:h,maxSizeMB:10,maxFiles:20})}),f==="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:te,disabled:T||!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("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:R,disabled:T||!k,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:ee,disabled:T||!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("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((I,O)=>{let X=n.find(Re=>Re.id===I.userId);return jsxRuntime.jsxs("div",{className:"card-detail-ai-suggestion",children:[X&&jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:X.color},children:X.initials}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"card-detail-ai-suggestion-name",children:X?.name}),jsxRuntime.jsx("div",{className:"card-detail-ai-suggestion-reason",children:I.reasoning}),jsxRuntime.jsxs("div",{className:"card-detail-ai-suggestion-confidence",children:["Confidence: ",(I.confidence*100).toFixed(0),"%"]})]})]},O)})]}),$.subtasks&&jsxRuntime.jsxs("div",{className:"card-detail-ai-results",children:[jsxRuntime.jsx("h4",{children:"Suggested Subtasks"}),$.subtasks.map((I,O)=>jsxRuntime.jsxs("div",{className:"card-detail-ai-subtask",children:[jsxRuntime.jsx("div",{className:"card-detail-ai-subtask-title",children:I.title}),I.description&&jsxRuntime.jsx("div",{className:"card-detail-ai-subtask-desc",children:I.description}),I.estimatedTime&&jsxRuntime.jsxs("div",{className:"card-detail-ai-subtask-time",children:["Est: ",I.estimatedTime,"h"]})]},O))]}),$.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),"%"]})]})]}),m.length>0&&jsxRuntime.jsxs("div",{className:"card-detail-ai-insights",children:[jsxRuntime.jsx("h4",{children:"AI Insights"}),m.map(I=>jsxRuntime.jsxs("div",{className:`card-detail-ai-insight card-detail-ai-insight-${I.severity.toLowerCase()}`,children:[jsxRuntime.jsxs("div",{className:"card-detail-ai-insight-header",children:[jsxRuntime.jsx("span",{className:"card-detail-ai-insight-title",children:I.title}),jsxRuntime.jsx("span",{className:"card-detail-ai-insight-severity",children:I.severity})]}),jsxRuntime.jsx("p",{className:"card-detail-ai-insight-desc",children:I.description}),I.suggestedAction&&jsxRuntime.jsxs("div",{className:"card-detail-ai-insight-action",children:["\u{1F4A1} ",I.suggestedAction]})]},I.id))]}),!$.assignees&&!$.subtasks&&!$.effort&&m.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"})]})]})]})]})})})}var sm=["LOW","MEDIUM","HIGH","URGENT"],im=["todo","in-progress","review","done"];function Zo({card:e,isOpen:t,onClose:a,onUpdate:r,onDelete:o,availableUsers:n=[],comments:l=[],activities:c=[],onAddComment:m,onDeleteComment:s,currentUser:p,onAIGenerateDescription:d,onAICreateSubtasks:i,onAIFindSimilar:g,availableColumns:y=[],availableLabels:k=[],onUploadCoverImage:x,unsplashAccessKey:h,theme:f}){let u=Va(),w=f||u?.themeName||"dark",[v,b]=react.useState(e),[E,C]=react.useState(false),[D,T]=react.useState([]),[z,$]=react.useState(false),[M,H]=react.useState(""),[S,U]=react.useState(""),[Y,te]=react.useState("all"),[R,ee]=react.useState(false),[G,se]=react.useState(false),[I,O]=react.useState(false),[X,Re]=react.useState(false),[Me,Et]=react.useState(false),[we,ct]=react.useState(false),[bt,mt]=react.useState(false),Kt=react.useRef(null),Pa=react.useRef(null),ge=react.useRef(null),tt=react.useRef(null),Gt=react.useRef(null),$t=react.useRef(null),ua=react.useRef(null),ie=react.useRef(null);react.useEffect(()=>{e&&!v?b({...e}):e&&v&&e.id!==v.id&&b({...e});},[e,v]),react.useEffect(()=>{let P=ae=>{let Oe=ae.target;tt.current&&!tt.current.contains(Oe)&&se(false),Gt.current&&!Gt.current.contains(Oe)&&O(false),$t.current&&!$t.current.contains(Oe)&&Re(false),ua.current&&!ua.current.contains(Oe)&&Et(false);};if(G||I||X||Me)return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[G,I,X,Me]),react.useEffect(()=>{if(!t)return;let P=ae=>{let Oe=ae.target,Lt=Oe.tagName==="INPUT"||Oe.tagName==="TEXTAREA"||Oe.isContentEditable;if(ae.key==="Escape"){ae.preventDefault(),G||I||X||Me||we||bt?(se(false),O(false),Re(false),Et(false),ct(false),mt(false)):Lt||a();return}if(Lt&&ae.key!=="Escape")return;let la=ae.metaKey||ae.ctrlKey;switch(ae.key.toLowerCase()){case "s":ae.preventDefault(),se(true);break;case "a":ae.preventDefault(),Re(true);break;case "p":ae.preventDefault(),O(true);break;case "l":ae.preventDefault(),Et(true);break;case "d":la||(ae.preventDefault(),ct(true),setTimeout(()=>ie.current?.focus(),0));break;case "e":la||(ae.preventDefault(),mt(true));break;case "i":ae.preventDefault(),C(true),setTimeout(()=>Pa.current?.focus(),0);break;case "t":ae.preventDefault(),$(true);break;case "c":ae.preventDefault(),ge.current?.focus();break}};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[t,a,G,I,X,Me,we,bt]);let ce=react.useCallback(P=>{let ae=P.currentTarget.textContent?.trim()||"";if(v&&ae!==v.title){let Oe={...v,title:ae};b(Oe),r?.(v.id,{title:ae});}},[v,r]),j=react.useCallback(P=>{P.key==="Enter"&&(P.preventDefault(),P.currentTarget.blur()),P.key==="Escape"&&(P.preventDefault(),P.currentTarget.textContent=v?.title||"",P.currentTarget.blur());},[v]),_=react.useCallback(()=>{v&&e&&v.description!==e.description&&r?.(v.id,{description:v.description}),C(false);},[v,e,r]),De=react.useCallback(P=>{if(v){let ae={...v,columnId:P};b(ae),r?.(v.id,{columnId:P}),se(false);}},[v,r]),je=react.useCallback(P=>{if(v){let ae={...v,priority:P};b(ae),r?.(v.id,{priority:P}),O(false);}},[v,r]),oe=react.useCallback(P=>{if(v){let ae=v.assignedUserIds||[],Oe=ae.includes(P)?ae.filter(la=>la!==P):[...ae,P],Lt={...v,assignedUserIds:Oe};b(Lt),r?.(v.id,{assignedUserIds:Oe});}},[v,r]),le=react.useCallback(P=>{if(v){let ae=v.labels||[],Oe=ae.includes(P)?ae.filter(la=>la!==P):[...ae,P],Lt={...v,labels:Oe};b(Lt),r?.(v.id,{labels:Oe});}},[v,r]),ia=react.useCallback(P=>{if(v){let ae=P.target.value,Oe={...v,endDate:ae};b(Oe),r?.(v.id,{endDate:ae}),ct(false);}},[v,r]),Yt=react.useCallback(P=>{if(v){let ae={...v,estimatedTime:parseFloat(P)||0};b(ae),r?.(v.id,{estimatedTime:parseFloat(P)||0});}},[v,r]),pe=react.useCallback(()=>{if(M.trim()){let P={id:`subtask-${Date.now()}`,title:M.trim(),completed:false};T([...D,P]),H(""),$(false);}},[M,D]),K=react.useCallback(P=>{T(D.map(ae=>ae.id===P?{...ae,completed:!ae.completed}:ae));},[D]),ye=react.useCallback(P=>{T(D.filter(ae=>ae.id!==P));},[D]),ue=react.useCallback(()=>{S.trim()&&v&&m&&(m(v.id,S.trim()),U(""));},[S,v,m]),Ge=react.useCallback(P=>{(P.metaKey||P.ctrlKey)&&P.key==="Enter"&&(P.preventDefault(),ue());},[ue]),Ke=react.useCallback(P=>{if(v){let ae={...v,coverImage:P};b(ae),r?.(v.id,{coverImage:P}),ee(false);}},[v,r]),Ae=react.useCallback(()=>{if(v){let P={...v,coverImage:void 0};b(P),r?.(v.id,{coverImage:void 0});}},[v,r]),pt=P=>jsxRuntime.jsx(rm__default.default,{remarkPlugins:[om__default.default],rehypePlugins:[nm__default.default],components:{a:({node:ae,...Oe})=>jsxRuntime.jsx("a",{...Oe,target:"_blank",rel:"noopener noreferrer"})},children:P}),We=c.filter(P=>Y==="comments"?P.type.includes("COMMENT"):Y==="history"?!P.type.includes("COMMENT"):true);if(!t||!e)return null;let be=v||e,wt=n.filter(P=>be.assignedUserIds?.includes(P.id)),dr=D.filter(P=>P.completed).length;return jsxRuntime.jsx($e,{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:P=>P.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"modal-title","data-theme":w,children:[jsxRuntime.jsxs("header",{className:"modal-v2-header",children:[jsxRuntime.jsx("h1",{id:"modal-title",ref:Kt,className:"modal-v2-title",contentEditable:true,suppressContentEditableWarning:true,onBlur:ce,onKeyDown:j,children:be.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-cover-section",children:[!R&&!be.coverImage&&jsxRuntime.jsxs("button",{className:"modal-v2-add-cover-button",onClick:()=>ee(true),children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",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"})]}),"Add cover image"]}),!R&&be.coverImage&&jsxRuntime.jsxs("div",{className:"modal-v2-cover-preview-wrapper",children:[jsxRuntime.jsx("img",{src:be.coverImage,alt:`Cover for ${be.title}`,className:"modal-v2-cover-image",onError:P=>{P.currentTarget.style.display="none";}}),jsxRuntime.jsxs("div",{className:"modal-v2-cover-actions",children:[jsxRuntime.jsx("button",{className:"modal-v2-cover-action-button",onClick:()=>ee(true),children:"Change"}),jsxRuntime.jsx("button",{className:"modal-v2-cover-action-button danger",onClick:Ae,children:"Remove"})]})]}),R&&jsxRuntime.jsxs("div",{className:"modal-v2-cover-manager-wrapper",children:[jsxRuntime.jsxs("div",{className:"modal-v2-cover-manager-header",children:[jsxRuntime.jsx("h3",{children:"Cover Image"}),jsxRuntime.jsx("button",{className:"modal-v2-cover-manager-close",onClick:()=>ee(false),children:jsxRuntime.jsxs("svg",{width:"16",height:"16",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.jsx(Vo,{coverImage:be.coverImage,onUpload:x,onChange:Ke,onRemove:Ae,unsplashAccessKey:h,showRecentUploads:true,theme:w})]})]}),jsxRuntime.jsxs("section",{className:"modal-v2-metadata",children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:tt,children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>se(!G),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:be.columnId||"No status"})]}),G&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:(y.length>0?y:im.map(P=>({id:P,title:P}))).map(P=>jsxRuntime.jsx("button",{className:`modal-v2-popover-item ${be.columnId===P.id?"active":""}`,onClick:()=>De(P.id),children:P.title},P.id))})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:$t,children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>Re(!X),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:wt.length>0?jsxRuntime.jsx("div",{className:"modal-v2-avatars",children:wt.map(P=>jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:P.color},title:P.name,children:P.initials},P.id))}):jsxRuntime.jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),X&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:n.map(P=>jsxRuntime.jsxs("button",{className:`modal-v2-popover-item ${be.assignedUserIds?.includes(P.id)?"active":""}`,onClick:()=>oe(P.id),children:[jsxRuntime.jsx("div",{className:"modal-v2-avatar-small",style:{background:P.color},children:P.initials}),P.name,be.assignedUserIds?.includes(P.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"})})]},P.id))})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:Gt,children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>O(!I),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:be.priority||"None"})]}),I&&jsxRuntime.jsxs("div",{className:"modal-v2-popover",children:[sm.map(P=>jsxRuntime.jsx("button",{className:`modal-v2-popover-item priority-${P.toLowerCase()} ${be.priority===P?"active":""}`,onClick:()=>je(P),children:P},P)),jsxRuntime.jsx("button",{className:"modal-v2-popover-item",onClick:()=>je(""),children:"None"})]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:ua,children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>Et(!Me),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:be.labels&&be.labels.length>0?jsxRuntime.jsx("span",{children:be.labels.join(", ")}):jsxRuntime.jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),Me&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:(k.length>0?k:["Bug","Feature","Enhancement","Documentation"]).map(P=>jsxRuntime.jsxs("button",{className:`modal-v2-popover-item ${be.labels?.includes(P)?"active":""}`,onClick:()=>le(P),children:[P,be.labels?.includes(P)&&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"})})]},P))})]}),jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>{ct(!we),setTimeout(()=>ie.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:be.endDate?new Date(be.endDate).toLocaleDateString():"Not set"}),jsxRuntime.jsx("input",{ref:ie,type:"date",value:typeof be.endDate=="string"?be.endDate.split("T")[0]:be.endDate?(()=>{let P=new Date(be.endDate),ae=P.getUTCFullYear(),Oe=String(P.getUTCMonth()+1).padStart(2,"0"),Lt=String(P.getUTCDate()).padStart(2,"0");return `${ae}-${Oe}-${Lt}`})():"",onChange:ia,style:{position:"absolute",opacity:0,pointerEvents:"none"}})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>mt(!bt),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:be.estimatedTime?`${be.estimatedTime}h`:"Not set"})]}),bt&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:jsxRuntime.jsx("input",{type:"number",min:"0",step:"0.5",placeholder:"Hours",value:be.estimatedTime||"",onChange:P=>Yt(P.target.value),className:"modal-v2-time-input",autoFocus:true,onBlur:()=>mt(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"}),jsxRuntime.jsxs("button",{className:"modal-v2-ai-button",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 Assist"]})]}),E?jsxRuntime.jsx("textarea",{className:"modal-v2-textarea",value:be.description||"",onChange:P=>{if(v){let ae={...v,description:P.target.value};b(ae);}},onBlur:_,placeholder:"Add a detailed description...",autoFocus:true}):jsxRuntime.jsx("div",{className:"modal-v2-content",onClick:()=>C(true),children:be.description?jsxRuntime.jsx("div",{className:"modal-v2-markdown",children:pt(be.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"}),D.length>0&&jsxRuntime.jsxs("span",{className:"modal-v2-count",children:[dr,"/",D.length]}),jsxRuntime.jsxs("button",{className:"modal-v2-add-button",onClick:()=>$(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:[D.map(P=>jsxRuntime.jsxs("div",{className:`modal-v2-subtask ${P.completed?"completed":""}`,children:[jsxRuntime.jsx("button",{className:"modal-v2-subtask-checkbox",onClick:()=>K(P.id),children:P.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:P.title}),jsxRuntime.jsx("button",{className:"modal-v2-subtask-delete",onClick:()=>ye(P.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"})]})})]},P.id)),z&&jsxRuntime.jsx("div",{className:"modal-v2-subtask-input-row",children:jsxRuntime.jsx("input",{type:"text",placeholder:"Subtask title...",value:M,onChange:P=>H(P.target.value),onKeyDown:P=>{P.key==="Enter"&&pe(),P.key==="Escape"&&($(false),H(""));},onBlur:pe,autoFocus:true,className:"modal-v2-subtask-input"})})]})]}),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 ${Y==="all"?"active":""}`,onClick:()=>te("all"),children:"All"}),jsxRuntime.jsx("button",{className:`modal-v2-filter ${Y==="comments"?"active":""}`,onClick:()=>te("comments"),children:"Comments"}),jsxRuntime.jsx("button",{className:`modal-v2-filter ${Y==="history"?"active":""}`,onClick:()=>te("history"),children:"History"})]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-input",children:[p&&jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:p.color},children:p.initials}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-wrapper",children:[jsxRuntime.jsx("textarea",{ref:ge,className:"modal-v2-comment-textarea",placeholder:"Write a comment...",value:S,onChange:P=>U(P.target.value),onKeyDown:Ge,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:ue,disabled:!S.trim(),children:"Send"})]})]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-timeline",children:[We.map(P=>{let ae=n.find(Lt=>Lt.id===P.userId);if(P.type.includes("COMMENT")){let Lt=l.find(la=>la.id===P.metadata?.commentId);return Lt?jsxRuntime.jsxs("div",{className:"modal-v2-activity-item comment-item",children:[ae&&jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:ae.color},children:ae.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:ae?.name||"Unknown"}),jsxRuntime.jsx("span",{className:"modal-v2-activity-time",children:new Date(P.timestamp).toLocaleString()})]}),jsxRuntime.jsx("div",{className:"modal-v2-comment-body",children:Lt.content})]})]},P.id):null}return jsxRuntime.jsxs("div",{className:"modal-v2-activity-item history-item",children:[jsxRuntime.jsxs("div",{className:"modal-v2-history-icon",children:[P.type.includes("CREATED")&&"\u2795",P.type.includes("UPDATED")&&"\u270F\uFE0F",P.type.includes("MOVED")&&"\u27A1\uFE0F",P.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",P.type.includes("ASSIGNED")&&"\u{1F464}",P.type.includes("PRIORITY")&&"\u{1F3AF}",P.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:ae?.name||"Unknown"})," ",P.type.replace(/_/g," ").toLowerCase(),P.newValue&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" to ",jsxRuntime.jsx("strong",{children:P.newValue})]})]}),jsxRuntime.jsx("span",{className:"modal-v2-activity-time",children:new Date(P.timestamp).toLocaleString()})]})]},P.id)}),We.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 hm({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 en({data:e,title:t="Team Velocity",height:a=300,showAverage:r=true,showPlanned:o=true}){let n=e.map(l=>({...l,average:l.average??e.reduce((c,m)=>c+m.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:n,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(hm,{})}),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}}),o&&jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"planned",stroke:"#3B82F6",strokeWidth:2,strokeDasharray:"5 5",name:"Planned",dot:{fill:"#3B82F6",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((l,c)=>l+c.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((l,c)=>l+c.completed,0)/e.length).toFixed(1)})]}),o&&e.some(l=>l.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:"#3B82F6"},children:e.reduce((l,c)=>l+(c.planned||0),0)})]})]})]})}function Nm({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 tn({data:e,title:t="Sprint Burndown",height:a=300,totalTasks:r,useArea:o=false}){let n=r??(e[0]?.ideal||e[0]?.remaining||0),l=e[e.length-1]?.remaining||0,c=e[e.length-1]?.ideal||0,m=n>0?(n-l)/n*100:0,s=l<=c;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(o?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(Nm,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),o?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:s?"#10B981":"#EF4444",fill:s?"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:s?"#10B981":"#EF4444",strokeWidth:3,name:"Remaining",dot:{fill:s?"#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:m>=50?"#10B981":"#F59E0B"},children:[m.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:s?"#10B981":"#EF4444"},children:l})]}),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:s?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:s?"#10B981":"#EF4444"},children:s?"\u2713 On Track":"\u26A0 Behind"})]})]})]})}var Fm={URGENT:"#EF4444",HIGH:"#F59E0B",MEDIUM:"#3B82F6",LOW:"#10B981"},bi=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899"];function Bm({cx:e,cy:t,midAngle:a,innerRadius:r,outerRadius:o,percent:n}){let l=r+(o-r)*.5,c=e+l*Math.cos(-a*(Math.PI/180)),m=t+l*Math.sin(-a*(Math.PI/180));return n<.05?null:jsxRuntime.jsx("text",{x:c,y:m,fill:"white",textAnchor:c>e?"start":"end",dominantBaseline:"central",style:{fontSize:"12px",fontWeight:600},children:`${(n*100).toFixed(0)}%`})}function vi({active:e,payload:t}){if(!e||!t||!t.length)return null;let a=t[0].payload,r=t[0].payload.totalValue||0,o=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:[o,"%"]})]})]})}function an({data:e,title:t="Distribution",type:a="pie",height:r=300,showPercentages:o=true}){let n=e.reduce((m,s)=>m+s.value,0),l=e.map(m=>({...m,totalValue:n,color:m.color||Fm[m.name]||bi[e.indexOf(m)%bi.length]})),c=l.map(m=>m.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:l,cx:"50%",cy:"50%",labelLine:false,label:o?Bm:false,outerRadius:r*.35,fill:"#8884d8",dataKey:"value",children:l.map((m,s)=>jsxRuntime.jsx(recharts.Cell,{fill:c[s]},`cell-${s}`))}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(vi,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"},formatter:(m,s)=>{let p=s.payload,d=n>0?(p.value/n*100).toFixed(0):"0";return `${m} (${p.value} - ${d}%)`}})]}):jsxRuntime.jsxs(recharts.BarChart,{data:l,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(vi,{})}),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:l.map((m,s)=>jsxRuntime.jsx(recharts.Cell,{fill:c[s]},`cell-${s}`))})]})}),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:"#3B82F6"},children:n})]}),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((m,s)=>s.value>m.value?s:m).name})]})]})]})}var jr=react.memo(({selectedCards:e,availableUsers:t=[],onClearSelection:a,callbacks:r,columns:o=[],availableLabels:n=[]})=>{let[l,c]=react.useState(false),[m,s]=react.useState(false),[p,d]=react.useState(false),[i,g]=react.useState(false);if(e.length===0)return null;let y=e.map(w=>w.id),k=w=>{r.onBulkUpdate?.(y,{priority:w}),c(false);},x=w=>{r.onBulkMove?.(y,w),s(false),a();},h=w=>{r.onBulkUpdate?.(y,{assignedUserIds:w}),d(false);},f=w=>{let v=new Set;e.forEach(E=>{E.labels?.forEach(C=>v.add(C));});let b=Array.from(new Set([...v,...w]));r.onBulkUpdate?.(y,{labels:b}),g(false);},u=()=>{confirm(`Delete ${e.length} card(s)? This cannot be undone.`)&&(r.onBulkDelete?.(y),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:()=>c(!l),title:"Update priority",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Priority"})}),l&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:["LOW","MEDIUM","HIGH","URGENT"].map(w=>jsxRuntime.jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>k(w),children:[jsxRuntime.jsx("span",{className:F("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))})]}),o.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>s(!m),title:"Move to column",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Move"})}),m&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:o.map(w=>jsxRuntime.jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>x(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:()=>d(!p),title:"Assign users",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Assign"})}),p&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:t.map(w=>jsxRuntime.jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>h([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))})]}),n.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>g(!i),title:"Add labels",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Labels"})}),i&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:n.map(w=>jsxRuntime.jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>f([w]),children:w},w))})]}),jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button asakaa-bulk-toolbar-button-danger",onClick:u,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"})})]})]})})});jr.displayName="BulkOperationsToolbar";function Gm(e,t,a){if(t==="none")return [];let r=new Map;return e.forEach(o=>{let n,l,c,m,s;switch(t){case "assignee":let p=o.assignedUserIds||(o.assigneeId?[o.assigneeId]:[]);p.length>0?p.forEach(g=>{let y=a?.find(k=>k.id===g);l=`assignee-${g}`,c=y?.name||`User ${g}`,m=y?.color,s=y?.avatar,r.has(l)||r.set(l,{id:l,title:c,groupValue:g,cardIds:[],color:m,icon:s}),r.get(l).cardIds.push(o.id);}):(l="assignee-unassigned",c="Unassigned",m="#6b7280",s="\u{1F464}",r.has(l)||r.set(l,{id:l,title:c,groupValue:null,cardIds:[],color:m,icon:s}),r.get(l).cardIds.push(o.id));break;case "priority":n=o.priority||"NONE",l=`priority-${n}`;let i={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"}}[n];c=i.title,m=i.color,r.has(l)||r.set(l,{id:l,title:c,groupValue:n,cardIds:[],color:m}),r.get(l).cardIds.push(o.id);break;case "label":o.labels&&o.labels.length>0?o.labels.forEach(g=>{l=`label-${g}`,c=g,m="#6b7280",r.has(l)||r.set(l,{id:l,title:c,groupValue:g,cardIds:[],color:m}),r.get(l).cardIds.push(o.id);}):(l="label-none",c="No Labels",m="#6b7280",r.has(l)||r.set(l,{id:l,title:c,groupValue:null,cardIds:[],color:m}),r.get(l).cardIds.push(o.id));break}}),Array.from(r.values()).sort((o,n)=>o.title.localeCompare(n.title))}function rn({board:e,swimlaneConfig:t,availableUsers:a,callbacks:r,className:o}){let[n,l]=react.useState(new Set),c=react.useMemo(()=>Gm(e.cards,t.groupBy,a),[e.cards,t.groupBy,a]),m=react.useCallback(s=>{l(p=>{let d=new Set(p);return d.has(s)?d.delete(s):d.add(s),d});},[]);return t.groupBy==="none"||c.length===0?jsxRuntime.jsx(ka,{board:e,callbacks:r,availableUsers:a,className:o}):jsxRuntime.jsxs("div",{className:F("asakaa-swimlane-view",o),children:[c.map(s=>{let p=n.has(s.id),d=e.cards.filter(g=>s.cardIds.includes(g.id)),i={...e,cards:d};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&&m(s.id),style:{borderLeft:s.color?`4px solid ${s.color}`:void 0},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[s.icon&&jsxRuntime.jsx("span",{className:"text-2xl leading-none",children:s.icon}),jsxRuntime.jsx("h3",{className:"text-lg font-semibold",style:{color:s.color},children:s.title}),jsxRuntime.jsxs("span",{className:"text-sm text-white/50 font-medium",children:["(",s.cardIds.length," ",s.cardIds.length===1?"card":"cards",")"]})]}),t.collapsible&&jsxRuntime.jsx("button",{className:"text-white/50 hover:text-white transition-colors","aria-label":p?"Expand lane":"Collapse lane",children:p?"\u25B6":"\u25BC"})]}),!p&&jsxRuntime.jsx("div",{className:"asakaa-swimlane-content p-4",children:jsxRuntime.jsx(ka,{board:i,callbacks:r,availableUsers:a})})]},s.id)}),c.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 on=[{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 nn({value:e,onChange:t,className:a}){let[r,o]=react.useState(false),n=react.useRef(null),l=react.useRef(null),c=on.find(s=>s.value===e)||on[0];react.useEffect(()=>{function s(p){n.current&&!n.current.contains(p.target)&&l.current&&!l.current.contains(p.target)&&o(false);}if(r)return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[r]);let m=s=>{t(s),o(false);};return jsxRuntime.jsxs("div",{className:F("relative inline-block",a),children:[jsxRuntime.jsxs("button",{ref:l,onClick:()=>o(!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:c.icon}),jsxRuntime.jsx("span",{children:c.label}),jsxRuntime.jsx("svg",{className:F("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:n,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:on.map(s=>jsxRuntime.jsxs("button",{onClick:()=>m(s.value),className:F("w-full px-3 py-2 flex items-start gap-3 text-left transition-all hover:bg-white/10",e===s.value&&"bg-white/5"),children:[jsxRuntime.jsx("span",{className:"text-xl leading-none mt-0.5",children:s.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:s.label}),e===s.value&&jsxRuntime.jsx("span",{className:"text-blue-400 text-xs",children:"\u2713"})]}),jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-0.5",children:s.description})]})]},s.value))})]})]})}var yr=[{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 Hm(e,t){if(!(Array.isArray(t.keys)?t.keys:[t.keys]).some(s=>e.key===s||e.code===s))return false;let o=t.modifiers||{},n=o.ctrl?e.ctrlKey||e.metaKey:!e.ctrlKey&&!e.metaKey,l=o.shift?e.shiftKey:!e.shiftKey,c=o.alt?e.altKey:!e.altKey,m=o.meta?e.metaKey:true;return n&&l&&c&&m}function Ci(e={}){let{shortcuts:t=yr,enabled:a=true,preventDefault:r=true}=e,o=react.useRef(t),n=react.useRef(a);react.useEffect(()=>{o.current=t,n.current=a;},[t,a]);let l=react.useCallback(m=>{o.current=[...o.current,m];},[]),c=react.useCallback(m=>{o.current=o.current.filter(s=>s.action!==m);},[]);return react.useEffect(()=>{function m(s){if(!n.current)return;let p=s.target;if(!((p.tagName==="INPUT"||p.tagName==="TEXTAREA"||p.isContentEditable)&&s.key!=="Escape"&&!s.ctrlKey&&!s.metaKey)){for(let d of o.current)if(Hm(s,d)){r&&s.preventDefault();let i=new CustomEvent("keyboard-action",{detail:d.action,bubbles:true,cancelable:true});window.dispatchEvent(i);break}}}return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[r]),{registerShortcut:l,unregisterShortcut:c,isEnabled:a}}function Vm(e){return {ArrowUp:"\u2191",ArrowDown:"\u2193",ArrowLeft:"\u2190",ArrowRight:"\u2192",Enter:"\u21B5",Escape:"Esc",Delete:"Del"," ":"Space"}[e]||e.toUpperCase()}function jm(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 Km(e){let t=Array.isArray(e.keys)?e.keys[0]:e.keys,a=jm(e),r=t?Vm(t):"";return a?`${a} + ${r}`:r}function Ym(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 sn({shortcuts:e=yr,isOpen:t,onClose:a,className:r}){let[o,n]=react.useState(false);if(react.useEffect(()=>{n(true);},[]),react.useEffect(()=>{function c(m){m.key==="Escape"&&t&&a();}if(t)return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[t,a]),!o||!t)return null;let l=Ym(e);return jsxRuntime.jsxs("div",{className:F("fixed inset-0 z-[9999] flex items-center justify-center",r),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-3xl w-full mx-4 max-h-[80vh] overflow-hidden",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:"\u2328\uFE0F"}),"Keyboard Shortcuts"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Speed up your workflow with these shortcuts"})]}),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.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(l).map(([c,m])=>m.length===0?null:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-lg font-semibold text-white/90 mb-4 flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"w-1 h-5 bg-blue-500 rounded-full"}),c]}),jsxRuntime.jsx("div",{className:"space-y-3",children:m.map(s=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-4 p-3 rounded-lg bg-white/5 hover:bg-white/10 transition-colors",children:[jsxRuntime.jsx("span",{className:"text-sm text-white/80",children:s.description}),jsxRuntime.jsx("kbd",{className:"px-3 py-1.5 bg-gradient-to-br from-gray-700 to-gray-800 border border-white/20 rounded-md text-xs font-mono text-white/90 shadow-lg whitespace-nowrap",children:Km(s)})]},s.action))})]},c))})}),jsxRuntime.jsx("div",{className:"px-6 py-4 border-t border-white/10 bg-white/5",children:jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center",children:["Press ",jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 bg-white/10 rounded text-white/70",children:"?"})," to toggle this help panel"]})})]})]})}var ln=[{id:"bug-report",name:"Bug Report",description:"Report a bug or issue",icon:"\u{1F41B}",category:"Development",template:{title:"[BUG] ",description:`**Steps to reproduce:**
|
|
6
6
|
1.
|
|
7
7
|
|