import{r as e,j as n}from"./vendor-react-Dp9pL_Wn.js";import{R as r,U as s,V as t,W as a,aq as o,ar as i}from"./c6eedc03a-CsEFTfjy.js";import{u as l,M as c}from"./vendor-intl-D2wGIp4M.js";import{d as u}from"./caf7c7e06-DJYXCm3T.js";import{T as p,I as f}from"./vendor-ant-cds-bBedrtIN.js";const m="https://support.claude.com/en/articles/13641943-visual-and-interactive-content";const d=e.memo(function({variant:s="full",onOpen:t}={}){const a=l(),u=e.useRef(!1),d=e.useRef(!1),h=e.useRef(!1),x=e.useRef(!1),g=e.useCallback(()=>{h.current||(h.current=!0,t?.())},[t]),j=e.useCallback(e=>{"touch"!==e.pointerType&&"pen"!==e.pointerType&&(u.current=!0,g())},[g]),k=e.useCallback(e=>{u.current=!1,"touch"!==e.pointerType&&"pen"!==e.pointerType&&(x.current=!1),d.current||(h.current=!1)},[]),v=e.useCallback(()=>{x.current=!0},[]),b=e.useCallback(()=>{const e=x.current;x.current=!1,d.current=!0,e||g()},[g]),w=e.useCallback(()=>{d.current=!1,x.current=!1,u.current||(h.current=!1)},[]),y=r(r(o("image_search_help_center","url","",i))??m)??m,C=e=>n.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:opacity-80",children:e});return n.jsx(p,{delay:0,align:"end",multiline:!0,className:"max-w-[280px] -translate-y-1",content:"short"===s?n.jsx(c,{defaultMessage:"Results from the web. <link>Learn more</link>",id:"ICs/DFJLFl",values:{link:C}}):n.jsx(c,{defaultMessage:"Results from the web. Listings are not sponsored and do not generate advertising revenue for Anthropic. <link>Learn more</link>",id:"G9SSLg/Q1C",values:{link:C}}),children:n.jsx("button",{type:"button","aria-label":a.formatMessage({defaultMessage:"About these sources",id:"SGNSIq+G0H"}),onPointerEnter:j,onPointerLeave:k,onPointerDown:v,onFocus:b,onBlur:w,className:"flex size-4 shrink-0 items-center justify-center text-muted transition-colors hover:text-secondary",children:n.jsx(f,{name:"Info",size:"sm"})})})}),h=e.memo(function({safeHref:e,price:o,onSourceClick:i,onSourcesInfoOpen:c}){const p=l(),f=r(e);if(!f)return null;const m=u(f),h=m&&o?p.formatMessage({defaultMessage:"{vendor} \xb7 {price}",id:"fmnYlj2OqC"},{vendor:m,price:o}):m||o;return n.jsxs("span",{className:"flex h-4 min-w-0 items-center justify-between gap-sm text-footnote leading-none text-muted",children:[n.jsxs(s,{href:f,linkTarget:"_blank",target:"_blank",onLinkClick:i,className:"group/source inline-flex min-w-0 items-center gap-1.5 decoration-transparent",children:[n.jsx("span",{className:"flex shrink-0",children:n.jsx(t,{url:a(f,16),size:16},f)}),h&&n.jsx("span",{className:"min-w-0 overflow-x-clip text-ellipsis whitespace-nowrap group-hover/source:underline group-focus-visible/source:underline",children:h})]}),n.jsx(d,{onOpen:c})]})});export{h as P,d as S};
