// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0-or-later
// @source: https://gitlab.com/soapbox-pub/ditto/-/tree/f0a3877c
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Sr as t,li as n,qi as r}from"./lucide-icons-BdRF0moN.js";import{t as i}from"./jsx-runtime-By8HlURe.js";import{t as a}from"./useAppContext-Ughdk2-Z.js";import{l as o}from"./useCurrentUser-C6OJJlWo.js";import{t as s}from"./button-Cs26nq0r.js";import{n as c,o as l,r as u,t as d}from"./avatar--oX_CTF4.js";import{n as f}from"./chunk-62JRHF6Z-yJW_vgm4.js";import{a as p}from"./bitcoinMoney-CQsGrYK3.js";var m=e(r(),1),h=i();function g({recipientPubkey:e,recipientLabel:r,amountSats:i,btcPrice:g,txid:_,onClose:v}){let{data:y}=o(e),{config:b}=a(),x=b.currencyDisplay??`usd`,S=y?.metadata,C=S?.name||S?.display_name||`Anonymous`,w=r??C,T=l(S),E=(0,m.useMemo)(()=>p(i,x,g),[i,x,g]),D=(0,m.useMemo)(()=>Array.from({length:8},(e,t)=>{let n=t/8*Math.PI*2;return{id:t,x:Math.cos(n)*58,y:Math.sin(n)*58,delay:.15+t%4*.05,hue:t%2==0?`bg-amber-400`:`bg-orange-500`}}),[]);return(0,h.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`relative grid gap-5 px-6 py-8 w-full overflow-hidden text-center motion-safe:animate-success-fade-up`,children:[(0,h.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 -z-10 bg-[radial-gradient(circle_at_50%_35%,hsl(var(--primary)/0.18),transparent_65%)]`}),(0,h.jsxs)(`div`,{className:`relative mx-auto flex size-28 items-center justify-center`,children:[(0,h.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-0 rounded-full bg-gradient-to-br from-amber-400/40 to-orange-500/30 motion-safe:animate-success-halo`}),(0,h.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-0 rounded-full bg-gradient-to-br from-amber-400 to-orange-500 shadow-lg shadow-orange-500/30 motion-safe:animate-success-pop`}),(0,h.jsx)(n,{className:`relative size-14 text-white drop-shadow-sm motion-safe:animate-success-pop`,strokeWidth:3,"aria-hidden":!0}),(0,h.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 motion-reduce:hidden`,children:D.map(e=>(0,h.jsx)(`span`,{className:`absolute left-1/2 top-1/2 size-1.5 rounded-full ${e.hue} motion-safe:animate-success-spark`,style:{"--spark-x":`${e.x}px`,"--spark-y":`${e.y}px`,animationDelay:`${e.delay}s`}},e.id))})]}),(0,h.jsxs)(`div`,{className:`grid gap-1`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:r?`Donation sent`:`Bitcoin sent`}),(0,h.jsx)(`div`,{className:`text-4xl font-bold tabular-nums bg-gradient-to-br from-amber-500 to-orange-600 bg-clip-text text-transparent`,children:E})]}),(0,h.jsxs)(`div`,{className:`mx-auto flex items-center gap-3 rounded-full border border-border/70 bg-muted/40 pl-2 pr-4 py-2 max-w-full`,children:[(0,h.jsxs)(d,{shape:T,className:`size-8 shrink-0`,children:[(0,h.jsx)(u,{src:S?.picture,alt:w}),(0,h.jsx)(c,{className:`bg-primary/20 text-primary text-xs`,children:w[0]?.toUpperCase()})]}),(0,h.jsxs)(`div`,{className:`min-w-0 text-left`,children:[(0,h.jsx)(`div`,{className:`text-[11px] text-muted-foreground leading-tight`,children:`To`}),(0,h.jsx)(`div`,{className:`text-sm font-medium truncate max-w-[220px]`,children:w})]})]}),(0,h.jsxs)(`div`,{className:`grid gap-2`,children:[_&&(0,h.jsx)(s,{type:`button`,variant:`outline`,asChild:!0,className:`w-full`,children:(0,h.jsxs)(f,{to:`/i/bitcoin:tx:${_}`,onClick:v,children:[(0,h.jsx)(t,{className:`size-4 mr-2`}),`View transaction`]})}),(0,h.jsx)(s,{type:`button`,onClick:v,className:`w-full`,children:`Done`})]})]})}export{g as t};
// @license-end
