- Rebuild AIUI with latest changes (haiku model fix, recipe panel, image fallbacks) - Add /api/tmdb/* stub returning empty results - Add /api/* catch-all returning JSON 404 (prevents HTML fallback errors) - Improve Claude proxy error messages (include err.code fallback) - Strip film images from dist to keep under 5MB Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
259 lines
200 KiB
JavaScript
259 lines
200 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/useNostr-DMx0ZF7J.js","assets/index-iNX5cLRF.js","assets/index-BNvE9-tw.css","assets/ThreadNode-uZHjueqh.js"])))=>i.map(i=>d[i]);
|
||
import{a as G,Z as qt,$ as rt,p as Ne,b as s,c as n,e,h as q,u as t,n as i,t as u,f as ie,w as W,v as J,F as I,g as P,i as f,j as Z,r as S,k as B,a0 as Gt,a1 as ct,N as ne,a2 as dt,a3 as ut,a4 as ht,a5 as xt,U as De,a6 as Ot,a7 as Ht,a8 as Wt,P as Kt,z as xe,Q as U,K as le,a9 as ae,aa as ye,_ as pt,A as ce,B as Pe,d as Yt,ab as Qt,L as se,ac as Jt,ad as Zt,ae as Xt,S as es,q as ts,af as ss,o as ns,M as ue,ag as Le,ah as ls}from"./index-iNX5cLRF.js";import{u as os}from"./chat-DURlEZti.js";import{u as $e,a as pe,e as He,d as gt,M as as,b as is,s as rs,c as cs,f as fe,_ as tt}from"./ChatWindow.vue_vue_type_script_setup_true_lang-D6Di9NNl.js";import{_ as ds}from"./FilmGrid.vue_vue_type_script_setup_true_lang-BCGlNgEL.js";import{u as Ae}from"./useContentImages-8oyMy70s.js";import{_ as us}from"./SongGrid.vue_vue_type_script_setup_true_lang-Cpvl53RE.js";import{useNostr as Ie}from"./useNostr-DMx0ZF7J.js";import{u as bt,_ as hs}from"./FilmDetail.vue_vue_type_script_setup_true_lang-C2prgMoU.js";import{_ as xs}from"./SongDetail.vue_vue_type_script_setup_true_lang-BbGQlf9S.js";const ps={class:"h-full flex flex-col"},gs={class:"flex items-center justify-between gap-2"},bs={class:"flex items-center gap-2 shrink-0"},vs={key:0,class:"flex flex-wrap gap-1.5"},fs=["onClick"],ms={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},ws={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},ys=["aria-label","onClick"],ks={class:"cover-card flex-1 min-h-0 relative"},$s={key:0,class:"absolute inset-0 animate-shimmer"},_s=["src","alt","onError"],Cs=["src","alt"],js={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},Ss={class:"absolute bottom-0 left-0 right-0 p-2"},Ms={class:"text-xs font-semibold text-white/90 leading-tight truncate"},Ts={class:"text-xs text-white/40 truncate mt-0.5"},Ds={key:4,class:"absolute top-1.5 left-1.5"},Is={class:"text-xs px-1.5 py-0.5 rounded bg-black/60 text-amber-400 backdrop-blur-sm font-medium"},Bs={key:5,class:"absolute top-1.5 right-1.5"},Ls={class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},Ps={key:0,class:"flex items-center justify-center py-12"},Ns=G({__name:"BookGrid",props:{books:{},title:{default:"Recommended Books"}},emits:["selectBook"],setup(a){const c=a,{isDark:l}=Z(),w=S(""),g=S(null),{coverSrc:v,fallbackSrc:x,onError:m,isLoading:$}=Ae({items:Ne(c,"books"),id:d=>d.id,existingUrl:d=>d.coverUrl,fetch:d=>rt(d.title,d.author),fallback:d=>qt(d.title,d.author)}),_=B(()=>{const d=new Map;for(const o of c.books)for(const r of o.genres??[])d.set(r,(d.get(r)??0)+1);return[...d.entries()].sort((o,r)=>r[1]-o[1]).slice(0,8).map(([o])=>o)}),b=B(()=>{let d=c.books;if(w.value){const o=w.value.toLowerCase();d=d.filter(r=>r.title.toLowerCase().includes(o)||r.author.toLowerCase().includes(o)||(r.genres??[]).some(h=>h.toLowerCase().includes(o)))}return g.value&&(d=d.filter(o=>(o.genres??[]).includes(g.value))),d});return(d,o)=>(s(),n("div",ps,[e("div",{class:"p-4 space-y-3",style:q(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",gs,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title),3),e("div",bs,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(b.value.length)+" books ",3),ie(d.$slots,"header-actions")])]),W(e("input",{"onUpdate:modelValue":o[0]||(o[0]=r=>w.value=r),type:"text",placeholder:"Search books...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,2),[[J,w.value]]),_.value.length>0?(s(),n("div",vs,[(s(!0),n(I,null,P(_.value,r=>(s(),n("button",{key:r,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",g.value===r?"nav-tab-active":t(l)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:h=>g.value=g.value===r?null:r},u(r),11,fs))),128))])):f("",!0)],4),e("div",ms,[e("div",ws,[(s(!0),n(I,null,P(b.value,r=>(s(),n("button",{key:r.id,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":`${r.title} by ${r.author}`,onClick:h=>d.$emit("selectBook",r)},[e("div",ks,[e("div",{class:i(["aspect-[2/3] relative w-full overflow-hidden rounded-[10px]",t(v)(r)?"":t(l)?"bg-white/[0.06]":"bg-black/[0.04]"])},[t($)(r)?(s(),n("div",$s)):f("",!0),t(v)(r)?(s(),n("img",{key:1,src:t(v)(r),alt:`${r.title} by ${r.author}`,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:h=>t(m)(r)},null,40,_s)):t($)(r)?f("",!0):(s(),n("img",{key:2,src:t(x)(r),alt:r.title,class:"w-full h-full object-cover"},null,8,Cs)),t(v)(r)?(s(),n("div",js)):f("",!0),e("div",Ss,[e("p",Ms,u(r.title),1),e("p",Ts,u(r.author),1)]),r.rating?(s(),n("div",Ds,[e("span",Is," ★ "+u(r.rating.toFixed(1)),1)])):f("",!0),r.year?(s(),n("div",Bs,[e("span",Ls,u(r.year),1)])):f("",!0)],2)])],8,ys))),128))]),b.value.length===0?(s(),n("div",Ps,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No books match your search ",2)])):f("",!0)])]))}}),As={class:"h-full flex flex-col"},zs={class:"flex items-center justify-between gap-2"},Es={class:"flex items-center gap-2 shrink-0"},Fs={key:0,class:"flex flex-wrap gap-1.5"},Rs=["onClick"],Vs={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},Us={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},qs=["aria-label","onClick"],Gs={class:"cover-card flex-1 min-h-0 relative"},Os={key:0,class:"absolute inset-0 animate-shimmer"},Hs=["src","alt","onError"],Ws=["src","alt"],Ks={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},Ys={class:"absolute bottom-0 left-0 right-0 p-2"},Qs={class:"text-xs font-semibold text-white/90 leading-tight truncate"},Js={class:"text-xs text-white/40 truncate mt-0.5"},Zs={key:4,class:"absolute top-1.5 left-1.5"},Xs={class:"text-xs px-1.5 py-0.5 rounded bg-black/60 text-amber-400 backdrop-blur-sm font-medium"},en={key:5,class:"absolute top-1.5 right-1.5"},tn={class:"absolute top-1.5 right-1.5 flex gap-0.5 flex-wrap justify-end max-w-[60%]"},sn={key:0,class:"flex items-center justify-center py-12"},nn=G({__name:"TVSeriesGrid",props:{series:{},title:{default:"Recommended TV Series"}},emits:["selectSeries"],setup(a){const c=a,{isDark:l}=Z(),w=S(""),g=S(null),{coverSrc:v,fallbackSrc:x,onError:m,isLoading:$}=Ae({items:Ne(c,"series"),id:o=>o.id,existingUrl:o=>o.posterUrl||o.backdropUrl,fetch:o=>ct(o.title,o.year).then(r=>r.posterUrl),fallback:o=>Gt(o.title,o.year)});function _(o){return o.year?o.endYear&&o.endYear!==o.year?`${o.year}–${o.endYear}`:o.status==="ongoing"?`${o.year}–`:String(o.year):""}const b=B(()=>{const o=new Map;for(const r of c.series)for(const h of r.genres??[])o.set(h,(o.get(h)??0)+1);return[...o.entries()].sort((r,h)=>h[1]-r[1]).slice(0,8).map(([r])=>r)}),d=B(()=>{let o=c.series;if(w.value){const r=w.value.toLowerCase();o=o.filter(h=>h.title.toLowerCase().includes(r)||(h.creator??"").toLowerCase().includes(r)||(h.network??"").toLowerCase().includes(r)||(h.genres??[]).some(M=>M.toLowerCase().includes(r)))}return g.value&&(o=o.filter(r=>(r.genres??[]).includes(g.value))),o});return(o,r)=>(s(),n("div",As,[e("div",{class:"p-4 space-y-3",style:q(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",zs,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title),3),e("div",Es,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(d.value.length)+" series ",3),ie(o.$slots,"header-actions")])]),W(e("input",{"onUpdate:modelValue":r[0]||(r[0]=h=>w.value=h),type:"text",placeholder:"Search TV series...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,2),[[J,w.value]]),b.value.length>0?(s(),n("div",Fs,[(s(!0),n(I,null,P(b.value,h=>(s(),n("button",{key:h,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",g.value===h?"nav-tab-active":t(l)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:M=>g.value=g.value===h?null:h},u(h),11,Rs))),128))])):f("",!0)],4),e("div",Vs,[e("div",Us,[(s(!0),n(I,null,P(d.value,h=>(s(),n("button",{key:h.id,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":h.title,onClick:M=>o.$emit("selectSeries",h)},[e("div",Gs,[e("div",{class:i(["aspect-[2/3] relative w-full overflow-hidden rounded-[10px]",t(v)(h)?"":t(l)?"bg-white/[0.06]":"bg-black/[0.04]"])},[t($)(h)?(s(),n("div",Os)):f("",!0),t(v)(h)?(s(),n("img",{key:1,src:t(v)(h),alt:`${h.title} — TV Series`,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:M=>t(m)(h)},null,40,Hs)):t($)(h)?f("",!0):(s(),n("img",{key:2,src:t(x)(h),alt:h.title,class:"w-full h-full object-cover"},null,8,Ws)),t(v)(h)?(s(),n("div",Ks)):f("",!0),e("div",Ys,[e("p",Qs,u(h.title),1),e("p",Js,[ne(u(_(h)),1),h.seasons?(s(),n(I,{key:0},[ne(" · "+u(h.seasons)+"S",1)],64)):f("",!0)])]),h.rating?(s(),n("div",Zs,[e("span",Xs," ★ "+u(h.rating.toFixed(1)),1)])):f("",!0),h.status==="ongoing"?(s(),n("div",en,[...r[1]||(r[1]=[e("span",{class:"text-xs px-1 py-0.5 rounded bg-emerald-500/80 text-white backdrop-blur-sm"}," ongoing ",-1)])])):f("",!0),e("div",tn,[(s(!0),n(I,null,P((h.sources??[]).slice(0,2),M=>(s(),n("span",{key:M.type,class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},u(M.type),1))),128))])],2)])],8,qs))),128))]),d.value.length===0?(s(),n("div",sn,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No TV series match your search ",2)])):f("",!0)])]))}}),ln={class:"h-full flex flex-col"},on={class:"flex items-center justify-between gap-2"},an={class:"flex items-center gap-2 shrink-0"},rn={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},cn={class:"columns-2 sm:columns-3 gap-3 space-y-3"},dn=["aria-label","onClick"],un=["src","alt","onError"],hn={key:2,class:"absolute bottom-0 left-0 right-0 p-2 bg-gradient-to-t from-black/70 via-black/30 to-transparent"},xn={key:0,class:"text-xs font-medium text-white/90 truncate"},pn={key:1,class:"text-xs text-white/50 truncate"},gn={key:0,class:"flex items-center justify-center py-12"},bn=G({__name:"ImageGrid",props:{images:{},title:{default:"Images"}},emits:["selectImage"],setup(a){const{isDark:c}=Z(),l=S(new Set);function w(g){l.value.add(g.id),l.value=new Set(l.value)}return(g,v)=>(s(),n("div",ln,[e("div",{class:"p-4 space-y-3",style:q(t(c)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",on,[e("h3",{class:i(["text-sm font-bold",t(c)?"text-white/90":"text-gray-900"])},u(a.title),3),e("div",an,[e("span",{class:i(["text-xs font-mono",t(c)?"text-white/30":"text-gray-400"])},u(a.images.length)+" images ",3),ie(g.$slots,"header-actions")])])],4),e("div",rn,[e("div",cn,[(s(!0),n(I,null,P(a.images,x=>(s(),n("button",{key:x.id,class:i(["group w-full break-inside-avoid text-left rounded-xl overflow-hidden transition-all duration-200 hover:brightness-110 relative",t(c)?"bg-white/5":"bg-black/3"]),"aria-label":x.alt||x.title||"Image",onClick:m=>g.$emit("selectImage",x)},[l.value.has(x.id)?(s(),n("div",{key:1,class:i(["w-full aspect-[4/3] flex items-center justify-center",t(c)?"bg-white/5":"bg-black/5"])},[(s(),n("svg",{class:i(["w-8 h-8",t(c)?"text-white/15":"text-gray-300"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...v[0]||(v[0]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])],2))],2)):(s(),n("img",{key:0,src:x.url,alt:x.alt||x.title||"Image",class:"w-full block transition-transform duration-300 group-hover:scale-[1.03]",loading:"lazy",onError:m=>w(x)},null,40,un)),x.title||x.source?(s(),n("div",hn,[x.title?(s(),n("p",xn,u(x.title),1)):f("",!0),x.source?(s(),n("p",pn,u(x.source),1)):f("",!0)])):f("",!0)],10,dn))),128))]),a.images.length===0?(s(),n("div",gn,[e("p",{class:i(["text-sm",t(c)?"text-white/30":"text-gray-400"])}," No images found ",2)])):f("",!0)])]))}}),vn={class:"h-full flex flex-col"},fn={class:"p-4 space-y-3"},mn={class:"flex items-center justify-between"},wn={class:"shrink-0 flex items-center gap-2"},yn={key:0,class:"flex flex-wrap gap-1.5"},kn=["onClick"],$n={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pb-16"},_n={class:"grid grid-cols-2 sm:grid-cols-3 gap-3"},Cn=["aria-label","onClick"],jn={class:"aspect-[4/3] relative w-full overflow-hidden rounded-t-[10px]"},Sn={key:0,class:"absolute inset-0 animate-shimmer"},Mn=["src","alt","onError"],Tn=["src","alt"],Dn={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},In={class:"absolute bottom-0 left-0 right-0 p-2"},Bn={class:"text-xs font-semibold text-white/90 truncate"},Ln={class:"text-xs text-white/40 truncate mt-0.5"},Pn={key:4,class:"absolute top-1.5 right-1.5"},Nn={class:"text-xs px-1.5 py-0.5 rounded bg-black/60 text-amber-400 backdrop-blur-sm font-semibold"},An={key:5,class:"absolute top-1.5 left-1.5"},zn={class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},En={key:0,class:"flex items-center justify-center py-12"},Fn=G({__name:"PlaceGrid",props:{places:{},title:{default:"Places"}},emits:["selectPlace"],setup(a){const c=a,{isDark:l}=Z(),w=S(""),g=S(null),{coverSrc:v,fallbackSrc:x,onError:m,isLoading:$}=Ae({items:Ne(c,"places"),id:d=>d.id,existingUrl:d=>d.photoUrl,fetch:d=>ut(d.name,d.city),fallback:d=>dt(d.name,d.cuisine||d.category)}),_=B(()=>{const d=new Map;for(const o of c.places){const r=o.cuisine||o.category;r&&d.set(r,(d.get(r)??0)+1)}return[...d.entries()].sort((o,r)=>r[1]-o[1]).slice(0,8).map(([o])=>o)}),b=B(()=>{let d=c.places;if(w.value){const o=w.value.toLowerCase();d=d.filter(r=>r.name.toLowerCase().includes(o)||r.cuisine?.toLowerCase().includes(o)||r.category?.toLowerCase().includes(o)||r.city?.toLowerCase().includes(o)||r.address?.toLowerCase().includes(o))}return g.value&&(d=d.filter(o=>o.cuisine===g.value||o.category===g.value)),d});return(d,o)=>(s(),n("div",vn,[e("div",fn,[e("div",mn,[e("h3",{class:i(["text-base font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title||"Places"),3),e("div",wn,[e("span",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(b.value.length)+" places ",3),ie(d.$slots,"header-actions")])]),W(e("input",{"onUpdate:modelValue":o[0]||(o[0]=r=>w.value=r),type:"text",placeholder:"Search places...",class:i(["w-full text-base px-3 py-2 rounded-lg outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder-white/25 focus:bg-white/8":"bg-black/5 text-gray-800 placeholder-gray-400 focus:bg-black/8"])},null,2),[[J,w.value]]),_.value.length>1?(s(),n("div",yn,[(s(!0),n(I,null,P(_.value,r=>(s(),n("button",{key:r,class:i(["text-xs px-2 py-1 rounded-md font-medium transition-all duration-150",g.value===r?"nav-tab-active":t(l)?"bg-white/5 text-white/40 hover:text-white/70":"bg-black/5 text-gray-500 hover:text-gray-800"]),onClick:h=>g.value=g.value===r?null:r},u(r),11,kn))),128))])):f("",!0)]),e("div",$n,[e("div",_n,[(s(!0),n(I,null,P(b.value,r=>(s(),n("button",{key:r.id,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":r.name,onClick:h=>d.$emit("selectPlace",r)},[e("div",jn,[t($)(r)?(s(),n("div",Sn)):f("",!0),t(v)(r)?(s(),n("img",{key:1,src:t(v)(r),alt:r.name,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:h=>t(m)(r)},null,40,Mn)):t($)(r)?f("",!0):(s(),n("img",{key:2,src:t(x)(r),alt:r.name,class:"w-full h-full object-cover"},null,8,Tn)),t(v)(r)?(s(),n("div",Dn)):f("",!0),e("div",In,[e("p",Bn,u(r.name),1),e("p",Ln,u(r.cuisine||r.category),1)]),r.rating?(s(),n("div",Pn,[e("span",Nn," ★ "+u(r.rating.toFixed(1)),1)])):f("",!0),r.priceLevel?(s(),n("div",An,[e("span",zn,u("$".repeat(r.priceLevel)),1)])):f("",!0)])],8,Cn))),128))]),b.value.length===0?(s(),n("div",En,[e("p",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])}," No places match your search ",2)])):f("",!0)])]))}}),Rn={class:"h-full flex flex-col"},Vn={class:"flex items-center justify-between gap-2"},Un={class:"flex items-center gap-2 shrink-0"},qn={key:0,class:"flex flex-wrap gap-1.5"},Gn=["onClick"],On={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},Hn={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},Wn=["aria-label","onClick"],Kn={class:"cover-card flex-1 min-h-0 relative"},Yn={key:0,class:"absolute inset-0 animate-shimmer"},Qn=["src","alt","onError"],Jn=["src","alt"],Zn={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},Xn={class:"absolute bottom-0 left-0 right-0 p-2"},el={class:"text-xs font-semibold text-white/90 leading-tight truncate"},tl={class:"text-xs text-white/40 truncate mt-0.5"},sl={class:"absolute top-1.5 right-1.5 flex gap-0.5 flex-wrap justify-end max-w-[60%]"},nl={key:0,class:"flex items-center justify-center py-12"},ll=G({__name:"PodcastGrid",props:{podcasts:{},title:{default:"Recommended Podcasts"}},emits:["selectPodcast"],setup(a){const c=a,{isDark:l}=Z(),w=S(""),g=S(null),{coverSrc:v,fallbackSrc:x,onError:m,isLoading:$}=Ae({items:Ne(c,"podcasts"),id:d=>d.id,existingUrl:d=>d.coverUrl,fetch:d=>xt(d.title,d.host),fallback:d=>ht(d.title,d.host)}),_=B(()=>{const d=new Map;for(const o of c.podcasts)for(const r of o.genres??[])d.set(r,(d.get(r)??0)+1);return[...d.entries()].sort((o,r)=>r[1]-o[1]).slice(0,8).map(([o])=>o)}),b=B(()=>{let d=c.podcasts;if(w.value){const o=w.value.toLowerCase();d=d.filter(r=>r.title.toLowerCase().includes(o)||(r.host??"").toLowerCase().includes(o)||(r.genres??[]).some(h=>h.toLowerCase().includes(o)))}return g.value&&(d=d.filter(o=>(o.genres??[]).includes(g.value))),d});return(d,o)=>(s(),n("div",Rn,[e("div",{class:"p-4 space-y-3",style:q(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",Vn,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title),3),e("div",Un,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(b.value.length)+" podcasts ",3),ie(d.$slots,"header-actions")])]),W(e("input",{"onUpdate:modelValue":o[0]||(o[0]=r=>w.value=r),type:"text",placeholder:"Search podcasts...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,2),[[J,w.value]]),_.value.length>0?(s(),n("div",qn,[(s(!0),n(I,null,P(_.value,r=>(s(),n("button",{key:r,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",g.value===r?"nav-tab-active":t(l)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:h=>g.value=g.value===r?null:r},u(r),11,Gn))),128))])):f("",!0)],4),e("div",On,[e("div",Hn,[(s(!0),n(I,null,P(b.value,r=>(s(),n("button",{key:r.id,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":r.title,onClick:h=>d.$emit("selectPodcast",r)},[e("div",Kn,[e("div",{class:i(["aspect-square relative w-full overflow-hidden rounded-[10px]",t(v)(r)?"":t(l)?"bg-white/[0.06]":"bg-black/[0.04]"])},[t($)(r)?(s(),n("div",Yn)):f("",!0),t(v)(r)?(s(),n("img",{key:1,src:t(v)(r),alt:r.title,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:h=>t(m)(r)},null,40,Qn)):t($)(r)?f("",!0):(s(),n("img",{key:2,src:t(x)(r),alt:r.title,class:"w-full h-full object-cover"},null,8,Jn)),t(v)(r)?(s(),n("div",Zn)):f("",!0),e("div",Xn,[e("p",el,u(r.title),1),e("p",tl,u(r.host||"Podcast"),1)]),e("div",sl,[(s(!0),n(I,null,P(r.sources.slice(0,2),h=>(s(),n("span",{key:h.type,class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},u(h.type),1))),128))])],2)])],8,Wn))),128))]),b.value.length===0?(s(),n("div",nl,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No podcasts match your search ",2)])):f("",!0)])]))}}),ol={class:"shrink-0"},al={class:"flex-1 overflow-y-auto custom-scrollbar"},il={key:0,class:"relative overflow-hidden",style:{minHeight:"180px"}},rl={class:"absolute inset-0"},cl=["src"],dl={class:"relative z-10 flex flex-col justify-end h-full px-5 pb-5 pt-12",style:{"min-height":"180px"}},ul={class:"px-3 pt-2 pb-8"},hl={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 2a10 10 0 100 20 10 10 0 000-20zm0 0v2m0 16v2m10-10h-2M4 12H2m15.07-5.07l-1.41 1.41M8.34 15.66l-1.41 1.41m0-11.14l1.41 1.41m7.32 7.32l1.41 1.41"},xl={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"},pl={key:2,"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z"},gl={key:3,"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h7"},bl=["onClick"],vl=["onClick"],fl={key:1,class:"flex items-center justify-center py-16 px-4"},ml=G({__name:"MagazineGrid",props:{sections:{},heroImageUrl:{default:null},title:{default:"Brief"},query:{default:""}},setup(a){const c=a,{isDark:l}=Z(),{openMagazineSectionDetail:w}=$e(),g=["compass","bookmark","lightning","lines"];function v(b){return b.replace(/\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/https?:\/\/\S+/g,"").replace(/\uFE0F/g,"").replace(new RegExp("(?:^|(?<=\\s))[\\p{Emoji_Presentation}\\p{Extended_Pictographic}]+\\s*","gu"),"").replace(/---+/g,"").replace(/^#+\s*/gm,"").replace(/\*\*/g,"").replace(/\*([^*\n]+)\*/g,"$1").replace(/\|/g,", ").replace(/,\s*,+/g,",").replace(/^\s*[-•]\s+/gm,"").replace(/\n+/g," ").replace(/(^|\s),\s*/g,"$1").trim()}function x(b,d){const o=v(b);return o.length<=d?o:o.slice(0,d).replace(/\s+\S*$/,"")+" ..."}const m=B(()=>{const b=[],d=c.sections;if(!d.length)return b;let o=0;for(const j of c.query||"brief")o=(o<<5)-o+j.charCodeAt(0)|0;let r="",h=0,M=!1;return d.forEach((j,L)=>{if(L===0&&!j.group){b.push({type:"wide",title:j.title,text:x(j.content,200),label:"The Lead",author:j.author,section:j});return}const D=j.group||"";if(D&&D!==r&&(M&&(b.push({type:"dark",title:"",text:""}),M=!1),b.push({type:"banner",title:"",text:"",icon:g[h%g.length],label:D}),h++,r=D),D){const C=M?"dark":"half",k=v(j.content),p=v(j.title),y=k.toLowerCase().startsWith(p.toLowerCase().slice(0,30));b.push({type:C,title:y?"":j.title,text:x(j.content,y?160:100),section:j}),M=!M}else M&&(b.push({type:"dark",title:"",text:""}),M=!1),b.push({type:"wide",title:j.title,text:x(j.content,180),author:j.author,section:j})}),M&&b.push({type:"dark",title:"",text:""}),b});function $(b){const d=c.sections.indexOf(b);w(b,d>=0?d:0)}const _=B(()=>{const b=(c.query??"").trim();return b?b.length>100?b.slice(0,97)+"...":b:c.title});return(b,d)=>(s(),n("div",{class:i(["magazine h-full flex flex-col",t(l)?"magazine-dark":"magazine-light"])},[e("header",{class:i(["shrink-0 px-5 py-4 flex items-center justify-between border-b",t(l)?"border-white/10":"border-black/10"])},[e("h1",{class:i(["font-serif text-xl font-bold tracking-tight",t(l)?"text-white":"text-black"])}," AI Brief ",2),e("div",ol,[ie(b.$slots,"header-actions",{},void 0,!0)])],2),e("div",al,[_.value?(s(),n("div",il,[e("div",rl,[a.heroImageUrl?(s(),n("img",{key:0,src:a.heroImageUrl,alt:"",class:"w-full h-full object-cover",style:{filter:"saturate(0.3) contrast(1.1)"}},null,8,cl)):(s(),n("div",{key:1,class:i(["w-full h-full",t(l)?"bg-gradient-to-br from-white/[0.04] via-white/[0.02] to-transparent":"bg-gradient-to-br from-black/[0.06] via-black/[0.03] to-transparent"])},null,2))]),e("div",{class:i(["absolute inset-0",t(l)?"bg-gradient-to-t from-[#0a0a0a] via-[#0a0a0a]/80 to-[#0a0a0a]/60":"bg-gradient-to-t from-[#faf9f6] via-[#faf9f6]/85 to-[#faf9f6]/65"])},null,2),e("div",dl,[e("p",{class:i(["text-xs uppercase tracking-[0.3em] font-medium mb-2",t(l)?"text-white/40":"text-black/40"])}," In response to ",2),e("p",{class:i(["font-serif text-2xl italic leading-tight",t(l)?"text-white/70":"text-black/60"])},u(_.value),3)])])):f("",!0),e("div",ul,[e("div",{class:i(["grid grid-cols-2 gap-px",t(l)?"bg-white/12":"bg-black/10"])},[(s(!0),n(I,null,P(m.value,(o,r)=>(s(),n(I,{key:r},[o.type==="banner"?(s(),n("div",{key:0,class:i(["col-span-2 flex flex-col items-center justify-center py-8 px-5",t(l)?"bg-[#0a0a0a]":"bg-[#faf9f6]"])},[(s(),n("svg",{class:i(["w-5 h-5 mb-2.5",t(l)?"text-white/20":"text-black/15"]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[o.icon==="compass"?(s(),n("path",hl)):o.icon==="bookmark"?(s(),n("path",xl)):o.icon==="lightning"?(s(),n("path",pl)):(s(),n("path",gl))],2)),e("p",{class:i(["text-xs uppercase tracking-[0.3em] font-semibold text-center",t(l)?"text-white/30":"text-black/30"])},u(o.label),3)],2)):o.type==="wide"?(s(),n("button",{key:1,class:i(["col-span-2 text-left px-5 py-5 transition-colors cursor-pointer",t(l)?"bg-[#0a0a0a] hover:bg-white/[0.03]":"bg-[#faf9f6] hover:bg-black/[0.02]"]),onClick:h=>o.section&&$(o.section)},[o.label?(s(),n("p",{key:0,class:i(["text-xs uppercase tracking-[0.3em] font-semibold mb-2",t(l)?"text-white/30":"text-black/35"])},u(o.label),3)):f("",!0),e("h2",{class:i(["font-serif text-lg font-bold leading-snug mb-2",t(l)?"text-white/95":"text-black/90"])},u(o.title),3),o.author?(s(),n("p",{key:1,class:i(["text-xs mb-2",t(l)?"text-white/40":"text-black/40"])}," By "+u(o.author),3)):f("",!0),e("p",{class:i(["font-serif text-sm leading-relaxed",t(l)?"text-white/70":"text-black/60"])},u(o.text),3)],10,bl)):(s(),n("button",{key:2,class:i(["text-left px-4 py-4 transition-colors flex flex-col cursor-pointer",[t(l)?"bg-[#0a0a0a] hover:bg-white/[0.03]":"bg-[#faf9f6] hover:bg-black/[0.02]",o.type==="dark"?t(l)?"bg-white/[0.04]":"bg-black/[0.04]":""]]),onClick:h=>o.section&&$(o.section)},[o.label?(s(),n("p",{key:0,class:i(["text-xs uppercase tracking-[0.25em] font-semibold mb-1.5",t(l)?"text-white/25":"text-black/30"])},u(o.label),3)):f("",!0),o.title?(s(),n("h3",{key:1,class:i(["font-serif text-sm font-bold leading-snug mb-1",t(l)?"text-white/90":"text-black/85"])},u(o.title),3)):f("",!0),e("p",{class:i(["font-serif text-xs leading-relaxed flex-1",[t(l)?"text-white/55":"text-black/50",o.title?"":"italic"]])},u(o.text),3)],10,vl))],64))),128))],2)]),a.sections.length===0?(s(),n("div",fl,[e("p",{class:i(["text-sm",t(l)?"text-white/40":"text-gray-400"])}," No sections to display ",2)])):f("",!0)])],2))}}),st=De(ml,[["__scopeId","data-v-02741b8c"]]),wl={class:"h-full flex flex-col"},yl={class:"flex items-center justify-between gap-2"},kl={class:"flex items-center gap-2 shrink-0"},$l=["placeholder"],_l={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},Cl={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},jl=["aria-label","onClick"],Sl={class:"cover-card flex-1 min-h-0 relative"},Ml={class:"aspect-[4/3] flex flex-col w-full overflow-hidden rounded-[10px]"},Tl={class:"flex-1 min-h-0 relative"},Dl=["src","alt","onError"],Il={key:2,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-black/20 to-transparent pointer-events-none"},Bl={key:0,class:"flex items-center justify-center py-12"},nt=G({__name:"NewsGrid",props:{articles:{},title:{default:"News & Articles"},query:{default:""},variant:{default:"news"}},setup(a){const c=a,{isDark:l}=Z(),{openArticleDetail:w,openWebsiteDetail:g}=$e(),v=S(""),x=S(new Set);function m(h){return!h||typeof h!="string"?!1:/^https?:\/\//i.test(h.trim())}function $(h){x.value=new Set([...x.value,h])}function _(h){try{return new URL(h).hostname.replace(/^www\./,"")}catch{return h}}function b(h){return c.variant==="websites"?Ot(h.title,_(h.url)):Ht(h.title,_(h.url))}function d(h){c.variant==="websites"?g(h):w(h)}function o(h,M){if(!M.trim())return 0;const L=M.toLowerCase().split(/\s+/).filter(y=>y.length>1);if(L.length===0)return 0;const D=h.title.toLowerCase(),C=(h.content??"").toLowerCase(),k=h.url.toLowerCase();let p=0;for(const y of L)D.includes(y)&&(p+=3),C.includes(y)&&(p+=2),k.includes(y)&&(p+=1);return p}const r=B(()=>{let h=c.articles;if(v.value.trim()){const M=v.value.toLowerCase();h=h.filter(j=>j.title.toLowerCase().includes(M)||(j.content??"").toLowerCase().includes(M)||j.url.toLowerCase().includes(M))}return c.query.trim()?[...h].sort((M,j)=>o(j,c.query)-o(M,c.query)):h});return(h,M)=>(s(),n("div",wl,[e("div",{class:"p-4 space-y-3",style:q(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",yl,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title),3),e("div",kl,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(r.value.length)+" "+u(a.variant==="websites"?"websites":"articles"),3),ie(h.$slots,"header-actions")])]),W(e("input",{"onUpdate:modelValue":M[0]||(M[0]=j=>v.value=j),type:"text",placeholder:a.variant==="websites"?"Search websites...":"Search articles...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,10,$l),[[J,v.value]])],4),e("div",_l,[e("div",Cl,[(s(!0),n(I,null,P(r.value,(j,L)=>(s(),n("button",{key:L,class:"group flex flex-col items-stretch text-left w-full path-glass-bubble rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105","aria-label":j.title,onClick:D=>d(j)},[e("div",Sl,[e("div",Ml,[e("div",Tl,[m(j.imgSrc)&&!x.value.has(j.url)?(s(),n("img",{key:0,src:j.imgSrc,alt:j.title,class:"absolute inset-0 w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:D=>$(j.url)},null,40,Dl)):(s(),n("div",{key:1,class:"absolute inset-0 bg-cover bg-center",style:q({backgroundImage:`url(${b(j)})`})},null,4)),m(j.imgSrc)&&!x.value.has(j.url)?(s(),n("div",Il)):f("",!0)]),e("div",{class:i(["shrink-0 p-2 backdrop-blur-md rounded-b-[10px]",[t(l)?"bg-black shadow-[inset_0_1px_0_rgba(255,255,255,0.12)]":"bg-white shadow-[inset_0_1px_0_rgba(0,0,0,0.06)]"]])},[e("p",{class:i(["text-xs font-semibold leading-tight line-clamp-2",t(l)?"text-white/95":"text-gray-900"])},u(j.title),3),j.content?(s(),n("p",{key:0,class:i(["text-xs line-clamp-1 mt-0.5",t(l)?"text-white/70":"text-gray-600"])},u(j.content),3)):f("",!0),e("p",{class:i(["text-xs truncate mt-0.5",t(l)?"text-white/50":"text-gray-500"])},u(_(j.url)),3)],2)])])],8,jl))),128))]),r.value.length===0?(s(),n("div",Bl,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])},u(a.variant==="websites"?"No websites match your search":"No articles match your search"),3)])):f("",!0)])]))}}),Ll={class:"h-full flex flex-col"},Pl={class:"flex items-center justify-between gap-2"},Nl={class:"flex items-center gap-2 shrink-0"},Al={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},zl={class:"grid grid-cols-1 sm:grid-cols-2 gap-3"},El=["aria-label","onClick"],Fl={class:"aspect-[3/1] relative w-full overflow-hidden"},Rl=["src","alt"],Vl={class:"p-3"},Ul={class:"flex items-center gap-3 mt-2 flex-wrap"},ql={key:0,class:"flex items-center justify-center py-12"},Gl=G({__name:"RecipeGrid",props:{recipes:{},title:{default:"Recipes"}},emits:["selectRecipe"],setup(a){const c=a,{isDark:l}=Z(),w=S(""),g=B(()=>{if(!w.value.trim())return c.recipes;const v=w.value.toLowerCase();return c.recipes.filter(x=>x.title.toLowerCase().includes(v)||x.ingredients.some(m=>m.toLowerCase().includes(v)))});return(v,x)=>(s(),n("div",Ll,[e("div",{class:"p-4 space-y-3",style:q(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",Pl,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title),3),e("div",Nl,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(g.value.length)+" recipes ",3),ie(v.$slots,"header-actions")])]),a.recipes.length>3?W((s(),n("input",{key:0,"onUpdate:modelValue":x[0]||(x[0]=m=>w.value=m),type:"text",placeholder:"Search recipes...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,2)),[[J,w.value]]):f("",!0)],4),e("div",Al,[e("div",zl,[(s(!0),n(I,null,P(g.value,(m,$)=>(s(),n("button",{key:$,class:i(["group flex flex-col items-stretch text-left w-full rounded-2xl overflow-hidden transition-all duration-200 hover:brightness-105",t(l)?"bg-white/[0.04] border border-white/8 hover:bg-white/[0.07]":"bg-black/[0.02] border border-black/5 hover:bg-black/[0.05]"]),"aria-label":m.title,onClick:_=>v.$emit("selectRecipe",m)},[e("div",Fl,[e("img",{src:t(Wt)(m.title,m.time),alt:m.title,class:"w-full h-full object-cover"},null,8,Rl)]),e("div",Vl,[e("p",{class:i(["text-sm font-semibold leading-tight line-clamp-2",t(l)?"text-white/90":"text-gray-900"])},u(m.title),3),e("div",Ul,[m.time?(s(),n("span",{key:0,class:i(["flex items-center gap-1 text-xs",t(l)?"text-white/40":"text-gray-500"])},[x[1]||(x[1]=e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),ne(" "+u(m.time),1)],2)):f("",!0),m.servings?(s(),n("span",{key:1,class:i(["flex items-center gap-1 text-xs",t(l)?"text-white/40":"text-gray-500"])},[x[2]||(x[2]=e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})],-1)),ne(" "+u(m.servings),1)],2)):f("",!0),m.calories?(s(),n("span",{key:2,class:i(["text-xs",t(l)?"text-white/40":"text-gray-500"])},u(m.calories)+" cal ",3)):f("",!0)]),m.ingredients.length>0?(s(),n("p",{key:0,class:i(["text-xs mt-2 line-clamp-1",t(l)?"text-white/25":"text-gray-400"])},u(m.ingredients.slice(0,4).join(" · ")),3)):f("",!0)])],10,El))),128))]),g.value.length===0?(s(),n("div",ql,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No recipes match your search ",2)])):f("",!0)])]))}}),Ol={class:"h-full flex flex-col"},Hl={class:"flex items-center justify-between gap-2"},Wl={class:"flex flex-wrap gap-1.5"},Kl=["onClick"],Yl={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},Ql={class:"space-y-2"},Jl=["aria-label","onClick"],Zl={class:"text-white/90"},Xl={class:"flex-1 min-w-0"},eo={class:"flex items-center gap-2"},to={class:"flex gap-1 mt-1.5"},so={key:0,class:"flex items-center justify-center py-12"},no=G({__name:"AppsGrid",props:{apps:{},title:{default:"Recommended Apps"}},emits:["selectApp"],setup(a){const c=a,{isDark:l}=Z(),w=S(""),g=S(null),v=[{value:"nostr-client",label:"Nostr"},{value:"lightning-wallet",label:"Lightning"},{value:"bitcoin-wallet",label:"Bitcoin"},{value:"privacy",label:"Privacy"},{value:"node",label:"Nodes"},{value:"dev-tool",label:"Dev"}];function x(b){return v.find(d=>d.value===b)?.label??b}function m(b){return{ios:"iOS",android:"Android",web:"Web",desktop:"Desktop",cli:"CLI",nodeos:"Node"}[b]??b}function $(b){let d=0;for(let r=0;r<b.length;r++)d=b.charCodeAt(r)+((d<<5)-d);const o=Math.abs(d%360);return`linear-gradient(135deg, hsl(${o}, 60%, 35%), hsl(${(o+40)%360}, 50%, 25%))`}const _=B(()=>{let b=c.apps;if(w.value){const d=w.value.toLowerCase();b=b.filter(o=>o.name.toLowerCase().includes(d)||o.description.toLowerCase().includes(d)||o.keywords.some(r=>r.toLowerCase().includes(d)))}return g.value&&(b=b.filter(d=>d.category===g.value)),b});return(b,d)=>(s(),n("div",Ol,[e("div",{class:"p-4 space-y-3",style:q(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",Hl,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(a.title),3),e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(_.value.length)+" apps ",3)]),W(e("input",{"onUpdate:modelValue":d[0]||(d[0]=o=>w.value=o),type:"text",placeholder:"Search apps...",class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/3 text-gray-800 placeholder:text-gray-400 focus:bg-black/5"])},null,2),[[J,w.value]]),e("div",Wl,[(s(),n(I,null,P(v,o=>e("button",{key:o.value,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",g.value===o.value?"nav-tab-active":t(l)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:r=>g.value=g.value===o.value?null:o.value},u(o.label),11,Kl)),64))])],4),e("div",Yl,[e("div",Ql,[(s(!0),n(I,null,P(_.value,o=>(s(),n("button",{key:o.id,class:i(["w-full text-left p-3 rounded-xl transition-all duration-200 flex items-start gap-3",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"]),"aria-label":o.name,onClick:r=>b.$emit("selectApp",o)},[e("div",{class:"w-10 h-10 rounded-xl flex items-center justify-center text-lg font-bold shrink-0",style:q({background:$(o.id)})},[e("span",Zl,u(o.name.charAt(0)),1)],4),e("div",Xl,[e("div",eo,[e("p",{class:i(["text-xs font-semibold truncate",t(l)?"text-white/90":"text-gray-900"])},u(o.name),3),e("span",{class:i(["text-xs px-1.5 py-0.5 rounded font-medium shrink-0",t(l)?"bg-white/10 text-white/50":"bg-black/5 text-gray-500"])},u(x(o.category)),3)]),e("p",{class:i(["text-xs mt-0.5 line-clamp-2",t(l)?"text-white/50":"text-gray-500"])},u(o.description),3),e("div",to,[(s(!0),n(I,null,P(o.platforms,r=>(s(),n("span",{key:r,class:i(["text-xs px-1 py-0.5 rounded",t(l)?"bg-white/5 text-white/30":"bg-black/3 text-gray-400"])},u(m(r)),3))),128))])])],10,Jl))),128))]),_.value.length===0?(s(),n("div",so,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No apps match your search ",2)])):f("",!0)])]))}}),lo={class:"group/node"},oo={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},ao={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},io={class:"truncate flex-1"},ro={key:0,class:"w-2.5 h-2.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},co={key:0,class:"w-2.5 h-2.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},uo={key:0},ho=G({__name:"FileTreeNode",props:{entry:{},activeFile:{},depth:{}},emits:["select","toggle-context"],setup(a,{emit:c}){const l=a,{isFileSelected:w}=pe(),g=c,{isDark:v}=Z(),x=S(l.depth<1),m=B(()=>!l.entry.isDirectory&&l.activeFile===l.entry.path),$=B(()=>!l.entry.isDirectory&&w(l.entry.path)),_=B(()=>l.entry.isDirectory&&w(l.entry.path));function b(){l.entry.isDirectory?x.value=!x.value:g("select",l.entry.path)}function d(){g("toggle-context",l.entry.path)}function o(){g("toggle-context",l.entry.path)}return(r,h)=>{const M=Kt("FileTreeNode",!0);return s(),n("div",lo,[e("div",{class:i(["w-full flex items-center gap-1.5 py-1 px-2 rounded-lg text-xs transition-colors cursor-pointer",[m.value?t(v)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(v)?"text-white/60 hover:bg-white/[0.04] hover:text-white/80":"text-gray-600 hover:bg-black/[0.03] hover:text-gray-800"]]),style:q({paddingLeft:`${a.depth*12+8}px`}),onClick:b},[a.entry.isDirectory?(s(),n("svg",{key:0,class:i(["w-3 h-3 shrink-0 transition-transform duration-150",x.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...h[2]||(h[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)):f("",!0),(s(),n("svg",{class:i(["w-3.5 h-3.5 shrink-0",a.entry.isDirectory?"text-accent/70":t(v)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a.entry.isDirectory?(s(),n("path",oo)):(s(),n("path",ao))],2)),e("span",io,u(a.entry.name),1),a.entry.isDirectory?f("",!0):(s(),n("button",{key:1,class:i(["shrink-0 w-4 h-4 rounded-full border flex items-center justify-center transition-all ml-auto",[$.value?"bg-accent border-accent text-white":t(v)?"border-white/20 opacity-0 group-hover/node:opacity-100 hover:border-white/40":"border-black/15 opacity-0 group-hover/node:opacity-100 hover:border-black/30"]]),"aria-label":"Toggle file for chat context",onClick:xe(d,["stop"])},[$.value?(s(),n("svg",ro,[...h[3]||(h[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):f("",!0)],2)),a.entry.isDirectory?(s(),n("button",{key:2,class:i(["shrink-0 w-4 h-4 rounded-full border flex items-center justify-center transition-all ml-auto",[_.value?"bg-accent border-accent text-white":t(v)?"border-white/20 opacity-0 group-hover/node:opacity-100 hover:border-white/40":"border-black/15 opacity-0 group-hover/node:opacity-100 hover:border-black/30"]]),"aria-label":"Add folder to chat context",onClick:xe(o,["stop"])},[_.value?(s(),n("svg",co,[...h[4]||(h[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):f("",!0)],2)):f("",!0)],6),a.entry.isDirectory&&x.value&&a.entry.children?(s(),n("div",uo,[(s(!0),n(I,null,P(a.entry.children,j=>(s(),U(M,{key:j.path,entry:j,"active-file":a.activeFile,depth:a.depth+1,onSelect:h[0]||(h[0]=L=>r.$emit("select",L)),onToggleContext:h[1]||(h[1]=L=>r.$emit("toggle-context",L))},null,8,["entry","active-file","depth"]))),128))])):f("",!0)])}}}),xo={class:"flex flex-col h-full"},po={class:"flex items-center gap-1 min-w-0 flex-1"},go={class:"flex items-center gap-2 shrink-0"},bo={key:0,class:"flex-1 overflow-y-auto custom-scrollbar p-3"},vo={class:"mb-3 flex gap-2"},fo={class:"flex justify-end gap-2"},mo=["disabled"],wo={class:"grid grid-cols-2 gap-2"},yo=["onClick"],ko={key:1,class:"flex-1 overflow-y-auto custom-scrollbar p-2"},$o={key:0,class:"flex items-center justify-center py-12"},_o=G({__name:"ProjectGrid",props:{isWideDesktop:{type:Boolean},isMobile:{type:Boolean}},setup(a){const{isDark:c}=Z(),{projectList:l,activeProject:w,fileTree:g,activeFile:v,codeMode:x,selectedFiles:m,selectProject:$,openFile:_,createProject:b,clearActiveFile:d,toggleFileSelection:o,isFileSelected:r,loadProjects:h}=pe();le(()=>{l.value.length===0&&h()});const M=S(""),j=S(!1),L=S(""),D=S(null),C=B(()=>w.value?"filetree":"projects"),k=B(()=>C.value==="projects"?"Projects":w.value?.name??"Projects"),p=B(()=>{const F=M.value.toLowerCase();return F?l.value.filter(O=>O.name.toLowerCase().includes(F)||(O.language??"").toLowerCase().includes(F)):l.value});function y(F){$(F)}function A(){const{activeProject:F,fileTree:O}=pe();F.value=null,O.value=[],d()}function V(F){_(F)}function E(F){o(F)}function Q(){j.value=!0,L.value="",ye(()=>D.value?.focus())}function H(){j.value=!1,L.value=""}function K(){const F=L.value.trim();F&&(b(F),j.value=!1,L.value="")}return(F,O)=>(s(),n("div",xo,[e("div",{class:"shrink-0 px-4 py-3 flex items-center justify-between gap-2",style:q(t(c)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",po,[C.value!=="projects"?(s(),n("button",{key:0,class:i(["text-xs shrink-0 transition-colors",t(c)?"text-white/40 hover:text-white/70 hover:underline":"text-gray-400 hover:text-gray-700 hover:underline"]),onClick:A}," Projects ",2)):f("",!0),C.value!=="projects"?(s(),n("span",{key:1,class:i(["text-xs shrink-0",t(c)?"text-white/20":"text-gray-300"])},"/",2)):f("",!0),e("span",{class:i(["text-sm font-semibold truncate",t(c)?"text-white/90":"text-gray-900"])},u(k.value),3)]),e("div",go,[C.value==="projects"?(s(),n("p",{key:0,class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])},u(t(l).length)+" repos ",3)):C.value==="filetree"?(s(),n("p",{key:1,class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])},u(t(w)?.language),3)):f("",!0),ie(F.$slots,"header-actions")])],4),C.value==="projects"?(s(),n("div",bo,[e("div",vo,[W(e("input",{"onUpdate:modelValue":O[0]||(O[0]=X=>M.value=X),type:"text",placeholder:"Search projects...",class:i(["flex-1 min-w-0 px-3 py-2 rounded-lg text-base bg-transparent outline-none",t(c)?"text-white/80 placeholder:text-white/20 border border-white/10 focus:border-white/25":"text-gray-800 placeholder:text-gray-400 border border-black/10 focus:border-black/20"])},null,2),[[J,M.value]]),e("button",{class:i(["shrink-0 px-3 py-2 rounded-lg text-xs font-medium transition-colors flex items-center gap-1.5",t(c)?"bg-accent/20 text-accent hover:bg-accent/30":"bg-accent/10 text-accent hover:bg-accent/20"]),onClick:Q},[...O[2]||(O[2]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),ne(" New ",-1)])],2)]),j.value?(s(),n("div",{key:0,class:i(["mb-3 p-3 rounded-xl",t(c)?"bg-white/[0.05] border border-white/10":"bg-black/[0.03] border border-black/8"])},[e("p",{class:i(["text-xs font-medium mb-2",t(c)?"text-white/70":"text-gray-700"])}," New Project ",2),W(e("input",{ref_key:"newProjectInputRef",ref:D,"onUpdate:modelValue":O[1]||(O[1]=X=>L.value=X),type:"text",placeholder:"Project name...",class:i(["w-full px-3 py-2 rounded-lg text-base bg-transparent outline-none mb-2",t(c)?"text-white/80 placeholder:text-white/20 border border-white/10 focus:border-white/25":"text-gray-800 placeholder:text-gray-400 border border-black/10 focus:border-black/20"]),onKeydown:[ae(K,["enter"]),ae(H,["escape"])]},null,34),[[J,L.value]]),e("div",fo,[e("button",{class:i(["text-xs px-2.5 py-1 rounded-lg transition-colors",t(c)?"text-white/40 hover:text-white/70":"text-gray-500 hover:text-gray-800"]),onClick:H}," Cancel ",2),e("button",{class:i(["text-xs px-2.5 py-1 rounded-lg font-medium transition-colors",t(c)?"bg-accent/20 text-accent hover:bg-accent/30":"bg-accent/10 text-accent hover:bg-accent/20"]),disabled:!L.value.trim(),onClick:K}," Create ",10,mo)])],2)):f("",!0),e("div",wo,[(s(!0),n(I,null,P(p.value,X=>(s(),n("button",{key:X.path,class:i(["text-left p-3 rounded-xl transition-all duration-150",t(c)?"bg-white/[0.03] hover:bg-white/[0.07] border border-white/5":"bg-black/[0.02] hover:bg-black/[0.05] border border-black/5"]),onClick:ge=>y(X)},[e("div",{class:i(["w-8 h-8 rounded-lg flex items-center justify-center mb-2",t(c)?"bg-white/5":"bg-black/5"])},[(s(),n("svg",{class:i(["w-4 h-4",X.isGit?"text-accent":t(c)?"text-white/40":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...O[3]||(O[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])],2))],2),e("p",{class:i(["text-xs font-medium truncate",t(c)?"text-white/80":"text-gray-800"])},u(X.name),3),e("p",{class:i(["text-xs mt-0.5 truncate",t(c)?"text-white/25":"text-gray-400"])},u(X.language),3)],10,yo))),128))])])):C.value==="filetree"?(s(),n("div",ko,[(s(!0),n(I,null,P(t(g),X=>(s(),U(ho,{key:X.path,entry:X,"active-file":t(v),depth:0,onSelect:V,onToggleContext:E},null,8,["entry","active-file"]))),128)),t(g).length===0?(s(),n("div",$o,[e("p",{class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])}," Loading file tree... ",2)])):f("",!0)])):f("",!0)]))}}),Co={class:"flex flex-col h-full"},jo={class:"shrink-0 px-4 py-2 flex gap-1.5 overflow-x-auto scrollbar-hide"},So=["onClick"],Mo={class:"flex-1 overflow-y-auto px-4 py-3"},To={class:"grid grid-cols-2 gap-2"},Do=["onClick"],Io=["onClick"],Bo={key:0,class:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Lo={key:2,class:"h-8 flex items-end gap-0.5 mb-2"},Po={key:3,class:"h-8 flex items-center mb-2"},No={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"},Ao={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"},zo={key:2,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"},Eo={key:3,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"},Fo=G({__name:"DesignSystemGrid",setup(a){const{isDark:c}=Z(),{openDesignSystemItem:l}=$e(),{codeMode:w,toggleDesignToken:g,isDesignTokenSelected:v}=pe(),x=S("all"),m=[{id:"all",label:"All"},{id:"colors",label:"Colors"},{id:"typography",label:"Typography"},{id:"spacing",label:"Spacing"},{id:"atoms",label:"Atoms"},{id:"molecules",label:"Molecules"},{id:"organisms",label:"Organisms"}],$=[{id:"color-bg",name:"Background",category:"colors",preview:"inline",description:"Primary app background",code:`background-color: #0a0a0a;
|
||
/* Tailwind: bg-[#0a0a0a] */`,usedIn:"ChatPage, all panels, base layout"},{id:"color-accent",name:"Accent / Bitcoin",category:"colors",preview:"inline",description:"Primary action color, Bitcoin orange",code:`color: #F7931A;
|
||
/* Tailwind: text-accent */`,usedIn:"Gradient buttons, active tabs, zap counts, CTA elements"},{id:"color-primary",name:"Primary",category:"colors",preview:"inline",description:"Primary neutral tone",code:`color: #606060;
|
||
/* Tailwind: text-primary */`,usedIn:"Secondary text, borders, muted elements"},{id:"color-surface",name:"Glass Surface",category:"colors",preview:"inline",description:"Glass morphism panel background",code:`background: rgba(0, 0, 0, 0.35);
|
||
backdrop-filter: blur(18px);
|
||
border: 1px solid rgba(255, 255, 255, 0.18);
|
||
/* Tailwind: .glass */`,usedIn:"ChatInput, ContentPanel, all overlay panels"},{id:"color-text-scale",name:"Text Opacity Scale",category:"colors",preview:"inline",description:"/25 placeholder, /40 muted, /60 secondary, /80 body, /90 emphasis",code:`/* Text opacity scale */
|
||
.placeholder { color: rgba(255,255,255, 0.25); }
|
||
.muted { color: rgba(255,255,255, 0.40); }
|
||
.secondary { color: rgba(255,255,255, 0.60); }
|
||
.body { color: rgba(255,255,255, 0.80); }
|
||
.emphasis { color: rgba(255,255,255, 0.90); }
|
||
.heading { color: rgba(255,255,255, 0.96); }`,usedIn:"Every component — consistent hierarchy across the system"},{id:"type-body",name:"Body Font",category:"typography",description:"Inter / system-ui for all body text",code:`font-family: Inter, system-ui, -apple-system, sans-serif;
|
||
/* Applied globally */`,usedIn:"Global default — ChatMessage, grids, detail views"},{id:"type-mono",name:"Monospace Font",category:"typography",description:"Menlo / Monaco for code and IDs",code:`font-family: Menlo, Monaco, "Courier New", monospace;
|
||
/* Tailwind: font-mono */`,usedIn:"CodeDetail, conversation IDs, relay URLs, metadata"},{id:"type-serif",name:"Serif Font",category:"typography",description:"Georgia for magazine/editorial layouts",code:`font-family: Georgia, "Times New Roman", Times, serif;
|
||
/* Used in MagazineGrid, AI Brief */`,usedIn:"MagazineGrid, MagazineSectionDetail, AI Brief"},{id:"type-sizes",name:"Text Sizes",category:"typography",description:"Compact scale: 10px labels to 2xl headings",code:`/* Key sizes used */
|
||
text-xs /* labels, metadata */
|
||
text-xs /* 12px - secondary text */
|
||
text-sm /* 14px - body text */
|
||
text-base /* 16px - primary text */
|
||
text-lg /* 18px - section headings */
|
||
text-xl /* 20px - page headings */
|
||
text-2xl /* 24px - hero text */`,usedIn:"Globally — see specific usage in each size bracket"},{id:"space-grid",name:"4px Grid",category:"spacing",preview:"inline",description:"All spacing follows a 4px base grid",code:`/* 4px grid system */
|
||
1 = 4px /* micro gap */
|
||
2 = 8px /* tight gap */
|
||
3 = 12px /* small padding */
|
||
4 = 16px /* standard padding */
|
||
5 = 20px /* section padding */
|
||
6 = 24px /* large gap */
|
||
8 = 32px /* section spacing */
|
||
12 = 48px /* large sections */`,usedIn:"Every layout — padding, margins, gaps between elements"},{id:"space-radius",name:"Border Radius",category:"spacing",preview:"inline",description:"Rounded corners from subtle to full",code:`/* Border radius scale */
|
||
rounded-md /* 6px - badges, tags */
|
||
rounded-lg /* 8px - buttons, inputs */
|
||
rounded-xl /* 12px - cards, panels */
|
||
rounded-2xl /* 16px - large panels */
|
||
rounded-full /* pill buttons */`,usedIn:"Badges (md), buttons (lg), cards (xl), panels (2xl)"},{id:"atom-glass-btn",name:"Glass Button",category:"atoms",description:"48px height, glass morphism background",code:`<button class="glass-button">
|
||
Action
|
||
</button>
|
||
|
||
/* glass-button:
|
||
height: 48px
|
||
background: rgba(0,0,0,0.6)
|
||
backdrop-filter: blur(18px)
|
||
border-radius: 12px
|
||
border: 1px solid rgba(255,255,255,0.12)
|
||
*/`,usedIn:"ChatInput send, modal actions, primary controls"},{id:"atom-glass-btn-sm",name:"Glass Button Small",category:"atoms",description:"Compact glass button variant",code:`<button class="glass-button-sm">
|
||
Small
|
||
</button>
|
||
|
||
/* Compact variant of glass-button */`,usedIn:"ChatInput send/stop buttons, inline actions"},{id:"atom-icon-btn",name:"Icon Button",category:"atoms",description:"Path glass icon, 32-36px square",code:`<button class="w-9 h-9 rounded-xl path-glass-icon
|
||
flex items-center justify-center">
|
||
<svg class="w-4 h-4" ...>
|
||
</button>
|
||
|
||
/* path-glass-icon:
|
||
background: transparent
|
||
transition: colors
|
||
hover: bg-white/10
|
||
*/`,usedIn:"ChatHeader toolbar, detail back buttons, close buttons"},{id:"atom-badge",name:"Genre Badge",category:"atoms",description:"Tiny pill badge for tags/genres",code:`<span class="text-xs px-2 py-1 rounded-md
|
||
font-medium bg-white/10 text-white/60">
|
||
Science Fiction
|
||
</span>`,usedIn:"FilmGrid, SongGrid, BookGrid, TVSeriesGrid genre filters"},{id:"atom-nav-tab",name:"Nav Tab",category:"atoms",description:"Content panel tab with active state",code:`<button class="nav-tab-active">
|
||
Films
|
||
</button>
|
||
|
||
/* Active: accent underline
|
||
Inactive: text-white/50 hover:text-white
|
||
Transition: 200ms */`,usedIn:"ContentPanel tab bar, mobile content tab filters"},{id:"atom-input",name:"Text Input",category:"atoms",description:"Search/filter input field",code:`<input
|
||
class="w-full px-3 py-2 rounded-lg text-xs
|
||
outline-none transition-colors
|
||
bg-white/5 text-white/80
|
||
placeholder:text-white/25
|
||
focus:bg-white/10"
|
||
placeholder="Search..."
|
||
/>`,usedIn:"All grid search bars, ProjectGrid new project"},{id:"atom-scrollbar",name:"Custom Scrollbar",category:"atoms",description:"Thin translucent scrollbar for scroll areas",code:`.custom-scrollbar::-webkit-scrollbar {
|
||
width: 4px;
|
||
}
|
||
.custom-scrollbar::-webkit-scrollbar-thumb {
|
||
background: rgba(255,255,255, 0.1);
|
||
border-radius: 2px;
|
||
}
|
||
/* Also: .scrollbar-hide hides completely */`,usedIn:"Content grids, chat message list, file trees"},{id:"mol-glass-card",name:"Glass Card",category:"molecules",description:"Frosted glass card with border",code:`<div class="glass-card">
|
||
<h3>Title</h3>
|
||
<p>Content</p>
|
||
</div>
|
||
|
||
/* glass-card:
|
||
background: rgba(0,0,0,0.65)
|
||
backdrop-filter: blur(18px)
|
||
border: 1px solid rgba(255,255,255,0.12)
|
||
border-radius: 16px
|
||
padding: 16px
|
||
*/`,usedIn:"ChatWindow container, content panel wrapper"},{id:"mol-gradient-card",name:"Gradient Card",category:"molecules",description:"Card with gradient background",code:`<div class="gradient-card">
|
||
<h3>Featured</h3>
|
||
<p>Content</p>
|
||
</div>
|
||
|
||
/* gradient-card:
|
||
background: linear-gradient(135deg, ...)
|
||
border-radius: 16px
|
||
*/`,usedIn:"Featured content highlights, promotional sections"},{id:"mol-source-link",name:"Source Link Row",category:"molecules",description:"Icon + label + external link arrow",code:`<a class="flex items-center justify-between
|
||
p-3 rounded-xl bg-white/5
|
||
hover:bg-white/10 transition-colors">
|
||
<div class="flex items-center gap-2.5">
|
||
<span class="text-sm">icon</span>
|
||
<div>
|
||
<p class="text-xs font-medium
|
||
text-white/80">Name</p>
|
||
<p class="text-xs
|
||
text-white/30">Description</p>
|
||
</div>
|
||
</div>
|
||
<svg><!-- external link icon --></svg>
|
||
</a>`,usedIn:"FilmDetail, SongDetail, PodcastDetail sources"},{id:"mol-banner-hero",name:"Banner Hero",category:"molecules",description:"Aspect 16/7 image with gradient overlay",code:`<div class="relative w-full aspect-[16/7]
|
||
overflow-hidden">
|
||
<img :src="url" class="absolute inset-0
|
||
w-full h-full object-cover" />
|
||
<div class="absolute inset-0
|
||
bg-gradient-to-t from-black/80
|
||
via-black/30 to-transparent" />
|
||
<div class="absolute bottom-0 p-4">
|
||
<h2 class="text-lg font-bold
|
||
text-white">Title</h2>
|
||
</div>
|
||
</div>`,usedIn:"FilmDetail, TVSeriesDetail, BookDetail banners"},{id:"mol-cover-card",name:"Cover Card",category:"molecules",description:"Poster/cover image card with overlay text",code:`<button class="group rounded-2xl overflow-hidden">
|
||
<div class="aspect-[2/3] relative">
|
||
<img class="w-full h-full object-cover
|
||
group-hover:scale-110
|
||
transition-transform duration-300" />
|
||
<div class="absolute inset-0
|
||
bg-gradient-to-t from-black/60
|
||
to-transparent" />
|
||
<div class="absolute bottom-0 p-2">
|
||
<p class="text-xs text-white/90">
|
||
Title</p>
|
||
</div>
|
||
</div>
|
||
</button>`,usedIn:"FilmGrid, TVSeriesGrid, SongGrid, BookGrid cards"},{id:"org-chat-bubble",name:"Chat Bubble",category:"organisms",description:"AI/User message bubble with streaming",code:`<!-- User bubble -->
|
||
<div class="flex justify-end">
|
||
<div class="glass-card max-w-[85%]
|
||
px-4 py-3 text-sm text-white/90">
|
||
Message text
|
||
</div>
|
||
</div>
|
||
|
||
<!-- AI bubble -->
|
||
<div class="flex justify-start">
|
||
<div class="max-w-[85%] px-4 py-3
|
||
text-sm text-white/80">
|
||
Response with markdown
|
||
</div>
|
||
</div>`,usedIn:"ChatMessage.vue — the primary chat interface"},{id:"org-content-panel",name:"Content Panel",category:"organisms",description:"Tabs + grid + detail navigation",code:`<!-- Structure -->
|
||
<div class="flex flex-col h-full">
|
||
<!-- Tab bar -->
|
||
<div class="flex gap-1 px-3 py-2">
|
||
<button class="nav-tab">Tab</button>
|
||
</div>
|
||
<!-- Grid view -->
|
||
<ContentGridView />
|
||
<!-- or Detail view -->
|
||
<DetailView />
|
||
</div>`,usedIn:"ChatPage middle column, mobile Content tab"},{id:"org-detail-view",name:"Detail View",category:"organisms",description:"Full detail with banner, back button, metadata",code:`<!-- Pattern: Banner → Meta → Content -->
|
||
<div class="h-full overflow-y-auto">
|
||
<!-- Banner with back button -->
|
||
<div class="relative aspect-[16/7]">
|
||
<img class="object-cover" />
|
||
<div class="gradient-overlay" />
|
||
<button class="absolute top-3 left-3
|
||
path-glass-icon">Back</button>
|
||
<div class="absolute bottom-0 p-4">
|
||
<h2>Title</h2>
|
||
<div>Metadata</div>
|
||
</div>
|
||
</div>
|
||
<!-- Body -->
|
||
<div class="p-4 space-y-4">
|
||
<p>Description</p>
|
||
<div>Genre badges</div>
|
||
<div>Source links</div>
|
||
</div>
|
||
</div>`,usedIn:"FilmDetail, BookDetail, TVSeriesDetail, SongDetail, PodcastDetail"},{id:"org-magazine",name:"Magazine Grid",category:"organisms",description:"Editorial tile layout with hero, wide, and half tiles",code:`<!-- Magazine structure -->
|
||
<div class="grid grid-cols-2 gap-px
|
||
bg-white/12">
|
||
<!-- Wide tile (col-span-2) -->
|
||
<button class="col-span-2 px-5 py-5
|
||
bg-[#0a0a0a]">
|
||
<p class="text-xs uppercase
|
||
tracking-[0.3em]">Label</p>
|
||
<h2 class="font-serif text-lg
|
||
font-bold">Title</h2>
|
||
<p class="font-serif text-sm">Text</p>
|
||
</button>
|
||
<!-- Half tiles -->
|
||
<button class="px-4 py-4 bg-[#0a0a0a]">
|
||
<h3 class="font-serif text-sm
|
||
font-bold">Title</h3>
|
||
<p class="font-serif text-xs">Text</p>
|
||
</button>
|
||
</div>`,usedIn:"MagazineGrid.vue — AI Brief editorial view"},{id:"org-nostr-note",name:"Nostr Note",category:"organisms",description:"Note card with avatar, author, content, zaps",code:`<div class="p-3 rounded-xl bg-white/[0.03]
|
||
border border-white/5">
|
||
<div class="flex items-start gap-2.5">
|
||
<div class="w-8 h-8 rounded-full
|
||
bg-purple-500/20 text-purple-400">
|
||
F
|
||
</div>
|
||
<div class="flex-1">
|
||
<span class="text-xs font-semibold">
|
||
author</span>
|
||
<p class="text-xs text-white/60">
|
||
Note content...</p>
|
||
<span class="text-xs
|
||
text-amber-500/70">21000 sats</span>
|
||
</div>
|
||
</div>
|
||
</div>`,usedIn:"NostrGrid.vue — Nostr feed tab"},{id:"anim-fade-up",name:"Fade Up",category:"atoms",description:"Entry animation: translate + opacity",code:`.animate-fade-up {
|
||
animation: fadeUp 900ms ease-out;
|
||
}
|
||
@keyframes fadeUp {
|
||
from {
|
||
opacity: 0;
|
||
transform: translateY(16px);
|
||
}
|
||
to {
|
||
opacity: 1;
|
||
transform: translateY(0);
|
||
}
|
||
}
|
||
/* Also: animate-fade-up-fast (400ms) */`,usedIn:"Empty states, initial load elements, ChatWindow"},{id:"anim-scale-in",name:"Scale In",category:"atoms",description:"Micro entrance with scale and opacity",code:`.animate-scale-in {
|
||
animation: scaleIn 250ms ease-out;
|
||
}
|
||
@keyframes scaleIn {
|
||
from {
|
||
opacity: 0;
|
||
transform: scale(0.95);
|
||
}
|
||
to {
|
||
opacity: 1;
|
||
transform: scale(1);
|
||
}
|
||
}`,usedIn:"Modal entries, tooltip appearances, popovers"}],_=B(()=>x.value==="all"?$:$.filter(o=>o.category===x.value));function b(o){l(o)}function d(o){const r=/(?:background-color|color|background):\s*([^;]+)/i.exec(o);if(!r)return"#333";const h=r[1].trim();return h.startsWith("#")||h.startsWith("rgb")||h.startsWith("hsl")?h:"#333"}return(o,r)=>(s(),n("div",Co,[e("div",{class:"shrink-0 px-4 py-3 flex items-center justify-between gap-2",style:q(t(c)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("span",{class:i(["text-sm font-semibold",t(c)?"text-white/90":"text-gray-900"])}," Design System ",2),e("p",{class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])},u(_.value.length)+" items ",3)],4),e("div",jo,[(s(),n(I,null,P(m,h=>e("button",{key:h.id,class:i(["text-xs px-2.5 py-1 rounded-md font-medium whitespace-nowrap transition-colors",x.value===h.id?"bg-accent/20 text-accent":t(c)?"bg-white/5 text-white/50 hover:bg-white/10":"bg-black/5 text-gray-500 hover:bg-black/10"]),onClick:M=>x.value=h.id},u(h.label),11,So)),64))]),e("div",Mo,[e("div",To,[(s(!0),n(I,null,P(_.value,h=>(s(),n("button",{key:h.id,class:i(["text-left p-3 rounded-xl transition-all duration-150 group relative",[t(w)&&t(v)(h.id)?"ring-2 ring-accent/50 bg-accent/10 cursor-pointer":t(c)?"bg-white/[0.03] hover:bg-white/[0.07] cursor-pointer":"bg-black/[0.02] hover:bg-black/[0.05] cursor-pointer"]]),onClick:M=>b(h)},[t(w)?(s(),n("div",{key:0,class:i(["absolute top-2 right-2 min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center z-10 cursor-pointer transition-colors",t(v)(h.id)?"bg-accent":t(c)?"bg-white/10 hover:bg-white/20":"bg-black/10 hover:bg-black/20"]),onClick:xe(M=>t(g)(h.id),["stop"])},[t(v)(h.id)?(s(),n("svg",Bo,[...r[0]||(r[0]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):f("",!0)],10,Io)):f("",!0),h.category==="colors"&&h.preview==="inline"?(s(),n("div",{key:1,class:i(["h-8 rounded-md mb-2 border",t(c)?"border-white/10":"border-black/10"]),style:q({background:d(h.code)})},null,6)):h.category==="spacing"&&h.preview==="inline"?(s(),n("div",Lo,[...r[1]||(r[1]=[e("div",{class:"bg-accent/40 rounded-sm",style:{width:"4px",height:"30%"}},null,-1),e("div",{class:"bg-accent/40 rounded-sm",style:{width:"4px",height:"50%"}},null,-1),e("div",{class:"bg-accent/40 rounded-sm",style:{width:"4px",height:"70%"}},null,-1),e("div",{class:"bg-accent/40 rounded-sm",style:{width:"4px",height:"100%"}},null,-1)])])):(s(),n("div",Po,[(s(),n("svg",{class:i(["w-5 h-5 transition-colors",t(c)?"text-white/20 group-hover:text-white/40":"text-black/15 group-hover:text-black/30"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[h.category==="atoms"?(s(),n("path",No)):h.category==="molecules"?(s(),n("path",Ao)):h.category==="organisms"?(s(),n("path",zo)):(s(),n("path",Eo))],2))])),e("h3",{class:i(["text-xs font-semibold leading-tight mb-0.5",t(c)?"text-white/80":"text-gray-800"])},u(h.name),3),e("p",{class:i(["text-xs leading-snug line-clamp-2",t(c)?"text-white/40":"text-gray-400"])},u(h.description),3)],10,Do))),128))])])]))}}),we=S(null),lt=S(!1),Re=S(!1),he=S(null);function me(){const a=B(()=>{if(!we.value)return null;try{return He(we.value)}catch{return null}}),c=B(()=>!!we.value),l=B(()=>a.value?a.value.slice(0,12)+"..."+a.value.slice(-8):null);function w(){lt.value=typeof window<"u"&&!!window.nostr}async function g(){if(he.value=null,!window.nostr){he.value="No Nostr extension detected. Install nos2x, Alby, or another NIP-07 extension.";return}Re.value=!0;try{const m=await window.nostr.getPublicKey();we.value=m}catch(m){he.value=m instanceof Error?m.message:"Failed to get public key"}finally{Re.value=!1}}async function v(m){if(he.value=null,!window.nostr)return he.value="No Nostr extension detected",null;try{return await window.nostr.signEvent(m)}catch($){return he.value=$ instanceof Error?$.message:"Failed to sign event",null}}function x(){we.value=null,he.value=null}return le(()=>{w(),setTimeout(w,500)}),{pubkey:we,npub:a,isAvailable:lt,isLoggedIn:c,isLoading:Re,error:he,truncatedNpub:l,login:g,logout:x,signEvent:v,checkAvailability:w}}const Ro="aiui-nostr-dms",Vo=1,ke="messages",je=S([]),Se=S(null),Ve=S(!1);let Me=null;function vt(){return Me||(Me=new Promise((a,c)=>{const l=indexedDB.open(Ro,Vo);l.onupgradeneeded=()=>{const w=l.result;if(!w.objectStoreNames.contains(ke)){const g=w.createObjectStore(ke,{keyPath:"id"});g.createIndex("contact","contactPubkey",{unique:!1}),g.createIndex("created_at","created_at",{unique:!1})}},l.onsuccess=()=>a(l.result),l.onerror=()=>{Me=null,c(l.error)}}),Me)}function Uo(a){return a.length<=12?a:a.slice(0,8)+"..."+a.slice(-4)}async function ot(a,c){const l=await vt(),w=a.fromPubkey===c?a.toPubkey:a.fromPubkey,g={...a,contactPubkey:w};return new Promise((v,x)=>{const m=l.transaction(ke,"readwrite");m.objectStore(ke).put(g),m.oncomplete=()=>v(),m.onerror=()=>x(m.error)})}async function Ue(){const a=await vt();return new Promise((c,l)=>{const g=a.transaction(ke,"readonly").objectStore(ke).getAll();g.onsuccess=()=>c(g.result),g.onerror=()=>l(g.error)})}function qe(a){const c=new Map;for(const w of a){const g=c.get(w.contactPubkey)??[];g.push(w),c.set(w.contactPubkey,g)}const l=[];for(const[w,g]of c)g.sort((v,x)=>v.created_at-x.created_at),l.push({contactPubkey:w,contactName:Uo(w),messages:g,lastMessage:g[g.length-1]??null,unread:0});return l.sort((w,g)=>(g.lastMessage?.created_at??0)-(w.lastMessage?.created_at??0)),l}function qo(){const{pubkey:a,isLoggedIn:c}=me(),l=B(()=>Se.value?je.value.find($=>$.contactPubkey===Se.value)??null:null);async function w(){if(c.value){Ve.value=!0;try{const $=await Ue();je.value=qe($)}catch{}finally{Ve.value=!1}}}async function g($,_){if(!window.nostr?.nip04||!a.value)return!1;try{const b=await window.nostr.nip04.encrypt($,_),d={kind:4,created_at:Math.floor(Date.now()/1e3),tags:[["p",$]],content:b},o=await window.nostr.signEvent(d);if(!o)return!1;const r={id:o.id,fromPubkey:a.value,toPubkey:$,content:_,created_at:o.created_at,decrypted:!0};await ot(r,a.value);const{publishEvent:h}=await pt(()=>import("./useNostr-DMx0ZF7J.js"),__vite__mapDeps([0,1,2])).then(j=>j.useNostr());await h(o);const M=await Ue();return je.value=qe(M),!0}catch{return!1}}async function v($,_,b,d){if(!(!window.nostr?.nip04||!a.value))try{const o=await window.nostr.nip04.decrypt(_,b),r={id:$,fromPubkey:_,toPubkey:a.value,content:o,created_at:d,decrypted:!0};await ot(r,a.value);const h=await Ue();je.value=qe(h)}catch{}}function x($){Se.value=$}function m(){Se.value=null}return{threads:je,activeThread:l,activeContact:Se,isLoading:Ve,loadDMs:w,sendDM:g,receiveDM:v,selectContact:x,clearActiveContact:m}}const Go={class:"h-full flex flex-col"},Oo={class:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.08]"},Ho={class:"flex-1 min-w-0"},Wo={class:"text-xs font-semibold text-white/80 truncate"},Ko={class:"text-xs text-white/30 font-mono truncate"},Yo={class:"text-xs leading-relaxed break-words"},Qo={class:"text-xs mt-1 text-white/25 tabular-nums"},Jo={class:"px-4 py-3 border-t border-white/[0.08]"},Zo={class:"flex gap-2"},Xo=["disabled"],ea={class:"p-4 border-b border-white/[0.08]"},ta={class:"flex items-center justify-between gap-2 mb-3"},sa={key:0,class:"space-y-2 mb-3"},na=["disabled"],la={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-1"},oa={key:0,class:"flex items-center justify-center py-12"},aa={key:1,class:"flex items-center justify-center py-12"},ia={key:2,class:"flex items-center justify-center py-12"},ra=["onClick"],ca={class:"flex items-start gap-2.5"},da={class:"w-8 h-8 rounded-full shrink-0 flex items-center justify-center text-xs font-bold bg-accent/20 text-accent"},ua={class:"flex-1 min-w-0"},ha={class:"flex items-center gap-1.5"},xa={class:"text-xs font-semibold truncate text-white/80"},pa={key:0,class:"text-xs ml-auto shrink-0 text-white/20"},ga={key:0,class:"text-xs mt-1 text-white/40 truncate"},ba=G({__name:"NostrDMs",setup(a){const{threads:c,activeThread:l,activeContact:w,isLoading:g,loadDMs:v,sendDM:x,selectContact:m,clearActiveContact:$}=qo(),{pubkey:_,isLoggedIn:b}=me(),d=S(""),o=S(!1),r=S(null),h=S(!1),M=S("");function j(k){const p=new Date(k*1e3),A=Math.floor((new Date().getTime()-p.getTime())/864e5);return A===0?p.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit"}):A<7?p.toLocaleDateString("en",{weekday:"short"}):p.toLocaleDateString("en",{month:"short",day:"numeric"})}async function L(){if(!d.value.trim()||o.value||!w.value)return;o.value=!0,await x(w.value,d.value.trim())&&(d.value="",await ye(),D()),o.value=!1}function D(){r.value&&(r.value.scrollTop=r.value.scrollHeight)}function C(){let k=M.value.trim();if(k.startsWith("npub"))try{k=gt(k)}catch{return}k.length===64&&(m(k),h.value=!1,M.value="")}return ce(w,async()=>{await ye(),D()}),le(()=>{v()}),(k,p)=>(s(),n("div",Go,[t(l)?(s(),n(I,{key:0},[e("div",Oo,[e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",onClick:p[0]||(p[0]=(...y)=>t($)&&t($)(...y))},[...p[4]||(p[4]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",Ho,[e("p",Wo,u(t(l).contactName),1),e("p",Ko,u(t(l).contactPubkey),1)])]),e("div",{ref_key:"messagesRef",ref:r,class:"flex-1 overflow-y-auto custom-scrollbar px-4 py-3 space-y-2"},[(s(!0),n(I,null,P(t(l).messages,y=>(s(),n("div",{key:y.id,class:i(["flex",y.fromPubkey===t(_)?"justify-end":"justify-start"])},[e("div",{class:i(["max-w-[80%] rounded-xl px-3 py-2",y.fromPubkey===t(_)?"bg-accent/15 text-white/80":"bg-white/5 text-white/70"])},[e("p",Yo,u(y.content),1),e("p",Qo,u(j(y.created_at)),1)],2)],2))),128))],512),e("div",Jo,[e("div",Zo,[W(e("input",{"onUpdate:modelValue":p[1]||(p[1]=y=>d.value=y),type:"text",placeholder:"Type a message...",class:"flex-1 px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",onKeydown:ae(L,["enter"])},null,544),[[J,d.value]]),e("button",{class:"px-3 py-2 rounded-lg text-xs bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!d.value.trim()||o.value,onClick:L}," Send ",8,Xo)])])],64)):(s(),n(I,{key:1},[e("div",ea,[e("div",ta,[p[5]||(p[5]=e("h3",{class:"text-sm font-bold text-white/90"},"Messages",-1)),e("button",{class:"text-xs px-2.5 py-1 rounded bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors",onClick:p[2]||(p[2]=y=>h.value=!h.value)},u(h.value?"Cancel":"New"),1)]),h.value?(s(),n("div",sa,[W(e("input",{"onUpdate:modelValue":p[3]||(p[3]=y=>M.value=y),type:"text",placeholder:"Recipient hex pubkey or npub...",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono"},null,512),[[J,M.value]]),e("button",{class:"text-xs px-2.5 py-1 rounded bg-white/5 text-white/60 hover:bg-white/10 transition-colors disabled:opacity-30",disabled:!M.value.trim(),onClick:C}," Start conversation ",8,na)])):f("",!0)]),e("div",la,[t(b)?t(g)?(s(),n("div",aa,[...p[7]||(p[7]=[e("p",{class:"text-xs text-white/30"},"Loading messages...",-1)])])):t(c).length===0?(s(),n("div",ia,[...p[8]||(p[8]=[e("p",{class:"text-xs text-white/30"},"No messages yet",-1)])])):f("",!0):(s(),n("div",oa,[...p[6]||(p[6]=[e("p",{class:"text-xs text-white/30"},"Sign in with Nostr to use DMs",-1)])])),(s(!0),n(I,null,P(t(c),y=>(s(),n("button",{key:y.contactPubkey,class:"w-full text-left p-3 rounded-xl transition-all duration-150 bg-white/[0.03] hover:bg-white/[0.07] border border-white/5",onClick:A=>t(m)(y.contactPubkey)},[e("div",ca,[e("div",da,u(y.contactName.charAt(0).toUpperCase()),1),e("div",ua,[e("div",ha,[e("span",xa,u(y.contactName),1),y.lastMessage?(s(),n("span",pa,u(j(y.lastMessage.created_at)),1)):f("",!0)]),y.lastMessage?(s(),n("p",ga,u(y.lastMessage.content),1)):f("",!0)])])],8,ra))),128))])],64))]))}}),va={class:"h-full flex flex-col"},fa={class:"p-4 border-b border-white/[0.08]"},ma={class:"flex gap-2"},wa=["disabled"],ya={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},ka={class:"flex items-center gap-2"},$a={class:"text-xs font-mono text-white/70 truncate flex-1"},_a={class:"flex items-center gap-2 flex-wrap"},Ca=["onClick"],ja=["onClick"],Sa=["disabled","onClick"],Ma=["onClick"],Ta={key:0,class:"mt-4 pt-4 border-t border-white/5"},Da=["disabled"],Ia={key:0,class:"text-xs mt-1 text-white/30"},Ba=G({__name:"NostrRelayManager",setup(a){const{relayStates:c,addRelay:l,removeRelay:w,toggleRelayRead:g,toggleRelayWrite:v,testRelay:x,importNIP65Relays:m,fetchNote:$}=Ie(),{isLoggedIn:_,pubkey:b}=me(),d=S(""),o=S(null),r=Pe({}),h=S(!1),M=S("");function j(){let C=d.value.trim();C&&(!C.startsWith("wss://")&&!C.startsWith("ws://")&&(C="wss://"+C),l(C),d.value="")}async function L(C){o.value=C;const k=await x(C);r[C]=k,o.value=null}async function D(){if(!b.value)return;h.value=!0,M.value="Fetching relay list...";const C=await $(b.value,5e3);C?(m({id:C.id,pubkey:C.pubkey,kind:10002,content:C.content,created_at:C.created_at,tags:C.tags,sig:""}),M.value="Imported relays from NIP-65"):M.value="No NIP-65 relay list found",h.value=!1}return(C,k)=>(s(),n("div",va,[e("div",fa,[k[1]||(k[1]=e("h3",{class:"text-sm font-bold text-white/90 mb-3"},"Relay Management",-1)),e("div",ma,[W(e("input",{"onUpdate:modelValue":k[0]||(k[0]=p=>d.value=p),type:"text",placeholder:"wss://relay.example.com",class:"flex-1 px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",onKeydown:ae(j,["enter"])},null,544),[[J,d.value]]),e("button",{class:"px-4 min-h-[44px] rounded-lg text-sm bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!d.value.trim(),onClick:j}," Add ",8,wa)])]),e("div",ya,[(s(!0),n(I,null,P(t(c),p=>(s(),n("div",{key:p.url,class:"rounded-xl bg-white/[0.03] border border-white/5 p-3 space-y-2"},[e("div",ka,[e("span",{class:i(["w-2 h-2 rounded-full shrink-0",p.connected?"bg-emerald-500":"bg-red-400/60"])},null,2),e("span",$a,u(p.url),1),p.latencyMs!==null?(s(),n("span",{key:0,class:i(["text-xs tabular-nums shrink-0",p.latencyMs<200?"text-emerald-400/60":p.latencyMs<500?"text-yellow-400/60":"text-red-400/60"])},u(p.latencyMs)+"ms ",3)):f("",!0),e("span",{class:i(["text-xs shrink-0",p.connected?"text-emerald-400/60":"text-red-400/60"])},u(p.connected?"Connected":"Disconnected"),3)]),e("div",_a,[e("button",{class:i(["text-sm px-3 min-h-[44px] rounded-lg transition-colors",p.read?"bg-accent/15 text-accent/80":"bg-white/5 text-white/30 hover:text-white/50"]),onClick:y=>t(g)(p.url)}," Read ",10,Ca),e("button",{class:i(["text-sm px-3 min-h-[44px] rounded-lg transition-colors",p.write?"bg-accent/15 text-accent/80":"bg-white/5 text-white/30 hover:text-white/50"]),onClick:y=>t(v)(p.url)}," Write ",10,ja),k[2]||(k[2]=e("div",{class:"flex-1"},null,-1)),e("button",{class:"text-sm px-3 min-h-[44px] rounded-lg bg-white/5 text-white/30 hover:text-white/50 transition-colors",disabled:o.value===p.url,onClick:y=>L(p.url)},u(o.value===p.url?"Testing...":"Test"),9,Sa),e("button",{class:"text-sm px-3 min-h-[44px] rounded-lg bg-white/5 text-red-400/50 hover:text-red-400/80 hover:bg-red-400/10 transition-colors",onClick:y=>t(w)(p.url)}," Remove ",8,Ma)]),r[p.url]!==void 0?(s(),n("p",{key:0,class:i(["text-xs",r[p.url]!==null?"text-emerald-400/60":"text-red-400/60"])},u(r[p.url]!==null?`Reachable (${r[p.url]}ms)`:"Unreachable"),3)):f("",!0)]))),128)),t(_)?(s(),n("div",Ta,[e("button",{class:"w-full text-left px-3 min-h-[44px] rounded-lg text-sm bg-white/5 text-white/40 hover:text-white/60 hover:bg-white/10 transition-colors",disabled:h.value,onClick:D},u(h.value?"Importing...":"Import relays from NIP-65 (kind:10002)"),9,Da),M.value?(s(),n("p",Ia,u(M.value),1)):f("",!0)])):f("",!0)])]))}}),La={class:"h-full flex flex-col"},Pa={key:0,class:"flex-1 flex items-center justify-center"},Na={key:1,class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-4"},Aa={class:"rounded-xl overflow-hidden border border-white/5"},za={class:"px-4 pb-4 -mt-8"},Ea={key:0,class:"text-lg font-bold text-accent"},Fa={class:"text-sm font-bold text-white/90 mt-2"},Ra={key:0,class:"text-xs text-purple-400/60"},Va={key:1,class:"text-xs text-white/50 mt-1 line-clamp-2"},Ua={class:"space-y-3"},qa=["disabled"],Ga=G({__name:"NostrProfileEditor",setup(a){const{isLoggedIn:c,signEvent:l,pubkey:w}=me(),{publishEvent:g,fetchNote:v}=Ie(),x=Pe({name:"",display_name:"",about:"",picture:"",banner:"",website:"",nip05:"",lud16:""}),m=S(!1),$=S(""),_=S(!1);async function b(){if(!w.value)return;const o=await v(w.value,5e3);if(o&&o.kind===0)try{const r=JSON.parse(o.content);Object.assign(x,r)}catch{}}async function d(){if(!c.value)return;m.value=!0,$.value="";const o={};for(const[L,D]of Object.entries(x))D&&(o[L]=D);const r={kind:0,created_at:Math.floor(Date.now()/1e3),tags:[],content:JSON.stringify(o)},h=await l(r);if(!h){m.value=!1,$.value="Signing failed",_.value=!1;return}const M=await g(h),j=M.filter(L=>L.success).length;m.value=!1,j>0?($.value=`Published to ${j}/${M.length} relays`,_.value=!0):($.value="Failed to publish to any relay",_.value=!1)}return le(()=>{b()}),(o,r)=>(s(),n("div",La,[r[17]||(r[17]=e("div",{class:"p-4 border-b border-white/[0.08]"},[e("h3",{class:"text-sm font-bold text-white/90"},"Nostr Profile")],-1)),t(c)?(s(),n("div",Na,[e("div",Aa,[e("div",{class:i(["h-24 bg-cover bg-center",x.banner?"":"bg-gradient-to-r from-accent/20 to-purple-500/20"]),style:q(x.banner?{backgroundImage:`url(${x.banner})`}:{})},null,6),e("div",za,[e("div",{class:i(["w-16 h-16 rounded-full border-2 border-black bg-cover bg-center flex items-center justify-center",x.picture?"":"bg-accent/20"]),style:q(x.picture?{backgroundImage:`url(${x.picture})`}:{})},[x.picture?f("",!0):(s(),n("span",Ea,u((x.display_name||x.name||"?").charAt(0).toUpperCase()),1))],6),e("p",Fa,u(x.display_name||x.name||"Anonymous"),1),x.nip05?(s(),n("p",Ra,u(x.nip05),1)):f("",!0),x.about?(s(),n("p",Va,u(x.about),1)):f("",!0)])]),e("div",Ua,[e("div",null,[r[9]||(r[9]=e("label",{class:"text-xs text-white/30 block mb-1"},"Display Name",-1)),W(e("input",{"onUpdate:modelValue":r[0]||(r[0]=h=>x.display_name=h),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",placeholder:"Your display name"},null,512),[[J,x.display_name]])]),e("div",null,[r[10]||(r[10]=e("label",{class:"text-xs text-white/30 block mb-1"},"Username",-1)),W(e("input",{"onUpdate:modelValue":r[1]||(r[1]=h=>x.name=h),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",placeholder:"username"},null,512),[[J,x.name]])]),e("div",null,[r[11]||(r[11]=e("label",{class:"text-xs text-white/30 block mb-1"},"Bio",-1)),W(e("textarea",{"onUpdate:modelValue":r[2]||(r[2]=h=>x.about=h),class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors resize-none min-h-[60px]",placeholder:"Tell the world about yourself"},null,512),[[J,x.about]])]),e("div",null,[r[12]||(r[12]=e("label",{class:"text-xs text-white/30 block mb-1"},"Avatar URL",-1)),W(e("input",{"onUpdate:modelValue":r[3]||(r[3]=h=>x.picture=h),type:"url",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"https://example.com/avatar.jpg"},null,512),[[J,x.picture]])]),e("div",null,[r[13]||(r[13]=e("label",{class:"text-xs text-white/30 block mb-1"},"Banner URL",-1)),W(e("input",{"onUpdate:modelValue":r[4]||(r[4]=h=>x.banner=h),type:"url",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"https://example.com/banner.jpg"},null,512),[[J,x.banner]])]),e("div",null,[r[14]||(r[14]=e("label",{class:"text-xs text-white/30 block mb-1"},"Website",-1)),W(e("input",{"onUpdate:modelValue":r[5]||(r[5]=h=>x.website=h),type:"url",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"https://example.com"},null,512),[[J,x.website]])]),e("div",null,[r[15]||(r[15]=e("label",{class:"text-xs text-white/30 block mb-1"},"NIP-05 Address",-1)),W(e("input",{"onUpdate:modelValue":r[6]||(r[6]=h=>x.nip05=h),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"you@example.com"},null,512),[[J,x.nip05]])]),e("div",null,[r[16]||(r[16]=e("label",{class:"text-xs text-white/30 block mb-1"},"Lightning Address",-1)),W(e("input",{"onUpdate:modelValue":r[7]||(r[7]=h=>x.lud16=h),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",placeholder:"you@getalby.com"},null,512),[[J,x.lud16]])]),e("button",{class:"w-full min-h-[44px] rounded-lg text-sm font-medium bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:m.value,onClick:d},u(m.value?"Publishing...":"Publish Profile (kind:0)"),9,qa),$.value?(s(),n("div",{key:0,class:i(["text-xs text-center",_.value?"text-emerald-400/60":"text-red-400/60"])},u($.value),3)):f("",!0)])])):(s(),n("div",Pa,[...r[8]||(r[8]=[e("p",{class:"text-xs text-white/30"},"Sign in with Nostr to edit your profile",-1)])]))]))}}),Oa={class:"relative glass-card w-[320px] max-w-[90vw] p-5 space-y-4 animate-scale-in"},Ha={class:"flex items-center justify-between"},Wa={class:"text-xs text-white/40 truncate font-mono"},Ka={class:"flex gap-1.5 flex-wrap"},Ya=["onClick"],Qa=["disabled"],Ja={key:0,class:"space-y-2"},Za={class:"flex justify-center"},Xa={class:"flex gap-1"},ei=["value"],ti=["href"],si={key:1,class:"text-xs text-red-400/60 text-center"},ni=G({__name:"ZapDialog",props:{isOpen:{type:Boolean},targetName:{},lightningAddress:{}},emits:["close"],setup(a,{emit:c}){const l=a,w=c,g=S(null),v=S(null),x=[21,100,500,1e3,5e3,1e4],m=S(21),$=S(""),_=S(""),b=S(!1),d=S(""),o=S(!1),r=S(null);function h(k){return k>=1e3?`${(k/1e3).toFixed(k%1e3===0?0:1)}k`:String(k)}function M(){w("close"),_.value="",d.value="",$.value=""}async function j(){if(!(!l.lightningAddress||!m.value)){b.value=!0,d.value="",_.value="";try{const[k,p]=l.lightningAddress.split("@");if(!k||!p)throw new Error("Invalid Lightning address");const y=await fetch(`https://${p}/.well-known/lnurlp/${k}`);if(!y.ok)throw new Error("Failed to fetch LNURL");const A=await y.json();if(A.status==="ERROR")throw new Error(A.reason||"LNURL error");const V=m.value*1e3;if(V<(A.minSendable??0))throw new Error(`Minimum: ${Math.ceil((A.minSendable??0)/1e3)} sats`);if(V>(A.maxSendable??1/0))throw new Error(`Maximum: ${Math.floor((A.maxSendable??0)/1e3)} sats`);let E=A.callback;const Q=E.includes("?")?"&":"?";E+=`${Q}amount=${V}`,$.value&&(E+=`&comment=${encodeURIComponent($.value)}`);const H=await fetch(E);if(!H.ok)throw new Error("Failed to get invoice");const K=await H.json();if(K.status==="ERROR")throw new Error(K.reason||"Invoice error");_.value=K.pr,await ye(),L(K.pr)}catch(k){d.value=k instanceof Error?k.message:"Zap failed"}finally{b.value=!1}}}function L(k){const p=r.value;if(!p)return;const y=p.getContext("2d");if(!y)return;y.fillStyle="#1a1a1a",y.fillRect(0,0,200,200),y.fillStyle="#F7931A",y.font="10px monospace",y.textAlign="center";const A=[];for(let E=0;E<k.length;E+=30)A.push(k.slice(E,E+30));const V=Math.max(10,100-A.length*6);A.forEach((E,Q)=>{y.fillText(E,100,V+Q*12)})}function D(){navigator.clipboard.writeText(_.value),o.value=!0,setTimeout(()=>{o.value=!1},2e3)}function C(k){const p=g.value;if(!p)return;const y=p.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(y.length===0)return;const A=y[0],V=y[y.length-1];k.shiftKey&&document.activeElement===A?(k.preventDefault(),V.focus()):!k.shiftKey&&document.activeElement===V&&(k.preventDefault(),A.focus())}return ce(()=>l.isOpen,async k=>{k?(await ye(),v.value?.focus()):(_.value="",d.value="")}),(k,p)=>a.isOpen?(s(),n("div",{key:0,ref_key:"dialogRef",ref:g,role:"dialog","aria-modal":"true","aria-label":"Send zap",class:"fixed inset-0 z-50 flex items-center justify-center",onClick:xe(M,["self"]),onKeydown:[ae(M,["escape"]),ae(C,["tab"])]},[e("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:M}),e("div",Oa,[e("div",Ha,[p[3]||(p[3]=e("h3",{class:"text-sm font-bold text-white/90"},"Zap",-1)),e("button",{ref_key:"closeButtonRef",ref:v,class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded text-white/40 hover:text-white/70 transition-colors","aria-label":"Close",onClick:M},[...p[2]||(p[2]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],512)]),e("p",Wa,u(a.targetName),1),e("div",Ka,[(s(),n(I,null,P(x,y=>e("button",{key:y,class:i(["text-xs px-2.5 py-1.5 rounded-lg transition-colors",m.value===y?"bg-accent/20 text-accent border border-accent/30":"bg-white/5 text-white/50 hover:bg-white/10"]),onClick:A=>m.value=y},u(h(y)),11,Ya)),64))]),e("div",null,[p[4]||(p[4]=e("label",{class:"text-xs text-white/30 block mb-1"},"Amount (sats)",-1)),W(e("input",{"onUpdate:modelValue":p[0]||(p[0]=y=>m.value=y),type:"number",min:"1",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors tabular-nums",placeholder:"21"},null,512),[[J,m.value,void 0,{number:!0}]])]),e("div",null,[p[5]||(p[5]=e("label",{class:"text-xs text-white/30 block mb-1"},"Message (optional)",-1)),W(e("input",{"onUpdate:modelValue":p[1]||(p[1]=y=>$.value=y),type:"text",class:"w-full px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",placeholder:"Great post!"},null,512),[[J,$.value]])]),e("button",{class:"w-full py-2.5 rounded-lg text-xs font-medium bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!m.value||m.value<1||b.value,onClick:j},u(b.value?"Generating invoice...":`Zap ${h(m.value)} sats`),9,Qa),_.value?(s(),n("div",Ja,[p[6]||(p[6]=e("p",{class:"text-xs text-white/30 text-center"},"Scan or tap to pay",-1)),e("div",Za,[e("canvas",{ref_key:"qrCanvas",ref:r,class:"rounded-lg",width:"200",height:"200"},null,512)]),e("div",Xa,[e("input",{value:_.value,readonly:"",class:"flex-1 px-2 py-1.5 rounded text-base bg-white/5 text-white/40 font-mono truncate outline-none"},null,8,ei),e("button",{class:"px-2 py-1.5 rounded text-xs bg-white/5 text-white/40 hover:text-white/60 transition-colors",onClick:D},u(o.value?"Copied":"Copy"),1)]),e("a",{href:"lightning:"+_.value,class:"block w-full py-2 rounded-lg text-xs text-center bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors"}," Open in wallet ",8,ti)])):f("",!0),d.value?(s(),n("p",si,u(d.value),1)):f("",!0)])],544)):f("",!0)}}),li={class:"h-full flex flex-col"},oi={class:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.08]"},ai={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},ii={key:0,class:"flex items-center justify-center py-12"},ri={key:1,class:"rounded-xl bg-white/[0.05] border border-white/10 p-3"},ci={class:"flex items-center gap-1.5 mb-1"},di={class:"w-6 h-6 rounded-full shrink-0 flex items-center justify-center text-xs font-bold bg-purple-500/20 text-purple-400"},ui={class:"text-xs font-semibold text-white/80"},hi={class:"text-xs ml-auto text-white/20"},xi={class:"text-xs text-white/70 leading-relaxed whitespace-pre-wrap"},pi={key:2,class:"space-y-1"},gi={class:"text-xs text-white/30 font-medium mt-3 mb-1"},bi={key:3,class:"flex items-center justify-center py-12"},vi={key:0,class:"px-4 py-3 border-t border-white/[0.08]"},fi={key:0,class:"text-xs text-white/30 mb-1"},mi={class:"flex gap-2"},wi=["disabled"],yi=G({__name:"NostrThread",props:{noteId:{}},emits:["back"],setup(a){const c=Yt(()=>pt(()=>import("./ThreadNode-uZHjueqh.js"),__vite__mapDeps([3,1,2]))),l=a,{fetchNote:w,publishEvent:g}=Ie(),{isLoggedIn:v,signEvent:x,pubkey:m}=me(),$=S(null),_=S([]),b=S(!0),d=S(null),o=S("");function r(k){const p=new Date(k*1e3);return p.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit"})+" "+p.toLocaleDateString("en",{month:"short",day:"numeric"})}function h(k){return k.length<=12?k:k.slice(0,8)+"..."+k.slice(-4)}async function M(){b.value=!0;const k=await w(l.noteId);if(!k){b.value=!1;return}$.value=k;const p=await j(l.noteId);_.value=L(p,l.noteId),b.value=!1}async function j(k){return new Promise(p=>{const y=[],A="thread-"+Math.random().toString(36).slice(2,8);let V=!1;const E=setTimeout(()=>{V||(V=!0,p(y))},8e3),Q="wss://relay.nostr.band";try{const H=new WebSocket(Q);H.onopen=()=>{H.send(JSON.stringify(["REQ",A,{kinds:[1],"#e":[k],limit:100}]))},H.onmessage=K=>{try{const F=JSON.parse(K.data);if(Array.isArray(F)&&F[0]==="EVENT"&&F[1]===A&&F[2]){const O=F[2];y.find(X=>X.id===O.id)||y.push({id:O.id,pubkey:O.pubkey,authorName:h(O.pubkey),kind:O.kind,content:O.content,created_at:O.created_at,tags:O.tags??[]})}Array.isArray(F)&&F[0]==="EOSE"&&F[1]===A&&(clearTimeout(E),H.close(),V||(V=!0,p(y)))}catch{}},H.onerror=()=>{clearTimeout(E),V||(V=!0,p(y))},H.onclose=()=>{V||(V=!0,p(y))}}catch{clearTimeout(E),p(y)}})}function L(k,p,y=5){const A=new Map;for(const E of k){let Q=p;const H=E.tags.filter(F=>F[0]==="e");if(H.length>0){const F=H.find(O=>O[3]==="reply");Q=F?F[1]:H[H.length-1][1]}const K=A.get(Q)??[];K.push(E),A.set(Q,K)}function V(E,Q){const H=A.get(E)??[];return H.sort((K,F)=>K.created_at-F.created_at),H.map(K=>({note:K,children:Q<y?V(K.id,Q+1):[]}))}return V(p,0)}function D(k){d.value=k}async function C(){if(!o.value.trim()||!m.value)return;const k=d.value??$.value;if(!k)return;const p=[["e",l.noteId,"","root"]];k.id!==l.noteId&&p.push(["e",k.id,"","reply"]),p.push(["p",k.pubkey]);const y={kind:1,created_at:Math.floor(Date.now()/1e3),tags:p,content:o.value.trim()},A=await x(y);A&&(await g(A),o.value="",d.value=null,await M())}return le(()=>{M()}),(k,p)=>(s(),n("div",li,[e("div",oi,[e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",onClick:p[0]||(p[0]=y=>k.$emit("back"))},[...p[3]||(p[3]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),p[4]||(p[4]=e("h3",{class:"text-sm font-bold text-white/90"},"Thread",-1))]),e("div",ai,[b.value?(s(),n("div",ii,[...p[5]||(p[5]=[e("p",{class:"text-xs text-white/30"},"Loading thread...",-1)])])):f("",!0),$.value?(s(),n("div",ri,[e("div",ci,[e("div",di,u($.value.authorName?.charAt(0)?.toUpperCase()??"?"),1),e("span",ui,u($.value.authorName??"anon"),1),e("span",hi,u(r($.value.created_at)),1)]),e("p",xi,u($.value.content),1)])):f("",!0),_.value.length>0?(s(),n("div",pi,[e("p",gi,u(_.value.length)+" replies",1),(s(!0),n(I,null,P(_.value,y=>(s(),U(t(c),{key:y.note.id,node:y,depth:0,onReply:D},null,8,["node"]))),128))])):f("",!0),!b.value&&!$.value?(s(),n("div",bi,[...p[6]||(p[6]=[e("p",{class:"text-xs text-white/30"},"Thread not found",-1)])])):f("",!0)]),$.value&&t(v)?(s(),n("div",vi,[d.value?(s(),n("p",fi,[ne(" Replying to "+u(d.value.authorName??"anon")+" ",1),e("button",{class:"text-accent/60 ml-1",onClick:p[1]||(p[1]=y=>d.value=null)},"cancel")])):f("",!0),e("div",mi,[W(e("input",{"onUpdate:modelValue":p[2]||(p[2]=y=>o.value=y),type:"text",placeholder:"Reply...",class:"flex-1 px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors",onKeydown:ae(C,["enter"])},null,544),[[J,o.value]]),e("button",{class:"px-3 py-2 rounded-lg text-xs bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!o.value.trim(),onClick:C}," Reply ",8,wi)])])):f("",!0)]))}}),ki={class:"h-full flex flex-col"},$i={class:"p-4 border-b border-white/[0.08]"},_i={class:"flex gap-1.5 flex-wrap"},Ci=["onClick"],ji={key:0,class:"flex-1 flex items-center justify-center"},Si={key:1,class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},Mi={key:0,class:"flex items-center justify-center py-12"},Ti={class:"flex gap-2 mb-3"},Di=["placeholder"],Ii=["disabled"],Bi={class:"w-6 h-6 rounded-full shrink-0 flex items-center justify-center text-xs font-bold bg-purple-500/20 text-purple-400"},Li={class:"flex-1 min-w-0"},Pi={class:"text-xs text-white/60 font-mono truncate"},Ni={key:0,class:"text-xs text-white/30"},Ai=["onClick"],zi={key:1,class:"flex items-center justify-center py-12"},Ei=["disabled"],Fi=G({__name:"NostrLists",setup(a){const{isLoggedIn:c,signEvent:l,pubkey:w}=me(),{publishEvent:g}=Ie(),v=[{kind:3,label:"Follows"},{kind:1e4,label:"Mute"},{kind:10001,label:"Pin"},{kind:10003,label:"Bookmarks"}],x=S(3),m=S([]),$=S(!1),_=S(!1),b=S(""),d=S(!1),o=S(""),r=S(!1);function h(k){return k.length<=16?k:k.slice(0,8)+"..."+k.slice(-8)}function M(k){return k.filter(p=>p[0]==="p"||p[0]==="e"||p[0]==="t").map(p=>{let y=h(p[1]);if(p[0]==="p")try{y=He(p[1])}catch{}return{tag:p[0],value:p[1],displayValue:y,relay:p[2]||void 0,petname:p[3]||void 0}})}async function j(k){if(w.value){$.value=!0,_.value=!1,m.value=[];try{const p=new WebSocket("wss://relay.nostr.band"),y="list-"+Math.random().toString(36).slice(2,8),A=setTimeout(()=>{p.close(),$.value=!1},8e3);p.onopen=()=>{p.send(JSON.stringify(["REQ",y,{kinds:[k],authors:[w.value],limit:1}]))},p.onmessage=V=>{try{const E=JSON.parse(V.data);if(Array.isArray(E)&&E[0]==="EVENT"&&E[1]===y&&E[2]){const Q=E[2];m.value=M(Q.tags)}Array.isArray(E)&&E[0]==="EOSE"&&(clearTimeout(A),p.close(),$.value=!1)}catch{}},p.onerror=()=>{clearTimeout(A),$.value=!1}}catch{$.value=!1}}}function L(){let k=b.value.trim();if(!k)return;let p=k;const y=x.value===3||x.value===1e4?"p":"e";if(k.startsWith("npub"))try{p=gt(k)}catch{return}if(m.value.find(V=>V.value===p))return;let A=h(p);if(y==="p")try{A=He(p)}catch{}m.value.push({tag:y,value:p,displayValue:A}),_.value=!0,b.value=""}function D(k){m.value=m.value.filter(p=>p.value!==k.value),_.value=!0}async function C(){if(!w.value)return;d.value=!0,o.value="";const k=m.value.map(E=>{const Q=[E.tag,E.value];return E.relay&&Q.push(E.relay),E.petname&&Q.push(E.petname),Q}),p={kind:x.value,created_at:Math.floor(Date.now()/1e3),tags:k,content:""},y=await l(p);if(!y){d.value=!1,o.value="Signing failed",r.value=!1;return}const A=await g(y),V=A.filter(E=>E.success).length;d.value=!1,_.value=!1,V>0?(o.value=`Published to ${V}/${A.length} relays`,r.value=!0):(o.value="Failed to publish",r.value=!1)}return le(()=>{j(x.value)}),(k,p)=>(s(),n("div",ki,[e("div",$i,[p[1]||(p[1]=e("h3",{class:"text-sm font-bold text-white/90 mb-3"},"Nostr Lists",-1)),e("div",_i,[(s(),n(I,null,P(v,y=>e("button",{key:y.kind,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",x.value===y.kind?"nav-tab-active":"text-white/40 hover:text-white/70 hover:bg-white/5"]),onClick:A=>{x.value=y.kind,j(y.kind)}},u(y.label),11,Ci)),64))])]),t(c)?(s(),n("div",Si,[$.value?(s(),n("div",Mi,[...p[3]||(p[3]=[e("p",{class:"text-xs text-white/30"},"Loading list...",-1)])])):f("",!0),e("div",Ti,[W(e("input",{"onUpdate:modelValue":p[0]||(p[0]=y=>b.value=y),type:"text",placeholder:x.value===3?"Add npub or hex pubkey...":"Add item (hex id or npub)...",class:"flex-1 px-3 py-2 rounded-lg text-base bg-white/5 text-white/80 placeholder:text-white/25 outline-none focus:bg-white/10 transition-colors font-mono",onKeydown:ae(L,["enter"])},null,40,Di),[[J,b.value]]),e("button",{class:"px-2.5 py-2 rounded-lg text-xs bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!b.value.trim(),onClick:L}," Add ",8,Ii)]),(s(!0),n(I,null,P(m.value,y=>(s(),n("div",{key:y.value,class:"flex items-center gap-2 p-2.5 rounded-xl bg-white/[0.03] border border-white/5"},[e("div",Bi,u(y.tag==="p"?"P":y.tag==="e"?"E":y.tag==="t"?"#":"?"),1),e("div",Li,[e("p",Pi,u(y.displayValue),1),y.petname?(s(),n("p",Ni,u(y.petname),1)):f("",!0)]),e("button",{class:"text-xs px-2 py-1 rounded bg-white/5 text-red-400/50 hover:text-red-400/80 hover:bg-red-400/10 transition-colors shrink-0",onClick:A=>D(y)}," Remove ",8,Ai)]))),128)),!$.value&&m.value.length===0?(s(),n("div",zi,[...p[4]||(p[4]=[e("p",{class:"text-xs text-white/30"},"List is empty",-1)])])):f("",!0),_.value?(s(),n("button",{key:2,class:"w-full py-2.5 rounded-lg text-xs font-medium bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30 mt-4",disabled:d.value,onClick:C},u(d.value?"Publishing...":"Publish updated list"),9,Ei)):f("",!0),o.value?(s(),n("p",{key:3,class:i(["text-xs text-center",r.value?"text-emerald-400/60":"text-red-400/60"])},u(o.value),3)):f("",!0)])):(s(),n("div",ji,[...p[2]||(p[2]=[e("p",{class:"text-xs text-white/30"},"Sign in with Nostr to manage lists",-1)])]))]))}}),Ri={class:"article-reader h-full flex"},Vi={key:0,class:"hidden lg:flex flex-col w-56 shrink-0 border-r border-white/5 overflow-y-auto scrollbar-hide py-4 px-3"},Ui=["onClick"],qi={class:"sticky top-0 z-10 flex items-center gap-2 px-4 py-2 bg-black/60 backdrop-blur-md border-b border-white/5"},Gi={class:"flex-1 text-xs text-white/40 truncate"},Oi=["disabled"],Hi=["disabled"],Wi={key:0,class:"lg:hidden bg-black/40 backdrop-blur-md border-b border-white/5 px-4 py-2 space-y-0.5 animate-fade-up-fast"},Ki=["onClick"],Yi={key:0,class:"text-xl font-bold text-white/96 mb-4"},Qi=["innerHTML"],Ji=G({__name:"ArticleReader",props:{content:{},title:{}},emits:["back"],setup(a){const c=a,l=[13,15,17,19,21],w=localStorage.getItem("aiui-article-font-size"),g=S(w?parseInt(w,10):1);ce(g,D=>{localStorage.setItem("aiui-article-font-size",String(D))});const v=S(!1),x=new as({html:!1,linkify:!0,breaks:!0});x.renderer.rules.heading_open=(D,C,k,p,y)=>{const A=D[C],V=parseInt(A.tag.slice(1),10);if(V===2||V===3){const H=(D[C+1]?.children?.reduce((K,F)=>K+(F.content||""),"")||"").toLowerCase().replace(/[^\w]+/g,"-").replace(/(^-|-$)/g,"");A.attrSet("id",H)}return y.renderToken(D,C,k)};const m=x.renderer.rules.link_open||function(D,C,k,p,y){return y.renderToken(D,C,k)};x.renderer.rules.link_open=function(D,C,k,p,y){return D[C].attrSet("target","_blank"),D[C].attrSet("rel","noopener noreferrer"),m(D,C,k,p,y)};const $=B(()=>x.render(c.content)),_=B(()=>{const D=[],C=/^(#{2,3})\s+(.+)$/gm;let k;for(;(k=C.exec(c.content))!==null;){const p=k[2].trim(),y=p.toLowerCase().replace(/[^\w]+/g,"-").replace(/(^-|-$)/g,"");D.push({text:p,id:y,level:k[1].length})}return D}),b=B(()=>{const D=c.content.split(/\s+/).length;return Math.max(1,Math.ceil(D/200))}),d=S(null),o=S(null),r=S(0);let h=null;function M(){if(!d.value)return;h?.disconnect(),h=new IntersectionObserver(C=>{for(const k of C)if(k.isIntersecting){const p=k.target.id,y=_.value.findIndex(A=>A.id===p);y>=0&&(r.value=y)}},{root:d.value,rootMargin:"-20% 0px -60% 0px",threshold:0}),o.value?.querySelectorAll("h2[id], h3[id]")?.forEach(C=>h.observe(C))}le(()=>{setTimeout(M,100)}),ce(()=>c.content,()=>{setTimeout(M,100)}),Qt(()=>{h?.disconnect()});function j(D){o.value?.querySelector(`#${CSS.escape(D)}`)?.scrollIntoView({behavior:"smooth",block:"start"})}function L(){const D=window.open("","_blank");D&&(D.document.write(`<!DOCTYPE html>
|
||
<html><head><title>${c.title||"Article"}</title>
|
||
<style>
|
||
body { font-family: Georgia, serif; max-width: 700px; margin: 2em auto; padding: 0 1em; line-height: 1.7; color: #222; }
|
||
h1 { font-size: 1.8em; margin-bottom: 0.5em; }
|
||
h2 { font-size: 1.4em; margin-top: 1.5em; }
|
||
h3 { font-size: 1.2em; margin-top: 1.2em; }
|
||
code { background: #f0f0f0; padding: 2px 5px; border-radius: 3px; }
|
||
pre { background: #f5f5f5; padding: 1em; overflow-x: auto; border-radius: 5px; }
|
||
blockquote { border-left: 3px solid #ccc; padding-left: 1em; color: #555; }
|
||
img { max-width: 100%; }
|
||
a { color: #0066cc; }
|
||
</style></head><body>
|
||
${c.title?`<h1>${c.title}</h1>`:""}
|
||
${$.value}
|
||
</body></html>`),D.document.close(),D.print())}return(D,C)=>(s(),n("div",Ri,[_.value.length>1?(s(),n("aside",Vi,[C[4]||(C[4]=e("p",{class:"text-xs uppercase tracking-wider text-white/30 mb-2 px-2"},"Contents",-1)),(s(!0),n(I,null,P(_.value,(k,p)=>(s(),n("button",{key:p,class:i(["text-left text-xs leading-relaxed py-1 px-2 rounded transition-colors truncate",[r.value===p?"text-accent bg-accent/10":"text-white/50 hover:text-white/70 hover:bg-white/5",k.level===3?"pl-5":""]]),onClick:y=>j(k.id)},u(k.text),11,Ui))),128))])):f("",!0),e("div",{ref_key:"contentRef",ref:d,class:"flex-1 overflow-y-auto scrollbar-hide"},[e("div",qi,[e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Back",onClick:C[0]||(C[0]=k=>D.$emit("back"))},[...C[5]||(C[5]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("span",Gi,u(b.value)+" min read",1),_.value.length>1?(s(),n("button",{key:0,class:"lg:hidden min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Table of contents",onClick:C[1]||(C[1]=k=>v.value=!v.value)},[...C[6]||(C[6]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h7"})],-1)])])):f("",!0),e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Decrease font size",disabled:g.value<=0,onClick:C[2]||(C[2]=k=>g.value=Math.max(0,g.value-1))},[...C[7]||(C[7]=[e("span",{class:"text-xs font-bold"},"A-",-1)])],8,Oi),e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Increase font size",disabled:g.value>=l.length-1,onClick:C[3]||(C[3]=k=>g.value=Math.min(l.length-1,g.value+1))},[...C[8]||(C[8]=[e("span",{class:"text-xs font-bold"},"A+",-1)])],8,Hi),e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",title:"Print",onClick:L},[...C[9]||(C[9]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})],-1)])])]),v.value&&_.value.length>1?(s(),n("div",Wi,[(s(!0),n(I,null,P(_.value,(k,p)=>(s(),n("button",{key:p,class:i(["block w-full text-left text-xs py-1 px-2 rounded transition-colors truncate",[r.value===p?"text-accent bg-accent/10":"text-white/50 hover:text-white/70",k.level===3?"pl-5":""]]),onClick:y=>{j(k.id),v.value=!1}},u(k.text),11,Ki))),128))])):f("",!0),e("article",{ref_key:"articleRef",ref:o,class:"article-body px-4 md:px-8 py-6 max-w-prose mx-auto leading-relaxed text-white/90",style:q({fontSize:l[g.value]+"px"})},[a.title?(s(),n("h1",Yi,u(a.title),1)):f("",!0),e("div",{class:"article-content [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:text-white/96 [&_h2]:mt-8 [&_h2]:mb-3 [&_h3]:text-base [&_h3]:font-medium [&_h3]:text-white/90 [&_h3]:mt-6 [&_h3]:mb-2 [&_p]:mb-4 [&_ul]:list-disc [&_ul]:ml-5 [&_ul]:mb-4 [&_ol]:list-decimal [&_ol]:ml-5 [&_ol]:mb-4 [&_li]:mb-1 [&_a]:text-accent [&_a]:underline [&_a]:underline-offset-2 [&_blockquote]:border-l-2 [&_blockquote]:border-accent/30 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:text-white/70 [&_blockquote]:my-4 [&_code]:bg-white/10 [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-[0.9em] [&_pre]:bg-white/5 [&_pre]:rounded-lg [&_pre]:p-4 [&_pre]:overflow-x-auto [&_pre]:my-4 [&_img]:rounded-lg [&_img]:max-w-full [&_img]:my-4 [&_hr]:border-white/10 [&_hr]:my-6",innerHTML:$.value},null,8,Qi)],4)],512)]))}}),Zi={class:"h-full flex flex-col"},Xi={class:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.08]"},er={class:"text-xs text-white/40 truncate"},tr={class:"flex-1 overflow-y-auto custom-scrollbar"},sr={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},nr={key:0,class:"flex items-center justify-center py-12"},lr=["onClick"],or={class:"space-y-1"},ar={class:"text-xs font-semibold text-white/80 line-clamp-2"},ir={class:"text-xs text-white/40 line-clamp-2"},rr={class:"flex items-center gap-2"},cr={class:"text-xs text-white/25 font-mono"},dr={class:"text-xs text-white/20"},ur={key:0,class:"text-xs text-accent/40 ml-auto"},hr={key:1,class:"flex items-center justify-center py-12"},xr=G({__name:"NostrArticles",setup(a){const c=S([]),l=S(!0),w=S(null),g=B(()=>w.value?m(w.value):"");function v(d){return d.length<=16?d:d.slice(0,8)+"..."+d.slice(-4)}function x(d){return new Date(d*1e3).toLocaleDateString("en",{month:"short",day:"numeric",year:"numeric"})}function m(d){const o=d.tags.find(h=>h[0]==="title");return o?.[1]?o[1]:d.content.split(`
|
||
`)[0].replace(/^#+ /,"").slice(0,60)||"Untitled"}function $(d){const o=d.tags.find(r=>r[0]==="summary");return o?.[1]?o[1]:d.content.slice(0,120).replace(/[#*_]/g,"")}function _(d){return d.tags.find(r=>r[0]==="image")?.[1]??null}async function b(){l.value=!0,c.value=[];const d="wss://relay.nostr.band",o="articles-"+Math.random().toString(36).slice(2,8);try{const r=new WebSocket(d),h=[],M=setTimeout(()=>{r.close(),c.value=h,l.value=!1},1e4);r.onopen=()=>{r.send(JSON.stringify(["REQ",o,{kinds:[30023],limit:30}]))},r.onmessage=j=>{try{const L=JSON.parse(j.data);if(Array.isArray(L)&&L[0]==="EVENT"&&L[1]===o&&L[2]){const D=L[2];h.find(C=>C.id===D.id)||h.push({id:D.id,pubkey:D.pubkey,authorName:v(D.pubkey),kind:D.kind,content:D.content,created_at:D.created_at,tags:D.tags??[]})}Array.isArray(L)&&L[0]==="EOSE"&&(clearTimeout(M),r.close(),h.sort((D,C)=>C.created_at-D.created_at),c.value=h,l.value=!1)}catch{}},r.onerror=()=>{clearTimeout(M),l.value=!1}}catch{l.value=!1}}return le(()=>{b()}),(d,o)=>(s(),n("div",Zi,[w.value?(s(),n(I,{key:0},[e("div",Xi,[e("button",{class:"min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-white/60 hover:text-white/80 hover:bg-white/10 transition-colors",onClick:o[0]||(o[0]=r=>w.value=null)},[...o[1]||(o[1]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("span",er,u(g.value),1)]),e("div",tr,[se(Ji,{content:w.value.content,title:g.value},null,8,["content","title"])])],64)):(s(),n(I,{key:1},[o[4]||(o[4]=e("div",{class:"p-4 border-b border-white/[0.08]"},[e("h3",{class:"text-sm font-bold text-white/90 mb-2"},"Long-Form Articles"),e("p",{class:"text-xs text-white/30"},"NIP-23 kind:30023 articles from your network")],-1)),e("div",sr,[l.value?(s(),n("div",nr,[...o[2]||(o[2]=[e("p",{class:"text-xs text-white/30"},"Loading articles...",-1)])])):f("",!0),(s(!0),n(I,null,P(c.value,r=>(s(),n("button",{key:r.id,class:"w-full text-left p-3 rounded-xl transition-all duration-150 bg-white/[0.03] hover:bg-white/[0.07] border border-white/5",onClick:h=>w.value=r},[e("div",or,[e("h4",ar,u(m(r)),1),e("p",ir,u($(r)),1),e("div",rr,[e("span",cr,u(v(r.pubkey)),1),e("span",dr,u(x(r.created_at)),1),_(r)?(s(),n("span",ur,"has image")):f("",!0)])])],8,lr))),128)),!l.value&&c.value.length===0?(s(),n("div",hr,[...o[3]||(o[3]=[e("p",{class:"text-xs text-white/30"},"No articles found",-1)])])):f("",!0)])],64))]))}}),We=1440*60*1e3,ft="aiui-nip05-cache",Te=S(new Map);function pr(){try{const a=localStorage.getItem(ft);if(a){const c=JSON.parse(a),l=Date.now(),w=c.filter(([,g])=>l-g.timestamp<We);Te.value=new Map(w)}}catch{}}function gr(){try{const a=Array.from(Te.value.entries());localStorage.setItem(ft,JSON.stringify(a))}catch{}}pr();function br(){async function a(w,g){const v=`${w}:${g}`,x=Te.value.get(v);if(x&&Date.now()-x.timestamp<We)return x.verified;try{const[m,$]=w.split("@");if(!m||!$)return!1;const _=await fetch(`https://${$}/.well-known/nostr.json?name=${encodeURIComponent(m)}`);if(!_.ok)return c(v,!1,g);const o=(await _.json())?.names?.[m]===g;return c(v,o,g)}catch{return c(v,!1,g)}}function c(w,g,v){return Te.value.set(w,{verified:g,pubkey:v,timestamp:Date.now()}),gr(),g}function l(w,g){const v=Te.value.get(`${w}:${g}`);return!v||Date.now()-v.timestamp>=We?null:v.verified}return{verifyNip05:a,isVerified:l}}const vr={class:"h-full flex flex-col"},fr={class:"flex gap-2 px-4 pt-3 pb-1"},mr=["onClick"],wr={class:"p-4 space-y-3 border-b border-white/[0.08]"},yr={class:"flex items-center justify-between gap-2"},kr={class:"flex items-center gap-2 shrink-0"},$r={class:"text-xs font-mono text-white/30"},_r={key:1,class:"rounded-lg bg-white/5 border border-white/10 p-3 space-y-2"},Cr=["onKeydown"],jr={class:"flex items-center justify-between gap-2"},Sr=["disabled"],Mr={key:0,class:"space-y-1"},Tr={class:"truncate font-mono text-white/40"},Dr={class:"flex gap-2"},Ir=["disabled"],Br={class:"flex gap-2"},Lr=["onClick"],Pr={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},Nr={key:0,class:"flex flex-col items-center justify-center py-12 gap-3"},Ar=["onClick"],zr={class:"flex items-start gap-2.5"},Er={class:"w-8 h-8 rounded-full shrink-0 overflow-hidden"},Fr=["src","alt","onError"],Rr={key:1,class:"w-full h-full flex items-center justify-center text-xs font-bold bg-purple-500/20 text-purple-400"},Vr={class:"flex-1 min-w-0"},Ur={class:"flex items-center gap-1.5"},qr={class:"text-xs font-semibold truncate text-white/80"},Gr={key:0,class:"text-xs truncate text-purple-400/60 flex items-center gap-0.5"},Or=["title"],Hr={class:"text-xs ml-auto shrink-0 text-white/20"},Wr={class:"text-xs mt-1 leading-relaxed line-clamp-3 text-white/60"},Kr={class:"flex items-center gap-3 mt-2"},Yr=["onClick"],Qr={key:0,class:"text-xs px-1.5 py-0.5 rounded bg-white/5 text-white/30"},Jr={class:"mt-4 pt-4 border-t border-white/5"},Zr={class:"space-y-1"},Xr={class:"truncate font-mono text-white/40"},ec={key:1,class:"flex items-center justify-center py-12"},tc=G({__name:"NostrGrid",setup(a){const{events:c,isConnected:l,relayStates:w,connect:g,publishEvent:v,searchResults:x,isSearching:m,searchNostr:$}=Ie(),{isLoggedIn:_,signEvent:b}=me(),{verifyNip05:d}=br(),o=S("feed"),r=[{id:"feed",label:"Feed"},{id:"articles",label:"Articles"},{id:"dms",label:"Messages"},{id:"lists",label:"Lists"},{id:"relays",label:"Relays"},{id:"profile",label:"Profile"}],h=S(null),M=Pe(new Set),j=S(""),L=S(null),D=S(!1),C=S(""),k=S(null),p=S(!1),y=S([]),A=S(!1),V=S(""),E=S(void 0);function Q(ee){V.value=ee.authorName??ee.pubkey.slice(0,12),E.value=void 0,A.value=!0}const H=Pe({}),K=[{id:1,label:"Notes"},{id:30023,label:"Articles"},{id:9735,label:"Zaps"},{id:6,label:"Reposts"}];function F(ee){const z=Math.floor(Date.now()/1e3-ee);return z<60?"now":z<3600?`${Math.floor(z/60)}m`:z<86400?`${Math.floor(z/3600)}h`:`${Math.floor(z/86400)}d`}const O=S(!1),X=B(()=>{if(O.value&&x.value.length>0){let z=x.value;return L.value!==null&&(z=z.filter(N=>N.kind===L.value)),z}let ee=c.value;if(L.value!==null&&(ee=ee.filter(z=>z.kind===L.value)),j.value){const z=j.value.toLowerCase();ee=ee.filter(N=>N.content.toLowerCase().includes(z)||(N.authorName??"").toLowerCase().includes(z)||(N.nip05??"").toLowerCase().includes(z))}return ee});function ge(){j.value.trim()&&(O.value=!0,$(j.value.trim(),L.value?[L.value]:void 0))}ce(j,ee=>{ee.trim()||(O.value=!1)}),ce(X,ee=>{for(const z of ee)z.nip05&&H[z.id]===void 0&&(H[z.id]=null,d(z.nip05,z.pubkey).then(N=>{H[z.id]=N}))},{immediate:!0});async function be(){if(!C.value.trim()||p.value)return;p.value=!0,y.value=[];const ee={kind:1,created_at:Math.floor(Date.now()/1e3),tags:[],content:C.value.trim()},z=await b(ee);if(!z){p.value=!1;return}const N=await v(z);y.value=N,p.value=!1,N.some(re=>re.success)&&(C.value="",setTimeout(()=>{y.value=[],D.value=!1},3e3))}return le(async()=>{g(),D.value&&(await ye(),k.value?.focus())}),(ee,z)=>(s(),n("div",vr,[e("div",fr,[(s(),n(I,null,P(r,N=>e("button",{key:N.id,class:i(["text-xs px-2.5 min-h-[44px] rounded-md transition-all duration-150 flex items-center justify-center",o.value===N.id?"nav-tab-active":"text-white/40 hover:text-white/70 hover:bg-white/5"]),onClick:re=>o.value=N.id},u(N.label),11,mr)),64))]),o.value==="dms"?(s(),U(ba,{key:0})):o.value==="relays"?(s(),U(Ba,{key:1})):o.value==="profile"?(s(),U(Ga,{key:2})):o.value==="lists"?(s(),U(Fi,{key:3})):o.value==="articles"?(s(),U(xr,{key:4})):o.value==="feed"&&h.value?(s(),U(yi,{key:5,"note-id":h.value,onBack:z[0]||(z[0]=N=>h.value=null)},null,8,["note-id"])):(s(),n(I,{key:6},[e("div",wr,[e("div",yr,[z[5]||(z[5]=e("h3",{class:"text-sm font-bold text-white/90"}," Nostr Feed ",-1)),e("div",kr,[e("span",$r,u(X.value.length)+" notes ",1),ie(ee.$slots,"header-actions")])]),t(_)?(s(),n("button",{key:0,class:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/40 bg-white/5 hover:bg-white/10 transition-colors",onClick:z[1]||(z[1]=N=>D.value=!D.value)},u(D.value?"Cancel":"Write a note..."),1)):f("",!0),D.value&&t(_)?(s(),n("div",_r,[W(e("textarea",{ref_key:"composeRef",ref:k,"onUpdate:modelValue":z[2]||(z[2]=N=>C.value=N),class:"w-full bg-transparent text-base text-white/80 placeholder:text-white/25 outline-none resize-none min-h-[80px]",placeholder:"What's on your mind?",onKeydown:[ae(xe(be,["meta"]),["enter"]),ae(xe(be,["ctrl"]),["enter"])]},null,40,Cr),[[J,C.value]]),e("div",jr,[e("span",{class:i(["text-xs tabular-nums",C.value.length>280?"text-accent/80":"text-white/25"])},u(C.value.length),3),e("button",{class:"text-xs px-3 py-1.5 rounded-lg bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30",disabled:!C.value.trim()||p.value,onClick:be},u(p.value?"Publishing...":"Publish"),9,Sr)]),y.value.length>0?(s(),n("div",Mr,[(s(!0),n(I,null,P(y.value,N=>(s(),n("div",{key:N.url,class:"flex items-center gap-2 text-xs px-2 py-1 rounded bg-white/[0.02]"},[e("span",{class:i(["w-1.5 h-1.5 rounded-full shrink-0",N.success?"bg-emerald-500":"bg-red-400/60"])},null,2),e("span",Tr,u(N.url),1),e("span",{class:i(["ml-auto shrink-0",N.success?"text-emerald-400/60":"text-red-400/60"])},u(N.message),3)]))),128))])):f("",!0)])):f("",!0),e("div",Dr,[W(e("input",{"onUpdate:modelValue":z[3]||(z[3]=N=>j.value=N),type:"text",placeholder:"Search notes, npubs...",class:"flex-1 px-3 py-2 rounded-lg text-base outline-none transition-colors bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10",onKeydown:ae(ge,["enter"])},null,544),[[J,j.value]]),j.value.trim()?(s(),n("button",{key:0,class:"px-2.5 py-2 rounded-lg text-xs bg-accent/15 text-accent/80 hover:bg-accent/25 transition-colors disabled:opacity-30 shrink-0",disabled:t(m),onClick:ge},u(t(m)?"...":"NIP-50"),9,Ir)):f("",!0)]),e("div",Br,[(s(),n(I,null,P(K,N=>e("button",{key:N.id,class:i(["text-xs px-2.5 min-h-[44px] rounded-md transition-all duration-150 flex items-center justify-center",L.value===N.id?"nav-tab-active":"text-white/40 hover:text-white/70 hover:bg-white/5"]),onClick:re=>L.value=L.value===N.id?null:N.id},u(N.label),11,Lr)),64))])]),e("div",Pr,[!t(l)&&t(c).length===0?(s(),n("div",Nr,[...z[6]||(z[6]=[e("svg",{class:"w-5 h-5 animate-spin text-white/30",fill:"none",viewBox:"0 0 24 24"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1),e("p",{class:"text-xs text-white/30"},"Connecting to relays...",-1)])])):f("",!0),(s(!0),n(I,null,P(X.value,N=>(s(),n("button",{key:N.id,class:"w-full text-left p-3 rounded-xl transition-all duration-150 bg-white/[0.03] hover:bg-white/[0.07] border border-white/5",onClick:re=>h.value=N.id},[e("div",zr,[e("div",Er,[N.authorPicture&&!M.has(N.pubkey)?(s(),n("img",{key:0,src:N.authorPicture,alt:N.authorName??"profile",class:"w-full h-full object-cover",loading:"lazy",onError:re=>M.add(N.pubkey)},null,40,Fr)):(s(),n("div",Rr,u(N.authorName?.charAt(0)?.toUpperCase()??"?"),1))]),e("div",Vr,[e("div",Ur,[e("span",qr,u(N.authorName??"anon"),1),N.nip05?(s(),n("span",Gr,[H[N.id]===!0?(s(),n("svg",{key:0,class:"w-2.5 h-2.5 text-emerald-400 shrink-0",fill:"currentColor",viewBox:"0 0 20 20",title:N.nip05},[...z[7]||(z[7]=[e("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])],8,Or)):f("",!0),ne(" "+u(N.nip05),1)])):f("",!0),e("span",Hr,u(F(N.created_at)),1)]),e("p",Wr,u(N.content),1),e("div",Kr,[e("button",{class:"text-xs px-3 py-2 min-h-[44px] min-w-[44px] rounded bg-white/5 text-accent/60 hover:text-accent hover:bg-accent/10 transition-colors flex items-center justify-center",onClick:xe(re=>Q(N),["stop"])}," Zap ",8,Yr),N.kind!==1?(s(),n("span",Qr," kind:"+u(N.kind),1)):f("",!0)])])])],8,Ar))),128)),e("div",Jr,[z[8]||(z[8]=e("p",{class:"text-xs font-medium mb-2 text-white/30"},"Relays",-1)),e("div",Zr,[(s(!0),n(I,null,P(t(w),N=>(s(),n("div",{key:N.url,class:"flex items-center gap-2 text-xs px-2 py-1 rounded-lg bg-white/[0.02]"},[e("span",{class:i(["w-1.5 h-1.5 rounded-full shrink-0",N.connected?"bg-emerald-500":"bg-red-400/60"])},null,2),e("span",Xr,u(N.url),1)]))),128))])]),t(l)&&X.value.length===0?(s(),n("div",ec,[...z[9]||(z[9]=[e("p",{class:"text-sm text-white/30"},"No notes match your search",-1)])])):f("",!0)])],64)),se(ni,{"is-open":A.value,"target-name":V.value,"lightning-address":E.value,onClose:z[4]||(z[4]=N=>A.value=!1)},null,8,["is-open","target-name","lightning-address"])]))}}),sc={class:"flex-1 min-h-0 flex flex-col"},at=G({__name:"ContentGridView",props:{activeTab:{},isWideDesktop:{type:Boolean},isMobile:{type:Boolean},panelFilms:{},panelBooks:{},panelTVSeries:{},panelImages:{},panelPlaces:{},panelSongs:{},panelPodcasts:{},panelWebResults:{},panelWebsites:{},panelMagazineSections:{},panelMagazineHeroImage:{},panelRecipes:{},panelApps:{},panelTitle:{},panelQuery:{},panelResponseText:{}},setup(a){const c=a,l=B(()=>{const o=c.panelResponseText??"";if(!o)return[{title:c.panelQuery||"Prompt",content:""}];const r=is(o);return r.length>0?r:[{title:c.panelQuery||"Response",content:rs(o)}]}),{openFilmDetail:w,openBookDetail:g,openTVSeriesDetail:v,openImageDetail:x,openPlaceDetail:m,openSongDetail:$,openPodcastDetail:_,openRecipeDetail:b,openAppDetail:d}=$e();return(o,r)=>(s(),n("div",sc,[a.activeTab==="film"?(s(),U(ds,{key:0,films:a.panelFilms,title:a.panelTitle,onSelectFilm:t(w)},null,8,["films","title","onSelectFilm"])):a.activeTab==="book"?(s(),U(Ns,{key:1,books:a.panelBooks,title:a.panelTitle,onSelectBook:t(g)},null,8,["books","title","onSelectBook"])):a.activeTab==="tvshow"?(s(),U(nn,{key:2,series:a.panelTVSeries,title:a.panelTitle,onSelectSeries:t(v)},null,8,["series","title","onSelectSeries"])):a.activeTab==="image"?(s(),U(bn,{key:3,images:a.panelImages,title:a.panelTitle,onSelectImage:t(x)},null,8,["images","title","onSelectImage"])):a.activeTab==="place"?(s(),U(Fn,{key:4,places:a.panelPlaces,title:a.panelTitle,onSelectPlace:t(m)},null,8,["places","title","onSelectPlace"])):a.activeTab==="song"?(s(),U(us,{key:5,songs:a.panelSongs,title:a.panelTitle,onSelectSong:t($)},null,8,["songs","title","onSelectSong"])):a.activeTab==="magazine"?(s(),U(st,{key:6,sections:a.panelMagazineSections,"hero-image-url":a.panelMagazineHeroImage,title:a.panelTitle,query:a.panelQuery},null,8,["sections","hero-image-url","title","query"])):a.activeTab==="news"?(s(),U(nt,{key:7,articles:a.panelWebResults,title:a.panelTitle,query:a.panelQuery},null,8,["articles","title","query"])):a.activeTab==="websites"?(s(),U(nt,{key:8,articles:a.panelWebsites,title:a.panelTitle,variant:"websites"},null,8,["articles","title"])):a.activeTab==="podcast"?(s(),U(ll,{key:9,podcasts:a.panelPodcasts,title:a.panelTitle,onSelectPodcast:t(_)},null,8,["podcasts","title","onSelectPodcast"])):a.activeTab==="recipe"?(s(),U(Gl,{key:10,recipes:a.panelRecipes,title:a.panelTitle,onSelectRecipe:t(b)},null,8,["recipes","title","onSelectRecipe"])):a.activeTab==="app"?(s(),U(no,{key:11,apps:a.panelApps,title:a.panelTitle,onSelectApp:t(d)},null,8,["apps","title","onSelectApp"])):a.activeTab==="code"?(s(),U(_o,{key:12,"is-wide-desktop":a.isWideDesktop,"is-mobile":a.isMobile},null,8,["is-wide-desktop","is-mobile"])):a.activeTab==="design-system"?(s(),U(Fo,{key:13})):a.activeTab==="nostr"?(s(),U(tc,{key:14})):a.activeTab==="prompt"?(s(),U(st,{key:15,sections:l.value,"hero-image-url":null,title:"Prompt",query:a.panelQuery},null,8,["sections","query"])):f("",!0)]))}}),nc={class:"book-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},lc={class:"relative w-full overflow-hidden"},oc={class:"w-full aspect-[16/7] flex items-center justify-center overflow-hidden bg-black/20"},ac=["src","alt"],ic={class:"absolute bottom-0 left-0 right-0 p-4"},rc={class:"text-lg font-bold text-white"},cc={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},dc={key:0},uc={key:1},hc={key:2,class:"text-amber-400"},xc={class:"p-4 space-y-4"},pc={key:1,class:"flex flex-wrap gap-1.5"},gc={class:"space-y-2"},bc=["href"],vc={class:"flex items-center gap-2.5"},fc={class:"text-sm"},mc=["href"],wc={class:"flex items-center gap-2.5"},yc={class:"text-sm"},kc=G({__name:"BookDetail",props:{book:{}},emits:["back"],setup(a){const c=a,{isDark:l}=Z(),{bannerSrc:w,fallbackGradient:g,onBannerError:v}=bt({primaryUrls:()=>[c.book.coverUrl],apiFetch:async()=>({posterUrl:await rt(c.book.title,c.book.author),backdropUrl:null}),title:()=>c.book.title,gradientSeed:()=>c.book.title+(c.book.author??"")}),x=B(()=>`${c.book.title} ${c.book.author}`.trim().replace(/\s+/g,"+")),m=B(()=>[{name:"Open Library",url:`https://openlibrary.org/search?q=${x.value}`,icon:"📖",desc:"Free, open catalog"},{name:"Internet Archive",url:`https://archive.org/search?query=${x.value}`,icon:"🏛️",desc:"Borrow & read free"},{name:"Project Gutenberg",url:`https://www.gutenberg.org/ebooks/search/?query=${x.value}`,icon:"📜",desc:"Public domain"},{name:"Standard Ebooks",url:`https://standardebooks.org/ebooks?query=${x.value}`,icon:"📕",desc:"Beautifully formatted"}]);function $(_){return{openlibrary:"📖",gutenberg:"📜",archive:"🏛️",goodreads:"📚",libgen:"🔓",local:"💾"}[_]??"📚"}return(_,b)=>(s(),n("div",nc,[e("div",lc,[e("div",oc,[t(w)?(s(),n("img",{key:0,src:t(w),alt:a.book.title,class:"w-full h-full object-cover object-center block",onError:b[0]||(b[0]=(...d)=>t(v)&&t(v)(...d))},null,40,ac)):(s(),n("div",{key:1,class:"w-full h-full",style:q({background:t(g)})},null,4))]),b[3]||(b[3]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:b[1]||(b[1]=d=>_.$emit("back"))},[...b[2]||(b[2]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",ic,[e("h2",rc,u(a.book.title),1),e("div",cc,[e("span",null,u(a.book.author),1),a.book.year?(s(),n("span",dc,u(a.book.year),1)):f("",!0),a.book.pages?(s(),n("span",uc,u(a.book.pages)+" pages",1)):f("",!0),a.book.rating?(s(),n("span",hc,"★ "+u(a.book.rating.toFixed(1)),1)):f("",!0)])])]),e("div",xc,[a.book.description?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(a.book.description),3)):f("",!0),a.book.genres?.length?(s(),n("div",pc,[(s(!0),n(I,null,P(a.book.genres,d=>(s(),n("span",{key:d,class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},u(d),3))),128))])):f("",!0),e("div",null,[e("h4",{class:i(["text-xs font-semibold mb-2",t(l)?"text-white/50":"text-gray-500"])},"Read on",2),e("div",gc,[(s(!0),n(I,null,P(a.book.sources??[],d=>(s(),n("a",{key:d.url,href:d.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",vc,[e("span",fc,u($(d.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(d.name),3)]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[4]||(b[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,bc))),128)),(s(!0),n(I,null,P(m.value,d=>(s(),n("a",{key:d.url,href:d.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",wc,[e("span",yc,u(d.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(d.name),3),d.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(d.desc),3)):f("",!0)])]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[5]||(b[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,mc))),128))])])])]))}}),$c={class:"tv-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},_c={class:"relative w-full overflow-hidden"},Cc={class:"w-full aspect-[16/7] flex items-center justify-center overflow-hidden bg-black/20"},jc=["src","alt"],Sc={class:"absolute bottom-0 left-0 right-0 p-4"},Mc={class:"text-lg font-bold text-white"},Tc={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},Dc={key:0},Ic={key:1},Bc={key:2},Lc={key:3},Pc={key:4,class:"text-amber-400"},Nc={key:5,class:"text-emerald-400"},Ac={key:6,class:"text-white/40"},zc={class:"p-4 space-y-4"},Ec={key:3,class:"flex flex-wrap gap-1.5"},Fc={class:"space-y-2"},Rc=["href"],Vc={class:"flex items-center gap-2.5"},Uc={class:"text-sm"},qc=["href"],Gc={class:"flex items-center gap-2.5"},Oc={class:"text-sm"},Hc=G({__name:"TVSeriesDetail",props:{series:{}},emits:["back"],setup(a){const c=a,{isDark:l}=Z(),{bannerSrc:w,fallbackGradient:g,onBannerError:v}=bt({primaryUrls:()=>[c.series.posterUrl,c.series.backdropUrl],apiFetch:()=>ct(c.series.title,c.series.year),title:()=>c.series.title}),x=B(()=>c.series.year?c.series.endYear&&c.series.endYear!==c.series.year?`${c.series.year}–${c.series.endYear}`:c.series.status==="ongoing"?`${c.series.year}–`:String(c.series.year):""),m=B(()=>c.series.title.trim().replace(/\s+/g,"+")),$=B(()=>(c.series.sources??[]).length>0?[]:[{name:"Internet Archive",url:`https://archive.org/search?query=${m.value}`,icon:"🏛️",desc:"Free, open archive"},{name:"YouTube",url:`https://youtube.com/results?search_query=${m.value}+full+series`,icon:"▶️",desc:"Free episodes"},{name:"Odysee",url:`https://odysee.com/$/search?q=${m.value}`,icon:"🔗",desc:"Decentralized"},{name:"Tubi",url:`https://tubitv.com/search/${m.value}`,icon:"📺",desc:"Free streaming"}]);function _(b){return{plex:"🟠",nextcloud:"☁️",youtube:"▶️",netflix:"🔴","free-web":"🌐",local:"💾"}[b]??"📺"}return(b,d)=>(s(),n("div",$c,[e("div",_c,[e("div",Cc,[t(w)?(s(),n("img",{key:0,src:t(w),alt:a.series.title,class:"w-full h-full object-cover object-center block",onError:d[0]||(d[0]=(...o)=>t(v)&&t(v)(...o))},null,40,jc)):(s(),n("div",{key:1,class:"w-full h-full",style:q({background:t(g)})},null,4))]),d[3]||(d[3]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:d[1]||(d[1]=o=>b.$emit("back"))},[...d[2]||(d[2]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",Sc,[e("h2",Mc,u(a.series.title),1),e("div",Tc,[x.value?(s(),n("span",Dc,u(x.value),1)):f("",!0),a.series.seasons?(s(),n("span",Ic,u(a.series.seasons)+" seasons",1)):f("",!0),a.series.episodes?(s(),n("span",Bc,u(a.series.episodes)+" episodes",1)):f("",!0),a.series.network?(s(),n("span",Lc,u(a.series.network),1)):f("",!0),a.series.rating?(s(),n("span",Pc,"★ "+u(a.series.rating.toFixed(1)),1)):f("",!0),a.series.status==="ongoing"?(s(),n("span",Nc,"ongoing")):a.series.status==="ended"?(s(),n("span",Ac,"ended")):f("",!0)])])]),e("div",zc,[a.series.synopsis?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(a.series.synopsis),3)):f("",!0),a.series.creator?(s(),n("div",{key:1,class:i(["text-xs",t(l)?"text-white/50":"text-gray-500"])},[d[4]||(d[4]=ne(" Created by ",-1)),e("span",{class:i(["font-medium",t(l)?"text-white/70":"text-gray-700"])},u(a.series.creator),3)],2)):f("",!0),a.series.cast?.length?(s(),n("div",{key:2,class:i(["text-xs",t(l)?"text-white/50":"text-gray-500"])}," Starring: "+u(a.series.cast.slice(0,5).join(", ")),3)):f("",!0),a.series.genres?.length?(s(),n("div",Ec,[(s(!0),n(I,null,P(a.series.genres,o=>(s(),n("span",{key:o,class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},u(o),3))),128))])):f("",!0),e("div",null,[e("h4",{class:i(["text-xs font-semibold mb-2",t(l)?"text-white/50":"text-gray-500"])},"Watch on",2),e("div",Fc,[(s(!0),n(I,null,P(a.series.sources??[],o=>(s(),n("a",{key:o.url,href:o.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",Vc,[e("span",Uc,u(_(o.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(o.name),3)]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...d[5]||(d[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,Rc))),128)),(s(!0),n(I,null,P($.value,o=>(s(),n("a",{key:o.url,href:o.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",Gc,[e("span",Oc,u(o.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(o.name),3),o.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(o.desc),3)):f("",!0)])]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...d[6]||(d[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,qc))),128))])])])]))}}),Wc={class:"podcast-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Kc={class:"relative w-full overflow-hidden"},Yc={class:"w-full aspect-[16/7] flex items-center justify-center overflow-hidden bg-black/20"},Qc=["src","alt"],Jc={class:"absolute bottom-0 left-0 right-0 p-4"},Zc={class:"text-lg font-bold text-white"},Xc={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},ed={key:0},td={key:1},sd={key:2},nd={class:"p-4 space-y-4"},ld={key:1,class:"flex flex-wrap gap-1.5"},od={class:"space-y-2"},ad=["href"],id={class:"flex items-center gap-2.5"},rd={class:"text-sm"},cd=["href"],dd={class:"flex items-center gap-2.5"},ud={class:"text-sm"},hd=G({__name:"PodcastDetail",props:{podcast:{}},emits:["back"],setup(a){const c=a,{isDark:l}=Z(),w=S(!1),g=S(null),v=B(()=>w.value?null:c.podcast.coverUrl||g.value||null);le(()=>{c.podcast.coverUrl||xt(c.podcast.title,c.podcast.host).then(b=>{b&&(g.value=b)})});const x=B(()=>ht(c.podcast.title,c.podcast.host)),m=B(()=>`${c.podcast.title} ${c.podcast.host??""}`.trim().replace(/\s+/g,"+")),$=B(()=>c.podcast.sources.length>0?[]:[{name:"Fountain",url:`https://fountain.fm/search?q=${m.value}`,icon:"⚡",desc:"Podcasting 2.0, Lightning"},{name:"Podcast Index",url:`https://podcastindex.org/search?q=${m.value}`,icon:"📻",desc:"Open podcast directory"},{name:"YouTube",url:`https://youtube.com/results?search_query=${m.value}`,icon:"▶️",desc:"Video podcasts"},{name:"Rumble",url:`https://rumble.com/search/video?q=${m.value}`,icon:"📺",desc:"Video & podcasts"},{name:"Odysee",url:`https://odysee.com/$/search?q=${m.value}`,icon:"🔗",desc:"Decentralized"}]);function _(b){return{fountain:"⚡",rumble:"📺",youtube:"▶️",podcastindex:"📻",castopod:"🦣",odysee:"🔗",podverse:"🎧",ipfs:"🌐",rss:"📡"}[b]??"🎙️"}return(b,d)=>(s(),n("div",Wc,[e("div",Kc,[e("div",Yc,[v.value?(s(),n("img",{key:0,src:v.value,alt:a.podcast.title,class:"w-full h-full object-cover object-center block",onError:d[0]||(d[0]=o=>w.value=!0)},null,40,Qc)):(s(),n("div",{key:1,class:"w-full h-full bg-cover bg-center",style:q({backgroundImage:`url(${x.value})`})},null,4))]),d[3]||(d[3]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:d[1]||(d[1]=o=>b.$emit("back"))},[...d[2]||(d[2]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",Jc,[e("h2",Zc,u(a.podcast.title),1),e("div",Xc,[a.podcast.host?(s(),n("span",ed,u(a.podcast.host),1)):f("",!0),a.podcast.year?(s(),n("span",td,u(a.podcast.year),1)):f("",!0),a.podcast.episodeCount?(s(),n("span",sd,u(a.podcast.episodeCount)+" episodes",1)):f("",!0)])])]),e("div",nd,[a.podcast.description?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(a.podcast.description),3)):f("",!0),a.podcast.genres?.length?(s(),n("div",ld,[(s(!0),n(I,null,P(a.podcast.genres,o=>(s(),n("span",{key:o,class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},u(o),3))),128))])):f("",!0),e("div",null,[e("h4",{class:i(["text-xs font-semibold mb-2",t(l)?"text-white/50":"text-gray-500"])},"Listen on",2),e("div",od,[(s(!0),n(I,null,P(a.podcast.sources,o=>(s(),n("a",{key:o.url,href:o.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",id,[e("span",rd,u(_(o.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(o.name),3)]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...d[4]||(d[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,ad))),128)),$.value.length?(s(!0),n(I,{key:0},P($.value,o=>(s(),n("a",{key:o.url,href:o.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",dd,[e("span",ud,u(o.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(o.name),3),o.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(o.desc),3)):f("",!0)])]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...d[5]||(d[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,cd))),128)):f("",!0)])])])]))}}),xd={class:"image-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},pd={class:"relative w-full overflow-hidden bg-black/20"},gd=["src","alt"],bd={class:"p-4 space-y-3"},vd={class:"pt-2"},fd=["href"],md=G({__name:"ImageDetail",props:{image:{}},emits:["back"],setup(a){const{isDark:c}=Z(),l=S(!1);return(w,g)=>(s(),n("div",xd,[e("div",pd,[l.value?(s(),n("div",{key:1,class:i(["w-full aspect-video flex items-center justify-center",t(c)?"bg-white/5":"bg-black/5"])},[(s(),n("svg",{class:i(["w-12 h-12",t(c)?"text-white/15":"text-gray-300"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...g[2]||(g[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])],2))],2)):(s(),n("img",{key:0,src:a.image.url,alt:a.image.alt||a.image.title||"Image",class:"w-full block max-h-[60vh] object-contain bg-black/40",onError:g[0]||(g[0]=v=>l.value=!0)},null,40,gd)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:g[1]||(g[1]=v=>w.$emit("back"))},[...g[3]||(g[3]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])])]),e("div",bd,[a.image.title?(s(),n("h2",{key:0,class:i(["text-base font-bold",t(c)?"text-white/90":"text-gray-900"])},u(a.image.title),3)):f("",!0),a.image.description?(s(),n("p",{key:1,class:i(["text-sm leading-relaxed",t(c)?"text-white/70":"text-gray-600"])},u(a.image.description),3)):f("",!0),a.image.attribution?(s(),n("div",{key:2,class:i(["text-xs",t(c)?"text-white/50":"text-gray-500"])},u(a.image.attribution),3)):f("",!0),a.image.source?(s(),n("div",{key:3,class:i(["text-xs",t(c)?"text-white/40":"text-gray-400"])}," Source: "+u(a.image.source),3)):f("",!0),a.image.width&&a.image.height?(s(),n("div",{key:4,class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])},u(a.image.width)+" × "+u(a.image.height),3)):f("",!0),e("div",vd,[e("a",{href:a.image.url,target:"_blank",rel:"noopener",class:i(["inline-flex items-center gap-2 px-4 min-h-[44px] rounded-xl text-xs font-medium transition-colors",t(c)?"bg-white/5 hover:bg-white/10 text-white/80":"bg-black/3 hover:bg-black/5 text-gray-800"])},[...g[4]||(g[4]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1),ne(" Open original ",-1)])],10,fd)])])]))}}),wd={class:"place-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},yd={class:"relative w-full overflow-hidden"},kd={class:"w-full aspect-[16/9] flex items-center justify-center overflow-hidden bg-black/20"},$d=["src","alt"],_d=["src","alt"],Cd={class:"absolute bottom-0 left-0 right-0 p-4"},jd={class:"text-lg font-bold text-white"},Sd={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},Md={key:0},Td={key:1},Dd={key:2,class:"text-amber-400"},Id={key:3,class:"text-white/50"},Bd={class:"p-4 space-y-4"},Ld={key:1,class:"flex items-start gap-2.5"},Pd={key:2,class:"flex items-center gap-2.5"},Nd={key:3,class:"flex items-start gap-2.5"},Ad={key:4,class:"flex items-center gap-2.5"},zd=["href"],Ed={class:"space-y-2"},Fd=["href"],Rd={class:"flex items-center gap-2.5"},Vd={class:"text-sm"},Ud=["href"],qd={class:"flex items-center gap-2.5"},Gd={class:"text-sm"},Od=G({__name:"PlaceDetail",props:{place:{}},emits:["back"],setup(a){const c=a,{isDark:l}=Z(),w=S(null),g=B(()=>dt(c.place.name,c.place.cuisine||c.place.category));le(()=>{c.place.photoUrl||ut(c.place.name,c.place.city).then(_=>{_&&(w.value=_)})});const v=B(()=>{if(!c.place.website)return"";try{return new URL(c.place.website).hostname.replace(/^www\./,"")}catch{return c.place.website}}),x=B(()=>`${c.place.name} ${c.place.city??""}`.trim().replace(/\s+/g,"+")),m=B(()=>{if((c.place.sources??[]).length>0)return[];const _=[{name:"OpenStreetMap",url:`https://www.openstreetmap.org/search?query=${x.value}`,icon:"🗺️",desc:"Open source maps"},{name:"Google Maps",url:`https://www.google.com/maps/search/${x.value}`,icon:"📍",desc:"Directions & reviews"}];return c.place.lat&&c.place.lng&&(_.unshift({name:"OpenStreetMap",url:`https://www.openstreetmap.org/?mlat=${c.place.lat}&mlon=${c.place.lng}#map=17/${c.place.lat}/${c.place.lng}`,icon:"🗺️",desc:"Open source maps"}),_.splice(2)),_});function $(_){return{gmaps:"📍",osm:"🗺️",yelp:"⭐",tripadvisor:"🦉",foursquare:"📌",local:"💾"}[_]??"📍"}return(_,b)=>(s(),n("div",wd,[e("div",yd,[e("div",kd,[a.place.photoUrl||w.value?(s(),n("img",{key:0,src:a.place.photoUrl||w.value,alt:a.place.name,class:"w-full h-full object-cover object-center block"},null,8,$d)):(s(),n("img",{key:1,src:g.value,alt:a.place.name,class:"w-full h-full object-cover"},null,8,_d))]),b[2]||(b[2]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:b[0]||(b[0]=d=>_.$emit("back"))},[...b[1]||(b[1]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",Cd,[e("h2",jd,u(a.place.name),1),e("div",Sd,[a.place.cuisine||a.place.category?(s(),n("span",Md,u(a.place.cuisine||a.place.category),1)):f("",!0),a.place.city?(s(),n("span",Td,u(a.place.city),1)):f("",!0),a.place.rating?(s(),n("span",Dd,"★ "+u(a.place.rating.toFixed(1)),1)):f("",!0),a.place.priceLevel?(s(),n("span",Id,u("$".repeat(a.place.priceLevel)),1)):f("",!0)])])]),e("div",Bd,[a.place.description?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(a.place.description),3)):f("",!0),a.place.address?(s(),n("div",Ld,[(s(),n("svg",{class:i(["w-4 h-4 shrink-0 mt-0.5",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[3]||(b[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"},null,-1),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"},null,-1)])],2)),e("span",{class:i(["text-xs",t(l)?"text-white/60":"text-gray-600"])},u(a.place.address),3)])):f("",!0),a.place.phone?(s(),n("div",Pd,[(s(),n("svg",{class:i(["w-4 h-4 shrink-0",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[4]||(b[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"},null,-1)])],2)),e("span",{class:i(["text-xs",t(l)?"text-white/60":"text-gray-600"])},u(a.place.phone),3)])):f("",!0),a.place.hours?(s(),n("div",Nd,[(s(),n("svg",{class:i(["w-4 h-4 shrink-0 mt-0.5",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[5]||(b[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])],2)),e("span",{class:i(["text-xs",t(l)?"text-white/60":"text-gray-600"])},u(a.place.hours),3)])):f("",!0),a.place.website?(s(),n("div",Ad,[(s(),n("svg",{class:i(["w-4 h-4 shrink-0",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[6]||(b[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},null,-1)])],2)),e("a",{href:a.place.website,target:"_blank",rel:"noopener",class:i(["text-xs underline underline-offset-2",t(l)?"text-white/60 hover:text-white/80":"text-gray-600 hover:text-gray-800"])},u(v.value),11,zd)])):f("",!0),e("div",null,[e("h4",{class:i(["text-xs font-semibold mb-2",t(l)?"text-white/50":"text-gray-500"])},"Find on",2),e("div",Ed,[(s(!0),n(I,null,P(a.place.sources??[],d=>(s(),n("a",{key:d.url,href:d.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",Rd,[e("span",Vd,u($(d.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(d.name),3)]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[7]||(b[7]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,Fd))),128)),(s(!0),n(I,null,P(m.value,d=>(s(),n("a",{key:d.url,href:d.url,target:"_blank",rel:"noopener",class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5 hover:bg-white/10":"bg-black/3 hover:bg-black/5"])},[e("div",qd,[e("span",Gd,u(d.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(d.name),3),d.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(d.desc),3)):f("",!0)])]),(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...b[8]||(b[8]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],10,Ud))),128))])])])]))}}),Hd={class:"article-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Wd={class:"relative w-full overflow-hidden aspect-[16/7] shrink-0"},Kd=["src","alt"],Yd={class:"absolute bottom-0 left-0 right-0 p-4"},Qd={class:"text-lg font-bold text-white"},Jd={key:0,class:"text-xs text-white/60 mt-1"},Zd={class:"p-4 space-y-4"},Xd={key:0,class:"text-white/90 [&_p]:mb-3 [&_ul]:list-disc [&_ol]:list-decimal [&_li]:ml-4 [&_a]:underline [&_a]:underline-offset-2 [&_h1]:text-lg [&_h2]:text-base [&_h3]:text-sm [&_blockquote]:border-l-2 [&_blockquote]:pl-3 [&_blockquote]:italic"},eu=["innerHTML"],tu={key:1,class:"py-4"},su=["href"],nu=G({__name:"ArticleDetail",props:{article:{}},emits:["back"],setup(a){const c=a,l=B(()=>{const v=c.article?.url;if(!v||typeof v!="string")return"";try{const x=new URL(v);return/^https?:$/i.test(x.protocol)?x.hostname.replace(/^www\./,""):""}catch{return""}}),w=B(()=>{const v=[...c.article.title].reduce((x,m)=>x+m.charCodeAt(0),0)%360;return`linear-gradient(135deg, hsl(${v}, 25%, 12%) 0%, hsl(${(v+40)%360}, 20%, 8%) 100%)`}),g=B(()=>{const v=c.article.content;return v?/<[a-z][\s\S]*>/i.test(v)?Zt(v):`<p class="whitespace-pre-wrap">${Xt(v)}</p>`:""});return(v,x)=>(s(),n("div",Hd,[e("div",Wd,[a.article.imgSrc&&t(Jt)(a.article.imgSrc)?(s(),n("img",{key:0,src:a.article.imgSrc,alt:a.article.title,class:"absolute inset-0 w-full h-full object-cover object-center block"},null,8,Kd)):(s(),n("div",{key:1,class:"absolute inset-0",style:q({background:w.value})},null,4)),x[2]||(x[2]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none"},null,-1)),e("button",{class:"absolute top-3 left-3 p-2 rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10 text-white/80",onClick:x[0]||(x[0]=m=>v.$emit("back"))},[...x[1]||(x[1]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",Yd,[e("h2",Qd,u(a.article.title),1),l.value?(s(),n("p",Jd,u(l.value),1)):f("",!0)])]),e("div",Zd,[a.article.content?(s(),n("article",Xd,[e("div",{innerHTML:g.value},null,8,eu)])):(s(),n("div",tu,[...x[3]||(x[3]=[e("p",{class:"text-sm text-white/50"}," Full article content is not available. Open the link below to read on the source site. ",-1)])])),a.article.url?(s(),n("a",{key:2,href:a.article.url,target:"_blank",rel:"noopener noreferrer",class:"inline-flex items-center gap-2 p-3 rounded-xl transition-colors bg-white/10 hover:bg-white/15 text-white/90"},[...x[4]||(x[4]=[e("svg",{class:"w-4 h-4 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1),ne(" Read full article ",-1)])],8,su)):f("",!0)])]))}}),lu={class:"website-detail h-full flex flex-col overflow-hidden"},ou={class:"flex-1 min-w-0 pl-8"},au=["href"],iu={class:"flex-1 min-h-0 relative bg-black/20"},ru=["src"],cu=G({__name:"WebsiteDetail",props:{website:{}},emits:["back"],setup(a){const c=a,{isDark:l}=Z(),w=B(()=>{if(!c.website.url)return"";try{return new URL(c.website.url).hostname.replace(/^www\./,"")}catch{return""}});return(g,v)=>(s(),n("div",lu,[e("div",{class:"shrink-0 flex items-center gap-2 px-3 py-2.5",style:q(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:"absolute top-3 left-3 p-2 rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:v[0]||(v[0]=x=>g.$emit("back"))},[...v[2]||(v[2]=[e("svg",{class:"w-4 h-4 text-white/90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",ou,[e("p",{class:i(["text-sm font-medium truncate",t(l)?"text-white/90":"text-gray-900"])},u(a.website.title||"Website"),3),w.value?(s(),n("p",{key:0,class:i(["text-xs truncate",t(l)?"text-white/30":"text-gray-400"])},u(w.value),3)):f("",!0)]),e("a",{href:a.website.url,target:"_blank",rel:"noopener noreferrer",class:i(["flex items-center justify-center w-8 h-8 rounded-lg transition-colors shrink-0",t(l)?"hover:bg-white/10 text-white/50":"hover:bg-black/5 text-gray-400"]),"aria-label":"Open in new tab",title:"Open in new tab",onClick:v[1]||(v[1]=xe(()=>{},["stop"]))},[...v[3]||(v[3]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],10,au)],4),e("div",iu,[(s(),n("iframe",{key:a.website.url,src:a.website.url,class:"absolute inset-0 w-full h-full border-0",style:{"-ms-overflow-style":"none","scrollbar-width":"none"},title:"Website content"},null,8,ru))])]))}}),du=De(cu,[["__scopeId","data-v-0f5111f5"]]),uu={class:"flex-1 text-center pl-8"},hu={class:"flex-1 min-h-0 overflow-y-auto custom-scrollbar flex flex-col"},xu={class:"px-6 py-8 md:px-8 md:py-10 max-w-lg mx-auto my-auto"},pu={class:"space-y-4"},gu=["href"],bu={class:"flex items-center gap-1"},vu=G({__name:"MagazineSectionDetail",props:{section:{},currentIndex:{},totalSections:{}},emits:["back","navigate"],setup(a){const c=a,{isDark:l}=Z(),w=B(()=>c.section.content.replace(/\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/https?:\/\/\S+/g,"").replace(/\uFE0F/g,"").replace(/\*\*/g,"").replace(/\*([^*\n]+)\*/g,"$1").replace(new RegExp("(?:^|(?<=\\s))[\\p{Emoji_Presentation}\\p{Extended_Pictographic}]+\\s*","gu"),"").replace(/---+/g,"").replace(/^#+\s*/gm,"").replace(/\|/g,", ").replace(/,\s*,+/g,",").split(/\n{2,}|\n\s*[-•]\s+/).map(v=>v.replace(/^\s*[-•]\s+/,"").replace(/(^|\n)\s*,\s*/g,"$1").trim()).filter(v=>v.length>0));return(g,v)=>(s(),n("div",{class:i(["magazine-section-detail h-full flex flex-col overflow-hidden",t(l)?"bg-[#0a0a0a]":"bg-[#faf9f6]"]),style:{"font-family":"Georgia, 'Times New Roman', Times, serif"}},[e("div",{class:"shrink-0 flex items-center justify-between px-4 py-3",style:q(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:"absolute top-3 left-3 min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:v[0]||(v[0]=x=>g.$emit("back"))},[(s(),n("svg",{class:i(["w-4 h-4",t(l)?"text-white/70":"text-gray-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...v[3]||(v[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))]),e("div",uu,[e("span",{class:i(["text-xs uppercase tracking-[0.3em] font-semibold",t(l)?"text-white/30":"text-black/30"])}," AI Brief ",2)]),e("span",{class:i(["text-xs font-mono tabular-nums shrink-0",t(l)?"text-white/25":"text-black/25"])},u(a.currentIndex+1)+"/"+u(a.totalSections),3)],4),e("div",hu,[e("div",xu,[a.section.group?(s(),n("p",{key:0,class:i(["text-xs uppercase tracking-[0.3em] font-semibold mb-4",t(l)?"text-white/25":"text-black/30"])},u(a.section.group),3)):f("",!0),e("h2",{class:i(["text-2xl md:text-3xl font-bold leading-tight mb-4",t(l)?"text-white/95":"text-black/90"])},u(a.section.title),3),a.section.author?(s(),n("p",{key:1,class:i(["text-xs mb-6",t(l)?"text-white/40":"text-black/40"])}," By "+u(a.section.author),3)):f("",!0),e("div",{class:i(["w-12 h-px mb-6",t(l)?"bg-white/15":"bg-black/15"])},null,2),e("div",pu,[(s(!0),n(I,null,P(w.value,(x,m)=>(s(),n("p",{key:m,class:i(["text-base md:text-lg leading-relaxed",t(l)?"text-white/75":"text-black/65"])},u(x),3))),128))]),a.section.url?(s(),n("a",{key:2,href:a.section.url,target:"_blank",rel:"noopener noreferrer",class:i(["inline-flex items-center gap-2 mt-6 min-h-[44px] text-xs transition-colors",t(l)?"text-white/40 hover:text-white/70":"text-black/40 hover:text-black/70"])},[...v[4]||(v[4]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1),ne(" Source ",-1)])],10,gu)):f("",!0)])]),e("div",{class:"shrink-0 flex items-center justify-between px-4 py-3",style:q(t(l)?"border-top: 1px solid rgba(255, 255, 255, 0.08)":"border-top: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:i(["flex items-center gap-1.5 px-3 min-h-[44px] rounded-lg text-xs transition-colors",t(l)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-black/40 hover:text-black/70 hover:bg-black/5"]),onClick:v[1]||(v[1]=x=>g.$emit("navigate","prev"))},[...v[5]||(v[5]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),ne(" Prev ",-1)])],2),e("div",bu,[(s(!0),n(I,null,P(a.totalSections,x=>(s(),n("div",{key:x,class:i(["w-1.5 h-1.5 rounded-full transition-all duration-200",x-1===a.currentIndex?t(l)?"bg-white/70 scale-125":"bg-black/60 scale-125":t(l)?"bg-white/15":"bg-black/15"])},null,2))),128))]),e("button",{class:i(["flex items-center gap-1.5 px-3 min-h-[44px] rounded-lg text-xs transition-colors",t(l)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-black/40 hover:text-black/70 hover:bg-black/5"]),onClick:v[2]||(v[2]=x=>g.$emit("navigate","next"))},[...v[6]||(v[6]=[ne(" Next ",-1),e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],2)],4)],2))}}),fu={class:"flex-1 min-w-0 pl-8"},mu={class:"flex items-center gap-2"},wu={class:"flex-1 min-h-0 overflow-auto custom-scrollbar"},yu={key:0,class:"font-mono text-xs leading-relaxed"},ku={class:"w-full border-collapse"},$u={key:1,class:"flex items-center justify-center h-full"},_u={class:"text-center space-y-3 px-6"},Cu=G({__name:"CodeDetail",emits:["back"],setup(a){const{isDark:c}=Z(),{activeFile:l,activeFileContent:w,activeFileLanguage:g,activeProject:v}=pe(),x=B(()=>w.value),m=B(()=>g.value),$=B(()=>l.value??""),_=B(()=>$.value.split("/").pop()??""),b=B(()=>v.value?.name??""),d=B(()=>x.value?x.value.split(`
|
||
`):[]);return(o,r)=>(s(),n("div",{class:i(["code-detail h-full flex flex-col overflow-hidden",t(c)?"bg-[#1a1a2e]":"bg-[#fafafa]"])},[e("div",{class:"shrink-0 flex items-center gap-2 px-3 py-2",style:q(t(c)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:"absolute top-3 left-3 p-2 rounded-lg path-glass-icon z-10 transition-colors hover:bg-white/10",onClick:r[0]||(r[0]=h=>o.$emit("back"))},[(s(),n("svg",{class:i(["w-4 h-4",t(c)?"text-white/70":"text-gray-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...r[1]||(r[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))]),e("div",fu,[e("div",mu,[e("span",{class:i(["shrink-0 text-xs px-1.5 py-0.5 rounded font-mono",t(c)?"bg-white/10 text-white/50":"bg-black/5 text-gray-500"])},u(m.value),3),e("p",{class:i(["text-xs font-mono truncate",t(c)?"text-white/70":"text-gray-700"])},u(_.value),3)]),b.value?(s(),n("p",{key:0,class:i(["text-xs font-mono mt-0.5 truncate",t(c)?"text-white/25":"text-gray-400"])},u(b.value)+" / "+u($.value),3)):f("",!0)])],4),e("div",wu,[x.value?(s(),n("div",yu,[e("table",ku,[e("tbody",null,[(s(!0),n(I,null,P(d.value,(h,M)=>(s(),n("tr",{key:M,class:"hover:bg-white/[0.03]"},[e("td",{class:i(["select-none text-right pr-4 pl-4 py-0 align-top w-1",t(c)?"text-white/15":"text-gray-300"]),style:{"min-width":"3rem"}},u(M+1),3),e("td",{class:i(["pr-4 py-0 whitespace-pre",t(c)?"text-white/75":"text-gray-700"])},u(h),3)]))),128))])])])):(s(),n("div",$u,[e("div",_u,[e("div",{class:i(["w-16 h-16 rounded-2xl flex items-center justify-center mx-auto",t(c)?"bg-white/5":"bg-black/5"])},[(s(),n("svg",{class:i(["w-7 h-7",t(c)?"text-white/20":"text-gray-300"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...r[2]||(r[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"},null,-1)])],2))],2),e("p",{class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])}," Select a file to view its contents. ",2)])]))])],2))}}),ju=De(Cu,[["__scopeId","data-v-7f40c0bc"]]),Su={class:"h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Mu={class:"min-w-0 flex-1"},Tu={class:"p-4 space-y-4"},Du={key:0,class:"space-y-2"},Iu={key:1,class:"space-y-2"},Bu={key:2,class:"flex items-end gap-2"},Lu={key:0,class:"text-[7px] text-accent font-mono"},Pu={key:3,class:"space-y-2"},Nu={key:0,class:"flex gap-3"},Au={key:1,class:"flex gap-3"},zu={key:2,class:"flex gap-3"},Eu={key:3,class:"flex flex-wrap gap-1.5"},Fu={key:4},Ru={class:"glass-card p-4"},Vu={key:5,class:"flex gap-1.5"},Uu={key:6},qu={key:7,class:"space-y-2"},Gu={key:8},Ou={key:9,class:"space-y-1.5"},Hu={class:"flex items-center gap-2.5"},Wu={key:10},Ku={key:11,class:"flex gap-2"},Yu={class:"absolute bottom-0 left-0 right-0 p-1.5"},Qu={class:"text-xs text-white/80 font-medium truncate"},Ju={key:12,class:"space-y-2"},Zu={class:"flex justify-end"},Xu={class:"flex justify-start"},e0={key:13,class:"space-y-2"},t0={class:"grid grid-cols-3 gap-1"},s0={key:14,class:"space-y-2"},n0={class:"space-y-1 px-1"},l0={key:15},o0={key:16},a0={class:"flex items-start gap-2.5"},i0={class:"min-w-0 flex-1"},r0={class:"flex items-center gap-1.5"},c0={class:"flex gap-3 mt-1.5"},d0={key:17,class:"flex flex-col items-center gap-2"},u0={key:18,class:"flex flex-col items-center gap-2"},h0={key:19,class:"text-center py-4"},x0={key:0},p0=G({__name:"DesignSystemDetail",props:{item:{}},emits:["back"],setup(a){const c=a,{isDark:l}=Z(),w=S(!1),g=S(0),v=S(0),x={colors:"Colors",typography:"Typography",spacing:"Spacing",atoms:"Atoms",molecules:"Molecules",organisms:"Organisms"},m=B(()=>x[c.item.category]??c.item.category),$=B(()=>c.item.id==="type-mono"?{fontFamily:'Menlo, Monaco, "Courier New", monospace'}:c.item.id==="type-serif"?{fontFamily:'Georgia, "Times New Roman", Times, serif'}:{fontFamily:"Inter, system-ui, -apple-system, sans-serif"});function _(d){const o=/(?:background-color|color|background):\s*([^;]+)/i.exec(d);return o?o[1].trim():"#333"}async function b(){try{await navigator.clipboard.writeText(c.item.code),w.value=!0,setTimeout(()=>{w.value=!1},2e3)}catch{}}return(d,o)=>(s(),n("div",Su,[e("div",{class:"shrink-0 px-4 py-3 flex items-center gap-3",style:q(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:i(["min-w-[44px] min-h-[44px] rounded-lg path-glass-icon flex items-center justify-center transition-colors shrink-0",t(l)?"hover:bg-white/10":"hover:bg-black/5"]),onClick:o[0]||(o[0]=r=>d.$emit("back"))},[(s(),n("svg",{class:i(["w-3.5 h-3.5",t(l)?"text-white/70":"text-gray-500"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...o[3]||(o[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))],2),e("div",Mu,[e("h2",{class:i(["text-sm font-semibold truncate",t(l)?"text-white/90":"text-gray-900"])},u(a.item.name),3),e("p",{class:i(["text-xs",t(l)?"text-white/40":"text-gray-400"])},u(m.value),3)]),e("button",{class:i(["text-xs px-2 py-1 rounded-md transition-colors",w.value?"bg-emerald-500/20 text-emerald-400":t(l)?"bg-white/5 text-white/50 hover:bg-white/10":"bg-black/5 text-gray-500 hover:bg-black/10"]),onClick:b},u(w.value?"Copied":"Copy"),3)],4),e("div",Tu,[e("p",{class:i(["text-sm leading-relaxed",t(l)?"text-white/60":"text-gray-600"])},u(a.item.description),3),e("div",null,[e("h4",{class:i(["text-xs uppercase tracking-[0.2em] font-semibold mb-2",t(l)?"text-white/30":"text-gray-400"])}," Preview ",2),e("div",{class:i(["rounded-xl p-4 overflow-hidden",t(l)?"bg-white/[0.03] border border-white/10":"bg-black/[0.02] border border-black/10"])},[a.item.category==="colors"?(s(),n("div",Du,[e("div",{class:i(["h-12 rounded-lg border",t(l)?"border-white/10":"border-black/10"]),style:q({background:_(a.item.code)})},null,6),e("p",{class:i(["text-xs font-mono text-center",t(l)?"text-white/40":"text-gray-400"])},u(_(a.item.code)),3)])):a.item.category==="typography"?(s(),n("div",Iu,[e("p",{class:i(["text-2xl font-bold",t(l)?"text-white/90":"text-gray-900"]),style:q($.value)}," Aa Bb Cc 123 ",6),e("p",{class:i(["text-sm",t(l)?"text-white/60":"text-gray-600"]),style:q($.value)}," The quick brown fox jumps over the lazy dog. ",6)])):a.item.category==="spacing"?(s(),n("div",Bu,[(s(),n(I,null,P([4,8,12,16,20,24,32],(r,h)=>e("div",{key:h,class:"bg-accent/30 rounded-sm flex items-center justify-center",style:q({width:`${r}px`,height:`${r}px`})},[r>=16?(s(),n("span",Lu,u(r),1)):f("",!0)],4)),64))])):(s(),n("div",Pu,[a.item.id==="atom-glass-btn"?(s(),n("div",Nu,[...o[4]||(o[4]=[e("button",{class:"glass-button text-sm"},"Action",-1),e("button",{class:"glass-button text-sm opacity-50 cursor-not-allowed"},"Disabled",-1)])])):a.item.id==="atom-glass-btn-sm"?(s(),n("div",Au,[...o[5]||(o[5]=[e("button",{class:"glass-button glass-button-sm text-xs"},"Small",-1),e("button",{class:"glass-button glass-button-sm text-xs opacity-50 cursor-not-allowed"},"Disabled",-1)])])):a.item.id==="atom-icon-btn"?(s(),n("div",zu,[e("button",{class:i(["w-9 h-9 rounded-xl path-glass-icon flex items-center justify-center",t(l)?"text-white/70":"text-gray-500"])},[...o[6]||(o[6]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1)])],2),e("button",{class:i(["w-9 h-9 rounded-xl path-glass-icon flex items-center justify-center",t(l)?"text-white/70":"text-gray-500"])},[...o[7]||(o[7]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])],2),e("button",{class:i(["w-9 h-9 rounded-xl path-glass-icon flex items-center justify-center",t(l)?"text-white/70":"text-gray-500"])},[...o[8]||(o[8]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],2)])):a.item.id==="atom-badge"?(s(),n("div",Eu,[e("span",{class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},"Science Fiction",2),e("span",{class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},"Drama",2),e("span",{class:i(["text-xs px-2 py-1 rounded-md font-medium",t(l)?"bg-white/10 text-white/60":"bg-black/5 text-gray-600"])},"Thriller",2)])):a.item.id==="mol-glass-card"?(s(),n("div",Fu,[e("div",Ru,[e("h3",{class:i(["text-sm font-semibold mb-1",t(l)?"text-white/90":"text-gray-900"])},"Glass Card",2),e("p",{class:i(["text-xs",t(l)?"text-white/60":"text-gray-500"])},"Content with frosted glass background and subtle border.",2)])])):a.item.id==="atom-nav-tab"?(s(),n("div",Vu,[o[9]||(o[9]=e("button",{class:"text-xs px-2.5 py-1 rounded-md font-medium bg-accent/20 text-accent"},"Films",-1)),e("button",{class:i(["text-xs px-2.5 py-1 rounded-md font-medium",t(l)?"bg-white/5 text-white/50":"bg-black/5 text-gray-500"])},"Songs",2),e("button",{class:i(["text-xs px-2.5 py-1 rounded-md font-medium",t(l)?"bg-white/5 text-white/50":"bg-black/5 text-gray-500"])},"Podcasts",2)])):a.item.id==="atom-input"?(s(),n("div",Uu,[e("input",{class:i(["w-full px-3 py-2 rounded-lg text-base outline-none transition-colors",t(l)?"bg-white/5 text-white/80 placeholder:text-white/25 focus:bg-white/10":"bg-black/5 text-gray-800 placeholder:text-gray-400 focus:bg-black/10"]),placeholder:"Search...",readonly:""},null,2)])):a.item.id==="atom-scrollbar"?(s(),n("div",qu,[e("div",{class:i(["h-16 overflow-y-auto rounded-lg px-3 py-2",t(l)?"bg-white/5":"bg-black/5"]),style:{"scrollbar-width":"thin"}},[(s(),n(I,null,P(8,r=>e("p",{key:r,class:i(["text-xs py-0.5",t(l)?"text-white/40":"text-gray-400"])}," Scrollable content line "+u(r),3)),64))],2),e("p",{class:i(["text-xs text-center",t(l)?"text-white/30":"text-gray-400"])}," 4px wide, translucent thumb ",2)])):a.item.id==="mol-gradient-card"?(s(),n("div",Gu,[...o[10]||(o[10]=[e("div",{class:"gradient-card p-4 rounded-2xl"},[e("h3",{class:"text-sm font-semibold mb-1 text-white"},"Featured"),e("p",{class:"text-xs text-white/70"},"Gradient background card for highlights.")],-1)])])):a.item.id==="mol-source-link"?(s(),n("div",Ou,[e("div",{class:i(["flex items-center justify-between p-3 rounded-xl transition-colors",t(l)?"bg-white/5":"bg-black/5"])},[e("div",Hu,[o[11]||(o[11]=e("span",{class:"text-sm"},"🎬",-1)),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},"Netflix",2),e("p",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},"Stream now",2)])]),(s(),n("svg",{class:i(["w-3.5 h-3.5",t(l)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...o[12]||(o[12]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])],2))],2)])):a.item.id==="mol-banner-hero"?(s(),n("div",Wu,[...o[13]||(o[13]=[es('<div class="relative w-full aspect-[16/7] rounded-lg overflow-hidden"><div class="absolute inset-0" style="background:linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);"></div><div class="absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent"></div><div class="absolute bottom-0 left-0 p-3"><h3 class="text-sm font-bold text-white/90">Banner Title</h3><p class="text-xs text-white/50">Subtitle text</p></div></div>',1)])])):a.item.id==="mol-cover-card"?(s(),n("div",Ku,[(s(),n(I,null,P(3,r=>e("div",{key:r,class:"flex-1 rounded-xl overflow-hidden"},[e("div",{class:"aspect-[2/3] relative",style:q({background:`linear-gradient(${120*r}deg, ${["#2d1b69","#1b3a4b","#3b1b2b"][r-1]}, ${["#1a0a3e","#0a2030","#200a1a"][r-1]})`})},[o[14]||(o[14]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"},null,-1)),e("div",Yu,[e("p",Qu,u(["Film","Album","Series"][r-1]),1)])],4)])),64))])):a.item.id==="org-chat-bubble"?(s(),n("div",Ju,[e("div",Zu,[e("div",{class:i(["max-w-[80%] px-3 py-2 rounded-2xl text-xs",t(l)?"bg-white/10 text-white/90":"bg-black/10 text-gray-800"])}," What films should I watch? ",2)]),e("div",Xu,[e("div",{class:i(["max-w-[80%] px-3 py-2 text-xs",t(l)?"text-white/70":"text-gray-600"])}," Here are some great picks from your library... ",2)])])):a.item.id==="org-content-panel"?(s(),n("div",e0,[e("div",{class:"flex gap-1 pb-1.5",style:q(t(l)?"border-bottom: 1px solid rgba(255,255,255,0.08)":"border-bottom: 1px solid rgba(0,0,0,0.06)")},[o[15]||(o[15]=e("span",{class:"text-xs px-2 py-0.5 rounded font-medium bg-accent/20 text-accent"},"Films",-1)),e("span",{class:i(["text-xs px-2 py-0.5 rounded font-medium",t(l)?"text-white/40":"text-gray-400"])},"Songs",2),e("span",{class:i(["text-xs px-2 py-0.5 rounded font-medium",t(l)?"text-white/40":"text-gray-400"])},"Books",2)],4),e("div",t0,[(s(),n(I,null,P(6,r=>e("div",{key:r,class:i(["aspect-[2/3] rounded-md",t(l)?"bg-white/5":"bg-black/5"])},null,2)),64))])])):a.item.id==="org-detail-view"?(s(),n("div",s0,[e("div",{class:i(["relative aspect-[16/7] rounded-lg overflow-hidden",t(l)?"bg-white/5":"bg-black/5"])},[o[17]||(o[17]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"},null,-1)),e("div",{class:i(["absolute top-1.5 left-1.5 w-4 h-4 rounded-md flex items-center justify-center",t(l)?"bg-white/10":"bg-black/10"])},[(s(),n("svg",{class:i(["w-2.5 h-2.5",t(l)?"text-white/60":"text-gray-500"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...o[16]||(o[16]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))],2),o[18]||(o[18]=e("div",{class:"absolute bottom-1 left-2"},[e("p",{class:"text-xs font-bold text-white/90"},"Title"),e("p",{class:"text-xs text-white/50"},"Meta")],-1))],2),e("div",n0,[e("div",{class:i(["h-1.5 rounded-full w-full",t(l)?"bg-white/5":"bg-black/5"])},null,2),e("div",{class:i(["h-1.5 rounded-full w-3/4",t(l)?"bg-white/5":"bg-black/5"])},null,2)])])):a.item.id==="org-magazine"?(s(),n("div",l0,[e("div",{class:i(["grid grid-cols-2 gap-px rounded-lg overflow-hidden",t(l)?"bg-white/[0.12]":"bg-black/[0.08]"])},[e("div",{class:i(["col-span-2 px-3 py-3",t(l)?"bg-[#0a0a0a]":"bg-white"])},[e("p",{class:i(["text-[7px] uppercase tracking-[0.3em] mb-0.5",t(l)?"text-white/30":"text-gray-400"])},"Editorial",2),e("p",{class:i(["text-xs font-serif font-bold",t(l)?"text-white/90":"text-gray-900"])},"Hero Headline",2)],2),e("div",{class:i(["px-2 py-2",t(l)?"bg-[#0a0a0a]":"bg-white"])},[e("p",{class:i(["text-xs font-serif font-bold",t(l)?"text-white/80":"text-gray-800"])},"Half Tile",2)],2),e("div",{class:i(["px-2 py-2",t(l)?"bg-[#0a0a0a]":"bg-white"])},[e("p",{class:i(["text-xs font-serif font-bold",t(l)?"text-white/80":"text-gray-800"])},"Half Tile",2)],2)],2)])):a.item.id==="org-nostr-note"?(s(),n("div",o0,[e("div",{class:i(["p-3 rounded-xl",t(l)?"bg-white/[0.03] border border-white/5":"bg-black/[0.02] border border-black/5"])},[e("div",a0,[o[20]||(o[20]=e("div",{class:"w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold shrink-0",style:{background:"rgba(168, 85, 247, 0.2)",color:"rgba(168, 85, 247, 0.8)"}}," F ",-1)),e("div",i0,[e("div",r0,[e("span",{class:i(["text-xs font-semibold",t(l)?"text-white/80":"text-gray-800"])},"fiatjaf",2),e("span",{class:i(["text-xs",t(l)?"text-white/25":"text-gray-300"])},"2h",2)]),e("p",{class:i(["text-xs mt-0.5 leading-relaxed",t(l)?"text-white/50":"text-gray-500"])}," Nostr is the simplest open protocol... ",2),e("div",c0,[e("span",{class:i(["text-xs",t(l)?"text-white/25":"text-gray-300"])},"3 replies",2),o[19]||(o[19]=e("span",{class:"text-xs text-amber-500/70"},"21000 sats",-1))])])])],2)])):a.item.id==="anim-fade-up"?(s(),n("div",d0,[(s(),n("div",{key:g.value,class:i(["animate-fade-up px-4 py-2 rounded-lg text-xs font-medium",t(l)?"bg-white/10 text-white/70":"bg-black/10 text-gray-600"])}," Fade Up (900ms) ",2)),e("button",{class:i(["text-xs px-2 py-0.5 rounded transition-colors",t(l)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:o[1]||(o[1]=r=>g.value++)}," Replay ",2)])):a.item.id==="anim-scale-in"?(s(),n("div",u0,[(s(),n("div",{key:v.value,class:i(["animate-scale-in px-4 py-2 rounded-lg text-xs font-medium",t(l)?"bg-white/10 text-white/70":"bg-black/10 text-gray-600"])}," Scale In (250ms) ",2)),e("button",{class:i(["text-xs px-2 py-0.5 rounded transition-colors",t(l)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:o[2]||(o[2]=r=>v.value++)}," Replay ",2)])):(s(),n("div",h0,[e("p",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])}," See code below for usage pattern ",2)]))]))],2)]),a.item.usedIn?(s(),n("div",x0,[e("h4",{class:i(["text-xs uppercase tracking-[0.2em] font-semibold mb-2",t(l)?"text-white/30":"text-gray-400"])}," Used In ",2),e("div",{class:i(["rounded-xl px-3 py-2.5",t(l)?"bg-white/[0.03] border border-white/10":"bg-black/[0.02] border border-black/10"])},[e("p",{class:i(["text-xs leading-relaxed",t(l)?"text-white/50":"text-gray-500"])},u(a.item.usedIn),3)],2)])):f("",!0),e("div",null,[e("h4",{class:i(["text-xs uppercase tracking-[0.2em] font-semibold mb-2",t(l)?"text-white/30":"text-gray-400"])}," Code ",2),e("pre",{class:i(["rounded-xl p-4 text-xs leading-relaxed font-mono overflow-x-auto",t(l)?"bg-black/40 text-white/70 border border-white/10":"bg-gray-50 text-gray-700 border border-gray-200"])},u(a.item.code),3)])])]))}}),Ge=G({__name:"DetailView",setup(a){const{isCodeMode:c,activeFile:l}=pe();function w(){const{activeFile:F,activeFileContent:O}=pe();F.value=null,O.value=""}const{selectedFilm:g,selectedBook:v,selectedTVSeries:x,selectedImage:m,selectedPlace:$,selectedSong:_,selectedPodcast:b,selectedArticle:d,closeFilmDetail:o,closeBookDetail:r,closeTVSeriesDetail:h,closeImageDetail:M,closePlaceDetail:j,closeSongDetail:L,closePodcastDetail:D,closeArticleDetail:C,selectedWebsite:k,closeWebsiteDetail:p,selectedMagazineSection:y,magazineSectionIndex:A,panelMagazineSections:V,closeMagazineSectionDetail:E,navigateMagazineSection:Q,selectedDesignSystemItem:H,closeDesignSystemItem:K}=$e();return(F,O)=>t(g)?(s(),U(hs,{key:0,film:t(g),onBack:t(o)},null,8,["film","onBack"])):t(_)?(s(),U(xs,{key:1,song:t(_),onBack:t(L)},null,8,["song","onBack"])):t(b)?(s(),U(hd,{key:2,podcast:t(b),onBack:t(D)},null,8,["podcast","onBack"])):t(v)?(s(),U(kc,{key:3,book:t(v),onBack:t(r)},null,8,["book","onBack"])):t(x)?(s(),U(Hc,{key:4,series:t(x),onBack:t(h)},null,8,["series","onBack"])):t(m)?(s(),U(md,{key:5,image:t(m),onBack:t(M)},null,8,["image","onBack"])):t($)?(s(),U(Od,{key:6,place:t($),onBack:t(j)},null,8,["place","onBack"])):t(d)?(s(),U(nu,{key:7,article:t(d),onBack:t(C)},null,8,["article","onBack"])):t(k)?(s(),U(du,{key:8,website:t(k),onBack:t(p)},null,8,["website","onBack"])):t(y)?(s(),U(vu,{key:9,section:t(y),"current-index":t(A),"total-sections":t(V).length,onBack:t(E),onNavigate:t(Q)},null,8,["section","current-index","total-sections","onBack","onNavigate"])):t(c)&&t(l)?(s(),U(ju,{key:10,onBack:w})):t(H)?(s(),U(p0,{key:11,item:t(H),onBack:t(K)},null,8,["item","onBack"])):f("",!0)}}),Oe=G({__name:"CloseButton",emits:["click"],setup(a){const{isDark:c}=Z();return(l,w)=>(s(),n("button",{class:i(["absolute top-3 right-3 z-10 p-2 rounded-lg path-glass-icon transition-colors",t(c)?"text-white/70 hover:bg-white/10":"text-gray-500 hover:bg-black/5 hover:text-gray-800"]),title:"Close","aria-label":"Close",onClick:w[0]||(w[0]=g=>l.$emit("click"))},[...w[1]||(w[1]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],2))}}),g0={class:"flex-1 overflow-y-auto p-4"},b0={key:0,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4"},v0={key:1,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3"},f0={key:2,class:"space-y-3"},m0={class:"flex-1 space-y-2 py-1"},w0={key:3,class:"space-y-0"},y0=G({__name:"LoadingContentGrid",props:{variant:{default:"poster"},count:{default:8}},setup(a){const{isDark:c}=Z();return(l,w)=>(s(),n("div",g0,[a.variant==="poster"?(s(),n("div",b0,[(s(!0),n(I,null,P(a.count,g=>(s(),n("div",{key:g,class:i(["aspect-[2/3] rounded-xl animate-pulse",t(c)?"bg-white/10":"bg-black/6"])},null,2))),128))])):a.variant==="square"?(s(),n("div",v0,[(s(!0),n(I,null,P(a.count,g=>(s(),n("div",{key:g,class:"space-y-2"},[e("div",{class:i(["aspect-square rounded-xl animate-pulse",t(c)?"bg-white/10":"bg-black/6"])},null,2),e("div",{class:i(["h-3 rounded animate-pulse w-3/4",t(c)?"bg-white/8":"bg-black/5"])},null,2),e("div",{class:i(["h-2.5 rounded animate-pulse w-1/2",t(c)?"bg-white/5":"bg-black/3"])},null,2)]))),128))])):a.variant==="list"?(s(),n("div",f0,[(s(!0),n(I,null,P(a.count,g=>(s(),n("div",{key:g,class:i(["flex gap-3 p-3 rounded-xl animate-pulse",t(c)?"bg-white/[0.04]":"bg-black/[0.03]"])},[e("div",{class:i(["w-20 h-14 rounded-lg shrink-0",t(c)?"bg-white/10":"bg-black/6"])},null,2),e("div",m0,[e("div",{class:i(["h-3 rounded w-4/5",t(c)?"bg-white/10":"bg-black/6"])},null,2),e("div",{class:i(["h-2.5 rounded w-3/5",t(c)?"bg-white/6":"bg-black/4"])},null,2)])],2))),128))])):a.variant==="magazine"?(s(),n("div",w0,[e("div",{class:i(["h-44 animate-pulse mb-px",t(c)?"bg-white/[0.04]":"bg-black/[0.03]"])},null,2),e("div",{class:i(["grid grid-cols-2 gap-px",t(c)?"bg-white/12":"bg-black/10"])},[(s(!0),n(I,null,P(a.count,g=>(s(),n("div",{key:g,class:i(["p-4 animate-pulse",[t(c)?"bg-[#0a0a0a]":"bg-[#faf9f6]",g<=1?"col-span-2":""]])},[e("div",{class:i(["h-2.5 rounded w-1/3 mb-2",t(c)?"bg-white/8":"bg-black/5"])},null,2),e("div",{class:i(["h-4 rounded w-4/5 mb-2",t(c)?"bg-white/10":"bg-black/6"])},null,2),e("div",{class:i(["h-2.5 rounded w-full",t(c)?"bg-white/6":"bg-black/4"])},null,2)],2))),128))],2)])):f("",!0)]))}}),k0={class:"relative flex-1 flex flex-col min-h-0 overflow-hidden"},$0={key:0,class:"flex-1 flex flex-col min-h-0"},_0={class:"flex items-center gap-2 shrink-0"},C0={key:1,class:"relative flex-1 flex items-center justify-center min-h-0"},j0={class:"relative flex flex-col items-center gap-8"},S0={class:"flex items-center gap-2"},M0={class:"absolute inset-0 pointer-events-none overflow-hidden"},T0=G({__name:"ContextLoader",props:{contextType:{default:"film"}},setup(a){const c=a,{isDark:l}=Z(),w=B(()=>c.contextType==="film"?"Film recommendations":c.contextType==="song"?"Song recommendations":c.contextType==="podcast"?"Podcast recommendations":c.contextType==="book"?"Book recommendations":c.contextType==="tvshow"?"TV Series recommendations":c.contextType==="image"?"Images":c.contextType==="news"?"Articles":c.contextType==="websites"?"Websites":c.contextType==="magazine"?"Brief":"Content"),g=B(()=>["song","podcast","image"].includes(c.contextType)?"square":["news","websites"].includes(c.contextType)?"list":c.contextType==="magazine"?"magazine":"poster"),v=B(()=>c.contextType==="magazine"||["news","websites"].includes(c.contextType)?6:12);return(x,m)=>(s(),n("div",k0,[["film","song","podcast","book","tvshow","image","news","websites","magazine"].includes(a.contextType)?(s(),n("div",$0,[e("div",{class:"p-4 shrink-0 flex items-center justify-between gap-2",style:q(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("p",{class:i(["text-sm font-medium",t(l)?"text-white/70":"text-gray-600"])},u(w.value),3),e("div",_0,[e("p",{class:i(["text-xs font-mono uppercase tracking-[0.2em]",t(l)?"text-white/25":"text-gray-400"])}," Surfacing… ",2),ie(x.$slots,"header-actions",{},void 0,!0)])],4),se(y0,{variant:g.value,count:v.value},null,8,["variant","count"])])):(s(),n("div",C0,[e("div",{class:i(["absolute inset-0 opacity-[0.04] pointer-events-none",t(l)?"bg-white":"bg-black"]),style:{"background-image":`url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")`}},null,2),e("div",j0,[e("div",S0,[(s(),n(I,null,P(5,($,_)=>e("div",{key:_,class:i(["w-12 h-16 rounded-lg overflow-hidden relative animate-cell-pulse",t(l)?"bg-white/8 border border-white/15 shadow-xl shadow-accent/5":"bg-black/6 border border-black/8 shadow-xl shadow-accent/10"]),style:q({animationDelay:`${_*100}ms`})},[e("div",M0,[e("div",{class:i(["absolute inset-0 w-1/2 animate-shimmer-sweep",t(l)?"bg-gradient-to-r from-transparent via-accent/25 to-transparent":"bg-gradient-to-r from-transparent via-accent/35 to-transparent"])},null,2)])],6)),64))]),e("p",{class:i(["text-sm font-medium",t(l)?"text-white/70":"text-gray-600"])},u(w.value),3),e("div",{class:i(["w-40 h-px rounded-full overflow-hidden",t(l)?"bg-white/8":"bg-black/8"])},[...m[0]||(m[0]=[e("div",{class:"h-full bg-accent/90 rounded-full animate-progress-sweep"},null,-1)])],2)])]))]))}}),it=De(T0,[["__scopeId","data-v-f8eb31f3"]]),D0={key:0,class:"absolute inset-0 pointer-events-none bg-black/20"},I0={key:0,class:"flex-1 min-w-0 flex flex-col relative"},B0={class:"flex flex-wrap gap-1.5 flex-1 min-w-0 justify-center"},L0=["onClick"],P0={key:1,class:"flex-1 min-w-0 flex flex-col"},N0={key:3,class:"flex-1 flex items-center justify-center"},A0={class:"text-center space-y-4 animate-fade-up max-w-sm px-6"},z0={class:"empty-state-icon w-20 h-20 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},E0={key:0,class:"flex-1 min-w-0 path-glass-card overflow-hidden flex flex-col order-3 detail-persistent panel-slide-in",style:{"animation-delay":"0.2s"}},F0={key:1,class:"flex-1 flex items-center justify-center"},R0={class:"text-center space-y-4 max-w-[200px] px-4"},V0={class:"empty-state-icon w-16 h-16 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},U0={key:1,class:"flex-1 flex flex-col min-h-0"},q0={class:"flex-1 min-h-0 flex flex-col p-2 pb-0"},G0={class:"flex-1 min-h-0 path-glass-card flex flex-col rounded-2xl overflow-hidden"},O0={class:"flex-1 min-h-0 flex flex-col p-2 pb-0"},H0={class:"flex-1 min-h-0 path-glass-card flex flex-col rounded-2xl overflow-hidden"},W0={class:"shrink-0 flex items-center gap-2 px-3 pt-2 pb-1 overflow-x-auto scrollbar-hide"},K0=["onClick"],Y0={key:2,class:"flex-1 flex items-center justify-center"},Q0={class:"text-center space-y-3 px-6"},J0={class:"empty-state-icon w-16 h-16 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},Z0={class:"flex-1 min-h-0 flex flex-col p-2 pb-0"},X0={class:"flex-1 min-h-0 path-glass-card flex flex-col rounded-2xl overflow-hidden"},eh={class:"flex-1 min-h-0 flex flex-col"},th={key:1,class:"flex-1 flex items-center justify-center"},sh={class:"text-center space-y-3 px-6"},nh={class:"empty-state-icon w-16 h-16 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},lh={class:"shrink-0 pt-3 pb-3",style:{paddingBottom:"calc(12px + env(safe-area-inset-bottom, 0px))"}},oh={class:"flex items-center h-[49px] px-2 gap-1"},ah={key:0,class:"absolute top-1.5 right-[28%] w-1.5 h-1.5 rounded-full bg-accent"},ih={key:0,class:"absolute top-1.5 right-[28%] w-1.5 h-1.5 rounded-full bg-accent"},rh=G({__name:"ChatPage",setup(a){const{hasTrack:c}=ts(),l=os(),{activeFile:w,isCodeMode:g,exitCodeMode:v,clearActiveFile:x}=pe(),{isDark:m}=Z(),$=!!window.__AIUI_EMBEDDED__,_="/aiui/assets/img/bg-intro-3.jpg";cs();const{panelOpen:b,panelFilms:d,panelBooks:o,panelTVSeries:r,panelImages:h,panelPlaces:M,panelSongs:j,panelPodcasts:L,panelWebResults:D,panelWebsites:C,panelMagazineSections:k,panelMagazineHeroImage:p,panelRecipes:y,panelApps:A,panelTitle:V,panelQuery:E,panelResponseText:Q,contentType:H,activeTab:K,availableTabs:F,setActiveTab:O,selectedFilm:X,selectedBook:ge,selectedTVSeries:be,selectedImage:ee,selectedPlace:z,selectedSong:N,selectedPodcast:re,selectedArticle:mt,selectedWebsite:wt,selectedMagazineSection:Be,selectedDesignSystemItem:yt,closeFilmDetail:kt,closeBookDetail:$t,closeTVSeriesDetail:_t,closeImageDetail:Ct,closePlaceDetail:jt,closeSongDetail:St,closePodcastDetail:Mt,closeArticleDetail:Tt,closeWebsiteDetail:Dt,closeMagazineSectionDetail:It,closePanel:_e,openFilmDetail:Bt,openBookDetail:Lt,openTVSeriesDetail:Pt,openImageDetail:Nt,openPlaceDetail:At,openSongDetail:zt,openPodcastDetail:Et,openMagazineSectionDetail:Ft}=$e(),Ce=B(()=>l.panelSide),ze=S(window.innerWidth),oe=B(()=>ze.value<1024),de=B(()=>ze.value>=1440),te=S("chat"),{isKeyboardOpen:Rt}=ss();function Ke(){ze.value=window.innerWidth}function Ye(R){R.key==="Escape"&&g.value&&!oe.value&&v()}le(()=>{window.addEventListener("resize",Ke),window.addEventListener("keydown",Ye)}),ns(()=>{window.removeEventListener("resize",Ke),window.removeEventListener("keydown",Ye)}),ce(b,R=>{R&&oe.value&&!$&&(te.value="content")}),ce(V,()=>{b.value&&oe.value&&te.value==="chat"&&!$&&(te.value="content")}),ce(K,()=>{b.value&&oe.value&&te.value==="chat"&&!$&&(te.value="content")});const ve=B(()=>!!(X.value||ge.value||be.value||ee.value||z.value||N.value||re.value||mt.value||wt.value||Be.value||yt.value||g.value&&w.value));ce(ve,R=>{R&&oe.value&&(te.value="context"),!R&&oe.value&&te.value==="context"&&(te.value="content")});const Ee=B(()=>b.value&&F.value.length>0);function Qe(){kt(),$t(),_t(),Ct(),jt(),St(),Mt(),Tt(),Dt(),It(),x()}const Fe=B(()=>{const R=[];return d.value.forEach(T=>R.push({open:()=>Bt(T)})),o.value.forEach(T=>R.push({open:()=>Lt(T)})),r.value.forEach(T=>R.push({open:()=>Pt(T)})),j.value.forEach(T=>R.push({open:()=>zt(T)})),L.value.forEach(T=>R.push({open:()=>Et(T)})),h.value.forEach(T=>R.push({open:()=>Nt(T)})),M.value.forEach(T=>R.push({open:()=>At(T)})),k.value.forEach((T,Y)=>R.push({open:()=>Ft(T,Y)})),R}),Je=B(()=>{if(X.value){const R=d.value.indexOf(X.value);return R>=0?R:0}if(ge.value){const R=o.value.indexOf(ge.value);return R>=0?d.value.length+R:0}if(be.value){const R=r.value.indexOf(be.value);return R>=0?d.value.length+o.value.length+R:0}if(N.value){const R=d.value.length+o.value.length+r.value.length,T=j.value.indexOf(N.value);return T>=0?R+T:0}if(re.value){const R=d.value.length+o.value.length+r.value.length+j.value.length,T=L.value.indexOf(re.value);return T>=0?R+T:0}if(ee.value){const R=d.value.length+o.value.length+r.value.length+j.value.length+L.value.length,T=h.value.indexOf(ee.value);return T>=0?R+T:0}if(z.value){const R=d.value.length+o.value.length+r.value.length+j.value.length+L.value.length+h.value.length,T=M.value.indexOf(z.value);return T>=0?R+T:0}if(Be.value){const R=d.value.length+o.value.length+r.value.length+j.value.length+L.value.length+h.value.length+M.value.length,T=k.value.indexOf(Be.value);return T>=0?R+T:0}return 0});function Ze(R){const T=Fe.value;if(!T.length)return;let Y=Je.value;Y+=R==="next"?1:-1,Y<0&&(Y=T.length-1),Y>=T.length&&(Y=0),Qe(),T[Y].open()}const Vt={film:"Films",book:"Books",tvshow:"TV",image:"Images",place:"Places",recipe:"Recipes",song:"Songs",podcast:"Podcasts",news:"News",websites:"Websites",magazine:"Brief",code:"Code","design-system":"Design",app:"Apps",nostr:"Nostr",favorites:"Favorites",discover:"Discover",prompt:"Prompt"};function Xe(R){return Vt[R]??R}const et=B(()=>{if(b.value)return H.value;const T=([...l.messages].reverse().find(Y=>Y.role==="user")?.content??"").toLowerCase();return/\b(song|music|track|album|band|artist|listen)\b/.test(T)?"song":/\b(book|novel|read|author|fiction|nonfiction|memoir)\b/.test(T)?"book":/\b(tv show|tv series|series|television|binge|season)\b/.test(T)?"tvshow":/\b(image|images|photo|photos|picture|pictures|screenshot|gallery|artwork|illustration)\b/.test(T)?"image":/\b(restaurant|restaurants|place|places|food|eat|dining|cafe|bar|pub|brunch|lunch|dinner)\b/.test(T)?"film":/\b(podcast|episode|show|listen to)\b/.test(T)?"podcast":/\b(news|latest|recent|current|what'?s happening|what are people saying)\b/.test(T)?"news":/\b(bip|protocol|debate|sentiment|bearish|bull case|macro)\b/.test(T)?"magazine":/\b(website|websites|where to check|best places|check online|resources?|sources?)\b/.test(T)?"websites":H.value});return(R,T)=>(s(),n("div",{class:i(["h-full flex flex-col relative overflow-hidden transition-colors duration-300",[]]),style:q($?{background:"transparent"}:t(m)?{background:"#000 url("+_+") center center / cover no-repeat fixed"}:{backgroundColor:"#f5f4f1"})},[t(m)&&!$?(s(),n("div",D0)):f("",!0),e("div",{class:i(["flex-1 flex h-full p-3 md:p-4 gap-3 md:gap-4 transition-[padding] duration-200",[oe.value?"hidden":""]]),style:q(t(c)&&!oe.value?{paddingBottom:"76px"}:{})},[e("main",{class:i(["flex-1 min-w-0 path-glass-card overflow-hidden flex relative panel-slide-in",[de.value?Ce.value==="left"?"order-2":"order-1":Ce.value==="left"?"order-last":"order-first",!de.value&&ve.value&&!Ee.value&&"detail-active"]]),style:{"animation-delay":"0.1s"}},[t(b)&&Ee.value&&(de.value||!ve.value)?(s(),n("div",I0,[se(Oe,{onClick:t(_e)},null,8,["onClick"]),e("div",{class:"shrink-0 flex items-center gap-2 px-4 pr-12 py-3",style:q(t(m)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",B0,[(s(!0),n(I,null,P(t(F),Y=>(s(),n("button",{key:Y,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",t(K)===Y?"nav-tab-active":t(m)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:Ut=>t(O)(Y)},u(Xe(Y)),11,L0))),128))])],4),se(fe,{title:"Content failed to load"},{default:ue(()=>[se(at,{"active-tab":t(K),"is-wide-desktop":de.value,"is-mobile":oe.value,"panel-films":t(d),"panel-books":t(o),panelTVSeries:t(r),"panel-images":t(h),"panel-places":t(M),"panel-songs":t(j),"panel-podcasts":t(L),"panel-web-results":t(D),"panel-websites":t(C),"panel-magazine-sections":t(k),"panel-magazine-hero-image":t(p),"panel-recipes":t(y),"panel-apps":t(A),"panel-title":t(V),"panel-query":t(E),"panel-response-text":t(Q),onClose:t(_e)},null,8,["active-tab","is-wide-desktop","is-mobile","panel-films","panel-books","panelTVSeries","panel-images","panel-places","panel-songs","panel-podcasts","panel-web-results","panel-websites","panel-magazine-sections","panel-magazine-hero-image","panel-recipes","panel-apps","panel-title","panel-query","panel-response-text","onClose"])]),_:1})])):!de.value&&t(b)&&ve.value?(s(),n("div",P0,[se(Oe,{onClick:T[0]||(T[0]=Y=>Ee.value?Qe():t(_e)())}),se(fe,{title:"Detail view error"},{default:ue(()=>[se(Ge)]),_:1})])):t(l).isStreaming?(s(),U(it,{key:2,"context-type":et.value},{"header-actions":ue(()=>[se(Oe,{onClick:t(_e)},null,8,["onClick"])]),_:1},8,["context-type"])):(s(),n("div",N0,[e("div",A0,[e("div",z0,[e("span",{class:i(["text-3xl",t(m)?"text-[#fafafa]":"text-gray-800"])},"✦",2)]),e("div",null,[e("h2",{class:i(["text-lg font-bold mb-1",t(m)?"text-white/80":"text-gray-800"])}," Content Surface ",2),e("p",{class:i(["text-sm leading-relaxed",t(m)?"text-white/30":"text-gray-400"])}," Ask about films, songs, or podcasts in the chat to see rich content here. ",2)])])]))],2),de.value?(s(),n("div",E0,[ve.value?(s(),U(fe,{key:0,title:"Detail view error"},{default:ue(()=>[se(Ge)]),_:1})):(s(),n("div",F0,[e("div",R0,[e("div",V0,[e("span",{class:i(["text-2xl",t(m)?"text-[#fafafa]":"text-gray-800"])},"✦",2)]),e("div",null,[e("h2",{class:i(["text-sm font-semibold mb-1",t(m)?"text-white/60":"text-gray-600"])}," Awaiting Context ",2),e("p",{class:i(["text-xs leading-relaxed",t(m)?"text-white/25":"text-gray-400"])}," Select an item to see details here. ",2)])])]))])):f("",!0),e("aside",{class:i(["relative z-[100] w-80 xl:w-96 shrink-0 flex flex-col path-glass-card overflow-visible panel-slide-in",de.value?Ce.value==="left"?"order-1":"order-2":Ce.value==="left"?"order-first":"order-last"]),style:{"animation-delay":"0s"}},[se(fe,{title:"Chat error"},{default:ue(()=>[se(tt,{side:Ce.value,onSwitchSide:T[1]||(T[1]=Y=>t(l).switchSide())},null,8,["side"])]),_:1})],2)],6),oe.value?(s(),n("div",U0,[W(e("div",q0,[e("div",G0,[se(fe,{title:"Chat error"},{default:ue(()=>[se(tt,{variant:"standalone","show-close":!1})]),_:1})])],512),[[Le,te.value==="chat"]]),W(e("div",O0,[e("div",H0,[t(b)?(s(),n(I,{key:0},[e("div",W0,[e("button",{class:i(["p-1.5 rounded-lg transition-colors shrink-0",t(m)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-gray-400 hover:text-gray-700 hover:bg-black/5"]),onClick:T[2]||(T[2]=Y=>te.value="chat")},[...T[8]||(T[8]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])],2),(s(!0),n(I,null,P(t(F),Y=>(s(),n("button",{key:Y,class:i(["text-xs px-2.5 py-1.5 rounded-lg font-medium whitespace-nowrap transition-all duration-150",t(K)===Y?"nav-tab-active":t(m)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:Ut=>t(O)(Y)},u(Xe(Y)),11,K0))),128))]),se(fe,{title:"Content failed to load"},{default:ue(()=>[se(at,{"active-tab":t(K),"is-wide-desktop":de.value,"is-mobile":oe.value,"panel-films":t(d),"panel-books":t(o),panelTVSeries:t(r),"panel-images":t(h),"panel-places":t(M),"panel-songs":t(j),"panel-podcasts":t(L),"panel-web-results":t(D),"panel-websites":t(C),"panel-magazine-sections":t(k),"panel-magazine-hero-image":t(p),"panel-recipes":t(y),"panel-apps":t(A),"panel-title":t(V),"panel-query":t(E),onClose:t(_e)},null,8,["active-tab","is-wide-desktop","is-mobile","panel-films","panel-books","panelTVSeries","panel-images","panel-places","panel-songs","panel-podcasts","panel-web-results","panel-websites","panel-magazine-sections","panel-magazine-hero-image","panel-recipes","panel-apps","panel-title","panel-query","onClose"])]),_:1})],64)):t(l).isStreaming?(s(),U(it,{key:1,"context-type":et.value},null,8,["context-type"])):(s(),n("div",Y0,[e("div",Q0,[e("div",J0,[e("span",{class:i(["text-2xl",t(m)?"text-[#fafafa]":"text-gray-800"])},"✦",2)]),e("p",{class:i(["text-xs",t(m)?"text-white/30":"text-gray-400"])}," Ask about something in the chat to see content here. ",2)])]))])],512),[[Le,te.value==="content"]]),W(e("div",Z0,[e("div",X0,[ve.value?(s(),n(I,{key:0},[e("div",eh,[se(fe,{title:"Detail view error"},{default:ue(()=>[se(Ge)]),_:1})]),!t(Be)&&Fe.value.length>1?(s(),n("div",{key:0,class:"shrink-0 flex items-center justify-between px-4 py-2",style:q(t(m)?"border-top: 1px solid rgba(255, 255, 255, 0.08)":"border-top: 1px solid rgba(0, 0, 0, 0.06)")},[e("button",{class:i(["flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs transition-colors",t(m)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-black/40 hover:text-black/70 hover:bg-black/5"]),onClick:T[3]||(T[3]=Y=>Ze("prev"))},[...T[9]||(T[9]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),ne(" Prev ",-1)])],2),e("span",{class:i(["text-xs font-mono tabular-nums",t(m)?"text-white/25":"text-black/25"])},u(Je.value+1)+"/"+u(Fe.value.length),3),e("button",{class:i(["flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs transition-colors",t(m)?"text-white/50 hover:text-white/80 hover:bg-white/5":"text-black/40 hover:text-black/70 hover:bg-black/5"]),onClick:T[4]||(T[4]=Y=>Ze("next"))},[...T[10]||(T[10]=[ne(" Next ",-1),e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],2)],4)):f("",!0)],64)):(s(),n("div",th,[e("div",sh,[e("div",nh,[(s(),n("svg",{class:i(["w-7 h-7",t(m)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...T[11]||(T[11]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"},null,-1)])],2))]),e("p",{class:i(["text-xs",t(m)?"text-white/30":"text-gray-400"])}," Tap an item in Content to view details here. ",2)])]))])],512),[[Le,te.value==="context"]]),se(ls,{variant:"inline",compact:""}),W(e("div",lh,[e("div",oh,[e("button",{class:i(["flex-1 flex flex-col items-center justify-center h-[49px] min-h-[44px] rounded-xl text-[10px] font-medium tracking-wide transition-all duration-150 gap-0.5",te.value==="chat"?t(m)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(m)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:T[5]||(T[5]=Y=>te.value="chat")},[...T[12]||(T[12]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})],-1),e("span",null,"Chat",-1)])],2),e("button",{class:i(["flex-1 flex flex-col items-center justify-center h-[49px] min-h-[44px] rounded-xl text-[10px] font-medium tracking-wide transition-all duration-150 relative gap-0.5",te.value==="content"?t(m)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(m)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:T[6]||(T[6]=Y=>te.value="content")},[T[13]||(T[13]=e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})],-1)),T[14]||(T[14]=e("span",null,"Content",-1)),t(b)&&te.value==="chat"?(s(),n("span",ah)):f("",!0)],2),e("button",{class:i(["flex-1 flex flex-col items-center justify-center h-[49px] min-h-[44px] rounded-xl text-[10px] font-medium tracking-wide transition-all duration-150 relative gap-0.5",te.value==="context"?t(m)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(m)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:T[7]||(T[7]=Y=>te.value="context")},[T[15]||(T[15]=e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1)),T[16]||(T[16]=e("span",null,"Context",-1)),ve.value&&te.value!=="context"?(s(),n("span",ih)):f("",!0)],2)])],512),[[Le,!t(Rt)]])])):f("",!0)],4))}}),fh=De(rh,[["__scopeId","data-v-2cb034ff"]]);export{fh as default};
|