import{a as r,j as s}from"./router.chunk.YsRm4bSN.js";import{aZ as a,a6 as n,a_ as o,a$ as e,W as d,b0 as i}from"./icons.chunk.BwnSC3zE.js";import{_ as __,s as sprintf,b as _n}from"./wordpress.chunk.BVds2GcU.js";import{u as c,n as t,c as u,k as f,i as g,D as l,B as m}from"./main.chunk.N-eZ2ybB.js";import{D as w}from"./dot-separator.chunk.CtyhSI2x.js";import{P as p}from"./progress.chunk.Bl335FuN.js";import{g as x}from"./goal-info.chunk.5sJIIQ8N.js";import{u as h}from"./use-currency.chunk.QE--bLc6.js";import{f as j}from"./date-utils.chunk.DWRtWTmT.js";const v=r.forwardRef(({campaign:r,onRemove:v,onRemoveBookmark:y,mode:_="edit",showPreview:N=!1,className:k,...b},z)=>{const{isDonationMode:C}=c(),{toCurrency:D}=h(),R=x(r,C,D);return s.jsxs(t,{className:u("growfund-flex growfund-gap-6 growfund-p-4 growfund-items-center growfund-relative growfund-group/campaign-card",k),...b,ref:z,children:[s.jsx(f,{src:r.images?.[0]?.url??null,alt:r.title,aspectRatio:"square",className:"growfund-w-[6.25rem]",fit:"cover"}),s.jsxs("div",{className:"growfund-grid growfund-gap-1 growfund-flex-1",children:[s.jsx("div",{className:"growfund-typo-paragraph growfund-font-medium growfund-text-fg-primary",children:r.title}),s.jsxs("div",{className:"growfund-flex growfund-items-center growfund-gap-2",children:[g(r.author)&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"growfund-text-fg-secondary growfund-flex growfund-items-center growfund-gap-1 growfund-flex-shrink-0",children:[s.jsx("span",{children:__("by","growfund")}),s.jsx("span",{className:"growfund-text-fg-success growfund-capitalize",children:r.author.display_name})]}),s.jsx(w,{})]}),r.start_date&&s.jsxs("div",{className:"growfund-flex growfund-items-center growfund-gap-2 growfund-typo-small growfund-text-fg-secondary",children:[s.jsx(a,{className:"growfund-w-4 growfund-h-4 growfund-text-icon-primary"}),s.jsx("span",{children:sprintf(
/* translators: %s: campaign start date */
__("Starts from %s","growfund"),j(new Date(r.start_date),l.HUMAN_READABLE_V2))})]})]}),r.has_goal&&g(R)?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"growfund-w-full growfund-max-w-[20rem]",children:s.jsx(p,{value:R.progress_percentage,className:"growfund-mt-1"})}),s.jsx("div",{className:"growfund-typo-paragraph growfund-font-medium growfund-text-fg-secondary",children:s.jsx("span",{className:"growfund-text-primary",dangerouslySetInnerHTML:{__html:R.goal_label}})})]}):s.jsxs("div",{className:"growfund-typo-paragraph growfund-font-medium  growfund-text-fg-secondary growfund-flex growfund-items-center growfund-gap-2",children:[s.jsx("span",{className:"growfund-text-primary",children:sprintf("%s raised",D(r.fund_raised??0))}),s.jsx(w,{}),s.jsx(n,{className:"growfund-size-3"}),s.jsx("span",{className:"growfund-typo-small",children:sprintf(C?
/* translators: %s: number of donors */_n("%s donor","%s donors",r.number_of_contributors??0,"growfund"):
/* translators: %s: number of backers */_n("%s backer","%s backers",r.number_of_contributors??0,"growfund"),r.number_of_contributors??0)})]})]}),s.jsxs("div",{className:"growfund-ms-auto growfund-opacity-0 growfund-transition-opacity group-hover/campaign-card:growfund-opacity-100",children:["bookmark"===_&&s.jsxs("div",{className:"growfund-flex growfund-flex-col growfund-gap-2",children:[s.jsx(m,{variant:"secondary",size:"icon",className:"",onClick:y,children:s.jsx(o,{})}),s.jsx(m,{variant:"secondary",size:"icon",onClick:()=>{r.preview_url&&window.open(r.preview_url,"_blank")},children:s.jsx(e,{})})]}),"edit"===_&&s.jsx(m,{variant:"secondary",size:"icon",className:"hover:growfund-text-icon-critical",onClick:v,children:s.jsx(d,{})}),N&&s.jsx(m,{variant:"secondary",size:"icon",className:"growfund-top-4 growfund-right-4",onClick:()=>{r.preview_url&&window.open(r.preview_url,"_blank")},children:s.jsx(i,{})})]})]})});export{v as C};
