1import{cB as xa,al as _a,am as Da,j as e,$ as pe,ar as Ca,dt as Aa,cG as Sa,g1 as Ke,i$ as kt,j0 as Ma,a2 as Ta,g7 as _e,aC as Se,a as S,X as cn,g as G,w as T,fI as za,bR as ie,c_ as z,dN as ne,j1 as Jn,db as Pa,ev as tt,bF as Ra,bq as at,iE as Oa,bN as Ia,ah as Ce,d$ as Ze,ck as La,bj as xt,bn as Ea,iC as Na,cg as Fa,t as P,e as Mn,y as Tn,z as Me,j2 as $a,bJ as Ut,F as Wt,a6 as Gt,b as Ae,i4 as Vt,ee as ln,ax as ge,aL as it,aO as Ba,ag as X,bp as Ua,iK as Wa,iL as Ga,c as zn,cW as qt,bA as _t,e6 as An,iG as Va,h as dn,i as ot,aG as qa,iH as Ya,hb as lt,hc as rt,B as C,A as F,j3 as Dt,bi as Hn,P as Xe,bh as un,cI as he,av as Ja,_ as L,d0 as rn,iM as Yt,u as Jt,aV as Ht,cL as Ha,j4 as Ct,G as I,c3 as Qn,dQ as Qa,ac as Kn,a4 as en,aX as At,aZ as Sn,aY as Ka,j5 as Za,az as oe,T as Fe,fe as Xa,bZ as es,aT as tn,aU as an,et as ns,cu as Qt,aF as ts,aH as jn,aJ as St,cK as Kt,cx as Zt,e0 as as,D as Xt,a3 as ea,bf as ss,em as is,j6 as os,S as ls,aw as Cn,C as rs,d8 as cs,fK as ds,c$ as na,aW as Mt,hp as ue,j7 as us,j8 as gs,d as ms,j9 as ps,c0 as hs,au as bs,ja as fs,c8 as vs,hq as wn,p as ys,dk as Zn,q as js,bB as ws,v as ks,b1 as xs,r as _s,J as Ds,I as Cs,K as As,dV as Ss,dW as Ms,aI as Tt}from"./index-DEpx10yq.js";import{m as H,r as d,z as Ts,F as w,dG as zs,dH as Ps,dI as Rs,dq as sn,aE as Os,dr as Is,b2 as Ls,b3 as Es,b4 as ta,ad as aa,ds as Ns,aR as Fs,b6 as ct,cK as zt,a8 as $s,b5 as Bs,bg as Us,cA as Pt,c0 as Rt,b$ as Ws,ai as Gs,ak as Vs,aj as qs,dJ as Ys,aF as Js,dK as Hs,d4 as Qs,dL as Ks,dM as Zs,b9 as sa,dN as Xs,bl as ei,dv as ni,dO as ti,dP as ai,aP as si}from"./vendor-BuXdE1tY.js";import{h as ii,i as oi,d as li,e as ri,j as Ot,E as ci,D as di,c as ui,k as gi,a as mi,I as pi}from"./delete.t10s-Cp1t35Cd.js";import{D as hi,b as bi,g as fi}from"./DeedCard-Do8iAJIm.js";import{g as vi}from"./googleMaps-z2dJlqbP.js";import{i as yi}from"./is-serial-DkWNSLiX.js";import{u as be,dL as ji,dM as wi,dN as ki,dO as It,dP as nn,dQ as De,dR as xi,dS as _i,dT as Di,dU as te,dV as Ci,dW as Xn,dX as ae}from"./app-4WdNMoJ4.js";import{Q as Ai}from"./index-CAW6CT9T.js";import{R as Si}from"./RichText-DbmvLbYm.js";import{R as Mi}from"./RoutedTabs-68_GNi1G.js";import{b as Ti,A as zi,D as Pi,a as Ri}from"./ApplyDialog-YetVH5lo.js";import{d as Oi}from"./deed-approval-Dd0tu4rg.js";import{c as Ii,S as Li,A as Ei,a as Ni,u as Fi,b as $i,d as Bi}from"./useDeedMutations-C1q60JfX.js";import{S as Ui,L as Lt}from"./StatusToolbar-CwU45fhf.js";import{C as Wi}from"./index-BqUEwSLX.js";import{u as ia}from"./useAccess-zZp0IcMv.js";import{u as me}from"./usePermission-qJgqIwNI.js";import{v as oa}from"./validateDeed-DPHne9H5.js";import{i as Gi}from"./interpolateMarkup-DX3E-omN.js";import{D as V}from"./deed-JK3bCACr.js";import{i as Vi}from"./index-CSVBsJyN.js";import{a as qi}from"./CustomForm-CrBvnwV7.js";import{T as Yi}from"./Textarea-CsRu8kHr.js";import{l as Ji}from"./UserMiniProfile-CMLN97Vb.js";import{n as Hi}from"./nl2br-C5jdqXmD.js";import{u as Qi}from"./useMediaQuery-DhIt8ezZ.js";import{g as Ki,b as Zi}from"./sdgs-BmO7BZQd.js";import{u as Xi}from"./tags.hooks-pTz7HNhG.js";import{B as kn}from"./Badge-Ww_xYfFV.js";import{u as eo,a as no}from"./useCreateReport-3KNRDBQW.js";import{F as to}from"./fathom-vsAwhi_q.js";import{c as la,d as ra,g as ao}from"./getDeedCommitment-BzyYFwSX.js";import{c as so,D as io,I as oo}from"./operations.graphql-BHTf06Qz.js";import{t as lo}from"./ImpactReportEditModal-DV1uy7SB.js";import{D as ro}from"./datatable-I8HG7-hD.js";import{p as co}from"./datatable.filters-DqaHv0qU.js";import{b as uo}from"./searchTypes-DYY2T-Bd.js";import{D as go}from"./DisplayMode-IJR9KcXt.js";import{u as mo}from"./usePostcodeGroups-cuGkbYMj.js";import{M as po}from"./EmailMembersForm-CEXOe-jB.js";import{s as ho}from"./login-BXphnDB1.js";import{S as bo}from"./Switch-CTzGdbiC.js";import{G as et}from"./Grid-OZQAAsvA.js";import"./dayjs-timezone-iana-plugin-BLhLpZHa.js";import"./useUpdateOrganization-ErtIWpIi.js";import"./CopyButton-CvvxWmcz.js";import"./Flex-Cz2seYrx.js";import"./useLatestRef-biBs-Fu4.js";import"./WYSIWYG-Cj-RNIvf.js";import"./EmptyState-CftI0Jl5.js";import"./index-DvsNzQ5Q.js";import"./Table-CCIknSsW.js";import"./use-local-storage-Ch15PQMJ.js";import"./Pagination-DYF9zM6h.js";import"./use-timeout-BPN527Yn.js";import"./applicationStatusColors-NtXGdHIU.js";import"./Conversation-CWrh47y3.js";import"./applications-CuypLuo4.js";import"./CircularProfile-DcTzsMWb.js";import"./zod-Bno7PSKN.js";import"./Timestamp-B0vioKD7.js";import"./Tags-CxRpTUPs.js";import"./memberships-DyHjVvT4.js";import"./DeedApplicationConversation--tdp0eiT.js";import"./FormElementResponseFiles-B8REMEJa.js";import"./FileTable-ZDZZFBUe.js";import"./useCopyToClipboard-BNhpxVxu.js";import"./postcode-groups-BDOWFdI1.js";import"./collapseNbsp-CzVL4EIi.js";import"./escapeHtml-BdoiWSbP.js";import"./useMyMembership-B1qpHCSB.js";import"./useRefetchOrgNavPendingDeeds-CReFwWp9.js";import"./operations.graphql-DwmI1lnB.js";import"./refetchApolloQueriesLogged-B9lnQ-P1.js";import"./SectionToggle-CfHpvxeI.js";import"./DeedSearch-NPLDp_oZ.js";import"./SearchSelect-DykwrxLV.js";import"./operations.graphql-uJOlIQbV.js";import"./operations.graphql-C0-m0XGS.js";import"./operations.graphql-CDxOkHau.js";import"./contract.graphql-BIxXReRC.js";import"./LazyFAIcon-C8rNEnh4.js";import"./RadioBoxGroup-BBBrI5vV.js";import"./Radio-Dul-dj0E.js";import"./index-Nv_vYGRG.js";import"./NoBadgeReCAPTCHA-lNk5xzVp.js";import"./recaptcha-wrapper-Clz23PAr.js";import"./S3UploadButton-DuMKqxR7.js";import"./get-env-0ZX7pgpg.js";import"./ResetPasswordForm-BjFN92Mv.js";import"./index-CuBUkoZP.js";import"./helpers-B9PHCvKt.js";import"./AddressFieldsInput-P-cJyvLH.js";import"./index.t10s-CuJ7C0V8.js";import"./DeedForm.t10s-D944V4i3.js";import"./OrganizationForm.t10s-CVuRtN-Q.js";import"./WhitelabelForm.t10s-Wv0ryTAP.js";import"./ReactQueryLoader-BmbOdIhF.js";import"./sectionKeys-C7RiTDXv.js";import"./url-BRe_NL2S.js";import"./admin-Ba69bkYW.js";import"./datatable.render.boolean-C27rsV68.js";import"./DeleteOrganizationModal-xm7X8vbO.js";import"./WhitelabelTag-QkJCnXQd.js";import"./useStableSearchParams-BuRP1zXw.js";import"./datatable.filter.simple-DlFxq7wb.js";import"./index.module-B2xiHG4i.js";import"./NumberInput-BOq_lphe.js";import"./datatable.filter.deedType-Cqw1LewL.js";import"./datatable.filter.singleSelect-C2r-U3LG.js";import"./OrganizationSearch-BbuOmdeE.js";
1import"./TimeInput-CgwSoDq5.js";import"./isEqual-BjC-lMWr.js";import"./useQueryState-ByUA0Ag3.js";import"./Alert-BEGMTx-U.js";try{let n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="2ed3cfb3-36f0-451d-9bd0-ae89ff5d3df4",n._sentryDebugIdIdentifier="sentry-dbid-2ed3cfb3-36f0-451d-9bd0-ae89ff5d3df4")}catch{}var ca={root:"m_7341320d"};const fo=Ca((n,{size:a,radius:s,variant:i,gradient:o,color:t,autoContrast:l})=>{const u=n.variantColorResolver({color:t||n.primaryColor,theme:n,gradient:o,variant:i||"filled",autoContrast:l});return{root:{"--ti-size":Sa(a,"ti-size"),"--ti-radius":s===void 0?void 0:Aa(s),"--ti-bg":t||i?u.background:void 0,"--ti-color":t||i?u.color:void 0,"--ti-bd":t||i?u.border:void 0}}}),dt=xa((n,a)=>{const s=_a("ThemeIcon",null,n),{classNames:i,className:o,style:t,styles:l,unstyled:u,vars:r,autoContrast:h,attributes:m,...b}=s,g=Da({name:"ThemeIcon",classes:ca,props:s,className:o,style:t,classNames:i,styles:l,unstyled:u,attributes:m,vars:r,varsResolver:fo});return e.jsx(pe,{ref:a,...g("root"),...b})});dt.classes=ca;dt.displayName="@mantine/core/ThemeIcon";var vo=["refetch","reobserve","fetchMore","updateQuery","startPolling","subscribeToMore"];function yo(n,a){var s,i=Ke.useRef(),o=Ke.useRef(),t=Ke.useRef(),l=kt(a,i.current||{}),u=(s=l?.query)!==null&&s!==void 0?s:n;o.current=a,t.current=u;var r=Ma(Ta(a&&a.client),u),h=r.useQuery(_e(_e({},l),{skip:!i.current})),m=h.observable.options.initialFetchPolicy||r.getDefaultFetchPolicy(),b=Object.assign(h,{called:!!i.current}),g=Ke.useMemo(function(){for(var c={},D=function(j){var x=b[j];c[j]=function(){return i.current||(i.current=Object.create(null),r.forceUpdateState()),x.apply(this,arguments)}},v=0,p=vo;v<p.length;v++){var y=p[v];D(y)}return c},[]);Object.assign(b,g);var k=Ke.useCallback(function(c){i.current=c?_e(_e({},c),{fetchPolicy:c.fetchPolicy||m}):{fetchPolicy:m};var D=kt(o.current,_e({query:t.current},i.current)),v=r.executeQuery(_e(_e({},D),{skip:!1})).then(function(p){return Object.assign(p,g)});return v.catch(function(){}),v},[]);return[k,b]}const jo=({children:n,style:a={},className:s=void 0,...i})=>e.jsx("div",{className:Se(be.flex,s),style:a,...i,children:H.Children.map(n,o=>H.isValidElement(o)?H.cloneElement(o,{style:{display:"flex",justifyContent:"center",alignContent:"center",flexDirection:"column"}}):o)}),Et=({children:n,className:a,...s})=>e.jsx("div",{...s,className:Se(ji.noscreen,a),children:n}),wo=({children:n,className:a,...s})=>e.jsx("div",{...s,className:Se(wi.onlyPrint,a),children:n}),ko={en:"Scan me or visit %{url} to join",nl:"Scan me of ga naar %{url} om je aan te melden"},xo={scanMe:ko},_o=n=>{const a=S(xo),s=cn(),o=`${G().url}${s.pathname}${s.search}${s.hash}`;return e.jsxs("div",{className:ki.container,children:[e.jsx(Ai,{value:o,size:96,bgColor:"#ffffff",fgColor:"#000000",level:"L",includeMargin:!1,renderAs:"svg",style:{marginRight:16,flexShrink:0}}),e.jsxs(T,{size:"sm",children:[n.additionalText,e.jsx("br",{}),a("scanMe",{url:o})]})]})};function Do(n){return null}const Pn=6,Co=24,da=n=>typeof n!="number"||!Number.isFinite(n)?Pn:Math.min(Math.max(Math.floor(n),1),Co),xn=n=>new Date(n.year,n.month-1,n.day,0,0,0,0),O=n=>ie().year(n.year).month(n.month-1).date(n.day).startOf("day"),nt=n=>({year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate()}),$e=n=>({year:n.year(),month:n.month()+1,day:n.date()}),Ao=(n,a)=>n.year===a.year&&n.month===a.month&&n.day===a.day,Nt=z.object({year:z.number().int(),month:z.number().int(),day:z.number().int()}),st=(n,a,s=Pn)=>{const i=ie(a?.add(1,"day")).startOf("day"),o=i.add(s,"month").endOf("day"),t=ie.max(O(n),i);return{minPlainDate:$e(i),maxPlainDate:$e(o),minEndPlainDate:$e(t)}},So=(n=Pn)=>z.object({title:z.string().min(1),startOnDate:Nt,recurrence:z.discriminatedUnion("unit",[z.object({unit:z.literal("week"),every:z.number().min(1),weekDays:z.object({0:z.boolean(),1:z.boolean(),2:z.boolean(),3:z.boolean(),4:z.boolean(),5:z.boolean(),6:z.boolean()})}),z.object({unit:z.literal("month"),every:z.number().min(1),mode:z.union([z.literal("nth"),z.literal("last")])})]),endOnDate:Nt,relativeRsvpCloses:z.boolean().nullable()}).refine(a=>{const s=O(a.startOnDate),i=O(a.endOnDate);return s.isBefore(i,"day")},{message:ne.end_date_before_start_date,path:["endOnDate"]}).refine(a=>{const{minPlainDate:s,maxPlainDate:i}=st(a.startOnDate,void 0,n),o=O(a.startOnDate);return!o.isBefore(O(s),"day")&&!o.isAfter(O(i),"day")},{message:ne.date_range_between_now_and_n_months,path:["startOnDate"],params:{months:n}}).refine(a=>{const{minPlainDate:s,maxPlainDate:i}=st(a.startOnDate,void 0,n),o=O(a.endOnDate);return!o.isBefore(O(s),"day")&&!o.isAfter(O(i),"day")},{message:ne.date_range_between_now_and_n_months,path:["endOnDate"],params:{months:n}}).superRefine((a,s)=>{if(a.recurrence.unit!=="week")return;let i=!0;
1if(a.startOnDate){const t=O(a.startOnDate).day();a.recurrence.weekDays[t]||(i=!1)}let o=!0;if(a.endOnDate){const t=O(a.endOnDate).day();a.recurrence.weekDays[t]||(o=!1)}!i&&!o?s.addIssue({code:Jn.custom,message:ne.start_on_date_end_on_date_weekdays_must_be_selected,path:["recurrence"]}):i?o||s.addIssue({code:Jn.custom,message:ne.end_on_date_weekday_must_be_selected,path:["recurrence"]}):s.addIssue({code:Jn.custom,message:ne.start_on_date_weekday_must_be_selected,path:["recurrence"]})}).refine(a=>a.recurrence.unit!=="month"||a.recurrence.mode!=="nth"?!0:Rn(a.startOnDate)<4,{message:ne.monthly_nth_can_only_be_selected_for_first_4_weekdays,path:["endOnDate"]}).refine(a=>a.recurrence.unit!=="month"||a.recurrence.mode!=="last"?!0:ut(a.startOnDate),{message:ne.monthly_last_can_only_be_selected_for_last_weekday,path:["endOnDate"]}).refine(a=>{const s=gt(a.startOnDate,a.endOnDate,a.recurrence,n),i=s[s.length-1];return i&&Ao(i,a.endOnDate)},{message:ne.end_date_not_in_recurrence_result,path:["endOnDate"]}),Mo=n=>{if(n.member_created||n.p2p)return{result:!1,reason:"memberCreatedOrP2p"};if(za.includes(n.subtype))return{result:!1,reason:"subtype"};if(!n.date_ending)return{result:!1,reason:"noDateEnding"};if(n.date_starting){const a=ie(n.date_starting),s=ie(n.date_ending);if(!a.isSame(s,"day"))return{result:!1,reason:"noSameDay"}}return n.published?{result:!0}:{result:!1,reason:"notPublished"}},Rn=n=>{const a=O(n);return Math.floor((a.date()-1)/7)},ut=n=>{const a=O(n);return a.daysInMonth()<=a.date()-1+7},ua=(n,a,s,i)=>{const o=ie().year(n).month(a).startOf("month"),t=o.endOf("month"),l=o.day(s),u=l.isBefore(o,"month")?l.add(1,"week"):l.isAfter(t,"month")?l.subtract(1,"week"):l;return $e(u.add(i,"week"))},To=(n,a,s)=>{const i=ua(n,a+1,s,0);return $e(O(i).subtract(1,"week"))},gt=(n,a,s,i=Pn)=>{if(!s.every)return[];const o=da(i)*31,t=O(n),l=O(a);switch(s.unit){case"month":switch(s.mode){case"nth":{const u=Rn(n),r=[];for(let h=0;;h+=s.every){const m=ua(t.year(),t.month()+h,t.day(),u);if(O(m).isAfter(l))return r;if(r.push(m),r.length>o)throw new Error("Too many recurrence dates generated")}}case"last":{const u=[];for(let r=0;;r+=s.every){const h=To(t.year(),t.month()+r,t.day());if(O(h).isAfter(l))return u;if(u.push(h),u.length>o)throw new Error("Too many recurrence dates generated")}}default:throw new Error(`Unknown mode: ${s.mode.toString()}`)}case"week":{const u=Object.entries(s.weekDays).filter(([,h])=>h).map(([h])=>(parseInt(h,10)-t.day()+7)%7).sort();if(u.length===0)return[];const r=[];for(let h=0;;h+=s.every)for(const m of u){const b=t.add(m,"days").add(h,"weeks");if(b.isAfter(l))return r;if(r.push($e(b)),r.length>o)throw new Error("Too many recurrence dates generated")}}default:throw new Error(`Unknown unit: ${s.unit.toString()}`)}},zo={en:"Back to recurrence settings",nl:"Terug naar instellingen voor herhalingen"},Po={en:"Cancel",nl:"Annuleren"},Ro={en:"Proceed to date confirmation",nl:"Ga door naar datumbevestiging"},Oo={en:"Copy %{g:deed} recurrently",nl:"Kopieer %{g:deed} terugkerend"},Io={en:'This will create the recurring %{g:deeds} inside the existing group "<group-link>%{groupTitle}</group-link>".',nl:"Hiermee wordt de terugkerende %{g:deeds} in de bestaande groep <group-link>%{groupTitle}</group-link> aangemaakt."},Lo={en:"This will create the recurring %{g:deeds} in a new group.",nl:"Hiermee wordt de terugkerende %{g:deeds} in een nieuwe groep aangemaakt."},Eo={en:"Create recurring %{g:deeds}",nl:"Maak terugkerende %{g:deeds} aan"},No={en:"Recurring %{g:deeds} successfully created!",nl:"Terugkerende %{g:deeds} succesvol aangemaakt!"},Fo={backLabel:zo,cancelLabel:Po,confirmLabel:Ro,dialogTitle:Oo,disclaimerAlreadyInGroup:Io,disclaimerNotInAGroup:Lo,submitLabel:Eo,successMessage:No},$o={en:"Please review that the following dates are correct.",nl:"Controleer of de volgende data correct zijn."},Bo={en:'Once clicking on "Create recurring %{g:deeds}" the source %{g:deed} will be copied into the following dates for a total of %{total} new %{g:deeds}:',nl:'Als je op "maak terugkerende%{g:deeds}" klikt, wordt de originele %{g:deed} %{total} keer gekopieerd.'}
1,Uo={confirmExplainer1:$o,confirmExplainer2:Bo},Wo=n=>{const a=S(Uo),[s,i,o]=n.form.watch(["startOnDate","recurrence","endOnDate"]),t=d.useMemo(()=>gt(s,o,i,n.allowFutureMonths).map(l=>O(l)),[s,o,i,n.allowFutureMonths]);return e.jsxs("div",{className:It.outerWrapper,children:[e.jsx("p",{children:a("confirmExplainer1")}),e.jsx("p",{children:a("confirmExplainer2",{total:t.length})}),e.jsx("ul",{className:It.datesList,children:t.map(l=>e.jsx("li",{children:l.format("LL (dddd)")},l.toISOString()))})]})},Go={en:"Every",nl:"Elke"},Vo={en:"on the last %{weekday} of the month",nl:"op de laatste %{weekday} van de maand"},qo={en:"on the %{nth} %{weekday} of the month",nl:"op de %{nth} %{weekday} van de maand"},Yo={en:"1st",nl:"1e"},Jo={en:"2nd",nl:"2e"},Ho={en:"3rd",nl:"3e"},Qo={en:"4th",nl:"4e"},Ko={en:"on the last %{weekday} of the month",nl:"op de laatste %{weekday} van de maand"},Zo={en:"on the %{nth} %{weekday} of the month",nl:"op de %{nth} %{weekday} van de maand"},Xo={en:"on weekdays:",nl:"op weekdagen:"},el={en:"month |||| months",nl:"maand |||| maanden"},nl={en:"week |||| weeks",nl:"week |||| weken"},tl={every:Go,mode_last_label:Vo,mode_nth_label:qo,nth_0:Yo,nth_1:Jo,nth_2:Ho,nth_3:Qo,onMonthLast:Ko,onMonthNth:Zo,onWeekDays:Xo,unit_month_label:el,unit_week_label:nl},al={en:"S",nl:"S"},sl={en:"M",nl:"M"},il={en:"T",nl:"D"},ol={en:"W",nl:"W"},ll={en:"T",nl:"D"},rl={en:"F",nl:"V"},cl={en:"S",nl:"Z"},dl={buttonLabel_0:al,buttonLabel_1:sl,buttonLabel_2:il,buttonLabel_3:ol,buttonLabel_4:ll,buttonLabel_5:rl,buttonLabel_6:cl},ul=n=>{const a=n.onChange,s=d.useCallback((i,o)=>{a({...n.value,[i]:o})},[a,n.value]);return e.jsx("div",{className:Se(nn.buttonsWrapper,n.className),children:Array(7).fill(void 0).map((i,o)=>{const t=(o+1+7)%7;return e.jsx(gl,{weekday:t,isSelected:n.value[t],onChange:s,invalid:n.invalid,isDisabled:n.isDisabled},o)})})},gl=n=>{const a=S(dl),s=n.onChange,i=d.useCallback(()=>{s(n.weekday,!n.isSelected)},[s,n.isSelected,n.weekday]);return e.jsx("button",{type:"button",onClick:i,className:Se(nn.button,{[nn.selected]:n.isSelected,[nn.invalid]:n.invalid,[nn.disabled]:n.isDisabled}),children:a(`buttonLabel_${n.weekday}`)})},ml=n=>{const a=S(tl),s=n.onChange,i=d.useCallback(m=>{s({...n.value,every:m})},[s,n.value]),o=d.useCallback(m=>{switch(m){case"week":switch(n.value.unit){case"week":return;case"month":{s({every:n.value.every,unit:"week",weekDays:n.initialWeekdays??{0:!1,1:!1,2:!1,3:!1,4:!1,5:!1,6:!1}});return}default:throw new Error(`Unknown props.value.unit: ${n.value.unit.toString()}`)}case"month":switch(n.value.unit){case"week":{s({every:n.value.every,unit:"month",mode:"nth"});return}case"month":return;default:throw new Error(`Unknown props.value.unit: ${n.value.unit.toString()}`)}default:throw new Error(`Unknown unit: ${m.toString()}`)}},[s,n.value,n.initialWeekdays]),t=d.useCallback(m=>{switch(n.value.unit){case"week":{s({...n.value,weekDays:m});return}case"month":throw new Error("Tried to set weekday on month recurrence");default:throw new Error(`Unknown props.value.unit: ${n.value.unit.toString()}`)}},[s,n.value]),l=d.useMemo(()=>[{value:"week",label:a("unit_week_label",{smart_count:n.value.every})},{value:"month",label:a("unit_month_label",{smart_count:n.value.every})}],[a,n.value.every]),u=Pa(),r=d.useMemo(()=>{if(n.value.unit!=="month")return null;const m=O(n.startOnDate),b=Rn(n.startOnDate),g=ut(n.startOnDate),k=m.locale(u).format("dddd");return{nth:b,isLast:g,weekday:k,modeOptions:g&&b!==4?[{value:"nth",label:a("mode_nth_label",{nth:a(`nth_${b}`),weekday:k})},{value:"last",label:a("mode_last_label",{weekday:k})}]:null}},[a,n.startOnDate,n.value.unit,u]),h=d.useCallback(m=>{if(n.value.unit!=="month")throw new Error("Tried to set monthly mode on non-monthly recurrence");s({...n.value,mode:m})},[s,n.value]);return e.jsxs("fieldset",{id:n.inputId,"aria-labelledby":n.labelTextId,className:De.fieldset,onBlur:n.onBlur,ref:n.ref,children:[e.jsx(tt,{required:!0,passes:!n.invalid,message:n.invalidMessage}),e.jsx("span",{className:De.every,children:a("every")}),e.jsx(Ra,{required:!0,disabled:n.isDisabled,className:De.everyInput,inputClassName:De.everyInput,value:n.value.every,onChange:i,min:1,invalid:n.invalid}),e.jsx(at,{required:!0,disabled:n.isDisabled,options:l,value:n.value.unit,onChange:o,error:n.invalid}),n.value.unit==="week"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:De.weekdayClarifyText,children:a("onWeekDays")}
1),e.jsx(ul,{value:n.value.weekDays,onChange:t,invalid:n.invalid,isDisabled:n.isDisabled})]}):null,n.value.unit==="month"&&r?r.modeOptions?e.jsx(at,{required:!0,disabled:n.isDisabled,options:r.modeOptions,value:n.value.mode,onChange:h,error:n.invalid}):r.nth===4?e.jsx("span",{className:De.weekdayClarifyText,children:a("onMonthLast",{weekday:r.weekday})}):e.jsx("span",{className:De.weekdayClarifyText,children:a("onMonthNth",{nth:a(`nth_${r.nth}`),weekday:r.weekday})}):null]})},pl={en:"Will adjust the following selected dates relative to the recurrence. If left unchecked, the date will be copied as-is from the original %{g:deed} (without any adjustments).",nl:"Zal de volgende geselecteerde datums aanpassen op basis van de ingestelde herhaling. Als deze optie niet is ingeschakeld, wordt de datum gekopieerd van de originele %{g:deed} (zonder enige aanpassingen)."},hl={en:"Adjust dates relative to recurrence",nl:"Datums aanpassen ten opzichte van de herhaling"},bl={en:"Date of the last (including) recurring %{g:deed} to create (up to %{months} months ahead).",nl:"Datum van laatste (inbegrepen) terugkerende %{g:deed} (tot %{months} maanden vooruit)."},fl={en:"End recurrence on",nl:"Stop herhaling op"},vl={en:"Applications closing date",nl:"Sluitingsdatum voor aanmeldingen"},yl={en:"Date of the first recurring %{g:deed} to create (up to %{months} months ahead).",nl:"Datum van de eerste terugkerende %{g:deed} die wordt aangemaakt (tot %{months} maanden vooruit)."},jl={en:"Start recurrence on",nl:"Start herhaling op"},wl={en:"Group title",nl:"Groepstitel"},kl={en:"e.g. My recurring %{g:deeds}",nl:"bijv. Mijn terugkerende %{g:deeds}"},xl={en:"Recurrence settings",nl:"Instellingen voor herhalingen"},_l={fieldGroup_relativeDates_help:pl,fieldGroup_relativeDates_label:hl,field_endOnDate_help:bl,field_endOnDate_label:fl,field_relativeRsvpCloses_label:vl,field_startOnDate_help:yl,field_startOnDate_label:jl,field_title_label:wl,field_title_placeholder:kl,fieldgroup_recurrence_label:xl},Dl=n=>`${n.getFullYear()}-${n.getMonth()}-${n.getDate()}`,Cl=n=>`${n.year}-${n.month-1}-${n.day}`,Al=n=>{const a=S(_l),s=Oa(),i=Ia({isVisible:!0}),[o,t,l]=n.form.watch(["startOnDate","recurrence","endOnDate"]),u=d.useMemo(()=>o??nt(new Date),[o]),{minPlainDate:r,maxPlainDate:h,minEndPlainDate:m}=d.useMemo(()=>st(u,n.deedDate,n.allowFutureMonths),[u,n.deedDate,n.allowFutureMonths]),b=d.useMemo(()=>O(r).toDate(),[r]),g=d.useMemo(()=>O(h).toDate(),[h]),k=d.useMemo(()=>O(m).toDate(),[m]),c=d.useMemo(()=>{const y=O(u).day(),j=l?O(l).day():null;return{0:y===0||j===0,1:y===1||j===1,2:y===2||j===2,3:y===3||j===3,4:y===4||j===4,5:y===5||j===5,6:y===6||j===6}},[u,l]),D=d.useMemo(()=>{if(t.unit!=="month"||o===null)return t;const y=Rn(o),j=ut(o);return t.mode==="last"&&!j?{...t,mode:"nth"}:t.mode==="nth"&&y===4?{...t,mode:"last"}:t},[t,o]);d.useEffect(()=>{D!==t&&n.form.setValue("recurrence",D,{shouldValidate:!0,shouldDirty:!0})},[D,t,n.form]);const{earliestNonStartDate:v,resultingPlainDates:p}=d.useMemo(()=>{if(o===null)return{earliestNonStartDate:null,resultingPlainDates:null};const y=gt(o,h,D,n.allowFutureMonths);return y.length===0?{earliestNonStartDate:null,resultingPlainDates:null}:{earliestNonStartDate:y[1]?xn(y[1]):xn(y[0]),resultingPlainDates:Object.fromEntries(y.map(j=>[Cl(j),!0]))}},[D,o,h,n.allowFutureMonths]);return e.jsx("div",{style:{zIndex:i},children:e.jsxs(Ts,{autoFocus:!0,children:[n.existingDeedGroup===null&&e.jsx(Ce,{label:a("field_title_label"),required:!0,children:({inputId:y})=>e.jsx(Ze,{name:"title",render:({field:j,fieldState:x})=>e.jsx(La,{id:y,required:!0,disabled:n.form.formState.isSubmitting,...j,placeholder:a("field_title_placeholder"),invalid:!!x.error,invalidMessage:x.error?s(x.error):void 0})})}),e.jsx(Ce,{label:a("field_startOnDate_label"),help:a("field_startOnDate_help",{months:n.allowFutureMonths}),required:!0,children:({inputId:y})=>e.jsx(Ze,{name:"startOnDate",render:({field:{ref:j,...x},fieldState:_})=>e.jsxs(e.Fragment,{children:[e.jsx(tt,{required:!0,passes:!_.error,message:_.error?s(_.error):void 0}),e.jsx(xt,{textInputProps:{id:y},disabled:n.form.formState.isSubmitting,required:!0,...x,value:x.value?xn(x.value):null,onChange:R=>{x.onChange(R&&nt(R)),n.form.trigger("recurrence")},textInputRef:j,fromMonth:b,toMonth:g,minDate:b,maxDate:g,invali
1d:!!_.error,setTimeMidnight:!0})]})})}),e.jsx(Ce,{label:a("fieldgroup_recurrence_label"),required:!0,children:({inputId:y,labelTextId:j})=>e.jsx(Ze,{name:"recurrence",render:({field:x,fieldState:_})=>e.jsx(ml,{startOnDate:u,inputId:y,labelTextId:j,isDisabled:n.form.formState.isSubmitting,...x,initialWeekdays:c,ref:x.ref,invalid:!!_.error,invalidMessage:_.error?s(_.error):void 0})})}),e.jsx(Ce,{label:a("field_endOnDate_label"),help:a("field_endOnDate_help",{months:n.allowFutureMonths}),required:!0,children:({inputId:y})=>e.jsx(Ze,{name:"endOnDate",render:({field:{ref:j,...x},fieldState:_})=>e.jsxs(e.Fragment,{children:[e.jsx(tt,{required:!0,passes:!_.error,message:_.error?s(_.error):void 0}),e.jsx(xt,{textInputProps:{id:y},disabled:n.form.formState.isSubmitting,required:!0,...x,value:x.value?xn(x.value):null,onChange:R=>{x.onChange(R&&nt(R)),n.form.trigger("recurrence")},textInputRef:j,fromMonth:k,toMonth:g,minDate:v??k,maxDate:g,initialMonth:v??k,invalid:!!_.error,setTimeMidnight:!0,isDateDisabledFn:R=>p!==null&&!p[Dl(R)]})]})})}),n.hasRelativeRsvpCloses?e.jsx(Ce,{label:a("fieldGroup_relativeDates_label"),help:a("fieldGroup_relativeDates_help"),children:({inputId:y,labelTextId:j})=>e.jsx("fieldset",{id:y,"aria-labelledby":j,className:xi.fieldset,children:e.jsx(Ze,{name:"relativeRsvpCloses",render:({field:{ref:x,..._},fieldState:R})=>e.jsx(Ea,{disabled:n.form.formState.isSubmitting,ref:x,..._,invali
1d:!!R.error,invalidMessage:R.error?s(R.error):void 0,children:a("field_relativeRsvpCloses_label")})})})}):null]})})},Ft="CREATE_DEED_RECURRENCE_FORM",Sl=n=>{const a=S(Fo),s=G(),i=da(s.whitelabel.settings.recurring_deeds_future_months),o=d.useMemo(()=>Na(So(i)),[i]),t=Fa({defaultValues:{title:n.initialGroupTitle,startOnDate:null,recurrence:{every:1,unit:"month",mode:"nth"},endOnDate:null,relativeRsvpCloses:n.hasRsvpCloses?!0:null},resolver:o}),[l,u]=d.useState("form"),r=P.useUtils(),h=Mn(),m=Tn(),b=Me(),g=n.onSuccess,k=P.deeds.recur.useMutation({onSuccess:async y=>{m({message:a("successMessage")})(y),await r.deeds.get.invalidate({id:n.deedId}),h($a(y.deedGroup)),g(y.deedGroup.id)},onError:b()}),c=d.useCallback(async y=>{const j=y;switch(l){case"form":{u("confirm");return}case"confirm":{await k.mutateAsync({id:n.deedId,...j});break}default:throw new Error(`Invalid step: ${l.toString()}`)}},[l,k,n.deedId]),D=d.useCallback(()=>{u("confirm")},[]),v=d.useCallback(()=>{u("form")},[]),p=n.existingDeedGroup;return e.jsx(Ut,{open:!0,title:a("dialogTitle"),mode:"confirm",showDismissButton:!t.formState.isSubmitting,okButtonProps:{type:"submit",form:Ft},onOk:l==="form"?D:void 0,okButtonLabel:a(l==="confirm"?"submitLabel":"confirmLabel"),onCancel:l==="confirm"?v:n.onCancel,cancelButtonLabel:a(l==="confirm"?"backLabel":"cancelLabel"),overlayOptions:{isDismissable:!t.formState.isSubmitting},isConfirming:t.formState.isSubmitting,forceHasCancelButton:!0,children:e.jsxs(Wt,{id:Ft,className:"form",reactHookForm:!0,form:t,onSubmit:t.handleSubmit(c),children:[e.jsx(Gt,{status:"warning",children:e.jsx("p",{children:p===null?a("disclaimerNotInAGroup"):Gi(a("disclaimerAlreadyInGroup",{groupTitle:p.title}),{"group-link":y=>e.jsx(Ae,{to:Vt({organizationSlug:n.organizationSlug,deedsTranslation:ln(s.whitelabel,a.locale),deedGroupId:p.id}),target:"_blank",children:y})})})}),l==="form"&&e.jsx(Al,{form:t,deedId:n.deedId,deedDate:n.deedDate,hasRelativeRsvpCloses:n.hasRsvpCloses,existingDeedGroup:n.existingDeedGroup,allowFutureMonths:i}),l==="confirm"&&e.jsx(Wo,{form:t,allowFutureMonths:i})]})})},Ml={en:"Admin Tools: ",nl:"Admin Tools: "},Tl={en:"Applications",nl:"Aanmeldingen"},zl={en:"To reopen applications change the application closing date in the application options section of the edit %{g:deed | capitalize} form",nl:"Om aanmeldingen te heropenen verander je de sluitingsdatum in het aanmeldingsopties gedeelte van %{g:theDeed} %{g:deed | capitalize} aanmaak / bewerk formulier. "},Pl={en:"Applications are closed, and the %{g:deed} is upcoming",nl:"Aanmeldingen zijn gesloten, %{g:theDeed} %{g:deed | capitalize} is aanstaande"},Rl={en:"This %{g:deed} is hidden and volunteers cannot see it and cannot apply to it",nl:"%{g:thisDeed | capitalize} %{g:deed} is verborgen en vrijwilligers kunnen hem niet zien en er geen aanvraag voor indienen"},Ol={en:"Archived",nl:"Gearchiveerd"},Il={en:"Are you sure you want to archive this %{g:deed}? Volunteers won't be able to find it anymore and we will send a cancellation email to any attendees if this %{g:deed} is open.",nl:"Weet u zeker dat u %{g:thisDeed} %{g:deed} wilt archiveren? Vrijwilligers zullen het niet meer kunnen vinden en we zullen een annuleringsmail sturen naar alle deelnemer
1s als %{g:thisDeed} %{g:deed} open is."},Ll={en:"Are you sure you want to unarchive this %{g:deed}? This %{g:deed} will be return to your drafts",nl:"Weet u zeker dat u %{g:thisDeed} %{g:deed} wilt unarchiveren? %{g:thisDeed | capitalize} %{g:deed} zal worden teruggezet naar uw ontwerpen"},El={en:"Are you sure you want to unarchive this %{g:deed}? This %{g:deed} will be published",nl:"Weet je zeker dat je %{g:thisDeed} %{g:deed} wilt unarchiveren? %{g:thisDeed | capitalize} %{g:deed} zal worden gepubliceerd"},Nl={en:"Attendees",nl:"Deelnemers"},Fl={en:"Assign %{g:deed}",nl:"Toewijzen %{g:deed}"},$l={en:"Suggest %{g:deed}",nl:"Suggereer %{g:thisDeed} %{g:deed}"},Bl={en:"Cancel",nl:"Annuleren"},Ul={en:"Delete",nl:"Verwijderen"},Wl={en:"Delete",nl:"Annuleer"},Gl={en:"Are you sure you want to cancel the %{g:deed}?",nl:"Ben je zeker dat je %{g:theDeed} %{g:deed} wilt verwijderen?"},Vl={en:"Cancel",nl:"Annuleren"},ql={en:"Cannot Publish",nl:"Kan niet publiceren"},Yl={en:`Cannot Publish because: 2`,nl:`Kan niet publiceren omdat: 3`},Jl={en:"Re-opening applications will disable capacity checking. You will be able to enable it again by editing the %{g:deed}.",nl:"Aanmeldingen heropenen "},Hl={en:"Copy recurrently",nl:"Kopieer terugkerend"},Ql={en:"Recurrence is not supported for member-created or P2P %{g:deeds}.",nl:"Herhaling wordt niet ondersteund voor door leden gemaakte of P2P %{g:deeds}."},Kl={en:"Recurrence is only available for single-day events and tasks with an end date.",nl:"Herhaling is alleen beschikbaar voor gebeurtenissen van één dag en taken met een einddatum."},Zl={en:"Recurrence is only available for single-day events and tasks with an end date.",nl:"Herhaling is alleen beschikbaar voor evenementen van 1 dag en taken met een einddatum."},Xl={en:"Recurrence is only available for published %{g:deeds}.",nl:"Herhaling is alleen beschikbaar voor gepubliceerde %{g:deeds}."},er={en:"Recurrence is only available for single-day events and tasks with an end date.",nl:"Herhaling is alleen beschikbaar voor evenementen van 1 dag en taken met een einddatum."},nr={en:"No",nl:"Nee"},tr={en:"Cancel",nl:"Nee"},ar={en:"Your %{g:deed} has been saved, but isn't published yet. Press Edit to publish your %{g:deed}.",nl:"Je %{g:deed} is opgeslagen, maar is nog niet gepubliceerd. Bewerk je %{g:deed} om deze te publiceren."},sr={en:"Draft Mode",nl:"Ontwerp Modus"},ir={en:"This %{g:deed} is hidden and volunteers cannot see it and cannot apply to it",nl:"%{g:thisDeed | capitalize} %{g:deed} is verborgen en vrijwilligers kunnen hem niet zien en er geen aanvraag voor indienen"},or={en:"Draft Mode",nl:"Conceptmodus"},lr={en:"Duplicate",nl:"Dupliceren"},rr={en:"Edit",nl:"Bewerk"},cr={en:"Edit",nl:"Bewerk"},dr={en:"This %{type} expired %{days} days ago.",nl:"%{type | capitalize} is %{days} dagen geleden verlopen."},ur={en:"Your %{g:deed} is expired and unlisted in search. Reopen your %{g:deed} or create a new %{g:deed} to reach more volunteers.",nl:"Je %{g:deed} is verlopen en komt niet meer voor in de zoekresultaten. Heropen je %{g:deed} voor aanmeldingen of creëer een nieuwe %{g:deed} om meer vrijwilligers te bereiken."},gr={en:"%{g:deed | capitalize} expired",nl:"%{g:deed | capitalize} verlopen"},mr={en:"This %{type} expires in %{days} days.",nl:"%{thisType.nl | capitalize} %{type} verloopt over %{days} dagen."},pr={en:"Extend for %{days} days",nl:"Verlengen voor %{days} dagen"},hr={en:"Your %{g:deed} is filled and unlisted in search. Duplicate your %{g:deed} or create a new %{g:deed} to find more volunteers.",nl:"Je %{g:deed} is gevuld en niet meer zichtbaar als zoekresultaat. Dupliceer %{g:theDeed} %{g:deed} of maak een nieuwe %{g:deed} om meer vrijwilligers te vinden."},br={en:"%{g:deed | capitalize} filled",nl:"%{g:deed | capitalize} vervuld"},fr={en:"Your %{g:deed} is filled and unlisted in search. Reopen your %{g:deed} or create a new %{g:deed} to reach more volunteers.",nl:"Je %{g:deed} is vervuld en komt niet meer voor in de zoekresultaten. Heropen je %{g:deed} voor aanmeldingen of creeër een nieuwe %{g:deed} om meer vrijwilligers te bereiken."}
3,vr={en:"%{g:deed | capitalize} filled",nl:"%{g:deed | capitalize} vervuld"},yr={en:"Your %{g:deed} has been saved, but isn't published yet. Press Edit to publish your %{g:deed}.",nl:"Je %{g:deed} is opgeslagen, maar is nog niet gepubliceerd. Bewerk je %{g:deed} om deze te publiceren."},jr={en:"Draft Mode",nl:"Ontwerp Modus"},wr={en:"Invite",nl:"Nodig uit"},kr={en:"Mark as filled",nl:"Markeren als vervuld"},xr={en:"Re-open applications",nl:"Markeren als open"},_r={en:`%{g:deed | capitalize} must start in the future 4`,nl:`%{g:deed | capitalize} moet in de toekomst zijn 5`},Dr={en:"Open in CRM",nl:"Openen in CRM"},Cr={en:"Your %{g:deed} is now publicly visible. Promote your %{g:deed} on social media or by email to get more applications!",nl:"Jouw %{g:deed} is nu zichtbaar voor iedereen. Promoot je %{g:deed} op sociale media of via e-mail om meer aanmeldingen te krijgen!"},Ar={en:"Your %{g:deed} is now publicly visible. Promote your %{g:deed} by email to get more applications!",nl:"Jouw %{g:deed} is nu zichtbaar voor iedereen. Promoot je %{g:deed} via e-mail om meer aanmeldingen te krijgen!"},Sr={en:"Published",nl:"Gepubliceerd"},Mr={en:"Your %{g:organization} is not yet approved",nl:"Uw %{g:organization} is nog niet geaccepteerd"},Tr={en:"Applications have closed for this %{g:deed | capitalize}, as the starting date has come and gone.",nl:"Aanmeldingen voor %{g:thisDeed} %{g:deed | capitalize} zijn gesloten, de startdatum is in het verleden."},zr={en:"%{g:deed | capitalize} has occurred or started",nl:"%{g:deed | capitalize} heeft plaatsgevonden of is begonnen"},Pr={en:"Print",nl:"Afdrukken"},Rr={en:"Publish",nl:"Publiceren"},Or={en:"Your %{g:deed} is now publicly visible on Deedmob. Promote your %{g:deed} on social media or by email to get more applications!",nl:"Je %{g:deed} is nu publiekelijk zichtbaar op Deedmob. Promoot je %{g:deed} op social media of via e-mail om meer aanmeldingen te krijgen!"},Ir={en:"Open to applications",nl:"Open voor aanmeldingen"},Lr={en:"The %{g:deed} isn't published because it has been rejected by an admin.",nl:"%{g:theDeed | capitalize} %{g:deed} is niet gepubliceerd omdat deze is afgewezen door een beheerder."},Er={en:"Rejected",nl:"Afgewezen"},Nr={en:"Approve and publish",nl:"Goedkeuren en publiceren"},Fr={en:"Are you sure you want to delete the %{g:deed}?",nl:"Weet je zeker dat je %{g:theDeed} %{g:deed} wilt verwijderen?"},$r={en:"Unarchive",nl:"Dearchiveren"},Br={en:"Find potential volunteers",nl:"Vind potentiële vrijwilligers"},Ur={en:"The %{g:deed} has been saved, but isn't published yet because it requires approval from an admin.",nl:"%{g:theDeed | capitalize} %{g:deed} is opgeslagen, maar is nog niet gepubliceerd omdat deze goedgekeurd moet worden door een beheerder."},Wr={en:"Pending Review",nl:"Wacht op goedkeuring"},Gr={adminTools:Ml,applications:Tl,applicationsClosedButUpcomingModeMessage:zl,applicationsClosedButUpcomingModeTitle:Pl,archivedModeMessage:Rl,archivedModeTitle:Ol,areYouSureArchive:Il,areYouSureUnarchiveDraft:Ll,areYouSureUnarchivePublished:El,attendees:Nl,buttonLabelAssignDeedToUser:Fl,buttonLabelSuggestDeedToUser:$l,cancelArchive:Bl,cancelDeed:Ul,cancelEvent:Wl,cancelEventConfirm:Gl,cancelUnArchive:Vl,cannotPublish:ql,cannotPublishReason:Yl,capacityEnforcedWarning:Jl,copyRecurring:Hl,copyRecurringDisabledReason_memberCreatedOrP2p:Ql,copyRecurringDisabledReason_noDateEnding:Kl,copyRecurringDisabledReason_noSameDay:Zl,copyRecurringDisabledReason_notPublished:Xl,copyRecurringDisabledReason_subtype:er,denyCancel:nr,denyVacant:tr,draftMessage:ar,draftMode:sr,draftModeMessage:ir,draftModeTitle:or,duplicate:lr,editDeed:rr,editEvent:cr,expired:dr,expiredModeMessage:ur,expiredModeTitle:gr,expiring:mr,extend:pr,filledMessage:hr,filledMode:br,filledModeMessage:fr,filledModeTitle:vr,hiddenModeMessage:yr,hiddenModeTitle:jr,invite:wr,markFilled:kr,markVacant:xr,notUpcoming:_r,openInCrm:Dr,openModeMessage:Cr,openModeMessageLoginWalled:Ar,openModeTitle:Sr,organizationUnapproved:Mr,pastModeMessage:Tr,pastModeTitle:zr,print:Pr,published:Rr,publishedMessage:Or,publishedMode:Ir,rejectedModeMessage:Lr,rejectedModeTitle:Er,reviewApprove:Nr,reviewDeletePopupQuestion:Fr,unarchive:$r,volunteerBank:Br,"waiting-for-approvalModeMessage":{en:"The %{g:deed} has been saved, but isn't published yet because it requires approval from an admin.",nl:"%{g:theDeed | capitalize} %{g:deed} is opgeslagen, maar is nog niet gepubliceerd omdat deze goedgekeurd moet worden door een beheerder."},"waiting-for-approvalModeTitle":{en:"Pending Review",nl:"Wacht op goedkeuring"},waitingForApprovalModeMessage:Ur,waitingForApprovalModeTitle:Wr};function Vr(n){return n.approval_status===An.waitingForApproval?"gray":n.status==="open"?"green":n.status==="closed"?"orange":"gray"}function qr(n){return n.approval_status===An.waitingForApproval?"waitingForApproval":n.detailedStatus}
5function Yr({onCancelConfirm:n,onRejectConfirm:a,publishCard:s,inviteClick:i,organization:o,deed:t,archive:l,unarchive:u,toggleFilled:r,isApprovedOrganization:h,whitelabel:m,extendClick:b,canDelete:g}){const k=ia(),c={organizationId:t.organization_id,object:t,organization:o},D=me({...c,resource:ge.deeds,action:"update"}),v=me({...c,resource:ge.deedApplications,action:"create"}),p=ii({deed:t,organization:o,access:k}),y=oi({deed:t,organization:o,whitelabel:m,access:k,organizationId:t.organization_id}),j=Me(),x=Ii(),_=P.useUtils(),R=d.useCallback(async()=>{try{await x.mutateAsync({deedId:t.id}),await _.deeds.get.invalidate({id:t.id})}catch($){j()($)}},[x,t,_,j]),f=S(Gr),W=S(li),[E,B]=d.useState(!1),[q,Y]=d.useState(!1),N=G(),Q=d.useContext(it),ee=Ba(),{data:fe}=P.crm.getDeepLink.useQuery({objectType:"deed",objectId:t.id},{enabled:ee,staleTime:Wi}),J=fe?.crmUrl,K=t.applications??[],A=X({obj:t.title,currentlyActiveLanguage:N.language,whitelabel:N.whitelabel,shouldAttemptTranslateToUserLanguage:Q,originalContentLanguage:t.detected_primary_language}),M=Ua(A),U=ln(m,f.locale),Te=Wa({organizationSlug:o.slug,deedId:t.id,deedsTranslation:U,isP2P:t.p2p}),Be=Ga({deedTranslation:U,deedSlug:M,deedId:t.id,organizationSlug:o.slug,isP2P:t.p2p}),ze=zn(),Ue=!t.date_starting||new Date(t.date_starting)>new Date,We=t.published,Pe=()=>{ze(Yt({deed:{id:t.id,image:t.image,title:X({obj:t.title,currentlyActiveLanguage:N.language,whitelabel:N.whitelabel,originalContentLanguage:t.detected_primary_language})},activities:t.activities,causes:t.causes||[]}))},Ge=oa(!0,N.whitelabel)({...t,published:!0})||{},ve=!t.archived&&Ue&&h&&Object.keys(Ge).length===0,In=f("cannotPublishReason")+(h?"":`${f("organizationUnapproved")} 6`)+(Ue?"":`${f("notUpcoming")} 7`)+qt(Ge),Ve=t.filled,Ln=t.expired,qe=t.capacity_enforced,mn=We&&!t.archived&&!Ln&&(!t.date_ending||t.subtype===_t.project_role||t.subtype===_t.organization_role||t.date_ending&&new Date(t.date_ending)>new Date),le=qr(t),ye=f(`${le}ModeTitle`),Ye=f(N.whitelabel.settings.login_wall&&le==="open"?`${le}ModeMessageLoginWalled`:`${le}ModeMessage`),pn=Oi(t,N.whitelabel.settings),hn=pn&&t.approval_status===An.waitingForApproval,Re=!We&&(!pn||t.approval_status==null||t.approval_status===An.approved),Z=t.expires_at&&ie(t.expires_at).startOf("day").diff(ie().startOf("day"),"day"),{extendsByDays:Oe,extensionEnabled:je}=Va(N.whitelabel.settings,t.type),Ie=je&&(t.expired||Z!=null),Je=dn($=>ot($)?.id),En=qa(k,t.organization_id),Le=Je!==void 0?Ya(Je,t,N,D):!1,He=d.useMemo(()=>lt(N.whitelabel.translations_meta,rt[t.type],"type"),[N.whitelabel.translations_meta,t.type]),we=m.settings.recurring_deeds_enabled?Mo(t):null,[Nn,Qe]=d.useState(!1),Fn=()=>{Qe(!0)},$n=d.useCallback($=>{Qe(!1),ze(Vt({organizationSlug:o.slug,deedsTranslation:ln(m,f.locale),deedGroupId:$}))},[ze,o.slug,f.locale,m]),Bn=d.useCallback(()=>{Qe(!1)},[]),Ee=ri({type:t.type,site:N,tg:f.g}),Ne=we!==null&&En?e.jsx(C,{variant:"subtle",size:"compact-sm",onClick:Fn,leftSection:e.jsx(w,{icon:zs}),disabled:!we.result,...F(Dt.copyRecurringButton),children:f("copyRecurring")},"copy-recurring"):null,bn=Ne&&we?we.result?Ne:e.jsx(Hn,{tooltipPosition:{placement:"top"},tooltip:f(`copyRecurringDisabledReason_${we.reason}`),tooltipOptions:{delay:200},children:Ne},"copy-recurring-tooltip"):null,ke=t.application_flow===V.external;return e.jsxs(e.Fragment,{children:[e.jsxs(Ui,{color:Vr(t),title:e.jsxs(e.Fragment,{children:[ye," ",Le?e.jsx(di,{}):null]}),message:Ye,children:[[hn&&y&&e.jsx(Lt,{items:[e.jsx(C,{...F("deed-toolbar-approve-review-button"),leftSection:e.jsx(w,{icon:Ps}),onClick:R,variant:"subtle",size:"compact-sm",type:"button",children:f("reviewApprove")},"approve"),t.published_at==null&&e.jsx(Xe,{okButtonProps:{color:"danger"},onConfirm:a,okText:f.g("delete"),cancelText:f.g("cancel"),title:f("reviewDeletePopupQuestion"),children:e.jsx(C,{...F("deed-toolbar-delete-review-button"),leftSection:e.jsx(w,{icon:Rs}),variant:"subtle",size:"compact-sm",children:f.g("delete")})},"reject")].filter($=>!!$)},"approval-section"),e.jsx(Lt,{items:[Re&&e.jsx(H.Fragment,{children:ve?e.jsx(C,{...F("deed-toolbar-publish-button"),variant:"subtle",size:"compact-sm",onClick:()=>s(t),leftSection:e.jsx(w,{icon:sn}),children:f("published")}):e.jsx(Hn,{tooltipPosition:{placement:"top"},tooltip:In,tooltipOptions:{delay:200},children:e.jsxs("span",{children:[e.jsx(w,{icon:Os,className:Se("margin-right-5",_i.iconLight)}),f("cannotPublish")]})})},"publish"),Ie&&e.jsx(Hn,{tooltipPosition:{placement:"top"},tooltip:Z&&Z>=0?f("expiring",{days:Z,type:f.g(`deed_${t.type}`),...He}):Z?f("expired",{days:-Z,type:f.g(`deed_${t.type}`),...He}):f("expired",{days:"?",type:f.g(`deed_${t.type}`),...He}),tooltipOptions:{delay:200},children:e.jsx(C,{variant:"subtle",size:"compact-sm",onClick:b,leftSection:e.jsx(w,{icon:Is}),children:f("extend",{days:Oe})})},"extend"),e.jsx(Ae,{to:Be,style:{color:"inherit"},children:e.jsx(C,{...F("deed-toolbar-edit-button"),variant:"subtle",size:"compact-sm",leftSection:e.jsx(w,{icon:Ls}),children:f("editDeed")})},"edit"),e.jsx(Ae,{to:Te,style:{color:"inherit"},children:e.jsx(C,{...F("deed-toolbar-duplicate-button"),variant:"subtle",size:"compact-sm",leftSection:e.jsx(w,{icon:Es}),children:f("duplicate")})},"duplicate"),bn,t.status==="open"&&!ke&&e.jsx(C,{variant:"subtle",size:"compact-sm",disabled:Le,onClick:i,leftSection:e.jsx(w,{icon:ta}),children:f("invite")},"invite"),We&&t.status==="open"&&N.whitelabel.settings.volunteer_bank_enabled&&e.jsx(C,{variant:"subtle",size:"compact-sm",onClick:Pe,leftSection:e.jsx(w,{icon:aa}),children:f("volunteerBank")},"volunteer-bank"),p&&!ke&&e.jsxs(H.Fragment,{children:[e.jsx(C,{...F("deed-toolbar-suggest-deed-button"),leftSection:e.jsx(w,{icon:Ns}),variant:"subtle",size:"compact-sm",onClick:()=>Y(!0),children:f("buttonLabelSuggestDeedToUser")}),q&&e.jsx(Li,{deed:t,onSuggested:async()=>
7{Y(!1),await _.deeds.applications.list.invalidate({deedId:t.id})},onClose:()=>Y(!1)})]},"suggest"),v&&!ke&&e.jsxs(H.Fragment,{children:[e.jsx(C,{...F("deed-toolbar-assign-deed-button"),leftSection:e.jsx(w,{icon:Fs}),variant:"subtle",size:"compact-sm",onClick:()=>B(!0),children:f("buttonLabelAssignDeedToUser")}),E&&e.jsx(un,{open:!0,title:f("buttonLabelAssignDeedToUser"),onClose:()=>B(!1),children:e.jsx(Ei,{initialValues:{deed:t,status:he.accepted},onSuccess:async()=>{B(!1),await _.deeds.applications.list.invalidate({deedId:t.id})}})})]},"assign"),mn&&e.jsx(H.Fragment,{children:Ve?t.application_flow===V.apply&&qe?e.jsx(Xe,{onConfirm:r,okText:f("markVacant"),cancelText:f("denyVacant"),title:f("capacityEnforcedWarning"),children:e.jsx(C,{variant:"subtle",size:"compact-sm",leftSection:e.jsx(w,{icon:sn}),children:f("markVacant")})}):e.jsx(C,{variant:"subtle",size:"compact-sm",onClick:r,leftSection:e.jsx(w,{icon:sn}),children:f("markVacant")}):e.jsx(C,{variant:"subtle",size:"compact-sm",onClick:r,leftSection:e.jsx(w,{icon:ct}),children:f("markFilled")})},"fill"),o.org_status===Ja.archived?null:e.jsx(H.Fragment,{children:t.archived?e.jsx(Xe,{onConfirm:u,okText:f("unarchive"),cancelText:f("cancelUnArchive"),title:t.published?f("areYouSureUnarchivePublished"):f("areYouSureUnarchiveDraft"),children:e.jsx(C,{variant:"subtle",size:"compact-sm",leftSection:e.jsx(w,{icon:zt}),children:f("unarchive")})}):e.jsx(Xe,{onConfirm:l,okText:f.g("archive"),okButtonProps:{color:"danger"},cancelText:f("cancelArchive"),title:f("areYouSureArchive"),children:e.jsx(C,{variant:"subtle",size:"compact-sm",leftSection:e.jsx(w,{icon:zt}),children:f.g("archive")})})},"archive"),g&&e.jsx(Xe,{okButtonProps:{...F("deed-cancel-button-popover-button-delete"),color:"danger"},onConfirm:n,okText:f.g("delete"),cancelText:f("denyCancel"),title:f.g("areYouSure"),content:e.jsxs(L,{children:[e.jsx(T,{dangerouslySetInnerHTML:{__html:W("deleteDeedConfirm",Ee)}}),t.status===rn.open&&Ot(K)>0&&e.jsx(T,{dangerouslySetInnerHTML:{__html:W("deleteDeedConfirmOpenAttendees",{...Ee,attendeesCount:Ot(K??[])})}}),K?.length>0&&e.jsx(T,{dangerouslySetInnerHTML:{__html:W("deleteDeedConfirmApplications",{...Ee,applicationsCount:K?.length})}})]}),children:e.jsx(C,{...F("deed-cancel-button"),variant:"subtle",size:"compact-sm",leftSection:e.jsx(w,{icon:$s}),children:f("cancelDeed")})},"delete"),(typeof window>"u"||window.hasOwnProperty("print"))&&e.jsx(C,{variant:"subtle",size:"compact-sm",leftSection:e.jsx(w,{icon:Bs}),onClick:()=>window.print(),children:f("print")},"print"),ee&&!!J&&e.jsx(C,{...F(Dt.openInCrmButton),component:"a",href:J,target:"_blank",rel:"noopener noreferrer",variant:"subtle",size:"compact-sm",leftSection:e.jsx(w,{icon:Us}),children:f("openInCrm")},"crm")].filter($=>!!$)},"actions")].filter($=>!!$),t.application_flow===V.external&&e.jsx(ci,{mt:"md",deedId:t.id,externalStats:t.external_stats})]}),Nn&&e.jsx(Sl,{deedId:t.id,deedDate:ie(t.date_starting??t.date_ending),organizationSlug:o.slug,hasRsvpCloses:t.rsvp_closes!==null,existingDeedGroup:t.deedGroup??null,initialGroupTitle:t.deedGroup?.title??A,onSuccess:$n,onCancel:Bn})]})}const Jr={en:"We've just sent a fresh confirmation link to:",nl:"We hebben zojuist een nieuwe bevestigingslink verzonden naar:"},Hr={en:"You've already applied",nl:"Je hebt je al aangemeld."},Qr={en:"Cancel",nl:"Annuleren"},Kr={en:"Change",nl:"Wijzig"},Zr={en:"Click the link in the email to finish your application.",nl:"Klik op de link in de e-mail om je aanmelding af te ronden."},Xr={en:"We've sent a confirmation link to:",nl:"We hebben een bevestigingslink gestuurd naar:"},ec={en:"Check your email",nl:"Controleer uw e-mail"},nc={en:"Close",nl:"Sluiten"},tc={en:"Confirm attendance",nl:"Aanwezigheid bevestigen"},ac={en:"Continue",nl:"Doorgaan"},sc={en:"Create an account",nl:"Account aanmaken"},ic={en:"Enter your email to continue â if you already have an account, we'll ask you to log in.",nl:"Voer je e-mailadres in om verder te gaan. Als je al een account hebt, vragen we je om in te loggen."},oc={en:"Something went wrong. Please try again.",nl:"Er is iets fout gegaan. Probeer later opnieuw."},lc={en:"Email address",nl:"E-mailadres"},rc={en:"[email protected]",nl:"[email protected]"},cc={en:"I have read and agree to the",nl:"Ik heb de voorwaarden gelezen en ga ermee akkoord."},dc={en:"No account was found for this email. We'll send you a confirmation link to finish your application.",nl:"Er is geen account gevonden voor dit e-mailadres. We sturen je een bevestigingsmail om je aanmelding te voltooien."},uc={en:"Continue your application",nl:"Ga verder met je aanmelding"},gc={en:"Please enter a valid email address.",nl:"Voer een geldig e-mailadres in."},mc={en:"Log in",nl:"Log in"},pc={en:"An account with this email address already exists. Please, log in to continue.",nl:"Er bestaat al een account met dit e-mailadres. Log in om verder te gaan."},hc={en:"Account found",nl:"Account gevonden"},bc={en:"Tell us something about yourself and why this %{g:deed} appeals to you.",nl:"Vertel ons iets over jezelf en waarom %{g:thisDeed} %{g:deed} je aanspreekt."},fc={en:"Privacy Policy",nl:"Privacyverklaring"},vc={en:"Resend confirmation email",nl:"Bevestigingsmail opnieuw verzenden"},yc={en:"Resend in %{seconds}s",nl:"Opnieuw verzenden in %{seconds}s"},jc={en:"Continue as a guest",nl:"Ga verder als gast"},wc={alreadyAppliedIntro:Jr,alreadyAppliedTitle:Hr,cancelButton:Qr,changeEmailLink:Kr,checkYourEmailFooter:Zr,checkYourEmailIntro:Xr,checkYourEmailTitle:ec,closeButton:nc,confirmAttendanceButton:tc,continueButton:ac,createAccountLink:sc,emailCheckDescription:ic,emailCheckError:oc,emailLabel:lc,emailPlaceholder:rc,gdpr
7ConsentPrefix:cc,guestFormDescription:dc,guestFormTitle:uc,invalidEmail:gc,loginButton:mc,loginRequiredBody:pc,loginRequiredTitle:hc,motivationMessage:bc,privacyPolicyLink:fc,resendButton:vc,resendIn:yc,submitButton:jc},kc=({deed:n,open:a,onClose:s})=>{const i=S(wc),o=Me(),{whitelabel:t}=G(),[l,u]=d.useState("email_check"),[r,h]=d.useState(""),[m,b]=d.useState(""),[g,k]=d.useState(60),[c,D]=d.useState(!1),[v,p]=d.useState(""),[y,j]=d.useState(!1),[x,_]=d.useState(!1),[R,f]=d.useState(""),W=Vi(n,t.settings),E=P.guest.checkEmail.useMutation(),B=P.guest.applyToActivity.useMutation(),q=P.guest.resendConfirmation.useMutation(),Y=Jt({onSubmit:async()=>{}});d.useEffect(()=>{a||(u("email_check"),h(""),b(""),k(60),D(!1),p(""),j(!1),_(!1),f(""),Y.reset())},[a]),d.useEffect(()=>{if(l!=="check_your_email")return;const A=setInterval(()=>{k(M=>M<=1?(clearInterval(A),0):M-1)},1e3);return()=>clearInterval(A)},[l]);const N=async()=>{const A=m.trim();if(!z.string().email().safeParse(A).success){p(i("invalidEmail"));return}p(""),j(!1),h(A);try{const M=await E.mutateAsync({email:A,deedId:n.id});M.status==="login_required"?u("login_required"):M.status==="existing_application"?(_(!0),k(M.retry_after),u("check_your_email")):u("form")}catch(M){At(M)?o()(M):(j(!0),Sn.error({message:i.g("error")}))}},Q=()=>{const A=Y.values,{elementResponses:M}=A;if(!(!M||Object.keys(M).length===0))return M},ee=async()=>{const A=R.trim();try{const M=await B.mutateAsync({deedId:n.id,email:r,consent:!0,initial_message:A||void 0,form_responses:Q()});_(M.already_existed),k(M.retry_after),u("check_your_email")}catch(M){At(M)===Ka.GUEST_APPLICATION_LOGIN_REQUIRED?u("login_required"):o()(M)}},fe=async()=>{try{const A=await q.mutateAsync({deedId:n.id,email:r});k(A.retry_after)}catch{Sn.error({message:i.g("error")})}},J=n.form?.elements,K=l==="check_your_email"?i(x?"alreadyAppliedTitle":"checkYourEmailTitle"):l==="login_required"?i("loginRequiredTitle"):l==="form"?i("guestFormTitle"):i.g(`application_flow_${n.application_flow}`);return e.jsxs(Ht,{opened:a,onClose:s,title:e.jsx(T,{fw:"bold",children:K}),closeButtonProps:{"aria-label":i.g("close")},size:"md",children:[l==="email_check"&&e.jsxs(L,{children:[e.jsx(T,{children:i("emailCheckDescription")}),e.jsx(Ha,{label:i("emailLabel"),placeholder:i("emailPlaceholder"),type:"email",error:v||(y?i("emailCheckError"):void 0),errorProps:F(Ct.emailError),...F(Ct.emailInput),value:m,onChange:A=>{b(A.currentTarget.value),p(""),j(!1)},onKeyDown:A=>{A.key==="Enter"&&N()}}),e.jsx(C,{fullWidth:!0,onClick:N,loading:E.isPending,children:i("continueButton")})]}),l==="form"&&e.jsx("form",{onSubmit:A=>{A.preventDefault(),ee()},children:e.jsxs(L,{gap:"md",children:[e.jsxs(I,{justify:"space-between",align:"center",gap:"sm",wrap:"nowrap",p:"xs",px:"sm",bg:"gray.0",style:{borderRadius:8,border:"1px solid var(--mantine-color-gray-3)"},children:[e.jsxs(I,{gap:"xs",align:"center",wrap:"nowrap",style:{minWidth:0},children:[e.jsx(w,{icon:Pt}),e.jsx(T,{size:"sm",fw:500,style:{wordBreak:"break-all"},children:r})]}),e.jsx(Qn,{size:"sm",component:"button",type:"button",onClick:()=>{b(r),u("email_check")},children:i("changeEmailLink")})]}),e.jsx(T,{size:"sm",c:"dimmed",children:i("guestFormDescription")}),e.jsxs(L,{gap:8,children:[e.jsx(Yi,{label:i("motivationMessage"),required:!W,minRows:3,autosize:!0,value:R,onChange:A=>f(A.currentTarget.value)}),J&&J.length>0&&e.jsx(qi,{form:Y,elements:J,fullWidth:!0}),e.jsx(Qa,{checked:c,onChange:A=>D(A.currentTarget.checked),label:e.jsxs(T,{size:"sm",children:[i("gdprConsentPrefix")," ",e.jsx(Qn,{href:Kn("privacy"),target:"_blank",rel:"noopener noreferrer",underline:"always",children:i("privacyPolicyLink")}),"."]})})]}),e.jsxs(I,{justify:"space-between",align:"center",gap:"xs",wrap:"wrap",children:[e.jsx(Qn,{size:"sm",href:`${Kn("register")}?${new URLSearchParams({[en.next]:`${window.location.pathname}?showApply`,[en.email]:r})}`,children:i("createAccountLink")}),e.jsx(C,{type:"submit",disabled:!c||B.isPending,loading:B.isPending,children:n.application_flow===V.join?i("confirmAttendanceButton"):i("submitButton")})]})]})}),l==="login_required"&&e.jsxs(L,{children:[e.jsx(T,{children:i("loginRequiredBody")}),e.jsxs(I,{justify:"flex-end",gap:"xs",children:[e.jsx(C,{variant:"default",onClick:()=>{u("email_check")},children:i.g("back")}),e.jsx(C,{component:"a",href:`${Kn("login")}?${new URLSearchParams({[en.next]:`${window.location.pathname}?showApply`,[en.email]:r})}`,children:i("loginButton")})]})]}),l==="check_your_email"&&e.jsxs(L,{gap:"md",children:[e.jsxs(I,{gap:"sm",align:"center",wrap:"nowrap",children:[e.jsx(dt,{size:"xl",radiu
7s:"xl",color:"blue",variant:"light",children:e.jsx(w,{icon:Pt,size:"lg"})}),e.jsx(T,{children:i(x?"alreadyAppliedIntro":"checkYourEmailIntro")})]}),e.jsx(pe,{p:"sm",bg:"gray.0",style:{borderRadius:8,border:"1px solid var(--mantine-color-gray-3)"},children:e.jsx(T,{fw:"bold",ta:"center",style:{wordBreak:"break-all"},children:r})}),e.jsx(T,{size:"sm",c:"dimmed",children:i("checkYourEmailFooter")}),e.jsxs(I,{justify:"flex-end",gap:"xs",children:[e.jsx(C,{variant:"default",onClick:s,children:i("closeButton")}),e.jsx(C,{onClick:fe,disabled:g>0||q.isPending,loading:q.isPending,children:g>0?i("resendIn",{seconds:g}):i("resendButton")})]})]})]})};function xc(){const n=cn();return d.useMemo(()=>n.state||{},[n.state])}const _c={en:"Related to",nl:"Gerelateerd aan"},Dc={relatedTo:_c},_n={variant:"light",color:"var(--text-color-secondary)",size:"lg"},Cc=({deed:n})=>{const a=S(Dc),s=G(),{enabledBySetting:i}=Xi(),o=Za(n?.activities||[],s.whitelabel.settings.omitted_activities||[]),t=n.causes??[],l=Ki(a.locale,s.whitelabel).filter(r=>n.sdgs?.includes(r.value)),u=i[n.p2p?"enabled_for_p2p":n.type===oe.workshop?"enabled_for_workshops":n.type===oe.community?"enabled_for_community_events":"enabled_for_volunteering"].filter(r=>n.tags?.includes(r.id)).filter(r=>!r.is_organizer_only);return o.length===0&&t.length===0&&l.length===0&&u.length===0?null:e.jsxs(L,{className:Di.badges,gap:4,children:[e.jsx(Fe,{order:3,size:"lg",children:a("relatedTo")}),o.length>0&&e.jsx(I,{gap:4,children:o.map(r=>d.createElement(kn,{..._n,key:r.join("-")},Xa(r,a.locale)))}),t.length>0&&e.jsx(I,{gap:4,children:t.map(r=>d.createElement(kn,{..._n,key:r},es(r,a.locale)))}),l.length>0&&e.jsx(I,{gap:4,children:l.map(r=>d.createElement(kn,{..._n,key:r.value},Zi(r.value,a.locale)))}),u.length>0&&e.jsx(I,{gap:4,children:u.map(r=>d.createElement(kn,{..._n,key:r.id},r.label))})]})},Ac={en:"Add to favorites",nl:"Voeg toe aan favorieten"},Sc={en:"Unfavourited",nl:"Verwijderd uit favorieten"},Mc={en:"Remove from favourites",nl:"Verwijder uit lijst met favorieten"},Tc={favouriteHelp:Ac,successMessageUnfavorite:Sc,unfavouriteHelp:Mc},on={variant:"muted",size:"lg",flex:1,maw:70},zc=({deed:n,isLoggedIn:a})=>{const s=S(Tc),i=Tn(),o=Me(),t=P.useUtils(),l=P.me.favorites.list.useQuery(void 0,{enabled:a}),u=P.me.favorites.add.useMutation({onSuccess:()=>t.me.favorites.list.invalidate()}),r=P.me.favorites.remove.useMutation({onSuccess:()=>t.me.favorites.list.invalidate()});if(!a)return null;const h=l.data?.find(b=>b.deed_id===n.id),m=()=>h?r.mutateAsync({deedId:n.id}):u.mutateAsync({deedId:n.id});return n.status!==rn.open?h?e.jsx(tn,{label:s("unfavouriteHelp"),children:e.jsx(an,{...on,onClick:()=>m().then(i({message:s("successMessageUnfavorite")}),o()),title:s("unfavouriteHelp"),children:e.jsx(w,{icon:Rt})})}):null:e.jsx(tn,{label:s(h?"unfavouriteHelp":"favouriteHelp"),children:e.jsx(an,{...on,onClick:()=>m().then(i(),o()),title:s(h?"unfavouriteHelp":"favouriteHelp"),children:e.jsx(w,{icon:h?Rt:Ws})})})},Pc={en:"Upcoming time slots for %{deedTitle}",nl:"Meer aankomende tijden voor %{deedTitle}"},Rc={title:Pc},Oc={en:"currently viewing",nl:"momenteel aan het bekijken"},Ic={currently:Oc},ga=({currentId:n,deed:a,deedsTranslation:s,organizationSlug:i,shouldAttemptTranslateToUserLanguage:o})=>{const t=S(Ic),l=G();return e.jsxs(L,{gap:0,children:[e.jsx(Ae,{to:ns({deedId:a.id,deedsTranslation:s,organizationSlug:i,deedTitleOrSlug:a.title,locale:t.locale,whitelabel:l.whitelabel,detected_primary_language:a.detected_primary_language}),children:X({obj:a.title,originalContentLanguage:a.detected_primary_language,currentlyActiveLanguage:l.language,whitelabel:l.whitelabel,shouldAttemptTranslateToUserLanguage:o})}),la(a,ra(t.g)),a.id===n&&e.jsxs("div",{style:{fontStyle:"italic"},children:["(",t("currently"),")"]})]})},Lc=({deed:n,onClose:a,deedsTranslation:s,organizationSlug:i,shouldAttemptTranslateToUserLanguage:o})=>{const t=S(Rc),l=P.useUtils(),u=G(),[r,h]=d.useState([]);d.useEffect(()=>{(async()=>{if(!n.deed_group_id){h([]);return}const b=await l.deeds.search.fetch({deed_group_id:n.deed_group_id,orderBy:"date_starting",date:[Qt(new Date)],organizationIds:[n.organization_id]});h(b.results)})()},[l,n.id,n.deed_group_id,n.organization_id]);const m=X({obj:n.title,originalContentLanguage:n.detected_primary_language,currentlyActiveLanguage:u.language,whitelabel:u.whitelabel,shouldAttemptTranslateToUserLanguage:o});return e.jsx(un,{open:!0,onClose:a,title:t("title",{deedTitle:m}),children:e.jsx(L,{gap:4,children:r.map(b=>e.jsx(ga,{currentId:n.id,deed:b,deedsTranslation:s,organizationSlug:i,shouldAttemptTranslateToUserLanguage:o},b.id))})})},Ec={en:"More upcoming times",nl:"Meer aankomende tijden"},Nc={moreUpcoming:Ec},Fc=({deed:n,shouldAttemptTranslateToUserLanguage:a,organizationSlug:s})=>
7{const i=P.useUtils(),o=G(),t=S(Nc),l=ln(o.whitelabel,t.locale),[u,r]=d.useState(),[h,m]=d.useState(!1);d.useEffect(()=>{m(!1)},[n.id]),d.useEffect(()=>{(async()=>{if(!n.deed_group_id)return;const k=await i.deeds.search.fetch({deed_group_id:n.deed_group_id,orderBy:"date_starting",limit:3,date:[Qt(new Date)],excludedIds:[n.id]});r(k)})()},[i,n.deed_group_id,n.date_starting,n.date_ending,n.id]);const b=u?.results??[],g=(u?.pagination?.pageCount??0)>1;return!n.deed_group_id||b.length<1?null:e.jsx(pe,{bg:"background.5",p:"sm",mt:"md",bdrs:"md",children:e.jsxs(L,{gap:"sm",children:[e.jsx(T,{fw:"bold",lh:1,children:t("moreUpcoming")}),e.jsx(L,{gap:4,children:b.map(k=>e.jsx(ga,{deed:k,deedsTranslation:l,organizationSlug:s,shouldAttemptTranslateToUserLanguage:a},k.id))}),g&&e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"muted",size:"sm",onClick:()=>{m(!0)},children:t.g("more")}),h&&e.jsx(Lc,{onClose:()=>m(!1),deed:n,deedsTranslation:l,organizationSlug:s,shouldAttemptTranslateToUserLanguage:a})]})]})})},$c={en:"About",nl:"Over"},Bc={en:"Detailed description",nl:"Uitgebreide omschrijving"},Uc={en:"Accepted",nl:"Match"},Wc={en:"Activity Tags",nl:"Activiteiten Tags"},Gc={en:"Address",nl:"Adres"},Vc={en:"Anonymous",nl:"Anoniem"},qc={en:"Anytime",nl:"Flexibel"},Yc={en:"Applications Closed",nl:"Aanmeldingen gesloten"},Jc={en:"Applied",nl:"Aangemeld"},Hc={en:"Are you sure you don't want to apply?",nl:"Weet je zeker dat je je niet wil aanmelden?"},Qc={en:"Application for %{title}",nl:"Aanmelden voor %{title}"},Kc={en:"Send application",nl:"Aanmelding versturen"},Zc={en:"Are you sure you want to archive this %{type}?",nl:"Weet je zeker dat je %{thisType.nl} %{type} wilt archiveren?"},Xc={en:"Are you going?",nl:"Ben je erbij?"},ed={en:"Are you sure you don't want to go any more? Once you withdraw your application, you will not be able to re-apply.",nl:"Weet je zeker dat je niet meer wil gaan?"},nd={en:"Are you sure you want to unarchive this %{g:deed}? This %{g:deed} will be return to your drafts",nl:"Weet u zeker dat u %{g:thisDeed} %{g:deed} wilt unarchiveren? %{g:thisDeed | capitalize} %{g:deed} zal worden teruggezet naar uw ontwerpen"},td={en:"Are you sure you want to unarchive this %{g:deed}? This %{g:deed} will be published",nl:"Weet je zeker dat je %{g:thisDeed} %{g:deed} wilt unarchiveren? %{g:thisDeed | capitalize} %{g:deed} zal worden gepubliceerd"},ad={en:`Cannot Publish because: 8`,nl:`Kan niet publiceren omdat: 9`},sd={en:"Causes",nl:"Interesses"},id={en:"Rejected",nl:"Geen match"},od={en:"Withdrawn",nl:"Ingetrokken"},ld={en:"%{g:deed} date",nl:"%{g:deed} datum"},rd={en:"Confirm",nl:"Bevestigen"},cd={en:"Contact person",nl:"Contactpersoon"},dd={en:"Conversation",nl:"Chat"},ud={en:"Reimbursement of costs",nl:"Vrijwilligersvergoeding"},gd={en:"Find the latest vacancies and the last news on volunteering on Deedmob.",nl:"De nieuwste vacatures en het laatste nieuws over vrijwilligerswerk vind je op Deedmob."},md={en:"Find the latest vacancies and the last news on volunteering on Deedmob.",nl:"De nieuwste vacatures en het laatste nieuws over vrijwilligerswerk vind je op Deedmob."},pd={en:"Find the latest vacancies and the last news on volunteering in %{location} on Deedmob.",nl:"De nieuwste vacatures en het laatste nieuws over vrijwilligerswerk in %{location} vind je op Deedmob."},hd={en:"Find the latest vacancies and the last news on volunteering in %{location} on Deedmob.",nl:"De nieuwste vacatures en het laatste nieuws over vrijwilligerswerk in %{location} vind je op Deedmob."},bd={en:"%{city} %{g:deeds | capitalize}",nl:"%{city} %{g:deeds | capitalize}"},fd={en:"Enter wait list",nl:"Ga op de wachtlijst"},vd={en:"Anonymous - User applied on another site and is not part of this site",nl:"Anoniem - Gebruiker heeft zich via een ander platform aangemeld en is niet actief op dit platform"},yd={en:"Extra support",nl:"Extra begeleiding"},jd={en:"This %{g:deed} is filled. Applications are closed.",nl:"%{g:thisDeed | capitalize} %{g:deed} is vol. Aanmeldingen zijn gesloten."},wd={en:"The organiser has marked this %{g:deed} as filled. Applications are closed.",nl:"De organisator heeft %{g:thisDeed} %{g:deed} gemarkeerd als gevuld. Aanmeldingen zijn gesloten."},kd={en:"Getting there",nl:"Hoe kom ik er?"},xd={en:"Create a group application",nl:"Een groep aanmelden"},_d={en:"Invite",nl:"Uitnodigen"},Dd={en:"Are you sure you don't want to join?",nl:"Weet je zeker dat je niet wilt meedoen?"},Cd={en:"Joining %{title}",nl:"Deelnemen aan %{title}"},Ad={en:"Join wait list?",nl:"Wil je op de wachtlijst?"},Sd={en:"Thanks for joining! We'll contact you as soon as possible!",nl:"Leuk dat je meedoet! We nemen zo snel mogelijk contact met je op!"},Md={en:"Confirm attendance",nl:"Aanwezigheid bevestigen"},Td={en:"Volunteering in %{city}",nl:"Vrijwilligerswerk in %{city}"}
9,zd={en:"Map",nl:"Kaart"},Pd={en:"Message organiser",nl:"Schrijf de contactpersoon"},Rd={en:`Link: %{deedLink} 10 11`,nl:`Link: %{deedLink} 12 13`},Od={en:'Question related to %{deedType} "%{deedTitle}"',nl:'Vraag gerelateerd aan %{deedType} "%{deedTitle}"'},Id={en:"Native language skills",nl:"Beheersing van het Nederlands"},Ld={en:"No account? Register here.",nl:"Geen account? Registreer hier."},Ed={en:"Before applying, please log in or create an account.",nl:"Je dient ingelogd te zijn voordat je je kunt aanmelden. Login of maak een account aan."},Nd={en:"Log in or create an account",nl:"Inloggen of een account aanmaken"},Fd={en:`%{g:deed | capitalize} must start in the future 14`,nl:`%{g:deed | capitalize} moet in de toekomst van start gaan 15`},$d={en:"or",nl:"of"},Bd={en:"You've been asked to help",nl:"Je bent gevraagd om te helpen"},Ud={en:"Your %{g:organization} is not yet approved",nl:"Uw %{g:organization} is nog niet geaccepteerd"},Wd={en:"Ask %{firstName} a question",nl:"Stel de contactpersoon een vraag"},Gd={en:"Pending",nl:"In afwachting"},Vd={en:"%{smart_count} person going |||| %{smart_count} people going",nl:"%{smart_count} persoon gaat |||| %{smart_count} personen gaan"},qd={en:"%{smart_count} on the wait list",nl:"%{smart_count} op de wachtlijst"},Yd={en:"%{smart_count} person participated |||| %{smart_count} people participated",nl:"%{smart_count} persoon heeft meegedaan |||| %{smart_count} personen hebben meegedaan"},Jd={en:"Practical details",nl:"Praktische informatie"},Hd={en:"Provided",nl:"Wat wij bieden"},Qd={en:"or contact the organiser directly at",nl:"of neem rechtstreeks contact op met de organisator via"},Kd={en:"Application for %{title}",nl:"Aanmelden voor %{title}"},Zd={en:"Report %{g:deed}",nl:"Rapporteer %{g:deed}"},Xd={en:"Requirements",nl:"Voorwaarden"},eu={en:"%{g:applications | capitalize} Closed.",nl:"%{g:applications | capitalize} gesloten."},nu={en:"%{g:applications | capitalize} closing",nl:"%{g:applications | capitalize} sluiten"},tu={en:"You're going.",nl:"Je gaat."},au={en:"You're not going.",nl:"Je gaat niet."},su={en:"You're not going.",nl:"Je gaat niet."},iu={en:"You've been asked to help",nl:"Je bent gevraagd om te helpen"},ou={en:"You're on the wait list.",nl:"Je staat op de wachtlijst"},lu={en:"See more %{g:deeds} by %{organization_name}",nl:"Bekijk meer %{g:deeds} van %{organization_name}"},ru={en:"Volunteer as %{title} %{starting} on Deedmob with me %{url}",nl:"Doe vrijwilligerswerk als %{title} %{starting} op Deedmob met mij %{url}"},cu={en:"Show original text (%{locale})",nl:"Oorspronkelijke tekst weergeven (%{locale})"},du={en:"Show automatic translation (%{locale})",nl:"Automatische vertaling weergeven (%{locale})"},uu={en:"Missing Email Address",nl:"Ontbrekend e-mailadres"},gu={en:"Please click here to add your contact email, so we know where to reach you.",nl:"Klik hier om je contact e-mail toe te voegen zodat we weten waar we je kunnen bereiken."},mu={en:"%{smart_count} spot left |||| %{smart_count} spots left",nl:"%{smart_count} plaats over |||| %{smart_count} plaatsen over"},pu={en:"%{g:deed | capitalize} unfavourited!",nl:"Je hebt %{g:theDeed} %{g:deed} verwijderd uit favorieten!"},hu={en:"Successfully extended %{g:deed}!",nl:"Je hebt je %{g:deed} verlengd!"},bu={en:"%{g:deed | capitalize} marked as filled!",nl:"Je hebt %{g:theDeed} %{g:deed} gemarkeerd als gevuld!"},fu={en:"%{g:deed | capitalize} published!",nl:"Je hebt %{g:theDeed} %{g:deed} gepubliceerd!"},vu={en:"%{g:deed | capitalize} marked as not filled!",nl:"%{g:deed | capitalize} gemarkeerd als niet gevuld"},yu={en:"Summary",nl:"Samenvatting"},ju={en:"Applications",nl:"Aanmeldingen"},wu={en:"Activity reports",nl:"Activiteitenrapporten"}
15,ku={en:"Attendees",nl:"Deelnemers"},xu={en:"Info",nl:"Info"},_u={en:"View your applications",nl:"Bekijk je aanmeldingen"},Du={en:"Disclosure and Barring Service",nl:"Verklaring Omtrent Gedrag"},Cu={en:"On Wait list",nl:"Op de wachtlijst"},Au={en:"Be the first on the wait list!",nl:"Wees de eerste op de wachtlijst!"},Su={en:"No one on the wait list yet.",nl:"Nog niemand op de wachtlijst."},Mu={en:"Wait list for %{title}",nl:"Wachtlijst voor %{title}"},Tu={en:"Withdraw application",nl:"Aanmelding annuleren"},zu={en:"You and %{smart_count} person participated. |||| You and %{smart_count} people participated.",nl:"Jij en %{smart_count} persoon hebben meegedaan. |||| Jij en %{smart_count} personenhebben meegedaan. "},Pu={en:"You participated.",nl:"Je hebt meegedaan."},gn={about:$c,about_html:Bc,accepted:Uc,activities:Wc,address:Gc,anonymousUser:Vc,anytime:qc,applicationsClosedButUpcoming:Yc,applied:Jc,applyCloseWarning:Hc,applyTitle:Qc,apply_submit:Kc,archiveDeedConfirm:Zc,areYouGoing:Xc,areYouSureRemove:ed,areYouSureUnarchiveDraft:nd,areYouSureUnarchivePublished:td,cannotPublishReason:ad,causesLabel:sd,closed_by_organization:id,closed_by_user:od,commitment_label:ld,confirmRemove:rd,contactPerson:cd,conversation:dd,cost_reimbursement:ud,deedAbout:gd,deedAboutCauses:md,deedAboutCausesLocation:pd,deedAboutLocation:hd,deedsPage:bd,enter_waitlist:fd,externalUser:vd,extra_support:yd,filledCapacity:jd,filledOrganizer:wd,gettingThere:kd,groupApply:xd,inviteByEmail:_d,joinCloseWarning:Dd,joinTitle:Cd,joinWaitlist:Ad,joinWelcome:Sd,join_submit:Md,localLandingPage:Td,map:zd,messageOrganiser:Pd,messageOrganizerBody:Rd,messageOrganizerSubject:Od,native_speaker:Id,noAccount:Ld,notLoggedInDescription:Ed,notLoggedInTitle:Nd,notUpcoming:Fd,or:$d,org_invited_user:Bd,organizationUnapproved:Ud,organizer:Wd,pending:Gd,peopleGoing:Vd,peopleOnWaitlist:qd,peopleParticipated:Yd,practicalDetails:Jd,provisions:Hd,reachOutDirectly:Qd,registerTitle:Kd,reportDeed:Zd,requirements:Xd,rsvpClosed:eu,rsvpClosesFromNow:nu,rsvp_accepted:tu,rsvp_closed_by_organization:au,rsvp_closed_by_user:su,rsvp_org_invited_user:iu,rsvp_waiting:ou,seeMoreDeedsBy:lu,shareDeed:ru,showOriginal:cu,showTranslated:du,signedInNoEmail:uu,signedInNoEmailLink:gu,spotsLeft:mu,successMessage:pu,successMessageExtend:hu,successMessageFill:bu,successMessagePublish:fu,successMessageUnfill:vu,summary:yu,tab_applications_label:ju,tab_attendance_label:wu,tab_attendees_label:ku,tab_info_label:xu,viewApplications:_u,vog:Du,waiting:Cu,waitlistBeFirst:Au,waitlistEmpty:Su,waitlistTitle:Mu,withdraw:Tu,youAndPeopleParticipated:zu,youParticipated:Pu},On=({deedId:n})=>{const a=P.useUtils(),s=Ti(n);return{refetchAll:d.useCallback(()=>{a.deeds.get.invalidate({id:n}),a.deeds.applications.list.invalidate({deedId:n}),a.deeds.applications.countAcceptedAndWaiting.invalidate({deedId:n}),a.me.applicationForDeed.invalidate({deedId:n}),s()},[a,n,s]),refetchBadges:s}},Dn={fw:"bold"},se={gap:"sm",wrap:"nowrap",align:"flex-start"},ma=({deed:n,adminOrModOrgOptions:a,refetchAll:s,setShowRegisterOrLogin:i,setShowApplyModal:o,setShowGuestApplyModal:t,setIsCreateGroupApplicationDialogOpen:l})=>{const u=G(),r=S(gn);return e.jsx(zi,{refetchData:s,setShowRegisterOrLogin:i,setShowApplyModal:o,setShowGuestApplyModal:t,deed:n,extraButton:u.whitelabel.settings.group_applications_enabled&&n.application_flow!==V.external&&n.status===rn.open&&a.length>0&&e.jsx(C,{variant:"muted",fullWidth:!0,onClick:()=>l(!0),children:r("groupApply")})})},Ru=({deed:n,organizer:a,applications:s,isLoggedIn:i,setShowRegisterOrLogin:o,setShowApplyModal:t,setShowGuestApplyModal:l,openEmailShare:u,setIsCreateGroupApplicationDialogOpen:r,organization:h,translatedDeedTitle:m,fullDeedUrlWithHttps:b,deedType:g,adminOrModOrgOptions:k,includeApplyButton:c,shouldAttemptTranslateToUserLanguage:D})=>{const v=G(),p=S(gn),[y,{open:j,close:x}]=ts(!1),{refetchAll:_}=On({deedId:n.id}),R=eo(),{openReportDialog:f}=no({onSuccess:(U,Te)=>{R.mutate({type:"deed",deed_id:n.id,reason:U},{onSuccess:()=>Te()})},question:p.g("sureReportDeed")}),W=d.useMemo(()=>({home:{icon:qs,label:p.g("from_home")},flexible:{icon:Vs,label:p.g("flexible_location")},address:{icon:Gs,label:p("address")}}),[p]),E=d.useMemo(()=>n.from_home?W.home:n.flexible_location?W.flexible:n.address?W.address:null,[n.from_home,n.flexible_location,n.address,W]),B=la(n,ra(p.g)),q=d.useMemo(()=>s.filter(U=>U.status===he.accepted),[s]),Y=d.useMemo(()=>s.filter(U=>U.status===he.waiting),[s]),N=d.useMemo(()=>
15{if(!a?.id)return null;const U={deedTitle:m,deedLink:b,deedType:g?p.g(`deed_${g}`):"deed",...lt(v.whitelabel.translations_meta,g?rt[g]:"deed","deedType")};return new URLSearchParams({[jn.toUsers]:a.id.toString(),[jn.subject]:p("messageOrganizerSubject",U),[jn.message]:p("messageOrganizerBody",U),[jn.deedId]:n.id.toString()})},[a?.id,n.id,p,m,b,g,v.whitelabel.translations_meta]),Q=n.vog&&!v.whitelabel.settings.hide_vog_option,ee=n.native_speaker&&!v.whitelabel.settings.hide_native_speaker,fe=n.members_only&&h.private_deeds_enabled,J=q.length>0&&e.jsxs(e.Fragment,{children:[p("peopleGoing",{smart_count:q.length}),Y.length>0&&e.jsxs(e.Fragment,{children:[" ","(",p("peopleOnWaitlist",{smart_count:Y.length}),")"]})]}),K=n?.waitlist&&n?.waitlisting,A=q.length,M=!n.filled&&!!n.capacity&&(n.application_flow===V.join||n.application_flow===V.apply&&n.capacity_enforced)&&!K&&e.jsx("span",{children:p("spotsLeft",{smart_count:Math.max(n.capacity-A,0)})},"spotsLeft");return e.jsxs(L,{gap:"lg",pos:"sticky",top:"var(--mantine-spacing-xs)",children:[e.jsxs(L,{gap:2,children:[e.jsx(T,{...Dn,children:p("practicalDetails")}),e.jsxs(I,{...se,children:[e.jsx(w,{icon:Ys,className:te.icon}),e.jsxs(T,{children:[St(p.g(`deed_${n.type}_short`)),(()=>{const U=ao(n.type,n.subtype,p.g,!1,v.whitelabel,n.format??null,!0);return U?` ⢠${U}`:""})()]})]}),B&&e.jsxs(I,{...se,children:[e.jsx(w,{icon:Js,className:te.icon}),B]}),E&&e.jsxs(I,{...se,children:[e.jsx(w,{icon:E.icon,className:te.icon,"aria-label":E.label,"aria-hidden":"false"}),n.address?n.address:St(E.label)]}),(J||M)&&e.jsxs(I,{...se,children:[e.jsx(w,{icon:Hs,className:te.icon}),e.jsxs(I,{gap:4,children:[J&&e.jsxs(e.Fragment,{children:[J,M&&e.jsx("span",{children:"â¢"})]}),M]})]}),c&&e.jsx(pe,{mt:"sm",children:e.jsx(ma,{deed:n,adminOrModOrgOptions:k,refetchAll:_,setShowRegisterOrLogin:o,setShowApplyModal:t,setShowGuestApplyModal:l,setIsCreateGroupApplicationDialogOpen:r})}),e.jsx(Fc,{deed:n,organizationSlug:h.slug,shouldAttemptTranslateToUserLanguage:D})]}),e.jsx(Kt,{c:"textSecondary",my:"sm"}),a&&e.jsxs(L,{gap:2,children:[e.jsx(T,{...Dn,children:p("contactPerson")}),e.jsxs(I,{wrap:"nowrap",align:"flex-start",children:[e.jsx(pe,{mt:"0.5em",children:e.jsx(Zt,{src:a.image||"",scale:32,withBorder:!0,isPresentational:!0})}),e.jsxs(L,{gap:0,children:[e.jsxs(T,{children:[a.first_names," ",n.p2p?"":a.last_name]}),e.jsxs(T,{style:{overflowWrap:"anywhere"},children:[!n.p2p&&n.status===rn.open&&!v.whitelabel.settings.deed_ask_organizer_question_disabled&&e.jsx(Ae,{to:`/messages/new?${N}`,onClick:()=>as(to.DEED_ASK_A_QUESTION),children:p("organizer",{firstName:a.first_names||""})}),v.whitelabel.settings.show_organizer_contact_info&&!n.p2p&&e.jsxs(e.Fragment,{children:[" ",p("reachOutDirectly")," ",a.email&&e.jsx("a",{href:`mailto:${a.email}`,children:a.email})," ",a.email&&a.phone_number&&p("or")," ",a.phone_number&&e.jsx("a",{href:`tel:${a.phone_number}`,children:a.phone_number}),"."]})]})]})]})]}),(n.cost_reimbursement||n.extra_support)&&e.jsxs(L,{gap:0,children:[e.jsx(T,{...Dn,children:p("provisions")}),n.cost_reimbursement&&e.jsxs(I,{...se,children:[e.jsx(w,{icon:Qs,className:te.icon}),p("cost_reimbursement")]}),n.extra_support&&e.jsxs(I,{...se,children:[e.jsx(w,{icon:Ks,className:te.icon}),p("extra_support")]})]}),e.jsxs(L,{gap:"lg",children:[(Q||ee||fe)&&e.jsxs(L,{gap:0,children:[e.jsx(T,{...Dn,children:p("requirements")}),Q&&e.jsxs(I,{...se,children:[e.jsx(w,{icon:Zs,className:te.icon}),p("vog")]}),ee&&e.jsxs(I,{...se,children:[e.jsx(w,{icon:sn,className:te.icon}),p("native_speaker")]}),fe&&e.jsxs(I,{...se,children:[e.jsx(w,{icon:sa,className:te.icon}),p.g("members_only")]})]}),e.jsxs(I,{gap:"xs",grow:!0,wrap:"nowrap",children:[!v.whitelabel.settings.login_wall&&e.jsx(tn,{label:p.g("share"),children:e.jsx(an,{onClick:j,title:p.g("share"),...on,children:e.jsx(w,{icon:ta})})}),n.status===rn.open&&e.jsx(tn,{label:p("inviteByEmail"),children:e.jsx(an,{onClick:u,title:p("inviteByEmail"),...on,children:e.jsx(w,{icon:Xs})})}),e.jsx(zc,{deed:n,isLoggedIn:i}),e.jsx(tn,{label:p("reportDeed"),children:e.jsx(an,{color:"danger",onClick:f,title:p("reportDeed"),...on,children:e.jsx(w,{icon:ei})})})]})]}),e.jsx(Ht,{opened:y,onClose:x,title:p.g("share"),children:e.jsx(Xt,{deed:n,organization:h,url:b,onEmailClick:()=>{x(),u()}})})]})},Ou=({deedId:n})=>{const a=S(lo),s=cn(),i=d.useRef(null),[o]=ea(),t=o.get(ss.filter),l=d.useMemo(()=>{const r=co(t);return so({t:a,location:s,refetchRef:i,filters:r})},[a,s,i,t]),u=d.useCallback(r=>({results:[...r?.deed?.listImpactReports?.results??[]],pageInfo:r?.deed?.listImpactReports?.pageInfo}),[]);return e.jsxs(e.Fragment,{children:[e.jsx(ro,{storeColumnsKey:"deed-attendance",columns:l,extractData:u,extraVariables:{id:n},document:io,refs:{refetch:i},isColumnsLoaded:!0}),e.jsx(oo,{onEditSuccess:()=>i.current?.()})]})},Iu=is(n=>n.deeds.deedsLikeThis,(n,a)=>a,(n,a,s)=>s,(n,a,s)=>
15n?.[s]?.[a]),Lu={en:"%{g:deed_community_plural | capitalize} you might also like",nl:"%{g:deed_community_plural | capitalize} die je misschien ook interessant vindt"},Eu={en:"%{g:deed_volunteering_plural | capitalize} you might also like",nl:"%{g:deed_volunteering_plural | capitalize} die je misschien ook interessant vindt"},Nu={en:"%{g:deed_workshop_plural | capitalize} you might also like",nl:"Vind %{g:deed_workshop_plural | capitalize} die bij jou passen"},Fu={likeThisCommunity:Lu,likeThisVolunteerings:Eu,likeThisWorkshops:Nu},$u={[oe.community]:"likeThisCommunity",[oe.volunteering]:"likeThisVolunteerings",[oe.workshop]:"likeThisWorkshops"},Bu=()=>Array.from({length:3}).map((n,a)=>e.jsx(bi,{},a)),Uu=n=>{const a=S(Fu),s=Mn(),i=G(),o=dn(t=>Iu(t,n.deed.id,n.deedType));return d.useEffect(()=>{!i.whitelabel.settings.deed_show_deeds_like_this||o||s(os({deedId:n.deed.id,deedType:n.deedType}))},[o,s,i,n.deed.id,n.deedType]),!i.whitelabel.settings.deed_show_deeds_like_this||!o||o.length===0?null:e.jsxs(L,{...F("deeds-like-this"),gap:"sm",children:[e.jsx(Kt,{my:"md"}),e.jsx(Fe,{order:3,size:"lg",children:a($u[n.deedType])}),e.jsx(ls,{cols:{base:1,md:2},children:o?o.map(t=>e.jsx(hi,{display:go.Grid,deed:t,postcodeGroups:n.postcodeGroups},t.id)):Bu()})]})},pa=H.memo(({deed:n})=>{const a=G(),s=mo();if(n.type===oe.community)return null;const i=uo(a.whitelabel),o=[oe.workshop,oe.volunteering].filter(t=>i.includes(t)).sort(t=>t===n.type?-1:0);return e.jsx(e.Fragment,{children:o.map(t=>e.jsx(Cn,{children:e.jsx(Uu,{deed:n,deedType:t,postcodeGroups:s})},t))})});pa.displayName="DeedsLikeThisSection";const Wu={en:"Successfully applied!",nl:"Aanmelden is gelukt!"},Gu={en:"You will receive an email confirmation as soon as possible (if you donât see it, please check your spam/junk folder!",nl:"Je ontvangt zo spoedig mogelijk bevestiging (zou in 'ongewenste mail' kunnen belanden)"},Vu={en:"Invite others to join you! ð",nl:"Nodig anderen uit om samen goed te doen! ð"},qu={en:"Successfully joined!",nl:"Aanmelden is gelukt!"},Yu={en:"If a spot opens up, you'll get a place automatically and we'll send you an e-mail. If you won't be able to make it anymore, just update your response.",nl:"Als er een plek vrijkomt, krijg je automatisch een plek en sturen we je een e-mail. Als je niet meer kunt komen, werk dan je reactie bij."},Ju={en:"You're on the wait list",nl:"Je staat op de wachtlijst"},Hu={successApplied:Wu,successConfirm:Gu,successInvite:Vu,successJoined:qu,waitlistedParagraph:Yu,waitlistedTitle:Ju},ha=H.memo(({isLoggedIn:n,show:a,status:s,onClose:i,onEmailShareClick:o})=>{const t=S(Hu);return e.jsx(un,{open:a,onClose:i,title:null,...F("deed-application-success-modal"),children:e.jsxs("div",{className:be.textCenter,children:[e.jsx(w,{icon:s==="waiting"?ni:ct,className:Ci.icon}),e.jsx("h3",{children:t(s==="waiting"?"waitlistedTitle":s==="accepted"?"successJoined":"successApplied")}),s==="waiting"?e.jsx(T,{children:t("waitlistedParagraph")}):s==="accepted"?e.jsx(e.Fragment,{children:null}):e.jsx(T,{children:t("successConfirm")}),n&&e.jsx("div",{className:Se(be.textCenter,be.marginTopR),children:e.jsx(C,{variant:"outline",onClick:()=>{o(),i()},children:t("successInvite")})})]})})});ha.displayName="SuccessDeedApplyModal";const Qu={en:"By taking the following actions you're able to increase the likelihood of receiving applications for your opportunity:",nl:"Je kunt nu al enkele acties ondernemen om meer aanmeldingen te krijgen. We hebben ze hieronder op een rijtje gezet:"},Ku={en:"Invite people you know",nl:"Nodig mensen uit die je kent"},Zu={en:"Your %{g:deed} is published and discoverable ð",nl:"Je %{g:deed} is gepubliceerd en vindbaar ð"},Xu={en:"Share on social media",nl:"Deel je %{g:deed} op social media"},eg={en:"Reach out to potential volunteers",nl:"Potentiële vrijwilligers aanschrijven"},ng={deedSuccessCreate:Qu,invite:Ku,published:Zu,shareSuccess:Xu,volunteerBankInvite:eg},ba=H.memo(({show:n,onClose:a,deed:s,organization:i,inviteClick:o})=>{const t=G(),l=S(ng),u=zn(),r=cn(),h=()=>{u(Yt({deed:{id:s.id,image:s.image,title:X({obj:s.title,currentlyActiveLanguage:t.language,whitelabel:t.whitelabel,originalContentLanguage:s.detected_primary_language})},activities:s.activities,causes:s.causes||[]}))},m=[!s.members_only&&!t.whitelabel.settings.login_wall&&e.jsx(rs,{popover:()=>e.jsx(Xt,{deed:s,organization:i,url:t.httpsUrl+r.pathname}),children:e.jsx(C,{variant:"outline",leftSection:e.jsx(w,{icon:sn}),children:l("shareSuccess")})},1),e.jsx(C,{variant:"outline",onClick:o,leftSection:e.jsx(w,{icon:ti}),children:l("invite")},3),t.whitelabel.settings.volunteer_bank_enabled&&e.jsx(C,{variant:"outline",onClick:h,leftSection:e.jsx(w,{icon:aa}),children:l("volunteerBankInvite")}
15,2)].filter(Boolean);return e.jsx(un,{open:n,showDismissButton:!0,overlayOptions:{shouldCloseOnBlur:!1,isDismissable:!1},onClose:a,title:null,...F("deed-publish-success-modal"),children:e.jsxs("div",{className:be.textCenter,children:[e.jsx(w,{icon:ct,className:Xn.publishedIcon}),e.jsx("h3",{children:l("published")}),e.jsx("p",{children:l("deedSuccessCreate")}),e.jsx("div",{className:Xn.buttonListWrapper,children:e.jsx("ul",{children:m.map((b,g)=>e.jsxs("li",{style:{listStyleType:"none",margin:"16px 0",textAlign:"left"},children:[e.jsx("div",{className:Xn.buttonLeader,children:g+1})," ",b]},g))})})]})})});ba.displayName="SuccessDeedPublishModal";const tg={en:"Back",nl:"Terug"},ag={en:"Cancel",nl:"Annuleren"},sg={en:"You are about to create a group application for ",nl:"Je staat op het punt een groepsaanmelding te maken voor"},ig={en:"%{smart_count} person.||||%{smart_count} persons.",nl:"%{smart_count} persoon.|||| %{smart_count} personen."},og={en:"You will become the point of contact for all communication and notifications around the applications and their status. This means you may receive some notifications %{count} times.",nl:"Je wordt de contactpersoon voor alle communicaties en notificaties voor de aanmeldingen en de statussen van de aanmeldingen. Dit betekent dat je bepaalde notificaties wel %{count} keer kunt ontvangen."},lg={en:"You can manage your group applications from Profile icon -> My %{g:deeds | capitalize} -> Group applications.",nl:"Je kunt de groepsaanmeldingen beheren via Profielicoon -> Mijn %{g:deeds | capitalize} -> Groepsaanmeldingen."},rg={en:"All applications will have the same form values filled.",nl:"Voor alle aanmeldingen worden dezelfde waarden gebruikt."},cg={en:"Create a group application",nl:"Een groep aanmelden"},dg={en:"All applications will have the same values filled.",nl:"Voor alle aanmeldingen worden dezelfde waarden gebruikt."},ug={en:"As an admin / moderator of %{g:aOrganization} %{g:organization}, you are able to make group applications on behalf of the members of your %{g:organization}. You will become the point of contact for all communication and notifications around the applications and their status.",nl:"Als beheerder / moderator van een %{g:organization} kun je groepsaanmeldingen maken namens de leden van de %{g:organization}. Je wordt het aanspreekpunt voor alle communicatie en meldingen rondom de aanvragen en de status."},gg={en:"Find members",nl:"Vind leden"},mg={en:"Select %{g:organization}",nl:"Selecteer %{g:organization}"},pg={en:"Proceed to the application form",nl:"Ga naar het aanmeldingsformulier"},hg={en:"Proceed to confirmation",nl:"Ga door naar bevestiging"},bg={en:"Create a group application",nl:"Een groep aanmelden"},fg={en:"Your group application has been created.",nl:"Je groepsaanmelding is aangemaakt."},fa={backLabel:tg,cancelLabel:ag,confirm1:sg,confirm1Person:ig,confirm2:og,confirm3:lg,confirm4:rg,dialogTitle:cg,formValues:dg,intro:ug,membersLabel:gg,organizationLabel:mg,proceedApplicationForm:pg,proceedConfirmation:hg,submitLabel:bg,successMessage:fg},vg={en:"%{fullName} (already applied)",nl:"%{fullName} (al gereageerd)"},yg={alreadyApplied:vg},jg={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListMembersWithApplications"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"organizationId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"deedId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filter"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"organization"},arguments:[{kind:"Argument",name:{kind:"Name",value:"idOrSlug"},value:{kind:"Variable",name:{kind:"Name",value:"organizationId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"listMembersWithApplications"},arguments:[{kind:"Argument",name:{kind:"Name",value:"deedId"},value:{kind:"Variable",name:{kind:"Name",value:"deedId"}}},{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"Variable",name:{kind:"Name",value:"filter"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fullName"}},{kind:"Field",name:{kind:"Name",value:"image"}},{kind:"Field",name:{kind:"Name",value:"hasApplication"}}]}}]}}]}}]},$t=(n,a)=>({id:n.id.toString(),image:n.image,fullName:n.hasApplication?a("alreadyApplied",{fullName:n.fullName}):n.fullName,isDisabled:n.hasApplication,isSelected:!n.hasApplication}),wg=({inputId:n,onChange:a,organizationId:s,ariaLabelledBy:i,deedId:o,preselectedUserIds:t})=>{const l=S(yg),[u]=yo(jg,{fetchPolicy:"network-only"}),r=d.useCallback(async()=>{const{data:m}=await u({variables:{organizationId:s.toString(),deedId:o.toString()}});return m?.organization?.listMembersWithApplications.map(b=>$t(b,l))??[]},[u,l,s,o]),h=d.useCallback(async m=>{const{data:b}=await u({variables:{organizationId:s.toString(),deedId:o.toString(),filter:m}});return b?.organization?.listMembersWithApplications.map(g=>$t(g,l))??[]},[u,s,o,l]);return e.jsx(po,{ariaLabelledBy:i,inputId:n,onChange:a,findUsers:h,fetchAllUsers:r,preselectedUserIds:t})},kg=({adminOrModOrgOption:n,onChange:a,value:s})=>{const i=S(fa);return e.jsx(Ce,{label:i("organizationLabel"),children:({inputId:o})=>e.jsx(at,{required:!0,id:o,options:n,value:s,onChange:a})})},Bt="CREATE_GROUP_APPLICATION_FORM",xg=({onSuccess:n,deed:a,onCancel:s,adminOrModOrgOptions:i})=>{const o=S(fa),t=P.useUtils(),l=P.deeds.groupApply.useMutation({onSuccess:()=>
15{t.deeds.pendingApplicationsCount.invalidate({deedId:a.id}),t.me.groupApplications.list.invalidate()}}),u=dn(v=>v.auth.user),[r,h]=d.useState("orgAndMembers"),m=Tn(),b=Me(),g=d.useCallback(async v=>{switch(r){case"orgAndMembers":{h("applicationForm");return}case"applicationForm":{h("confirm");return}case"confirm":{try{await l.mutateAsync({deedId:a.id,applicantIds:v.applicantIds,initialMessage:v.initial_message,...a.form&&{elementResponses:v.elementResponses}}),m({message:o("successMessage")})(null),n()}catch(p){b()(p)}break}default:throw new Error(`Invalid step: ${r.toString()}`)}},[r,b,m,l,o,a,n]),k=d.useCallback(()=>{switch(r){case"applicationForm":{h("orgAndMembers");break}case"confirm":{h("applicationForm");break}default:throw new Error("This should not happen")}},[r]);if(i.length<1)throw new Error("No orgs.");if(!u)throw new Error("No user.");const c=Jt({initialValues:{organizationId:i[0].value,applicantIds:[]},onSubmit:g}),D=c.values.applicantIds?.length||0;return e.jsx(Ut,{open:!0,title:o("dialogTitle"),mode:"confirm",okButtonProps:{type:"submit",form:Bt},okButtonLabel:o(r==="orgAndMembers"?"proceedApplicationForm":r==="applicationForm"?"proceedConfirmation":"submitLabel"),onCancel:r!=="orgAndMembers"?k:s,cancelButtonLabel:o(r==="orgAndMembers"?"cancelLabel":"backLabel"),showDismissButton:!c.submitting,forceHasCancelButton:!0,overlayOptions:{isDismissable:!c.submitting},isConfirming:c.submitting,children:e.jsxs(Wt,{id:Bt,className:"form",form:c,children:[r==="orgAndMembers"&&e.jsxs("div",{children:[e.jsx("p",{children:o("intro")}),e.jsx(kg,{adminOrModOrgOption:i,value:c.binding("organizationId").value,onChange:c.binding("organizationId").onChange}),e.jsx(Ce,{label:o("membersLabel"),children:({inputId:v})=>e.jsx(wg,{deedId:a.id,inputId:v,organizationId:c.values.organizationId,onChange:p=>{c.binding("applicantIds").onChange(p)},preselectedUserIds:c.binding("applicantIds").value.length?c.binding("applicantIds").value:[u.id]},c.values.organizationId)})]}),r==="applicationForm"&&e.jsxs("div",{children:[o("formValues"),e.jsx(Pi,{deed:a,status:he.pending,form:c,customForm:a.form})]}),r==="confirm"&&e.jsxs("ul",{children:[e.jsxs("li",{children:[o("confirm1"),o("confirm1Person",{smart_count:D})]}),e.jsx("li",{children:o("confirm2",{count:D})}),e.jsx("li",{children:o("confirm3")}),e.jsx("li",{children:o("confirm4")})]})]})})},_g={en:"Translate automatically to my language (%{locale})",nl:"Automatische vertaling naar mijn taal (%{locale})"},Dg={translate_to_my_language:_g},Cg={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateOwnTranslateToMyLanguage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"translateToMyLanguage"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateUser"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"translateToMyLanguage"},value:{kind:"Variable",name:{kind:"Name",value:"translateToMyLanguage"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"translateToMyLanguage"}}]}}]}}]}}]},Ag=()=>{const n=Mn(),i=!!dn(ot)?.id,[o]=cs(Cg),[,t]=ds();return l=>{ho(t,window.location.hostname,l),i&&o({variables:{translateToMyLanguage:l}}).then(({data:u})=>{if(u)return n(na({translate_to_my_language:u.updateUser.user.translateToMyLanguage}))}).catch(()=>null)}},Sg=()=>{const n=d.useContext(it),a=S(Dg),s=Ag();return e.jsx(bo,{checked:n,onChange:i=>s(i.currentTarget.checked),label:a("translate_to_my_language",{locale:a.g(`locale_${a.locale}`)})})},Mg=({deedId:n,deedApplicationStatus:a,setShowApplyModal:s,setSuccessDeedApplyModal:i,myApplication:o})=>{const{refetchAll:t,refetchBadges:l}=On({deedId:n}),u=Mn(),r=P.me.updatePhoneNumber.useMutation(),h=P.deeds.applyToDeed.useMutation(),m=P.deeds.applications.update.useMutation(),b=Me(),g=S(gn),k=d.useCallback(async(D,v)=>{const p=a,{initial_message:y,phone_number:j,elementResponses:x}=v;
15if(D)try{if(j){const _=await r.mutateAsync({phoneNumber:j});u(na({phone_number:_.phoneNumber}))}o?await m.mutateAsync({deedId:D.id,applicationId:o.id,data:{status:p,initial_message:y,...D.form&&{elementResponses:x}}}):await h.mutateAsync({deedId:D.id,initialMessage:y,status:p,...D.form&&{elementResponses:x}}),s(!1),i({show:!0,status:p}),t()}catch(_){t(),b()(_)}},[u,t,o,b,h,m,r,a,s,i]),c=d.useCallback(async D=>{if(!(!o||!D))try{await m.mutateAsync({deedId:D.id,applicationId:o.id,data:{status:he.closed_by_user}}),Sn.info({message:g("rsvp_closed_by_user")}),t(),l()}catch(v){b()(v)}},[o,g,m,t,l,b]);return{handleSubmitDeedApplication:k,closeMyDeedApplication:c}},Tg=({deedId:n,deedType:a,deedFilled:s,deedPublished:i,organizationSlug:o})=>{const t=S(gn),l=G(),u=Tn(),r=Me(),h=zn(),m=Ni(),b=Fi(),g=$i(),k=Bi(),c=P.deeds.publish.useMutation(),D=P.deeds.extend.useMutation(),{refetchAll:v,refetchBadges:p}=On({deedId:n}),y=d.useCallback(()=>{Mt.open({children:t("archiveDeedConfirm",{type:a?t.g(`deed_${a}`):"deed",...lt(l.whitelabel.translations_meta,a?rt[a]:"deed","type")}),okButtonProps:{color:"danger"},cancelButtonLabel:t.g("cancel"),onOk:async()=>{try{await b.mutateAsync({deedId:n,archived:!0}),v()}catch(E){r()(E)}}})},[t,v,r,n,a,l.whitelabel.translations_meta,b]),j=d.useCallback(()=>{Mt.open({children:t(i?"areYouSureUnarchivePublished":"areYouSureUnarchiveDraft"),okButtonProps:{color:"danger"},cancelButtonLabel:t.g("cancel"),onOk:async()=>{try{await b.mutateAsync({deedId:n,archived:!1}),v()}catch(E){r()(E)}}})},[t,v,b,r,n,i]);function x(E){const B=oa(!0,l.whitelabel)(E)||{};if(Object.keys(B).length>0){Sn.warning({message:qt(B),duration:3});return}c.mutateAsync({deedId:E.id}).then(q=>{u({message:t("successMessagePublish")})(null),v(),h({},{replace:!0,state:{openDeedPublishedModal:q.published}})}).catch(r())}const _=d.useCallback(async()=>{try{await m.mutateAsync({deedId:n,filled:!s}),v()}catch{}},[v,m,s,n]),R=d.useCallback(()=>{D.mutateAsync({deedId:n}).then(()=>{u({message:t("successMessageExtend")})(null),v()}).catch(r())},[D,v,u,r,t,n]),f=d.useCallback(()=>{g.mutate({deedId:n}),p(),h(`/o/${o}/${l.deedsString}`)},[g,p,h,o,l.deedsString,n]),W=d.useCallback(()=>{k.mutate({deedId:n}),p(),h(`/o/${o}/${l.deedsString}`)},[k,p,h,o,l.deedsString,n]);return{submitDeedPublish:x,archiveDeed:y,unarchiveDeed:j,toggleFilled:_,extendClick:R,cancelDeed:f,rejectDeed:W}},zg=({deed:n,deedAboutMeta:a,fullDeedUrlWithHttps:s,organization:i,translatedDeedTitle:o,translatedVenueName:t})=>{if(n.type!==oe.volunteering)return null;switch(n.detailedStatus){case ue.draft:case ue.archived:case ue.applicationsClosedButUpcoming:case ue.waitingForApproval:case ue.past:case ue.expired:return null;case ue.filled:{if(!n.waitlisting)return null;break}case ue.open:}const l=us(n),u=l?.country??gs(i.country_code??"nl"),r=n.date_ending||n.expires_at||void 0;return{"@context":"https://schema.org","@type":"JobPosting",datePosted:n.created_at,description:a,hiringOrganization:{"@type":"Organization",name:i.name,...i.url&&{sameAs:i.url},logo:i.image},title:o,directApply:!0,employmentType:"VOLUNTEER",...r?{validThrough:r}:{},url:s,...n.from_home?{jobLocationType:"TELECOMMUTE",applicantLocationRequirements:{"@type":"Country",name:u}}:{jobLocation:{"@type":"Place",address:l?{"@type":"PostalAddress",addressCountry:u,...l.city&&{addressLocality:l.city},...l.postcode&&{postalCode:l.postcode},...l.street&&{streetAddress:l.street}}:n.address??void 0,name:t||(n.address??void 0),...n.coordinates?.lat!=null&&{geo:{"@type":"GeoCoordinates",latitude:n.coordinates.lat,longitude:n.coordinates.lng}}}}}},$p=n=>{const a=ms();if(!a.deedId||!a.organizationSlug)throw new Error("deedId or organizationSlug param not found");const s=zn(),i=cn(),o=Number(a.deedId),t=G(),l=S(gn),u=S(ps),r=hs(),h=Qi(`(min-width: ${r.breakpoints.md})`),m=dn(ot),b=!!m?.id,g=bs(),[k]=P.deeds.get.useSuspenseQuery({id:o}),c=k.deed,D=k.organizer,v=k.myApplication,p=ia(),y={organizationId:c.organization_id,organization:g},j={...y,object:c},x=P.deeds.applications.list.useQuery({deedId:o}),_=x.data??[],R=_,f=k.organizationApproved,W=me({...j,resource:ge.deedApplications,action:"read"}),E=P.deeds.applications.markAllSeen.useMutation(),B=d.useRef(null);d.useEffect(()=>{W&&x.isSuccess&&B.current!==o&&(B.current=o,E.mutate({deedId:o}))},[W,x.isSuccess,o,E]);const q=me({...y,resource:ge.deeds,action:"update"}),Y=me({...j,resource:ge.deeds,action:"update"}),N=ui({deed:c,organization:g,whitelabel:t.whitelabel,access:p,organizationId:c.organization_id}),{options:Q}=fs(),ee=me({...j,resource:ge.deedApplications,action:"update"}),J=P.deeds.pendingApplicationsCount.useQuery({deedId:o},{enabled:ee}).data??null,K=me({...j,resource:ge.impactReports,action:"create"}),A=me({...j,resource:ge.impactReports,action:"read"}),M=gi(p),Te=P.deeds.pendingAttendanceCount.useQuery({deedId:o},{enabled:K}).data??null,[Be]=ea(),[ze,Ue]=d.useState(!1),[We,Pe]=d.useState(!1),[Ge,ve]=d.useState(!1),[In,Ve]=d.useState(!1),Ln=xc(),[qe,mn]=d.use
15State({show:!1}),[le,ye]=d.useState(null),[Ye,pn]=d.useState(!1),hn=d.useContext(it),Re=vs(),Z=c?.waitlist&&c?.waitlisting,Oe=!!g&&!!c,je=d.useMemo(()=>Oe?Re({...c,organization:g}):"",[Re,c,g,Oe]),Ie=d.useMemo(()=>Oe?`${t.httpsUrl}${je}`:t.httpsUrl+i.pathname,[Oe,je,t,i.pathname]),Je=d.useMemo(()=>Z?he.waiting:c?.application_flow===V.join?he.accepted:he.pending,[Z,c]),En=x.isFetching,{refetchAll:Le}=On({deedId:o}),{archiveDeed:He,unarchiveDeed:we,submitDeedPublish:Nn,toggleFilled:Qe,extendClick:Fn,cancelDeed:$n,rejectDeed:Bn}=Tg({deedId:o,deedType:c?.type,deedFilled:!!c?.filled,deedPublished:!!c?.published,organizationSlug:g?.slug}),{handleSubmitDeedApplication:Ee,closeMyDeedApplication:Ne}=Mg({deedId:o,deedApplicationStatus:Je,isLoggedIn:b,setSuccessDeedApplyModal:mn,setShowApplyModal:ve,myApplication:v}),bn=c?.status,ke=d.useRef(null);d.useEffect(()=>{const ce=`${i.pathname}${i.search}`;ke.current!==ce&&(Be.get(wn.showApply)!==null&&bn==="open"&&!v&&(ke.current=ce,b?ve(!0):ye("apply")),Be.get(wn.withdraw)!==null&&v?.status!=="closed_by_organization"&&v?.status!=="closed_by_user"&&(ke.current=ce,b?Ne(c):ye("withdraw")))},[i.search,i.pathname,bn,b,Be,Ee,v,Ne,c]);const $=hn&&!Ye,re=c&&X({obj:c.title,originalContentLanguage:c.detected_primary_language,currentlyActiveLanguage:t.language,whitelabel:t.whitelabel,shouldAttemptTranslateToUserLanguage:$});ys(re||"");const fn=d.useCallback(()=>{Ue(!0)},[]);if(!g||!c)return null;const mt=X({obj:g.about,originalContentLanguage:g.detected_primary_language,currentlyActiveLanguage:t.language,whitelabel:t.whitelabel,shouldAttemptTranslateToUserLanguage:$});if(n.deedRouteType!=="p2p"&&c.p2p||!c.p2p&&n.deedRouteType==="p2p")return e.jsx(Zn,{statusCode:301,to:{pathname:Re({...c,organization:g}),search:i.search}});if(!yi(o))return e.jsx(Zn,{to:g?`/o/${g.slug}`:"/"});if(c.organization_id!==g.id)return e.jsx(Zn,{to:c.organization?{pathname:Re({...c,organization:c.organization}),search:i.search}:`/o/${g.slug}`});const Un=c.address,Wn=X({obj:c.summary,originalContentLanguage:c.detected_primary_language,currentlyActiveLanguage:l.locale,whitelabel:t.whitelabel,shouldAttemptTranslateToUserLanguage:$}),pt=X({obj:c.about_html,originalContentLanguage:c.detected_primary_language,currentlyActiveLanguage:l.locale,whitelabel:t.whitelabel,shouldAttemptTranslateToUserLanguage:$}),Gn=X({obj:c.venue_name,originalContentLanguage:c.detected_primary_language,currentlyActiveLanguage:l.locale,whitelabel:t.whitelabel,shouldAttemptTranslateToUserLanguage:$}),ht=e.jsx(Ru,{deed:{...c,format:k.format},organizer:D,applications:_,setShowRegisterOrLogin:ye,setShowApplyModal:ve,setShowGuestApplyModal:Ve,isLoggedIn:b,openEmailShare:fn,setIsCreateGroupApplicationDialogOpen:Pe,organization:g,translatedDeedTitle:re,fullDeedUrlWithHttps:Ie,deedType:c.type,adminOrModOrgOptions:Q,includeApplyButton:h,shouldAttemptTranslateToUserLanguage:$});if(typeof window>"u"){js(()=>Ie);const ce=ws(),vt=ks(l.locale,t.whitelabel),yt=c.city||Un,jt=g.causes?g.causes.filter(de=>!!vt.find(xe=>xe.value===de)).map(de=>vt.find(xe=>xe.value===de).label.toLowerCase()).join(", "):"",ka=c.activities.map(de=>ce.find(xe=>xe.id===de[0])?.label.values.find(xe=>xe.id===de[1])?.label).filter(Boolean).map(de=>de.toLowerCase()).slice(0,5).join(", ")||"",wt=Wn||l(`deedAbout${jt?"Causes":""}${yt?"Location":""}`,{organization:g.name,location:yt,causes:jt,activities:ka}).trim();xs(()=>t.whitelabel.settings.disable_google_jobs?null:zg({deed:c,deedAboutMeta:wt,fullDeedUrlWithHttps:Ie,organization:g,translatedDeedTitle:re,translatedVenueName:Gn}));let yn=c.image;yn||(c.p2p&&g.cover_image_p2p?yn=g.cover_image_p2p:yn=g.cover_image||g.image),_s(()=>({"og:type":"article","og:title":`${re} | ${g.name}`,"og:description":wt,...Ds(yn),"twitter:card":"summary_large_image","twitter:creator":g.twitter_url||"",...t.siteName==="Deedmob"&&{"twitter:site":"@DeedMobGlobal"}}))}const va=!m||m.email!==null,bt=le?`${i.pathname}?${le==="apply"?wn.showApply:wn.withdraw}`:void 0,vn=bt?new URLSearchParams({[en.next]:bt}):null,ft=`locale_${c.detected_primary_language}`,ya=fi(c,g),Vn=e.jsxs(et,{gutter:"xl",children:[e.jsx(et.Col,{span:{base:12,md:8},children:e.jsxs(L,{gap:"lg",children:[e.jsx(Fe,{order:1,...F("deed-title"),size:"h2",lh:1,mb:-8,children:re}),e.jsx(Cs,{src:ya??"",alt:re??"",width:1600,height:900,fit:"crop",style:{width:"100%",height:"auto",aspectRatio:"16 / 9",objectFit:"cover"},skeletonStyle:{width:"100%",height:"auto",aspectRatio:"16 / 9"},lazy:!0}),e.jsx(pe,{className:ae.hideOnDesktop,children:ht}),!c.p2p&&e.jsx(Et,{children:e.jsxs(jo,{style:{alignItems:"center",flexWrap:"wrap"},children:[e.jsx(Zt,{scale:40,withBorder:!0,backgroundSize:"contain",src:g.image,style:{display:"inline-block"},isPresentational:!0}),g.name]})}),e.jsx(Et,{children:e.jsx("div",{className:ae.qr,children:e.jsx(_o,{additionalText:`#${c.id}`})})}),Wn&&e.jsx(T,{mt:"lx",fw:"bold",children:Wn}),pt&&e.jsx(Si,{children:Ji(pt)}),e.jsx(Cc,{deed:c}),!c.from_home&&!c.flexible_location&&Un&&e.jsx(Cn,{children:e.jsxs(L,{gap:6,children:[e.jsx(Fe,{order:3,size:"lg",children:l("gettingThere")}),Gn&&e.jsx(T,{children:Gn}),e.jsx("iframe",{title:l("map"),className:ae.map,src:`https://maps.google.com/maps/embed/v1/place?key=${vi}&q=${encodeURIComponent(Un)}&zoom=13`,allowFullScreen:!0})]})}),mt&&e.jsxs(L,{gap:6,children:[e.jsxs(Fe,{order:3,size:"lg",children:[l("about")," ",g.name]}),e.jsx(T,{children:Hi(mt)}),e.jsx(C,{mt:"xs",component:Ae,variant:"muted",size:"sm",to:`/o/${g.slug}/${ln(t.whitelabel,l.locale)}`,children:l("seeMoreDeedsBy",{organization_name:g.name})})]}),m&&(c.detected_primary_language!==l.locale||m.language!==l.locale)&&e.jsx(Cn,{children:e.jsx(pe,{w:"100%",mt:"md",children:e.jsxs(L,{gap:"xs",children:[e.jsx(Fe,{order:3,size:"lg",children:l.g("language")}),e.jsxs(I,{gap:"xs",children:[e.jsx(Sg,{}),hn&&e.jsx(C,{variant:"muted",size:"sm",onClick:()=>pn(!Ye),children:Ye?l("showTranslated",{locale:l.g(`locale_${m.language}`)}):l("showOriginal",{locale:l.g.has(ft)?l.g(ft):c.detected_primary_language})})]})]})})}),!h&&e.jsx(pe,{pos:"sticky",bottom:0,bg:"background.6",py:"sm",style:{marginLeft:"calc(var(--grid-size) * 4px * -1)",marginRight:"calc(var(--grid-size) * 4px * -1)",borderTop:"1px solid var(--mantine-color-background-3)",paddingLeft:"calc(var(--grid-size) * 4px)",paddingRight:"calc(var(--grid-size) * 4px)"},children:e.jsx(ma,{deed:c,adminOrModOrgOptions:Q,refetchAll:Le,setShowRegisterOrLogin:ye,setShowApplyModal:ve,setShowGuestApplyModal:Ve,setIsCreateGroupApplicationDialogOpen:Pe})}),e.jsx(pa,{deed:c})]})}),e.jsx(et.Col,{span:{base:12,md:4},className:ae.hideOnMobile,children:ht})]}),qn=Y&&c.application_flow!==V.external,Yn=A&&c.application_flow!==V.external;return e.jsxs("div",{children:[Y&&e.jsx("div",{children:e.jsx(Yr,{whitelabel:t.whitelabel,organization:g,archive:He,unarchive:we,isApprovedOrganization:f,publishCard:()=>
15Nn(c),onCancelConfirm:$n,onRejectConfirm:Bn,deed:{...c,applications:R},toggleFilled:Qe,inviteClick:fn,extendClick:Fn,canDelete:N})}),!va&&e.jsx(Gt,{status:"danger",title:l("signedInNoEmail"),alertClassName:ae.signedInNoEmailAlert,children:e.jsx(Ae,{to:"/settings/email",children:l("signedInNoEmailLink")})}),qn||Yn?e.jsxs(e.Fragment,{children:[e.jsx(Cn,{children:e.jsxs(Mi,{tabClassName:ae.tab,tabs:[{to:{pathname:je,state:{resetScroll:!1}},path:"/o/:organizationSlug/:deedsString/:deedSlug/:deedId",exact:!0,text:e.jsxs(e.Fragment,{children:[e.jsx(w,{icon:ai}),l("tab_info_label")]}),label:l("tab_info_label")},...qn?[{to:{pathname:`${je}/applications`,state:{resetScroll:!1}},path:"/o/:organizationSlug/:deedsString/:deedSlug/:deedId/applications",exact:!0,text:e.jsxs(Tt,{hidden:!J,variant:"emphasis",value:J,badgeClassName:ae.badge,children:[e.jsx(w,{icon:sa}),l(c.application_flow===V.join?"tab_attendees_label":"tab_applications_label")]}),label:l(c.application_flow===V.join?"tab_attendees_label":"tab_applications_label")}]:[],...Yn?[{to:{pathname:`${je}/attendance`,state:{resetScroll:!1}},path:"/o/:organizationSlug/:deedsString/:deedSlug/:deedId/attendance",exact:!1,text:e.jsxs(Tt,{hidden:!Te,variant:"emphasis",value:Te,badgeClassName:ae.badge,children:[e.jsx(w,{icon:si}),l("tab_attendance_label")]}),label:l("tab_attendance_label")}]:[]],children:[e.jsx("div",{className:be.paddingTopR,children:Vn}),qn&&e.jsx("div",{className:be.paddingTopR,children:En&&(!_||_.length===0)?e.jsx(As,{}):e.jsx(mi,{showExport:!0,showEmailApplicants:!0,showSuggestedApplications:M,showViewInList:q,deed:{...c,applications:R},whitelabel:t.whitelabel,organization:g,fetchData:Le})}),Yn&&e.jsx("div",{className:be.paddingTopR,children:e.jsx(Ss,{children:e.jsx(Ms,{path:"attendance/*",element:e.jsx(Ou,{deedId:c.id.toString()})})})})]})}),e.jsx(wo,{children:Vn})]}):Vn,e.jsx(pi,{deed:c,organization:g,show:ze,onHide:()=>Ue(!1),url:Ie}),e.jsx(un,{overlayOptions:{isDismissable:!0},open:le!==null,onClose:()=>ye(null),title:l("notLoggedInTitle"),footer:e.jsxs("div",{className:ae.notLoggedInFooter,children:[e.jsx(C,{variant:"outline",onClick:()=>{window.location.href=`/register${vn?`?${vn}`:""}`},...F("not-logged-in-dialog-register-button"),children:u("register")}),e.jsx(C,{onClick:()=>{window.location.href=`/login${vn?`?${vn}`:""}`},...F("not-logged-in-dialog-login-button"),children:u("login")})]}),children:e.jsx(T,{children:l("notLoggedInDescription",{title:re})})}),Ge&&e.jsx(Ri,{onClose:ja,deed:c,applyOrJoinStatus:Je,waitlisting:Z,translatedDeedTitle:re,onSubmitApplication:Ee}),c&&e.jsx(kc,{deed:c,open:In,onClose:()=>Ve(!1)}),We&&e.jsx(xg,{deed:c,onSuccess:()=>{Pe(!1),Le()},onCancel:()=>Pe(!1),adminOrModOrgOptions:Q}),e.jsx(ba,{deed:c,inviteClick:fn,organization:g,show:!qe.show&&!ze&&!!Ln.openDeedPublishedModal,onClose:()=>{s({},{replace:!0,state:{}})}}),e.jsx(ha,{isLoggedIn:b,show:qe.show,status:qe.status,onEmailShareClick:fn,onClose:wa}),e.jsx(Do,{when:Ge,message:l(c.application_flow===V.join?"joinCloseWarning":"applyCloseWarning")})]});function ja(){window.confirm(l(c.application_flow===V.join?"joinCloseWarning":"applyCloseWarning"))&&ve(!1)}function wa(){mn(ce=>({...ce,show:!1}))}};export{$p as default}; 16//# sourceMappingURL=index-B6u88Pp1.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.