@pixonui/react 0.5.14 → 0.5.15

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.js CHANGED
@@ -66,6 +66,6 @@
66
66
  `})]})}function RC({data:e,keys:t,colors:r=["cyan","purple","emerald"],maxValue:o,height:n=300,className:a,...s}){let[i,c]=we.useState(0),d=we__namespace.default.useRef(null);we__namespace.default.useEffect(()=>{if(!d.current)return;let h=new ResizeObserver(p=>{p[0]&&c(p[0].contentRect.width);});return h.observe(d.current),()=>h.disconnect()},[]);let m={x:i/2,y:n/2},u=Math.min(i,n)/2-40,f=we.useMemo(()=>{if(o)return o;let h=0;return e.forEach(p=>{t.forEach(b=>{let w=Number(p[b])||0;w>h&&(h=w);});}),h*1.1||100},[e,t,o]),g=Math.PI*2/e.length,x={cyan:"rgba(6, 182, 212, 0.5)",purple:"rgba(139, 92, 246, 0.5)",emerald:"rgba(16, 185, 129, 0.5)",amber:"rgba(245, 158, 11, 0.5)",rose:"rgba(244, 63, 94, 0.5)"},v={cyan:"#06b6d4",purple:"#8b5cf6",emerald:"#10b981",amber:"#f59e0b",rose:"#f43f5e"};return i===0?jsxRuntime.jsx("div",{ref:d,style:{height:n}}):jsxRuntime.jsx("div",{ref:d,className:l("relative w-full select-none",a),style:{height:n},...s,children:jsxRuntime.jsxs("svg",{width:"100%",height:"100%",viewBox:`0 0 ${i} ${n}`,className:"overflow-visible",children:[[1,2,3,4,5].map(h=>{let p=u/5*h,b=e.map((w,k)=>{let y=g*k-Math.PI/2;return `${m.x+Math.cos(y)*p},${m.y+Math.sin(y)*p}`}).join(" ");return jsxRuntime.jsx("polygon",{points:b,fill:"none",stroke:"rgba(255,255,255,0.1)",strokeWidth:"1"},h)}),e.map((h,p)=>{let b=g*p-Math.PI/2,w=m.x+Math.cos(b)*u,k=m.y+Math.sin(b)*u,y=m.x+Math.cos(b)*(u+20),N=m.y+Math.sin(b)*(u+20);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:m.x,y1:m.y,x2:w,y2:k,stroke:"rgba(255,255,255,0.1)",strokeWidth:"1"}),jsxRuntime.jsx("text",{x:y,y:N,textAnchor:"middle",dominantBaseline:"middle",fill:"rgba(255,255,255,0.6)",fontSize:"12",children:h.subject})]},p)}),t.map((h,p)=>{let b=e.map((N,C)=>{let L=(Number(N[h])||0)/f*u,H=g*C-Math.PI/2;return `${m.x+Math.cos(H)*L},${m.y+Math.sin(H)*L}`}).join(" "),w=r[p%r.length]||"cyan",k=x[w],y=v[w];return jsxRuntime.jsx("polygon",{points:b,fill:k,fillOpacity:.3,stroke:y,strokeWidth:2,className:"transition-all duration-500 ease-out hover:fill-opacity-50"},h)})]})})}function SC({data:e,color:t="emerald",height:r=40,strokeWidth:o=2,fill:n=false,className:a,...s}){let i=Math.max(...e),c=Math.min(...e),d=i-c||1,u={cyan:"#06b6d4",purple:"#8b5cf6",emerald:"#10b981",amber:"#f59e0b",rose:"#f43f5e",white:"#ffffff"}[t],f=e.map((v,h)=>{let p=h/(e.length-1)*100,w=95-(v-c)/d*90;return {x:p,y:w}}),g="";if(f.length>0){g=`M ${f[0].x} ${f[0].y}`;for(let v=0;v<f.length-1;v++){let h=f[v],p=f[v+1],b=h.x+(p.x-h.x)/2,w=h.y,k=h.x+(p.x-h.x)/2,y=p.y;g+=` C ${b} ${w}, ${k} ${y}, ${p.x} ${p.y}`;}}let x=n?`${g} L 100 100 L 0 100 Z`:void 0;return jsxRuntime.jsx("div",{className:l("w-full overflow-hidden",a),style:{height:r},...s,children:jsxRuntime.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"overflow-visible",children:[n&&jsxRuntime.jsx("path",{d:x,fill:u,fillOpacity:.1,stroke:"none"}),jsxRuntime.jsx("path",{d:g,fill:"none",stroke:u,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]})})}function AC({ticks:e=5,format:t=r=>r.toString()}){let{height:r,padding:o,maxValue:n}=Me(),a=r-o.top-o.bottom;return jsxRuntime.jsx("g",{children:Array.from({length:e+1}).map((s,i)=>{let c=n/e*i,d=r-o.bottom-a/e*i;return jsxRuntime.jsx("text",{x:o.left-10,y:d,textAnchor:"end",dominantBaseline:"middle",className:"fill-gray-400 dark:fill-white/40 text-xs font-medium",children:t(Math.round(c))},i)})})}var ha=we.createContext(void 0);function $C({defaultValue:e,value:t,onValueChange:r,className:o,children:n,...a}){let[s,i]=we.useState(e),c=m=>{t===void 0&&i(m),r?.(m);},d=t!==void 0?t:s;return jsxRuntime.jsx(ha.Provider,{value:{value:d,onValueChange:c},children:jsxRuntime.jsx("div",{className:l("w-full",o),...a,children:n})})}function FC({className:e,children:t,...r}){return jsxRuntime.jsx("div",{role:"tablist",className:l("inline-flex h-10 items-center justify-center rounded-2xl bg-gray-100 p-1 text-gray-500 dark:bg-white/[0.03] dark:text-white/60",e),...r,children:t})}function UC({className:e,value:t,children:r,...o}){let n=we.useContext(ha);if(!n)throw new Error("TabsTrigger must be used within Tabs");let a=n.value===t;return jsxRuntime.jsx("button",{type:"button",role:"tab","aria-selected":a,"aria-controls":`tabs-content-${t}`,id:`tabs-trigger-${t}`,onClick:()=>n.onValueChange(t),className:l("inline-flex items-center justify-center whitespace-nowrap rounded-2xl px-3 py-1.5 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-zinc-950 dark:focus-visible:ring-white/20",a?"bg-white text-gray-900 shadow-sm dark:bg-white/[0.06] dark:text-white dark:backdrop-blur-sm":"hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-white/[0.03] dark:hover:text-white",e),...o,children:r})}function WC({className:e,value:t,children:r,...o}){let n=we.useContext(ha);if(!n)throw new Error("TabsContent must be used within Tabs");return n.value!==t?null:jsxRuntime.jsx("div",{role:"tabpanel",id:`tabs-content-${t}`,"aria-labelledby":`tabs-trigger-${t}`,tabIndex:0,className:l("mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20 focus-visible:ring-offset-2",e),...o,children:r})}var GC=we__namespace.default.forwardRef(({className:e,children:t,...r},o)=>jsxRuntime.jsx("aside",{ref:o,className:l("flex h-full w-64 flex-col border-r backdrop-blur-xl transition-colors duration-200","border-gray-200 bg-white/50","dark:border-white/10 dark:bg-black/20",e),...r,children:t})),jC=we__namespace.default.forwardRef(({className:e,children:t,...r},o)=>jsxRuntime.jsx("div",{ref:o,className:l("flex h-16 items-center px-6 border-b border-gray-200 dark:border-white/5",e),...r,children:t})),QC=we__namespace.default.forwardRef(({className:e,children:t,...r},o)=>jsxRuntime.jsx("div",{ref:o,className:l("flex-1 overflow-y-auto py-4 px-3 space-y-1",e),...r,children:t})),JC=we__namespace.default.forwardRef(({className:e,children:t,...r},o)=>jsxRuntime.jsx("div",{ref:o,className:l("p-4 border-t border-gray-200 dark:border-white/5",e),...r,children:t})),ZC=we__namespace.default.forwardRef(({className:e,children:t,active:r,icon:o,badge:n,...a},s)=>jsxRuntime.jsxs("button",{ref:s,className:l("flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium transition-colors","hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-white/[0.03] dark:hover:text-white",r?"bg-gray-200 text-gray-900 dark:bg-white/[0.06] dark:text-white":"text-gray-600 dark:text-white/60",e),...a,children:[o&&jsxRuntime.jsx("span",{className:l("flex h-4 w-4 items-center justify-center",r?"text-gray-900 dark:text-white":"text-gray-500 dark:text-white/60"),children:o}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:t}),n&&jsxRuntime.jsx("span",{className:"flex h-5 min-w-5 items-center justify-center rounded-full bg-gray-200 dark:bg-white/[0.06] px-1.5 text-[10px] font-bold text-gray-900 dark:text-white",children:n})]})),eM=we__namespace.default.forwardRef(({className:e,children:t,label:r,...o},n)=>jsxRuntime.jsxs("div",{ref:n,className:l("mb-6",e),...o,children:[r&&jsxRuntime.jsx("div",{className:"mb-2 px-3 text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-white/40",children:r}),jsxRuntime.jsx("div",{className:"space-y-1",children:t})]}));var tp={sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl","2xl":"max-w-screen-2xl",full:"max-w-full"};function lM({logo:e,links:t=[],actions:r,className:o,maxWidth:n="xl"}){let[a,s]=we.useState(false),[i,c]=we.useState(false);return we.useEffect(()=>{let d=()=>{s(window.scrollY>20);};return window.addEventListener("scroll",d),()=>window.removeEventListener("scroll",d)},[]),jsxRuntime.jsx("nav",{className:l("fixed top-0 left-0 right-0 z-50 transition-all duration-300 px-4 py-4",a?"py-3":"py-6",o),children:jsxRuntime.jsxs("div",{className:l("mx-auto transition-all duration-300",tp[n]),children:[jsxRuntime.jsxs(ne,{className:l("flex items-center justify-between px-6 py-3 transition-all duration-300",a?"rounded-2xl border-white/10 bg-white/70 dark:bg-zinc-900/70 backdrop-blur-xl shadow-lg":"rounded-2xl border-transparent bg-transparent dark:bg-transparent backdrop-blur-none shadow-none"),children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:e||jsxRuntime.jsx("span",{className:"text-xl font-bold tracking-tighter",children:"PIXON"})}),jsxRuntime.jsx("div",{className:"hidden md:flex items-center gap-8",children:t.map(d=>jsxRuntime.jsx("a",{href:d.href,className:"text-sm font-medium text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white transition-colors",children:d.label},d.label))}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx("div",{className:"hidden md:flex items-center gap-2",children:r}),jsxRuntime.jsx("button",{className:"md:hidden p-2 text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-white/[0.03] rounded-2xl transition-colors",onClick:()=>c(!i),children:i?jsxRuntime.jsx(lucideReact.X,{size:20}):jsxRuntime.jsx(lucideReact.Menu,{size:20})})]})]}),jsxRuntime.jsx("div",{className:l("md:hidden absolute top-full left-4 right-4 mt-2 transition-all duration-300 origin-top",i?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 -translate-y-4 pointer-events-none"),children:jsxRuntime.jsxs(ne,{className:"p-4 flex flex-col gap-4 shadow-2xl border-white/10 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-2xl",children:[t.map(d=>jsxRuntime.jsx("a",{href:d.href,className:"text-base font-medium px-4 py-2 rounded-2xl hover:bg-zinc-100 dark:hover:bg-white/[0.03] text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white transition-all",onClick:()=>c(false),children:d.label},d.label)),jsxRuntime.jsx("div",{className:"pt-4 border-t border-zinc-200 dark:border-white/10 flex flex-col gap-2",children:r})]})})]})})}var go=we.createContext(void 0);function at({children:e}){let[t,r]=we.useState(false),o=we.useRef(null);return jsxRuntime.jsx(go.Provider,{value:{isOpen:t,setIsOpen:r,triggerRef:o},children:jsxRuntime.jsx("div",{className:"relative inline-block text-left",children:e})})}function nt({className:e,children:t,...r}){let o=we.useContext(go);if(!o)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=a=>{o.setIsOpen(!o.isOpen),r.onClick?.(a);};return jsxRuntime.jsx("button",{ref:o.triggerRef,type:"button","aria-haspopup":"menu","aria-expanded":o.isOpen?"true":"false",onClick:n,className:l("inline-flex items-center justify-center",e),...r,children:t})}function st({className:e,children:t,align:r="start",side:o="bottom",...n}){let a=we.useContext(go);if(!a)throw new Error("DropdownMenuContent must be used within DropdownMenu");let s=we.useRef(null),{position:i,isPositioned:c}=Kt(a.triggerRef,s,{side:o,align:r,isOpen:a.isOpen});if(we.useEffect(()=>{if(a.isOpen){let m=f=>{s.current&&!s.current.contains(f.target)&&a.triggerRef.current&&!a.triggerRef.current.contains(f.target)&&a.setIsOpen(false);},u=f=>{if(f.key==="Escape"&&(a.setIsOpen(false),a.triggerRef.current?.focus()),f.key==="ArrowDown"||f.key==="ArrowUp"){f.preventDefault();let g=s.current?.querySelectorAll('[role="menuitem"]');if(!g.length)return;let x=Array.from(g).indexOf(document.activeElement),v=0;f.key==="ArrowDown"?v=(x+1)%g.length:v=(x-1+g.length)%g.length,g[v]?.focus();}};return document.addEventListener("mousedown",m),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",u);}}},[a.isOpen,a.setIsOpen,a.triggerRef]),!a.isOpen)return null;let d=()=>o==="bottom"?r==="start"?"top left":r==="end"?"top right":"top center":o==="top"?r==="start"?"bottom left":r==="end"?"bottom right":"bottom center":o==="left"?r==="start"?"top right":r==="end"?"bottom right":"center right":o==="right"?r==="start"?"top left":r==="end"?"bottom left":"center left":"center center";return reactDom.createPortal(jsxRuntime.jsx("div",{ref:s,role:"menu","aria-orientation":"vertical",style:{top:i.top,left:i.left,transformOrigin:d()},className:l("fixed z-[110] min-w-[8rem] overflow-hidden rounded-2xl border border-gray-200 dark:border-white/10 bg-white/80 dark:bg-white/[0.03] backdrop-blur-xl p-1 shadow-md duration-100",c?"animate-in fade-in zoom-in-95 opacity-100":"opacity-0",e),...n,children:t}),document.body)}function K({className:e,children:t,...r}){let o=we.useContext(go);return jsxRuntime.jsx("button",{type:"button",role:"menuitem",onClick:a=>{o?.setIsOpen(false),r.onClick?.(a);},className:l("relative flex w-full cursor-pointer select-none items-center rounded-2xl px-3 py-2 text-sm outline-none transition-colors","text-gray-700 dark:text-white/80","hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-white/[0.06] dark:hover:text-white","focus:bg-gray-100 focus:text-gray-900 dark:focus:bg-white/[0.06] dark:focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:t})}function Bs({className:e,children:t,...r}){return jsxRuntime.jsx("div",{className:l("px-2 py-1.5 text-sm font-semibold text-gray-900 dark:text-white",e),...r,children:t})}function xa({className:e,...t}){return jsxRuntime.jsx("div",{className:l("-mx-1 my-1 h-px bg-gray-200 dark:bg-white/[0.03]",e),...t})}function NM({name:e,description:t,avatarSrc:r,avatarFallback:o,className:n,side:a="top",align:s="start"}){return jsxRuntime.jsxs(at,{children:[jsxRuntime.jsx(nt,{className:l("w-full outline-none",n),children:jsxRuntime.jsxs("div",{className:"group flex w-full items-center gap-3 rounded-2xl border border-gray-200 dark:border-white/5 bg-white dark:bg-white/[0.03] p-3 transition-colors hover:bg-gray-50 dark:hover:bg-white/[0.06]",children:[jsxRuntime.jsx(z,{src:r,fallback:o||e.charAt(0),size:"sm"}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col items-start text-left",children:[jsxRuntime.jsx("span",{className:"text-xs font-medium text-gray-900 dark:text-white",children:e}),t&&jsxRuntime.jsx("span",{className:"text-[10px] text-gray-500 dark:text-white/50",children:t})]}),jsxRuntime.jsx(lucideReact.Settings,{className:"h-4 w-4 text-gray-400 dark:text-white/50 transition-colors group-hover:text-gray-900 dark:group-hover:text-white"})]})}),jsxRuntime.jsxs(st,{className:"w-56",align:s,side:a,children:[jsxRuntime.jsx(Bs,{children:"My Account"}),jsxRuntime.jsx(xa,{}),jsxRuntime.jsxs(K,{children:[jsxRuntime.jsx(lucideReact.User,{className:"mr-2 h-4 w-4"}),jsxRuntime.jsx("span",{children:"Profile"})]}),jsxRuntime.jsxs(K,{children:[jsxRuntime.jsx(lucideReact.Settings,{className:"mr-2 h-4 w-4"}),jsxRuntime.jsx("span",{children:"Settings"})]}),jsxRuntime.jsx(xa,{}),jsxRuntime.jsxs(K,{className:"text-rose-400 focus:text-rose-400",children:[jsxRuntime.jsx(lucideReact.LogOut,{className:"mr-2 h-4 w-4"}),jsxRuntime.jsx("span",{children:"Log out"})]})]})]})}var lp=we__namespace.default.forwardRef(({...e},t)=>jsxRuntime.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));lp.displayName="Breadcrumb";var cp=we__namespace.default.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx("ol",{ref:r,className:l("flex flex-wrap items-center gap-1.5 break-words text-sm text-gray-500 dark:text-white/50 sm:gap-2.5",e),...t}));cp.displayName="BreadcrumbList";var dp=we__namespace.default.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx("li",{ref:r,className:l("inline-flex items-center gap-1.5",e),...t}));dp.displayName="BreadcrumbItem";var mp=we__namespace.default.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx("a",{ref:r,className:l("transition-colors hover:text-gray-900 dark:hover:text-white",e),...t}));mp.displayName="BreadcrumbLink";var up=we__namespace.default.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:l("font-normal text-gray-900 dark:text-white",e),...t}));up.displayName="BreadcrumbPage";var pp=({children:e,className:t,...r})=>jsxRuntime.jsx("li",{role:"presentation","aria-hidden":"true",className:l("[&>svg]:size-3.5",t),...r,children:e??jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:jsxRuntime.jsx("path",{d:"m9 18 6-6-6-6"})})});pp.displayName="BreadcrumbSeparator";var fp=({className:e,...t})=>jsxRuntime.jsxs("span",{role:"presentation","aria-hidden":"true",className:l("flex h-9 w-9 items-center justify-center",e),...t,children:[jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"19",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"5",cy:"12",r:"1"})]}),jsxRuntime.jsx("span",{className:"sr-only",children:"More"})]});fp.displayName="BreadcrumbElipssis";function SM({contentId:e="main-content",className:t,children:r="Skip to content"}){return jsxRuntime.jsx("a",{href:`#${e}`,className:l("sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-[100] focus:px-4 focus:py-2 focus:bg-purple-600 focus:text-white focus:rounded-xl focus:shadow-2xl focus:outline-none focus:ring-2 focus:ring-white/20 transition-all",t),children:r})}var hp=({className:e,...t})=>jsxRuntime.jsx("nav",{role:"navigation","aria-label":"pagination",className:l("mx-auto flex w-full justify-center",e),...t});hp.displayName="Pagination";var bp=we__namespace.default.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx("ul",{ref:r,className:l("flex flex-row items-center gap-1",e),...t}));bp.displayName="PaginationContent";var xp=we__namespace.default.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx("li",{ref:r,className:l("",e),...t}));xp.displayName="PaginationItem";var va=({className:e,isActive:t,...r})=>jsxRuntime.jsx("a",{"aria-current":t?"page":void 0,className:l("inline-flex h-9 w-9 items-center justify-center rounded-2xl text-sm font-medium transition-colors","hover:bg-gray-100 dark:hover:bg-white/[0.03] hover:text-gray-900 dark:hover:text-white",t?"bg-gray-100 text-gray-900 dark:bg-white/[0.06] dark:text-white":"text-gray-500 dark:text-white/60",e),...r});va.displayName="PaginationLink";var vp=({className:e,...t})=>jsxRuntime.jsxs(va,{"aria-label":"Go to previous page",className:l("w-auto gap-1 px-2.5",e),...t,children:[jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:jsxRuntime.jsx("path",{d:"m15 18-6-6 6-6"})}),jsxRuntime.jsx("span",{children:"Previous"})]});vp.displayName="PaginationPrevious";var wp=({className:e,...t})=>jsxRuntime.jsxs(va,{"aria-label":"Go to next page",className:l("w-auto gap-1 px-2.5",e),...t,children:[jsxRuntime.jsx("span",{children:"Next"}),jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:jsxRuntime.jsx("path",{d:"m9 18 6-6-6-6"})})]});wp.displayName="PaginationNext";var yp=({className:e,...t})=>jsxRuntime.jsxs("span",{"aria-hidden":true,className:l("flex h-9 w-9 items-center justify-center",e),...t,children:[jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"19",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"5",cy:"12",r:"1"})]}),jsxRuntime.jsx("span",{className:"sr-only",children:"More pages"})]});yp.displayName="PaginationEllipsis";var KM=({steps:e,currentStep:t,className:r,onStepClick:o})=>jsxRuntime.jsx("div",{className:l("flex w-full flex-col gap-4 md:flex-row",r),children:e.map((n,a)=>{let s=t>a,i=t===a,c=!!o;return jsxRuntime.jsxs("div",{className:l("flex flex-1 flex-col gap-2 md:flex-row md:items-center md:gap-4",c&&"cursor-pointer"),onClick:()=>c&&o(a),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4 md:flex-col md:gap-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("div",{className:l("flex h-8 w-8 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors",s?"border-blue-600 bg-blue-600 text-white dark:border-blue-500 dark:bg-blue-500":i?"border-blue-600 text-blue-600 dark:border-blue-500 dark:text-blue-500":"border-gray-300 text-gray-500 dark:border-white/20 dark:text-white/40"),children:s?jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4"}):a+1}),a<e.length-1&&jsxRuntime.jsx("div",{className:l("ml-4 h-px flex-1 bg-gray-200 md:hidden dark:bg-white/[0.03]",s&&"bg-blue-600 dark:bg-blue-500")})]}),jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:l("text-sm font-medium",i||s?"text-gray-900 dark:text-white":"text-gray-500 dark:text-white/50"),children:n.title}),n.description&&jsxRuntime.jsx("span",{className:"text-xs text-gray-500 dark:text-white/40 hidden md:block",children:n.description})]})]}),a<e.length-1&&jsxRuntime.jsx("div",{className:l("hidden h-px flex-1 bg-gray-200 md:block dark:bg-white/[0.03]",s&&"bg-blue-600 dark:bg-blue-500")})]},a)})});function qM({isOpen:e,onClose:t,onConfirm:r,title:o,description:n,confirmText:a="Confirm",cancelText:s="Cancel",variant:i="primary",isLoading:c=false}){return jsxRuntime.jsxs(oo,{isOpen:e,onClose:t,children:[jsxRuntime.jsx(ao,{children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[i==="danger"&&jsxRuntime.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-rose-500/10 text-rose-500",children:jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"h-5 w-5"})}),jsxRuntime.jsx(Je,{as:"h3",children:o})]})}),jsxRuntime.jsx("div",{className:"py-2",children:jsxRuntime.jsx(ve,{className:"text-gray-500 dark:text-white/60",children:n})}),jsxRuntime.jsxs(no,{children:[jsxRuntime.jsx(R,{variant:"ghost",onClick:t,disabled:c,children:s}),jsxRuntime.jsx(R,{variant:i==="danger"?"danger":"primary",onClick:r,isLoading:c,children:a})]})]})}function tR({isOpen:e,onClose:t,children:r,className:o}){let n=we.useRef(null),[a,s]=we__namespace.default.useState(false);we.useEffect(()=>{s(true);},[]),we.useEffect(()=>{let c=n.current;c&&(e?c.open||c.showModal():c.open&&c.close());},[e,a]),we.useEffect(()=>{let c=n.current;if(!c)return;let d=m=>{m.preventDefault(),t();};return c.addEventListener("cancel",d),()=>c.removeEventListener("cancel",d)},[t,a]);let i=c=>{c.target===n.current&&t();};return a?reactDom.createPortal(jsxRuntime.jsx("dialog",{ref:n,onClick:i,className:l("fixed inset-0 z-[100] bg-transparent p-0 backdrop:bg-black/60 backdrop:backdrop-blur-sm open:grid open:place-items-center","open:animate-in open:fade-in open:duration-200",o),children:jsxRuntime.jsxs("div",{className:l("relative w-full max-w-lg scale-100 gap-4 border border-gray-200 dark:border-white/10 bg-white dark:bg-[#0A0A0A]/90 p-6 shadow-2xl backdrop-blur-xl transition-all sm:rounded-2xl","animate-in fade-in zoom-in-95 duration-200 slide-in-from-bottom-2"),children:[r,jsxRuntime.jsxs("button",{onClick:t,className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-white/20 disabled:pointer-events-none",children:[jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-900 dark:text-white",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("span",{className:"sr-only",children:"Close"})]})]})}),document.body):null}function rR({className:e,children:t}){return jsxRuntime.jsx("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left mb-4",e),children:t})}function oR({className:e,children:t}){return jsxRuntime.jsx("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-6",e),children:t})}function aR({className:e,children:t}){return jsxRuntime.jsx(Je,{as:"h2",className:l("text-lg font-semibold leading-none tracking-tight",e),children:t})}function nR({className:e,children:t}){return jsxRuntime.jsx("p",{className:l("text-sm text-gray-500 dark:text-gray-400",e),children:t})}function fR({isOpen:e,onClose:t,position:r="right",children:o,className:n}){let[a,s]=we.useState(false),[i,c]=we.useState(false),d=we.useRef(null);we.useEffect(()=>{if(e)c(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{s(true);});}),document.body.style.overflow="hidden";else {s(false);let g=setTimeout(()=>{c(false),document.body.style.overflow="unset";},300);return ()=>clearTimeout(g)}},[e]),we.useEffect(()=>{let g=x=>{x.key==="Escape"&&t();};return e&&document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g);}},[e,t]);let m=g=>{g.target===d.current&&t();};if(!i)return null;let u={left:"left-0 h-full w-3/4 max-w-sm border-r",right:"right-0 h-full w-3/4 max-w-sm border-l",bottom:"bottom-0 w-full h-auto max-h-[90vh] border-t rounded-t-2xl"},f={left:a?"translate-x-0":"-translate-x-full",right:a?"translate-x-0":"translate-x-full",bottom:a?"translate-y-0":"translate-y-full"};return reactDom.createPortal(jsxRuntime.jsx("div",{ref:d,onClick:m,className:l("fixed inset-0 z-[100] flex bg-black/60 backdrop-blur-sm transition-opacity duration-300",a?"opacity-100":"opacity-0"),role:"dialog","aria-modal":"true",children:jsxRuntime.jsx("div",{className:l("absolute bg-white dark:bg-[#0A0A0A] border-gray-200 dark:border-white/10 p-6 shadow-2xl transition-transform duration-300 ease-in-out",u[r],f[r],n),children:o})}),document.body)}function gR({className:e,children:t,...r}){return jsxRuntime.jsx("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left mb-6",e),...r,children:t})}function hR({className:e,children:t,...r}){return jsxRuntime.jsx("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-auto pt-6",e),...r,children:t})}function bR({className:e,children:t,...r}){return jsxRuntime.jsx(Je,{as:"h2",className:l("text-lg font-semibold leading-none tracking-tight",e),...r,children:t})}function xR({className:e,children:t,...r}){return jsxRuntime.jsx(ve,{variant:"muted",className:l("text-sm",e),...r,children:t})}function MR({content:e,children:t,position:r="top",delay:o=200,className:n}){let[a,s]=we.useState(false),i=we.useRef(null),c=we.useRef(null),d=we.useRef(null),{position:m,isPositioned:u}=Kt(c,d,{side:r,align:"center",sideOffset:8,isOpen:a}),f=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>s(true),o);},g=()=>{i.current&&clearTimeout(i.current),s(false);};we.useEffect(()=>()=>{i.current&&clearTimeout(i.current);},[]);let x={top:"slide-in-from-bottom-2",bottom:"slide-in-from-top-2",left:"slide-in-from-right-2",right:"slide-in-from-left-2"};return jsxRuntime.jsxs("div",{ref:c,className:"relative inline-flex",onMouseEnter:f,onMouseLeave:g,onFocus:f,onBlur:g,children:[t,a&&reactDom.createPortal(jsxRuntime.jsx("div",{ref:d,role:"tooltip",style:{top:m.top,left:m.left},className:l("fixed z-[120] min-w-max max-w-xs rounded-2xl border border-gray-200 dark:border-white/10 bg-white dark:bg-[#0A0A0A]/90 px-3 py-1.5 text-xs text-gray-900 dark:text-white shadow-xl backdrop-blur-md","duration-200",u?"animate-in fade-in opacity-100":"opacity-0",x[r],n),children:e}),document.body)]})}var Ap=we__namespace.default.forwardRef(({className:e,size:t="lg",...r},o)=>jsxRuntime.jsx("div",{ref:o,className:l("mx-auto w-full px-4",{sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl",full:"max-w-full"}[t],e),...r}));Ap.displayName="Container";var Vp=we__namespace.default.forwardRef(({className:e,direction:t="col",gap:r=4,align:o,justify:n,wrap:a,style:s,...i},c)=>jsxRuntime.jsx("div",{ref:c,className:l("flex",{"flex-row":t==="row","flex-col":t==="col","flex-row-reverse":t==="row-reverse","flex-col-reverse":t==="col-reverse","flex-wrap":a,"items-start":o==="start","items-end":o==="end","items-center":o==="center","items-baseline":o==="baseline","items-stretch":o==="stretch","justify-start":n==="start","justify-end":n==="end","justify-center":n==="center","justify-between":n==="between","justify-around":n==="around","justify-evenly":n==="evenly"},e),style:{gap:typeof r=="number"?`${r*.25}rem`:r,...s},...i}));Vp.displayName="Stack";var $p=we__namespace.default.forwardRef(({className:e,cols:t=1,sm:r,md:o,lg:n,xl:a,gap:s=4,style:i,...c},d)=>jsxRuntime.jsx("div",{ref:d,className:l("grid",r&&`sm:grid-cols-${r}`,o&&`md:grid-cols-${o}`,n&&`lg:grid-cols-${n}`,a&&`xl:grid-cols-${a}`,e),style:{gridTemplateColumns:t?`repeat(${t}, minmax(0, 1fr))`:void 0,gap:typeof s=="number"?`${s*.25}rem`:s,...i},...c}));$p.displayName="Grid";var Up=we__namespace.default.forwardRef(({variant:e="none",noise:t=false,patternColor:r,size:o=24,mask:n="none",animate:a=false,followMouse:s=false,bgColor:i,className:c,children:d,style:m,...u},f)=>{let g=we__namespace.default.useRef(null);we__namespace.default.useEffect(()=>{if(!s)return;let h=p=>{let b=g.current;if(!b)return;let w=b.getBoundingClientRect(),k=p.clientX-w.left,y=p.clientY-w.top;b.style.setProperty("--mouse-x",`${k}px`),b.style.setProperty("--mouse-y",`${y}px`);};return window.addEventListener("mousemove",h),()=>window.removeEventListener("mousemove",h)},[s]);let x=()=>{let h={},p=r||"var(--pattern-color, rgba(255,255,255,0.08))";return e==="dots"?{...h,backgroundImage:`radial-gradient(${p} 1px, transparent 1px)`,backgroundSize:`${o}px ${o}px`,transform:s?"translate3d(calc((var(--mouse-x, 0) - 24px) / 40), calc((var(--mouse-y, 0) - 24px) / 40), 0)":void 0}:e==="grid"?{...h,backgroundImage:`
