import{r as n,j as o}from"./router.chunk.YsRm4bSN.js";import{s as sprintf,_ as __}from"./wordpress.chunk.BVds2GcU.js";import{S as t}from"./donation.chunk.D76CvJSa.js";import{u as s,c4 as r,A as a,D as e,b5 as i,l as m,$ as c,L as d,N as u,aC as p,aD as f,az as j}from"./main.chunk.N-eZ2ybB.js";import{m as h}from"./pdf-core.chunk.D33I_Wdh.js";import{P as l}from"./pdf-donation-content.chunk.CK5AzyNy.js";import{P as g}from"./pdf-receipt-document.chunk.BnWw5Zlc.js";import{u as k}from"./use-currency.chunk.QE--bLc6.js";import{f as x}from"./date-utils.chunk.DWRtWTmT.js";import{u as _}from"./donation.chunk.Dp3XMNs5.js";import"./react-jsx-runtime.chunk.ATkk6v2S.js";import"./react.js";import"./react-dom-client.chunk.BMQ1litG.js";import"./react-dom.js";import"./utils.chunk.C1IATKsN.js";import"./ui-radix.chunk.Xzokq_Gv.js";import"./icons.chunk.BwnSC3zE.js";import"./forms.chunk.Bz8aaTWe.js";import"./pdf-context.chunk.DXMR6h2w.js";import"./pdf-signature.chunk.IQZSL9sf.js";import"./pdf-html.chunk.CXZoRVhj.js";const w=({donation:t,template:m})=>{const{toCurrency:c}=k(),{appConfig:d}=s(),u=n.useMemo(()=>{const n={campaign_name:t.campaign.title,fund_name:t.fund?.title??i(2),donor_name:sprintf("%s %s",t.donor.first_name,t.donor.last_name),donation_amount:c(t.amount),payment_method:t.payment_method.label,donation_date_time:x(t.created_at,e.DATE_TIME)};return m.content.greetings=r(m.short_codes?.filter(n=>"{fund_name}"!==n.value||d[a.Campaign]?.allow_fund)??[],m.content.greetings,n),m},[m,t,c,d]),p=window.innerHeight;return o.jsx(h,{width:"100%",height:p,children:o.jsx(g,{pdfReceiptTemplate:u,toCurrency:c,appConfig:d,children:o.jsx(l,{donation:t})})})},y=()=>{const{uid:n}=m(),s=_(n);return c(s,{Loading:o.jsx(j,{}),Error:o.jsx(p,{className:"growfund-mt-10",children:o.jsxs(f,{children:[o.jsx(t,{}),o.jsx("div",{children:__("Donation not found.","growfund")})]})}),Empty:o.jsx(d,{className:"growfund-mt-10",children:o.jsxs(u,{className:"growfund-flex growfund-flex-col growfund-items-center",children:[o.jsx(t,{}),o.jsx("div",{children:__("Donation not found.","growfund")})]})}),Success:n=>o.jsx(w,{...n.data})})};export{y as default};
