1import{d as w,aY as x,g as e,o as l,i as b,h as k,j as s,t as i,e as p,f as L,a4 as C,k as S,n,_ as E}from"./BSfTcT_O.js";const B={class:"flex items-center h-28"},D={class:"flex-1 p-4 min-w-0"},N={class:"text-base font-semibold text-primary group-hover:text-secondary mb-1 line-clamp-1"},$={class:"text-sm text-muted line-clamp-1 mb-2"},j={class:"flex items-center gap-1 text-xs text-default"},z=["src","alt"],U={class:"truncate"},V={key:0,class:"h-full w-28 sm:w-56 flex-shrink-0"},q={key:1,class:"my-5 p-6 rounded-lg bg-elevated/50 animate-pulse"},F=w({__name:"LinkCard",props:{url:{type:String,required:!0},title:{type:String,default:""},description:{type:String,default:""},icon:{type:String,default:""},image:{type:String,default:""}},setup(r){const t=r,{data:o,pending:_}=x("/api/ogp",{query:{url:t.url},immediate:!t.title&&!t.description},"$1ni4ao-MEL"),c=n(()=>t.title||o.value?.title||t.url),g=n(()=>t.description||o.value?.description||""),d=n(()=>t.image||o.value?.image||""),u=n(()=>{try{return new URL(t.url).hostname.replace("www.","")}catch{return t.url}}),f=n(()=>`https://www.google.com/s2/favicons?domain=${t.url}&sz=32`),h=m=>{const a=m.target;a instanceof HTMLElement&&(a.style.display="none")};return(m,a)=>{const y=C,v=E;return e(_)?(l(),p("div",q,[...a[0]||(a[0]=[s("div",{class:"h-6 bg-default rounded w-3/4 mb-2"},null,-1),s("div",{class:"h-4 bg-default rounded w-full"},null,-1)])])):(l(),b(v,{key:0,to:r.url,target:"_blank",class:"my-5 block border border-muted rounded-lg overflow-hidden hover:border-secondary transition-colors group bg-muted"},{default:k(()=>[s("div",B,[s("div",D,[s("h3",N,i(e(c)),1),s("p",$,i(e(g)),1),s("div",j,[s("img",{src:e(f),alt:`${e(u)} favicon`,width:"16",height:"16",class:"w-4 h-4",loading:"lazy",onError:h},null,40,z),s("span",U,i(e(u)),1)])]),e(d)?(l(),p("div",V,[L(y,{src:e(d),alt:e(c),class:"h-full w-full object-cover",loading:"lazy"},null,8,["src","alt"])])):S("",!0)])]),_:1},8,["to"]))}}}),M=Object.assign(F,{__name:"LinkCard"});export{M as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.