67
67
  linear-gradient(to right, ${p} 1px, transparent 1px),
68
68
  linear-gradient(to bottom, ${p} 1px, transparent 1px)
69
- `,backgroundSize:`${o}px ${o}px`,transform:s?"translate3d(calc((var(--mouse-x, 0) - 24px) / 40), calc((var(--mouse-y, 0) - 24px) / 40), 0)":void 0}:e==="gradient"?{...h,background:s?`radial-gradient(circle at var(--mouse-x, center) var(--mouse-y, center), ${p}, transparent)`:`radial-gradient(circle at center, ${p}, transparent)`}:e==="beams"?{...h,background:`radial-gradient(60% 40% at 50% 0%, ${p} 0%, transparent 100%)`}:h},v=n==="fade"?{maskImage:"radial-gradient(ellipse at center, black, transparent 90%)",WebkitMaskImage:"radial-gradient(ellipse at center, black, transparent 90%)"}:{};return jsxRuntime.jsxs("div",{ref:h=>{h&&(g.current=h),typeof f=="function"?f(h):f&&(f.current=h);},className:l("absolute inset-0 overflow-hidden pointer-events-none transition-transform duration-300 ease-out","z-0","[--pattern-color:rgba(0,0,0,0.05)] dark:[--pattern-color:rgba(255,255,255,0.08)]",i?.startsWith("bg-")?i:"",c),style:{...x(),...v,...m,backgroundColor:i&&!i.startsWith("bg-")?i:void 0},...u,children:[t&&jsxRuntime.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none brightness-100 contrast-150",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`}}),e==="beams"&&jsxRuntime.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[jsxRuntime.jsx("div",{className:"absolute top-0 left-1/4 w-px h-full bg-gradient-to-b from-transparent via-white/10 to-transparent"}),jsxRuntime.jsx("div",{className:"absolute top-0 right-1/4 w-px h-full bg-gradient-to-b from-transparent via-white/10 to-transparent"})]}),e==="mesh"&&jsxRuntime.jsxs("div",{className:l("absolute inset-0 opacity-30 blur-[100px]",a&&"animate-pulse"),children:[jsxRuntime.jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[50%] h-[50%] rounded-full bg-blue-500/20"}),jsxRuntime.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[50%] h-[50%] rounded-full bg-purple-500/20"}),jsxRuntime.jsx("div",{className:"absolute top-[20%] right-[10%] w-[40%] h-[40%] rounded-full bg-indigo-500/10"})]}),d]})});Up.displayName="Background";var jR=({children:e,className:t,size:r=300,color:o,fill:n,...a})=>{let s=we.useRef(null),i=n||o||"rgba(255, 255, 255, 0.1)";return jsxRuntime.jsxs("div",{ref:s,onMouseMove:u=>{let f=s.current;if(!f)return;let g=f.getBoundingClientRect(),x=u.clientX-g.left,v=u.clientY-g.top;f.style.setProperty("--mouse-x",`${x}px`),f.style.setProperty("--mouse-y",`${v}px`);},onMouseEnter:()=>{s.current?.style.setProperty("--opacity","1");},onMouseLeave:()=>{s.current?.style.setProperty("--opacity","0");},className:l("relative overflow-hidden rounded-2xl border border-gray-200 bg-white dark:border-white/10 dark:bg-black",t),...a,children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute -inset-px transition-opacity duration-300",style:{opacity:"var(--opacity, 0)",background:`radial-gradient(${r}px circle at var(--mouse-x, center) var(--mouse-y, center), ${i}, transparent 80%)`}}),e&&jsxRuntime.jsx("div",{className:"relative h-full",children:e})]})};var of=classVarianceAuthority.cva("relative flex w-full flex-col rounded-2xl border transition-all duration-200 focus-within:ring-4",{variants:{variant:{default:"bg-white border-gray-200 shadow-sm focus-within:border-purple-500/50 focus-within:ring-purple-500/10 dark:bg-white/[0.03] dark:border-white/10 dark:shadow-none",ghost:"bg-transparent border-transparent shadow-none focus-within:bg-white/50 dark:focus-within:bg-white/5"}},defaultVariants:{variant:"default"}}),af=we__namespace.default.forwardRef(({className:e,variant:t,onSubmit:r,isGenerating:o,onAttach:n,onFilesSelected:a,onStop:s,onMic:i,maxLength:c,footer:d,attachments:m,onRemoveAttachment:u,accept:f,multiple:g,placeholder:x="Ask AI anything...",value:v,onChange:h,...p},b)=>{let[w,k]=we.useState(""),y=v!==void 0,N=y?v:w,C=we.useRef(null),T=we.useRef(null),L=()=>{C.current&&(C.current.style.height="auto",C.current.style.height=`${C.current.scrollHeight}px`);};we.useEffect(()=>{L();},[N]);let H=M=>{let Y=M.target.value;c&&Y.length>c||(y||k(Y),h?.(M));},E=M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),N.trim()&&!o&&(r?.(N),y||k(""))),p.onKeyDown?.(M);},S=()=>{o&&s?s():N.trim()&&(r?.(N),y||k(""));},O=()=>{a&&T.current?T.current.click():n?.();},V=M=>{M.target.files&&M.target.files.length>0&&a?.(M.target.files),T.current&&(T.current.value="");};return jsxRuntime.jsxs("div",{className:l(of({variant:t,className:e})),children:[jsxRuntime.jsx("input",{type:"file",ref:T,className:"hidden",onChange:V,accept:f,multiple:g}),m&&m.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2 px-4 pt-4",children:m.map(M=>jsxRuntime.jsxs("div",{className:"group relative flex items-center gap-2 rounded-xl border border-gray-200 bg-gray-50 px-3 py-1.5 text-sm transition-colors hover:bg-gray-100 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/[0.06]",children:[jsxRuntime.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-lg bg-white dark:bg-white/[0.06]",children:jsxRuntime.jsx(lucideReact.File,{className:"h-3 w-3 text-purple-500"})}),jsxRuntime.jsx("span",{className:"max-w-[120px] truncate text-gray-700 dark:text-gray-300",children:M.name}),jsxRuntime.jsx("button",{onClick:()=>u?.(M.id),className:"ml-1 rounded-full p-0.5 text-gray-400 opacity-0 transition-all hover:bg-gray-200 hover:text-gray-600 group-hover:opacity-100 dark:hover:bg-white/[0.06] dark:hover:text-white",type:"button",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3"})})]},M.id))}),jsxRuntime.jsx("textarea",{ref:M=>{C.current=M,typeof b=="function"?b(M):b&&(b.current=M);},value:N,onChange:H,onKeyDown:E,placeholder:x,rows:1,className:l("w-full resize-none bg-transparent px-4 py-4 text-base outline-none max-h-[200px]","text-gray-900 placeholder:text-gray-400","dark:text-white dark:placeholder:text-white/40"),disabled:o&&!s,...p}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-2 pb-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-gray-600 dark:text-white/40 dark:hover:text-white",onClick:O,type:"button",title:"Attach file",children:jsxRuntime.jsx(lucideReact.Paperclip,{className:"h-5 w-5"})}),i&&jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-gray-600 dark:text-white/40 dark:hover:text-white",onClick:i,type:"button",title:"Use microphone",children:jsxRuntime.jsx(lucideReact.Mic,{className:"h-5 w-5"})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[c&&jsxRuntime.jsxs("span",{className:"text-xs text-gray-400 dark:text-white/30",children:[N.length,"/",c]}),jsxRuntime.jsx(R,{size:"icon",disabled:!N.trim()&&!o||o&&!s,onClick:S,className:l("h-8 w-8 rounded-full transition-all duration-200",N.trim()||o?"bg-purple-600 text-white hover:bg-purple-500 shadow-lg shadow-purple-500/25":"bg-gray-100 text-gray-400 dark:bg-white/[0.06] dark:text-white/20"),children:o?s?jsxRuntime.jsx(lucideReact.Square,{className:"h-3 w-3 fill-current"}):jsxRuntime.jsx(lucideReact.Sparkles,{className:"h-4 w-4 animate-pulse"}):jsxRuntime.jsx(lucideReact.ArrowUp,{className:"h-4 w-4"})})]})]}),d&&jsxRuntime.jsx("div",{className:"border-t border-gray-100 px-4 py-2 text-xs text-gray-400 dark:border-white/5 dark:text-white/30",children:d})]})});af.displayName="AIPromptInput";var hf=classVarianceAuthority.cva("group relative overflow-hidden rounded-2xl border transition-all duration-200",{variants:{variant:{default:"bg-gray-50 border-gray-200 dark:bg-white/[0.02] dark:border-white/10",ghost:"bg-transparent border-transparent",outline:"bg-transparent border-gray-200 dark:border-white/10"}},defaultVariants:{variant:"default"}}),bf=we__namespace.default.forwardRef(({className:e,variant:t,children:r,onCopy:o,onRegenerate:n,onFeedback:a,onShare:s,onEdit:i,timestamp:c,sources:d,model:m,usage:u,...f},g)=>jsxRuntime.jsxs("div",{ref:g,className:l(hf({variant:t,className:e})),...f,children:[jsxRuntime.jsxs("div",{className:"absolute left-4 top-4 flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-gradient-to-br from-purple-500 to-blue-500 shadow-lg shadow-purple-500/20",children:jsxRuntime.jsx(lucideReact.Sparkles,{className:"h-3.5 w-3.5 text-white"})}),c&&jsxRuntime.jsx("span",{className:"text-xs font-medium text-gray-400 dark:text-white/30",children:c})]}),jsxRuntime.jsxs("div",{className:"pl-14 pr-4 py-4",children:[jsxRuntime.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none text-gray-700 dark:text-gray-300",children:r}),d&&d.length>0&&jsxRuntime.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:d.map((x,v)=>jsxRuntime.jsxs("a",{href:x.url,target:"_blank",rel:"noopener noreferrer",className:l("flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs transition-colors","border-gray-200 bg-white text-gray-600 hover:bg-gray-50","dark:border-white/10 dark:bg-white/[0.03] dark:text-white/60 dark:hover:bg-white/[0.06]"),children:[jsxRuntime.jsx("span",{className:"max-w-[150px] truncate",children:x.title}),jsxRuntime.jsx(lucideReact.ExternalLink,{className:"h-3 w-3 opacity-50"})]},v))})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 bg-white/50 px-2 py-1.5 backdrop-blur dark:border-white/5 dark:bg-white/[0.02]",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 px-2 text-[10px] font-medium text-gray-400 dark:text-white/20",children:[m&&jsxRuntime.jsx("span",{children:m}),u&&jsxRuntime.jsx("span",{children:u})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs(R,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:o,children:[jsxRuntime.jsx(lucideReact.Copy,{className:"mr-1.5 h-3.5 w-3.5"}),"Copy"]}),s&&jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:s,title:"Share",children:jsxRuntime.jsx(lucideReact.Share,{className:"h-3.5 w-3.5"})}),i&&jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:i,title:"Edit",children:jsxRuntime.jsx(lucideReact.Edit,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("div",{className:"mx-1 h-3 w-px bg-gray-200 dark:bg-white/10"}),jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:n,title:"Regenerate",children:jsxRuntime.jsx(lucideReact.RefreshCw,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:()=>a?.("up"),title:"Helpful",children:jsxRuntime.jsx(lucideReact.ThumbsUp,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:()=>a?.("down"),title:"Not helpful",children:jsxRuntime.jsx(lucideReact.ThumbsDown,{className:"h-3.5 w-3.5"})})]})]})]}));bf.displayName="AIResponse";function f4({children:e,className:t,...r}){return jsxRuntime.jsx("div",{className:l("flex h-[800px] w-full overflow-hidden rounded-3xl border border-gray-200 dark:border-white/10 bg-white dark:bg-black/40 backdrop-blur-xl shadow-2xl",t),...r,children:e})}function N4({conversations:e,activeId:t,onSelect:r,onNewChat:o,onSearch:n,onArchive:a,onPin:s,onMute:i,onDelete:c,filter:d="all",sortBy:m="recent",hideHeader:u=false,className:f,...g}){let[x,v]=we.useState(""),h=we.useMemo(()=>e.filter(b=>(b.user?.name||b.group?.name||"").toLowerCase().includes(x.toLowerCase())),[e,x]),p=b=>{let w=b.target.value;v(w),n?.(w);};return jsxRuntime.jsxs("div",{className:l("flex flex-col border-r border-gray-200 dark:border-white/10 bg-gray-50/50 dark:bg-white/[0.02]",!f?.includes("w-")&&"w-80",f),...g,children:[!u&&jsxRuntime.jsxs("div",{className:"p-4 space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Messages"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",title:"Filter",children:jsxRuntime.jsx(lucideReact.Filter,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{onClick:o,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",title:"New Chat",children:jsxRuntime.jsx(lucideReact.Plus,{className:"h-5 w-5"})})]})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),jsxRuntime.jsx("input",{type:"text",value:x,onChange:p,placeholder:"Search messages...",className:"w-full h-10 pl-9 pr-4 rounded-2xl bg-white dark:bg-white/[0.03] border border-gray-200 dark:border-white/10 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/50 transition-all placeholder:text-gray-400 dark:text-white"})]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:bg-white/10 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-white/20 [&::-webkit-scrollbar-track]:bg-transparent",children:jsxRuntime.jsx("div",{className:"flex flex-col",children:h.map(b=>{let w=b.user?.name||b.group?.name||"Unknown",k=b.user?.avatar||b.group?.avatar,y=b.user?.status==="online",N=t===b.id;return jsxRuntime.jsx("div",{className:"p-2",children:jsxRuntime.jsxs("div",{onClick:()=>r?.(b.id),className:l("w-full h-16 flex items-center gap-3 p-3 rounded-2xl transition-all text-left group cursor-pointer",N?"bg-blue-500/10 dark:bg-white/[0.06] shadow-[0_0_15px_rgba(59,130,246,0.1)] dark:shadow-[0_0_15px_rgba(255,255,255,0.05)]":"hover:bg-gray-100 dark:hover:bg-white/[0.03]"),children:[jsxRuntime.jsxs("div",{className:"relative flex-shrink-0",children:[jsxRuntime.jsx(z,{src:k,alt:w,fallback:w[0]}),y&&jsxRuntime.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 w-3.5 h-3.5 bg-green-500 border-2 border-white dark:border-[#0a0a0a] rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[jsxRuntime.jsx("span",{className:l("font-semibold truncate",N?"text-blue-600 dark:text-white":"text-gray-900 dark:text-white/90"),children:w}),b.lastMessage&&jsxRuntime.jsx("span",{className:"text-[10px] text-gray-400 dark:text-white/30 whitespace-nowrap",children:new Date(b.lastMessage.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-white/40 truncate",children:b.isTyping?jsxRuntime.jsx("span",{className:"text-blue-500 animate-pulse",children:"typing..."}):b.lastMessage?.content||"No messages yet"}),b.unreadCount>0&&jsxRuntime.jsx("span",{className:"flex-shrink-0 min-w-[18px] h-[18px] flex items-center justify-center bg-blue-500 text-white text-[10px] font-bold rounded-full px-1",children:b.unreadCount})]})]}),jsxRuntime.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:C=>C.stopPropagation(),children:jsxRuntime.jsxs(at,{children:[jsxRuntime.jsx(nt,{className:"p-1 rounded-lg hover:bg-gray-200 dark:hover:bg-white/10 text-gray-400",children:jsxRuntime.jsx(lucideReact.MoreVertical,{className:"h-4 w-4"})}),jsxRuntime.jsxs(st,{align:"end",children:[jsxRuntime.jsxs(K,{onClick:()=>s?.(b.id),children:[jsxRuntime.jsx(lucideReact.Pin,{className:"h-4 w-4 mr-2"})," Pin"]}),jsxRuntime.jsxs(K,{onClick:()=>a?.(b.id),children:[jsxRuntime.jsx(lucideReact.Archive,{className:"h-4 w-4 mr-2"})," Archive"]}),jsxRuntime.jsxs(K,{onClick:()=>i?.(b.id),children:[jsxRuntime.jsx(lucideReact.BellOff,{className:"h-4 w-4 mr-2"})," Mute"]}),jsxRuntime.jsxs(K,{className:"text-red-500",onClick:()=>c?.(b.id),children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4 mr-2"})," Delete"]})]})]})})]})},b.id)})})})]})}function P4({user:e,onBack:t,onInfo:r,onCall:o,onVideoCall:n,onSearch:a,onMute:s,isTyping:i,isMuted:c,actions:d,className:m,...u}){return jsxRuntime.jsxs("div",{className:l("flex h-16 items-center justify-between border-b border-gray-200 dark:border-white/10 bg-white/80 dark:bg-black/40 backdrop-blur px-4 sticky top-0 z-10",m),...u,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[t&&jsxRuntime.jsx("button",{onClick:t,className:"md:hidden p-2 -ml-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06]",children:jsxRuntime.jsx(lucideReact.ArrowLeft,{className:"h-5 w-5 text-gray-600 dark:text-white/70"})}),jsxRuntime.jsxs("div",{className:"relative cursor-pointer",onClick:r,children:[jsxRuntime.jsx(z,{src:e.avatar,alt:e.name,fallback:e.name[0]}),e.status==="online"&&jsxRuntime.jsx("span",{className:"absolute bottom-0 right-0 h-3 w-3 rounded-full bg-green-500 border-2 border-white dark:border-black"})]}),jsxRuntime.jsxs("div",{className:"cursor-pointer",onClick:r,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white leading-none",children:e.name}),c&&jsxRuntime.jsx(lucideReact.BellOff,{className:"h-3 w-3 text-gray-400"})]}),jsxRuntime.jsx("p",{className:l("text-xs mt-1 transition-colors",i?"text-blue-500 font-medium animate-pulse":"text-gray-500 dark:text-white/50"),children:i?"typing...":e.status==="online"?"Online":`Last seen ${e.lastSeen?.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[a&&jsxRuntime.jsx("button",{onClick:a,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.Search,{className:"h-5 w-5"})}),jsxRuntime.jsx("button",{onClick:o,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.Phone,{className:"h-5 w-5"})}),jsxRuntime.jsx("button",{onClick:n,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.Video,{className:"h-5 w-5"})}),d,jsxRuntime.jsx("button",{onClick:r,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.MoreVertical,{className:"h-5 w-5"})})]})]})}function Ws({src:e,duration:t,isMe:r,className:o,...n}){let[a,s]=we.useState(false),[i,c]=we.useState(0),[d,m]=we.useState(false),u=we.useRef(null),f=()=>{u.current&&(a?u.current.pause():u.current.play(),s(!a));},g=()=>{u.current&&c(u.current.currentTime);},x=()=>{s(false),c(0);},v=p=>{let b=Math.floor(p/60),w=Math.floor(p%60);return `${b}:${w.toString().padStart(2,"0")}`},h=t?i/t*100:0;return jsxRuntime.jsxs("div",{className:l("flex items-center gap-3 p-2 rounded-2xl min-w-[200px]",r?"bg-white/10":"bg-gray-100 dark:bg-white/[0.03]",o),...n,children:[jsxRuntime.jsx("audio",{ref:u,src:e,onTimeUpdate:g,onEnded:x}),jsxRuntime.jsx("button",{onClick:f,className:l("w-10 h-10 rounded-full flex items-center justify-center transition-all",r?"bg-white text-blue-600":"bg-blue-500 text-white"),children:a?jsxRuntime.jsx(lucideReact.Pause,{className:"h-5 w-5 fill-current"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-5 w-5 fill-current ml-0.5"})}),jsxRuntime.jsxs("div",{className:"flex-1 space-y-1",children:[jsxRuntime.jsx("div",{className:"h-1.5 w-full bg-gray-300 dark:bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:l("h-full transition-all duration-100",r?"bg-white":"bg-blue-500"),style:{width:`${h}%`}})}),jsxRuntime.jsxs("div",{className:"flex justify-between text-[10px] font-medium opacity-60",children:[jsxRuntime.jsx("span",{children:v(i)}),jsxRuntime.jsx("span",{children:t?v(t):"--:--"})]})]}),jsxRuntime.jsx("button",{onClick:()=>m(!d),className:"p-1.5 rounded-full hover:bg-black/5 dark:hover:bg-white/5 opacity-60",children:d?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-4 w-4"})})]})}function _s({status:e,className:t,...r}){return e==="sending"?jsxRuntime.jsx("div",{className:l("w-3 h-3 border border-current border-t-transparent rounded-full animate-spin opacity-50",t),...r}):e==="failed"?jsxRuntime.jsx("span",{className:l("text-red-500 text-[10px] font-bold",t),...r,children:"!"}):jsxRuntime.jsxs("div",{className:l("flex items-center",t),...r,children:[e==="sent"&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3 opacity-50"}),e==="delivered"&&jsxRuntime.jsx(lucideReact.CheckCheck,{className:"h-3 w-3 opacity-50"}),e==="read"&&jsxRuntime.jsx(lucideReact.CheckCheck,{className:"h-3 w-3 text-blue-500"})]})}function Xs({url:e,title:t,description:r,image:o,siteName:n,className:a,...s}){return jsxRuntime.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:l("block overflow-hidden rounded-xl border border-gray-200 dark:border-white/10 bg-white dark:bg-white/[0.03] hover:bg-gray-50 dark:hover:bg-white/[0.05] transition-all group",a),...s,children:[o&&jsxRuntime.jsx("div",{className:"aspect-video w-full overflow-hidden border-b border-gray-200 dark:border-white/10",children:jsxRuntime.jsx("img",{src:o,alt:t,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"})}),jsxRuntime.jsxs("div",{className:"p-3 space-y-1",children:[n&&jsxRuntime.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-blue-500",children:n}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white line-clamp-1",children:t||e}),r&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-white/50 line-clamp-2",children:r}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-gray-400 pt-1",children:[jsxRuntime.jsx(lucideReact.ExternalLink,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{className:"truncate",children:new URL(e).hostname})]})]})]})}function qs({data:e,isOwn:t,onAction:r}){return jsxRuntime.jsxs("div",{className:"space-y-2 max-w-sm",children:[(()=>{if(!e.header)return null;switch(e.header.type){case "text":return jsxRuntime.jsx("h4",{className:"font-bold mb-1 text-sm",children:e.header.text});case "image":return jsxRuntime.jsx("div",{className:"mb-2 rounded-lg overflow-hidden border border-white/10",children:jsxRuntime.jsx("img",{src:e.header.attachment?.url,alt:"Header",className:"w-full h-auto object-cover"})});default:return null}})(),jsxRuntime.jsx("p",{className:"text-sm leading-relaxed",children:e.body}),e.footer&&jsxRuntime.jsx("p",{className:"text-[10px] opacity-50 italic",children:e.footer}),e.type==="button"&&e.buttons&&jsxRuntime.jsx("div",{className:"flex flex-col gap-1 mt-3",children:e.buttons.map(n=>jsxRuntime.jsxs("button",{onClick:()=>r?.(n),className:l("flex items-center justify-center gap-2 p-2.5 rounded-xl text-sm font-medium transition-all","bg-white/10 hover:bg-white/20 border border-white/10 active:scale-[0.98]",t?"text-white":"text-blue-500 dark:text-blue-400"),children:[n.type==="url"&&jsxRuntime.jsx(lucideReact.ExternalLink,{className:"h-3.5 w-3.5"}),n.type==="call"&&jsxRuntime.jsx(lucideReact.Phone,{className:"h-3.5 w-3.5"}),n.type==="reply"&&jsxRuntime.jsx(lucideReact.Reply,{className:"h-3.5 w-3.5"}),n.text]},n.id))}),e.type==="list"&&e.sections&&jsxRuntime.jsx("div",{className:"mt-3 space-y-3",children:e.sections.map((n,a)=>jsxRuntime.jsxs("div",{className:"space-y-1",children:[n.title&&jsxRuntime.jsx("p",{className:"text-[10px] uppercase tracking-wider opacity-40 font-bold px-1",children:n.title}),jsxRuntime.jsx("div",{className:"flex flex-col gap-1",children:n.rows.map(s=>jsxRuntime.jsxs("button",{onClick:()=>r?.({id:s.id,text:s.title,type:"reply"}),className:"flex flex-col items-start p-3 rounded-xl bg-white/5 hover:bg-white/10 border border-white/5 transition-colors text-left",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:s.title}),s.description&&jsxRuntime.jsx("span",{className:"text-xs opacity-50 line-clamp-1",children:s.description})]},s.id))})]},a))})]})}function Gs({cards:e,isOwn:t,onAction:r}){let o=we__namespace.default.useRef(null),n=a=>{o.current&&o.current.scrollBy({left:a==="left"?-240:240,behavior:"smooth"});};return jsxRuntime.jsxs("div",{className:"relative group/carousel max-w-[300px] sm:max-w-[400px]",children:[jsxRuntime.jsx("div",{ref:o,className:"flex gap-3 overflow-x-auto scrollbar-hide snap-x snap-mandatory pb-2",children:e.map((a,s)=>jsxRuntime.jsxs("div",{className:"flex-shrink-0 w-[240px] snap-start rounded-2xl bg-white/5 dark:bg-white/[0.03] border border-white/10 overflow-hidden flex flex-col",children:[a.header?.attachment&&jsxRuntime.jsx("div",{className:"aspect-video w-full overflow-hidden",children:jsxRuntime.jsx("img",{src:a.header.attachment.url,alt:"Card",className:"w-full h-full object-cover"})}),jsxRuntime.jsxs("div",{className:"p-3 flex-1 flex flex-col",children:[jsxRuntime.jsx("p",{className:"text-sm leading-relaxed mb-1",children:a.body}),a.footer&&jsxRuntime.jsx("p",{className:"text-[10px] opacity-50 italic mb-3",children:a.footer}),jsxRuntime.jsx("div",{className:"mt-auto flex flex-col gap-1",children:a.buttons.map(i=>jsxRuntime.jsxs("button",{onClick:()=>r?.(i),className:l("flex items-center justify-center gap-2 p-2 rounded-lg text-xs font-medium transition-all","bg-white/10 hover:bg-white/20 border border-white/10",t?"text-white":"text-blue-500 dark:text-blue-400"),children:[i.type==="url"&&jsxRuntime.jsx(lucideReact.ExternalLink,{className:"h-3 w-3"}),i.type==="call"&&jsxRuntime.jsx(lucideReact.Phone,{className:"h-3 w-3"}),i.type==="reply"&&jsxRuntime.jsx(lucideReact.Reply,{className:"h-3 w-3"}),i.text]},i.id))})]})]},s))}),e.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{onClick:()=>n("left"),className:"absolute left-[-12px] top-1/2 -translate-y-1/2 p-1.5 rounded-full bg-white dark:bg-gray-800 shadow-lg border border-white/10 opacity-0 group-hover/carousel:opacity-100 transition-opacity z-10",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{onClick:()=>n("right"),className:"absolute right-[-12px] top-1/2 -translate-y-1/2 p-1.5 rounded-full bg-white dark:bg-gray-800 shadow-lg border border-white/10 opacity-0 group-hover/carousel:opacity-100 transition-opacity z-10",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})})]})]})}function Js({message:e,isOwn:t,showAvatar:r,showStatus:o=true,className:n,onReply:a,onReact:s,onDelete:i,onEdit:c,onForward:d,onCopy:m,onPin:u,onSelect:f,isSelected:g}){let x=()=>!t||!o?null:jsxRuntime.jsx(_s,{status:e.status||"sent",className:"ml-1"}),v=()=>{if(e.type==="revoked")return jsxRuntime.jsxs("p",{className:"text-sm italic opacity-50 flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-3 w-3"})," This message was deleted"]});switch(e.type){case "audio":return jsxRuntime.jsx(Ws,{src:e.attachments?.[0]?.url||"",duration:e.attachments?.[0]?.duration,isMe:t});case "location":return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:e.location?.address||"Shared Location"})]}),jsxRuntime.jsxs("div",{className:"aspect-video rounded-xl bg-gray-200 dark:bg-white/10 flex items-center justify-center overflow-hidden relative group/map",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-8 w-8 opacity-20 group-hover/map:scale-110 transition-transform"}),jsxRuntime.jsx("div",{className:"absolute inset-0 bg-blue-500/5 group-hover/map:bg-blue-500/10 transition-colors"})]})]});case "contact":return jsxRuntime.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-xl bg-black/5 dark:bg-white/10 border border-white/5",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center text-white shadow-lg shadow-blue-500/20",children:jsxRuntime.jsx(lucideReact.User,{className:"h-5 w-5"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:"text-sm font-bold truncate",children:e.contact?.name}),jsxRuntime.jsx("p",{className:"text-xs opacity-60 truncate",children:e.contact?.phone})]})]});case "file":return jsxRuntime.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-black/5 dark:bg-white/10 border border-white/5 hover:bg-black/10 dark:hover:bg-white/20 transition-colors cursor-pointer",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-500/20 flex items-center justify-center text-blue-500",children:jsxRuntime.jsx(lucideReact.FileText,{className:"h-6 w-6"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium truncate",children:e.attachments?.[0]?.name||"File"}),jsxRuntime.jsx("p",{className:"text-[10px] opacity-60 uppercase",children:e.attachments?.[0]?.size||"Unknown size"})]})]});case "sticker":return jsxRuntime.jsx("div",{className:"relative group/sticker",children:jsxRuntime.jsx("img",{src:e.attachments?.[0]?.url,alt:"Sticker",className:"w-32 h-32 object-contain"})});case "image":return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("div",{className:"relative rounded-2xl overflow-hidden border border-white/5 group/image",children:jsxRuntime.jsx(qo,{src:e.attachments?.[0]?.url||"",alt:e.content||"Image",className:"max-h-[300px] w-auto object-contain bg-black/20"})}),e.content&&jsxRuntime.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words px-1",children:e.content})]});case "video":return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("div",{className:"relative rounded-2xl overflow-hidden border border-white/5 bg-black/20 aspect-video flex items-center justify-center group/video",children:jsxRuntime.jsx("video",{src:e.attachments?.[0]?.url,controls:true,className:"max-h-[300px] w-full"})}),e.content&&jsxRuntime.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words px-1",children:e.content})]});case "interactive":return e.interactive?.type==="carousel"&&e.interactive.cards?jsxRuntime.jsx(Gs,{cards:e.interactive.cards,isOwn:t}):e.interactive?jsxRuntime.jsx(qs,{data:e.interactive,isOwn:t}):null;default:let h=/(https?:\/\/[^\s]+)/g,p=e.content.match(h);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e.replyTo&&jsxRuntime.jsxs("div",{className:"mb-2 p-2 rounded-lg bg-black/5 dark:bg-white/5 border-l-4 border-blue-500 text-xs",children:[jsxRuntime.jsx("p",{className:"font-bold text-blue-500 truncate",children:e.replyTo.senderId===e.senderId?"You":"Other"}),jsxRuntime.jsx("p",{className:"opacity-60 truncate",children:e.replyTo.content})]}),jsxRuntime.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:e.content}),p&&p.map(b=>jsxRuntime.jsx(Xs,{url:b},b))]})}};return jsxRuntime.jsxs("div",{className:l("flex w-full mb-4 group/bubble",t?"justify-end":"justify-start",n),children:[!t&&r&&jsxRuntime.jsx("div",{className:"mr-2 mt-auto",children:jsxRuntime.jsx(z,{src:e.contact?.avatar,alt:e.contact?.name||"User",className:"w-8 h-8",fallback:(e.contact?.name||e.senderId||"?").charAt(0).toUpperCase()})}),jsxRuntime.jsxs("div",{className:l("relative max-w-[75%] sm:max-w-[60%] transition-all duration-300",g&&"scale-95 opacity-80"),children:[jsxRuntime.jsx(Hn,{preset:"spring",children:jsxRuntime.jsxs("div",{className:l("relative p-3 rounded-2xl shadow-sm backdrop-blur-md border",t?"bg-blue-600/90 dark:bg-blue-500/20 text-white border-blue-500/20 rounded-tr-none":"bg-white/80 dark:bg-white/[0.05] text-gray-900 dark:text-white border-white/10 rounded-tl-none","hover:shadow-lg hover:shadow-blue-500/5 transition-shadow"),children:[!t&&e.remoteJid?.endsWith("@g.us")&&e.contact?.name&&jsxRuntime.jsx("p",{className:"text-[11px] font-bold text-blue-500 dark:text-blue-400 mb-1 truncate",children:e.contact.name}),v(),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-1 mt-1 opacity-60 text-[10px]",children:[jsxRuntime.jsx("span",{children:new Date(e.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),x()]}),e.reactions&&Object.keys(e.reactions).length>0&&jsxRuntime.jsx("div",{className:"absolute -bottom-3 right-2 flex -space-x-1",children:Object.entries(e.reactions).map(([h,p])=>jsxRuntime.jsx("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-white/10 rounded-full px-1.5 py-0.5 text-xs shadow-sm animate-in zoom-in-50",title:p.join(", "),children:h},h))})]})}),jsxRuntime.jsxs("div",{className:l("absolute top-0 opacity-0 group-hover/bubble:opacity-100 transition-opacity flex items-center gap-1",t?"right-full mr-2":"left-full ml-2"),children:[jsxRuntime.jsxs(at,{children:[jsxRuntime.jsx(nt,{className:"p-1.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/10 text-gray-400 transition-colors",children:jsxRuntime.jsx(lucideReact.Smile,{className:"h-4 w-4"})}),jsxRuntime.jsx(st,{side:"top",className:"flex gap-1 p-1",children:["\u{1F44D}","\u2764\uFE0F","\u{1F602}","\u{1F62E}","\u{1F622}","\u{1F64F}"].map(h=>jsxRuntime.jsx("button",{onClick:()=>s?.(h),className:"p-1.5 hover:bg-gray-100 dark:hover:bg-white/10 rounded-lg transition-transform hover:scale-125",children:h},h))})]}),jsxRuntime.jsxs(at,{children:[jsxRuntime.jsx(nt,{className:"p-1.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/10 text-gray-400 transition-colors",children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"h-4 w-4"})}),jsxRuntime.jsxs(st,{align:t?"end":"start",children:[jsxRuntime.jsxs(K,{onClick:a,children:[jsxRuntime.jsx(lucideReact.Reply,{className:"h-4 w-4 mr-2"})," Reply"]}),jsxRuntime.jsxs(K,{onClick:m,children:[jsxRuntime.jsx(lucideReact.Copy,{className:"h-4 w-4 mr-2"})," Copy"]}),jsxRuntime.jsxs(K,{onClick:d,children:[jsxRuntime.jsx(lucideReact.Forward,{className:"h-4 w-4 mr-2"})," Forward"]}),jsxRuntime.jsxs(K,{onClick:u,children:[jsxRuntime.jsx(lucideReact.Pin,{className:"h-4 w-4 mr-2"})," Pin"]}),t&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(K,{onClick:c,children:[jsxRuntime.jsx(lucideReact.Edit2,{className:"h-4 w-4 mr-2"})," Edit"]}),jsxRuntime.jsxs(K,{className:"text-red-500",onClick:i,children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4 mr-2"})," Delete"]})]})]})]})]})]})]})}function CL({messages:e,currentUserId:t,className:r,onReply:o,onReact:n,onDelete:a,onEdit:s,onForward:i,onCopy:c,onPin:d,onSelect:m,onLoadMore:u,hasMore:f,isLoadingMore:g,selectedMessages:x=[],dateFormat:v="MMMM d, yyyy",groupByDate:h=true,...p}){let[b,w]=we.useState(true),k=we.useRef(null),y=we.useRef(null),N=we.useCallback((T="auto")=>{y.current?.scrollIntoView({behavior:T});},[]);we.useEffect(()=>{b&&N("smooth");},[e.length,b,N]);let C=T=>{let L=T.currentTarget,H=Math.abs(L.scrollHeight-L.clientHeight-L.scrollTop)<100;w(H),L.scrollTop===0&&f&&!g&&u&&u();};return e.length===0&&!g?jsxRuntime.jsx("div",{className:l("flex-1 flex items-center justify-center p-8 text-center text-gray-500 dark:text-white/40",r),...p,children:jsxRuntime.jsxs("div",{className:"max-w-sm space-y-4",children:[jsxRuntime.jsx("div",{className:"w-24 h-24 bg-blue-500/10 dark:bg-white/[0.03] rounded-full flex items-center justify-center mx-auto mb-6 animate-pulse",children:jsxRuntime.jsx(lucideReact.MessageSquare,{className:"h-12 w-12 text-blue-500"})}),jsxRuntime.jsx("h3",{className:"text-xl font-medium text-gray-900 dark:text-white",children:"No messages yet"}),jsxRuntime.jsx("p",{children:"Start the conversation by sending a message below."})]})}):jsxRuntime.jsxs("div",{className:l("flex-1 relative overflow-hidden",r),...p,children:[jsxRuntime.jsx("div",{ref:k,onScroll:C,className:"h-full overflow-y-auto p-4 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:bg-white/10 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-white/20 [&::-webkit-scrollbar-track]:bg-transparent",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-4",children:[e.map((T,L)=>{let H=T.senderId===t,E=L>0?e[L-1]:null,S=!H&&(!E||E.senderId!==T.senderId);return jsxRuntime.jsx(Js,{message:T,isOwn:H,showAvatar:S,onReply:()=>o?.(T),onReact:O=>n?.(T,O),onDelete:()=>a?.(T),onEdit:()=>s?.(T),onForward:()=>i?.(T),onCopy:()=>c?.(T),onPin:()=>d?.(T),onSelect:()=>m?.(T),isSelected:x.includes(T.id)},T.id)}),jsxRuntime.jsx("div",{ref:y})]})}),!b&&jsxRuntime.jsx("button",{onClick:()=>N("smooth"),className:"absolute bottom-6 right-6 p-3 rounded-full bg-white dark:bg-white/10 backdrop-blur border border-gray-200 dark:border-white/10 shadow-lg text-gray-600 dark:text-white hover:scale-110 transition-all z-10",children:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"h-5 w-5"})})]})}function ei(){let[e,t]=we.useState(false),[r,o]=we.useState(0),[n,a]=we.useState(null),[s,i]=we.useState(null),c=we.useRef(null),d=we.useRef(null),m=we.useRef([]),u=we.useCallback(async()=>{try{let v=await navigator.mediaDevices.getUserMedia({audio:!0}),h=MediaRecorder.isTypeSupported("audio/ogg; codecs=opus")?"audio/ogg; codecs=opus":"audio/webm";c.current=new MediaRecorder(v,{mimeType:h}),m.current=[],c.current.ondataavailable=p=>{p.data.size>0&&m.current.push(p.data);},c.current.onstop=()=>{let p=new Blob(m.current,{type:h}),b=URL.createObjectURL(p);a(p),i(b),v.getTracks().forEach(w=>w.stop());},c.current.start(),t(!0),o(0),d.current=window.setInterval(()=>{o(p=>p+1);},1e3);}catch(v){throw console.error("Failed to start recording",v),v}},[]),f=we.useCallback(()=>{c.current&&e&&(c.current.stop(),t(false),d.current&&clearInterval(d.current));},[e]),g=we.useCallback(()=>{c.current&&e&&(c.current.stop(),t(false),d.current&&clearInterval(d.current),a(null),i(null),o(0));},[e]),x=we.useCallback(()=>{a(null),i(null),o(0);},[]);return {isRecording:e,duration:r,audioBlob:n,audioUrl:s,startRecording:u,stopRecording:f,cancelRecording:g,clearAudio:x}}function ti({onSend:e,onCancel:t,className:r,...o}){let{isRecording:n,duration:a,audioBlob:s,startRecording:i,stopRecording:c,cancelRecording:d}=ei();we.useEffect(()=>(i(),()=>d()),[i,d]);let m=u=>{let f=Math.floor(u/60),g=u%60;return `${f}:${g.toString().padStart(2,"0")}`};return jsxRuntime.jsxs("div",{className:l("flex items-center gap-3 p-2 rounded-2xl bg-gray-100 dark:bg-white/[0.03] border border-gray-200 dark:border-white/10 animate-in slide-in-from-bottom-2",r),...o,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-xl bg-red-500/10 text-red-500",children:[jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),jsxRuntime.jsx("span",{className:"text-sm font-mono font-bold",children:m(a)})]}),jsxRuntime.jsx("div",{className:"flex-1 h-8 flex items-center gap-0.5 px-2",children:[...Array(20)].map((u,f)=>jsxRuntime.jsx("div",{className:"w-1 bg-red-500/40 rounded-full transition-all duration-150",style:{height:n?`${20+Math.random()*80}%`:"20%",animationDelay:`${f*.05}s`}},f))}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>{d(),t();},className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-white/10 text-gray-500 transition-colors",children:jsxRuntime.jsx(lucideReact.Trash2,{className:"h-5 w-5"})}),n?jsxRuntime.jsx(R,{size:"icon",variant:"ghost",onClick:c,className:"rounded-full bg-red-500 text-white hover:bg-red-600",children:jsxRuntime.jsx(lucideReact.Square,{className:"h-4 w-4 fill-current"})}):jsxRuntime.jsx(R,{size:"icon",onClick:()=>s&&e(s,a),className:"rounded-full bg-blue-500 text-white hover:bg-blue-600",children:jsxRuntime.jsx(lucideReact.Send,{className:"h-4 w-4"})})]})]})}function qL({value:e,onValueChange:t,onSend:r,onChange:o,onAttach:n,onMic:a,onVoiceEnd:s,onEmoji:i,onGif:c,onLocation:d,onContact:m,onPoll:u,onPix:f,onCarousel:g,onButtons:x,onList:v,onCancelReply:h,placeholder:p="Type a message...",users:b=[],replyingTo:w,isRecording:k,maxLength:y,disabled:N,className:C,...T}){let[L,H]=we.useState(""),E=e!==void 0?e:L,S=P=>{t?t(P):H(P);},[O,V]=we.useState(false),[M,Y]=we.useState(null),[de,Z]=we.useState(0),te=we.useRef(null),Le=we.useMemo(()=>M===null?[]:b.filter(P=>P.name.toLowerCase().includes(M.toLowerCase())).slice(0,5),[b,M]),wt=P=>{if(N)return;let I=P.target.value;if(y&&I.length>y)return;S(I),o?.(I);I[P.target.selectionStart-1];let Qe=I.slice(0,P.target.selectionStart).match(/@(\w*)$/);Qe?(Y(Qe[1]||""),Z(0)):Y(null),te.current&&(te.current.style.height="auto",te.current.style.height=`${Math.min(te.current.scrollHeight,120)}px`);},zr=P=>{if(!te.current)return;let I=te.current.selectionStart,A=E.slice(0,I).replace(/@\w*$/,`@${P.name} `),re=E.slice(I);S(A+re),Y(null),te.current.focus();},U=P=>{if(!N){if(M!==null&&Le.length>0){P.key==="ArrowDown"?(P.preventDefault(),Z(I=>(I+1)%Le.length)):P.key==="ArrowUp"?(P.preventDefault(),Z(I=>(I-1+Le.length)%Le.length)):P.key==="Enter"||P.key==="Tab"?(P.preventDefault(),zr(Le[de])):P.key==="Escape"&&Y(null);return}P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),_());}},_=()=>{N||!E.trim()&&!k||(r?.(E),S(""),te.current&&(te.current.style.height="auto"));};return jsxRuntime.jsxs("div",{className:l("p-4 bg-white/80 dark:bg-black/40 backdrop-blur border-t border-gray-200 dark:border-white/10 relative",C),...T,children:[M!==null&&Le.length>0&&jsxRuntime.jsx("div",{className:"absolute bottom-full left-4 mb-2 w-64 bg-white dark:bg-gray-900 border border-gray-200 dark:border-white/10 rounded-2xl shadow-2xl overflow-hidden animate-in slide-in-from-bottom-4",children:Le.map((P,I)=>jsxRuntime.jsxs("button",{onClick:()=>zr(P),className:l("w-full flex items-center gap-3 p-3 text-left transition-colors",I===de?"bg-blue-500/10 dark:bg-white/10":"hover:bg-gray-50 dark:hover:bg-white/5"),children:[jsxRuntime.jsx(z,{src:P.avatar,alt:P.name,className:"w-8 h-8"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-bold dark:text-white",children:P.name}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-500 dark:text-white/40",children:["@",P.name.toLowerCase().replace(/\s/g,"")]})]})]},P.id))}),w&&jsxRuntime.jsxs("div",{className:"mb-3 flex items-center justify-between p-3 rounded-2xl bg-blue-500/5 border-l-4 border-blue-500 animate-in slide-in-from-bottom-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:"text-xs font-bold text-blue-500",children:"Replying to"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-white/60 truncate",children:w.content})]}),jsxRuntime.jsx("button",{onClick:h,className:"p-1.5 rounded-full hover:bg-gray-200 dark:hover:bg-white/10 text-gray-400",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:"flex items-end gap-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[jsxRuntime.jsxs(at,{children:[jsxRuntime.jsx(nt,{disabled:N,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50 transition-colors disabled:opacity-50",children:jsxRuntime.jsx(lucideReact.Paperclip,{className:"h-5 w-5"})}),jsxRuntime.jsxs(st,{align:"start",side:"top",children:[jsxRuntime.jsxs(K,{onClick:n,children:[jsxRuntime.jsx(lucideReact.Image,{className:"h-4 w-4 mr-2"})," Image & Video"]}),jsxRuntime.jsxs(K,{onClick:n,children:[jsxRuntime.jsx(lucideReact.Paperclip,{className:"h-4 w-4 mr-2"})," Document"]}),jsxRuntime.jsxs(K,{onClick:d,children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-4 w-4 mr-2"})," Location"]}),jsxRuntime.jsxs(K,{onClick:m,children:[jsxRuntime.jsx(lucideReact.AtSign,{className:"h-4 w-4 mr-2"})," Contact"]}),jsxRuntime.jsxs(K,{onClick:u,children:[jsxRuntime.jsx(lucideReact.AtSign,{className:"h-4 w-4 mr-2"})," Poll"]}),jsxRuntime.jsxs(K,{onClick:f,children:[jsxRuntime.jsx(lucideReact.AtSign,{className:"h-4 w-4 mr-2"})," PIX"]}),jsxRuntime.jsxs(K,{onClick:g,children:[jsxRuntime.jsx(lucideReact.Layout,{className:"h-4 w-4 mr-2"})," Carousel"]}),jsxRuntime.jsxs(K,{onClick:x,children:[jsxRuntime.jsx(lucideReact.Layout,{className:"h-4 w-4 mr-2"})," Buttons"]}),jsxRuntime.jsxs(K,{onClick:v,children:[jsxRuntime.jsx(lucideReact.List,{className:"h-4 w-4 mr-2"})," List Menu"]}),jsxRuntime.jsxs(K,{onClick:c,children:[jsxRuntime.jsx(lucideReact.Gift,{className:"h-4 w-4 mr-2"})," GIF"]})]})]}),jsxRuntime.jsx("button",{onClick:i,disabled:N,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50 transition-colors disabled:opacity-50",children:jsxRuntime.jsx(lucideReact.Smile,{className:"h-5 w-5"})})]}),jsxRuntime.jsx("div",{className:"flex-1 relative",children:k?jsxRuntime.jsx(ti,{onSend:(P,I)=>s?.(P,I),onCancel:()=>h?.()}):jsxRuntime.jsx("textarea",{ref:te,value:E,onChange:wt,onKeyDown:U,placeholder:p,disabled:N,rows:1,className:"w-full p-2.5 max-h-[120px] rounded-2xl bg-gray-100 dark:bg-white/[0.03] border border-transparent focus:border-blue-500/50 focus:bg-white dark:focus:bg-white/[0.06] text-sm resize-none transition-all outline-none dark:text-white placeholder:text-gray-400"})}),jsxRuntime.jsx("div",{className:"flex items-center gap-1 mb-1",children:E.trim()||k?jsxRuntime.jsx("button",{onClick:_,disabled:N,className:"p-2.5 rounded-full bg-blue-500 text-white hover:bg-blue-600 shadow-lg shadow-blue-500/20 transition-all active:scale-90",children:jsxRuntime.jsx(lucideReact.Send,{className:"h-5 w-5"})}):jsxRuntime.jsx("button",{onClick:a,disabled:N,className:"p-2.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50 transition-colors disabled:opacity-50",children:jsxRuntime.jsx(lucideReact.Mic,{className:"h-5 w-5"})})})]})]})}function nP({user:e,onClose:t,className:r,...o}){return jsxRuntime.jsxs("div",{className:l("w-80 border-l border-gray-200 dark:border-white/10 bg-white dark:bg-black/20 flex flex-col",r),...o,children:[jsxRuntime.jsxs("div",{className:"h-16 flex items-center px-4 border-b border-gray-200 dark:border-white/10",children:[jsxRuntime.jsx("button",{onClick:t,className:"p-2 -ml-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06]",children:jsxRuntime.jsx(lucideReact.X,{className:"h-5 w-5 text-gray-500"})}),jsxRuntime.jsx("span",{className:"ml-2 font-semibold text-gray-900 dark:text-white",children:"Contact Info"})]}),jsxRuntime.jsxs(it,{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"p-6 flex flex-col items-center text-center",children:[jsxRuntime.jsx(z,{src:e.avatar,alt:e.name,fallback:e.name[0],className:"h-24 w-24 mb-4 text-2xl"}),jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:e.name}),jsxRuntime.jsx("p",{className:"text-sm text-gray-500 dark:text-white/50 mt-1",children:e.phone||"+1 (555) 000-0000"}),jsxRuntime.jsxs("div",{className:"mt-6 w-full",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-500 dark:text-white/50 mb-1 text-left",children:"About"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-900 dark:text-white text-left",children:e.bio||"Hey there! I am using Pixon Chat."})]})]}),jsxRuntime.jsx(Sr,{}),jsxRuntime.jsxs("div",{className:"p-4 space-y-4",children:[jsxRuntime.jsx("h3",{className:"text-xs font-semibold text-gray-500 dark:text-white/40 uppercase tracking-wider",children:"Media & Docs"}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2",children:[1,2,3,4,5,6].map(n=>jsxRuntime.jsxs("div",{className:"aspect-square rounded-2xl bg-gray-100 dark:bg-white/[0.03] overflow-hidden relative group cursor-pointer",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-gray-400",children:jsxRuntime.jsx(lucideReact.Image,{className:"h-6 w-6"})}),jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity"})]},n))})]}),jsxRuntime.jsx(Sr,{}),jsxRuntime.jsx("div",{className:"p-4 space-y-4",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-gray-700 dark:text-white/80",children:[jsxRuntime.jsx(lucideReact.Bell,{className:"h-5 w-5"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Mute Notifications"})]}),jsxRuntime.jsx(Eo,{})]})}),jsxRuntime.jsx(Sr,{}),jsxRuntime.jsxs("div",{className:"p-4 space-y-2",children:[jsxRuntime.jsxs("button",{className:"w-full flex items-center gap-3 p-3 rounded-2xl hover:bg-red-50 dark:hover:bg-red-500/10 text-red-600 dark:text-red-400 transition-colors text-sm font-medium",children:[jsxRuntime.jsx(lucideReact.Ban,{className:"h-5 w-5"}),"Block ",e.name]}),jsxRuntime.jsxs("button",{className:"w-full flex items-center gap-3 p-3 rounded-2xl hover:bg-red-50 dark:hover:bg-red-500/10 text-red-600 dark:text-red-400 transition-colors text-sm font-medium",children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-5 w-5"}),"Delete Chat"]})]})]})]})}function cP({users:e=[],variant:t="default",className:r,...o}){let n=e.length===0?"Someone is typing":e.length===1?`${e[0]} is typing`:e.length===2?`${e[0]} and ${e[1]} are typing`:`${e[0]} and ${e.length-1} others are typing`;return t==="bubble"?jsxRuntime.jsx("div",{className:l("flex items-center gap-1 px-3 py-2 rounded-2xl bg-gray-100 dark:bg-white/[0.03] w-fit",r),...o,children:jsxRuntime.jsxs("div",{className:"flex gap-1",children:[jsxRuntime.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 animate-bounce [animation-delay:-0.3s]"}),jsxRuntime.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 animate-bounce [animation-delay:-0.15s]"}),jsxRuntime.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 animate-bounce"})]})}):jsxRuntime.jsxs("div",{className:l("flex items-center gap-2 text-xs text-gray-500 dark:text-white/40 italic",r),...o,children:[jsxRuntime.jsxs("div",{className:"flex gap-0.5",children:[jsxRuntime.jsx("span",{className:"w-1 h-1 rounded-full bg-current animate-bounce [animation-delay:-0.3s]"}),jsxRuntime.jsx("span",{className:"w-1 h-1 rounded-full bg-current animate-bounce [animation-delay:-0.15s]"}),jsxRuntime.jsx("span",{className:"w-1 h-1 rounded-full bg-current animate-bounce"})]}),n]})}function fP({message:e,onCancel:t,className:r,...o}){return jsxRuntime.jsxs("div",{className:l("flex items-center gap-3 p-2 rounded-xl bg-blue-500/5 border-l-4 border-blue-500 animate-in slide-in-from-bottom-2",r),...o,children:[jsxRuntime.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/10 text-blue-500",children:jsxRuntime.jsx(lucideReact.Reply,{className:"h-4 w-4"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:"text-xs font-bold text-blue-500",children:"Replying to"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-white/60 truncate",children:e.content})]}),t&&jsxRuntime.jsx("button",{onClick:t,className:"p-1 rounded-full hover:bg-gray-200 dark:hover:bg-white/10 text-gray-400 transition-colors",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}function vP({type:e="info",message:t,action:r,onClose:o,className:n,...a}){let s={info:lucideReact.Info,warning:lucideReact.AlertCircle,error:lucideReact.AlertCircle,success:lucideReact.CheckCircle2},i={info:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",warning:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",error:"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20",success:"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20"},c=s[e];return jsxRuntime.jsxs("div",{className:l("flex items-center gap-3 px-4 py-2 border-b text-sm animate-in slide-in-from-top duration-300",i[e],n),...a,children:[jsxRuntime.jsx(c,{className:"h-4 w-4 shrink-0"}),jsxRuntime.jsx("p",{className:"flex-1 font-medium",children:t}),r&&jsxRuntime.jsx("button",{onClick:r.onClick,className:"text-xs font-bold uppercase tracking-wider hover:underline",children:r.label}),o&&jsxRuntime.jsx("button",{onClick:o,className:"p-1 rounded-full hover:bg-black/5 dark:hover:bg-white/5 transition-colors",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}function TP({date:e,className:t,...r}){return jsxRuntime.jsx("div",{className:l("flex justify-center sticky top-0 z-10 py-4",t),...r,children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-gray-100/80 dark:bg-white/5 backdrop-blur text-[10px] font-bold uppercase tracking-wider text-gray-500 dark:text-white/40 border border-gray-200 dark:border-white/10 shadow-sm",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-3 w-3"}),e]})})}function LP({status:e="offline",size:t="md",className:r,...o}){let n={online:"bg-green-500",offline:"bg-gray-400",away:"bg-amber-500",busy:"bg-red-500"},a={sm:"h-2 w-2",md:"h-3 w-3",lg:"h-4 w-4"};return jsxRuntime.jsx("span",{className:l("rounded-full border-2 border-white dark:border-black shrink-0",n[e],a[t],e==="online"&&"animate-pulse",r),...o})}function DP({content:e,className:t,...r}){return jsxRuntime.jsx("div",{className:l("flex justify-center py-2",t),...r,children:jsxRuntime.jsx("div",{className:"px-4 py-1 rounded-lg bg-gray-100/50 dark:bg-white/[0.02] text-[11px] font-medium text-gray-500 dark:text-white/30 border border-gray-200/50 dark:border-white/5",children:e})})}function zP({group:e,onBack:t,onInfo:r,isTyping:o,typingUsers:n=[],className:a,...s}){let i=n.length>0?`${n.join(", ")} ${n.length===1?"is":"are"} typing...`:"typing...";return jsxRuntime.jsxs("div",{className:l("flex h-16 items-center justify-between border-b border-gray-200 dark:border-white/10 bg-white/80 dark:bg-black/40 backdrop-blur px-4 sticky top-0 z-10",a),...s,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[t&&jsxRuntime.jsx("button",{onClick:t,className:"md:hidden p-2 -ml-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06]",children:jsxRuntime.jsx(lucideReact.ArrowLeft,{className:"h-5 w-5 text-gray-600 dark:text-white/70"})}),jsxRuntime.jsx("div",{className:"relative cursor-pointer",onClick:r,children:jsxRuntime.jsxs("div",{className:"flex -space-x-3",children:[e.members.slice(0,2).map((c,d)=>jsxRuntime.jsx(z,{src:c.avatar,alt:c.name,fallback:c.name[0],className:l("border-2 border-white dark:border-black",d===0?"z-10":"z-0")},c.id)),e.members.length>2&&jsxRuntime.jsxs("div",{className:"w-10 h-10 rounded-full bg-gray-200 dark:bg-white/10 border-2 border-white dark:border-black flex items-center justify-center text-[10px] font-bold text-gray-600 dark:text-white/60 z-0",children:["+",e.members.length-2]})]})}),jsxRuntime.jsxs("div",{className:"cursor-pointer min-w-0",onClick:r,children:[jsxRuntime.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white leading-none truncate",children:e.name}),jsxRuntime.jsx("p",{className:l("text-xs mt-1 truncate transition-colors",o?"text-blue-500 font-medium animate-pulse":"text-gray-500 dark:text-white/50"),children:o?i:`${e.members.length} members`})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.Phone,{className:"h-5 w-5"})}),jsxRuntime.jsx("button",{className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.Video,{className:"h-5 w-5"})}),jsxRuntime.jsx("button",{onClick:r,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.MoreVertical,{className:"h-5 w-5"})})]})]})}function YP({users:e,selectedIndex:t,onSelect:r,className:o,...n}){return e.length===0?null:jsxRuntime.jsx(ne,{className:l("w-64 overflow-hidden shadow-xl animate-in fade-in slide-in-from-bottom-2",o),...n,children:jsxRuntime.jsxs("div",{className:"p-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-wider text-gray-400 border-b border-gray-200 dark:border-white/5 mb-1",children:"Mention someone"}),e.map((a,s)=>jsxRuntime.jsxs("button",{onClick:()=>r(a),className:l("w-full flex items-center gap-2 p-2 rounded-xl text-left transition-colors",s===t?"bg-blue-500 text-white":"hover:bg-gray-100 dark:hover:bg-white/[0.06]"),children:[jsxRuntime.jsx(z,{src:a.avatar,alt:a.name,fallback:a.name[0],size:"sm"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium truncate",children:a.name}),a.status&&jsxRuntime.jsx("p",{className:l("text-[10px]",s===t?"text-white/70":"text-gray-500"),children:a.status})]})]},a.id))]})})}var q0=[{name:"Smileys",emojis:["\u{1F600}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F606}","\u{1F605}","\u{1F602}","\u{1F923}","\u{1F60A}","\u{1F607}","\u{1F642}","\u{1F643}","\u{1F609}","\u{1F60C}","\u{1F60D}","\u{1F970}","\u{1F618}","\u{1F617}","\u{1F619}","\u{1F61A}","\u{1F60B}","\u{1F61B}","\u{1F61D}","\u{1F61C}","\u{1F92A}","\u{1F928}","\u{1F9D0}","\u{1F913}","\u{1F60E}","\u{1F929}","\u{1F973}","\u{1F60F}","\u{1F612}","\u{1F61E}","\u{1F614}","\u{1F61F}","\u{1F615}","\u{1F641}","\u2639\uFE0F","\u{1F623}","\u{1F616}","\u{1F62B}","\u{1F629}","\u{1F97A}","\u{1F622}","\u{1F62D}","\u{1F624}","\u{1F620}","\u{1F621}","\u{1F92C}","\u{1F92F}","\u{1F633}","\u{1F975}","\u{1F976}","\u{1F631}","\u{1F628}","\u{1F630}","\u{1F625}","\u{1F613}","\u{1F917}","\u{1F914}","\u{1F92D}","\u{1F92B}","\u{1F925}","\u{1F636}","\u{1F610}","\u{1F611}","\u{1F62C}","\u{1F644}","\u{1F62F}","\u{1F626}","\u{1F627}","\u{1F62E}","\u{1F632}","\u{1F971}","\u{1F634}","\u{1F924}","\u{1F62A}","\u{1F635}","\u{1F910}","\u{1F974}","\u{1F922}","\u{1F92E}","\u{1F927}","\u{1F637}","\u{1F912}","\u{1F915}"]},{name:"Hearts",emojis:["\u2764\uFE0F","\u{1F9E1}","\u{1F49B}","\u{1F49A}","\u{1F499}","\u{1F49C}","\u{1F5A4}","\u{1F90D}","\u{1F90E}","\u{1F494}","\u2763\uFE0F","\u{1F495}","\u{1F49E}","\u{1F493}","\u{1F497}","\u{1F496}","\u{1F498}","\u{1F49D}","\u{1F49F}"]},{name:"Gestures",emojis:["\u{1F44D}","\u{1F44E}","\u{1F44C}","\u{1F90C}","\u{1F90F}","\u270C\uFE0F","\u{1F91E}","\u{1F91F}","\u{1F918}","\u{1F919}","\u{1F448}","\u{1F449}","\u{1F446}","\u{1F595}","\u{1F447}","\u261D\uFE0F","\u270A","\u{1F44A}","\u{1F91B}","\u{1F91C}","\u{1F44F}","\u{1F64C}","\u{1F450}","\u{1F932}","\u{1F91D}","\u{1F64F}","\u270D\uFE0F","\u{1F485}","\u{1F933}","\u{1F4AA}","\u{1F9BE}","\u{1F9B5}","\u{1F9BF}","\u{1F9B6}","\u{1F463}","\u{1F442}","\u{1F9BB}","\u{1F443}","\u{1F9E0}","\u{1FAC0}","\u{1FAC1}","\u{1F9B7}","\u{1F9B4}","\u{1F440}","\u{1F441}\uFE0F","\u{1F445}","\u{1F444}"]},{name:"Activities",emojis:["\u26BD","\u{1F3C0}","\u{1F3C8}","\u26BE","\u{1F94E}","\u{1F3BE}","\u{1F3D0}","\u{1F3C9}","\u{1F94F}","\u{1F3B1}","\u{1FA80}","\u{1F3D3}","\u{1F3F8}","\u{1F3D2}","\u{1F3D1}","\u{1F94D}","\u{1F3CF}","\u{1FA83}","\u{1F945}","\u26F3","\u{1FA81}","\u{1F3F9}","\u{1F3A3}","\u{1F93F}","\u{1F94A}","\u{1F94B}","\u{1F3BD}","\u{1F6F9}","\u{1F6FC}","\u{1F6F7}","\u26F8\uFE0F","\u{1F3BF}","\u26F7\uFE0F","\u{1F3C2}","\u{1FA82}","\u{1F3CB}\uFE0F","\u{1F93C}","\u{1F938}","\u26F9\uFE0F","\u{1F93A}","\u{1F93E}","\u{1F3CC}\uFE0F","\u{1F3C7}","\u{1F9D8}","\u{1F3C4}","\u{1F3CA}","\u{1F93D}","\u{1F6A3}","\u{1F9D7}","\u{1F6B5}","\u{1F6B4}"]},{name:"Nature",emojis:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\u{1F43B}\u200D\u2744\uFE0F","\u{1F428}","\u{1F42F}","\u{1F981}","\u{1F42E}","\u{1F437}","\u{1F43D}","\u{1F438}","\u{1F435}","\u{1F648}","\u{1F649}","\u{1F64A}","\u{1F412}","\u{1F414}","\u{1F427}","\u{1F426}","\u{1F424}","\u{1F423}","\u{1F425}","\u{1F986}","\u{1F985}","\u{1F989}","\u{1F987}","\u{1F43A}","\u{1F417}","\u{1F434}","\u{1F984}","\u{1F41D}","\u{1FAB1}","\u{1F41B}","\u{1F98B}","\u{1F40C}","\u{1F41E}","\u{1F41C}","\u{1F99F}","\u{1FAB0}","\u{1FAB2}","\u{1FAB3}","\u{1F997}","\u{1F577}\uFE0F","\u{1F578}\uFE0F","\u{1F982}","\u{1F422}","\u{1F40D}","\u{1F98E}","\u{1F996}","\u{1F995}","\u{1F419}","\u{1F991}","\u{1F990}","\u{1F99E}","\u{1F980}","\u{1F421}","\u{1F420}","\u{1F41F}","\u{1F42C}","\u{1F433}","\u{1F40B}","\u{1F988}","\u{1F40A}","\u{1F405}","\u{1F406}","\u{1F993}","\u{1F98D}","\u{1F9A7}","\u{1F9A3}","\u{1F418}","\u{1F99B}","\u{1F98F}","\u{1F42A}","\u{1F42B}","\u{1F992}","\u{1F998}","\u{1F9AC}","\u{1F403}","\u{1F402}","\u{1F404}","\u{1F40E}","\u{1F416}","\u{1F40F}","\u{1F411}","\u{1F410}","\u{1F98C}","\u{1F415}","\u{1F429}","\u{1F9AE}","\u{1F415}\u200D\u{1F9BA}","\u{1F408}","\u{1F408}\u200D\u2B1B","\u{1F413}","\u{1F983}","\u{1F99A}","\u{1F99C}","\u{1F9A2}","\u{1F9A9}","\u{1F54A}\uFE0F","\u{1F407}","\u{1F99D}","\u{1F9A8}","\u{1F9A1}","\u{1F9AB}","\u{1F9A6}","\u{1F9A5}","\u{1F401}","\u{1F400}","\u{1F43F}\uFE0F","\u{1F994}","\u{1F43E}","\u{1F409}","\u{1F432}","\u{1F335}","\u{1F384}","\u{1F332}","\u{1F333}","\u{1F334}","\u{1FAB5}","\u{1F331}","\u{1F33F}","\u2618\uFE0F","\u{1F340}","\u{1F38D}","\u{1FAB4}","\u{1F38B}","\u{1F343}","\u{1F342}","\u{1F341}","\u{1F344}","\u{1F41A}","\u{1FAA8}","\u{1F33E}","\u{1F490}","\u{1F337}","\u{1F339}","\u{1F940}","\u{1F33A}","\u{1F338}","\u{1F33C}","\u{1F33B}","\u{1F31E}","\u{1F31D}","\u{1F31B}","\u{1F31C}","\u{1F31A}","\u{1F315}","\u{1F316}","\u{1F317}","\u{1F318}","\u{1F311}","\u{1F312}","\u{1F313}","\u{1F314}","\u{1F319}","\u{1F30E}","\u{1F30D}","\u{1F30F}","\u{1FA90}","\u{1F4AB}","\u2B50\uFE0F","\u{1F31F}","\u2728","\u26A1\uFE0F","\u2604\uFE0F","\u{1F4A5}","\u{1F525}","\u{1F32A}\uFE0F","\u{1F308}","\u2600\uFE0F","\u{1F324}\uFE0F","\u26C5\uFE0F","\u{1F325}\uFE0F","\u2601\uFE0F","\u{1F326}\uFE0F","\u{1F327}\uFE0F","\u26C8\uFE0F","\u{1F329}\uFE0F","\u{1F328}\uFE0F","\u2744\uFE0F","\u2603\uFE0F","\u26C4\uFE0F","\u{1F32C}\uFE0F","\u{1F4A8}","\u{1F4A7}","\u{1F4A6}","\u2614\uFE0F","\u2602\uFE0F","\u{1F30A}","\u{1F32B}\uFE0F"]}];function ZP({onSelect:e,className:t,...r}){let[o,n]=we.useState(""),a=q0.map(s=>({...s,emojis:s.emojis.filter(i=>o===""||i.includes(o))})).filter(s=>s.emojis.length>0);return jsxRuntime.jsxs(ne,{className:l("w-72 h-96 flex flex-col overflow-hidden shadow-2xl",t),...r,children:[jsxRuntime.jsx("div",{className:"p-3 border-b border-gray-200 dark:border-white/10",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400"}),jsxRuntime.jsx("input",{type:"text",value:o,onChange:s=>n(s.target.value),placeholder:"Search emoji...",className:"w-full h-8 pl-8 pr-3 rounded-lg bg-gray-100 dark:bg-white/5 text-xs focus:outline-none focus:ring-2 focus:ring-blue-500/50 transition-all"})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-2 custom-scrollbar",children:a.map(s=>jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("h4",{className:"text-[10px] font-bold uppercase tracking-wider text-gray-400 px-2 mb-2",children:s.name}),jsxRuntime.jsx("div",{className:"grid grid-cols-8 gap-1",children:s.emojis.map(i=>jsxRuntime.jsx("button",{onClick:()=>e(i),className:"h-8 w-8 flex items-center justify-center rounded-lg hover:bg-gray-100 dark:hover:bg-white/10 text-lg transition-colors",children:i},i))})]},s.name))})]})}function lE({onSearch:e,results:t,onResultClick:r,onClose:o,className:n,...a}){let[s,i]=we.useState(""),c=d=>{let m=d.target.value;i(m),e(m);};return jsxRuntime.jsxs("div",{className:l("flex flex-col h-full bg-white dark:bg-gray-900 border-l border-gray-200 dark:border-white/10 animate-in slide-in-from-right duration-300",n),...a,children:[jsxRuntime.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("h3",{className:"font-bold text-gray-900 dark:text-white",children:"Search Messages"}),jsxRuntime.jsx("button",{onClick:o,className:"p-1 rounded-full hover:bg-gray-100 dark:hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.X,{className:"h-5 w-5 text-gray-500"})})]}),jsxRuntime.jsx("div",{className:"p-4",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:c,placeholder:"Search in conversation...",className:"w-full h-10 pl-10 pr-4 rounded-xl bg-gray-100 dark:bg-white/5 border-none text-sm focus:ring-2 focus:ring-blue-500/50 transition-all",autoFocus:true})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:s&&t.length===0?jsxRuntime.jsx("div",{className:"p-8 text-center text-gray-500 dark:text-white/30",children:jsxRuntime.jsxs("p",{className:"text-sm",children:['No messages found for "',s,'"']})}):jsxRuntime.jsx("div",{className:"space-y-1",children:t.map(d=>jsxRuntime.jsxs("button",{onClick:()=>r(d),className:"w-full p-3 rounded-xl hover:bg-gray-100 dark:hover:bg-white/5 text-left transition-all group",children:[jsxRuntime.jsxs("div",{className:"flex justify-between mb-1",children:[jsxRuntime.jsx("span",{className:"text-[10px] font-bold text-blue-500 uppercase",children:d.timestamp.toLocaleDateString()}),jsxRuntime.jsx("span",{className:"text-[10px] text-gray-400",children:d.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-white/70 line-clamp-2 group-hover:text-gray-900 dark:group-hover:text-white",children:d.content})]},d.id))})})]})}var Ba=class{constructor(){this.state={conversations:new Map,messages:new Map,activeChatId:null,presence:new Map};this.listeners=new Set;this.getState=()=>this.state;this.subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));}emitChange(t){this.state=t;for(let r of this.listeners)r();}setConversations(t){this.emitChange({...this.state,conversations:new Map(t.map(r=>[r.id,r]))});}upsertConversation(t){let r=new Map(this.state.conversations),o=r.get(t.id);r.set(t.id,{...o||{unreadCount:0},...t}),this.emitChange({...this.state,conversations:r});}setMessages(t,r){let o=new Map(this.state.messages);o.set(t,r),this.emitChange({...this.state,messages:o});}addMessage(t,r){let o=this.state.messages.get(t)||[];if(o.some(i=>i.id===r.id))return;let n=new Map(this.state.messages);n.set(t,[...o,r]);let a={...this.state,messages:n},s=this.state.conversations.get(t);if(s){let i=new Map(this.state.conversations);i.set(t,{...s,lastMessage:r,unreadCount:this.state.activeChatId===t?0:(s.unreadCount||0)+1}),a.conversations=i;}this.emitChange(a);}updateMessageStatus(t,r,o){let n=this.state.messages.get(t);if(!n)return;let a=n.findIndex(s=>s.id===r);if(a!==-1){let s=[...n],i=s[a];if(i){s[a]={...i,status:o};let c=new Map(this.state.messages);c.set(t,s),this.emitChange({...this.state,messages:c});}}}updateMessage(t,r,o){let n=this.state.messages.get(t);if(!n)return;let a=n.findIndex(s=>s.id===r);if(a!==-1){let s=[...n];s[a]={...s[a],...o};let i=new Map(this.state.messages);i.set(t,s),this.emitChange({...this.state,messages:i});}}addReaction(t,r,o,n){let a=this.state.messages.get(t);if(!a)return;let s=a.findIndex(i=>i.id===r);if(s!==-1){let i=[...a],c={...i[s]},d={...c.reactions||{}},m=[...d[o]||[]];if(!m.includes(n)){m.push(n),d[o]=m,c.reactions=d,i[s]=c;let u=new Map(this.state.messages);u.set(t,i),this.emitChange({...this.state,messages:u});}}}removeReaction(t,r,o,n){let a=this.state.messages.get(t);if(!a)return;let s=a.findIndex(i=>i.id===r);if(s!==-1){let i=[...a],c={...i[s]},d={...c.reactions||{}};if(d[o]){d[o]=d[o].filter(u=>u!==n),d[o].length===0&&delete d[o],c.reactions=d,i[s]=c;let m=new Map(this.state.messages);m.set(t,i),this.emitChange({...this.state,messages:m});}}}deleteMessage(t,r){let o=this.state.messages.get(t);if(!o)return;let n=o.findIndex(a=>a.id===r);if(n!==-1){let a=[...o];a[n]={...a[n],type:"revoked",content:"Esta mensagem foi apagada",attachments:[],reactions:{}};let s=new Map(this.state.messages);s.set(t,a),this.emitChange({...this.state,messages:s});}}setActiveChat(t){let r={...this.state,activeChatId:t};if(t){let o=this.state.conversations.get(t);if(o&&o.unreadCount>0){let n=new Map(this.state.conversations);n.set(t,{...o,unreadCount:0}),r.conversations=n;}}this.emitChange(r);}setUserPresence(t,r){let o=new Map(this.state.presence);o.set(t,r),this.emitChange({...this.state,presence:o});}},je=new Ba;function ko(e){let t=we.useSyncExternalStore(je.subscribe,je.getState);return we.useMemo(()=>e(t),[t,e])}var eg=e=>Array.from(e.conversations.values()).sort((t,r)=>{if(t.isPinned&&!r.isPinned)return -1;if(!t.isPinned&&r.isPinned)return 1;let o=t.lastMessage?.timestamp.getTime()||0;return (r.lastMessage?.timestamp.getTime()||0)-o});function uE(){return ko(eg)}function pE(e){let t=we.useCallback(r=>e?r.messages.get(e)||[]:[],[e]);return ko(t)}function fE(){let e=we.useCallback(t=>t.activeChatId?t.conversations.get(t.activeChatId):null,[]);return ko(e)}function gE(e){let t=we.useCallback(r=>r.presence.get(e)||"unavailable",[e]);return ko(t)}function Va({url:e,token:t,rooms:r=[],onConnect:o,onDisconnect:n,onError:a}){let s=we.useRef(null);we.useEffect(()=>{let d=socket_ioClient.io(e,{auth:{token:t},transports:["websocket"],reconnectionAttempts:5,reconnectionDelay:1e3});return s.current=d,d.on("connect",()=>{console.log("Socket connected:",d.id),r.forEach(m=>d.emit("join",m)),o?.();}),d.on("disconnect",m=>{console.log("Socket disconnected:",m),n?.();}),d.on("connect_error",m=>{console.error("Socket connection error:",m),a?.(m);}),()=>{d.disconnect();}},[e,t,r,o,n,a]);let i=we.useCallback((d,m)=>{s.current?.connected?s.current.emit(d,m):console.warn("Socket not connected. Event buffered or dropped:",d);},[]),c=we.useCallback((d,m)=>(s.current?.on(d,m),()=>{s.current?.off(d,m);}),[]);return {socket:s.current,emit:i,on:c,isConnected:s.current?.connected||false}}function TE(e,t){let{on:r,emit:o,isConnected:n}=Va({url:e,token:t});return we.useEffect(()=>{r("chats.set",a=>{je.setConversations(a);}),r("chats.upsert",a=>{a.forEach(s=>je.upsertConversation(s));}),r("chats.update",a=>{a.forEach(s=>{s.id&&je.upsertConversation(s);});}),r("messages.upsert",({chatId:a,messages:s})=>{s.forEach(i=>je.addMessage(a,i));}),r("messages.update",({chatId:a,messageId:s,status:i})=>{je.updateMessageStatus(a,s,i);}),r("presence.update",({userId:a,status:s})=>{je.setUserPresence(a,s);}),r("groups.update",a=>{a.forEach(s=>{je.upsertConversation({id:s.id,group:s});});});},[r]),{isConnected:n,emit:o}}function CE(e,t){let{emit:r}=Va({url:""});return {setPresence:n=>{r("presence.send",{chatId:e,userId:t,status:n});}}}function ME(){return {uploadMedia:async(t,r)=>({url:"...",thumbnail:"...",blurhash:"..."})}}function RE(e){return {search:r=>r?e.filter(o=>o.content.toLowerCase().includes(r.toLowerCase())):e}}function EE({itemCount:e,itemHeight:t,overscan:r=5,initialScrollTop:o=0,startAtBottom:n=false}){let[a,s]=we.useState(o),[i,c]=we.useState(0),d=we.useRef(null),m=we.useRef(false),u=we.useCallback(p=>typeof t=="function"?t(p):t,[t]);we.useLayoutEffect(()=>{if(d.current){let p=new ResizeObserver(b=>{for(let w of b)c(w.contentRect.height);});return p.observe(d.current),o>0&&(d.current.scrollTop=o),()=>p.disconnect()}},[o]);let f=we.useCallback(p=>{s(p.currentTarget.scrollTop);},[]),{visibleItems:g,totalHeight:x,startIndex:v}=we.useMemo(()=>{let p=0,b=[];for(let T=0;T<e;T++)b.push(p),p+=u(T);let w=0,y=0,N=e-1;for(;y<=N;){let T=Math.floor((y+N)/2),L=b[T];L!==void 0&&L<=a?(w=T,y=T+1):N=T-1;}w=Math.max(0,w-r);let C=[];for(let T=w;T<e;T++){let L=b[T];if(L===void 0||L>a+i+r*u(T))break;C.push({index:T,offsetTop:L,height:u(T)});}return {visibleItems:C,totalHeight:p,startIndex:w}},[a,i,e,u,r]);we.useLayoutEffect(()=>{if(n&&!m.current&&x>0&&d.current&&i>0){let p=d.current,b=x-i;b>0&&(p.scrollTop=b,s(b)),m.current=true;}},[x,i,n]);let h=we.useCallback((p,b="auto")=>{if(d.current){let w=0;for(let k=0;k<p;k++)w+=u(k);d.current.scrollTo({top:w,behavior:b});}},[u]);return {containerRef:d,visibleItems:g,totalHeight:x,startIndex:v,onScroll:f,scrollToIndex:h,scrollToBottom:(p="auto")=>{d.current&&d.current.scrollTo({top:d.current.scrollHeight,behavior:p});}}}function ui(){let[e,t]=we.useState({scrollX:0,scrollY:0,scrollProgressX:0,scrollProgressY:0}),r=we.useRef(false),o=we.useCallback(()=>{r.current||(window.requestAnimationFrame(()=>{let n=window.scrollX,a=window.scrollY,s=document.documentElement.scrollWidth-document.documentElement.clientWidth,i=document.documentElement.scrollHeight-document.documentElement.clientHeight;t({scrollX:n,scrollY:a,scrollProgressX:s>0?n/s:0,scrollProgressY:i>0?a/i:0}),r.current=false;}),r.current=true);},[]);return we.useEffect(()=>(window.addEventListener("scroll",o,{passive:true}),o(),()=>window.removeEventListener("scroll",o)),[o]),e}function BE({className:e,color:t="bg-blue-500",height:r=2,position:o="top",...n}){let{scrollProgressY:a}=ui();return jsxRuntime.jsx("div",{className:l("fixed left-0 right-0 z-[100] w-full pointer-events-none",o==="top"?"top-0":"bottom-0",e),style:{height:r},...n,children:jsxRuntime.jsx("div",{className:l("h-full transition-all duration-75 ease-out",t),style:{width:`${a*100}%`,boxShadow:a>0?`0 0 10px ${t.replace("bg-","var(--")}`:"none"}})})}var mg=we__namespace.default.forwardRef(({orientation:e="horizontal",className:t,...r},o)=>jsxRuntime.jsx("hr",{ref:o,className:l("border-0 bg-gray-200 dark:bg-white/10",{"h-px w-full":e==="horizontal","h-full w-px":e==="vertical"},t),...r}));mg.displayName="Divider";var fg=we__namespace.default.forwardRef(({children:e,className:t,...r},o)=>jsxRuntime.jsx("kbd",{ref:o,className:l("rounded-lg border border-gray-200 dark:border-white/10 bg-gray-100 dark:bg-white/[0.03] px-2 py-1 text-[11px] font-semibold text-gray-500 dark:text-white/65",t),...r,children:e}));fg.displayName="Kbd";var vg={theme:"system",setTheme:()=>null},gi=we.createContext(vg);function GE({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...o}){let[n,a]=we.useState(t);we.useEffect(()=>{let i=localStorage.getItem(r);i&&a(i);},[r]),we.useEffect(()=>{let i=window.document.documentElement;if(i.classList.remove("light","dark"),n==="system"){let c=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{i.classList.remove("light","dark"),i.classList.add(c.matches?"dark":"light");};return d(),c.addEventListener("change",d),()=>c.removeEventListener("change",d)}i.classList.add(n);},[n]);let s={theme:n,setTheme:i=>{localStorage.setItem(r,i),a(i);}};return jsxRuntime.jsx(gi.Provider,{...o,value:s,children:e})}var hi=()=>{let e=we.useContext(gi);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function rS({className:e}){let{setTheme:t,theme:r}=hi();return jsxRuntime.jsxs(R,{variant:"ghost",size:"icon",className:l("h-9 w-9",e),onClick:()=>t(r==="light"?"dark":"light"),children:[jsxRuntime.jsx(lucideReact.Sun,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),jsxRuntime.jsx(lucideReact.Moon,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function Mg(e,t=true){let[r,o]=we.useState({data:null,error:null,isLoading:false}),n=we.useCallback(async()=>{o({data:null,error:null,isLoading:true});try{let a=await e();return o({data:a,error:null,isLoading:!1}),a}catch(a){throw o({data:null,error:a,isLoading:false}),a}},[e]);return we.useEffect(()=>{t&&n();},[n,t]),{...r,execute:n}}function sS(e,t){let r=we.useCallback(()=>fetch(e,t).then(o=>o.json()),[e,t]);return Mg(r)}function cS({initialMessages:e=[],onSendMessage:t,scrollThreshold:r=100}={}){let[o,n]=we.useState(e),[a,s]=we.useState(false),[i,c]=we.useState(false),d=we.useRef(null),m=we.useRef(true),u=we.useCallback((v="smooth")=>{d.current&&d.current.scrollTo({top:d.current.scrollHeight,behavior:v});},[]),f=we.useCallback(()=>{if(d.current){let{scrollTop:v,scrollHeight:h,clientHeight:p}=d.current;m.current=h-v-p<r;}},[r]);we.useEffect(()=>{m.current&&u();},[o,u]);let g=we.useCallback(async(v,h)=>{if(!v.trim())return;let p=crypto.randomUUID(),b={id:p,content:v,senderId:h,timestamp:new Date,status:"sending"};n(w=>[...w,b]);try{t&&await t(v),n(w=>w.map(k=>k.id===p?{...k,status:"sent"}:k));}catch{n(k=>k.map(y=>y.id===p?{...y,status:"error"}:y));}},[t]),x=we.useCallback(()=>{n([]);},[]);return {messages:o,setMessages:n,sendMessage:g,clearMessages:x,isTyping:a,setIsTyping:s,isLoading:i,setIsLoading:c,scrollRef:d,handleScroll:f,scrollToBottom:u}}function pS(e=[]){let[t,r]=we.useState(e),o=we.useCallback(d=>{r(m=>[...m,d]);},[]),n=we.useCallback((d,m)=>{r(u=>u.map(f=>f.id===d?{...f,status:m}:f));},[]),a=we.useCallback(d=>{r(m=>m.filter(u=>u.id!==d));},[]),s=we.useCallback((d,m)=>{r(u=>u.map(f=>f.id===d?{...f,content:m,isEdited:true}:f));},[]),i=we.useCallback((d,m,u)=>{r(f=>f.map(g=>{if(g.id!==d)return g;let x={...g.reactions||{}},v=x[m]||[];return v.includes(u)?(x[m]=v.filter(h=>h!==u),x[m].length===0&&delete x[m]):x[m]=[...v,u],{...g,reactions:x}}));},[]),c=we.useCallback(()=>{r([]);},[]);return {messages:t,setMessages:r,addMessage:o,updateMessageStatus:n,deleteMessage:a,editMessage:s,addReaction:i,clearMessages:c}}function hS(e){let[t,r]=we.useState(""),o=we.useMemo(()=>{if(!t.trim())return [];let n=t.toLowerCase();return e.filter(a=>a.content.toLowerCase().includes(n))},[e,t]);return {query:t,setQuery:r,results:o}}function vS(e){let t=we.useRef(null);return we.useEffect(()=>{let r=o=>{let n=t.current;!n||n.contains(o?.target||null)||e(o);};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r);}},[e]),t}function kS({timeout:e=2e3}={}){let[t,r]=we.useState(false),[o,n]=we.useState(null);return {copy:we.useCallback(async s=>{if(!navigator?.clipboard){n(new Error("Clipboard API not supported"));return}try{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),e);}catch(i){n(i instanceof Error?i:new Error("Failed to copy"));}},[e]),copied:t,error:o}}function CS(e,t){let[r,o]=we.useState(e);return we.useEffect(()=>{let n=setTimeout(()=>{o(e);},t);return ()=>{clearTimeout(n);}},[e,t]),r}function LS(e){let[t,r]=we.useState(false),[o,n]=we.useState({x:0,y:0}),a=we.useRef({x:0,y:0}),s=we.useRef({x:0,y:0}),i=we.useRef(Date.now()),c=we.useRef({x:0,y:0}),d=we.useCallback((f,g)=>{r(true),a.current={x:f-o.x,y:g-o.y},s.current={x:f,y:g},i.current=Date.now();},[o]),m=we.useCallback((f,g)=>{if(!t)return;let x=f-a.current.x,v=g-a.current.y,h=Date.now(),p=h-i.current;p>0&&(c.current={x:(f-s.current.x)/p,y:(g-s.current.y)/p}),n({x,y:v}),s.current={x:f,y:g},i.current=h,e?.({isDragging:true,offset:{x,y:v},velocity:c.current});},[t,e]),u=we.useCallback(()=>{r(false),e?.({isDragging:false,offset:o,velocity:c.current});},[o,e]);return we.useEffect(()=>{let f=h=>m(h.clientX,h.clientY),g=h=>{h.touches[0]&&m(h.touches[0].clientX,h.touches[0].clientY);},x=()=>u(),v=()=>u();return t&&(window.addEventListener("mousemove",f),window.addEventListener("mouseup",x),window.addEventListener("touchmove",g),window.addEventListener("touchend",v)),()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",x),window.removeEventListener("touchmove",g),window.removeEventListener("touchend",v);}},[t,m,u]),{isDragging:t,offset:o,dragProps:{onMouseDown:f=>d(f.clientX,f.clientY),onTouchStart:f=>{f.touches[0]&&d(f.touches[0].clientX,f.touches[0].clientY);},style:{cursor:t?"grabbing":"grab",touchAction:"none"}}}}function SS(e){let[t,r]=we.useState({progress:0,scrollY:0,isIntersecting:false}),o=we.useRef(false);return we.useEffect(()=>{let n=e.current;if(!n)return;let a=()=>{o.current||(window.requestAnimationFrame(()=>{let s=n.getBoundingClientRect(),i=window.innerHeight,c=i+s.height,d=i-s.top,m=Math.max(0,Math.min(1,d/c));r({progress:m,scrollY:window.scrollY,isIntersecting:s.top<i&&s.bottom>0}),o.current=false;}),o.current=true);};return window.addEventListener("scroll",a,{passive:true}),window.addEventListener("resize",a),a(),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a);}},[e]),t}function IS(e,t){let r=we.useRef(null);return we.useLayoutEffect(()=>{let o=document.querySelector(`[data-flip-id="${e}"]`);if(!o)return;let n=r.current,a=o.getBoundingClientRect();if(n){let s=n.left-a.left,i=n.top-a.top,c=n.width/a.width,d=n.height/a.height;(Math.abs(s)>.5||Math.abs(i)>.5||Math.abs(c-1)>.01||Math.abs(d-1)>.01)&&o.animate([{transformOrigin:"top left",transform:`translate(${s}px, ${i}px) scale(${c}, ${d})`},{transformOrigin:"top left",transform:"none"}],{duration:400,easing:"cubic-bezier(0.2, 0.8, 0.2, 1)"});}r.current=a;},t),{"data-flip-id":e}}function OS({initialValues:e,onSubmit:t}){let[r,o]=we.useState(e),[n,a]=we.useState({}),[s,i]=we.useState(false),c=we.useCallback(u=>{let{name:f,value:g,type:x}=u.target,v=x==="checkbox"?u.target.checked:g;o(h=>({...h,[f]:v})),n[f]&&a(h=>({...h,[f]:""}));},[n]),d=we.useCallback(async u=>{u.preventDefault();let f=u.currentTarget;if(!f.checkValidity()){let g={};Array.from(f.elements).forEach(x=>{let v=x;v.name&&!v.validity.valid&&(g[v.name]=v.validationMessage);}),a(g);return}i(true);try{await t(r);}finally{i(false);}},[r,t]),m=we.useCallback(u=>({name:u,value:r[u],onChange:c,error:n[u]}),[r,n,c]);return {values:r,errors:n,isSubmitting:s,handleChange:c,handleSubmit:d,register:m,setValues:o,setErrors:a}}function $S(e){let[t,r]=we.useState({past:[],present:e,future:[]}),o=t.past.length>0,n=t.future.length>0,a=we.useCallback(()=>{o&&r(d=>{let m=d.past[d.past.length-1];return m===void 0?d:{past:d.past.slice(0,d.past.length-1),present:m,future:[d.present,...d.future]}});},[o]),s=we.useCallback(()=>{n&&r(d=>{let m=d.future[0];if(m===void 0)return d;let u=d.future.slice(1);return {past:[...d.past,d.present],present:m,future:u}});},[n]),i=we.useCallback(d=>{r(m=>{let u=typeof d=="function"?d(m.present):d;return m.present===u?m:{past:[...m.past,m.present],present:u,future:[]}});},[]),c=we.useCallback(()=>{r({past:[],present:e,future:[]});},[e]);return {state:t.present,set:i,undo:a,redo:s,clear:c,canUndo:o,canRedo:n,history:t}}function WS(e=3e3){let[t,r]=we.useState(false),o=we.useRef();return we.useEffect(()=>{let n=()=>{r(false),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(true);},e);},a=["mousemove","mousedown","keydown","touchstart","scroll"];return a.forEach(s=>{window.addEventListener(s,n);}),n(),()=>{a.forEach(s=>{window.removeEventListener(s,n);}),o.current&&clearTimeout(o.current);}},[e]),t}function XS({onLoadMore:e,isLoading:t,hasMore:r,threshold:o=100,root:n=null}){let a=we.useRef(null),s=we.useRef(null),i=we.useCallback(c=>{let d=c[0];d&&d.isIntersecting&&r&&!t&&e();},[r,t,e]);return we.useEffect(()=>{let c=s.current;if(c)return a.current=new IntersectionObserver(i,{root:n,rootMargin:`0px 0px ${o}px 0px`,threshold:.1}),a.current.observe(c),()=>{a.current&&a.current.disconnect();}},[i,n,o]),s}function QS(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:n=false}={}){let[a,s]=we.useState(),i=a?.isIntersecting&&n,c=([d])=>{s(d);};return we.useEffect(()=>{let d=e?.current;if(!!!window.IntersectionObserver||i||!d)return;let u={threshold:t,root:r,rootMargin:o},f=new IntersectionObserver(c,u);return f.observe(d),()=>f.disconnect()},[e,t,r,o,i]),a}function eD(e){let[t,r]=we.useState(e),o=we.useCallback((i,c,d,m)=>{r(u=>{let f=u.columns[c],g=u.columns[d],x=u.tasks[i];if(!f||!g||!x)return u;let v=Array.from(f.taskIds);v.splice(v.indexOf(i),1);let h={...f,taskIds:v},p=c===d?v:Array.from(g.taskIds);p.splice(m,0,i);let b={...g,taskIds:p};return {...u,columns:{...u.columns,[c]:h,[d]:b},tasks:{...u.tasks,[i]:{...x,columnId:d}}}});},[]),n=we.useCallback((i,c)=>{r(d=>{let m=Array.from(d.columnOrder);return m.splice(m.indexOf(i),1),m.splice(c,0,i),{...d,columnOrder:m}});},[]),a=we.useCallback((i,c)=>{r(d=>{let m=d.columns[i];if(!m)return d;let u={...m,taskIds:[...m.taskIds,c.id]};return {...d,tasks:{...d.tasks,[c.id]:c},columns:{...d.columns,[i]:u}}});},[]),s=we.useCallback(i=>{r(c=>{let d=c.tasks[i];if(!d)return c;let m=c.columns[d.columnId];if(!m)return c;let u={...c.tasks};delete u[i];let f={...m,taskIds:m.taskIds.filter(g=>g!==i)};return {...c,tasks:u,columns:{...c.columns,[d.columnId]:f}}});},[]);return {board:t,setBoard:r,moveTask:o,moveColumn:n,addTask:a,removeTask:s}}function oD(e){let t=we.useRef(e);t.current=e,we.useEffect(()=>{let r=o=>{let n=[];(o.ctrlKey||o.metaKey)&&n.push("mod"),o.shiftKey&&n.push("shift"),o.altKey&&n.push("alt");let s=o.key.toLowerCase();["control","meta","shift","alt"].includes(s)||n.push(s);let i=n.join("+"),c=t.current[i]||t.current[s];c&&c(o);};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]);}function sD(e){let t=we.useRef(false);we.useEffect(()=>{t.current||(t.current=true,e());},[]);}function iD(e){we.useEffect(()=>()=>{e();},[]);}function mD(e,t){let[r,o]=we.useState(()=>{if(typeof window>"u")return t;try{let a=window.localStorage.getItem(e);return a?JSON.parse(a):t}catch(a){return console.warn(`Error reading localStorage key "${e}":`,a),t}}),n=we.useCallback(a=>{try{let s=a instanceof Function?a(r):a;o(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s));}catch(s){console.warn(`Error setting localStorage key "${e}":`,s);}},[e,r]);return [r,n]}function fD(e){let[t,r]=we.useState({x:0,y:0,elementX:0,elementY:0,percentageX:0,percentageY:0}),o=we.useRef(),n=we.useRef({x:0,y:0});return we.useEffect(()=>{let a=i=>{n.current={x:i.clientX,y:i.clientY},o.current||(o.current=requestAnimationFrame(s));},s=()=>{let{x:i,y:c}=n.current,d=0,m=0,u=0,f=0;if(e?.current){let g=e.current.getBoundingClientRect();d=i-g.left,m=c-g.top,u=Math.max(0,Math.min(100,d/g.width*100)),f=Math.max(0,Math.min(100,m/g.height*100));}r({x:i,y:c,elementX:d,elementY:m,percentageX:u,percentageY:f}),o.current=void 0;};return window.addEventListener("mousemove",a),()=>{window.removeEventListener("mousemove",a),o.current&&cancelAnimationFrame(o.current);}},[e]),t}function bD(){let[e,t]=we.useState({alpha:null,beta:null,gamma:null,absolute:false});return we.useEffect(()=>{let r=o=>{t({alpha:o.alpha,beta:o.beta,gamma:o.gamma,absolute:o.absolute});};return typeof window<"u"&&"DeviceOrientationEvent"in window&&window.addEventListener("deviceorientation",r),()=>{window.removeEventListener("deviceorientation",r);}},[]),e}function wD(e){let t=we.useRef();return we.useEffect(()=>{t.current=e;},[e]),t.current}function ND(e){let t=we.useRef(null),r=we.useCallback((o,n,a)=>{!o||a||!t.current||(o.dataset.messageId=n,t.current.observe(o));},[]);return we.useEffect(()=>(t.current=new IntersectionObserver(o=>{o.forEach(n=>{if(n.isIntersecting){let a=n.target.dataset.messageId;a&&(e(a),t.current?.unobserve(n.target));}});},{threshold:.5}),()=>{t.current?.disconnect();}),[e]),{registerMessage:r}}function MD(){let[e,t]=we.useState(false);return we.useEffect(()=>{let r=window.matchMedia("(prefers-reduced-motion: reduce)");t(r.matches);let o=n=>{t(n.matches);};return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),e}var gh={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function hh(e){let[t,r]=we.useState(false);return we.useEffect(()=>{let o=window.matchMedia(e);r(o.matches);let n=()=>r(o.matches);return o.addEventListener("change",n),()=>o.removeEventListener("change",n)},[e]),t}function PD(e){return hh(`(min-width: ${gh[e]}px)`)}function ED(e){let[t,r]=we.useState({width:0,height:0});return we.useLayoutEffect(()=>{if(!e.current)return;let o=new ResizeObserver(n=>{for(let a of n)r({width:a.contentRect.width,height:a.contentRect.height});});return o.observe(e.current),()=>o.disconnect()},[e]),t}function HD(e=10){let[t,r]=we.useState(null),o=we.useRef(0);return we.useEffect(()=>{let n=()=>{let s=window.scrollY;if(Math.abs(s-o.current)<e)return;let i=s>o.current?"down":"up";i!==t&&(s>0||i==="down")&&r(i),o.current=s>0?s:0;},a=()=>{window.requestAnimationFrame(n);};return window.addEventListener("scroll",a),()=>window.removeEventListener("scroll",a)},[t,e]),t}function BD(e=true){we.useLayoutEffect(()=>{if(!e)return;let t=window.getComputedStyle(document.body).overflow,r=window.getComputedStyle(document.body).paddingRight,o=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",o>0&&(document.body.style.paddingRight=`${parseFloat(r)+o}px`),()=>{document.body.style.overflow=t,document.body.style.paddingRight=r;}},[e]);}function yh(e,t,r){let[o,n]=t,[a,s]=r,i=(e-o)/(n-o),c=Math.max(0,Math.min(1,i));return a+c*(s-a)}function VD(e,t,r){return yh(e,t,r)}function $D(){let[e,t]=we.useState(0),r=we.useRef(0),o=we.useRef(Date.now()),n=we.useRef();return we.useEffect(()=>{let a=()=>{let i=window.scrollY,c=Date.now(),d=c-o.current;if(d>0){let u=(i-r.current)/d;t(u);}r.current=i,o.current=c,n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(s);},s=()=>{t(i=>Math.abs(i)<.01?0:i*.9),n.current=requestAnimationFrame(s);};return window.addEventListener("scroll",a,{passive:true}),()=>{window.removeEventListener("scroll",a),n.current&&cancelAnimationFrame(n.current);}},[]),e}function Ch(e,t){let r=e.toLowerCase().replace(/\s/g,""),o=t.toLowerCase(),n=0;for(let a=0;a<o.length&&n<r.length;a++)o[a]===r[n]&&n++;return n===r.length}function WD(e,t,r){return we.useMemo(()=>t.trim()?e.filter(o=>r.some(n=>{let a=o[n];return a==null?false:Ch(t,String(a))})):e,[e,t,r])}function XD(e,t){let r=we.useCallback(()=>{if(typeof window>"u")return t;try{let s=window.sessionStorage.getItem(e);return s?JSON.parse(s):t}catch(s){return console.warn(`Error reading sessionStorage key "${e}":`,s),t}},[t,e]),[o,n]=we.useState(r),a=we.useCallback(s=>{try{let i=s instanceof Function?s(o):s;n(i),typeof window<"u"&&window.sessionStorage.setItem(e,JSON.stringify(i));}catch(i){console.warn(`Error setting sessionStorage key "${e}":`,i);}},[e,o]);return we.useEffect(()=>{n(r());},[r]),[o,a]}function jD(e,t={}){let{stiffness:r=.15,damping:o=.8,mass:n=1,precision:a=.01}=t,[s,i]=we.useState(e),c=we.useRef(0),d=we.useRef(e),m=we.useRef();return we.useEffect(()=>{let u=()=>{let f=e-d.current,x=f*r/n;if(c.current=(c.current+x)*o,d.current+=c.current,Math.abs(f)<a&&Math.abs(c.current)<a){d.current=e,i(e),m.current=void 0;return}i(d.current),m.current=requestAnimationFrame(u);};return m.current&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(u),()=>{m.current&&cancelAnimationFrame(m.current);}},[e,r,o,n,a]),s}function JD(e,t=100,r=0){return r+e*t}function ZD(e,t=100){return Array.from({length:e},(r,o)=>o*t)}var Mi="01XYZ#%&@$+-/<>!_";function rH(e,t=800,r=true){let[o,n]=we.useState(e),a=we.useRef();return we.useEffect(()=>{if(!r){n(e);return}let s=Date.now(),i=()=>{let c=Date.now()-s,d=Math.min(c/t,1),m=e.split("").map((u,f)=>u===" "?" ":d>f/e.length?u:Mi[Math.floor(Math.random()*Mi.length)]).join("");n(m),d<1&&(a.current=requestAnimationFrame(i));};return a.current=requestAnimationFrame(i),()=>{a.current&&cancelAnimationFrame(a.current);}},[e,t,r]),o}function nH(e,t){let[r,o]=we.useState(e),n=we.useRef(Date.now());return we.useEffect(()=>{let a=setTimeout(()=>{Date.now()-n.current>=t&&(o(e),n.current=Date.now());},t-(Date.now()-n.current));return ()=>{clearTimeout(a);}},[e,t]),r}function lH(e=0){let[t,r]=we.useState(e),[o,n]=we.useState(false),a=we.useRef(null),s=we.useCallback(()=>{o||(n(true),a.current=setInterval(()=>{r(m=>m+1);},1e3));},[o]),i=we.useCallback(()=>{o&&a.current&&(clearInterval(a.current),n(false));},[o]),c=we.useCallback(()=>{a.current&&clearInterval(a.current),n(false),r(0);},[]);return we.useEffect(()=>()=>{a.current&&clearInterval(a.current);},[]),{seconds:t,isActive:o,start:s,pause:i,reset:c,formattedTime:(m=>{let u=Math.floor(m/3600),f=Math.floor(m%3600/60),g=m%60;return [u,f,g].map(x=>x<10?"0"+x:x).filter((x,v)=>x!=="00"||v>0).join(":")})(t)}}function uH(){let e=we.useContext(Ko);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function gH(e=false){let[t,r]=we.useState(e),o=we.useCallback(()=>{r(n=>!n);},[]);return [t,o,r]}function xH(e=3e3){let[t,r]=we.useState(false),o=we.useRef(null),n=we.useCallback(a=>{r(a),o.current&&clearTimeout(o.current),a&&(o.current=window.setTimeout(()=>{r(false);},e));},[e]);return we.useEffect(()=>()=>{o.current&&clearTimeout(o.current);},[]),{isTyping:t,setTyping:n}}function yH(){return {startTransition:t=>{if(!document.startViewTransition){t();return}document.startViewTransition(()=>{reactDom.flushSync(()=>{t();});});}}}function NH(e,t={month:"short",day:"numeric",year:"numeric"}){let r=new Date(e);return new Intl.DateTimeFormat("en-US",t).format(r)}function TH(e){return new Intl.NumberFormat("en-US").format(e)}function CH(e,t="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e)}function RH(e,t){return e.length<=t?e:e.slice(0,t)+"..."}function LH(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}
69
+ `,backgroundSize:`${o}px ${o}px`,transform:s?"translate3d(calc((var(--mouse-x, 0) - 24px) / 40), calc((var(--mouse-y, 0) - 24px) / 40), 0)":void 0}:e==="gradient"?{...h,background:s?`radial-gradient(circle at var(--mouse-x, center) var(--mouse-y, center), ${p}, transparent)`:`radial-gradient(circle at center, ${p}, transparent)`}:e==="beams"?{...h,background:`radial-gradient(60% 40% at 50% 0%, ${p} 0%, transparent 100%)`}:h},v=n==="fade"?{maskImage:"radial-gradient(ellipse at center, black, transparent 90%)",WebkitMaskImage:"radial-gradient(ellipse at center, black, transparent 90%)"}:{};return jsxRuntime.jsxs("div",{ref:h=>{h&&(g.current=h),typeof f=="function"?f(h):f&&(f.current=h);},className:l("absolute inset-0 overflow-hidden pointer-events-none transition-transform duration-300 ease-out","z-0","[--pattern-color:rgba(0,0,0,0.05)] dark:[--pattern-color:rgba(255,255,255,0.08)]",i?.startsWith("bg-")?i:"",c),style:{...x(),...v,...m,backgroundColor:i&&!i.startsWith("bg-")?i:void 0},...u,children:[t&&jsxRuntime.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none brightness-100 contrast-150",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`}}),e==="beams"&&jsxRuntime.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[jsxRuntime.jsx("div",{className:"absolute top-0 left-1/4 w-px h-full bg-gradient-to-b from-transparent via-white/10 to-transparent"}),jsxRuntime.jsx("div",{className:"absolute top-0 right-1/4 w-px h-full bg-gradient-to-b from-transparent via-white/10 to-transparent"})]}),e==="mesh"&&jsxRuntime.jsxs("div",{className:l("absolute inset-0 opacity-30 blur-[100px]",a&&"animate-pulse"),children:[jsxRuntime.jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[50%] h-[50%] rounded-full bg-blue-500/20"}),jsxRuntime.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[50%] h-[50%] rounded-full bg-purple-500/20"}),jsxRuntime.jsx("div",{className:"absolute top-[20%] right-[10%] w-[40%] h-[40%] rounded-full bg-indigo-500/10"})]}),d]})});Up.displayName="Background";var jR=({children:e,className:t,size:r=300,color:o,fill:n,...a})=>{let s=we.useRef(null),i=n||o||"rgba(255, 255, 255, 0.1)";return jsxRuntime.jsxs("div",{ref:s,onMouseMove:u=>{let f=s.current;if(!f)return;let g=f.getBoundingClientRect(),x=u.clientX-g.left,v=u.clientY-g.top;f.style.setProperty("--mouse-x",`${x}px`),f.style.setProperty("--mouse-y",`${v}px`);},onMouseEnter:()=>{s.current?.style.setProperty("--opacity","1");},onMouseLeave:()=>{s.current?.style.setProperty("--opacity","0");},className:l("relative overflow-hidden rounded-2xl border border-gray-200 bg-white dark:border-white/10 dark:bg-black",t),...a,children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute -inset-px transition-opacity duration-300",style:{opacity:"var(--opacity, 0)",background:`radial-gradient(${r}px circle at var(--mouse-x, center) var(--mouse-y, center), ${i}, transparent 80%)`}}),e&&jsxRuntime.jsx("div",{className:"relative h-full",children:e})]})};var of=classVarianceAuthority.cva("relative flex w-full flex-col rounded-2xl border transition-all duration-200 focus-within:ring-4",{variants:{variant:{default:"bg-white border-gray-200 shadow-sm focus-within:border-purple-500/50 focus-within:ring-purple-500/10 dark:bg-white/[0.03] dark:border-white/10 dark:shadow-none",ghost:"bg-transparent border-transparent shadow-none focus-within:bg-white/50 dark:focus-within:bg-white/5"}},defaultVariants:{variant:"default"}}),af=we__namespace.default.forwardRef(({className:e,variant:t,onSubmit:r,isGenerating:o,onAttach:n,onFilesSelected:a,onStop:s,onMic:i,maxLength:c,footer:d,attachments:m,onRemoveAttachment:u,accept:f,multiple:g,placeholder:x="Ask AI anything...",value:v,onChange:h,...p},b)=>{let[w,k]=we.useState(""),y=v!==void 0,N=y?v:w,C=we.useRef(null),T=we.useRef(null),L=()=>{C.current&&(C.current.style.height="auto",C.current.style.height=`${C.current.scrollHeight}px`);};we.useEffect(()=>{L();},[N]);let H=M=>{let Y=M.target.value;c&&Y.length>c||(y||k(Y),h?.(M));},E=M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),N.trim()&&!o&&(r?.(N),y||k(""))),p.onKeyDown?.(M);},S=()=>{o&&s?s():N.trim()&&(r?.(N),y||k(""));},O=()=>{a&&T.current?T.current.click():n?.();},V=M=>{M.target.files&&M.target.files.length>0&&a?.(M.target.files),T.current&&(T.current.value="");};return jsxRuntime.jsxs("div",{className:l(of({variant:t,className:e})),children:[jsxRuntime.jsx("input",{type:"file",ref:T,className:"hidden",onChange:V,accept:f,multiple:g}),m&&m.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2 px-4 pt-4",children:m.map(M=>jsxRuntime.jsxs("div",{className:"group relative flex items-center gap-2 rounded-xl border border-gray-200 bg-gray-50 px-3 py-1.5 text-sm transition-colors hover:bg-gray-100 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/[0.06]",children:[jsxRuntime.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-lg bg-white dark:bg-white/[0.06]",children:jsxRuntime.jsx(lucideReact.File,{className:"h-3 w-3 text-purple-500"})}),jsxRuntime.jsx("span",{className:"max-w-[120px] truncate text-gray-700 dark:text-gray-300",children:M.name}),jsxRuntime.jsx("button",{onClick:()=>u?.(M.id),className:"ml-1 rounded-full p-0.5 text-gray-400 opacity-0 transition-all hover:bg-gray-200 hover:text-gray-600 group-hover:opacity-100 dark:hover:bg-white/[0.06] dark:hover:text-white",type:"button",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3"})})]},M.id))}),jsxRuntime.jsx("textarea",{ref:M=>{C.current=M,typeof b=="function"?b(M):b&&(b.current=M);},value:N,onChange:H,onKeyDown:E,placeholder:x,rows:1,className:l("w-full resize-none bg-transparent px-4 py-4 text-base outline-none max-h-[200px]","text-gray-900 placeholder:text-gray-400","dark:text-white dark:placeholder:text-white/40"),disabled:o&&!s,...p}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-2 pb-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-gray-600 dark:text-white/40 dark:hover:text-white",onClick:O,type:"button",title:"Attach file",children:jsxRuntime.jsx(lucideReact.Paperclip,{className:"h-5 w-5"})}),i&&jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-gray-600 dark:text-white/40 dark:hover:text-white",onClick:i,type:"button",title:"Use microphone",children:jsxRuntime.jsx(lucideReact.Mic,{className:"h-5 w-5"})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[c&&jsxRuntime.jsxs("span",{className:"text-xs text-gray-400 dark:text-white/30",children:[N.length,"/",c]}),jsxRuntime.jsx(R,{size:"icon",disabled:!N.trim()&&!o||o&&!s,onClick:S,className:l("h-8 w-8 rounded-full transition-all duration-200",N.trim()||o?"bg-purple-600 text-white hover:bg-purple-500 shadow-lg shadow-purple-500/25":"bg-gray-100 text-gray-400 dark:bg-white/[0.06] dark:text-white/20"),children:o?s?jsxRuntime.jsx(lucideReact.Square,{className:"h-3 w-3 fill-current"}):jsxRuntime.jsx(lucideReact.Sparkles,{className:"h-4 w-4 animate-pulse"}):jsxRuntime.jsx(lucideReact.ArrowUp,{className:"h-4 w-4"})})]})]}),d&&jsxRuntime.jsx("div",{className:"border-t border-gray-100 px-4 py-2 text-xs text-gray-400 dark:border-white/5 dark:text-white/30",children:d})]})});af.displayName="AIPromptInput";var hf=classVarianceAuthority.cva("group relative overflow-hidden rounded-2xl border transition-all duration-200",{variants:{variant:{default:"bg-gray-50 border-gray-200 dark:bg-white/[0.02] dark:border-white/10",ghost:"bg-transparent border-transparent",outline:"bg-transparent border-gray-200 dark:border-white/10"}},defaultVariants:{variant:"default"}}),bf=we__namespace.default.forwardRef(({className:e,variant:t,children:r,onCopy:o,onRegenerate:n,onFeedback:a,onShare:s,onEdit:i,timestamp:c,sources:d,model:m,usage:u,...f},g)=>jsxRuntime.jsxs("div",{ref:g,className:l(hf({variant:t,className:e})),...f,children:[jsxRuntime.jsxs("div",{className:"absolute left-4 top-4 flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-gradient-to-br from-purple-500 to-blue-500 shadow-lg shadow-purple-500/20",children:jsxRuntime.jsx(lucideReact.Sparkles,{className:"h-3.5 w-3.5 text-white"})}),c&&jsxRuntime.jsx("span",{className:"text-xs font-medium text-gray-400 dark:text-white/30",children:c})]}),jsxRuntime.jsxs("div",{className:"pl-14 pr-4 py-4",children:[jsxRuntime.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none text-gray-700 dark:text-gray-300",children:r}),d&&d.length>0&&jsxRuntime.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:d.map((x,v)=>jsxRuntime.jsxs("a",{href:x.url,target:"_blank",rel:"noopener noreferrer",className:l("flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs transition-colors","border-gray-200 bg-white text-gray-600 hover:bg-gray-50","dark:border-white/10 dark:bg-white/[0.03] dark:text-white/60 dark:hover:bg-white/[0.06]"),children:[jsxRuntime.jsx("span",{className:"max-w-[150px] truncate",children:x.title}),jsxRuntime.jsx(lucideReact.ExternalLink,{className:"h-3 w-3 opacity-50"})]},v))})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 bg-white/50 px-2 py-1.5 backdrop-blur dark:border-white/5 dark:bg-white/[0.02]",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 px-2 text-[10px] font-medium text-gray-400 dark:text-white/20",children:[m&&jsxRuntime.jsx("span",{children:m}),u&&jsxRuntime.jsx("span",{children:u})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs(R,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:o,children:[jsxRuntime.jsx(lucideReact.Copy,{className:"mr-1.5 h-3.5 w-3.5"}),"Copy"]}),s&&jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:s,title:"Share",children:jsxRuntime.jsx(lucideReact.Share,{className:"h-3.5 w-3.5"})}),i&&jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:i,title:"Edit",children:jsxRuntime.jsx(lucideReact.Edit,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("div",{className:"mx-1 h-3 w-px bg-gray-200 dark:bg-white/10"}),jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:n,title:"Regenerate",children:jsxRuntime.jsx(lucideReact.RefreshCw,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:()=>a?.("up"),title:"Helpful",children:jsxRuntime.jsx(lucideReact.ThumbsUp,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:()=>a?.("down"),title:"Not helpful",children:jsxRuntime.jsx(lucideReact.ThumbsDown,{className:"h-3.5 w-3.5"})})]})]})]}));bf.displayName="AIResponse";function f4({children:e,className:t,...r}){return jsxRuntime.jsx("div",{className:l("flex h-[800px] w-full overflow-hidden rounded-3xl border border-gray-200 dark:border-white/10 bg-white dark:bg-black/40 backdrop-blur-xl shadow-2xl",t),...r,children:e})}function N4({conversations:e,activeId:t,onSelect:r,onNewChat:o,onSearch:n,onArchive:a,onPin:s,onMute:i,onDelete:c,filter:d="all",sortBy:m="recent",hideHeader:u=false,className:f,...g}){let[x,v]=we.useState(""),h=we.useMemo(()=>e.filter(b=>(b.user?.name||b.group?.name||"").toLowerCase().includes(x.toLowerCase())),[e,x]),p=b=>{let w=b.target.value;v(w),n?.(w);};return jsxRuntime.jsxs("div",{className:l("flex flex-col border-r border-gray-200 dark:border-white/10 bg-gray-50/50 dark:bg-white/[0.02]",!f?.includes("w-")&&"w-80",f),...g,children:[!u&&jsxRuntime.jsxs("div",{className:"p-4 space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Messages"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",title:"Filter",children:jsxRuntime.jsx(lucideReact.Filter,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{onClick:o,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",title:"New Chat",children:jsxRuntime.jsx(lucideReact.Plus,{className:"h-5 w-5"})})]})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),jsxRuntime.jsx("input",{type:"text",value:x,onChange:p,placeholder:"Search messages...",className:"w-full h-10 pl-9 pr-4 rounded-2xl bg-white dark:bg-white/[0.03] border border-gray-200 dark:border-white/10 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/50 transition-all placeholder:text-gray-400 dark:text-white"})]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:bg-white/10 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-white/20 [&::-webkit-scrollbar-track]:bg-transparent",children:jsxRuntime.jsx("div",{className:"flex flex-col",children:h.map(b=>{let w=b.user?.name||b.group?.name||"Unknown",k=b.user?.avatar||b.group?.avatar,y=b.user?.status==="online",N=t===b.id;return jsxRuntime.jsx("div",{className:"p-2",children:jsxRuntime.jsxs("div",{onClick:()=>r?.(b.id),className:l("w-full h-16 flex items-center gap-3 p-3 rounded-2xl transition-all text-left group cursor-pointer",N?"bg-blue-500/10 dark:bg-white/[0.06] shadow-[0_0_15px_rgba(59,130,246,0.1)] dark:shadow-[0_0_15px_rgba(255,255,255,0.05)]":"hover:bg-gray-100 dark:hover:bg-white/[0.03]"),children:[jsxRuntime.jsxs("div",{className:"relative flex-shrink-0",children:[jsxRuntime.jsx(z,{src:k,alt:w,fallback:w[0]}),y&&jsxRuntime.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 w-3.5 h-3.5 bg-green-500 border-2 border-white dark:border-[#0a0a0a] rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[jsxRuntime.jsx("span",{className:l("font-semibold truncate",N?"text-blue-600 dark:text-white":"text-gray-900 dark:text-white/90"),children:w}),b.lastMessage&&jsxRuntime.jsx("span",{className:"text-[10px] text-gray-400 dark:text-white/30 whitespace-nowrap",children:new Date(b.lastMessage.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-white/40 truncate",children:b.isTyping?jsxRuntime.jsx("span",{className:"text-blue-500 animate-pulse",children:"typing..."}):b.lastMessage?.content||"No messages yet"}),b.unreadCount>0&&jsxRuntime.jsx("span",{className:"flex-shrink-0 min-w-[18px] h-[18px] flex items-center justify-center bg-blue-500 text-white text-[10px] font-bold rounded-full px-1",children:b.unreadCount})]})]}),jsxRuntime.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:C=>C.stopPropagation(),children:jsxRuntime.jsxs(at,{children:[jsxRuntime.jsx(nt,{className:"p-1 rounded-lg hover:bg-gray-200 dark:hover:bg-white/10 text-gray-400",children:jsxRuntime.jsx(lucideReact.MoreVertical,{className:"h-4 w-4"})}),jsxRuntime.jsxs(st,{align:"end",children:[jsxRuntime.jsxs(K,{onClick:()=>s?.(b.id),children:[jsxRuntime.jsx(lucideReact.Pin,{className:"h-4 w-4 mr-2"})," Pin"]}),jsxRuntime.jsxs(K,{onClick:()=>a?.(b.id),children:[jsxRuntime.jsx(lucideReact.Archive,{className:"h-4 w-4 mr-2"})," Archive"]}),jsxRuntime.jsxs(K,{onClick:()=>i?.(b.id),children:[jsxRuntime.jsx(lucideReact.BellOff,{className:"h-4 w-4 mr-2"})," Mute"]}),jsxRuntime.jsxs(K,{className:"text-red-500",onClick:()=>c?.(b.id),children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4 mr-2"})," Delete"]})]})]})})]})},b.id)})})})]})}function P4({user:e,onBack:t,onInfo:r,onAvatarClick:o,onCall:n,onVideoCall:a,onSearch:s,onMute:i,isTyping:c,isMuted:d,actions:m,className:u,...f}){return jsxRuntime.jsxs("div",{className:l("flex h-16 items-center justify-between border-b border-gray-200 dark:border-white/10 bg-white/80 dark:bg-black/40 backdrop-blur px-4 sticky top-0 z-10",u),...f,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[t&&jsxRuntime.jsx("button",{onClick:t,className:"md:hidden p-2 -ml-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06]",children:jsxRuntime.jsx(lucideReact.ArrowLeft,{className:"h-5 w-5 text-gray-600 dark:text-white/70"})}),jsxRuntime.jsxs("div",{className:"relative cursor-pointer",onClick:o||r,children:[jsxRuntime.jsx(z,{src:e.avatar,alt:e.name,fallback:e.name[0]}),e.status==="online"&&jsxRuntime.jsx("span",{className:"absolute bottom-0 right-0 h-3 w-3 rounded-full bg-green-500 border-2 border-white dark:border-black"})]}),jsxRuntime.jsxs("div",{className:"cursor-pointer",onClick:r,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white leading-none",children:e.name}),d&&jsxRuntime.jsx(lucideReact.BellOff,{className:"h-3 w-3 text-gray-400"})]}),jsxRuntime.jsx("p",{className:l("text-xs mt-1 transition-colors",c?"text-blue-500 font-medium animate-pulse":"text-gray-500 dark:text-white/50"),children:c?"typing...":e.status==="online"?"Online":`Last seen ${e.lastSeen?.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[s&&jsxRuntime.jsx("button",{onClick:s,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.Search,{className:"h-5 w-5"})}),n&&jsxRuntime.jsx("button",{onClick:n,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.Phone,{className:"h-5 w-5"})}),a&&jsxRuntime.jsx("button",{onClick:a,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.Video,{className:"h-5 w-5"})}),m,jsxRuntime.jsx("button",{onClick:r,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.MoreVertical,{className:"h-5 w-5"})})]})]})}function Ws({src:e,duration:t,isMe:r,className:o,...n}){let[a,s]=we.useState(false),[i,c]=we.useState(0),[d,m]=we.useState(false),u=we.useRef(null),f=()=>{u.current&&(a?u.current.pause():u.current.play(),s(!a));},g=()=>{u.current&&c(u.current.currentTime);},x=()=>{s(false),c(0);},v=p=>{let b=Math.floor(p/60),w=Math.floor(p%60);return `${b}:${w.toString().padStart(2,"0")}`},h=t?i/t*100:0;return jsxRuntime.jsxs("div",{className:l("flex items-center gap-3 p-2 rounded-2xl min-w-[200px]",r?"bg-white/10":"bg-gray-100 dark:bg-white/[0.03]",o),...n,children:[jsxRuntime.jsx("audio",{ref:u,src:e,onTimeUpdate:g,onEnded:x}),jsxRuntime.jsx("button",{onClick:f,className:l("w-10 h-10 rounded-full flex items-center justify-center transition-all",r?"bg-white text-blue-600":"bg-blue-500 text-white"),children:a?jsxRuntime.jsx(lucideReact.Pause,{className:"h-5 w-5 fill-current"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-5 w-5 fill-current ml-0.5"})}),jsxRuntime.jsxs("div",{className:"flex-1 space-y-1",children:[jsxRuntime.jsx("div",{className:"h-1.5 w-full bg-gray-300 dark:bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:l("h-full transition-all duration-100",r?"bg-white":"bg-blue-500"),style:{width:`${h}%`}})}),jsxRuntime.jsxs("div",{className:"flex justify-between text-[10px] font-medium opacity-60",children:[jsxRuntime.jsx("span",{children:v(i)}),jsxRuntime.jsx("span",{children:t?v(t):"--:--"})]})]}),jsxRuntime.jsx("button",{onClick:()=>m(!d),className:"p-1.5 rounded-full hover:bg-black/5 dark:hover:bg-white/5 opacity-60",children:d?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-4 w-4"})})]})}function _s({status:e,className:t,...r}){return e==="sending"?jsxRuntime.jsx("div",{className:l("w-3 h-3 border border-current border-t-transparent rounded-full animate-spin opacity-50",t),...r}):e==="failed"?jsxRuntime.jsx("span",{className:l("text-red-500 text-[10px] font-bold",t),...r,children:"!"}):jsxRuntime.jsxs("div",{className:l("flex items-center",t),...r,children:[e==="sent"&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3 opacity-50"}),e==="delivered"&&jsxRuntime.jsx(lucideReact.CheckCheck,{className:"h-3 w-3 opacity-50"}),e==="read"&&jsxRuntime.jsx(lucideReact.CheckCheck,{className:"h-3 w-3 text-blue-500"})]})}function Xs({url:e,title:t,description:r,image:o,siteName:n,className:a,...s}){return jsxRuntime.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:l("block overflow-hidden rounded-xl border border-gray-200 dark:border-white/10 bg-white dark:bg-white/[0.03] hover:bg-gray-50 dark:hover:bg-white/[0.05] transition-all group",a),...s,children:[o&&jsxRuntime.jsx("div",{className:"aspect-video w-full overflow-hidden border-b border-gray-200 dark:border-white/10",children:jsxRuntime.jsx("img",{src:o,alt:t,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"})}),jsxRuntime.jsxs("div",{className:"p-3 space-y-1",children:[n&&jsxRuntime.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-blue-500",children:n}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white line-clamp-1",children:t||e}),r&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-white/50 line-clamp-2",children:r}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-gray-400 pt-1",children:[jsxRuntime.jsx(lucideReact.ExternalLink,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{className:"truncate",children:new URL(e).hostname})]})]})]})}function qs({data:e,isOwn:t,onAction:r}){return jsxRuntime.jsxs("div",{className:"space-y-2 max-w-sm",children:[(()=>{if(!e.header)return null;switch(e.header.type){case "text":return jsxRuntime.jsx("h4",{className:"font-bold mb-1 text-sm",children:e.header.text});case "image":return jsxRuntime.jsx("div",{className:"mb-2 rounded-lg overflow-hidden border border-white/10",children:jsxRuntime.jsx("img",{src:e.header.attachment?.url,alt:"Header",className:"w-full h-auto object-cover"})});default:return null}})(),jsxRuntime.jsx("p",{className:"text-sm leading-relaxed",children:e.body}),e.footer&&jsxRuntime.jsx("p",{className:"text-[10px] opacity-50 italic",children:e.footer}),e.type==="button"&&e.buttons&&jsxRuntime.jsx("div",{className:"flex flex-col gap-1 mt-3",children:e.buttons.map(n=>jsxRuntime.jsxs("button",{onClick:()=>r?.(n),className:l("flex items-center justify-center gap-2 p-2.5 rounded-xl text-sm font-medium transition-all","bg-white/10 hover:bg-white/20 border border-white/10 active:scale-[0.98]",t?"text-white":"text-blue-500 dark:text-blue-400"),children:[n.type==="url"&&jsxRuntime.jsx(lucideReact.ExternalLink,{className:"h-3.5 w-3.5"}),n.type==="call"&&jsxRuntime.jsx(lucideReact.Phone,{className:"h-3.5 w-3.5"}),n.type==="reply"&&jsxRuntime.jsx(lucideReact.Reply,{className:"h-3.5 w-3.5"}),n.text]},n.id))}),e.type==="list"&&e.sections&&jsxRuntime.jsx("div",{className:"mt-3 space-y-3",children:e.sections.map((n,a)=>jsxRuntime.jsxs("div",{className:"space-y-1",children:[n.title&&jsxRuntime.jsx("p",{className:"text-[10px] uppercase tracking-wider opacity-40 font-bold px-1",children:n.title}),jsxRuntime.jsx("div",{className:"flex flex-col gap-1",children:n.rows.map(s=>jsxRuntime.jsxs("button",{onClick:()=>r?.({id:s.id,text:s.title,type:"reply"}),className:"flex flex-col items-start p-3 rounded-xl bg-white/5 hover:bg-white/10 border border-white/5 transition-colors text-left",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:s.title}),s.description&&jsxRuntime.jsx("span",{className:"text-xs opacity-50 line-clamp-1",children:s.description})]},s.id))})]},a))})]})}function Gs({cards:e,isOwn:t,onAction:r}){let o=we__namespace.default.useRef(null),n=a=>{o.current&&o.current.scrollBy({left:a==="left"?-240:240,behavior:"smooth"});};return jsxRuntime.jsxs("div",{className:"relative group/carousel max-w-[300px] sm:max-w-[400px]",children:[jsxRuntime.jsx("div",{ref:o,className:"flex gap-3 overflow-x-auto scrollbar-hide snap-x snap-mandatory pb-2",children:e.map((a,s)=>jsxRuntime.jsxs("div",{className:"flex-shrink-0 w-[240px] snap-start rounded-2xl bg-white/5 dark:bg-white/[0.03] border border-white/10 overflow-hidden flex flex-col",children:[a.header?.attachment&&jsxRuntime.jsx("div",{className:"aspect-video w-full overflow-hidden",children:jsxRuntime.jsx("img",{src:a.header.attachment.url,alt:"Card",className:"w-full h-full object-cover"})}),jsxRuntime.jsxs("div",{className:"p-3 flex-1 flex flex-col",children:[jsxRuntime.jsx("p",{className:"text-sm leading-relaxed mb-1",children:a.body}),a.footer&&jsxRuntime.jsx("p",{className:"text-[10px] opacity-50 italic mb-3",children:a.footer}),jsxRuntime.jsx("div",{className:"mt-auto flex flex-col gap-1",children:a.buttons.map(i=>jsxRuntime.jsxs("button",{onClick:()=>r?.(i),className:l("flex items-center justify-center gap-2 p-2 rounded-lg text-xs font-medium transition-all","bg-white/10 hover:bg-white/20 border border-white/10",t?"text-white":"text-blue-500 dark:text-blue-400"),children:[i.type==="url"&&jsxRuntime.jsx(lucideReact.ExternalLink,{className:"h-3 w-3"}),i.type==="call"&&jsxRuntime.jsx(lucideReact.Phone,{className:"h-3 w-3"}),i.type==="reply"&&jsxRuntime.jsx(lucideReact.Reply,{className:"h-3 w-3"}),i.text]},i.id))})]})]},s))}),e.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{onClick:()=>n("left"),className:"absolute left-[-12px] top-1/2 -translate-y-1/2 p-1.5 rounded-full bg-white dark:bg-gray-800 shadow-lg border border-white/10 opacity-0 group-hover/carousel:opacity-100 transition-opacity z-10",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{onClick:()=>n("right"),className:"absolute right-[-12px] top-1/2 -translate-y-1/2 p-1.5 rounded-full bg-white dark:bg-gray-800 shadow-lg border border-white/10 opacity-0 group-hover/carousel:opacity-100 transition-opacity z-10",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})})]})]})}function Js({message:e,isOwn:t,showAvatar:r,showStatus:o=true,className:n,onReply:a,onReact:s,onDelete:i,onEdit:c,onForward:d,onCopy:m,onPin:u,onSelect:f,onImageClick:g,isSelected:x}){let v=()=>!t||!o?null:jsxRuntime.jsx(_s,{status:e.status||"sent",className:"ml-1"}),h=()=>{if(e.type==="revoked")return jsxRuntime.jsxs("p",{className:"text-sm italic opacity-50 flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-3 w-3"})," This message was deleted"]});switch(e.type){case "audio":return jsxRuntime.jsx(Ws,{src:e.attachments?.[0]?.url||"",duration:e.attachments?.[0]?.duration,isMe:t});case "location":return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:e.location?.address||"Shared Location"})]}),jsxRuntime.jsxs("div",{className:"aspect-video rounded-xl bg-gray-200 dark:bg-white/10 flex items-center justify-center overflow-hidden relative group/map",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-8 w-8 opacity-20 group-hover/map:scale-110 transition-transform"}),jsxRuntime.jsx("div",{className:"absolute inset-0 bg-blue-500/5 group-hover/map:bg-blue-500/10 transition-colors"})]})]});case "contact":return jsxRuntime.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-xl bg-black/5 dark:bg-white/10 border border-white/5",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center text-white shadow-lg shadow-blue-500/20",children:jsxRuntime.jsx(lucideReact.User,{className:"h-5 w-5"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:"text-sm font-bold truncate",children:e.contact?.name}),jsxRuntime.jsx("p",{className:"text-xs opacity-60 truncate",children:e.contact?.phone})]})]});case "file":return jsxRuntime.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-black/5 dark:bg-white/10 border border-white/5 hover:bg-black/10 dark:hover:bg-white/20 transition-colors cursor-pointer",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-500/20 flex items-center justify-center text-blue-500",children:jsxRuntime.jsx(lucideReact.FileText,{className:"h-6 w-6"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium truncate",children:e.attachments?.[0]?.name||"File"}),jsxRuntime.jsx("p",{className:"text-[10px] opacity-60 uppercase",children:e.attachments?.[0]?.size||"Unknown size"})]})]});case "sticker":return jsxRuntime.jsx("div",{className:"relative group/sticker",children:jsxRuntime.jsx("img",{src:e.attachments?.[0]?.url,alt:"Sticker",className:"w-32 h-32 object-contain"})});case "image":return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("div",{className:"relative rounded-2xl overflow-hidden border border-white/5 group/image cursor-pointer",onClick:()=>g?.(e.attachments?.[0]?.url||""),children:jsxRuntime.jsx(qo,{src:e.attachments?.[0]?.url||"",alt:e.content||"Image",className:"max-h-[300px] w-auto object-contain bg-black/20 transition-transform duration-300 group-hover/image:scale-105"})}),e.content&&jsxRuntime.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words px-1",children:e.content})]});case "video":return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("div",{className:"relative rounded-2xl overflow-hidden border border-white/5 bg-black/20 aspect-video flex items-center justify-center group/video",children:jsxRuntime.jsx("video",{src:e.attachments?.[0]?.url,controls:true,className:"max-h-[300px] w-full"})}),e.content&&jsxRuntime.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words px-1",children:e.content})]});case "interactive":return e.interactive?.type==="carousel"&&e.interactive.cards?jsxRuntime.jsx(Gs,{cards:e.interactive.cards,isOwn:t}):e.interactive?jsxRuntime.jsx(qs,{data:e.interactive,isOwn:t}):null;default:let p=/(https?:\/\/[^\s]+)/g,b=e.content.match(p);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[e.replyTo&&jsxRuntime.jsxs("div",{className:"mb-2 p-2 rounded-lg bg-black/5 dark:bg-white/5 border-l-4 border-blue-500 text-xs",children:[jsxRuntime.jsx("p",{className:"font-bold text-blue-500 truncate",children:e.replyTo.senderId===e.senderId?"You":"Other"}),jsxRuntime.jsx("p",{className:"opacity-60 truncate",children:e.replyTo.content})]}),jsxRuntime.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:e.content}),b&&b.map(w=>jsxRuntime.jsx(Xs,{url:w},w))]})}};return jsxRuntime.jsxs("div",{className:l("flex w-full mb-4 group/bubble",t?"justify-end":"justify-start",n),children:[!t&&r&&jsxRuntime.jsx("div",{className:"mr-2 mt-auto",children:jsxRuntime.jsx(z,{src:e.contact?.avatar,alt:e.contact?.name||"User",className:"w-8 h-8",fallback:(e.contact?.name||e.senderId||"?").charAt(0).toUpperCase()})}),jsxRuntime.jsxs("div",{className:l("relative max-w-[75%] sm:max-w-[60%] transition-all duration-300",x&&"scale-95 opacity-80"),children:[jsxRuntime.jsx(Hn,{preset:"spring",children:jsxRuntime.jsxs("div",{className:l("relative p-3 rounded-2xl shadow-sm backdrop-blur-md border",t?"bg-blue-600/90 dark:bg-blue-500/20 text-white border-blue-500/20 rounded-tr-none":"bg-white/80 dark:bg-white/[0.05] text-gray-900 dark:text-white border-white/10 rounded-tl-none","hover:shadow-lg hover:shadow-blue-500/5 transition-shadow"),children:[!t&&e.remoteJid?.endsWith("@g.us")&&e.contact?.name&&jsxRuntime.jsx("p",{className:"text-[11px] font-bold text-blue-500 dark:text-blue-400 mb-1 truncate",children:e.contact.name}),h(),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-1 mt-1 opacity-60 text-[10px]",children:[jsxRuntime.jsx("span",{children:new Date(e.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),v()]}),e.reactions&&Object.keys(e.reactions).length>0&&jsxRuntime.jsx("div",{className:"absolute -bottom-3 right-2 flex -space-x-1",children:Object.entries(e.reactions).map(([p,b])=>jsxRuntime.jsx("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-white/10 rounded-full px-1.5 py-0.5 text-xs shadow-sm animate-in zoom-in-50",title:b.join(", "),children:p},p))})]})}),jsxRuntime.jsxs("div",{className:l("absolute top-0 opacity-0 group-hover/bubble:opacity-100 transition-opacity flex items-center gap-1",t?"right-full mr-2":"left-full ml-2"),children:[jsxRuntime.jsxs(at,{children:[jsxRuntime.jsx(nt,{className:"p-1.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/10 text-gray-400 transition-colors",children:jsxRuntime.jsx(lucideReact.Smile,{className:"h-4 w-4"})}),jsxRuntime.jsx(st,{side:"top",className:"flex gap-1 p-1",children:["\u{1F44D}","\u2764\uFE0F","\u{1F602}","\u{1F62E}","\u{1F622}","\u{1F64F}"].map(p=>jsxRuntime.jsx("button",{onClick:()=>s?.(p),className:"p-1.5 hover:bg-gray-100 dark:hover:bg-white/10 rounded-lg transition-transform hover:scale-125",children:p},p))})]}),jsxRuntime.jsxs(at,{children:[jsxRuntime.jsx(nt,{className:"p-1.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/10 text-gray-400 transition-colors",children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"h-4 w-4"})}),jsxRuntime.jsxs(st,{align:t?"end":"start",children:[jsxRuntime.jsxs(K,{onClick:a,children:[jsxRuntime.jsx(lucideReact.Reply,{className:"h-4 w-4 mr-2"})," Reply"]}),jsxRuntime.jsxs(K,{onClick:m,children:[jsxRuntime.jsx(lucideReact.Copy,{className:"h-4 w-4 mr-2"})," Copy"]}),jsxRuntime.jsxs(K,{onClick:d,children:[jsxRuntime.jsx(lucideReact.Forward,{className:"h-4 w-4 mr-2"})," Forward"]}),jsxRuntime.jsxs(K,{onClick:u,children:[jsxRuntime.jsx(lucideReact.Pin,{className:"h-4 w-4 mr-2"})," Pin"]}),t&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(K,{onClick:c,children:[jsxRuntime.jsx(lucideReact.Edit2,{className:"h-4 w-4 mr-2"})," Edit"]}),jsxRuntime.jsxs(K,{className:"text-red-500",onClick:i,children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4 mr-2"})," Delete"]})]})]})]})]})]})]})}function CL({messages:e,currentUserId:t,className:r,onReply:o,onReact:n,onDelete:a,onEdit:s,onForward:i,onCopy:c,onPin:d,onSelect:m,onLoadMore:u,hasMore:f,isLoadingMore:g,selectedMessages:x=[],dateFormat:v="MMMM d, yyyy",groupByDate:h=true,...p}){let[b,w]=we.useState(true),k=we.useRef(null),y=we.useRef(null),N=we.useCallback((T="auto")=>{y.current?.scrollIntoView({behavior:T});},[]);we.useEffect(()=>{b&&N("smooth");},[e.length,b,N]);let C=T=>{let L=T.currentTarget,H=Math.abs(L.scrollHeight-L.clientHeight-L.scrollTop)<100;w(H),L.scrollTop===0&&f&&!g&&u&&u();};return e.length===0&&!g?jsxRuntime.jsx("div",{className:l("flex-1 flex items-center justify-center p-8 text-center text-gray-500 dark:text-white/40",r),...p,children:jsxRuntime.jsxs("div",{className:"max-w-sm space-y-4",children:[jsxRuntime.jsx("div",{className:"w-24 h-24 bg-blue-500/10 dark:bg-white/[0.03] rounded-full flex items-center justify-center mx-auto mb-6 animate-pulse",children:jsxRuntime.jsx(lucideReact.MessageSquare,{className:"h-12 w-12 text-blue-500"})}),jsxRuntime.jsx("h3",{className:"text-xl font-medium text-gray-900 dark:text-white",children:"No messages yet"}),jsxRuntime.jsx("p",{children:"Start the conversation by sending a message below."})]})}):jsxRuntime.jsxs("div",{className:l("flex-1 relative overflow-hidden",r),...p,children:[jsxRuntime.jsx("div",{ref:k,onScroll:C,className:"h-full overflow-y-auto p-4 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:bg-white/10 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-white/20 [&::-webkit-scrollbar-track]:bg-transparent",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-4",children:[e.map((T,L)=>{let H=T.senderId===t,E=L>0?e[L-1]:null,S=!H&&(!E||E.senderId!==T.senderId);return jsxRuntime.jsx(Js,{message:T,isOwn:H,showAvatar:S,onReply:()=>o?.(T),onReact:O=>n?.(T,O),onDelete:()=>a?.(T),onEdit:()=>s?.(T),onForward:()=>i?.(T),onCopy:()=>c?.(T),onPin:()=>d?.(T),onSelect:()=>m?.(T),isSelected:x.includes(T.id)},T.id)}),jsxRuntime.jsx("div",{ref:y})]})}),!b&&jsxRuntime.jsx("button",{onClick:()=>N("smooth"),className:"absolute bottom-6 right-6 p-3 rounded-full bg-white dark:bg-white/10 backdrop-blur border border-gray-200 dark:border-white/10 shadow-lg text-gray-600 dark:text-white hover:scale-110 transition-all z-10",children:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"h-5 w-5"})})]})}function ei(){let[e,t]=we.useState(false),[r,o]=we.useState(0),[n,a]=we.useState(null),[s,i]=we.useState(null),c=we.useRef(null),d=we.useRef(null),m=we.useRef([]),u=we.useCallback(async()=>{try{let v=await navigator.mediaDevices.getUserMedia({audio:!0}),h=MediaRecorder.isTypeSupported("audio/ogg; codecs=opus")?"audio/ogg; codecs=opus":"audio/webm";c.current=new MediaRecorder(v,{mimeType:h}),m.current=[],c.current.ondataavailable=p=>{p.data.size>0&&m.current.push(p.data);},c.current.onstop=()=>{let p=new Blob(m.current,{type:h}),b=URL.createObjectURL(p);a(p),i(b),v.getTracks().forEach(w=>w.stop());},c.current.start(),t(!0),o(0),d.current=window.setInterval(()=>{o(p=>p+1);},1e3);}catch(v){throw console.error("Failed to start recording",v),v}},[]),f=we.useCallback(()=>{c.current&&e&&(c.current.stop(),t(false),d.current&&clearInterval(d.current));},[e]),g=we.useCallback(()=>{c.current&&e&&(c.current.stop(),t(false),d.current&&clearInterval(d.current),a(null),i(null),o(0));},[e]),x=we.useCallback(()=>{a(null),i(null),o(0);},[]);return {isRecording:e,duration:r,audioBlob:n,audioUrl:s,startRecording:u,stopRecording:f,cancelRecording:g,clearAudio:x}}function ti({onSend:e,onCancel:t,className:r,...o}){let{isRecording:n,duration:a,audioBlob:s,startRecording:i,stopRecording:c,cancelRecording:d}=ei();we.useEffect(()=>(i(),()=>d()),[]);let m=u=>{let f=Math.floor(u/60),g=u%60;return `${f}:${g.toString().padStart(2,"0")}`};return jsxRuntime.jsxs("div",{className:l("flex items-center gap-3 p-2 rounded-2xl bg-gray-100 dark:bg-white/[0.03] border border-gray-200 dark:border-white/10 animate-in slide-in-from-bottom-2",r),...o,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-xl bg-red-500/10 text-red-500",children:[jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),jsxRuntime.jsx("span",{className:"text-sm font-mono font-bold",children:m(a)})]}),jsxRuntime.jsx("div",{className:"flex-1 h-8 flex items-center gap-0.5 px-2",children:[...Array(20)].map((u,f)=>jsxRuntime.jsx("div",{className:"w-1 bg-red-500/40 rounded-full transition-all duration-150",style:{height:n?`${20+Math.random()*80}%`:"20%",animationDelay:`${f*.05}s`}},f))}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>{d(),t();},className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-white/10 text-gray-500 transition-colors",children:jsxRuntime.jsx(lucideReact.Trash2,{className:"h-5 w-5"})}),n?jsxRuntime.jsx(R,{size:"icon",variant:"ghost",onClick:c,className:"rounded-full bg-red-500 text-white hover:bg-red-600",children:jsxRuntime.jsx(lucideReact.Square,{className:"h-4 w-4 fill-current"})}):jsxRuntime.jsx(R,{size:"icon",onClick:()=>s&&e(s,a),className:"rounded-full bg-blue-500 text-white hover:bg-blue-600",children:jsxRuntime.jsx(lucideReact.Send,{className:"h-4 w-4"})})]})]})}function qL({value:e,onValueChange:t,onSend:r,onChange:o,onAttach:n,onMic:a,onVoiceEnd:s,onEmoji:i,onGif:c,onLocation:d,onContact:m,onPoll:u,onPix:f,onCarousel:g,onButtons:x,onList:v,onCancelReply:h,placeholder:p="Type a message...",users:b=[],replyingTo:w,isRecording:k,maxLength:y,disabled:N,className:C,...T}){let[L,H]=we.useState(""),E=e!==void 0?e:L,S=P=>{t?t(P):H(P);},[O,V]=we.useState(false),[M,Y]=we.useState(null),[de,Z]=we.useState(0),te=we.useRef(null),Le=we.useMemo(()=>M===null?[]:b.filter(P=>P.name.toLowerCase().includes(M.toLowerCase())).slice(0,5),[b,M]),wt=P=>{if(N)return;let I=P.target.value;if(y&&I.length>y)return;S(I),o?.(I);I[P.target.selectionStart-1];let Qe=I.slice(0,P.target.selectionStart).match(/@(\w*)$/);Qe?(Y(Qe[1]||""),Z(0)):Y(null),te.current&&(te.current.style.height="auto",te.current.style.height=`${Math.min(te.current.scrollHeight,120)}px`);},zr=P=>{if(!te.current)return;let I=te.current.selectionStart,A=E.slice(0,I).replace(/@\w*$/,`@${P.name} `),re=E.slice(I);S(A+re),Y(null),te.current.focus();},U=P=>{if(!N){if(M!==null&&Le.length>0){P.key==="ArrowDown"?(P.preventDefault(),Z(I=>(I+1)%Le.length)):P.key==="ArrowUp"?(P.preventDefault(),Z(I=>(I-1+Le.length)%Le.length)):P.key==="Enter"||P.key==="Tab"?(P.preventDefault(),zr(Le[de])):P.key==="Escape"&&Y(null);return}P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),_());}},_=()=>{N||!E.trim()&&!k||(r?.(E),S(""),te.current&&(te.current.style.height="auto"));};return jsxRuntime.jsxs("div",{className:l("p-4 bg-white/80 dark:bg-black/40 backdrop-blur border-t border-gray-200 dark:border-white/10 relative",C),...T,children:[M!==null&&Le.length>0&&jsxRuntime.jsx("div",{className:"absolute bottom-full left-4 mb-2 w-64 bg-white dark:bg-gray-900 border border-gray-200 dark:border-white/10 rounded-2xl shadow-2xl overflow-hidden animate-in slide-in-from-bottom-4",children:Le.map((P,I)=>jsxRuntime.jsxs("button",{onClick:()=>zr(P),className:l("w-full flex items-center gap-3 p-3 text-left transition-colors",I===de?"bg-blue-500/10 dark:bg-white/10":"hover:bg-gray-50 dark:hover:bg-white/5"),children:[jsxRuntime.jsx(z,{src:P.avatar,alt:P.name,className:"w-8 h-8"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-bold dark:text-white",children:P.name}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-500 dark:text-white/40",children:["@",P.name.toLowerCase().replace(/\s/g,"")]})]})]},P.id))}),w&&jsxRuntime.jsxs("div",{className:"mb-3 flex items-center justify-between p-3 rounded-2xl bg-blue-500/5 border-l-4 border-blue-500 animate-in slide-in-from-bottom-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:"text-xs font-bold text-blue-500",children:"Replying to"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-white/60 truncate",children:w.content})]}),jsxRuntime.jsx("button",{onClick:h,className:"p-1.5 rounded-full hover:bg-gray-200 dark:hover:bg-white/10 text-gray-400",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:"flex items-end gap-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[jsxRuntime.jsxs(at,{children:[jsxRuntime.jsx(nt,{disabled:N,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50 transition-colors disabled:opacity-50",children:jsxRuntime.jsx(lucideReact.Paperclip,{className:"h-5 w-5"})}),jsxRuntime.jsxs(st,{align:"start",side:"top",children:[jsxRuntime.jsxs(K,{onClick:n,children:[jsxRuntime.jsx(lucideReact.Image,{className:"h-4 w-4 mr-2"})," Image & Video"]}),jsxRuntime.jsxs(K,{onClick:n,children:[jsxRuntime.jsx(lucideReact.Paperclip,{className:"h-4 w-4 mr-2"})," Document"]}),jsxRuntime.jsxs(K,{onClick:d,children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-4 w-4 mr-2"})," Location"]}),jsxRuntime.jsxs(K,{onClick:m,children:[jsxRuntime.jsx(lucideReact.AtSign,{className:"h-4 w-4 mr-2"})," Contact"]}),jsxRuntime.jsxs(K,{onClick:u,children:[jsxRuntime.jsx(lucideReact.AtSign,{className:"h-4 w-4 mr-2"})," Poll"]}),jsxRuntime.jsxs(K,{onClick:f,children:[jsxRuntime.jsx(lucideReact.AtSign,{className:"h-4 w-4 mr-2"})," PIX"]}),jsxRuntime.jsxs(K,{onClick:g,children:[jsxRuntime.jsx(lucideReact.Layout,{className:"h-4 w-4 mr-2"})," Carousel"]}),jsxRuntime.jsxs(K,{onClick:x,children:[jsxRuntime.jsx(lucideReact.Layout,{className:"h-4 w-4 mr-2"})," Buttons"]}),jsxRuntime.jsxs(K,{onClick:v,children:[jsxRuntime.jsx(lucideReact.List,{className:"h-4 w-4 mr-2"})," List Menu"]}),jsxRuntime.jsxs(K,{onClick:c,children:[jsxRuntime.jsx(lucideReact.Gift,{className:"h-4 w-4 mr-2"})," GIF"]})]})]}),jsxRuntime.jsx("button",{onClick:i,disabled:N,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50 transition-colors disabled:opacity-50",children:jsxRuntime.jsx(lucideReact.Smile,{className:"h-5 w-5"})})]}),jsxRuntime.jsx("div",{className:"flex-1 relative",children:k?jsxRuntime.jsx(ti,{onSend:(P,I)=>s?.(P,I),onCancel:()=>h?.()}):jsxRuntime.jsx("textarea",{ref:te,value:E,onChange:wt,onKeyDown:U,placeholder:p,disabled:N,rows:1,className:"w-full p-2.5 max-h-[120px] rounded-2xl bg-gray-100 dark:bg-white/[0.03] border border-transparent focus:border-blue-500/50 focus:bg-white dark:focus:bg-white/[0.06] text-sm resize-none transition-all outline-none dark:text-white placeholder:text-gray-400"})}),jsxRuntime.jsx("div",{className:"flex items-center gap-1 mb-1",children:E.trim()||k?jsxRuntime.jsx("button",{onClick:_,disabled:N,className:"p-2.5 rounded-full bg-blue-500 text-white hover:bg-blue-600 shadow-lg shadow-blue-500/20 transition-all active:scale-90",children:jsxRuntime.jsx(lucideReact.Send,{className:"h-5 w-5"})}):jsxRuntime.jsx("button",{onClick:a,disabled:N,className:"p-2.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50 transition-colors disabled:opacity-50",children:jsxRuntime.jsx(lucideReact.Mic,{className:"h-5 w-5"})})})]})]})}function nP({user:e,onClose:t,className:r,...o}){return jsxRuntime.jsxs("div",{className:l("w-80 border-l border-gray-200 dark:border-white/10 bg-white dark:bg-black/20 flex flex-col",r),...o,children:[jsxRuntime.jsxs("div",{className:"h-16 flex items-center px-4 border-b border-gray-200 dark:border-white/10",children:[jsxRuntime.jsx("button",{onClick:t,className:"p-2 -ml-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06]",children:jsxRuntime.jsx(lucideReact.X,{className:"h-5 w-5 text-gray-500"})}),jsxRuntime.jsx("span",{className:"ml-2 font-semibold text-gray-900 dark:text-white",children:"Contact Info"})]}),jsxRuntime.jsxs(it,{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"p-6 flex flex-col items-center text-center",children:[jsxRuntime.jsx(z,{src:e.avatar,alt:e.name,fallback:e.name[0],className:"h-24 w-24 mb-4 text-2xl"}),jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:e.name}),jsxRuntime.jsx("p",{className:"text-sm text-gray-500 dark:text-white/50 mt-1",children:e.phone||"+1 (555) 000-0000"}),jsxRuntime.jsxs("div",{className:"mt-6 w-full",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-500 dark:text-white/50 mb-1 text-left",children:"About"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-900 dark:text-white text-left",children:e.bio||"Hey there! I am using Pixon Chat."})]})]}),jsxRuntime.jsx(Sr,{}),jsxRuntime.jsxs("div",{className:"p-4 space-y-4",children:[jsxRuntime.jsx("h3",{className:"text-xs font-semibold text-gray-500 dark:text-white/40 uppercase tracking-wider",children:"Media & Docs"}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2",children:[1,2,3,4,5,6].map(n=>jsxRuntime.jsxs("div",{className:"aspect-square rounded-2xl bg-gray-100 dark:bg-white/[0.03] overflow-hidden relative group cursor-pointer",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-gray-400",children:jsxRuntime.jsx(lucideReact.Image,{className:"h-6 w-6"})}),jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity"})]},n))})]}),jsxRuntime.jsx(Sr,{}),jsxRuntime.jsx("div",{className:"p-4 space-y-4",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-gray-700 dark:text-white/80",children:[jsxRuntime.jsx(lucideReact.Bell,{className:"h-5 w-5"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Mute Notifications"})]}),jsxRuntime.jsx(Eo,{})]})}),jsxRuntime.jsx(Sr,{}),jsxRuntime.jsxs("div",{className:"p-4 space-y-2",children:[jsxRuntime.jsxs("button",{className:"w-full flex items-center gap-3 p-3 rounded-2xl hover:bg-red-50 dark:hover:bg-red-500/10 text-red-600 dark:text-red-400 transition-colors text-sm font-medium",children:[jsxRuntime.jsx(lucideReact.Ban,{className:"h-5 w-5"}),"Block ",e.name]}),jsxRuntime.jsxs("button",{className:"w-full flex items-center gap-3 p-3 rounded-2xl hover:bg-red-50 dark:hover:bg-red-500/10 text-red-600 dark:text-red-400 transition-colors text-sm font-medium",children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-5 w-5"}),"Delete Chat"]})]})]})]})}function cP({users:e=[],variant:t="default",className:r,...o}){let n=e.length===0?"Someone is typing":e.length===1?`${e[0]} is typing`:e.length===2?`${e[0]} and ${e[1]} are typing`:`${e[0]} and ${e.length-1} others are typing`;return t==="bubble"?jsxRuntime.jsx("div",{className:l("flex items-center gap-1 px-3 py-2 rounded-2xl bg-gray-100 dark:bg-white/[0.03] w-fit",r),...o,children:jsxRuntime.jsxs("div",{className:"flex gap-1",children:[jsxRuntime.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 animate-bounce [animation-delay:-0.3s]"}),jsxRuntime.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 animate-bounce [animation-delay:-0.15s]"}),jsxRuntime.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 animate-bounce"})]})}):jsxRuntime.jsxs("div",{className:l("flex items-center gap-2 text-xs text-gray-500 dark:text-white/40 italic",r),...o,children:[jsxRuntime.jsxs("div",{className:"flex gap-0.5",children:[jsxRuntime.jsx("span",{className:"w-1 h-1 rounded-full bg-current animate-bounce [animation-delay:-0.3s]"}),jsxRuntime.jsx("span",{className:"w-1 h-1 rounded-full bg-current animate-bounce [animation-delay:-0.15s]"}),jsxRuntime.jsx("span",{className:"w-1 h-1 rounded-full bg-current animate-bounce"})]}),n]})}function fP({message:e,onCancel:t,className:r,...o}){return jsxRuntime.jsxs("div",{className:l("flex items-center gap-3 p-2 rounded-xl bg-blue-500/5 border-l-4 border-blue-500 animate-in slide-in-from-bottom-2",r),...o,children:[jsxRuntime.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/10 text-blue-500",children:jsxRuntime.jsx(lucideReact.Reply,{className:"h-4 w-4"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:"text-xs font-bold text-blue-500",children:"Replying to"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-white/60 truncate",children:e.content})]}),t&&jsxRuntime.jsx("button",{onClick:t,className:"p-1 rounded-full hover:bg-gray-200 dark:hover:bg-white/10 text-gray-400 transition-colors",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}function vP({type:e="info",message:t,action:r,onClose:o,className:n,...a}){let s={info:lucideReact.Info,warning:lucideReact.AlertCircle,error:lucideReact.AlertCircle,success:lucideReact.CheckCircle2},i={info:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",warning:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",error:"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20",success:"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20"},c=s[e];return jsxRuntime.jsxs("div",{className:l("flex items-center gap-3 px-4 py-2 border-b text-sm animate-in slide-in-from-top duration-300",i[e],n),...a,children:[jsxRuntime.jsx(c,{className:"h-4 w-4 shrink-0"}),jsxRuntime.jsx("p",{className:"flex-1 font-medium",children:t}),r&&jsxRuntime.jsx("button",{onClick:r.onClick,className:"text-xs font-bold uppercase tracking-wider hover:underline",children:r.label}),o&&jsxRuntime.jsx("button",{onClick:o,className:"p-1 rounded-full hover:bg-black/5 dark:hover:bg-white/5 transition-colors",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}function TP({date:e,className:t,...r}){return jsxRuntime.jsx("div",{className:l("flex justify-center sticky top-0 z-10 py-4",t),...r,children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-gray-100/80 dark:bg-white/5 backdrop-blur text-[10px] font-bold uppercase tracking-wider text-gray-500 dark:text-white/40 border border-gray-200 dark:border-white/10 shadow-sm",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-3 w-3"}),e]})})}function LP({status:e="offline",size:t="md",className:r,...o}){let n={online:"bg-green-500",offline:"bg-gray-400",away:"bg-amber-500",busy:"bg-red-500"},a={sm:"h-2 w-2",md:"h-3 w-3",lg:"h-4 w-4"};return jsxRuntime.jsx("span",{className:l("rounded-full border-2 border-white dark:border-black shrink-0",n[e],a[t],e==="online"&&"animate-pulse",r),...o})}function DP({content:e,className:t,...r}){return jsxRuntime.jsx("div",{className:l("flex justify-center py-2",t),...r,children:jsxRuntime.jsx("div",{className:"px-4 py-1 rounded-lg bg-gray-100/50 dark:bg-white/[0.02] text-[11px] font-medium text-gray-500 dark:text-white/30 border border-gray-200/50 dark:border-white/5",children:e})})}function zP({group:e,onBack:t,onInfo:r,isTyping:o,typingUsers:n=[],className:a,...s}){let i=n.length>0?`${n.join(", ")} ${n.length===1?"is":"are"} typing...`:"typing...";return jsxRuntime.jsxs("div",{className:l("flex h-16 items-center justify-between border-b border-gray-200 dark:border-white/10 bg-white/80 dark:bg-black/40 backdrop-blur px-4 sticky top-0 z-10",a),...s,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[t&&jsxRuntime.jsx("button",{onClick:t,className:"md:hidden p-2 -ml-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06]",children:jsxRuntime.jsx(lucideReact.ArrowLeft,{className:"h-5 w-5 text-gray-600 dark:text-white/70"})}),jsxRuntime.jsx("div",{className:"relative cursor-pointer",onClick:r,children:jsxRuntime.jsxs("div",{className:"flex -space-x-3",children:[e.members.slice(0,2).map((c,d)=>jsxRuntime.jsx(z,{src:c.avatar,alt:c.name,fallback:c.name[0],className:l("border-2 border-white dark:border-black",d===0?"z-10":"z-0")},c.id)),e.members.length>2&&jsxRuntime.jsxs("div",{className:"w-10 h-10 rounded-full bg-gray-200 dark:bg-white/10 border-2 border-white dark:border-black flex items-center justify-center text-[10px] font-bold text-gray-600 dark:text-white/60 z-0",children:["+",e.members.length-2]})]})}),jsxRuntime.jsxs("div",{className:"cursor-pointer min-w-0",onClick:r,children:[jsxRuntime.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white leading-none truncate",children:e.name}),jsxRuntime.jsx("p",{className:l("text-xs mt-1 truncate transition-colors",o?"text-blue-500 font-medium animate-pulse":"text-gray-500 dark:text-white/50"),children:o?i:`${e.members.length} members`})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.Phone,{className:"h-5 w-5"})}),jsxRuntime.jsx("button",{className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.Video,{className:"h-5 w-5"})}),jsxRuntime.jsx("button",{onClick:r,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsxRuntime.jsx(lucideReact.MoreVertical,{className:"h-5 w-5"})})]})]})}function YP({users:e,selectedIndex:t,onSelect:r,className:o,...n}){return e.length===0?null:jsxRuntime.jsx(ne,{className:l("w-64 overflow-hidden shadow-xl animate-in fade-in slide-in-from-bottom-2",o),...n,children:jsxRuntime.jsxs("div",{className:"p-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-wider text-gray-400 border-b border-gray-200 dark:border-white/5 mb-1",children:"Mention someone"}),e.map((a,s)=>jsxRuntime.jsxs("button",{onClick:()=>r(a),className:l("w-full flex items-center gap-2 p-2 rounded-xl text-left transition-colors",s===t?"bg-blue-500 text-white":"hover:bg-gray-100 dark:hover:bg-white/[0.06]"),children:[jsxRuntime.jsx(z,{src:a.avatar,alt:a.name,fallback:a.name[0],size:"sm"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium truncate",children:a.name}),a.status&&jsxRuntime.jsx("p",{className:l("text-[10px]",s===t?"text-white/70":"text-gray-500"),children:a.status})]})]},a.id))]})})}var q0=[{name:"Smileys",emojis:["\u{1F600}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F606}","\u{1F605}","\u{1F602}","\u{1F923}","\u{1F60A}","\u{1F607}","\u{1F642}","\u{1F643}","\u{1F609}","\u{1F60C}","\u{1F60D}","\u{1F970}","\u{1F618}","\u{1F617}","\u{1F619}","\u{1F61A}","\u{1F60B}","\u{1F61B}","\u{1F61D}","\u{1F61C}","\u{1F92A}","\u{1F928}","\u{1F9D0}","\u{1F913}","\u{1F60E}","\u{1F929}","\u{1F973}","\u{1F60F}","\u{1F612}","\u{1F61E}","\u{1F614}","\u{1F61F}","\u{1F615}","\u{1F641}","\u2639\uFE0F","\u{1F623}","\u{1F616}","\u{1F62B}","\u{1F629}","\u{1F97A}","\u{1F622}","\u{1F62D}","\u{1F624}","\u{1F620}","\u{1F621}","\u{1F92C}","\u{1F92F}","\u{1F633}","\u{1F975}","\u{1F976}","\u{1F631}","\u{1F628}","\u{1F630}","\u{1F625}","\u{1F613}","\u{1F917}","\u{1F914}","\u{1F92D}","\u{1F92B}","\u{1F925}","\u{1F636}","\u{1F610}","\u{1F611}","\u{1F62C}","\u{1F644}","\u{1F62F}","\u{1F626}","\u{1F627}","\u{1F62E}","\u{1F632}","\u{1F971}","\u{1F634}","\u{1F924}","\u{1F62A}","\u{1F635}","\u{1F910}","\u{1F974}","\u{1F922}","\u{1F92E}","\u{1F927}","\u{1F637}","\u{1F912}","\u{1F915}"]},{name:"Hearts",emojis:["\u2764\uFE0F","\u{1F9E1}","\u{1F49B}","\u{1F49A}","\u{1F499}","\u{1F49C}","\u{1F5A4}","\u{1F90D}","\u{1F90E}","\u{1F494}","\u2763\uFE0F","\u{1F495}","\u{1F49E}","\u{1F493}","\u{1F497}","\u{1F496}","\u{1F498}","\u{1F49D}","\u{1F49F}"]},{name:"Gestures",emojis:["\u{1F44D}","\u{1F44E}","\u{1F44C}","\u{1F90C}","\u{1F90F}","\u270C\uFE0F","\u{1F91E}","\u{1F91F}","\u{1F918}","\u{1F919}","\u{1F448}","\u{1F449}","\u{1F446}","\u{1F595}","\u{1F447}","\u261D\uFE0F","\u270A","\u{1F44A}","\u{1F91B}","\u{1F91C}","\u{1F44F}","\u{1F64C}","\u{1F450}","\u{1F932}","\u{1F91D}","\u{1F64F}","\u270D\uFE0F","\u{1F485}","\u{1F933}","\u{1F4AA}","\u{1F9BE}","\u{1F9B5}","\u{1F9BF}","\u{1F9B6}","\u{1F463}","\u{1F442}","\u{1F9BB}","\u{1F443}","\u{1F9E0}","\u{1FAC0}","\u{1FAC1}","\u{1F9B7}","\u{1F9B4}","\u{1F440}","\u{1F441}\uFE0F","\u{1F445}","\u{1F444}"]},{name:"Activities",emojis:["\u26BD","\u{1F3C0}","\u{1F3C8}","\u26BE","\u{1F94E}","\u{1F3BE}","\u{1F3D0}","\u{1F3C9}","\u{1F94F}","\u{1F3B1}","\u{1FA80}","\u{1F3D3}","\u{1F3F8}","\u{1F3D2}","\u{1F3D1}","\u{1F94D}","\u{1F3CF}","\u{1FA83}","\u{1F945}","\u26F3","\u{1FA81}","\u{1F3F9}","\u{1F3A3}","\u{1F93F}","\u{1F94A}","\u{1F94B}","\u{1F3BD}","\u{1F6F9}","\u{1F6FC}","\u{1F6F7}","\u26F8\uFE0F","\u{1F3BF}","\u26F7\uFE0F","\u{1F3C2}","\u{1FA82}","\u{1F3CB}\uFE0F","\u{1F93C}","\u{1F938}","\u26F9\uFE0F","\u{1F93A}","\u{1F93E}","\u{1F3CC}\uFE0F","\u{1F3C7}","\u{1F9D8}","\u{1F3C4}","\u{1F3CA}","\u{1F93D}","\u{1F6A3}","\u{1F9D7}","\u{1F6B5}","\u{1F6B4}"]},{name:"Nature",emojis:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\u{1F43B}\u200D\u2744\uFE0F","\u{1F428}","\u{1F42F}","\u{1F981}","\u{1F42E}","\u{1F437}","\u{1F43D}","\u{1F438}","\u{1F435}","\u{1F648}","\u{1F649}","\u{1F64A}","\u{1F412}","\u{1F414}","\u{1F427}","\u{1F426}","\u{1F424}","\u{1F423}","\u{1F425}","\u{1F986}","\u{1F985}","\u{1F989}","\u{1F987}","\u{1F43A}","\u{1F417}","\u{1F434}","\u{1F984}","\u{1F41D}","\u{1FAB1}","\u{1F41B}","\u{1F98B}","\u{1F40C}","\u{1F41E}","\u{1F41C}","\u{1F99F}","\u{1FAB0}","\u{1FAB2}","\u{1FAB3}","\u{1F997}","\u{1F577}\uFE0F","\u{1F578}\uFE0F","\u{1F982}","\u{1F422}","\u{1F40D}","\u{1F98E}","\u{1F996}","\u{1F995}","\u{1F419}","\u{1F991}","\u{1F990}","\u{1F99E}","\u{1F980}","\u{1F421}","\u{1F420}","\u{1F41F}","\u{1F42C}","\u{1F433}","\u{1F40B}","\u{1F988}","\u{1F40A}","\u{1F405}","\u{1F406}","\u{1F993}","\u{1F98D}","\u{1F9A7}","\u{1F9A3}","\u{1F418}","\u{1F99B}","\u{1F98F}","\u{1F42A}","\u{1F42B}","\u{1F992}","\u{1F998}","\u{1F9AC}","\u{1F403}","\u{1F402}","\u{1F404}","\u{1F40E}","\u{1F416}","\u{1F40F}","\u{1F411}","\u{1F410}","\u{1F98C}","\u{1F415}","\u{1F429}","\u{1F9AE}","\u{1F415}\u200D\u{1F9BA}","\u{1F408}","\u{1F408}\u200D\u2B1B","\u{1F413}","\u{1F983}","\u{1F99A}","\u{1F99C}","\u{1F9A2}","\u{1F9A9}","\u{1F54A}\uFE0F","\u{1F407}","\u{1F99D}","\u{1F9A8}","\u{1F9A1}","\u{1F9AB}","\u{1F9A6}","\u{1F9A5}","\u{1F401}","\u{1F400}","\u{1F43F}\uFE0F","\u{1F994}","\u{1F43E}","\u{1F409}","\u{1F432}","\u{1F335}","\u{1F384}","\u{1F332}","\u{1F333}","\u{1F334}","\u{1FAB5}","\u{1F331}","\u{1F33F}","\u2618\uFE0F","\u{1F340}","\u{1F38D}","\u{1FAB4}","\u{1F38B}","\u{1F343}","\u{1F342}","\u{1F341}","\u{1F344}","\u{1F41A}","\u{1FAA8}","\u{1F33E}","\u{1F490}","\u{1F337}","\u{1F339}","\u{1F940}","\u{1F33A}","\u{1F338}","\u{1F33C}","\u{1F33B}","\u{1F31E}","\u{1F31D}","\u{1F31B}","\u{1F31C}","\u{1F31A}","\u{1F315}","\u{1F316}","\u{1F317}","\u{1F318}","\u{1F311}","\u{1F312}","\u{1F313}","\u{1F314}","\u{1F319}","\u{1F30E}","\u{1F30D}","\u{1F30F}","\u{1FA90}","\u{1F4AB}","\u2B50\uFE0F","\u{1F31F}","\u2728","\u26A1\uFE0F","\u2604\uFE0F","\u{1F4A5}","\u{1F525}","\u{1F32A}\uFE0F","\u{1F308}","\u2600\uFE0F","\u{1F324}\uFE0F","\u26C5\uFE0F","\u{1F325}\uFE0F","\u2601\uFE0F","\u{1F326}\uFE0F","\u{1F327}\uFE0F","\u26C8\uFE0F","\u{1F329}\uFE0F","\u{1F328}\uFE0F","\u2744\uFE0F","\u2603\uFE0F","\u26C4\uFE0F","\u{1F32C}\uFE0F","\u{1F4A8}","\u{1F4A7}","\u{1F4A6}","\u2614\uFE0F","\u2602\uFE0F","\u{1F30A}","\u{1F32B}\uFE0F"]}];function ZP({onSelect:e,className:t,...r}){let[o,n]=we.useState(""),a=q0.map(s=>({...s,emojis:s.emojis.filter(i=>o===""||i.includes(o))})).filter(s=>s.emojis.length>0);return jsxRuntime.jsxs(ne,{className:l("w-72 h-96 flex flex-col overflow-hidden shadow-2xl",t),...r,children:[jsxRuntime.jsx("div",{className:"p-3 border-b border-gray-200 dark:border-white/10",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400"}),jsxRuntime.jsx("input",{type:"text",value:o,onChange:s=>n(s.target.value),placeholder:"Search emoji...",className:"w-full h-8 pl-8 pr-3 rounded-lg bg-gray-100 dark:bg-white/5 text-xs focus:outline-none focus:ring-2 focus:ring-blue-500/50 transition-all"})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-2 custom-scrollbar",children:a.map(s=>jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("h4",{className:"text-[10px] font-bold uppercase tracking-wider text-gray-400 px-2 mb-2",children:s.name}),jsxRuntime.jsx("div",{className:"grid grid-cols-8 gap-1",children:s.emojis.map(i=>jsxRuntime.jsx("button",{onClick:()=>e(i),className:"h-8 w-8 flex items-center justify-center rounded-lg hover:bg-gray-100 dark:hover:bg-white/10 text-lg transition-colors",children:i},i))})]},s.name))})]})}function lE({onSearch:e,results:t,onResultClick:r,onClose:o,className:n,...a}){let[s,i]=we.useState(""),c=d=>{let m=d.target.value;i(m),e(m);};return jsxRuntime.jsxs("div",{className:l("flex flex-col h-full bg-white dark:bg-gray-900 border-l border-gray-200 dark:border-white/10 animate-in slide-in-from-right duration-300",n),...a,children:[jsxRuntime.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("h3",{className:"font-bold text-gray-900 dark:text-white",children:"Search Messages"}),jsxRuntime.jsx("button",{onClick:o,className:"p-1 rounded-full hover:bg-gray-100 dark:hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.X,{className:"h-5 w-5 text-gray-500"})})]}),jsxRuntime.jsx("div",{className:"p-4",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:c,placeholder:"Search in conversation...",className:"w-full h-10 pl-10 pr-4 rounded-xl bg-gray-100 dark:bg-white/5 border-none text-sm focus:ring-2 focus:ring-blue-500/50 transition-all",autoFocus:true})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:s&&t.length===0?jsxRuntime.jsx("div",{className:"p-8 text-center text-gray-500 dark:text-white/30",children:jsxRuntime.jsxs("p",{className:"text-sm",children:['No messages found for "',s,'"']})}):jsxRuntime.jsx("div",{className:"space-y-1",children:t.map(d=>jsxRuntime.jsxs("button",{onClick:()=>r(d),className:"w-full p-3 rounded-xl hover:bg-gray-100 dark:hover:bg-white/5 text-left transition-all group",children:[jsxRuntime.jsxs("div",{className:"flex justify-between mb-1",children:[jsxRuntime.jsx("span",{className:"text-[10px] font-bold text-blue-500 uppercase",children:d.timestamp.toLocaleDateString()}),jsxRuntime.jsx("span",{className:"text-[10px] text-gray-400",children:d.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-white/70 line-clamp-2 group-hover:text-gray-900 dark:group-hover:text-white",children:d.content})]},d.id))})})]})}var Ba=class{constructor(){this.state={conversations:new Map,messages:new Map,activeChatId:null,presence:new Map};this.listeners=new Set;this.getState=()=>this.state;this.subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));}emitChange(t){this.state=t;for(let r of this.listeners)r();}setConversations(t){this.emitChange({...this.state,conversations:new Map(t.map(r=>[r.id,r]))});}upsertConversation(t){let r=new Map(this.state.conversations),o=r.get(t.id);r.set(t.id,{...o||{unreadCount:0},...t}),this.emitChange({...this.state,conversations:r});}setMessages(t,r){let o=new Map(this.state.messages);o.set(t,r),this.emitChange({...this.state,messages:o});}addMessage(t,r){let o=this.state.messages.get(t)||[];if(o.some(i=>i.id===r.id))return;let n=new Map(this.state.messages);n.set(t,[...o,r]);let a={...this.state,messages:n},s=this.state.conversations.get(t);if(s){let i=new Map(this.state.conversations);i.set(t,{...s,lastMessage:r,unreadCount:this.state.activeChatId===t?0:(s.unreadCount||0)+1}),a.conversations=i;}this.emitChange(a);}updateMessageStatus(t,r,o){let n=this.state.messages.get(t);if(!n)return;let a=n.findIndex(s=>s.id===r);if(a!==-1){let s=[...n],i=s[a];if(i){s[a]={...i,status:o};let c=new Map(this.state.messages);c.set(t,s),this.emitChange({...this.state,messages:c});}}}updateMessage(t,r,o){let n=this.state.messages.get(t);if(!n)return;let a=n.findIndex(s=>s.id===r);if(a!==-1){let s=[...n];s[a]={...s[a],...o};let i=new Map(this.state.messages);i.set(t,s),this.emitChange({...this.state,messages:i});}}addReaction(t,r,o,n){let a=this.state.messages.get(t);if(!a)return;let s=a.findIndex(i=>i.id===r);if(s!==-1){let i=[...a],c={...i[s]},d={...c.reactions||{}},m=[...d[o]||[]];if(!m.includes(n)){m.push(n),d[o]=m,c.reactions=d,i[s]=c;let u=new Map(this.state.messages);u.set(t,i),this.emitChange({...this.state,messages:u});}}}removeReaction(t,r,o,n){let a=this.state.messages.get(t);if(!a)return;let s=a.findIndex(i=>i.id===r);if(s!==-1){let i=[...a],c={...i[s]},d={...c.reactions||{}};if(d[o]){d[o]=d[o].filter(u=>u!==n),d[o].length===0&&delete d[o],c.reactions=d,i[s]=c;let m=new Map(this.state.messages);m.set(t,i),this.emitChange({...this.state,messages:m});}}}deleteMessage(t,r){let o=this.state.messages.get(t);if(!o)return;let n=o.findIndex(a=>a.id===r);if(n!==-1){let a=[...o];a[n]={...a[n],type:"revoked",content:"Esta mensagem foi apagada",attachments:[],reactions:{}};let s=new Map(this.state.messages);s.set(t,a),this.emitChange({...this.state,messages:s});}}setActiveChat(t){let r={...this.state,activeChatId:t};if(t){let o=this.state.conversations.get(t);if(o&&o.unreadCount>0){let n=new Map(this.state.conversations);n.set(t,{...o,unreadCount:0}),r.conversations=n;}}this.emitChange(r);}setUserPresence(t,r){let o=new Map(this.state.presence);o.set(t,r),this.emitChange({...this.state,presence:o});}},je=new Ba;function ko(e){let t=we.useSyncExternalStore(je.subscribe,je.getState);return we.useMemo(()=>e(t),[t,e])}var eg=e=>Array.from(e.conversations.values()).sort((t,r)=>{if(t.isPinned&&!r.isPinned)return -1;if(!t.isPinned&&r.isPinned)return 1;let o=t.lastMessage?.timestamp.getTime()||0;return (r.lastMessage?.timestamp.getTime()||0)-o});function uE(){return ko(eg)}function pE(e){let t=we.useCallback(r=>e?r.messages.get(e)||[]:[],[e]);return ko(t)}function fE(){let e=we.useCallback(t=>t.activeChatId?t.conversations.get(t.activeChatId):null,[]);return ko(e)}function gE(e){let t=we.useCallback(r=>r.presence.get(e)||"unavailable",[e]);return ko(t)}function Va({url:e,token:t,rooms:r=[],onConnect:o,onDisconnect:n,onError:a}){let s=we.useRef(null);we.useEffect(()=>{let d=socket_ioClient.io(e,{auth:{token:t},transports:["websocket"],reconnectionAttempts:5,reconnectionDelay:1e3});return s.current=d,d.on("connect",()=>{console.log("Socket connected:",d.id),r.forEach(m=>d.emit("join",m)),o?.();}),d.on("disconnect",m=>{console.log("Socket disconnected:",m),n?.();}),d.on("connect_error",m=>{console.error("Socket connection error:",m),a?.(m);}),()=>{d.disconnect();}},[e,t,r,o,n,a]);let i=we.useCallback((d,m)=>{s.current?.connected?s.current.emit(d,m):console.warn("Socket not connected. Event buffered or dropped:",d);},[]),c=we.useCallback((d,m)=>(s.current?.on(d,m),()=>{s.current?.off(d,m);}),[]);return {socket:s.current,emit:i,on:c,isConnected:s.current?.connected||false}}function TE(e,t){let{on:r,emit:o,isConnected:n}=Va({url:e,token:t});return we.useEffect(()=>{r("chats.set",a=>{je.setConversations(a);}),r("chats.upsert",a=>{a.forEach(s=>je.upsertConversation(s));}),r("chats.update",a=>{a.forEach(s=>{s.id&&je.upsertConversation(s);});}),r("messages.upsert",({chatId:a,messages:s})=>{s.forEach(i=>je.addMessage(a,i));}),r("messages.update",({chatId:a,messageId:s,status:i})=>{je.updateMessageStatus(a,s,i);}),r("presence.update",({userId:a,status:s})=>{je.setUserPresence(a,s);}),r("groups.update",a=>{a.forEach(s=>{je.upsertConversation({id:s.id,group:s});});});},[r]),{isConnected:n,emit:o}}function CE(e,t){let{emit:r}=Va({url:""});return {setPresence:n=>{r("presence.send",{chatId:e,userId:t,status:n});}}}function ME(){return {uploadMedia:async(t,r)=>({url:"...",thumbnail:"...",blurhash:"..."})}}function RE(e){return {search:r=>r?e.filter(o=>o.content.toLowerCase().includes(r.toLowerCase())):e}}function EE({itemCount:e,itemHeight:t,overscan:r=5,initialScrollTop:o=0,startAtBottom:n=false}){let[a,s]=we.useState(o),[i,c]=we.useState(0),d=we.useRef(null),m=we.useRef(false),u=we.useCallback(p=>typeof t=="function"?t(p):t,[t]);we.useLayoutEffect(()=>{if(d.current){let p=new ResizeObserver(b=>{for(let w of b)c(w.contentRect.height);});return p.observe(d.current),o>0&&(d.current.scrollTop=o),()=>p.disconnect()}},[o]);let f=we.useCallback(p=>{s(p.currentTarget.scrollTop);},[]),{visibleItems:g,totalHeight:x,startIndex:v}=we.useMemo(()=>{let p=0,b=[];for(let T=0;T<e;T++)b.push(p),p+=u(T);let w=0,y=0,N=e-1;for(;y<=N;){let T=Math.floor((y+N)/2),L=b[T];L!==void 0&&L<=a?(w=T,y=T+1):N=T-1;}w=Math.max(0,w-r);let C=[];for(let T=w;T<e;T++){let L=b[T];if(L===void 0||L>a+i+r*u(T))break;C.push({index:T,offsetTop:L,height:u(T)});}return {visibleItems:C,totalHeight:p,startIndex:w}},[a,i,e,u,r]);we.useLayoutEffect(()=>{if(n&&!m.current&&x>0&&d.current&&i>0){let p=d.current,b=x-i;b>0&&(p.scrollTop=b,s(b)),m.current=true;}},[x,i,n]);let h=we.useCallback((p,b="auto")=>{if(d.current){let w=0;for(let k=0;k<p;k++)w+=u(k);d.current.scrollTo({top:w,behavior:b});}},[u]);return {containerRef:d,visibleItems:g,totalHeight:x,startIndex:v,onScroll:f,scrollToIndex:h,scrollToBottom:(p="auto")=>{d.current&&d.current.scrollTo({top:d.current.scrollHeight,behavior:p});}}}function ui(){let[e,t]=we.useState({scrollX:0,scrollY:0,scrollProgressX:0,scrollProgressY:0}),r=we.useRef(false),o=we.useCallback(()=>{r.current||(window.requestAnimationFrame(()=>{let n=window.scrollX,a=window.scrollY,s=document.documentElement.scrollWidth-document.documentElement.clientWidth,i=document.documentElement.scrollHeight-document.documentElement.clientHeight;t({scrollX:n,scrollY:a,scrollProgressX:s>0?n/s:0,scrollProgressY:i>0?a/i:0}),r.current=false;}),r.current=true);},[]);return we.useEffect(()=>(window.addEventListener("scroll",o,{passive:true}),o(),()=>window.removeEventListener("scroll",o)),[o]),e}function BE({className:e,color:t="bg-blue-500",height:r=2,position:o="top",...n}){let{scrollProgressY:a}=ui();return jsxRuntime.jsx("div",{className:l("fixed left-0 right-0 z-[100] w-full pointer-events-none",o==="top"?"top-0":"bottom-0",e),style:{height:r},...n,children:jsxRuntime.jsx("div",{className:l("h-full transition-all duration-75 ease-out",t),style:{width:`${a*100}%`,boxShadow:a>0?`0 0 10px ${t.replace("bg-","var(--")}`:"none"}})})}var mg=we__namespace.default.forwardRef(({orientation:e="horizontal",className:t,...r},o)=>jsxRuntime.jsx("hr",{ref:o,className:l("border-0 bg-gray-200 dark:bg-white/10",{"h-px w-full":e==="horizontal","h-full w-px":e==="vertical"},t),...r}));mg.displayName="Divider";var fg=we__namespace.default.forwardRef(({children:e,className:t,...r},o)=>jsxRuntime.jsx("kbd",{ref:o,className:l("rounded-lg border border-gray-200 dark:border-white/10 bg-gray-100 dark:bg-white/[0.03] px-2 py-1 text-[11px] font-semibold text-gray-500 dark:text-white/65",t),...r,children:e}));fg.displayName="Kbd";var vg={theme:"system",setTheme:()=>null},gi=we.createContext(vg);function GE({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...o}){let[n,a]=we.useState(t);we.useEffect(()=>{let i=localStorage.getItem(r);i&&a(i);},[r]),we.useEffect(()=>{let i=window.document.documentElement;if(i.classList.remove("light","dark"),n==="system"){let c=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{i.classList.remove("light","dark"),i.classList.add(c.matches?"dark":"light");};return d(),c.addEventListener("change",d),()=>c.removeEventListener("change",d)}i.classList.add(n);},[n]);let s={theme:n,setTheme:i=>{localStorage.setItem(r,i),a(i);}};return jsxRuntime.jsx(gi.Provider,{...o,value:s,children:e})}var hi=()=>{let e=we.useContext(gi);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function rS({className:e}){let{setTheme:t,theme:r}=hi();return jsxRuntime.jsxs(R,{variant:"ghost",size:"icon",className:l("h-9 w-9",e),onClick:()=>t(r==="light"?"dark":"light"),children:[jsxRuntime.jsx(lucideReact.Sun,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),jsxRuntime.jsx(lucideReact.Moon,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function Mg(e,t=true){let[r,o]=we.useState({data:null,error:null,isLoading:false}),n=we.useCallback(async()=>{o({data:null,error:null,isLoading:true});try{let a=await e();return o({data:a,error:null,isLoading:!1}),a}catch(a){throw o({data:null,error:a,isLoading:false}),a}},[e]);return we.useEffect(()=>{t&&n();},[n,t]),{...r,execute:n}}function sS(e,t){let r=we.useCallback(()=>fetch(e,t).then(o=>o.json()),[e,t]);return Mg(r)}function cS({initialMessages:e=[],onSendMessage:t,scrollThreshold:r=100}={}){let[o,n]=we.useState(e),[a,s]=we.useState(false),[i,c]=we.useState(false),d=we.useRef(null),m=we.useRef(true),u=we.useCallback((v="smooth")=>{d.current&&d.current.scrollTo({top:d.current.scrollHeight,behavior:v});},[]),f=we.useCallback(()=>{if(d.current){let{scrollTop:v,scrollHeight:h,clientHeight:p}=d.current;m.current=h-v-p<r;}},[r]);we.useEffect(()=>{m.current&&u();},[o,u]);let g=we.useCallback(async(v,h)=>{if(!v.trim())return;let p=crypto.randomUUID(),b={id:p,content:v,senderId:h,timestamp:new Date,status:"sending"};n(w=>[...w,b]);try{t&&await t(v),n(w=>w.map(k=>k.id===p?{...k,status:"sent"}:k));}catch{n(k=>k.map(y=>y.id===p?{...y,status:"error"}:y));}},[t]),x=we.useCallback(()=>{n([]);},[]);return {messages:o,setMessages:n,sendMessage:g,clearMessages:x,isTyping:a,setIsTyping:s,isLoading:i,setIsLoading:c,scrollRef:d,handleScroll:f,scrollToBottom:u}}function pS(e=[]){let[t,r]=we.useState(e),o=we.useCallback(d=>{r(m=>[...m,d]);},[]),n=we.useCallback((d,m)=>{r(u=>u.map(f=>f.id===d?{...f,status:m}:f));},[]),a=we.useCallback(d=>{r(m=>m.filter(u=>u.id!==d));},[]),s=we.useCallback((d,m)=>{r(u=>u.map(f=>f.id===d?{...f,content:m,isEdited:true}:f));},[]),i=we.useCallback((d,m,u)=>{r(f=>f.map(g=>{if(g.id!==d)return g;let x={...g.reactions||{}},v=x[m]||[];return v.includes(u)?(x[m]=v.filter(h=>h!==u),x[m].length===0&&delete x[m]):x[m]=[...v,u],{...g,reactions:x}}));},[]),c=we.useCallback(()=>{r([]);},[]);return {messages:t,setMessages:r,addMessage:o,updateMessageStatus:n,deleteMessage:a,editMessage:s,addReaction:i,clearMessages:c}}function hS(e){let[t,r]=we.useState(""),o=we.useMemo(()=>{if(!t.trim())return [];let n=t.toLowerCase();return e.filter(a=>a.content.toLowerCase().includes(n))},[e,t]);return {query:t,setQuery:r,results:o}}function vS(e){let t=we.useRef(null);return we.useEffect(()=>{let r=o=>{let n=t.current;!n||n.contains(o?.target||null)||e(o);};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r);}},[e]),t}function kS({timeout:e=2e3}={}){let[t,r]=we.useState(false),[o,n]=we.useState(null);return {copy:we.useCallback(async s=>{if(!navigator?.clipboard){n(new Error("Clipboard API not supported"));return}try{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),e);}catch(i){n(i instanceof Error?i:new Error("Failed to copy"));}},[e]),copied:t,error:o}}function CS(e,t){let[r,o]=we.useState(e);return we.useEffect(()=>{let n=setTimeout(()=>{o(e);},t);return ()=>{clearTimeout(n);}},[e,t]),r}function LS(e){let[t,r]=we.useState(false),[o,n]=we.useState({x:0,y:0}),a=we.useRef({x:0,y:0}),s=we.useRef({x:0,y:0}),i=we.useRef(Date.now()),c=we.useRef({x:0,y:0}),d=we.useCallback((f,g)=>{r(true),a.current={x:f-o.x,y:g-o.y},s.current={x:f,y:g},i.current=Date.now();},[o]),m=we.useCallback((f,g)=>{if(!t)return;let x=f-a.current.x,v=g-a.current.y,h=Date.now(),p=h-i.current;p>0&&(c.current={x:(f-s.current.x)/p,y:(g-s.current.y)/p}),n({x,y:v}),s.current={x:f,y:g},i.current=h,e?.({isDragging:true,offset:{x,y:v},velocity:c.current});},[t,e]),u=we.useCallback(()=>{r(false),e?.({isDragging:false,offset:o,velocity:c.current});},[o,e]);return we.useEffect(()=>{let f=h=>m(h.clientX,h.clientY),g=h=>{h.touches[0]&&m(h.touches[0].clientX,h.touches[0].clientY);},x=()=>u(),v=()=>u();return t&&(window.addEventListener("mousemove",f),window.addEventListener("mouseup",x),window.addEventListener("touchmove",g),window.addEventListener("touchend",v)),()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",x),window.removeEventListener("touchmove",g),window.removeEventListener("touchend",v);}},[t,m,u]),{isDragging:t,offset:o,dragProps:{onMouseDown:f=>d(f.clientX,f.clientY),onTouchStart:f=>{f.touches[0]&&d(f.touches[0].clientX,f.touches[0].clientY);},style:{cursor:t?"grabbing":"grab",touchAction:"none"}}}}function SS(e){let[t,r]=we.useState({progress:0,scrollY:0,isIntersecting:false}),o=we.useRef(false);return we.useEffect(()=>{let n=e.current;if(!n)return;let a=()=>{o.current||(window.requestAnimationFrame(()=>{let s=n.getBoundingClientRect(),i=window.innerHeight,c=i+s.height,d=i-s.top,m=Math.max(0,Math.min(1,d/c));r({progress:m,scrollY:window.scrollY,isIntersecting:s.top<i&&s.bottom>0}),o.current=false;}),o.current=true);};return window.addEventListener("scroll",a,{passive:true}),window.addEventListener("resize",a),a(),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a);}},[e]),t}function IS(e,t){let r=we.useRef(null);return we.useLayoutEffect(()=>{let o=document.querySelector(`[data-flip-id="${e}"]`);if(!o)return;let n=r.current,a=o.getBoundingClientRect();if(n){let s=n.left-a.left,i=n.top-a.top,c=n.width/a.width,d=n.height/a.height;(Math.abs(s)>.5||Math.abs(i)>.5||Math.abs(c-1)>.01||Math.abs(d-1)>.01)&&o.animate([{transformOrigin:"top left",transform:`translate(${s}px, ${i}px) scale(${c}, ${d})`},{transformOrigin:"top left",transform:"none"}],{duration:400,easing:"cubic-bezier(0.2, 0.8, 0.2, 1)"});}r.current=a;},t),{"data-flip-id":e}}function OS({initialValues:e,onSubmit:t}){let[r,o]=we.useState(e),[n,a]=we.useState({}),[s,i]=we.useState(false),c=we.useCallback(u=>{let{name:f,value:g,type:x}=u.target,v=x==="checkbox"?u.target.checked:g;o(h=>({...h,[f]:v})),n[f]&&a(h=>({...h,[f]:""}));},[n]),d=we.useCallback(async u=>{u.preventDefault();let f=u.currentTarget;if(!f.checkValidity()){let g={};Array.from(f.elements).forEach(x=>{let v=x;v.name&&!v.validity.valid&&(g[v.name]=v.validationMessage);}),a(g);return}i(true);try{await t(r);}finally{i(false);}},[r,t]),m=we.useCallback(u=>({name:u,value:r[u],onChange:c,error:n[u]}),[r,n,c]);return {values:r,errors:n,isSubmitting:s,handleChange:c,handleSubmit:d,register:m,setValues:o,setErrors:a}}function $S(e){let[t,r]=we.useState({past:[],present:e,future:[]}),o=t.past.length>0,n=t.future.length>0,a=we.useCallback(()=>{o&&r(d=>{let m=d.past[d.past.length-1];return m===void 0?d:{past:d.past.slice(0,d.past.length-1),present:m,future:[d.present,...d.future]}});},[o]),s=we.useCallback(()=>{n&&r(d=>{let m=d.future[0];if(m===void 0)return d;let u=d.future.slice(1);return {past:[...d.past,d.present],present:m,future:u}});},[n]),i=we.useCallback(d=>{r(m=>{let u=typeof d=="function"?d(m.present):d;return m.present===u?m:{past:[...m.past,m.present],present:u,future:[]}});},[]),c=we.useCallback(()=>{r({past:[],present:e,future:[]});},[e]);return {state:t.present,set:i,undo:a,redo:s,clear:c,canUndo:o,canRedo:n,history:t}}function WS(e=3e3){let[t,r]=we.useState(false),o=we.useRef();return we.useEffect(()=>{let n=()=>{r(false),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(true);},e);},a=["mousemove","mousedown","keydown","touchstart","scroll"];return a.forEach(s=>{window.addEventListener(s,n);}),n(),()=>{a.forEach(s=>{window.removeEventListener(s,n);}),o.current&&clearTimeout(o.current);}},[e]),t}function XS({onLoadMore:e,isLoading:t,hasMore:r,threshold:o=100,root:n=null}){let a=we.useRef(null),s=we.useRef(null),i=we.useCallback(c=>{let d=c[0];d&&d.isIntersecting&&r&&!t&&e();},[r,t,e]);return we.useEffect(()=>{let c=s.current;if(c)return a.current=new IntersectionObserver(i,{root:n,rootMargin:`0px 0px ${o}px 0px`,threshold:.1}),a.current.observe(c),()=>{a.current&&a.current.disconnect();}},[i,n,o]),s}function QS(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:n=false}={}){let[a,s]=we.useState(),i=a?.isIntersecting&&n,c=([d])=>{s(d);};return we.useEffect(()=>{let d=e?.current;if(!!!window.IntersectionObserver||i||!d)return;let u={threshold:t,root:r,rootMargin:o},f=new IntersectionObserver(c,u);return f.observe(d),()=>f.disconnect()},[e,t,r,o,i]),a}function eD(e){let[t,r]=we.useState(e),o=we.useCallback((i,c,d,m)=>{r(u=>{let f=u.columns[c],g=u.columns[d],x=u.tasks[i];if(!f||!g||!x)return u;let v=Array.from(f.taskIds);v.splice(v.indexOf(i),1);let h={...f,taskIds:v},p=c===d?v:Array.from(g.taskIds);p.splice(m,0,i);let b={...g,taskIds:p};return {...u,columns:{...u.columns,[c]:h,[d]:b},tasks:{...u.tasks,[i]:{...x,columnId:d}}}});},[]),n=we.useCallback((i,c)=>{r(d=>{let m=Array.from(d.columnOrder);return m.splice(m.indexOf(i),1),m.splice(c,0,i),{...d,columnOrder:m}});},[]),a=we.useCallback((i,c)=>{r(d=>{let m=d.columns[i];if(!m)return d;let u={...m,taskIds:[...m.taskIds,c.id]};return {...d,tasks:{...d.tasks,[c.id]:c},columns:{...d.columns,[i]:u}}});},[]),s=we.useCallback(i=>{r(c=>{let d=c.tasks[i];if(!d)return c;let m=c.columns[d.columnId];if(!m)return c;let u={...c.tasks};delete u[i];let f={...m,taskIds:m.taskIds.filter(g=>g!==i)};return {...c,tasks:u,columns:{...c.columns,[d.columnId]:f}}});},[]);return {board:t,setBoard:r,moveTask:o,moveColumn:n,addTask:a,removeTask:s}}function oD(e){let t=we.useRef(e);t.current=e,we.useEffect(()=>{let r=o=>{let n=[];(o.ctrlKey||o.metaKey)&&n.push("mod"),o.shiftKey&&n.push("shift"),o.altKey&&n.push("alt");let s=o.key.toLowerCase();["control","meta","shift","alt"].includes(s)||n.push(s);let i=n.join("+"),c=t.current[i]||t.current[s];c&&c(o);};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]);}function sD(e){let t=we.useRef(false);we.useEffect(()=>{t.current||(t.current=true,e());},[]);}function iD(e){we.useEffect(()=>()=>{e();},[]);}function mD(e,t){let[r,o]=we.useState(()=>{if(typeof window>"u")return t;try{let a=window.localStorage.getItem(e);return a?JSON.parse(a):t}catch(a){return console.warn(`Error reading localStorage key "${e}":`,a),t}}),n=we.useCallback(a=>{try{let s=a instanceof Function?a(r):a;o(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s));}catch(s){console.warn(`Error setting localStorage key "${e}":`,s);}},[e,r]);return [r,n]}function fD(e){let[t,r]=we.useState({x:0,y:0,elementX:0,elementY:0,percentageX:0,percentageY:0}),o=we.useRef(),n=we.useRef({x:0,y:0});return we.useEffect(()=>{let a=i=>{n.current={x:i.clientX,y:i.clientY},o.current||(o.current=requestAnimationFrame(s));},s=()=>{let{x:i,y:c}=n.current,d=0,m=0,u=0,f=0;if(e?.current){let g=e.current.getBoundingClientRect();d=i-g.left,m=c-g.top,u=Math.max(0,Math.min(100,d/g.width*100)),f=Math.max(0,Math.min(100,m/g.height*100));}r({x:i,y:c,elementX:d,elementY:m,percentageX:u,percentageY:f}),o.current=void 0;};return window.addEventListener("mousemove",a),()=>{window.removeEventListener("mousemove",a),o.current&&cancelAnimationFrame(o.current);}},[e]),t}function bD(){let[e,t]=we.useState({alpha:null,beta:null,gamma:null,absolute:false});return we.useEffect(()=>{let r=o=>{t({alpha:o.alpha,beta:o.beta,gamma:o.gamma,absolute:o.absolute});};return typeof window<"u"&&"DeviceOrientationEvent"in window&&window.addEventListener("deviceorientation",r),()=>{window.removeEventListener("deviceorientation",r);}},[]),e}function wD(e){let t=we.useRef();return we.useEffect(()=>{t.current=e;},[e]),t.current}function ND(e){let t=we.useRef(null),r=we.useCallback((o,n,a)=>{!o||a||!t.current||(o.dataset.messageId=n,t.current.observe(o));},[]);return we.useEffect(()=>(t.current=new IntersectionObserver(o=>{o.forEach(n=>{if(n.isIntersecting){let a=n.target.dataset.messageId;a&&(e(a),t.current?.unobserve(n.target));}});},{threshold:.5}),()=>{t.current?.disconnect();}),[e]),{registerMessage:r}}function MD(){let[e,t]=we.useState(false);return we.useEffect(()=>{let r=window.matchMedia("(prefers-reduced-motion: reduce)");t(r.matches);let o=n=>{t(n.matches);};return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),e}var gh={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function hh(e){let[t,r]=we.useState(false);return we.useEffect(()=>{let o=window.matchMedia(e);r(o.matches);let n=()=>r(o.matches);return o.addEventListener("change",n),()=>o.removeEventListener("change",n)},[e]),t}function PD(e){return hh(`(min-width: ${gh[e]}px)`)}function ED(e){let[t,r]=we.useState({width:0,height:0});return we.useLayoutEffect(()=>{if(!e.current)return;let o=new ResizeObserver(n=>{for(let a of n)r({width:a.contentRect.width,height:a.contentRect.height});});return o.observe(e.current),()=>o.disconnect()},[e]),t}function HD(e=10){let[t,r]=we.useState(null),o=we.useRef(0);return we.useEffect(()=>{let n=()=>{let s=window.scrollY;if(Math.abs(s-o.current)<e)return;let i=s>o.current?"down":"up";i!==t&&(s>0||i==="down")&&r(i),o.current=s>0?s:0;},a=()=>{window.requestAnimationFrame(n);};return window.addEventListener("scroll",a),()=>window.removeEventListener("scroll",a)},[t,e]),t}function BD(e=true){we.useLayoutEffect(()=>{if(!e)return;let t=window.getComputedStyle(document.body).overflow,r=window.getComputedStyle(document.body).paddingRight,o=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",o>0&&(document.body.style.paddingRight=`${parseFloat(r)+o}px`),()=>{document.body.style.overflow=t,document.body.style.paddingRight=r;}},[e]);}function yh(e,t,r){let[o,n]=t,[a,s]=r,i=(e-o)/(n-o),c=Math.max(0,Math.min(1,i));return a+c*(s-a)}function VD(e,t,r){return yh(e,t,r)}function $D(){let[e,t]=we.useState(0),r=we.useRef(0),o=we.useRef(Date.now()),n=we.useRef();return we.useEffect(()=>{let a=()=>{let i=window.scrollY,c=Date.now(),d=c-o.current;if(d>0){let u=(i-r.current)/d;t(u);}r.current=i,o.current=c,n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(s);},s=()=>{t(i=>Math.abs(i)<.01?0:i*.9),n.current=requestAnimationFrame(s);};return window.addEventListener("scroll",a,{passive:true}),()=>{window.removeEventListener("scroll",a),n.current&&cancelAnimationFrame(n.current);}},[]),e}function Ch(e,t){let r=e.toLowerCase().replace(/\s/g,""),o=t.toLowerCase(),n=0;for(let a=0;a<o.length&&n<r.length;a++)o[a]===r[n]&&n++;return n===r.length}function WD(e,t,r){return we.useMemo(()=>t.trim()?e.filter(o=>r.some(n=>{let a=o[n];return a==null?false:Ch(t,String(a))})):e,[e,t,r])}function XD(e,t){let r=we.useCallback(()=>{if(typeof window>"u")return t;try{let s=window.sessionStorage.getItem(e);return s?JSON.parse(s):t}catch(s){return console.warn(`Error reading sessionStorage key "${e}":`,s),t}},[t,e]),[o,n]=we.useState(r),a=we.useCallback(s=>{try{let i=s instanceof Function?s(o):s;n(i),typeof window<"u"&&window.sessionStorage.setItem(e,JSON.stringify(i));}catch(i){console.warn(`Error setting sessionStorage key "${e}":`,i);}},[e,o]);return we.useEffect(()=>{n(r());},[r]),[o,a]}function jD(e,t={}){let{stiffness:r=.15,damping:o=.8,mass:n=1,precision:a=.01}=t,[s,i]=we.useState(e),c=we.useRef(0),d=we.useRef(e),m=we.useRef();return we.useEffect(()=>{let u=()=>{let f=e-d.current,x=f*r/n;if(c.current=(c.current+x)*o,d.current+=c.current,Math.abs(f)<a&&Math.abs(c.current)<a){d.current=e,i(e),m.current=void 0;return}i(d.current),m.current=requestAnimationFrame(u);};return m.current&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(u),()=>{m.current&&cancelAnimationFrame(m.current);}},[e,r,o,n,a]),s}function JD(e,t=100,r=0){return r+e*t}function ZD(e,t=100){return Array.from({length:e},(r,o)=>o*t)}var Mi="01XYZ#%&@$+-/<>!_";function rH(e,t=800,r=true){let[o,n]=we.useState(e),a=we.useRef();return we.useEffect(()=>{if(!r){n(e);return}let s=Date.now(),i=()=>{let c=Date.now()-s,d=Math.min(c/t,1),m=e.split("").map((u,f)=>u===" "?" ":d>f/e.length?u:Mi[Math.floor(Math.random()*Mi.length)]).join("");n(m),d<1&&(a.current=requestAnimationFrame(i));};return a.current=requestAnimationFrame(i),()=>{a.current&&cancelAnimationFrame(a.current);}},[e,t,r]),o}function nH(e,t){let[r,o]=we.useState(e),n=we.useRef(Date.now());return we.useEffect(()=>{let a=setTimeout(()=>{Date.now()-n.current>=t&&(o(e),n.current=Date.now());},t-(Date.now()-n.current));return ()=>{clearTimeout(a);}},[e,t]),r}function lH(e=0){let[t,r]=we.useState(e),[o,n]=we.useState(false),a=we.useRef(null),s=we.useCallback(()=>{o||(n(true),a.current=setInterval(()=>{r(m=>m+1);},1e3));},[o]),i=we.useCallback(()=>{o&&a.current&&(clearInterval(a.current),n(false));},[o]),c=we.useCallback(()=>{a.current&&clearInterval(a.current),n(false),r(0);},[]);return we.useEffect(()=>()=>{a.current&&clearInterval(a.current);},[]),{seconds:t,isActive:o,start:s,pause:i,reset:c,formattedTime:(m=>{let u=Math.floor(m/3600),f=Math.floor(m%3600/60),g=m%60;return [u,f,g].map(x=>x<10?"0"+x:x).filter((x,v)=>x!=="00"||v>0).join(":")})(t)}}function uH(){let e=we.useContext(Ko);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function gH(e=false){let[t,r]=we.useState(e),o=we.useCallback(()=>{r(n=>!n);},[]);return [t,o,r]}function xH(e=3e3){let[t,r]=we.useState(false),o=we.useRef(null),n=we.useCallback(a=>{r(a),o.current&&clearTimeout(o.current),a&&(o.current=window.setTimeout(()=>{r(false);},e));},[e]);return we.useEffect(()=>()=>{o.current&&clearTimeout(o.current);},[]),{isTyping:t,setTyping:n}}function yH(){return {startTransition:t=>{if(!document.startViewTransition){t();return}document.startViewTransition(()=>{reactDom.flushSync(()=>{t();});});}}}function NH(e,t={month:"short",day:"numeric",year:"numeric"}){let r=new Date(e);return new Intl.DateTimeFormat("en-US",t).format(r)}function TH(e){return new Intl.NumberFormat("en-US").format(e)}function CH(e,t="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e)}function RH(e,t){return e.length<=t?e:e.slice(0,t)+"..."}function LH(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}
70
70
  exports.AIPromptInput=af;exports.AIResponse=bf;exports.Accordion=gk;exports.AccordionContent=xk;exports.AccordionItem=hk;exports.AccordionTrigger=bk;exports.Alert=Yc;exports.AreaChart=dC;exports.AssigneePicker=ns;exports.AudioPlayer=Ws;exports.Avatar=z;exports.Background=Up;exports.Badge=ze;exports.BarChart=nC;exports.Breadcrumb=lp;exports.BreadcrumbEllipsis=fp;exports.BreadcrumbItem=dp;exports.BreadcrumbLink=mp;exports.BreadcrumbList=cp;exports.BreadcrumbPage=up;exports.BreadcrumbSeparator=pp;exports.Button=R;exports.Calendar=jr;exports.Card=ji;exports.CardContent=el;exports.CardDescription=Zi;exports.CardFooter=tl;exports.CardHeader=Qi;exports.CardTitle=Ji;exports.CarouselMessage=Gs;exports.ChartContainer=j5;exports.ChartGrid=Q5;exports.ChartSkeleton=eC;exports.ChartTooltip=Z5;exports.ChartXAxis=J5;exports.ChartYAxis=AC;exports.ChatBanner=vP;exports.ChatHeader=P4;exports.ChatInput=qL;exports.ChatLayout=f4;exports.ChatProfile=nP;exports.ChatSidebar=N4;exports.Checkbox=Po;exports.Checklist=ts;exports.Collapse=Y5;exports.ColorPicker=Qv;exports.ColumnLimit=Fn;exports.Combobox=Io;exports.ComboboxContent=zx;exports.ComboboxEmpty=hn;exports.ComboboxInput=fn;exports.ComboboxItem=bn;exports.ComboboxList=gn;exports.ComboboxTrigger=Vx;exports.Command=Xn;exports.CommandDialog=n1;exports.CommandEmpty=s1;exports.CommandGroup=jn;exports.CommandInput=qn;exports.CommandItem=Qn;exports.CommandList=Gn;exports.CommandShortcut=i1;exports.ConfirmDialog=qM;exports.Container=Ap;exports.DataTable=Hk;exports.DatePicker=sv;exports.DateSeparator=TP;exports.DateTimePicker=wv;exports.Dialog=tR;exports.DialogDescription=nR;exports.DialogFooter=oR;exports.DialogHeader=rR;exports.DialogTitle=aR;exports.Divider=mg;exports.Drawer=fR;exports.DrawerDescription=xR;exports.DrawerFooter=hR;exports.DrawerHeader=gR;exports.DrawerTitle=bR;exports.DropdownMenu=at;exports.DropdownMenuContent=st;exports.DropdownMenuItem=K;exports.DropdownMenuLabel=Bs;exports.DropdownMenuSeparator=xa;exports.DropdownMenuTrigger=nt;exports.DueDatePicker=is;exports.EmojiPicker=ZP;exports.EmptyState=jc;exports.FileDropzone=vc;exports.FormControl=mc;exports.FormDescription=uc;exports.FormItem=cc;exports.FormLabel=dc;exports.FormMessage=pc;exports.GlowButton=zi;exports.Grid=$p;exports.GroupHeader=zP;exports.Heading=Je;exports.HeroText=gl;exports.Image=qo;exports.InteractiveMessage=qs;exports.Kanban=vu;exports.KanbanBoard=vu;exports.KanbanCalendarView=_n;exports.KanbanCard=Qo;exports.KanbanColumn=Jo;exports.KanbanFilterBar=Zn;exports.KanbanHeader=Kn;exports.KanbanListView=ro;exports.KanbanQuickAdd=TT;exports.KanbanSwimlane=ms;exports.KanbanTableView=Yn;exports.KanbanTaskModal=ds;exports.KanbanTimelineView=Wn;exports.Kbd=fg;exports.Label=X;exports.LabelPicker=as;exports.LetterPullup=hl;exports.LineChart=gC;exports.LinkPreview=Xs;exports.Magnetic=Ky;exports.Marquee=M5;exports.MentionList=YP;exports.MessageBubble=Js;exports.MessageList=CL;exports.MessageSearch=lE;exports.MetricCard=Yi;exports.Modal=oo;exports.ModalDescription=S1;exports.ModalFooter=no;exports.ModalHeader=ao;exports.ModalTitle=es;exports.Motion=Hn;exports.MotionGroup=ky;exports.Navbar=lM;exports.NumberInput=Dc;exports.NumberTicker=Xy;exports.OTPInput=Mc;exports.OnlineIndicator=LP;exports.PageLoader=Jy;exports.PageTransition=ak;exports.Pagination=hp;exports.PaginationContent=bp;exports.PaginationEllipsis=yp;exports.PaginationItem=xp;exports.PaginationLink=va;exports.PaginationNext=wp;exports.PaginationPrevious=vp;exports.Parallax=Hy;exports.PasswordInput=Jl;exports.PieChart=kC;exports.Popover=Ze;exports.PopoverContent=tt;exports.PopoverTrigger=et;exports.PrimaryButton=Hi;exports.Progress=Xc;exports.RadarChart=RC;exports.RadioGroup=ic;exports.RadioGroupItem=lc;exports.Rating=rd;exports.ReadReceipt=_s;exports.ReplyPreview=fP;exports.Reveal=en;exports.ScrollArea=it;exports.ScrollProgress=BE;exports.Select=Yr;exports.Separator=Sr;exports.ShinyText=dl;exports.Sidebar=GC;exports.SidebarContent=QC;exports.SidebarFooter=JC;exports.SidebarGroup=eM;exports.SidebarHeader=jC;exports.SidebarItem=ZC;exports.Skeleton=Sn;exports.SkipToContent=SM;exports.Slider=Yx;exports.Sparkline=SC;exports.Spotlight=jR;exports.Stack=Vp;exports.StatusDot=Hu;exports.Stepper=KM;exports.SubtaskList=BT;exports.Surface=ne;exports.Switch=Eo;exports.SystemMessage=DP;exports.Table=wr;exports.TableBody=kr;exports.TableCell=We;exports.TableHead=rt;exports.TableHeader=yr;exports.TableRow=dt;exports.Tabs=$C;exports.TabsContent=WC;exports.TabsList=FC;exports.TabsTrigger=UC;exports.TagInput=_v;exports.TaskActivity=$T;exports.TaskAttachments=os;exports.TaskComments=rs;exports.Terminal=Lu;exports.TerminalLine=k5;exports.Text=ve;exports.TextGradient=il;exports.TextInput=kt;exports.TextMotion=Ry;exports.Textarea=hr;exports.ThemeProvider=GE;exports.ThemeToggle=rS;exports.TimeTracker=cs;exports.Timeline=Qk;exports.TimelineItem=Ud;exports.Toast=Pn;exports.ToastContext=Ko;exports.ToastProvider=Fw;exports.ToggleGroup=Oc;exports.Tooltip=MR;exports.Tree=aN;exports.TypingIndicator=cP;exports.UserMenu=NM;exports.UserPreview=zd;exports.VoiceRecorder=ti;exports.chatStore=je;exports.cn=l;exports.formatCurrency=CH;exports.formatDate=NH;exports.formatNumber=TH;exports.normalize=Qt;exports.slugify=LH;exports.truncate=RH;exports.useActiveChat=fE;exports.useAsync=Mg;exports.useBaileysSync=TE;exports.useBreakpoint=PD;exports.useChart=Me;exports.useChat=cS;exports.useChatMedia=ME;exports.useChatMessages=pS;exports.useChatPresence=CE;exports.useChatSearch=hS;exports.useChatSearchWorker=RE;exports.useChatStore=ko;exports.useClickOutside=vS;exports.useClipboard=kS;exports.useContainerQuery=ED;exports.useConversations=uE;exports.useDebounce=CS;exports.useDrag=LS;exports.useElementScroll=SS;exports.useFetch=sS;exports.useFlip=IS;exports.useFloating=Kt;exports.useForm=OS;exports.useHistory=$S;exports.useIdle=WS;exports.useInView=Fe;exports.useInfiniteScroll=XS;exports.useIntersection=QS;exports.useKanban=eD;exports.useKanbanFilters=fs;exports.useKanbanHistory=DT;exports.useKanbanKeyboard=hs;exports.useKanbanSync=PT;exports.useKanbanUndo=gs;exports.useKeyboardShortcuts=oD;exports.useLocalStorage=mD;exports.useMediaQuery=hh;exports.useMessages=pE;exports.useMousePosition=fD;exports.useOnMount=sD;exports.useOnUnmount=iD;exports.useOrientation=bD;exports.usePrevious=wD;exports.useReadReceipts=ND;exports.useReducedMotion=MD;exports.useScroll=ui;exports.useScrollDirection=HD;exports.useScrollLock=BD;exports.useScrollTransform=VD;exports.useScrollVelocity=$D;exports.useSearch=WD;exports.useSequence=ZD;exports.useSessionStorage=XD;exports.useSocket=Va;exports.useSpring=jD;exports.useStagger=JD;exports.useTextScramble=rH;exports.useTheme=hi;exports.useThrottle=nH;exports.useTimer=lH;exports.useToast=uH;exports.useToggle=gH;exports.useTypingIndicator=xH;exports.useUserPresence=gE;exports.useViewTransition=yH;exports.useVirtualList=EE;exports.useVoiceRecorder=ei;//# sourceMappingURL=index.js.map
71
71
  //# sourceMappingURL=index.js.map