import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{Mi as s,ki as a}from"./vendor-frame-CwiylG4Y.js";import{Dh as r}from"./shared-1-3-6x7RKF.js";import{qi as n}from"./shared-6-Cf_fMhRZ.js";import{An as l,Cn as i,Mn as o,Nn as t,On as c,jn as m,kn as d,wn as p}from"./shared-8-C1HP2d2B.js";import{n as x,t as f}from"./c9bc02337-CMerfzdC.js";var u=e(s()),h=a();var j=(0,u.memo)(function({product:e,widgetType:s,disableAnalytics:a,onLearnMore:l,onDomainClick:m,onSourcesInfoOpen:j}){const b=r(e.url),g=(0,u.useCallback)(()=>l?.(),[l]),w=(0,u.useMemo)(()=>function(e){const s=(e??[]).map(e=>({img:e,src:r(e.thumbnail_url)})).filter(e=>!!e.src);return s.length>=3?s.slice(0,3):null}(e.images),[e.images]);return(0,h.jsxs)("div",{className:"relative flex min-w-0 flex-col overflow-hidden bg-surface-2",style:{borderRadius:p},children:[w&&(0,h.jsx)("div",{className:"px-sm pt-sm",children:(0,h.jsx)("div",{className:"grid h-56 w-full grid-cols-[3fr_2fr] grid-rows-2",style:{gap:"3px"},children:w.map(({img:e,src:r},n)=>(0,h.jsx)(d,{src:r,widgetType:s,disableAnalytics:a,alt:e.title||"",radius:t("hero-left",n),className:0===n?"row-span-2":"",children:(0,h.jsx)(i,{source:e.source,pageUrl:e.page_url,onDomainClick:m?()=>m(e):void 0})},e.id||n))})}),(0,h.jsxs)("div",{className:"flex flex-1 flex-col px-lg pb-lg pt-lg",children:[b?(0,h.jsx)("span",{className:"flex",children:(0,h.jsx)(n,{href:b,linkTarget:"_blank",target:"_blank",onLinkClick:g,className:`min-w-0 break-words decoration-transparent hover:decoration-current focus-visible:decoration-current ${o}`,children:e.name})}):(0,h.jsx)("span",{className:`break-words ${o}`,children:e.name}),e.blurb&&(0,h.jsx)("span",{className:"break-words pt-2 text-body text-secondary",children:e.blurb}),b?(0,h.jsx)("span",{className:"mt-auto pt-md",children:(0,h.jsx)(f,{safeHref:b,price:e.price,onSourceClick:g,onSourcesInfoOpen:j})}):e.price||w?(0,h.jsx)("span",{className:"mt-auto pt-md",children:(0,h.jsxs)("span",{className:"flex h-4 min-w-0 items-center justify-between gap-sm text-footnote leading-none text-muted",children:[(0,h.jsx)("span",{className:"min-w-0 overflow-x-clip text-ellipsis whitespace-nowrap",children:e.price}),w&&(0,h.jsx)(x,{variant:"short",onOpen:j})]})}):null]}),(0,h.jsx)(c,{})]})});export{j as t};