- Add AIUI pre-built dist to demo/ for Portainer deployment - Add nginx-demo.conf with Claude API proxy (envsubst for API key) - Add docker-entrypoint.sh for runtime API key injection - Update Dockerfile.web to include AIUI and Claude proxy - Update docker-compose.demo.yml with ANTHROPIC_API_KEY env var - Switch deploy script from sshpass to SSH key auth - Fix Quick Start Goals animating before other cards (stagger 5, opacity guard) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
259 lines
190 KiB
JavaScript
259 lines
190 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/useNostr-CZatyrb1.js","assets/index-CqBtvLD5.js","assets/index-D1RpahE8.css","assets/ThreadNode-B0koBP1i.js"])))=>i.map(i=>d[i]);
|
||
import{a as G,Z as Vt,$ as rt,p as Ne,b as s,c as n,e,h as W,u as t,n as i,t as u,f as re,w as Q,v as J,F as D,g as N,i as v,j as Z,r as S,k as B,a0 as Ut,a1 as ct,H as se,a2 as dt,a3 as ut,a4 as ht,a5 as xt,U as Ie,a6 as qt,a7 as Gt,J as Ot,Q as q,D as ne,a8 as ae,a9 as ye,z as we,_ as pt,A as ie,B as Pe,d as Ht,aa as Wt,E as te,ab as Kt,ac as Yt,ad as Qt,S as Jt,q as Zt,ae as Xt,o as es,G as ue,af as Le,ag as ts}from"./index-CqBtvLD5.js";import{u as ss}from"./chat-D6vURcTH.js";import{u as $e,a as xe,e as He,d as gt,M as ns,b as ls,s as os,c as as,f as be,_ as tt}from"./ChatWindow.vue_vue_type_script_setup_true_lang-BS0iEVVD.js";import{_ as is}from"./FilmGrid.vue_vue_type_script_setup_true_lang-Cl2ukq8v.js";import{u as ze}from"./useContentImages-CXWJDBMs.js";import{_ as rs}from"./SongGrid.vue_vue_type_script_setup_true_lang-Bx4BvItY.js";import{useNostr as De}from"./useNostr-CZatyrb1.js";import{u as bt,_ as cs}from"./FilmDetail.vue_vue_type_script_setup_true_lang-Ckw7Dobw.js";import{_ as ds}from"./SongDetail.vue_vue_type_script_setup_true_lang-D619ywdc.js";const us={class:"h-full flex flex-col"},hs={class:"flex items-center justify-between gap-2"},xs={class:"flex items-center gap-2 shrink-0"},ps={key:0,class:"flex flex-wrap gap-1.5"},gs=["onClick"],bs={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},vs={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},fs=["aria-label","onClick"],ms={class:"cover-card flex-1 min-h-0 relative"},ws={key:0,class:"absolute inset-0 animate-shimmer"},ys=["src","alt","onError"],ks=["src","alt"],$s={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},_s={class:"absolute bottom-0 left-0 right-0 p-2"},Cs={class:"text-xs font-semibold text-white/90 leading-tight truncate"},js={class:"text-xs text-white/40 truncate mt-0.5"},Ss={key:4,class:"absolute top-1.5 left-1.5"},Ms={class:"text-xs px-1.5 py-0.5 rounded bg-black/60 text-amber-400 backdrop-blur-sm font-medium"},Ts={key:5,class:"absolute top-1.5 right-1.5"},Is={class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},Ds={key:0,class:"flex items-center justify-center py-12"},Bs=G({__name:"BookGrid",props:{books:{},title:{default:"Recommended Books"}},emits:["selectBook"],setup(o){const c=o,{isDark:l}=Z(),m=S(""),g=S(null),{coverSrc:b,fallbackSrc:p,onError:w,isLoading:$}=ze({items:Ne(c,"books"),id:d=>d.id,existingUrl:d=>d.coverUrl,fetch:d=>rt(d.title,d.author),fallback:d=>Vt(d.title,d.author)}),_=B(()=>{const d=new Map;for(const a of c.books)for(const r of a.genres??[])d.set(r,(d.get(r)??0)+1);return[...d.entries()].sort((a,r)=>r[1]-a[1]).slice(0,8).map(([a])=>a)}),f=B(()=>{let d=c.books;if(m.value){const a=m.value.toLowerCase();d=d.filter(r=>r.title.toLowerCase().includes(a)||r.author.toLowerCase().includes(a)||(r.genres??[]).some(h=>h.toLowerCase().includes(a)))}return g.value&&(d=d.filter(a=>(a.genres??[]).includes(g.value))),d});return(d,a)=>(s(),n("div",us,[e("div",{class:"p-4 space-y-3",style:W(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",hs,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(o.title),3),e("div",xs,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(f.value.length)+" books ",3),re(d.$slots,"header-actions")])]),Q(e("input",{"onUpdate:modelValue":a[0]||(a[0]=r=>m.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,m.value]]),_.value.length>0?(s(),n("div",ps,[(s(!0),n(D,null,N(_.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,gs))),128))])):v("",!0)],4),e("div",bs,[e("div",vs,[(s(!0),n(D,null,N(f.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",ms,[e("div",{class:i(["aspect-[2/3] relative w-full overflow-hidden rounded-[10px]",t(b)(r)?"":t(l)?"bg-white/[0.06]":"bg-black/[0.04]"])},[t($)(r)?(s(),n("div",ws)):v("",!0),t(b)(r)?(s(),n("img",{key:1,src:t(b)(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(w)(r)},null,40,ys)):t($)(r)?v("",!0):(s(),n("img",{key:2,src:t(p)(r),alt:r.title,class:"w-full h-full object-cover"},null,8,ks)),t(b)(r)?(s(),n("div",$s)):v("",!0),e("div",_s,[e("p",Cs,u(r.title),1),e("p",js,u(r.author),1)]),r.rating?(s(),n("div",Ss,[e("span",Ms," ★ "+u(r.rating.toFixed(1)),1)])):v("",!0),r.year?(s(),n("div",Ts,[e("span",Is,u(r.year),1)])):v("",!0)],2)])],8,fs))),128))]),f.value.length===0?(s(),n("div",Ds,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No books match your search ",2)])):v("",!0)])]))}}),Ls={class:"h-full flex flex-col"},Ps={class:"flex items-center justify-between gap-2"},Ns={class:"flex items-center gap-2 shrink-0"},zs={key:0,class:"flex flex-wrap gap-1.5"},Es=["onClick"],As={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},Fs={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},Rs=["aria-label","onClick"],Vs={class:"cover-card flex-1 min-h-0 relative"},Us={key:0,class:"absolute inset-0 animate-shimmer"},qs=["src","alt","onError"],Gs=["src","alt"],Os={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},Hs={class:"absolute bottom-0 left-0 right-0 p-2"},Ws={class:"text-xs font-semibold text-white/90 leading-tight truncate"},Ks={class:"text-xs text-white/40 truncate mt-0.5"},Ys={key:4,class:"absolute top-1.5 left-1.5"},Qs={class:"text-xs px-1.5 py-0.5 rounded bg-black/60 text-amber-400 backdrop-blur-sm font-medium"},Js={key:5,class:"absolute top-1.5 right-1.5"},Zs={class:"absolute top-1.5 right-1.5 flex gap-0.5 flex-wrap justify-end max-w-[60%]"},Xs={key:0,class:"flex items-center justify-center py-12"},en=G({__name:"TVSeriesGrid",props:{series:{},title:{default:"Recommended TV Series"}},emits:["selectSeries"],setup(o){const c=o,{isDark:l}=Z(),m=S(""),g=S(null),{coverSrc:b,fallbackSrc:p,onError:w,isLoading:$}=ze({items:Ne(c,"series"),id:a=>a.id,existingUrl:a=>a.posterUrl||a.backdropUrl,fetch:a=>ct(a.title,a.year).then(r=>r.posterUrl),fallback:a=>Ut(a.title,a.year)});function _(a){return a.year?a.endYear&&a.endYear!==a.year?`${a.year}–${a.endYear}`:a.status==="ongoing"?`${a.year}–`:String(a.year):""}const f=B(()=>{const a=new Map;for(const r of c.series)for(const h of r.genres??[])a.set(h,(a.get(h)??0)+1);return[...a.entries()].sort((r,h)=>h[1]-r[1]).slice(0,8).map(([r])=>r)}),d=B(()=>{let a=c.series;if(m.value){const r=m.value.toLowerCase();a=a.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&&(a=a.filter(r=>(r.genres??[]).includes(g.value))),a});return(a,r)=>(s(),n("div",Ls,[e("div",{class:"p-4 space-y-3",style:W(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",Ps,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(o.title),3),e("div",Ns,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(d.value.length)+" series ",3),re(a.$slots,"header-actions")])]),Q(e("input",{"onUpdate:modelValue":r[0]||(r[0]=h=>m.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,m.value]]),f.value.length>0?(s(),n("div",zs,[(s(!0),n(D,null,N(f.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,Es))),128))])):v("",!0)],4),e("div",As,[e("div",Fs,[(s(!0),n(D,null,N(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=>a.$emit("selectSeries",h)},[e("div",Vs,[e("div",{class:i(["aspect-[2/3] relative w-full overflow-hidden rounded-[10px]",t(b)(h)?"":t(l)?"bg-white/[0.06]":"bg-black/[0.04]"])},[t($)(h)?(s(),n("div",Us)):v("",!0),t(b)(h)?(s(),n("img",{key:1,src:t(b)(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(w)(h)},null,40,qs)):t($)(h)?v("",!0):(s(),n("img",{key:2,src:t(p)(h),alt:h.title,class:"w-full h-full object-cover"},null,8,Gs)),t(b)(h)?(s(),n("div",Os)):v("",!0),e("div",Hs,[e("p",Ws,u(h.title),1),e("p",Ks,[se(u(_(h)),1),h.seasons?(s(),n(D,{key:0},[se(" · "+u(h.seasons)+"S",1)],64)):v("",!0)])]),h.rating?(s(),n("div",Ys,[e("span",Qs," ★ "+u(h.rating.toFixed(1)),1)])):v("",!0),h.status==="ongoing"?(s(),n("div",Js,[...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)])])):v("",!0),e("div",Zs,[(s(!0),n(D,null,N((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,Rs))),128))]),d.value.length===0?(s(),n("div",Xs,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No TV series match your search ",2)])):v("",!0)])]))}}),tn={class:"h-full flex flex-col"},sn={class:"flex items-center justify-between gap-2"},nn={class:"flex items-center gap-2 shrink-0"},ln={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},on={class:"columns-2 sm:columns-3 gap-3 space-y-3"},an=["aria-label","onClick"],rn=["src","alt","onError"],cn={key:2,class:"absolute bottom-0 left-0 right-0 p-2 bg-gradient-to-t from-black/70 via-black/30 to-transparent"},dn={key:0,class:"text-xs font-medium text-white/90 truncate"},un={key:1,class:"text-xs text-white/50 truncate"},hn={key:0,class:"flex items-center justify-center py-12"},xn=G({__name:"ImageGrid",props:{images:{},title:{default:"Images"}},emits:["selectImage"],setup(o){const{isDark:c}=Z(),l=S(new Set);function m(g){l.value.add(g.id),l.value=new Set(l.value)}return(g,b)=>(s(),n("div",tn,[e("div",{class:"p-4 space-y-3",style:W(t(c)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",sn,[e("h3",{class:i(["text-sm font-bold",t(c)?"text-white/90":"text-gray-900"])},u(o.title),3),e("div",nn,[e("span",{class:i(["text-xs font-mono",t(c)?"text-white/30":"text-gray-400"])},u(o.images.length)+" images ",3),re(g.$slots,"header-actions")])])],4),e("div",ln,[e("div",on,[(s(!0),n(D,null,N(o.images,p=>(s(),n("button",{key:p.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":p.alt||p.title||"Image",onClick:w=>g.$emit("selectImage",p)},[l.value.has(p.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"},[...b[0]||(b[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:p.url,alt:p.alt||p.title||"Image",class:"w-full block transition-transform duration-300 group-hover:scale-[1.03]",loading:"lazy",onError:w=>m(p)},null,40,rn)),p.title||p.source?(s(),n("div",cn,[p.title?(s(),n("p",dn,u(p.title),1)):v("",!0),p.source?(s(),n("p",un,u(p.source),1)):v("",!0)])):v("",!0)],10,an))),128))]),o.images.length===0?(s(),n("div",hn,[e("p",{class:i(["text-sm",t(c)?"text-white/30":"text-gray-400"])}," No images found ",2)])):v("",!0)])]))}}),pn={class:"h-full flex flex-col"},gn={class:"p-4 space-y-3"},bn={class:"flex items-center justify-between"},vn={class:"shrink-0 flex items-center gap-2"},fn={key:0,class:"flex flex-wrap gap-1.5"},mn=["onClick"],wn={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pb-16"},yn={class:"grid grid-cols-2 sm:grid-cols-3 gap-3"},kn=["aria-label","onClick"],$n={class:"aspect-[4/3] relative w-full overflow-hidden rounded-t-[10px]"},_n={key:0,class:"absolute inset-0 animate-shimmer"},Cn=["src","alt","onError"],jn=["src","alt"],Sn={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},Mn={class:"absolute bottom-0 left-0 right-0 p-2"},Tn={class:"text-xs font-semibold text-white/90 truncate"},In={class:"text-xs text-white/40 truncate mt-0.5"},Dn={key:4,class:"absolute top-1.5 right-1.5"},Bn={class:"text-xs px-1.5 py-0.5 rounded bg-black/60 text-amber-400 backdrop-blur-sm font-semibold"},Ln={key:5,class:"absolute top-1.5 left-1.5"},Pn={class:"text-xs px-1 py-0.5 rounded bg-black/60 text-white/70 backdrop-blur-sm"},Nn={key:0,class:"flex items-center justify-center py-12"},zn=G({__name:"PlaceGrid",props:{places:{},title:{default:"Places"}},emits:["selectPlace"],setup(o){const c=o,{isDark:l}=Z(),m=S(""),g=S(null),{coverSrc:b,fallbackSrc:p,onError:w,isLoading:$}=ze({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 a of c.places){const r=a.cuisine||a.category;r&&d.set(r,(d.get(r)??0)+1)}return[...d.entries()].sort((a,r)=>r[1]-a[1]).slice(0,8).map(([a])=>a)}),f=B(()=>{let d=c.places;if(m.value){const a=m.value.toLowerCase();d=d.filter(r=>r.name.toLowerCase().includes(a)||r.cuisine?.toLowerCase().includes(a)||r.category?.toLowerCase().includes(a)||r.city?.toLowerCase().includes(a)||r.address?.toLowerCase().includes(a))}return g.value&&(d=d.filter(a=>a.cuisine===g.value||a.category===g.value)),d});return(d,a)=>(s(),n("div",pn,[e("div",gn,[e("div",bn,[e("h3",{class:i(["text-base font-bold",t(l)?"text-white/90":"text-gray-900"])},u(o.title||"Places"),3),e("div",vn,[e("span",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(f.value.length)+" places ",3),re(d.$slots,"header-actions")])]),Q(e("input",{"onUpdate:modelValue":a[0]||(a[0]=r=>m.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,m.value]]),_.value.length>1?(s(),n("div",fn,[(s(!0),n(D,null,N(_.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,mn))),128))])):v("",!0)]),e("div",wn,[e("div",yn,[(s(!0),n(D,null,N(f.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",$n,[t($)(r)?(s(),n("div",_n)):v("",!0),t(b)(r)?(s(),n("img",{key:1,src:t(b)(r),alt:r.name,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:h=>t(w)(r)},null,40,Cn)):t($)(r)?v("",!0):(s(),n("img",{key:2,src:t(p)(r),alt:r.name,class:"w-full h-full object-cover"},null,8,jn)),t(b)(r)?(s(),n("div",Sn)):v("",!0),e("div",Mn,[e("p",Tn,u(r.name),1),e("p",In,u(r.cuisine||r.category),1)]),r.rating?(s(),n("div",Dn,[e("span",Bn," ★ "+u(r.rating.toFixed(1)),1)])):v("",!0),r.priceLevel?(s(),n("div",Ln,[e("span",Pn,u("$".repeat(r.priceLevel)),1)])):v("",!0)])],8,kn))),128))]),f.value.length===0?(s(),n("div",Nn,[e("p",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])}," No places match your search ",2)])):v("",!0)])]))}}),En={class:"h-full flex flex-col"},An={class:"flex items-center justify-between gap-2"},Fn={class:"flex items-center gap-2 shrink-0"},Rn={key:0,class:"flex flex-wrap gap-1.5"},Vn=["onClick"],Un={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},qn={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},Gn=["aria-label","onClick"],On={class:"cover-card flex-1 min-h-0 relative"},Hn={key:0,class:"absolute inset-0 animate-shimmer"},Wn=["src","alt","onError"],Kn=["src","alt"],Yn={key:3,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none"},Qn={class:"absolute bottom-0 left-0 right-0 p-2"},Jn={class:"text-xs font-semibold text-white/90 leading-tight truncate"},Zn={class:"text-xs text-white/40 truncate mt-0.5"},Xn={class:"absolute top-1.5 right-1.5 flex gap-0.5 flex-wrap justify-end max-w-[60%]"},el={key:0,class:"flex items-center justify-center py-12"},tl=G({__name:"PodcastGrid",props:{podcasts:{},title:{default:"Recommended Podcasts"}},emits:["selectPodcast"],setup(o){const c=o,{isDark:l}=Z(),m=S(""),g=S(null),{coverSrc:b,fallbackSrc:p,onError:w,isLoading:$}=ze({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 a of c.podcasts)for(const r of a.genres??[])d.set(r,(d.get(r)??0)+1);return[...d.entries()].sort((a,r)=>r[1]-a[1]).slice(0,8).map(([a])=>a)}),f=B(()=>{let d=c.podcasts;if(m.value){const a=m.value.toLowerCase();d=d.filter(r=>r.title.toLowerCase().includes(a)||(r.host??"").toLowerCase().includes(a)||(r.genres??[]).some(h=>h.toLowerCase().includes(a)))}return g.value&&(d=d.filter(a=>(a.genres??[]).includes(g.value))),d});return(d,a)=>(s(),n("div",En,[e("div",{class:"p-4 space-y-3",style:W(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",An,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(o.title),3),e("div",Fn,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(f.value.length)+" podcasts ",3),re(d.$slots,"header-actions")])]),Q(e("input",{"onUpdate:modelValue":a[0]||(a[0]=r=>m.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,m.value]]),_.value.length>0?(s(),n("div",Rn,[(s(!0),n(D,null,N(_.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,Vn))),128))])):v("",!0)],4),e("div",Un,[e("div",qn,[(s(!0),n(D,null,N(f.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",On,[e("div",{class:i(["aspect-square relative w-full overflow-hidden rounded-[10px]",t(b)(r)?"":t(l)?"bg-white/[0.06]":"bg-black/[0.04]"])},[t($)(r)?(s(),n("div",Hn)):v("",!0),t(b)(r)?(s(),n("img",{key:1,src:t(b)(r),alt:r.title,class:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy",onError:h=>t(w)(r)},null,40,Wn)):t($)(r)?v("",!0):(s(),n("img",{key:2,src:t(p)(r),alt:r.title,class:"w-full h-full object-cover"},null,8,Kn)),t(b)(r)?(s(),n("div",Yn)):v("",!0),e("div",Qn,[e("p",Jn,u(r.title),1),e("p",Zn,u(r.host||"Podcast"),1)]),e("div",Xn,[(s(!0),n(D,null,N(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,Gn))),128))]),f.value.length===0?(s(),n("div",el,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])}," No podcasts match your search ",2)])):v("",!0)])]))}}),sl={class:"shrink-0"},nl={class:"flex-1 overflow-y-auto custom-scrollbar"},ll={key:0,class:"relative overflow-hidden",style:{minHeight:"180px"}},ol={class:"absolute inset-0"},al=["src"],il={class:"relative z-10 flex flex-col justify-end h-full px-5 pb-5 pt-12",style:{"min-height":"180px"}},rl={class:"px-3 pt-2 pb-8"},cl={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"},dl={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"},ul={key:2,"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z"},hl={key:3,"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h7"},xl=["onClick"],pl=["onClick"],gl={key:1,class:"flex items-center justify-center py-16 px-4"},bl=G({__name:"MagazineGrid",props:{sections:{},heroImageUrl:{default:null},title:{default:"Brief"},query:{default:""}},setup(o){const c=o,{isDark:l}=Z(),{openMagazineSectionDetail:m}=$e(),g=["compass","bookmark","lightning","lines"];function b(f){return f.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 p(f,d){const a=b(f);return a.length<=d?a:a.slice(0,d).replace(/\s+\S*$/,"")+" ..."}const w=B(()=>{const f=[],d=c.sections;if(!d.length)return f;let a=0;for(const j of c.query||"brief")a=(a<<5)-a+j.charCodeAt(0)|0;let r="",h=0,M=!1;return d.forEach((j,L)=>{if(L===0&&!j.group){f.push({type:"wide",title:j.title,text:p(j.content,200),label:"The Lead",author:j.author,section:j});return}const I=j.group||"";if(I&&I!==r&&(M&&(f.push({type:"dark",title:"",text:""}),M=!1),f.push({type:"banner",title:"",text:"",icon:g[h%g.length],label:I}),h++,r=I),I){const C=M?"dark":"half",k=b(j.content),x=b(j.title),y=k.toLowerCase().startsWith(x.toLowerCase().slice(0,30));f.push({type:C,title:y?"":j.title,text:p(j.content,y?160:100),section:j}),M=!M}else M&&(f.push({type:"dark",title:"",text:""}),M=!1),f.push({type:"wide",title:j.title,text:p(j.content,180),author:j.author,section:j})}),M&&f.push({type:"dark",title:"",text:""}),f});function $(f){const d=c.sections.indexOf(f);m(f,d>=0?d:0)}const _=B(()=>{const f=(c.query??"").trim();return f?f.length>100?f.slice(0,97)+"...":f:c.title});return(f,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",sl,[re(f.$slots,"header-actions",{},void 0,!0)])],2),e("div",nl,[_.value?(s(),n("div",ll,[e("div",ol,[o.heroImageUrl?(s(),n("img",{key:0,src:o.heroImageUrl,alt:"",class:"w-full h-full object-cover",style:{filter:"saturate(0.3) contrast(1.1)"}},null,8,al)):(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",il,[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)])])):v("",!0),e("div",rl,[e("div",{class:i(["grid grid-cols-2 gap-px",t(l)?"bg-white/12":"bg-black/10"])},[(s(!0),n(D,null,N(w.value,(a,r)=>(s(),n(D,{key:r},[a.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"},[a.icon==="compass"?(s(),n("path",cl)):a.icon==="bookmark"?(s(),n("path",dl)):a.icon==="lightning"?(s(),n("path",ul)):(s(),n("path",hl))],2)),e("p",{class:i(["text-xs uppercase tracking-[0.3em] font-semibold text-center",t(l)?"text-white/30":"text-black/30"])},u(a.label),3)],2)):a.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=>a.section&&$(a.section)},[a.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(a.label),3)):v("",!0),e("h2",{class:i(["font-serif text-lg font-bold leading-snug mb-2",t(l)?"text-white/95":"text-black/90"])},u(a.title),3),a.author?(s(),n("p",{key:1,class:i(["text-xs mb-2",t(l)?"text-white/40":"text-black/40"])}," By "+u(a.author),3)):v("",!0),e("p",{class:i(["font-serif text-sm leading-relaxed",t(l)?"text-white/70":"text-black/60"])},u(a.text),3)],10,xl)):(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]",a.type==="dark"?t(l)?"bg-white/[0.04]":"bg-black/[0.04]":""]]),onClick:h=>a.section&&$(a.section)},[a.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(a.label),3)):v("",!0),a.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(a.title),3)):v("",!0),e("p",{class:i(["font-serif text-xs leading-relaxed flex-1",[t(l)?"text-white/55":"text-black/50",a.title?"":"italic"]])},u(a.text),3)],10,pl))],64))),128))],2)]),o.sections.length===0?(s(),n("div",gl,[e("p",{class:i(["text-sm",t(l)?"text-white/40":"text-gray-400"])}," No sections to display ",2)])):v("",!0)])],2))}}),st=Ie(bl,[["__scopeId","data-v-02741b8c"]]),vl={class:"h-full flex flex-col"},fl={class:"flex items-center justify-between gap-2"},ml={class:"flex items-center gap-2 shrink-0"},wl=["placeholder"],yl={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-4 pb-16"},kl={class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},$l=["aria-label","onClick"],_l={class:"cover-card flex-1 min-h-0 relative"},Cl={class:"aspect-[4/3] flex flex-col w-full overflow-hidden rounded-[10px]"},jl={class:"flex-1 min-h-0 relative"},Sl=["src","alt","onError"],Ml={key:2,class:"absolute inset-0 bg-gradient-to-t from-black/60 via-black/20 to-transparent pointer-events-none"},Tl={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(o){const c=o,{isDark:l}=Z(),{openArticleDetail:m,openWebsiteDetail:g}=$e(),b=S(""),p=S(new Set);function w(h){return!h||typeof h!="string"?!1:/^https?:\/\//i.test(h.trim())}function $(h){p.value=new Set([...p.value,h])}function _(h){try{return new URL(h).hostname.replace(/^www\./,"")}catch{return h}}function f(h){return c.variant==="websites"?qt(h.title,_(h.url)):Gt(h.title,_(h.url))}function d(h){c.variant==="websites"?g(h):m(h)}function a(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 I=h.title.toLowerCase(),C=(h.content??"").toLowerCase(),k=h.url.toLowerCase();let x=0;for(const y of L)I.includes(y)&&(x+=3),C.includes(y)&&(x+=2),k.includes(y)&&(x+=1);return x}const r=B(()=>{let h=c.articles;if(b.value.trim()){const M=b.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)=>a(j,c.query)-a(M,c.query)):h});return(h,M)=>(s(),n("div",vl,[e("div",{class:"p-4 space-y-3",style:W(t(l)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",fl,[e("h3",{class:i(["text-sm font-bold",t(l)?"text-white/90":"text-gray-900"])},u(o.title),3),e("div",ml,[e("span",{class:i(["text-xs font-mono",t(l)?"text-white/30":"text-gray-400"])},u(r.value.length)+" "+u(o.variant==="websites"?"websites":"articles"),3),re(h.$slots,"header-actions")])]),Q(e("input",{"onUpdate:modelValue":M[0]||(M[0]=j=>b.value=j),type:"text",placeholder:o.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,wl),[[J,b.value]])],4),e("div",yl,[e("div",kl,[(s(!0),n(D,null,N(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:I=>d(j)},[e("div",_l,[e("div",Cl,[e("div",jl,[w(j.imgSrc)&&!p.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:I=>$(j.url)},null,40,Sl)):(s(),n("div",{key:1,class:"absolute inset-0 bg-cover bg-center",style:W({backgroundImage:`url(${f(j)})`})},null,4)),w(j.imgSrc)&&!p.value.has(j.url)?(s(),n("div",Ml)):v("",!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)):v("",!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,$l))),128))]),r.value.length===0?(s(),n("div",Tl,[e("p",{class:i(["text-sm",t(l)?"text-white/30":"text-gray-400"])},u(o.variant==="websites"?"No websites match your search":"No articles match your search"),3)])):v("",!0)])]))}}),Il={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"},Dl={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"},Bl={class:"truncate"},Ll={key:1,class:"w-3 h-3 shrink-0 text-accent ml-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Pl={key:0},Nl=G({__name:"FileTreeNode",props:{entry:{},activeFile:{},depth:{}},emits:["select"],setup(o,{emit:c}){const l=o,{isFileSelected:m}=xe(),g=c,{isDark:b}=Z(),p=S(l.depth<1),w=B(()=>!l.entry.isDirectory&&l.activeFile===l.entry.path),$=B(()=>!l.entry.isDirectory&&m(l.entry.path));function _(){l.entry.isDirectory?p.value=!p.value:g("select",l.entry.path)}return(f,d)=>{const a=Ot("FileTreeNode",!0);return s(),n("div",null,[e("button",{class:i(["w-full text-left flex items-center gap-1.5 py-1 px-2 rounded-lg text-xs transition-colors",[$.value?"bg-accent/15 text-accent ring-1 ring-accent/30":w.value?t(b)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(b)?"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:W({paddingLeft:`${o.depth*12+8}px`}),onClick:_},[o.entry.isDirectory?(s(),n("svg",{key:0,class:i(["w-3 h-3 shrink-0 transition-transform duration-150",p.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...d[1]||(d[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)):v("",!0),(s(),n("svg",{class:i(["w-3.5 h-3.5 shrink-0",o.entry.isDirectory?"text-accent/70":t(b)?"text-white/30":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o.entry.isDirectory?(s(),n("path",Il)):(s(),n("path",Dl))],2)),e("span",Bl,u(o.entry.name),1),$.value?(s(),n("svg",Ll,[...d[2]||(d[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):v("",!0)],6),o.entry.isDirectory&&p.value&&o.entry.children?(s(),n("div",Pl,[(s(!0),n(D,null,N(o.entry.children,r=>(s(),q(a,{key:r.path,entry:r,"active-file":o.activeFile,depth:o.depth+1,onSelect:d[0]||(d[0]=h=>f.$emit("select",h))},null,8,["entry","active-file","depth"]))),128))])):v("",!0)])}}}),zl={class:"flex flex-col h-full"},El={class:"flex items-center gap-1 min-w-0 flex-1"},Al={class:"flex items-center gap-2 shrink-0"},Fl={key:0,class:"flex-1 overflow-y-auto custom-scrollbar p-3"},Rl={class:"mb-3 flex gap-2"},Vl={class:"flex justify-end gap-2"},Ul=["disabled"],ql={class:"grid grid-cols-2 gap-2"},Gl=["onClick"],Ol={key:1,class:"flex-1 overflow-y-auto custom-scrollbar p-2"},Hl={key:0,class:"flex items-center justify-center py-12"},Wl=G({__name:"ProjectGrid",props:{isWideDesktop:{type:Boolean},isMobile:{type:Boolean}},setup(o){const{isDark:c}=Z(),{projectList:l,activeProject:m,fileTree:g,activeFile:b,codeMode:p,selectedFiles:w,selectProject:$,openFile:_,createProject:f,clearActiveFile:d,toggleFileSelection:a,isFileSelected:r,loadProjects:h}=xe();ne(()=>{l.value.length===0&&h()});const M=S(""),j=S(!1),L=S(""),I=S(null),C=B(()=>m.value?"filetree":"projects"),k=B(()=>C.value==="projects"?"Projects":m.value?.name??"Projects"),x=B(()=>{const U=M.value.toLowerCase();return U?l.value.filter(R=>R.name.toLowerCase().includes(U)||(R.language??"").toLowerCase().includes(U)):l.value});function y(U){$(U)}function z(){const{activeProject:U,fileTree:R}=xe();U.value=null,R.value=[],d()}function V(U){a(U),_(U)}function A(){j.value=!0,L.value="",ye(()=>I.value?.focus())}function K(){j.value=!1,L.value=""}function O(){const U=L.value.trim();U&&(f(U),j.value=!1,L.value="")}return(U,R)=>(s(),n("div",zl,[e("div",{class:"shrink-0 px-4 py-3 flex items-center justify-between gap-2",style:W(t(c)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",El,[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:z}," Projects ",2)):v("",!0),C.value!=="projects"?(s(),n("span",{key:1,class:i(["text-xs shrink-0",t(c)?"text-white/20":"text-gray-300"])},"/",2)):v("",!0),e("span",{class:i(["text-sm font-semibold truncate",t(c)?"text-white/90":"text-gray-900"])},u(k.value),3)]),e("div",Al,[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(m)?.language),3)):v("",!0),re(U.$slots,"header-actions")])],4),C.value==="projects"?(s(),n("div",Fl,[e("div",Rl,[Q(e("input",{"onUpdate:modelValue":R[0]||(R[0]=H=>M.value=H),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:A},[...R[2]||(R[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),se(" 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),Q(e("input",{ref_key:"newProjectInputRef",ref:I,"onUpdate:modelValue":R[1]||(R[1]=H=>L.value=H),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(O,["enter"]),ae(K,["escape"])]},null,34),[[J,L.value]]),e("div",Vl,[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:K}," 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:O}," Create ",10,Ul)])],2)):v("",!0),e("div",ql,[(s(!0),n(D,null,N(x.value,H=>(s(),n("button",{key:H.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:le=>y(H)},[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",H.isGit?"text-accent":t(c)?"text-white/40":"text-gray-400"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...R[3]||(R[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(H.name),3),e("p",{class:i(["text-xs mt-0.5 truncate",t(c)?"text-white/25":"text-gray-400"])},u(H.language),3)],10,Gl))),128))])])):C.value==="filetree"?(s(),n("div",Ol,[(s(!0),n(D,null,N(t(g),H=>(s(),q(Nl,{key:H.path,entry:H,"active-file":t(b),depth:0,onSelect:V},null,8,["entry","active-file"]))),128)),t(g).length===0?(s(),n("div",Hl,[e("p",{class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])}," Loading file tree... ",2)])):v("",!0)])):v("",!0)]))}}),Kl={class:"flex flex-col h-full"},Yl={class:"shrink-0 px-4 py-2 flex gap-1.5 overflow-x-auto scrollbar-hide"},Ql=["onClick"],Jl={class:"flex-1 overflow-y-auto px-4 py-3"},Zl={class:"grid grid-cols-2 gap-2"},Xl=["onClick"],eo=["onClick"],to={key:0,class:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},so={key:2,class:"h-8 flex items-end gap-0.5 mb-2"},no={key:3,class:"h-8 flex items-center mb-2"},lo={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"},oo={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"},ao={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"},io={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"},ro=G({__name:"DesignSystemGrid",setup(o){const{isDark:c}=Z(),{openDesignSystemItem:l}=$e(),{codeMode:m,toggleDesignToken:g,isDesignTokenSelected:b}=xe(),p=S("all"),w=[{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(()=>p.value==="all"?$:$.filter(a=>a.category===p.value));function f(a){l(a)}function d(a){const r=/(?:background-color|color|background):\s*([^;]+)/i.exec(a);if(!r)return"#333";const h=r[1].trim();return h.startsWith("#")||h.startsWith("rgb")||h.startsWith("hsl")?h:"#333"}return(a,r)=>(s(),n("div",Kl,[e("div",{class:"shrink-0 px-4 py-3 flex items-center justify-between gap-2",style:W(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",Yl,[(s(),n(D,null,N(w,h=>e("button",{key:h.id,class:i(["text-xs px-2.5 py-1 rounded-md font-medium whitespace-nowrap transition-colors",p.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=>p.value=h.id},u(h.label),11,Ql)),64))]),e("div",Jl,[e("div",Zl,[(s(!0),n(D,null,N(_.value,h=>(s(),n("button",{key:h.id,class:i(["text-left p-3 rounded-xl transition-all duration-150 group relative",[t(m)&&t(b)(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=>f(h)},[t(m)?(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(b)(h.id)?"bg-accent":t(c)?"bg-white/10 hover:bg-white/20":"bg-black/10 hover:bg-black/20"]),onClick:we(M=>t(g)(h.id),["stop"])},[t(b)(h.id)?(s(),n("svg",to,[...r[0]||(r[0]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):v("",!0)],10,eo)):v("",!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:W({background:d(h.code)})},null,6)):h.category==="spacing"&&h.preview==="inline"?(s(),n("div",so,[...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",no,[(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",lo)):h.category==="molecules"?(s(),n("path",oo)):h.category==="organisms"?(s(),n("path",ao)):(s(),n("path",io))],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,Xl))),128))])])]))}}),me=S(null),lt=S(!1),Re=S(!1),he=S(null);function ve(){const o=B(()=>{if(!me.value)return null;try{return He(me.value)}catch{return null}}),c=B(()=>!!me.value),l=B(()=>o.value?o.value.slice(0,12)+"..."+o.value.slice(-8):null);function m(){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 w=await window.nostr.getPublicKey();me.value=w}catch(w){he.value=w instanceof Error?w.message:"Failed to get public key"}finally{Re.value=!1}}async function b(w){if(he.value=null,!window.nostr)return he.value="No Nostr extension detected",null;try{return await window.nostr.signEvent(w)}catch($){return he.value=$ instanceof Error?$.message:"Failed to sign event",null}}function p(){me.value=null,he.value=null}return ne(()=>{m(),setTimeout(m,500)}),{pubkey:me,npub:o,isAvailable:lt,isLoggedIn:c,isLoading:Re,error:he,truncatedNpub:l,login:g,logout:p,signEvent:b,checkAvailability:m}}const co="aiui-nostr-dms",uo=1,ke="messages",je=S([]),Se=S(null),Ve=S(!1);let Me=null;function vt(){return Me||(Me=new Promise((o,c)=>{const l=indexedDB.open(co,uo);l.onupgradeneeded=()=>{const m=l.result;if(!m.objectStoreNames.contains(ke)){const g=m.createObjectStore(ke,{keyPath:"id"});g.createIndex("contact","contactPubkey",{unique:!1}),g.createIndex("created_at","created_at",{unique:!1})}},l.onsuccess=()=>o(l.result),l.onerror=()=>{Me=null,c(l.error)}}),Me)}function ho(o){return o.length<=12?o:o.slice(0,8)+"..."+o.slice(-4)}async function ot(o,c){const l=await vt(),m=o.fromPubkey===c?o.toPubkey:o.fromPubkey,g={...o,contactPubkey:m};return new Promise((b,p)=>{const w=l.transaction(ke,"readwrite");w.objectStore(ke).put(g),w.oncomplete=()=>b(),w.onerror=()=>p(w.error)})}async function Ue(){const o=await vt();return new Promise((c,l)=>{const g=o.transaction(ke,"readonly").objectStore(ke).getAll();g.onsuccess=()=>c(g.result),g.onerror=()=>l(g.error)})}function qe(o){const c=new Map;for(const m of o){const g=c.get(m.contactPubkey)??[];g.push(m),c.set(m.contactPubkey,g)}const l=[];for(const[m,g]of c)g.sort((b,p)=>b.created_at-p.created_at),l.push({contactPubkey:m,contactName:ho(m),messages:g,lastMessage:g[g.length-1]??null,unread:0});return l.sort((m,g)=>(g.lastMessage?.created_at??0)-(m.lastMessage?.created_at??0)),l}function xo(){const{pubkey:o,isLoggedIn:c}=ve(),l=B(()=>Se.value?je.value.find($=>$.contactPubkey===Se.value)??null:null);async function m(){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||!o.value)return!1;try{const f=await window.nostr.nip04.encrypt($,_),d={kind:4,created_at:Math.floor(Date.now()/1e3),tags:[["p",$]],content:f},a=await window.nostr.signEvent(d);if(!a)return!1;const r={id:a.id,fromPubkey:o.value,toPubkey:$,content:_,created_at:a.created_at,decrypted:!0};await ot(r,o.value);const{publishEvent:h}=await pt(()=>import("./useNostr-CZatyrb1.js"),__vite__mapDeps([0,1,2])).then(j=>j.useNostr());await h(a);const M=await Ue();return je.value=qe(M),!0}catch{return!1}}async function b($,_,f,d){if(!(!window.nostr?.nip04||!o.value))try{const a=await window.nostr.nip04.decrypt(_,f),r={id:$,fromPubkey:_,toPubkey:o.value,content:a,created_at:d,decrypted:!0};await ot(r,o.value);const h=await Ue();je.value=qe(h)}catch{}}function p($){Se.value=$}function w(){Se.value=null}return{threads:je,activeThread:l,activeContact:Se,isLoading:Ve,loadDMs:m,sendDM:g,receiveDM:b,selectContact:p,clearActiveContact:w}}const po={class:"h-full flex flex-col"},go={class:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.08]"},bo={class:"flex-1 min-w-0"},vo={class:"text-xs font-semibold text-white/80 truncate"},fo={class:"text-xs text-white/30 font-mono truncate"},mo={class:"text-xs leading-relaxed break-words"},wo={class:"text-xs mt-1 text-white/25 tabular-nums"},yo={class:"px-4 py-3 border-t border-white/[0.08]"},ko={class:"flex gap-2"},$o=["disabled"],_o={class:"p-4 border-b border-white/[0.08]"},Co={class:"flex items-center justify-between gap-2 mb-3"},jo={key:0,class:"space-y-2 mb-3"},So=["disabled"],Mo={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-1"},To={key:0,class:"flex items-center justify-center py-12"},Io={key:1,class:"flex items-center justify-center py-12"},Do={key:2,class:"flex items-center justify-center py-12"},Bo=["onClick"],Lo={class:"flex items-start gap-2.5"},Po={class:"w-8 h-8 rounded-full shrink-0 flex items-center justify-center text-xs font-bold bg-accent/20 text-accent"},No={class:"flex-1 min-w-0"},zo={class:"flex items-center gap-1.5"},Eo={class:"text-xs font-semibold truncate text-white/80"},Ao={key:0,class:"text-xs ml-auto shrink-0 text-white/20"},Fo={key:0,class:"text-xs mt-1 text-white/40 truncate"},Ro=G({__name:"NostrDMs",setup(o){const{threads:c,activeThread:l,activeContact:m,isLoading:g,loadDMs:b,sendDM:p,selectContact:w,clearActiveContact:$}=xo(),{pubkey:_,isLoggedIn:f}=ve(),d=S(""),a=S(!1),r=S(null),h=S(!1),M=S("");function j(k){const x=new Date(k*1e3),z=Math.floor((new Date().getTime()-x.getTime())/864e5);return z===0?x.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit"}):z<7?x.toLocaleDateString("en",{weekday:"short"}):x.toLocaleDateString("en",{month:"short",day:"numeric"})}async function L(){if(!d.value.trim()||a.value||!m.value)return;a.value=!0,await p(m.value,d.value.trim())&&(d.value="",await ye(),I()),a.value=!1}function I(){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&&(w(k),h.value=!1,M.value="")}return ie(m,async()=>{await ye(),I()}),ne(()=>{b()}),(k,x)=>(s(),n("div",po,[t(l)?(s(),n(D,{key:0},[e("div",go,[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:x[0]||(x[0]=(...y)=>t($)&&t($)(...y))},[...x[4]||(x[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",bo,[e("p",vo,u(t(l).contactName),1),e("p",fo,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(D,null,N(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",mo,u(y.content),1),e("p",wo,u(j(y.created_at)),1)],2)],2))),128))],512),e("div",yo,[e("div",ko,[Q(e("input",{"onUpdate:modelValue":x[1]||(x[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()||a.value,onClick:L}," Send ",8,$o)])])],64)):(s(),n(D,{key:1},[e("div",_o,[e("div",Co,[x[5]||(x[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:x[2]||(x[2]=y=>h.value=!h.value)},u(h.value?"Cancel":"New"),1)]),h.value?(s(),n("div",jo,[Q(e("input",{"onUpdate:modelValue":x[3]||(x[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,So)])):v("",!0)]),e("div",Mo,[t(f)?t(g)?(s(),n("div",Io,[...x[7]||(x[7]=[e("p",{class:"text-xs text-white/30"},"Loading messages...",-1)])])):t(c).length===0?(s(),n("div",Do,[...x[8]||(x[8]=[e("p",{class:"text-xs text-white/30"},"No messages yet",-1)])])):v("",!0):(s(),n("div",To,[...x[6]||(x[6]=[e("p",{class:"text-xs text-white/30"},"Sign in with Nostr to use DMs",-1)])])),(s(!0),n(D,null,N(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:z=>t(w)(y.contactPubkey)},[e("div",Lo,[e("div",Po,u(y.contactName.charAt(0).toUpperCase()),1),e("div",No,[e("div",zo,[e("span",Eo,u(y.contactName),1),y.lastMessage?(s(),n("span",Ao,u(j(y.lastMessage.created_at)),1)):v("",!0)]),y.lastMessage?(s(),n("p",Fo,u(y.lastMessage.content),1)):v("",!0)])])],8,Bo))),128))])],64))]))}}),Vo={class:"h-full flex flex-col"},Uo={class:"p-4 border-b border-white/[0.08]"},qo={class:"flex gap-2"},Go=["disabled"],Oo={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},Ho={class:"flex items-center gap-2"},Wo={class:"text-xs font-mono text-white/70 truncate flex-1"},Ko={class:"flex items-center gap-2 flex-wrap"},Yo=["onClick"],Qo=["onClick"],Jo=["disabled","onClick"],Zo=["onClick"],Xo={key:0,class:"mt-4 pt-4 border-t border-white/5"},ea=["disabled"],ta={key:0,class:"text-xs mt-1 text-white/30"},sa=G({__name:"NostrRelayManager",setup(o){const{relayStates:c,addRelay:l,removeRelay:m,toggleRelayRead:g,toggleRelayWrite:b,testRelay:p,importNIP65Relays:w,fetchNote:$}=De(),{isLoggedIn:_,pubkey:f}=ve(),d=S(""),a=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){a.value=C;const k=await p(C);r[C]=k,a.value=null}async function I(){if(!f.value)return;h.value=!0,M.value="Fetching relay list...";const C=await $(f.value,5e3);C?(w({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",Vo,[e("div",Uo,[k[1]||(k[1]=e("h3",{class:"text-sm font-bold text-white/90 mb-3"},"Relay Management",-1)),e("div",qo,[Q(e("input",{"onUpdate:modelValue":k[0]||(k[0]=x=>d.value=x),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,Go)])]),e("div",Oo,[(s(!0),n(D,null,N(t(c),x=>(s(),n("div",{key:x.url,class:"rounded-xl bg-white/[0.03] border border-white/5 p-3 space-y-2"},[e("div",Ho,[e("span",{class:i(["w-2 h-2 rounded-full shrink-0",x.connected?"bg-emerald-500":"bg-red-400/60"])},null,2),e("span",Wo,u(x.url),1),x.latencyMs!==null?(s(),n("span",{key:0,class:i(["text-xs tabular-nums shrink-0",x.latencyMs<200?"text-emerald-400/60":x.latencyMs<500?"text-yellow-400/60":"text-red-400/60"])},u(x.latencyMs)+"ms ",3)):v("",!0),e("span",{class:i(["text-xs shrink-0",x.connected?"text-emerald-400/60":"text-red-400/60"])},u(x.connected?"Connected":"Disconnected"),3)]),e("div",Ko,[e("button",{class:i(["text-sm px-3 min-h-[44px] rounded-lg transition-colors",x.read?"bg-accent/15 text-accent/80":"bg-white/5 text-white/30 hover:text-white/50"]),onClick:y=>t(g)(x.url)}," Read ",10,Yo),e("button",{class:i(["text-sm px-3 min-h-[44px] rounded-lg transition-colors",x.write?"bg-accent/15 text-accent/80":"bg-white/5 text-white/30 hover:text-white/50"]),onClick:y=>t(b)(x.url)}," Write ",10,Qo),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:a.value===x.url,onClick:y=>L(x.url)},u(a.value===x.url?"Testing...":"Test"),9,Jo),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(m)(x.url)}," Remove ",8,Zo)]),r[x.url]!==void 0?(s(),n("p",{key:0,class:i(["text-xs",r[x.url]!==null?"text-emerald-400/60":"text-red-400/60"])},u(r[x.url]!==null?`Reachable (${r[x.url]}ms)`:"Unreachable"),3)):v("",!0)]))),128)),t(_)?(s(),n("div",Xo,[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:I},u(h.value?"Importing...":"Import relays from NIP-65 (kind:10002)"),9,ea),M.value?(s(),n("p",ta,u(M.value),1)):v("",!0)])):v("",!0)])]))}}),na={class:"h-full flex flex-col"},la={key:0,class:"flex-1 flex items-center justify-center"},oa={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"},ia={class:"px-4 pb-4 -mt-8"},ra={key:0,class:"text-lg font-bold text-accent"},ca={class:"text-sm font-bold text-white/90 mt-2"},da={key:0,class:"text-xs text-purple-400/60"},ua={key:1,class:"text-xs text-white/50 mt-1 line-clamp-2"},ha={class:"space-y-3"},xa=["disabled"],pa=G({__name:"NostrProfileEditor",setup(o){const{isLoggedIn:c,signEvent:l,pubkey:m}=ve(),{publishEvent:g,fetchNote:b}=De(),p=Pe({name:"",display_name:"",about:"",picture:"",banner:"",website:"",nip05:"",lud16:""}),w=S(!1),$=S(""),_=S(!1);async function f(){if(!m.value)return;const a=await b(m.value,5e3);if(a&&a.kind===0)try{const r=JSON.parse(a.content);Object.assign(p,r)}catch{}}async function d(){if(!c.value)return;w.value=!0,$.value="";const a={};for(const[L,I]of Object.entries(p))I&&(a[L]=I);const r={kind:0,created_at:Math.floor(Date.now()/1e3),tags:[],content:JSON.stringify(a)},h=await l(r);if(!h){w.value=!1,$.value="Signing failed",_.value=!1;return}const M=await g(h),j=M.filter(L=>L.success).length;w.value=!1,j>0?($.value=`Published to ${j}/${M.length} relays`,_.value=!0):($.value="Failed to publish to any relay",_.value=!1)}return ne(()=>{f()}),(a,r)=>(s(),n("div",na,[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",oa,[e("div",aa,[e("div",{class:i(["h-24 bg-cover bg-center",p.banner?"":"bg-gradient-to-r from-accent/20 to-purple-500/20"]),style:W(p.banner?{backgroundImage:`url(${p.banner})`}:{})},null,6),e("div",ia,[e("div",{class:i(["w-16 h-16 rounded-full border-2 border-black bg-cover bg-center flex items-center justify-center",p.picture?"":"bg-accent/20"]),style:W(p.picture?{backgroundImage:`url(${p.picture})`}:{})},[p.picture?v("",!0):(s(),n("span",ra,u((p.display_name||p.name||"?").charAt(0).toUpperCase()),1))],6),e("p",ca,u(p.display_name||p.name||"Anonymous"),1),p.nip05?(s(),n("p",da,u(p.nip05),1)):v("",!0),p.about?(s(),n("p",ua,u(p.about),1)):v("",!0)])]),e("div",ha,[e("div",null,[r[9]||(r[9]=e("label",{class:"text-xs text-white/30 block mb-1"},"Display Name",-1)),Q(e("input",{"onUpdate:modelValue":r[0]||(r[0]=h=>p.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,p.display_name]])]),e("div",null,[r[10]||(r[10]=e("label",{class:"text-xs text-white/30 block mb-1"},"Username",-1)),Q(e("input",{"onUpdate:modelValue":r[1]||(r[1]=h=>p.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,p.name]])]),e("div",null,[r[11]||(r[11]=e("label",{class:"text-xs text-white/30 block mb-1"},"Bio",-1)),Q(e("textarea",{"onUpdate:modelValue":r[2]||(r[2]=h=>p.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,p.about]])]),e("div",null,[r[12]||(r[12]=e("label",{class:"text-xs text-white/30 block mb-1"},"Avatar URL",-1)),Q(e("input",{"onUpdate:modelValue":r[3]||(r[3]=h=>p.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,p.picture]])]),e("div",null,[r[13]||(r[13]=e("label",{class:"text-xs text-white/30 block mb-1"},"Banner URL",-1)),Q(e("input",{"onUpdate:modelValue":r[4]||(r[4]=h=>p.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,p.banner]])]),e("div",null,[r[14]||(r[14]=e("label",{class:"text-xs text-white/30 block mb-1"},"Website",-1)),Q(e("input",{"onUpdate:modelValue":r[5]||(r[5]=h=>p.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,p.website]])]),e("div",null,[r[15]||(r[15]=e("label",{class:"text-xs text-white/30 block mb-1"},"NIP-05 Address",-1)),Q(e("input",{"onUpdate:modelValue":r[6]||(r[6]=h=>p.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,p.nip05]])]),e("div",null,[r[16]||(r[16]=e("label",{class:"text-xs text-white/30 block mb-1"},"Lightning Address",-1)),Q(e("input",{"onUpdate:modelValue":r[7]||(r[7]=h=>p.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,p.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:w.value,onClick:d},u(w.value?"Publishing...":"Publish Profile (kind:0)"),9,xa),$.value?(s(),n("div",{key:0,class:i(["text-xs text-center",_.value?"text-emerald-400/60":"text-red-400/60"])},u($.value),3)):v("",!0)])])):(s(),n("div",la,[...r[8]||(r[8]=[e("p",{class:"text-xs text-white/30"},"Sign in with Nostr to edit your profile",-1)])]))]))}}),ga={class:"relative glass-card w-[320px] max-w-[90vw] p-5 space-y-4 animate-scale-in"},ba={class:"flex items-center justify-between"},va={class:"text-xs text-white/40 truncate font-mono"},fa={class:"flex gap-1.5 flex-wrap"},ma=["onClick"],wa=["disabled"],ya={key:0,class:"space-y-2"},ka={class:"flex justify-center"},$a={class:"flex gap-1"},_a=["value"],Ca=["href"],ja={key:1,class:"text-xs text-red-400/60 text-center"},Sa=G({__name:"ZapDialog",props:{isOpen:{type:Boolean},targetName:{},lightningAddress:{}},emits:["close"],setup(o,{emit:c}){const l=o,m=c,g=S(null),b=S(null),p=[21,100,500,1e3,5e3,1e4],w=S(21),$=S(""),_=S(""),f=S(!1),d=S(""),a=S(!1),r=S(null);function h(k){return k>=1e3?`${(k/1e3).toFixed(k%1e3===0?0:1)}k`:String(k)}function M(){m("close"),_.value="",d.value="",$.value=""}async function j(){if(!(!l.lightningAddress||!w.value)){f.value=!0,d.value="",_.value="";try{const[k,x]=l.lightningAddress.split("@");if(!k||!x)throw new Error("Invalid Lightning address");const y=await fetch(`https://${x}/.well-known/lnurlp/${k}`);if(!y.ok)throw new Error("Failed to fetch LNURL");const z=await y.json();if(z.status==="ERROR")throw new Error(z.reason||"LNURL error");const V=w.value*1e3;if(V<(z.minSendable??0))throw new Error(`Minimum: ${Math.ceil((z.minSendable??0)/1e3)} sats`);if(V>(z.maxSendable??1/0))throw new Error(`Maximum: ${Math.floor((z.maxSendable??0)/1e3)} sats`);let A=z.callback;const K=A.includes("?")?"&":"?";A+=`${K}amount=${V}`,$.value&&(A+=`&comment=${encodeURIComponent($.value)}`);const O=await fetch(A);if(!O.ok)throw new Error("Failed to get invoice");const U=await O.json();if(U.status==="ERROR")throw new Error(U.reason||"Invoice error");_.value=U.pr,await ye(),L(U.pr)}catch(k){d.value=k instanceof Error?k.message:"Zap failed"}finally{f.value=!1}}}function L(k){const x=r.value;if(!x)return;const y=x.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 z=[];for(let A=0;A<k.length;A+=30)z.push(k.slice(A,A+30));const V=Math.max(10,100-z.length*6);z.forEach((A,K)=>{y.fillText(A,100,V+K*12)})}function I(){navigator.clipboard.writeText(_.value),a.value=!0,setTimeout(()=>{a.value=!1},2e3)}function C(k){const x=g.value;if(!x)return;const y=x.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(y.length===0)return;const z=y[0],V=y[y.length-1];k.shiftKey&&document.activeElement===z?(k.preventDefault(),V.focus()):!k.shiftKey&&document.activeElement===V&&(k.preventDefault(),z.focus())}return ie(()=>l.isOpen,async k=>{k?(await ye(),b.value?.focus()):(_.value="",d.value="")}),(k,x)=>o.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:we(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",ga,[e("div",ba,[x[3]||(x[3]=e("h3",{class:"text-sm font-bold text-white/90"},"Zap",-1)),e("button",{ref_key:"closeButtonRef",ref:b,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},[...x[2]||(x[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",va,u(o.targetName),1),e("div",fa,[(s(),n(D,null,N(p,y=>e("button",{key:y,class:i(["text-xs px-2.5 py-1.5 rounded-lg transition-colors",w.value===y?"bg-accent/20 text-accent border border-accent/30":"bg-white/5 text-white/50 hover:bg-white/10"]),onClick:z=>w.value=y},u(h(y)),11,ma)),64))]),e("div",null,[x[4]||(x[4]=e("label",{class:"text-xs text-white/30 block mb-1"},"Amount (sats)",-1)),Q(e("input",{"onUpdate:modelValue":x[0]||(x[0]=y=>w.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,w.value,void 0,{number:!0}]])]),e("div",null,[x[5]||(x[5]=e("label",{class:"text-xs text-white/30 block mb-1"},"Message (optional)",-1)),Q(e("input",{"onUpdate:modelValue":x[1]||(x[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:!w.value||w.value<1||f.value,onClick:j},u(f.value?"Generating invoice...":`Zap ${h(w.value)} sats`),9,wa),_.value?(s(),n("div",ya,[x[6]||(x[6]=e("p",{class:"text-xs text-white/30 text-center"},"Scan or tap to pay",-1)),e("div",ka,[e("canvas",{ref_key:"qrCanvas",ref:r,class:"rounded-lg",width:"200",height:"200"},null,512)]),e("div",$a,[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,_a),e("button",{class:"px-2 py-1.5 rounded text-xs bg-white/5 text-white/40 hover:text-white/60 transition-colors",onClick:I},u(a.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,Ca)])):v("",!0),d.value?(s(),n("p",ja,u(d.value),1)):v("",!0)])],544)):v("",!0)}}),Ma={class:"h-full flex flex-col"},Ta={class:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.08]"},Ia={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},Da={key:0,class:"flex items-center justify-center py-12"},Ba={key:1,class:"rounded-xl bg-white/[0.05] border border-white/10 p-3"},La={class:"flex items-center gap-1.5 mb-1"},Pa={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"},Na={class:"text-xs font-semibold text-white/80"},za={class:"text-xs ml-auto text-white/20"},Ea={class:"text-xs text-white/70 leading-relaxed whitespace-pre-wrap"},Aa={key:2,class:"space-y-1"},Fa={class:"text-xs text-white/30 font-medium mt-3 mb-1"},Ra={key:3,class:"flex items-center justify-center py-12"},Va={key:0,class:"px-4 py-3 border-t border-white/[0.08]"},Ua={key:0,class:"text-xs text-white/30 mb-1"},qa={class:"flex gap-2"},Ga=["disabled"],Oa=G({__name:"NostrThread",props:{noteId:{}},emits:["back"],setup(o){const c=Ht(()=>pt(()=>import("./ThreadNode-B0koBP1i.js"),__vite__mapDeps([3,1,2]))),l=o,{fetchNote:m,publishEvent:g}=De(),{isLoggedIn:b,signEvent:p,pubkey:w}=ve(),$=S(null),_=S([]),f=S(!0),d=S(null),a=S("");function r(k){const x=new Date(k*1e3);return x.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit"})+" "+x.toLocaleDateString("en",{month:"short",day:"numeric"})}function h(k){return k.length<=12?k:k.slice(0,8)+"..."+k.slice(-4)}async function M(){f.value=!0;const k=await m(l.noteId);if(!k){f.value=!1;return}$.value=k;const x=await j(l.noteId);_.value=L(x,l.noteId),f.value=!1}async function j(k){return new Promise(x=>{const y=[],z="thread-"+Math.random().toString(36).slice(2,8);let V=!1;const A=setTimeout(()=>{V||(V=!0,x(y))},8e3),K="wss://relay.nostr.band";try{const O=new WebSocket(K);O.onopen=()=>{O.send(JSON.stringify(["REQ",z,{kinds:[1],"#e":[k],limit:100}]))},O.onmessage=U=>{try{const R=JSON.parse(U.data);if(Array.isArray(R)&&R[0]==="EVENT"&&R[1]===z&&R[2]){const H=R[2];y.find(le=>le.id===H.id)||y.push({id:H.id,pubkey:H.pubkey,authorName:h(H.pubkey),kind:H.kind,content:H.content,created_at:H.created_at,tags:H.tags??[]})}Array.isArray(R)&&R[0]==="EOSE"&&R[1]===z&&(clearTimeout(A),O.close(),V||(V=!0,x(y)))}catch{}},O.onerror=()=>{clearTimeout(A),V||(V=!0,x(y))},O.onclose=()=>{V||(V=!0,x(y))}}catch{clearTimeout(A),x(y)}})}function L(k,x,y=5){const z=new Map;for(const A of k){let K=x;const O=A.tags.filter(R=>R[0]==="e");if(O.length>0){const R=O.find(H=>H[3]==="reply");K=R?R[1]:O[O.length-1][1]}const U=z.get(K)??[];U.push(A),z.set(K,U)}function V(A,K){const O=z.get(A)??[];return O.sort((U,R)=>U.created_at-R.created_at),O.map(U=>({note:U,children:K<y?V(U.id,K+1):[]}))}return V(x,0)}function I(k){d.value=k}async function C(){if(!a.value.trim()||!w.value)return;const k=d.value??$.value;if(!k)return;const x=[["e",l.noteId,"","root"]];k.id!==l.noteId&&x.push(["e",k.id,"","reply"]),x.push(["p",k.pubkey]);const y={kind:1,created_at:Math.floor(Date.now()/1e3),tags:x,content:a.value.trim()},z=await p(y);z&&(await g(z),a.value="",d.value=null,await M())}return ne(()=>{M()}),(k,x)=>(s(),n("div",Ma,[e("div",Ta,[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:x[0]||(x[0]=y=>k.$emit("back"))},[...x[3]||(x[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)])]),x[4]||(x[4]=e("h3",{class:"text-sm font-bold text-white/90"},"Thread",-1))]),e("div",Ia,[f.value?(s(),n("div",Da,[...x[5]||(x[5]=[e("p",{class:"text-xs text-white/30"},"Loading thread...",-1)])])):v("",!0),$.value?(s(),n("div",Ba,[e("div",La,[e("div",Pa,u($.value.authorName?.charAt(0)?.toUpperCase()??"?"),1),e("span",Na,u($.value.authorName??"anon"),1),e("span",za,u(r($.value.created_at)),1)]),e("p",Ea,u($.value.content),1)])):v("",!0),_.value.length>0?(s(),n("div",Aa,[e("p",Fa,u(_.value.length)+" replies",1),(s(!0),n(D,null,N(_.value,y=>(s(),q(t(c),{key:y.note.id,node:y,depth:0,onReply:I},null,8,["node"]))),128))])):v("",!0),!f.value&&!$.value?(s(),n("div",Ra,[...x[6]||(x[6]=[e("p",{class:"text-xs text-white/30"},"Thread not found",-1)])])):v("",!0)]),$.value&&t(b)?(s(),n("div",Va,[d.value?(s(),n("p",Ua,[se(" Replying to "+u(d.value.authorName??"anon")+" ",1),e("button",{class:"text-accent/60 ml-1",onClick:x[1]||(x[1]=y=>d.value=null)},"cancel")])):v("",!0),e("div",qa,[Q(e("input",{"onUpdate:modelValue":x[2]||(x[2]=y=>a.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,a.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:!a.value.trim(),onClick:C}," Reply ",8,Ga)])])):v("",!0)]))}}),Ha={class:"h-full flex flex-col"},Wa={class:"p-4 border-b border-white/[0.08]"},Ka={class:"flex gap-1.5 flex-wrap"},Ya=["onClick"],Qa={key:0,class:"flex-1 flex items-center justify-center"},Ja={key:1,class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},Za={key:0,class:"flex items-center justify-center py-12"},Xa={class:"flex gap-2 mb-3"},ei=["placeholder"],ti=["disabled"],si={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"},ni={class:"flex-1 min-w-0"},li={class:"text-xs text-white/60 font-mono truncate"},oi={key:0,class:"text-xs text-white/30"},ai=["onClick"],ii={key:1,class:"flex items-center justify-center py-12"},ri=["disabled"],ci=G({__name:"NostrLists",setup(o){const{isLoggedIn:c,signEvent:l,pubkey:m}=ve(),{publishEvent:g}=De(),b=[{kind:3,label:"Follows"},{kind:1e4,label:"Mute"},{kind:10001,label:"Pin"},{kind:10003,label:"Bookmarks"}],p=S(3),w=S([]),$=S(!1),_=S(!1),f=S(""),d=S(!1),a=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(x=>x[0]==="p"||x[0]==="e"||x[0]==="t").map(x=>{let y=h(x[1]);if(x[0]==="p")try{y=He(x[1])}catch{}return{tag:x[0],value:x[1],displayValue:y,relay:x[2]||void 0,petname:x[3]||void 0}})}async function j(k){if(m.value){$.value=!0,_.value=!1,w.value=[];try{const x=new WebSocket("wss://relay.nostr.band"),y="list-"+Math.random().toString(36).slice(2,8),z=setTimeout(()=>{x.close(),$.value=!1},8e3);x.onopen=()=>{x.send(JSON.stringify(["REQ",y,{kinds:[k],authors:[m.value],limit:1}]))},x.onmessage=V=>{try{const A=JSON.parse(V.data);if(Array.isArray(A)&&A[0]==="EVENT"&&A[1]===y&&A[2]){const K=A[2];w.value=M(K.tags)}Array.isArray(A)&&A[0]==="EOSE"&&(clearTimeout(z),x.close(),$.value=!1)}catch{}},x.onerror=()=>{clearTimeout(z),$.value=!1}}catch{$.value=!1}}}function L(){let k=f.value.trim();if(!k)return;let x=k;const y=p.value===3||p.value===1e4?"p":"e";if(k.startsWith("npub"))try{x=gt(k)}catch{return}if(w.value.find(V=>V.value===x))return;let z=h(x);if(y==="p")try{z=He(x)}catch{}w.value.push({tag:y,value:x,displayValue:z}),_.value=!0,f.value=""}function I(k){w.value=w.value.filter(x=>x.value!==k.value),_.value=!0}async function C(){if(!m.value)return;d.value=!0,a.value="";const k=w.value.map(A=>{const K=[A.tag,A.value];return A.relay&&K.push(A.relay),A.petname&&K.push(A.petname),K}),x={kind:p.value,created_at:Math.floor(Date.now()/1e3),tags:k,content:""},y=await l(x);if(!y){d.value=!1,a.value="Signing failed",r.value=!1;return}const z=await g(y),V=z.filter(A=>A.success).length;d.value=!1,_.value=!1,V>0?(a.value=`Published to ${V}/${z.length} relays`,r.value=!0):(a.value="Failed to publish",r.value=!1)}return ne(()=>{j(p.value)}),(k,x)=>(s(),n("div",Ha,[e("div",Wa,[x[1]||(x[1]=e("h3",{class:"text-sm font-bold text-white/90 mb-3"},"Nostr Lists",-1)),e("div",Ka,[(s(),n(D,null,N(b,y=>e("button",{key:y.kind,class:i(["text-xs px-2 py-1 rounded-md transition-all duration-150",p.value===y.kind?"nav-tab-active":"text-white/40 hover:text-white/70 hover:bg-white/5"]),onClick:z=>{p.value=y.kind,j(y.kind)}},u(y.label),11,Ya)),64))])]),t(c)?(s(),n("div",Ja,[$.value?(s(),n("div",Za,[...x[3]||(x[3]=[e("p",{class:"text-xs text-white/30"},"Loading list...",-1)])])):v("",!0),e("div",Xa,[Q(e("input",{"onUpdate:modelValue":x[0]||(x[0]=y=>f.value=y),type:"text",placeholder:p.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,ei),[[J,f.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:!f.value.trim(),onClick:L}," Add ",8,ti)]),(s(!0),n(D,null,N(w.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",si,u(y.tag==="p"?"P":y.tag==="e"?"E":y.tag==="t"?"#":"?"),1),e("div",ni,[e("p",li,u(y.displayValue),1),y.petname?(s(),n("p",oi,u(y.petname),1)):v("",!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:z=>I(y)}," Remove ",8,ai)]))),128)),!$.value&&w.value.length===0?(s(),n("div",ii,[...x[4]||(x[4]=[e("p",{class:"text-xs text-white/30"},"List is empty",-1)])])):v("",!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,ri)):v("",!0),a.value?(s(),n("p",{key:3,class:i(["text-xs text-center",r.value?"text-emerald-400/60":"text-red-400/60"])},u(a.value),3)):v("",!0)])):(s(),n("div",Qa,[...x[2]||(x[2]=[e("p",{class:"text-xs text-white/30"},"Sign in with Nostr to manage lists",-1)])]))]))}}),di={class:"article-reader h-full flex"},ui={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"},hi=["onClick"],xi={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"},pi={class:"flex-1 text-xs text-white/40 truncate"},gi=["disabled"],bi=["disabled"],vi={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"},fi=["onClick"],mi={key:0,class:"text-xl font-bold text-white/96 mb-4"},wi=["innerHTML"],yi=G({__name:"ArticleReader",props:{content:{},title:{}},emits:["back"],setup(o){const c=o,l=[13,15,17,19,21],m=localStorage.getItem("aiui-article-font-size"),g=S(m?parseInt(m,10):1);ie(g,I=>{localStorage.setItem("aiui-article-font-size",String(I))});const b=S(!1),p=new ns({html:!1,linkify:!0,breaks:!0});p.renderer.rules.heading_open=(I,C,k,x,y)=>{const z=I[C],V=parseInt(z.tag.slice(1),10);if(V===2||V===3){const O=(I[C+1]?.children?.reduce((U,R)=>U+(R.content||""),"")||"").toLowerCase().replace(/[^\w]+/g,"-").replace(/(^-|-$)/g,"");z.attrSet("id",O)}return y.renderToken(I,C,k)};const w=p.renderer.rules.link_open||function(I,C,k,x,y){return y.renderToken(I,C,k)};p.renderer.rules.link_open=function(I,C,k,x,y){return I[C].attrSet("target","_blank"),I[C].attrSet("rel","noopener noreferrer"),w(I,C,k,x,y)};const $=B(()=>p.render(c.content)),_=B(()=>{const I=[],C=/^(#{2,3})\s+(.+)$/gm;let k;for(;(k=C.exec(c.content))!==null;){const x=k[2].trim(),y=x.toLowerCase().replace(/[^\w]+/g,"-").replace(/(^-|-$)/g,"");I.push({text:x,id:y,level:k[1].length})}return I}),f=B(()=>{const I=c.content.split(/\s+/).length;return Math.max(1,Math.ceil(I/200))}),d=S(null),a=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 x=k.target.id,y=_.value.findIndex(z=>z.id===x);y>=0&&(r.value=y)}},{root:d.value,rootMargin:"-20% 0px -60% 0px",threshold:0}),a.value?.querySelectorAll("h2[id], h3[id]")?.forEach(C=>h.observe(C))}ne(()=>{setTimeout(M,100)}),ie(()=>c.content,()=>{setTimeout(M,100)}),Wt(()=>{h?.disconnect()});function j(I){a.value?.querySelector(`#${CSS.escape(I)}`)?.scrollIntoView({behavior:"smooth",block:"start"})}function L(){const I=window.open("","_blank");I&&(I.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>`),I.document.close(),I.print())}return(I,C)=>(s(),n("div",di,[_.value.length>1?(s(),n("aside",ui,[C[4]||(C[4]=e("p",{class:"text-xs uppercase tracking-wider text-white/30 mb-2 px-2"},"Contents",-1)),(s(!0),n(D,null,N(_.value,(k,x)=>(s(),n("button",{key:x,class:i(["text-left text-xs leading-relaxed py-1 px-2 rounded transition-colors truncate",[r.value===x?"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,hi))),128))])):v("",!0),e("div",{ref_key:"contentRef",ref:d,class:"flex-1 overflow-y-auto scrollbar-hide"},[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",title:"Back",onClick:C[0]||(C[0]=k=>I.$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",pi,u(f.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=>b.value=!b.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)])])):v("",!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,gi),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,bi),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)])])]),b.value&&_.value.length>1?(s(),n("div",vi,[(s(!0),n(D,null,N(_.value,(k,x)=>(s(),n("button",{key:x,class:i(["block w-full text-left text-xs py-1 px-2 rounded transition-colors truncate",[r.value===x?"text-accent bg-accent/10":"text-white/50 hover:text-white/70",k.level===3?"pl-5":""]]),onClick:y=>{j(k.id),b.value=!1}},u(k.text),11,fi))),128))])):v("",!0),e("article",{ref_key:"articleRef",ref:a,class:"article-body px-4 md:px-8 py-6 max-w-prose mx-auto leading-relaxed text-white/90",style:W({fontSize:l[g.value]+"px"})},[o.title?(s(),n("h1",mi,u(o.title),1)):v("",!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,wi)],4)],512)]))}}),ki={class:"h-full flex flex-col"},$i={class:"flex items-center gap-2 px-4 py-3 border-b border-white/[0.08]"},_i={class:"text-xs text-white/40 truncate"},Ci={class:"flex-1 overflow-y-auto custom-scrollbar"},ji={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},Si={key:0,class:"flex items-center justify-center py-12"},Mi=["onClick"],Ti={class:"space-y-1"},Ii={class:"text-xs font-semibold text-white/80 line-clamp-2"},Di={class:"text-xs text-white/40 line-clamp-2"},Bi={class:"flex items-center gap-2"},Li={class:"text-xs text-white/25 font-mono"},Pi={class:"text-xs text-white/20"},Ni={key:0,class:"text-xs text-accent/40 ml-auto"},zi={key:1,class:"flex items-center justify-center py-12"},Ei=G({__name:"NostrArticles",setup(o){const c=S([]),l=S(!0),m=S(null),g=B(()=>m.value?w(m.value):"");function b(d){return d.length<=16?d:d.slice(0,8)+"..."+d.slice(-4)}function p(d){return new Date(d*1e3).toLocaleDateString("en",{month:"short",day:"numeric",year:"numeric"})}function w(d){const a=d.tags.find(h=>h[0]==="title");return a?.[1]?a[1]:d.content.split(`
|
||
`)[0].replace(/^#+ /,"").slice(0,60)||"Untitled"}function $(d){const a=d.tags.find(r=>r[0]==="summary");return a?.[1]?a[1]:d.content.slice(0,120).replace(/[#*_]/g,"")}function _(d){return d.tags.find(r=>r[0]==="image")?.[1]??null}async function f(){l.value=!0,c.value=[];const d="wss://relay.nostr.band",a="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",a,{kinds:[30023],limit:30}]))},r.onmessage=j=>{try{const L=JSON.parse(j.data);if(Array.isArray(L)&&L[0]==="EVENT"&&L[1]===a&&L[2]){const I=L[2];h.find(C=>C.id===I.id)||h.push({id:I.id,pubkey:I.pubkey,authorName:b(I.pubkey),kind:I.kind,content:I.content,created_at:I.created_at,tags:I.tags??[]})}Array.isArray(L)&&L[0]==="EOSE"&&(clearTimeout(M),r.close(),h.sort((I,C)=>C.created_at-I.created_at),c.value=h,l.value=!1)}catch{}},r.onerror=()=>{clearTimeout(M),l.value=!1}}catch{l.value=!1}}return ne(()=>{f()}),(d,a)=>(s(),n("div",ki,[m.value?(s(),n(D,{key:0},[e("div",$i,[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:a[0]||(a[0]=r=>m.value=null)},[...a[1]||(a[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",_i,u(g.value),1)]),e("div",Ci,[te(yi,{content:m.value.content,title:g.value},null,8,["content","title"])])],64)):(s(),n(D,{key:1},[a[4]||(a[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",ji,[l.value?(s(),n("div",Si,[...a[2]||(a[2]=[e("p",{class:"text-xs text-white/30"},"Loading articles...",-1)])])):v("",!0),(s(!0),n(D,null,N(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=>m.value=r},[e("div",Ti,[e("h4",Ii,u(w(r)),1),e("p",Di,u($(r)),1),e("div",Bi,[e("span",Li,u(b(r.pubkey)),1),e("span",Pi,u(p(r.created_at)),1),_(r)?(s(),n("span",Ni,"has image")):v("",!0)])])],8,Mi))),128)),!l.value&&c.value.length===0?(s(),n("div",zi,[...a[3]||(a[3]=[e("p",{class:"text-xs text-white/30"},"No articles found",-1)])])):v("",!0)])],64))]))}}),We=1440*60*1e3,ft="aiui-nip05-cache",Te=S(new Map);function Ai(){try{const o=localStorage.getItem(ft);if(o){const c=JSON.parse(o),l=Date.now(),m=c.filter(([,g])=>l-g.timestamp<We);Te.value=new Map(m)}}catch{}}function Fi(){try{const o=Array.from(Te.value.entries());localStorage.setItem(ft,JSON.stringify(o))}catch{}}Ai();function Ri(){async function o(m,g){const b=`${m}:${g}`,p=Te.value.get(b);if(p&&Date.now()-p.timestamp<We)return p.verified;try{const[w,$]=m.split("@");if(!w||!$)return!1;const _=await fetch(`https://${$}/.well-known/nostr.json?name=${encodeURIComponent(w)}`);if(!_.ok)return c(b,!1,g);const a=(await _.json())?.names?.[w]===g;return c(b,a,g)}catch{return c(b,!1,g)}}function c(m,g,b){return Te.value.set(m,{verified:g,pubkey:b,timestamp:Date.now()}),Fi(),g}function l(m,g){const b=Te.value.get(`${m}:${g}`);return!b||Date.now()-b.timestamp>=We?null:b.verified}return{verifyNip05:o,isVerified:l}}const Vi={class:"h-full flex flex-col"},Ui={class:"flex gap-2 px-4 pt-3 pb-1"},qi=["onClick"],Gi={class:"p-4 space-y-3 border-b border-white/[0.08]"},Oi={class:"flex items-center justify-between gap-2"},Hi={class:"flex items-center gap-2 shrink-0"},Wi={class:"text-xs font-mono text-white/30"},Ki={key:1,class:"rounded-lg bg-white/5 border border-white/10 p-3 space-y-2"},Yi=["onKeydown"],Qi={class:"flex items-center justify-between gap-2"},Ji=["disabled"],Zi={key:0,class:"space-y-1"},Xi={class:"truncate font-mono text-white/40"},er={class:"flex gap-2"},tr=["disabled"],sr={class:"flex gap-2"},nr=["onClick"],lr={class:"flex-1 overflow-y-auto custom-scrollbar px-4 pt-3 pb-16 space-y-2"},or={key:0,class:"flex flex-col items-center justify-center py-12 gap-3"},ar=["onClick"],ir={class:"flex items-start gap-2.5"},rr={class:"w-8 h-8 rounded-full shrink-0 overflow-hidden"},cr=["src","alt","onError"],dr={key:1,class:"w-full h-full flex items-center justify-center text-xs font-bold bg-purple-500/20 text-purple-400"},ur={class:"flex-1 min-w-0"},hr={class:"flex items-center gap-1.5"},xr={class:"text-xs font-semibold truncate text-white/80"},pr={key:0,class:"text-xs truncate text-purple-400/60 flex items-center gap-0.5"},gr=["title"],br={class:"text-xs ml-auto shrink-0 text-white/20"},vr={class:"text-xs mt-1 leading-relaxed line-clamp-3 text-white/60"},fr={class:"flex items-center gap-3 mt-2"},mr=["onClick"],wr={key:0,class:"text-xs px-1.5 py-0.5 rounded bg-white/5 text-white/30"},yr={class:"mt-4 pt-4 border-t border-white/5"},kr={class:"space-y-1"},$r={class:"truncate font-mono text-white/40"},_r={key:1,class:"flex items-center justify-center py-12"},Cr=G({__name:"NostrGrid",setup(o){const{events:c,isConnected:l,relayStates:m,connect:g,publishEvent:b,searchResults:p,isSearching:w,searchNostr:$}=De(),{isLoggedIn:_,signEvent:f}=ve(),{verifyNip05:d}=Ri(),a=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),I=S(!1),C=S(""),k=S(null),x=S(!1),y=S([]),z=S(!1),V=S(""),A=S(void 0);function K(X){V.value=X.authorName??X.pubkey.slice(0,12),A.value=void 0,z.value=!0}const O=Pe({}),U=[{id:1,label:"Notes"},{id:30023,label:"Articles"},{id:9735,label:"Zaps"},{id:6,label:"Reposts"}];function R(X){const E=Math.floor(Date.now()/1e3-X);return E<60?"now":E<3600?`${Math.floor(E/60)}m`:E<86400?`${Math.floor(E/3600)}h`:`${Math.floor(E/86400)}d`}const H=S(!1),le=B(()=>{if(H.value&&p.value.length>0){let E=p.value;return L.value!==null&&(E=E.filter(P=>P.kind===L.value)),E}let X=c.value;if(L.value!==null&&(X=X.filter(E=>E.kind===L.value)),j.value){const E=j.value.toLowerCase();X=X.filter(P=>P.content.toLowerCase().includes(E)||(P.authorName??"").toLowerCase().includes(E)||(P.nip05??"").toLowerCase().includes(E))}return X});function fe(){j.value.trim()&&(H.value=!0,$(j.value.trim(),L.value?[L.value]:void 0))}ie(j,X=>{X.trim()||(H.value=!1)}),ie(le,X=>{for(const E of X)E.nip05&&O[E.id]===void 0&&(O[E.id]=null,d(E.nip05,E.pubkey).then(P=>{O[E.id]=P}))},{immediate:!0});async function pe(){if(!C.value.trim()||x.value)return;x.value=!0,y.value=[];const X={kind:1,created_at:Math.floor(Date.now()/1e3),tags:[],content:C.value.trim()},E=await f(X);if(!E){x.value=!1;return}const P=await b(E);y.value=P,x.value=!1,P.some(ce=>ce.success)&&(C.value="",setTimeout(()=>{y.value=[],I.value=!1},3e3))}return ne(async()=>{g(),I.value&&(await ye(),k.value?.focus())}),(X,E)=>(s(),n("div",Vi,[e("div",Ui,[(s(),n(D,null,N(r,P=>e("button",{key:P.id,class:i(["text-xs px-2.5 min-h-[44px] rounded-md transition-all duration-150 flex items-center justify-center",a.value===P.id?"nav-tab-active":"text-white/40 hover:text-white/70 hover:bg-white/5"]),onClick:ce=>a.value=P.id},u(P.label),11,qi)),64))]),a.value==="dms"?(s(),q(Ro,{key:0})):a.value==="relays"?(s(),q(sa,{key:1})):a.value==="profile"?(s(),q(pa,{key:2})):a.value==="lists"?(s(),q(ci,{key:3})):a.value==="articles"?(s(),q(Ei,{key:4})):a.value==="feed"&&h.value?(s(),q(Oa,{key:5,"note-id":h.value,onBack:E[0]||(E[0]=P=>h.value=null)},null,8,["note-id"])):(s(),n(D,{key:6},[e("div",Gi,[e("div",Oi,[E[5]||(E[5]=e("h3",{class:"text-sm font-bold text-white/90"}," Nostr Feed ",-1)),e("div",Hi,[e("span",Wi,u(le.value.length)+" notes ",1),re(X.$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:E[1]||(E[1]=P=>I.value=!I.value)},u(I.value?"Cancel":"Write a note..."),1)):v("",!0),I.value&&t(_)?(s(),n("div",Ki,[Q(e("textarea",{ref_key:"composeRef",ref:k,"onUpdate:modelValue":E[2]||(E[2]=P=>C.value=P),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(we(pe,["meta"]),["enter"]),ae(we(pe,["ctrl"]),["enter"])]},null,40,Yi),[[J,C.value]]),e("div",Qi,[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()||x.value,onClick:pe},u(x.value?"Publishing...":"Publish"),9,Ji)]),y.value.length>0?(s(),n("div",Zi,[(s(!0),n(D,null,N(y.value,P=>(s(),n("div",{key:P.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",P.success?"bg-emerald-500":"bg-red-400/60"])},null,2),e("span",Xi,u(P.url),1),e("span",{class:i(["ml-auto shrink-0",P.success?"text-emerald-400/60":"text-red-400/60"])},u(P.message),3)]))),128))])):v("",!0)])):v("",!0),e("div",er,[Q(e("input",{"onUpdate:modelValue":E[3]||(E[3]=P=>j.value=P),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(fe,["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(w),onClick:fe},u(t(w)?"...":"NIP-50"),9,tr)):v("",!0)]),e("div",sr,[(s(),n(D,null,N(U,P=>e("button",{key:P.id,class:i(["text-xs px-2.5 min-h-[44px] rounded-md transition-all duration-150 flex items-center justify-center",L.value===P.id?"nav-tab-active":"text-white/40 hover:text-white/70 hover:bg-white/5"]),onClick:ce=>L.value=L.value===P.id?null:P.id},u(P.label),11,nr)),64))])]),e("div",lr,[!t(l)&&t(c).length===0?(s(),n("div",or,[...E[6]||(E[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)])])):v("",!0),(s(!0),n(D,null,N(le.value,P=>(s(),n("button",{key:P.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:ce=>h.value=P.id},[e("div",ir,[e("div",rr,[P.authorPicture&&!M.has(P.pubkey)?(s(),n("img",{key:0,src:P.authorPicture,alt:P.authorName??"profile",class:"w-full h-full object-cover",loading:"lazy",onError:ce=>M.add(P.pubkey)},null,40,cr)):(s(),n("div",dr,u(P.authorName?.charAt(0)?.toUpperCase()??"?"),1))]),e("div",ur,[e("div",hr,[e("span",xr,u(P.authorName??"anon"),1),P.nip05?(s(),n("span",pr,[O[P.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:P.nip05},[...E[7]||(E[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,gr)):v("",!0),se(" "+u(P.nip05),1)])):v("",!0),e("span",br,u(R(P.created_at)),1)]),e("p",vr,u(P.content),1),e("div",fr,[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:we(ce=>K(P),["stop"])}," Zap ",8,mr),P.kind!==1?(s(),n("span",wr," kind:"+u(P.kind),1)):v("",!0)])])])],8,ar))),128)),e("div",yr,[E[8]||(E[8]=e("p",{class:"text-xs font-medium mb-2 text-white/30"},"Relays",-1)),e("div",kr,[(s(!0),n(D,null,N(t(m),P=>(s(),n("div",{key:P.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",P.connected?"bg-emerald-500":"bg-red-400/60"])},null,2),e("span",$r,u(P.url),1)]))),128))])]),t(l)&&le.value.length===0?(s(),n("div",_r,[...E[9]||(E[9]=[e("p",{class:"text-sm text-white/30"},"No notes match your search",-1)])])):v("",!0)])],64)),te(Sa,{"is-open":z.value,"target-name":V.value,"lightning-address":A.value,onClose:E[4]||(E[4]=P=>z.value=!1)},null,8,["is-open","target-name","lightning-address"])]))}}),jr={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:{},panelTitle:{},panelQuery:{},panelResponseText:{}},setup(o){const c=o,l=B(()=>{const f=c.panelResponseText??"";if(!f)return[{title:c.panelQuery||"Prompt",content:""}];const d=ls(f);return d.length>0?d:[{title:c.panelQuery||"Response",content:os(f)}]}),{openFilmDetail:m,openBookDetail:g,openTVSeriesDetail:b,openImageDetail:p,openPlaceDetail:w,openSongDetail:$,openPodcastDetail:_}=$e();return(f,d)=>(s(),n("div",jr,[o.activeTab==="film"?(s(),q(is,{key:0,films:o.panelFilms,title:o.panelTitle,onSelectFilm:t(m)},null,8,["films","title","onSelectFilm"])):o.activeTab==="book"?(s(),q(Bs,{key:1,books:o.panelBooks,title:o.panelTitle,onSelectBook:t(g)},null,8,["books","title","onSelectBook"])):o.activeTab==="tvshow"?(s(),q(en,{key:2,series:o.panelTVSeries,title:o.panelTitle,onSelectSeries:t(b)},null,8,["series","title","onSelectSeries"])):o.activeTab==="image"?(s(),q(xn,{key:3,images:o.panelImages,title:o.panelTitle,onSelectImage:t(p)},null,8,["images","title","onSelectImage"])):o.activeTab==="place"?(s(),q(zn,{key:4,places:o.panelPlaces,title:o.panelTitle,onSelectPlace:t(w)},null,8,["places","title","onSelectPlace"])):o.activeTab==="song"?(s(),q(rs,{key:5,songs:o.panelSongs,title:o.panelTitle,onSelectSong:t($)},null,8,["songs","title","onSelectSong"])):o.activeTab==="magazine"?(s(),q(st,{key:6,sections:o.panelMagazineSections,"hero-image-url":o.panelMagazineHeroImage,title:o.panelTitle,query:o.panelQuery},null,8,["sections","hero-image-url","title","query"])):o.activeTab==="news"?(s(),q(nt,{key:7,articles:o.panelWebResults,title:o.panelTitle,query:o.panelQuery},null,8,["articles","title","query"])):o.activeTab==="websites"?(s(),q(nt,{key:8,articles:o.panelWebsites,title:o.panelTitle,variant:"websites"},null,8,["articles","title"])):o.activeTab==="podcast"?(s(),q(tl,{key:9,podcasts:o.panelPodcasts,title:o.panelTitle,onSelectPodcast:t(_)},null,8,["podcasts","title","onSelectPodcast"])):o.activeTab==="code"?(s(),q(Wl,{key:10,"is-wide-desktop":o.isWideDesktop,"is-mobile":o.isMobile},null,8,["is-wide-desktop","is-mobile"])):o.activeTab==="design-system"?(s(),q(ro,{key:11})):o.activeTab==="nostr"?(s(),q(Cr,{key:12})):o.activeTab==="prompt"?(s(),q(st,{key:13,sections:l.value,"hero-image-url":null,title:"Prompt",query:o.panelQuery},null,8,["sections","query"])):v("",!0)]))}}),Sr={class:"book-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Mr={class:"relative w-full overflow-hidden"},Tr={class:"w-full aspect-[16/7] flex items-center justify-center overflow-hidden bg-black/20"},Ir=["src","alt"],Dr={class:"absolute bottom-0 left-0 right-0 p-4"},Br={class:"text-lg font-bold text-white"},Lr={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},Pr={key:0},Nr={key:1},zr={key:2,class:"text-amber-400"},Er={class:"p-4 space-y-4"},Ar={key:1,class:"flex flex-wrap gap-1.5"},Fr={class:"space-y-2"},Rr=["href"],Vr={class:"flex items-center gap-2.5"},Ur={class:"text-sm"},qr=["href"],Gr={class:"flex items-center gap-2.5"},Or={class:"text-sm"},Hr=G({__name:"BookDetail",props:{book:{}},emits:["back"],setup(o){const c=o,{isDark:l}=Z(),{bannerSrc:m,fallbackGradient:g,onBannerError:b}=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??"")}),p=B(()=>`${c.book.title} ${c.book.author}`.trim().replace(/\s+/g,"+")),w=B(()=>[{name:"Open Library",url:`https://openlibrary.org/search?q=${p.value}`,icon:"📖",desc:"Free, open catalog"},{name:"Internet Archive",url:`https://archive.org/search?query=${p.value}`,icon:"🏛️",desc:"Borrow & read free"},{name:"Project Gutenberg",url:`https://www.gutenberg.org/ebooks/search/?query=${p.value}`,icon:"📜",desc:"Public domain"},{name:"Standard Ebooks",url:`https://standardebooks.org/ebooks?query=${p.value}`,icon:"📕",desc:"Beautifully formatted"}]);function $(_){return{openlibrary:"📖",gutenberg:"📜",archive:"🏛️",goodreads:"📚",libgen:"🔓",local:"💾"}[_]??"📚"}return(_,f)=>(s(),n("div",Sr,[e("div",Mr,[e("div",Tr,[t(m)?(s(),n("img",{key:0,src:t(m),alt:o.book.title,class:"w-full h-full object-cover object-center block",onError:f[0]||(f[0]=(...d)=>t(b)&&t(b)(...d))},null,40,Ir)):(s(),n("div",{key:1,class:"w-full h-full",style:W({background:t(g)})},null,4))]),f[3]||(f[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:f[1]||(f[1]=d=>_.$emit("back"))},[...f[2]||(f[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",Dr,[e("h2",Br,u(o.book.title),1),e("div",Lr,[e("span",null,u(o.book.author),1),o.book.year?(s(),n("span",Pr,u(o.book.year),1)):v("",!0),o.book.pages?(s(),n("span",Nr,u(o.book.pages)+" pages",1)):v("",!0),o.book.rating?(s(),n("span",zr,"★ "+u(o.book.rating.toFixed(1)),1)):v("",!0)])])]),e("div",Er,[o.book.description?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(o.book.description),3)):v("",!0),o.book.genres?.length?(s(),n("div",Ar,[(s(!0),n(D,null,N(o.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))])):v("",!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",Fr,[(s(!0),n(D,null,N(o.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",Vr,[e("span",Ur,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"},[...f[4]||(f[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,Rr))),128)),(s(!0),n(D,null,N(w.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",Gr,[e("span",Or,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)):v("",!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"},[...f[5]||(f[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,qr))),128))])])])]))}}),Wr={class:"tv-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Kr={class:"relative w-full overflow-hidden"},Yr={class:"w-full aspect-[16/7] flex items-center justify-center overflow-hidden bg-black/20"},Qr=["src","alt"],Jr={class:"absolute bottom-0 left-0 right-0 p-4"},Zr={class:"text-lg font-bold text-white"},Xr={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},ec={key:0},tc={key:1},sc={key:2},nc={key:3},lc={key:4,class:"text-amber-400"},oc={key:5,class:"text-emerald-400"},ac={key:6,class:"text-white/40"},ic={class:"p-4 space-y-4"},rc={key:3,class:"flex flex-wrap gap-1.5"},cc={class:"space-y-2"},dc=["href"],uc={class:"flex items-center gap-2.5"},hc={class:"text-sm"},xc=["href"],pc={class:"flex items-center gap-2.5"},gc={class:"text-sm"},bc=G({__name:"TVSeriesDetail",props:{series:{}},emits:["back"],setup(o){const c=o,{isDark:l}=Z(),{bannerSrc:m,fallbackGradient:g,onBannerError:b}=bt({primaryUrls:()=>[c.series.posterUrl,c.series.backdropUrl],apiFetch:()=>ct(c.series.title,c.series.year),title:()=>c.series.title}),p=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):""),w=B(()=>c.series.title.trim().replace(/\s+/g,"+")),$=B(()=>(c.series.sources??[]).length>0?[]:[{name:"Internet Archive",url:`https://archive.org/search?query=${w.value}`,icon:"🏛️",desc:"Free, open archive"},{name:"YouTube",url:`https://youtube.com/results?search_query=${w.value}+full+series`,icon:"▶️",desc:"Free episodes"},{name:"Odysee",url:`https://odysee.com/$/search?q=${w.value}`,icon:"🔗",desc:"Decentralized"},{name:"Tubi",url:`https://tubitv.com/search/${w.value}`,icon:"📺",desc:"Free streaming"}]);function _(f){return{plex:"🟠",nextcloud:"☁️",youtube:"▶️",netflix:"🔴","free-web":"🌐",local:"💾"}[f]??"📺"}return(f,d)=>(s(),n("div",Wr,[e("div",Kr,[e("div",Yr,[t(m)?(s(),n("img",{key:0,src:t(m),alt:o.series.title,class:"w-full h-full object-cover object-center block",onError:d[0]||(d[0]=(...a)=>t(b)&&t(b)(...a))},null,40,Qr)):(s(),n("div",{key:1,class:"w-full h-full",style:W({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]=a=>f.$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",Jr,[e("h2",Zr,u(o.series.title),1),e("div",Xr,[p.value?(s(),n("span",ec,u(p.value),1)):v("",!0),o.series.seasons?(s(),n("span",tc,u(o.series.seasons)+" seasons",1)):v("",!0),o.series.episodes?(s(),n("span",sc,u(o.series.episodes)+" episodes",1)):v("",!0),o.series.network?(s(),n("span",nc,u(o.series.network),1)):v("",!0),o.series.rating?(s(),n("span",lc,"★ "+u(o.series.rating.toFixed(1)),1)):v("",!0),o.series.status==="ongoing"?(s(),n("span",oc,"ongoing")):o.series.status==="ended"?(s(),n("span",ac,"ended")):v("",!0)])])]),e("div",ic,[o.series.synopsis?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(o.series.synopsis),3)):v("",!0),o.series.creator?(s(),n("div",{key:1,class:i(["text-xs",t(l)?"text-white/50":"text-gray-500"])},[d[4]||(d[4]=se(" Created by ",-1)),e("span",{class:i(["font-medium",t(l)?"text-white/70":"text-gray-700"])},u(o.series.creator),3)],2)):v("",!0),o.series.cast?.length?(s(),n("div",{key:2,class:i(["text-xs",t(l)?"text-white/50":"text-gray-500"])}," Starring: "+u(o.series.cast.slice(0,5).join(", ")),3)):v("",!0),o.series.genres?.length?(s(),n("div",rc,[(s(!0),n(D,null,N(o.series.genres,a=>(s(),n("span",{key:a,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(a),3))),128))])):v("",!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",cc,[(s(!0),n(D,null,N(o.series.sources??[],a=>(s(),n("a",{key:a.url,href:a.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",uc,[e("span",hc,u(_(a.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(a.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,dc))),128)),(s(!0),n(D,null,N($.value,a=>(s(),n("a",{key:a.url,href:a.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",pc,[e("span",gc,u(a.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(a.name),3),a.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(a.desc),3)):v("",!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,xc))),128))])])])]))}}),vc={class:"podcast-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},fc={class:"relative w-full overflow-hidden"},mc={class:"w-full aspect-[16/7] flex items-center justify-center overflow-hidden bg-black/20"},wc=["src","alt"],yc={class:"absolute bottom-0 left-0 right-0 p-4"},kc={class:"text-lg font-bold text-white"},$c={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},_c={key:0},Cc={key:1},jc={key:2},Sc={class:"p-4 space-y-4"},Mc={key:1,class:"flex flex-wrap gap-1.5"},Tc={class:"space-y-2"},Ic=["href"],Dc={class:"flex items-center gap-2.5"},Bc={class:"text-sm"},Lc=["href"],Pc={class:"flex items-center gap-2.5"},Nc={class:"text-sm"},zc=G({__name:"PodcastDetail",props:{podcast:{}},emits:["back"],setup(o){const c=o,{isDark:l}=Z(),m=S(!1),g=S(null),b=B(()=>m.value?null:c.podcast.coverUrl||g.value||null);ne(()=>{c.podcast.coverUrl||xt(c.podcast.title,c.podcast.host).then(f=>{f&&(g.value=f)})});const p=B(()=>ht(c.podcast.title,c.podcast.host)),w=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=${w.value}`,icon:"⚡",desc:"Podcasting 2.0, Lightning"},{name:"Podcast Index",url:`https://podcastindex.org/search?q=${w.value}`,icon:"📻",desc:"Open podcast directory"},{name:"YouTube",url:`https://youtube.com/results?search_query=${w.value}`,icon:"▶️",desc:"Video podcasts"},{name:"Rumble",url:`https://rumble.com/search/video?q=${w.value}`,icon:"📺",desc:"Video & podcasts"},{name:"Odysee",url:`https://odysee.com/$/search?q=${w.value}`,icon:"🔗",desc:"Decentralized"}]);function _(f){return{fountain:"⚡",rumble:"📺",youtube:"▶️",podcastindex:"📻",castopod:"🦣",odysee:"🔗",podverse:"🎧",ipfs:"🌐",rss:"📡"}[f]??"🎙️"}return(f,d)=>(s(),n("div",vc,[e("div",fc,[e("div",mc,[b.value?(s(),n("img",{key:0,src:b.value,alt:o.podcast.title,class:"w-full h-full object-cover object-center block",onError:d[0]||(d[0]=a=>m.value=!0)},null,40,wc)):(s(),n("div",{key:1,class:"w-full h-full bg-cover bg-center",style:W({backgroundImage:`url(${p.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]=a=>f.$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",yc,[e("h2",kc,u(o.podcast.title),1),e("div",$c,[o.podcast.host?(s(),n("span",_c,u(o.podcast.host),1)):v("",!0),o.podcast.year?(s(),n("span",Cc,u(o.podcast.year),1)):v("",!0),o.podcast.episodeCount?(s(),n("span",jc,u(o.podcast.episodeCount)+" episodes",1)):v("",!0)])])]),e("div",Sc,[o.podcast.description?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(o.podcast.description),3)):v("",!0),o.podcast.genres?.length?(s(),n("div",Mc,[(s(!0),n(D,null,N(o.podcast.genres,a=>(s(),n("span",{key:a,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(a),3))),128))])):v("",!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",Tc,[(s(!0),n(D,null,N(o.podcast.sources,a=>(s(),n("a",{key:a.url,href:a.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",Dc,[e("span",Bc,u(_(a.type)),1),e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(a.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,Ic))),128)),$.value.length?(s(!0),n(D,{key:0},N($.value,a=>(s(),n("a",{key:a.url,href:a.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",Pc,[e("span",Nc,u(a.icon),1),e("div",null,[e("p",{class:i(["text-xs font-medium",t(l)?"text-white/80":"text-gray-800"])},u(a.name),3),a.desc?(s(),n("p",{key:0,class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])},u(a.desc),3)):v("",!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,Lc))),128)):v("",!0)])])])]))}}),Ec={class:"image-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Ac={class:"relative w-full overflow-hidden bg-black/20"},Fc=["src","alt"],Rc={class:"p-4 space-y-3"},Vc={class:"pt-2"},Uc=["href"],qc=G({__name:"ImageDetail",props:{image:{}},emits:["back"],setup(o){const{isDark:c}=Z(),l=S(!1);return(m,g)=>(s(),n("div",Ec,[e("div",Ac,[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:o.image.url,alt:o.image.alt||o.image.title||"Image",class:"w-full block max-h-[60vh] object-contain bg-black/40",onError:g[0]||(g[0]=b=>l.value=!0)},null,40,Fc)),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]=b=>m.$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",Rc,[o.image.title?(s(),n("h2",{key:0,class:i(["text-base font-bold",t(c)?"text-white/90":"text-gray-900"])},u(o.image.title),3)):v("",!0),o.image.description?(s(),n("p",{key:1,class:i(["text-sm leading-relaxed",t(c)?"text-white/70":"text-gray-600"])},u(o.image.description),3)):v("",!0),o.image.attribution?(s(),n("div",{key:2,class:i(["text-xs",t(c)?"text-white/50":"text-gray-500"])},u(o.image.attribution),3)):v("",!0),o.image.source?(s(),n("div",{key:3,class:i(["text-xs",t(c)?"text-white/40":"text-gray-400"])}," Source: "+u(o.image.source),3)):v("",!0),o.image.width&&o.image.height?(s(),n("div",{key:4,class:i(["text-xs",t(c)?"text-white/30":"text-gray-400"])},u(o.image.width)+" × "+u(o.image.height),3)):v("",!0),e("div",Vc,[e("a",{href:o.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),se(" Open original ",-1)])],10,Uc)])])]))}}),Gc={class:"place-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Oc={class:"relative w-full overflow-hidden"},Hc={class:"w-full aspect-[16/9] flex items-center justify-center overflow-hidden bg-black/20"},Wc=["src","alt"],Kc=["src","alt"],Yc={class:"absolute bottom-0 left-0 right-0 p-4"},Qc={class:"text-lg font-bold text-white"},Jc={class:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-xs text-white/60"},Zc={key:0},Xc={key:1},ed={key:2,class:"text-amber-400"},td={key:3,class:"text-white/50"},sd={class:"p-4 space-y-4"},nd={key:1,class:"flex items-start gap-2.5"},ld={key:2,class:"flex items-center gap-2.5"},od={key:3,class:"flex items-start gap-2.5"},ad={key:4,class:"flex items-center gap-2.5"},id=["href"],rd={class:"space-y-2"},cd=["href"],dd={class:"flex items-center gap-2.5"},ud={class:"text-sm"},hd=["href"],xd={class:"flex items-center gap-2.5"},pd={class:"text-sm"},gd=G({__name:"PlaceDetail",props:{place:{}},emits:["back"],setup(o){const c=o,{isDark:l}=Z(),m=S(null),g=B(()=>dt(c.place.name,c.place.cuisine||c.place.category));ne(()=>{c.place.photoUrl||ut(c.place.name,c.place.city).then(_=>{_&&(m.value=_)})});const b=B(()=>{if(!c.place.website)return"";try{return new URL(c.place.website).hostname.replace(/^www\./,"")}catch{return c.place.website}}),p=B(()=>`${c.place.name} ${c.place.city??""}`.trim().replace(/\s+/g,"+")),w=B(()=>{if((c.place.sources??[]).length>0)return[];const _=[{name:"OpenStreetMap",url:`https://www.openstreetmap.org/search?query=${p.value}`,icon:"🗺️",desc:"Open source maps"},{name:"Google Maps",url:`https://www.google.com/maps/search/${p.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(_,f)=>(s(),n("div",Gc,[e("div",Oc,[e("div",Hc,[o.place.photoUrl||m.value?(s(),n("img",{key:0,src:o.place.photoUrl||m.value,alt:o.place.name,class:"w-full h-full object-cover object-center block"},null,8,Wc)):(s(),n("img",{key:1,src:g.value,alt:o.place.name,class:"w-full h-full object-cover"},null,8,Kc))]),f[2]||(f[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:f[0]||(f[0]=d=>_.$emit("back"))},[...f[1]||(f[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",Yc,[e("h2",Qc,u(o.place.name),1),e("div",Jc,[o.place.cuisine||o.place.category?(s(),n("span",Zc,u(o.place.cuisine||o.place.category),1)):v("",!0),o.place.city?(s(),n("span",Xc,u(o.place.city),1)):v("",!0),o.place.rating?(s(),n("span",ed,"★ "+u(o.place.rating.toFixed(1)),1)):v("",!0),o.place.priceLevel?(s(),n("span",td,u("$".repeat(o.place.priceLevel)),1)):v("",!0)])])]),e("div",sd,[o.place.description?(s(),n("p",{key:0,class:i(["text-sm leading-relaxed",t(l)?"text-white/70":"text-gray-600"])},u(o.place.description),3)):v("",!0),o.place.address?(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"},[...f[3]||(f[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(o.place.address),3)])):v("",!0),o.place.phone?(s(),n("div",ld,[(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"},[...f[4]||(f[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(o.place.phone),3)])):v("",!0),o.place.hours?(s(),n("div",od,[(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"},[...f[5]||(f[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(o.place.hours),3)])):v("",!0),o.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"},[...f[6]||(f[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:o.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(b.value),11,id)])):v("",!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",rd,[(s(!0),n(D,null,N(o.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",dd,[e("span",ud,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"},[...f[7]||(f[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,cd))),128)),(s(!0),n(D,null,N(w.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",xd,[e("span",pd,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)):v("",!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"},[...f[8]||(f[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,hd))),128))])])])]))}}),bd={class:"article-detail h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},vd={class:"relative w-full overflow-hidden aspect-[16/7] shrink-0"},fd=["src","alt"],md={class:"absolute bottom-0 left-0 right-0 p-4"},wd={class:"text-lg font-bold text-white"},yd={key:0,class:"text-xs text-white/60 mt-1"},kd={class:"p-4 space-y-4"},$d={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"},_d=["innerHTML"],Cd={key:1,class:"py-4"},jd=["href"],Sd=G({__name:"ArticleDetail",props:{article:{}},emits:["back"],setup(o){const c=o,l=B(()=>{const b=c.article?.url;if(!b||typeof b!="string")return"";try{const p=new URL(b);return/^https?:$/i.test(p.protocol)?p.hostname.replace(/^www\./,""):""}catch{return""}}),m=B(()=>{const b=[...c.article.title].reduce((p,w)=>p+w.charCodeAt(0),0)%360;return`linear-gradient(135deg, hsl(${b}, 25%, 12%) 0%, hsl(${(b+40)%360}, 20%, 8%) 100%)`}),g=B(()=>{const b=c.article.content;return b?/<[a-z][\s\S]*>/i.test(b)?Yt(b):`<p class="whitespace-pre-wrap">${Qt(b)}</p>`:""});return(b,p)=>(s(),n("div",bd,[e("div",vd,[o.article.imgSrc&&t(Kt)(o.article.imgSrc)?(s(),n("img",{key:0,src:o.article.imgSrc,alt:o.article.title,class:"absolute inset-0 w-full h-full object-cover object-center block"},null,8,fd)):(s(),n("div",{key:1,class:"absolute inset-0",style:W({background:m.value})},null,4)),p[2]||(p[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:p[0]||(p[0]=w=>b.$emit("back"))},[...p[1]||(p[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",md,[e("h2",wd,u(o.article.title),1),l.value?(s(),n("p",yd,u(l.value),1)):v("",!0)])]),e("div",kd,[o.article.content?(s(),n("article",$d,[e("div",{innerHTML:g.value},null,8,_d)])):(s(),n("div",Cd,[...p[3]||(p[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)])])),o.article.url?(s(),n("a",{key:2,href:o.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"},[...p[4]||(p[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),se(" Read full article ",-1)])],8,jd)):v("",!0)])]))}}),Md={class:"website-detail h-full flex flex-col overflow-hidden"},Td={class:"flex-1 min-w-0 pl-8"},Id=["href"],Dd={class:"flex-1 min-h-0 relative bg-black/20"},Bd=["src"],Ld=G({__name:"WebsiteDetail",props:{website:{}},emits:["back"],setup(o){const c=o,{isDark:l}=Z(),m=B(()=>{if(!c.website.url)return"";try{return new URL(c.website.url).hostname.replace(/^www\./,"")}catch{return""}});return(g,b)=>(s(),n("div",Md,[e("div",{class:"shrink-0 flex items-center gap-2 px-3 py-2.5",style:W(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:b[0]||(b[0]=p=>g.$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",Td,[e("p",{class:i(["text-sm font-medium truncate",t(l)?"text-white/90":"text-gray-900"])},u(o.website.title||"Website"),3),m.value?(s(),n("p",{key:0,class:i(["text-xs truncate",t(l)?"text-white/30":"text-gray-400"])},u(m.value),3)):v("",!0)]),e("a",{href:o.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:b[1]||(b[1]=we(()=>{},["stop"]))},[...b[3]||(b[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,Id)],4),e("div",Dd,[(s(),n("iframe",{key:o.website.url,src:o.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,Bd))])]))}}),Pd=Ie(Ld,[["__scopeId","data-v-0f5111f5"]]),Nd={class:"flex-1 text-center pl-8"},zd={class:"flex-1 min-h-0 overflow-y-auto custom-scrollbar flex flex-col"},Ed={class:"px-6 py-8 md:px-8 md:py-10 max-w-lg mx-auto my-auto"},Ad={class:"space-y-4"},Fd=["href"],Rd={class:"flex items-center gap-1"},Vd=G({__name:"MagazineSectionDetail",props:{section:{},currentIndex:{},totalSections:{}},emits:["back","navigate"],setup(o){const c=o,{isDark:l}=Z(),m=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(b=>b.replace(/^\s*[-•]\s+/,"").replace(/(^|\n)\s*,\s*/g,"$1").trim()).filter(b=>b.length>0));return(g,b)=>(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:W(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:b[0]||(b[0]=p=>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"},[...b[3]||(b[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))]),e("div",Nd,[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(o.currentIndex+1)+"/"+u(o.totalSections),3)],4),e("div",zd,[e("div",Ed,[o.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(o.section.group),3)):v("",!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(o.section.title),3),o.section.author?(s(),n("p",{key:1,class:i(["text-xs mb-6",t(l)?"text-white/40":"text-black/40"])}," By "+u(o.section.author),3)):v("",!0),e("div",{class:i(["w-12 h-px mb-6",t(l)?"bg-white/15":"bg-black/15"])},null,2),e("div",Ad,[(s(!0),n(D,null,N(m.value,(p,w)=>(s(),n("p",{key:w,class:i(["text-base md:text-lg leading-relaxed",t(l)?"text-white/75":"text-black/65"])},u(p),3))),128))]),o.section.url?(s(),n("a",{key:2,href:o.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"])},[...b[4]||(b[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),se(" Source ",-1)])],10,Fd)):v("",!0)])]),e("div",{class:"shrink-0 flex items-center justify-between px-4 py-3",style:W(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:b[1]||(b[1]=p=>g.$emit("navigate","prev"))},[...b[5]||(b[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),se(" Prev ",-1)])],2),e("div",Rd,[(s(!0),n(D,null,N(o.totalSections,p=>(s(),n("div",{key:p,class:i(["w-1.5 h-1.5 rounded-full transition-all duration-200",p-1===o.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:b[2]||(b[2]=p=>g.$emit("navigate","next"))},[...b[6]||(b[6]=[se(" 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))}}),Ud={class:"flex-1 min-w-0 pl-8"},qd={class:"flex items-center gap-2"},Gd={class:"flex-1 min-h-0 overflow-auto custom-scrollbar"},Od={key:0,class:"font-mono text-xs leading-relaxed"},Hd={class:"w-full border-collapse"},Wd={key:1,class:"flex items-center justify-center h-full"},Kd={class:"text-center space-y-3 px-6"},Yd=G({__name:"CodeDetail",emits:["back"],setup(o){const{isDark:c}=Z(),{activeFile:l,activeFileContent:m,activeFileLanguage:g,activeProject:b}=xe(),p=B(()=>m.value),w=B(()=>g.value),$=B(()=>l.value??""),_=B(()=>$.value.split("/").pop()??""),f=B(()=>b.value?.name??""),d=B(()=>p.value?p.value.split(`
|
||
`):[]);return(a,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:W(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=>a.$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",Ud,[e("div",qd,[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(w.value),3),e("p",{class:i(["text-xs font-mono truncate",t(c)?"text-white/70":"text-gray-700"])},u(_.value),3)]),f.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(f.value)+" / "+u($.value),3)):v("",!0)])],4),e("div",Gd,[p.value?(s(),n("div",Od,[e("table",Hd,[e("tbody",null,[(s(!0),n(D,null,N(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",Wd,[e("div",Kd,[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))}}),Qd=Ie(Yd,[["__scopeId","data-v-7f40c0bc"]]),Jd={class:"h-full overflow-y-auto overflow-x-hidden scrollbar-hide"},Zd={class:"min-w-0 flex-1"},Xd={class:"p-4 space-y-4"},eu={key:0,class:"space-y-2"},tu={key:1,class:"space-y-2"},su={key:2,class:"flex items-end gap-2"},nu={key:0,class:"text-[7px] text-accent font-mono"},lu={key:3,class:"space-y-2"},ou={key:0,class:"flex gap-3"},au={key:1,class:"flex gap-3"},iu={key:2,class:"flex gap-3"},ru={key:3,class:"flex flex-wrap gap-1.5"},cu={key:4},du={class:"glass-card p-4"},uu={key:5,class:"flex gap-1.5"},hu={key:6},xu={key:7,class:"space-y-2"},pu={key:8},gu={key:9,class:"space-y-1.5"},bu={class:"flex items-center gap-2.5"},vu={key:10},fu={key:11,class:"flex gap-2"},mu={class:"absolute bottom-0 left-0 right-0 p-1.5"},wu={class:"text-xs text-white/80 font-medium truncate"},yu={key:12,class:"space-y-2"},ku={class:"flex justify-end"},$u={class:"flex justify-start"},_u={key:13,class:"space-y-2"},Cu={class:"grid grid-cols-3 gap-1"},ju={key:14,class:"space-y-2"},Su={class:"space-y-1 px-1"},Mu={key:15},Tu={key:16},Iu={class:"flex items-start gap-2.5"},Du={class:"min-w-0 flex-1"},Bu={class:"flex items-center gap-1.5"},Lu={class:"flex gap-3 mt-1.5"},Pu={key:17,class:"flex flex-col items-center gap-2"},Nu={key:18,class:"flex flex-col items-center gap-2"},zu={key:19,class:"text-center py-4"},Eu={key:0},Au=G({__name:"DesignSystemDetail",props:{item:{}},emits:["back"],setup(o){const c=o,{isDark:l}=Z(),m=S(!1),g=S(0),b=S(0),p={colors:"Colors",typography:"Typography",spacing:"Spacing",atoms:"Atoms",molecules:"Molecules",organisms:"Organisms"},w=B(()=>p[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 a=/(?:background-color|color|background):\s*([^;]+)/i.exec(d);return a?a[1].trim():"#333"}async function f(){try{await navigator.clipboard.writeText(c.item.code),m.value=!0,setTimeout(()=>{m.value=!1},2e3)}catch{}}return(d,a)=>(s(),n("div",Jd,[e("div",{class:"shrink-0 px-4 py-3 flex items-center gap-3",style:W(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:a[0]||(a[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"},[...a[3]||(a[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",Zd,[e("h2",{class:i(["text-sm font-semibold truncate",t(l)?"text-white/90":"text-gray-900"])},u(o.item.name),3),e("p",{class:i(["text-xs",t(l)?"text-white/40":"text-gray-400"])},u(w.value),3)]),e("button",{class:i(["text-xs px-2 py-1 rounded-md transition-colors",m.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:f},u(m.value?"Copied":"Copy"),3)],4),e("div",Xd,[e("p",{class:i(["text-sm leading-relaxed",t(l)?"text-white/60":"text-gray-600"])},u(o.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"])},[o.item.category==="colors"?(s(),n("div",eu,[e("div",{class:i(["h-12 rounded-lg border",t(l)?"border-white/10":"border-black/10"]),style:W({background:_(o.item.code)})},null,6),e("p",{class:i(["text-xs font-mono text-center",t(l)?"text-white/40":"text-gray-400"])},u(_(o.item.code)),3)])):o.item.category==="typography"?(s(),n("div",tu,[e("p",{class:i(["text-2xl font-bold",t(l)?"text-white/90":"text-gray-900"]),style:W($.value)}," Aa Bb Cc 123 ",6),e("p",{class:i(["text-sm",t(l)?"text-white/60":"text-gray-600"]),style:W($.value)}," The quick brown fox jumps over the lazy dog. ",6)])):o.item.category==="spacing"?(s(),n("div",su,[(s(),n(D,null,N([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:W({width:`${r}px`,height:`${r}px`})},[r>=16?(s(),n("span",nu,u(r),1)):v("",!0)],4)),64))])):(s(),n("div",lu,[o.item.id==="atom-glass-btn"?(s(),n("div",ou,[...a[4]||(a[4]=[e("button",{class:"glass-button text-sm"},"Action",-1),e("button",{class:"glass-button text-sm opacity-50 cursor-not-allowed"},"Disabled",-1)])])):o.item.id==="atom-glass-btn-sm"?(s(),n("div",au,[...a[5]||(a[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)])])):o.item.id==="atom-icon-btn"?(s(),n("div",iu,[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"])},[...a[6]||(a[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"])},[...a[7]||(a[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"])},[...a[8]||(a[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)])):o.item.id==="atom-badge"?(s(),n("div",ru,[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)])):o.item.id==="mol-glass-card"?(s(),n("div",cu,[e("div",du,[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)])])):o.item.id==="atom-nav-tab"?(s(),n("div",uu,[a[9]||(a[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)])):o.item.id==="atom-input"?(s(),n("div",hu,[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)])):o.item.id==="atom-scrollbar"?(s(),n("div",xu,[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(D,null,N(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)])):o.item.id==="mol-gradient-card"?(s(),n("div",pu,[...a[10]||(a[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)])])):o.item.id==="mol-source-link"?(s(),n("div",gu,[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",bu,[a[11]||(a[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"},[...a[12]||(a[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)])):o.item.id==="mol-banner-hero"?(s(),n("div",vu,[...a[13]||(a[13]=[Jt('<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)])])):o.item.id==="mol-cover-card"?(s(),n("div",fu,[(s(),n(D,null,N(3,r=>e("div",{key:r,class:"flex-1 rounded-xl overflow-hidden"},[e("div",{class:"aspect-[2/3] relative",style:W({background:`linear-gradient(${120*r}deg, ${["#2d1b69","#1b3a4b","#3b1b2b"][r-1]}, ${["#1a0a3e","#0a2030","#200a1a"][r-1]})`})},[a[14]||(a[14]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"},null,-1)),e("div",mu,[e("p",wu,u(["Film","Album","Series"][r-1]),1)])],4)])),64))])):o.item.id==="org-chat-bubble"?(s(),n("div",yu,[e("div",ku,[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",$u,[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)])])):o.item.id==="org-content-panel"?(s(),n("div",_u,[e("div",{class:"flex gap-1 pb-1.5",style:W(t(l)?"border-bottom: 1px solid rgba(255,255,255,0.08)":"border-bottom: 1px solid rgba(0,0,0,0.06)")},[a[15]||(a[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",Cu,[(s(),n(D,null,N(6,r=>e("div",{key:r,class:i(["aspect-[2/3] rounded-md",t(l)?"bg-white/5":"bg-black/5"])},null,2)),64))])])):o.item.id==="org-detail-view"?(s(),n("div",ju,[e("div",{class:i(["relative aspect-[16/7] rounded-lg overflow-hidden",t(l)?"bg-white/5":"bg-black/5"])},[a[17]||(a[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"},[...a[16]||(a[16]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))],2),a[18]||(a[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",Su,[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)])])):o.item.id==="org-magazine"?(s(),n("div",Mu,[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)])):o.item.id==="org-nostr-note"?(s(),n("div",Tu,[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",Iu,[a[20]||(a[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",Du,[e("div",Bu,[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",Lu,[e("span",{class:i(["text-xs",t(l)?"text-white/25":"text-gray-300"])},"3 replies",2),a[19]||(a[19]=e("span",{class:"text-xs text-amber-500/70"},"21000 sats",-1))])])])],2)])):o.item.id==="anim-fade-up"?(s(),n("div",Pu,[(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:a[1]||(a[1]=r=>g.value++)}," Replay ",2)])):o.item.id==="anim-scale-in"?(s(),n("div",Nu,[(s(),n("div",{key:b.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:a[2]||(a[2]=r=>b.value++)}," Replay ",2)])):(s(),n("div",zu,[e("p",{class:i(["text-xs",t(l)?"text-white/30":"text-gray-400"])}," See code below for usage pattern ",2)]))]))],2)]),o.item.usedIn?(s(),n("div",Eu,[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(o.item.usedIn),3)],2)])):v("",!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(o.item.code),3)])])]))}}),Ge=G({__name:"DetailView",setup(o){const{isCodeMode:c,activeFile:l}=xe();function m(){const{activeFile:R,activeFileContent:H}=xe();R.value=null,H.value=""}const{selectedFilm:g,selectedBook:b,selectedTVSeries:p,selectedImage:w,selectedPlace:$,selectedSong:_,selectedPodcast:f,selectedArticle:d,closeFilmDetail:a,closeBookDetail:r,closeTVSeriesDetail:h,closeImageDetail:M,closePlaceDetail:j,closeSongDetail:L,closePodcastDetail:I,closeArticleDetail:C,selectedWebsite:k,closeWebsiteDetail:x,selectedMagazineSection:y,magazineSectionIndex:z,panelMagazineSections:V,closeMagazineSectionDetail:A,navigateMagazineSection:K,selectedDesignSystemItem:O,closeDesignSystemItem:U}=$e();return(R,H)=>t(g)?(s(),q(cs,{key:0,film:t(g),onBack:t(a)},null,8,["film","onBack"])):t(_)?(s(),q(ds,{key:1,song:t(_),onBack:t(L)},null,8,["song","onBack"])):t(f)?(s(),q(zc,{key:2,podcast:t(f),onBack:t(I)},null,8,["podcast","onBack"])):t(b)?(s(),q(Hr,{key:3,book:t(b),onBack:t(r)},null,8,["book","onBack"])):t(p)?(s(),q(bc,{key:4,series:t(p),onBack:t(h)},null,8,["series","onBack"])):t(w)?(s(),q(qc,{key:5,image:t(w),onBack:t(M)},null,8,["image","onBack"])):t($)?(s(),q(gd,{key:6,place:t($),onBack:t(j)},null,8,["place","onBack"])):t(d)?(s(),q(Sd,{key:7,article:t(d),onBack:t(C)},null,8,["article","onBack"])):t(k)?(s(),q(Pd,{key:8,website:t(k),onBack:t(x)},null,8,["website","onBack"])):t(y)?(s(),q(Vd,{key:9,section:t(y),"current-index":t(z),"total-sections":t(V).length,onBack:t(A),onNavigate:t(K)},null,8,["section","current-index","total-sections","onBack","onNavigate"])):t(c)&&t(l)?(s(),q(Qd,{key:10,onBack:m})):t(O)?(s(),q(Au,{key:11,item:t(O),onBack:t(U)},null,8,["item","onBack"])):v("",!0)}}),Oe=G({__name:"CloseButton",emits:["click"],setup(o){const{isDark:c}=Z();return(l,m)=>(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:m[0]||(m[0]=g=>l.$emit("click"))},[...m[1]||(m[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))}}),Fu={class:"flex-1 overflow-y-auto p-4"},Ru={key:0,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4"},Vu={key:1,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3"},Uu={key:2,class:"space-y-3"},qu={class:"flex-1 space-y-2 py-1"},Gu={key:3,class:"space-y-0"},Ou=G({__name:"LoadingContentGrid",props:{variant:{default:"poster"},count:{default:8}},setup(o){const{isDark:c}=Z();return(l,m)=>(s(),n("div",Fu,[o.variant==="poster"?(s(),n("div",Ru,[(s(!0),n(D,null,N(o.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))])):o.variant==="square"?(s(),n("div",Vu,[(s(!0),n(D,null,N(o.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))])):o.variant==="list"?(s(),n("div",Uu,[(s(!0),n(D,null,N(o.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",qu,[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))])):o.variant==="magazine"?(s(),n("div",Gu,[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(D,null,N(o.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)])):v("",!0)]))}}),Hu={class:"relative flex-1 flex flex-col min-h-0 overflow-hidden"},Wu={key:0,class:"flex-1 flex flex-col min-h-0"},Ku={class:"flex items-center gap-2 shrink-0"},Yu={key:1,class:"relative flex-1 flex items-center justify-center min-h-0"},Qu={class:"relative flex flex-col items-center gap-8"},Ju={class:"flex items-center gap-2"},Zu={class:"absolute inset-0 pointer-events-none overflow-hidden"},Xu=G({__name:"ContextLoader",props:{contextType:{default:"film"}},setup(o){const c=o,{isDark:l}=Z(),m=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"),b=B(()=>c.contextType==="magazine"||["news","websites"].includes(c.contextType)?6:12);return(p,w)=>(s(),n("div",Hu,[["film","song","podcast","book","tvshow","image","news","websites","magazine"].includes(o.contextType)?(s(),n("div",Wu,[e("div",{class:"p-4 shrink-0 flex items-center justify-between gap-2",style:W(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(m.value),3),e("div",Ku,[e("p",{class:i(["text-xs font-mono uppercase tracking-[0.2em]",t(l)?"text-white/25":"text-gray-400"])}," Surfacing… ",2),re(p.$slots,"header-actions",{},void 0,!0)])],4),te(Ou,{variant:g.value,count:b.value},null,8,["variant","count"])])):(s(),n("div",Yu,[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",Qu,[e("div",Ju,[(s(),n(D,null,N(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:W({animationDelay:`${_*100}ms`})},[e("div",Zu,[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(m.value),3),e("div",{class:i(["w-40 h-px rounded-full overflow-hidden",t(l)?"bg-white/8":"bg-black/8"])},[...w[0]||(w[0]=[e("div",{class:"h-full bg-accent/90 rounded-full animate-progress-sweep"},null,-1)])],2)])]))]))}}),it=Ie(Xu,[["__scopeId","data-v-f8eb31f3"]]),e0={key:0,class:"absolute inset-0 pointer-events-none bg-black/20"},t0={key:0,class:"flex-1 min-w-0 flex flex-col relative"},s0={class:"flex flex-wrap gap-1.5 flex-1 min-w-0 justify-center"},n0=["onClick"],l0={key:1,class:"flex-1 min-w-0 flex flex-col"},o0={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"},i0={class:"empty-state-icon w-20 h-20 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},r0={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"}},c0={key:1,class:"flex-1 flex items-center justify-center"},d0={class:"text-center space-y-4 max-w-[200px] px-4"},u0={class:"empty-state-icon w-16 h-16 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},h0={key:1,class:"flex-1 flex flex-col min-h-0"},x0={class:"flex-1 min-h-0 flex flex-col p-2 pb-0"},p0={class:"flex-1 min-h-0 path-glass-card flex flex-col rounded-2xl overflow-hidden"},g0={class:"flex-1 min-h-0 flex flex-col p-2 pb-0"},b0={class:"flex-1 min-h-0 path-glass-card flex flex-col rounded-2xl overflow-hidden"},v0={class:"shrink-0 flex items-center gap-2 px-3 pt-2 pb-1 overflow-x-auto scrollbar-hide"},f0=["onClick"],m0={key:2,class:"flex-1 flex items-center justify-center"},w0={class:"text-center space-y-3 px-6"},y0={class:"empty-state-icon w-16 h-16 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},k0={class:"flex-1 min-h-0 flex flex-col p-2 pb-0"},$0={class:"flex-1 min-h-0 path-glass-card flex flex-col rounded-2xl overflow-hidden"},_0={class:"flex-1 min-h-0 flex flex-col"},C0={key:1,class:"flex-1 flex items-center justify-center"},j0={class:"text-center space-y-3 px-6"},S0={class:"empty-state-icon w-16 h-16 rounded-2xl path-glass-icon flex items-center justify-center mx-auto overflow-hidden"},M0={class:"shrink-0 pt-3 pb-3",style:{paddingBottom:"calc(12px + env(safe-area-inset-bottom, 0px))"}},T0={class:"flex items-center h-[49px] px-2 gap-1"},I0={key:0,class:"absolute top-1.5 right-[28%] w-1.5 h-1.5 rounded-full bg-accent"},D0={key:0,class:"absolute top-1.5 right-[28%] w-1.5 h-1.5 rounded-full bg-accent"},B0=G({__name:"ChatPage",setup(o){const{hasTrack:c}=Zt(),l=ss(),{activeFile:m,isCodeMode:g,exitCodeMode:b,clearActiveFile:p}=xe(),{isDark:w}=Z(),$=!!window.__AIUI_EMBEDDED__,_="/aiui/assets/img/bg-intro-3.jpg";as();const{panelOpen:f,panelFilms:d,panelBooks:a,panelTVSeries:r,panelImages:h,panelPlaces:M,panelSongs:j,panelPodcasts:L,panelWebResults:I,panelWebsites:C,panelMagazineSections:k,panelMagazineHeroImage:x,panelTitle:y,panelQuery:z,panelResponseText:V,contentType:A,activeTab:K,availableTabs:O,setActiveTab:U,selectedFilm:R,selectedBook:H,selectedTVSeries:le,selectedImage:fe,selectedPlace:pe,selectedSong:X,selectedPodcast:E,selectedArticle:P,selectedWebsite:ce,selectedMagazineSection:Be,selectedDesignSystemItem:mt,closeFilmDetail:wt,closeBookDetail:yt,closeTVSeriesDetail:kt,closeImageDetail:$t,closePlaceDetail:_t,closeSongDetail:Ct,closePodcastDetail:jt,closeArticleDetail:St,closeWebsiteDetail:Mt,closeMagazineSectionDetail:Tt,closePanel:_e,openFilmDetail:It,openBookDetail:Dt,openTVSeriesDetail:Bt,openImageDetail:Lt,openPlaceDetail:Pt,openSongDetail:Nt,openPodcastDetail:zt,openMagazineSectionDetail:Et}=$e(),Ce=B(()=>l.panelSide),Ee=S(window.innerWidth),oe=B(()=>Ee.value<1024),de=B(()=>Ee.value>=1440),ee=S("chat"),{isKeyboardOpen:At}=Xt();function Ke(){Ee.value=window.innerWidth}function Ye(F){F.key==="Escape"&&g.value&&!oe.value&&b()}ne(()=>{window.addEventListener("resize",Ke),window.addEventListener("keydown",Ye)}),es(()=>{window.removeEventListener("resize",Ke),window.removeEventListener("keydown",Ye)}),ie(f,F=>{F&&oe.value&&!$&&(ee.value="content")}),ie(y,()=>{f.value&&oe.value&&ee.value==="chat"&&!$&&(ee.value="content")}),ie(K,()=>{f.value&&oe.value&&ee.value==="chat"&&!$&&(ee.value="content")});const ge=B(()=>!!(R.value||H.value||le.value||fe.value||pe.value||X.value||E.value||P.value||ce.value||Be.value||mt.value||g.value&&m.value));ie(ge,F=>{F&&oe.value&&(ee.value="context"),!F&&oe.value&&ee.value==="context"&&(ee.value="content")});const Ae=B(()=>f.value&&O.value.length>0);function Qe(){wt(),yt(),kt(),$t(),_t(),Ct(),jt(),St(),Mt(),Tt(),p()}const Fe=B(()=>{const F=[];return d.value.forEach(T=>F.push({open:()=>It(T)})),a.value.forEach(T=>F.push({open:()=>Dt(T)})),r.value.forEach(T=>F.push({open:()=>Bt(T)})),j.value.forEach(T=>F.push({open:()=>Nt(T)})),L.value.forEach(T=>F.push({open:()=>zt(T)})),h.value.forEach(T=>F.push({open:()=>Lt(T)})),M.value.forEach(T=>F.push({open:()=>Pt(T)})),k.value.forEach((T,Y)=>F.push({open:()=>Et(T,Y)})),F}),Je=B(()=>{if(R.value){const F=d.value.indexOf(R.value);return F>=0?F:0}if(H.value){const F=a.value.indexOf(H.value);return F>=0?d.value.length+F:0}if(le.value){const F=r.value.indexOf(le.value);return F>=0?d.value.length+a.value.length+F:0}if(X.value){const F=d.value.length+a.value.length+r.value.length,T=j.value.indexOf(X.value);return T>=0?F+T:0}if(E.value){const F=d.value.length+a.value.length+r.value.length+j.value.length,T=L.value.indexOf(E.value);return T>=0?F+T:0}if(fe.value){const F=d.value.length+a.value.length+r.value.length+j.value.length+L.value.length,T=h.value.indexOf(fe.value);return T>=0?F+T:0}if(pe.value){const F=d.value.length+a.value.length+r.value.length+j.value.length+L.value.length+h.value.length,T=M.value.indexOf(pe.value);return T>=0?F+T:0}if(Be.value){const F=d.value.length+a.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?F+T:0}return 0});function Ze(F){const T=Fe.value;if(!T.length)return;let Y=Je.value;Y+=F==="next"?1:-1,Y<0&&(Y=T.length-1),Y>=T.length&&(Y=0),Qe(),T[Y].open()}const Ft={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(F){return Ft[F]??F}const et=B(()=>{if(f.value)return A.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":A.value});return(F,T)=>(s(),n("div",{class:i(["h-full flex flex-col relative overflow-hidden transition-colors duration-300",[]]),style:W($?{background:"transparent"}:t(w)?{background:"#000 url("+_+") center center / cover no-repeat fixed"}:{backgroundColor:"#f5f4f1"})},[t(w)&&!$?(s(),n("div",e0)):v("",!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:W(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&&ge.value&&!Ae.value&&"detail-active"]]),style:{"animation-delay":"0.1s"}},[t(f)&&Ae.value&&(de.value||!ge.value)?(s(),n("div",t0,[te(Oe,{onClick:t(_e)},null,8,["onClick"]),e("div",{class:"shrink-0 flex items-center gap-2 px-4 pr-12 py-3",style:W(t(w)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[e("div",s0,[(s(!0),n(D,null,N(t(O),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(w)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:Rt=>t(U)(Y)},u(Xe(Y)),11,n0))),128))])],4),te(be,{title:"Content failed to load"},{default:ue(()=>[te(at,{"active-tab":t(K),"is-wide-desktop":de.value,"is-mobile":oe.value,"panel-films":t(d),"panel-books":t(a),panelTVSeries:t(r),"panel-images":t(h),"panel-places":t(M),"panel-songs":t(j),"panel-podcasts":t(L),"panel-web-results":t(I),"panel-websites":t(C),"panel-magazine-sections":t(k),"panel-magazine-hero-image":t(x),"panel-title":t(y),"panel-query":t(z),"panel-response-text":t(V),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-title","panel-query","panel-response-text","onClose"])]),_:1})])):!de.value&&t(f)&&ge.value?(s(),n("div",l0,[te(Oe,{onClick:T[0]||(T[0]=Y=>Ae.value?Qe():t(_e)())}),te(be,{title:"Detail view error"},{default:ue(()=>[te(Ge)]),_:1})])):t(l).isStreaming?(s(),q(it,{key:2,"context-type":et.value},{"header-actions":ue(()=>[te(Oe,{onClick:t(_e)},null,8,["onClick"])]),_:1},8,["context-type"])):(s(),n("div",o0,[e("div",a0,[e("div",i0,[e("span",{class:i(["text-3xl",t(w)?"text-[#fafafa]":"text-gray-800"])},"✦",2)]),e("div",null,[e("h2",{class:i(["text-lg font-bold mb-1",t(w)?"text-white/80":"text-gray-800"])}," Content Surface ",2),e("p",{class:i(["text-sm leading-relaxed",t(w)?"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",r0,[ge.value?(s(),q(be,{key:0,title:"Detail view error"},{default:ue(()=>[te(Ge)]),_:1})):(s(),n("div",c0,[e("div",d0,[e("div",u0,[e("span",{class:i(["text-2xl",t(w)?"text-[#fafafa]":"text-gray-800"])},"✦",2)]),e("div",null,[e("h2",{class:i(["text-sm font-semibold mb-1",t(w)?"text-white/60":"text-gray-600"])}," Awaiting Context ",2),e("p",{class:i(["text-xs leading-relaxed",t(w)?"text-white/25":"text-gray-400"])}," Select an item to see details here. ",2)])])]))])):v("",!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"}},[te(be,{title:"Chat error"},{default:ue(()=>[te(tt,{side:Ce.value,onSwitchSide:T[1]||(T[1]=Y=>t(l).switchSide())},null,8,["side"])]),_:1})],2)],6),oe.value?(s(),n("div",h0,[Q(e("div",x0,[e("div",p0,[te(be,{title:"Chat error"},{default:ue(()=>[te(tt,{variant:"standalone","show-close":!1})]),_:1})])],512),[[Le,ee.value==="chat"]]),Q(e("div",g0,[e("div",b0,[t(f)?(s(),n(D,{key:0},[e("div",v0,[e("button",{class:i(["p-1.5 rounded-lg transition-colors shrink-0",t(w)?"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=>ee.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(D,null,N(t(O),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(w)?"text-white/40 hover:text-white/70 hover:bg-white/5":"text-gray-500 hover:text-gray-800 hover:bg-black/5"]),onClick:Rt=>t(U)(Y)},u(Xe(Y)),11,f0))),128))]),te(be,{title:"Content failed to load"},{default:ue(()=>[te(at,{"active-tab":t(K),"is-wide-desktop":de.value,"is-mobile":oe.value,"panel-films":t(d),"panel-books":t(a),panelTVSeries:t(r),"panel-images":t(h),"panel-places":t(M),"panel-songs":t(j),"panel-podcasts":t(L),"panel-web-results":t(I),"panel-websites":t(C),"panel-magazine-sections":t(k),"panel-magazine-hero-image":t(x),"panel-title":t(y),"panel-query":t(z),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-title","panel-query","onClose"])]),_:1})],64)):t(l).isStreaming?(s(),q(it,{key:1,"context-type":et.value},null,8,["context-type"])):(s(),n("div",m0,[e("div",w0,[e("div",y0,[e("span",{class:i(["text-2xl",t(w)?"text-[#fafafa]":"text-gray-800"])},"✦",2)]),e("p",{class:i(["text-xs",t(w)?"text-white/30":"text-gray-400"])}," Ask about something in the chat to see content here. ",2)])]))])],512),[[Le,ee.value==="content"]]),Q(e("div",k0,[e("div",$0,[ge.value?(s(),n(D,{key:0},[e("div",_0,[te(be,{title:"Detail view error"},{default:ue(()=>[te(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:W(t(w)?"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(w)?"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),se(" Prev ",-1)])],2),e("span",{class:i(["text-xs font-mono tabular-nums",t(w)?"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(w)?"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]=[se(" 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)):v("",!0)],64)):(s(),n("div",C0,[e("div",j0,[e("div",S0,[(s(),n("svg",{class:i(["w-7 h-7",t(w)?"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(w)?"text-white/30":"text-gray-400"])}," Tap an item in Content to view details here. ",2)])]))])],512),[[Le,ee.value==="context"]]),te(ts,{variant:"inline",compact:""}),Q(e("div",M0,[e("div",T0,[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",ee.value==="chat"?t(w)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(w)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:T[5]||(T[5]=Y=>ee.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",ee.value==="content"?t(w)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(w)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:T[6]||(T[6]=Y=>ee.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(f)&&ee.value==="chat"?(s(),n("span",I0)):v("",!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",ee.value==="context"?t(w)?"bg-white/10 text-white/90":"bg-black/8 text-gray-900":t(w)?"text-white/40 hover:text-white/60":"text-gray-400 hover:text-gray-600"]),onClick:T[7]||(T[7]=Y=>ee.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)),ge.value&&ee.value!=="context"?(s(),n("span",D0)):v("",!0)],2)])],512),[[Le,!t(At)]])])):v("",!0)],4))}}),U0=Ie(B0,[["__scopeId","data-v-a57bffe4"]]);export{U0 as default};
|