PageSourceSearch

https://grouprev.com/build/assets/FundraiserPagesIndexPage-CUDEC1uu.js

js grouprev.com collected 2026-09-26 00:48:55 UTC 72,663 bytes, 3 lines download raw bytes

1import{c as d,o as r,f as t,_ as I,aq as S,$ as U,B as $,D as N,T as E,a3 as V,b as p,w as u,d as c,e as m,r as l,g as f,t as n,ar as oe,as as le,at as de,M as ue,au as me,a6 as q,a8 as ce,a9 as fe,W,h as M,F as k,av as Z,aw as j,i as R,a1 as H,k as T,ax as z,ap as L,m as B,p as ge,v as pe,C as he,ac as _e,u as G,ay as Q,az as we,P as O,a4 as K,aA as Y,L as J,a7 as ve,K as be,a as ye,aB as Pe,aC as Ce,aD as xe}from"./app-6TUkk-lE.js";import{F as Fe}from"./fundraiser-page-details-edit-Ct2pBMIK.js";import{F as Ie}from"./fundraiser-page-selector-D_J75dav.js";import{C as ke}from"./CsvExportBatchMixin-hjcb38ss.js";import"./team-members-modal-CkKyLF-_.js";function Me(s,e){return r(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"})])}function Ee(s,e){return r(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])}function Se(s,e){return r(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})])}
1const Ue={name:"FundraiserPageCreateModal",components:{TwButton:E,TwValidationErrors:N,TwInput:$,FundraiserPageDetailsEdit:Fe,TwModal:U},mixins:[S],props:{fundraiser:{type:Object,required:!0}},emits:["canceled","created"],data(){return{LoadingCreatingFundraiserPage:!1,ShowDetails:!1,ValidationErrorMessage:null,OwnerFirstName:null,OwnerLastName:null,OwnerEmail:null,FundraiserPage:{fundraiser_id:this.fundraiser.id}}},watch:{OwnerFirstName(s){this.FundraiserPage.title=`${this.fundraiser.title} for ${s} ${this.OwnerLastName||""}`.trim()},OwnerLastName(s){this.FundraiserPage.title=`${this.fundraiser.title} for ${this.OwnerFirstName||""} ${s}`.trim()}},beforeMount(){this.resetData()},methods:{resetData(){this.fundraiser.settings.default_long_desc&&(this.FundraiserPage.long_description=this.fundraiser.settings.default_long_desc),this.fundraiser.settings.default_short_desc&&(this.FundraiserPage.short_description=this.fundraiser.settings.default_short_desc),this.fundraiser.settings.default_goal&&(this.FundraiserPage.goal=this.fundraiser.settings.default_goal),this.fundraiser.settings.default_deadline&&(this.FundraiserPage.deadline=this.fundraiser.settings.default_deadline)},async modalOk(){try{this.ValidationErrorMessage=null,this.LoadingCreatingFundraiserPage=!0;const s=await V().itemCreate({owner_first_name:this.OwnerFirstName,owner_last_name:this.OwnerLastName,owner_email:this.OwnerEmail,fundraiser_id:this.fundraiser.id,...this.FundraiserPage});this.LoadingCreatingFundraiserPage=!1,await this.$refs.modal.close(),this.$emit("created",s)}catch(s){throw console.error(s),this.LoadingCreatingFundraiserPage=!1,s.response&&(this.ValidationErrorMessage=s.response.data),s}},modalCancel(){this.$refs.modal.close(),this.$emit("canceled")}}},Ve={class:"form-spacing"},Re={class:"bg-amber-50 my-8 p-4 rounded-lg text-sm"},Ne={class:"mb-2"},Le={class:"mt-8 mb-4 flex"};function De(s,e,g,P,a,o){const w=l("tw-input"),v=l("icon"),y=l("tw-button"),b=l("fundraiser-page-details-edit"),h=l("tw-validation-errors"),x=l("tw-modal");return r(),p(x,{ref:"modal",title:`Create a new page for ${g.fundraiser.title}`,"ok-text":"Create Fundraiser Page",onOk:o.modalOk,onCancel:o.modalCancel},{default:u(()=>[t("div",Ve,[t("div",null,[m(w,{modelValue:a.OwnerFirstName,"onUpdate:modelValue":e[0]||(e[0]=F=>a.OwnerFirstName=F),label:"First Name"},null,8,["modelValue"])]),t("div",null,[m(w,{modelValue:a.OwnerLastName,"onUpdate:modelValue":e[1]||(e[1]=F=>a.OwnerLastName=F),label:"Last Name"},null,8,["modelValue"])]),t("div",null,[m(w,{modelValue:a.OwnerEmail,"onUpdate:modelValue":e[2]||(e[2]=F=>a.OwnerEmail=F),label:"Email:"},null,8,["modelValue"])])]),t("div",Re,[t("p",Ne,[e[5]||(e[5]=f(" If the user doesn’t already have a GroupRev account, they’ll receive",-1)),t("span",null,n(g.fundraiser.settings.default_password?`the default password of ${g.fundraiser.settings.default_password}`:" a secure, randomly generated password"),1),e[6]||(e[6]=f(" to get started. ",-1))]),e[7]||(e[7]=t("p",null,"If they already have an account, they can log in with their existing password.",-1))]),t("div",Le,[m(y,{variant:"link",class:"underline",onClick:e[3]||(e[3]=F=>
1a.ShowDetails=!a.ShowDetails)},{default:u(()=>[e[8]||(e[8]=f(" Show Fundraiser Details ",-1)),m(v,{icon:a.ShowDetails?"chevron-up":"chevron-down"},null,8,["icon"])]),_:1})]),a.ShowDetails?(r(),p(b,{key:0,modelValue:a.FundraiserPage,"onUpdate:modelValue":e[4]||(e[4]=F=>a.FundraiserPage=F),loading:a.LoadingCreatingFundraiserPage,fundraiser:g.fundraiser,class:"mt-8"},null,8,["modelValue","loading","fundraiser"])):c("",!0),m(h,{"validation-result-error":a.ValidationErrorMessage},null,8,["validation-result-error"])]),_:1},8,["title","onOk","onCancel"])}const Te=I(Ue,[["render",De]]),A=oe("fundraiserInvite",{id:"fundraiserInvite",state:()=>({items:[],api:"/api/v1/fundraiser-invites"}),getters:{...de},actions:{async createFromEmailLists(s,e){const{data:g}=await axios.post(this.api+"/from-emails",{emails:e.emails,message:e.message,fundraiser_id:s.id});return this.items=g.data,g},async sendEmailNotification(s){const{data:e}=await axios.post(this.api+`/${s.id}/send-email-notification`);return e},async sendEmailNotificationToAll(s){const{data:e}=await axios.post(this.api+"/send-email-notifications",{not_paginated:!0,...s});return e},...le}}),Oe={name:"FundraiserInvitesFromEmailModal",components:{TwWysiwyg:me,TwValidationErrors:N,TwTextarea:ue,TwModal:U},mixins:[S],props:{fundraiser:{type:Object,required:!0}},emits:["created"],data(){return{LoadingCreatingInvitations:!1,EmailsString:null,Message:"Please join our fundraiser",ValidationErrorMessage:null}},computed:{userEmails(){return this.EmailsString?this.EmailsString.split(`
2`).map(s=>s.trim()).filter(s=>s):[]}},mounted(){},methods:{async submit(){try{this.ValidationErrorMessage=null,this.LoadingCreatingInvitations=!0,await A().createFromEmailLists(this.fundraiser,{emails:this.userEmails,message:this.Message}),this.LoadingCreatingInvitations=!1,this.$emit("created"),this.EmailsString=null,this.close()}catch(s){throw console.error(s),this.LoadingCreatingInvitations=!1,s.response&&(this.ValidationErrorMessage=s.response.data),s}}}},$e={class:"form-spacing"};function Ae(s,e,g,P,a,o){const w=l("tw-textarea"),v=l("tw-wysiwyg"),y=l("tw-validation-errors"),b=l("tw-modal");return r(),p(b,{ref:"modal",title:"Invite Group Members","ok-disabled":a.LoadingCreatingInvitations||o.userEmails.length===0,loading:a.LoadingCreatingInvitations,onOk:o.submit},{ok:u(()=>[e[2]||(e[2]=f(" Invite ",-1)),t("strong",null,n(o.userEmails.length),1)]),default:u(()=>[t("div",$e,[m(w,{modelValue:a.EmailsString,"onUpdate:modelValue":e[0]||(e[0]=h=>a.EmailsString=h),label:"Paste a list of emails, one per line"},null,8,["modelValue"]),m(v,{modelValue:a.Message,"onUpdate:modelValue":e[1]||(e[1]=h=>a.Message=h),label:"A short message to be included in the invitation email"},null,8,["modelValue"]),m(y,{"validation-result-error":a.ValidationErrorMessage},null,8,["validation-result-error"])])]),_:1},8,["ok-disabled","loading","onOk"])}
2const Be=I(Oe,[["render",Ae]]),je={name:"FundraiserInviteSendNotificationButton",components:{TwButton:E},props:{fundraiserInvite:{type:Object,required:!0}},data(){return{LoadingSendingNotification:!1}},methods:{async sendFundraiserInviteEmailNotification(){try{confirm("Are you sure you want to send the invitation email?")&&(this.ValidationErrorMessage=null,this.LoadingSendingNotification=!0,await A().sendEmailNotification(this.fundraiserInvite),this.LoadingSendingNotification=!1,this.$notify("Invitation email sent successfully","success"))}catch(s){throw console.error(s),this.LoadingSendingNotification=!1,s.response&&(this.ValidationErrorMessage=s.response.data),s}}}},ze={key:0},Ge={key:1};function qe(s,e,g,P,a,o){const w=l("tw-button");return r(),p(w,{loading:a.LoadingSendingNotification,onClick:o.sendFundraiserInviteEmailNotification},{default:u(()=>[a.LoadingSendingNotification?(r(),d("span",ze," Sending... ")):(r(),d("span",Ge," Resend invitation email "))]),_:1},8,["loading","onClick"])}const We=I(je,[["render",qe]]),Ze={name:"Fun
2draiserInvitesList",components:{FundraiserInviteSendNotificationButton:We,TwBadge:W,TwListGroupItem:fe,TwListGroup:ce},mixins:[q],props:{fundraiser:{type:Object,required:!1,default:null}},computed:{filters(){return{status:"pending",...this.fundraiser&&{fundraiser_id:this.fundraiser.id}}},itemsStoreModule(){return A()}},mounted(){this.fetchItems({clear:!0})}},He={class:"flex flex-row justify-center sm:justify-end mt-4 sm:mt-0"};function Qe(s,e,g,P,a,o){const w=l("tw-badge"),v=l("fundraiser-invite-send-notification-button"),y=l("tw-list-group-item"),b=l("tw-list-group");return r(),p(b,null,{default:u(()=>[(r(!0),d(k,null,M(s.items,h=>(r(),p(y,{key:"fundraiser-invite-list-key-"+h.id},{default:u(()=>[m(w,{variant:h.status==="accepted"?"green":"yellow"},{default:u(()=>[f(n(h.status),1)]),_:2},1032,["variant"]),f(" "+n(h.email)+" ",1),t("div",He,[m(v,{"fundraiser-invite":h},null,8,["fundraiser-invite"])])]),_:2},1024))),128))]),_:1})}const Ke=I(Ze,[["render",Qe]]),Ye={name:"FundraiserInvitesSendNotificationButton",components:{TwButton:E},props:{fundraiser:{type:Object,required:!1,default:null}},data(){return{LoadingSendingNotification:!1}},methods:{async sendFundraiserInviteEmailNotification(){try{confirm("Are you sure you want to resend the invitation email to all the pending invites?")&&(this.ValidationErrorMessage=null,this.LoadingSendingNotification=!0,await A().sendEmailNotificationToAll({status:"pending",...this.fundraiser&&{fundraiser_id:this.fundraiser.id}}),this.LoadingSendingNotification=!1,this.$notify("Invitation emails sent successfully","success"))}catch(s){throw console.error(s),this.LoadingSendingNotification=!1,s.response&&(this.ValidationErrorMessage=s.response.data),s}}}},Je={key:0},Xe={key:1};function es(s,e,g,P,a,o){const w=l("tw-button");return r(),p(w,{variant:"outline-amber",size:"sm",loading:a.LoadingSendingNotification,onClick:o.sendFundraiserInviteEmailNotification},{default:u(()=>[a.LoadingSendingNotification?(r(),d("span",Je," Sending... ")):(r(),d("span",Xe," Resend invitation email to ALL pending invites "))]),_:1},8,["loading","onClick"])}const ss=I(Ye,[["render",es]]),ts={name:"FundraiserPageAutoLoginButton",components:{TwButton:E,TwDropdownItem:j},mixins:[Z],props:{fundraiserPage:{type:Object,required:!0},component:{type:String,default:"tw-button"}},methods:{async autologinAsFundraiserPage(){confirm(`Login as supporter ${this.fundraiserPage.cached.owner_name}?`)&&(await R().startImpersonation(this.fundraiserPage.owner_user_id),await this.$router.push({name:"DashboardPage"}))}}};function as(s,e,g,P,a,o){return r(),p(H(g.component),{variant:s.variant,size:s.size,onClick:o.autologinAsFundraiserPage},{default:u(()=>[...e[0]||(e[0]=[f(" Auto Login ",-1)])]),_:1},8,["variant","size","onClick"])}const rs=I(ts,[["render",as]]),is={name:"FundraiserPageRebuildCacheButton",components:{TwButton:E,TwDropdownItem:j},mixins:[Z],props:{fundraiserPage:{type:Object,required:!0},component:{type:String,default:"tw-button"}},computed:{fundraiser(){return T().getItemById(this.fundraiserPage.fundraiser_id)}},methods:{async rebuildCache(){await V().rebuildCache(this.fundraiserPage.id),this.$notify("Cache rebuilt successfully","success")}}};function ns(s,e,g,P,a,o){return r(),p(H(g.component),{variant:s.variant,size:s.size,onClick:o.rebuildCache},{default:u(()=>[...e[0]||(e[0]=[f(" Rebuild Frontend Cache ",-1)])]),_:1},8,["variant","size","onClick"])}const os=I(is,[["render",ns]]),ls={props:{fundraiserPage:{type:Object,required:!0}},data(){return{LoadingResettingPassword:!1,RandomPassword:!1,DontSendEmailNotification:!1,ValidationErrorMessage:null,DisabledField:!1,NewPassword:null}},computed:{fundraiser(){return T().getItemById(this.fundraiserPage.fundraiser_id)}},watch:{DontSendEmailNotification(s){s&&(this.RandomPassword=!1)}},methods:{async resetPassword(){if(this.LoadingResettingPassword)return;const s=this.DontSendEmailNotification?"No email notification will be sent.":"The user will be notified of their new password.";if(confirm(`Reset password for ${this.fundraiserPage.cached.owner_name}? ${s}`))try{this.ValidationErrorMessage=null,this.LoadingResettingPassword=!0,await V().resetPassword(this.fundraiserPage.id,this.RandomPassword?null:this.NewPassword,!this.DontSendEmailNotification),this.$notify("Password reset successfully","success"),this.LoadingResettingPassword=!1,this.$refs.modal&&this.$refs.modal.close()}catch(e){throw console.error(e),this.LoadingResettingPassword=!1,e.response&&(this.ValidationErrorMessage=e.response.data),e}}}}
2,ds=z({name:"FundraiserPageResetPasswordModal",components:{TwCheckbox:L,TwValidationErrors:N,TwInput:$,TwModal:U},mixins:[ls,S],methods:{opened(){this.DontSendEmailNotification=!1,this.fundraiser.settings&&this.fundraiser.settings.default_password?(this.NewPassword=this.fundraiser.settings.default_password,this.RandomPassword=!1):(this.NewPassword=null,this.RandomPassword=!0),this.DisabledField=!1}}}),us=["disabled"];function ms(s,e,g,P,a,o){const w=l("tw-checkbox"),v=l("tw-input"),y=l("tw-validation-errors"),b=l("tw-modal");return r(),p(b,{ref:"modal","loading-overlay":"",loading:s.LoadingResettingPassword,"ok-disabled":!s.RandomPassword&&!s.NewPassword,title:`Reset password for ${s.fundraiserPage.cached&&s.fundraiserPage.cached.owner_legal_name?s.fundraiserPage.cached.owner_legal_name:"Unknown name"}`,onOk:s.resetPassword,onOpened:s.opened},{default:u(()=>[t("fieldset",{disabled:s.LoadingResettingPassword},[m(w,{modelValue:s.RandomPassword,"onUpdate:modelValue":e[0]||(e[0]=h=>s.RandomPassword=h),readonly:s.DontSendEmailNotification},{default:u(()=>[...e[3]||(e[3]=[f(" Generate a random password ",-1)])]),_:1},8,["modelValue","readonly"]),m(w,{modelValue:s.DontSendEmailNotification,"onUpdate:modelValue":e[1]||(e[1]=h=>s.DontSendEmailNotification=h)},{default:u(()=>[...e[4]||(e[4]=[f(" Don't send email notification ",-1)])]),_:1},8,["modelValue"]),s.RandomPassword?c("",!0):(r(),p(v,{key:0,modelValue:s.NewPassword,"onUpdate:modelValue":e[2]||(e[2]=h=>s.NewPassword=h),disabled:s.DisabledField,label:"New Password:"},null,8,["modelValue","disabled"])),m(y,{"validation-result-error":s.ValidationErrorMessage},null,8,["validation-result-error"])],8,us)]),_:1},8,["loading","ok-disabled","title","onOk","onOpened"])}
2const cs=I(ds,[["render",ms]]),fs=z({name:"FundraiserPageMergeModal",components:{ArrowRightIcon:Me,ExclamationTriangleIcon:Se,FundraiserPageSelector:Ie,TwModal:U,TwValidationErrors:N},mixins:[S],props:{fundraiserPage:{type:Object,required:!0}},emits:["merged","closed"],data(){return{FundraiserPageSelected:null,LoadingMergingFundraiserPage:!1,MergeConfirmed:!1,ValidationErrorMessage:null}},computed:{mergeButtonText(){return this.FundraiserPageSelected?"Merge these pages":"Select a destination"},mergeDisabled(){return!this.FundraiserPageSelected||!this.MergeConfirmed||this.LoadingMergingFundraiserPage}},watch:{FundraiserPageSelected(){this.MergeConfirmed=!1,this.ValidationErrorMessage=null}},methods:{resetMergeState(){this.FundraiserPageSelected=null,this.LoadingMergingFundraiserPage=!1,this.MergeConfirmed=!1,this.ValidationErrorMessage=null},pageOwnerName(s){return s?.cached?.owner_name||"Unknown owner"},pageTeamName(s){return s?.cached?.team_name||"No team"},pageDonationsCount(s){return s?.cached?.donations_confirmed_count??s?.cached?.donations_count??0},pageRaised(s){return s?.cached?.raised_formatted!==void 0&&s?.cached?.raised_formatted!==null?s.cached.raised_formatted:s?.cached?.raised!==void 0&&s?.cached?.raised!==null?Number(s.cached.raised).toLocaleString():"0"},async mergeFundraiserPage(){if(!this.mergeDisabled)try{this.ValidationErrorMessage=null,this.LoadingMergingFundraiserPage=!0,await V().mergeInto(this.fundraiserPage.id,this.FundraiserPageSelected.id),await this.close(),this.$notify(`Merged "${this.fundraiserPage.title}" into "${this.FundraiserPageSelected.title}".`,"success"),this.$emit("merged",{which:this.fundraiserPage,into:this.FundraiserPageSelected})}catch(s){const e=s.response?.data?.message||"Unable to merge these fundraiser pages.";this.ValidationErrorMessage=s.response?.data&&typeof s.response.data=="object"?s.response.data:{message:e},this.$notify(e,"danger")}finally{this.LoadingMergingFundraiserPage=!1}}}}),gs={class:"space-y-6"},ps={class:"grid items-stretch gap-3 sm:grid-cols-[1fr_auto_1fr]"},hs={class:"rounded-xl border-2 border-amber-300 bg-amber-50 p-4"},_s={class:"mt-3 flex items-center gap-3"},ws=["src","alt"],vs={class:"min-w-0"},bs={class:"truncate font-semibold text-gray-900"},ys={class:"truncate text-sm text-gray-600"},Ps={class:"text-xs text-gray-500"},Cs={class:"mt-4 grid grid-cols-2 gap-3 text-sm"},xs={class:"font-semibold text-gray-900"},Fs={class:"font-semibold text-gray-900"},Is={class:"col-span-2"},ks={class:"font-semibold text-gray-900"},Ms={class:"flex items-center justify-center text-gray-400"},Es={class:"mt-3 flex items-center gap-3"},Ss=["src","alt"],Us={class:"min-w-0"},Vs={class:"truncate font-semibold text-gray-900"},Rs={class:"truncate text-sm text-gray-600"},Ns={class:"text-xs text-gray-500"},Ls={class:"mt-4 grid grid-cols-2 gap-3 text-sm"},Ds={class:"font-semibold text-gray-900"},Ts={class:"font-semibold text-gray-900"},Os={class:"col-span-2"},$s={class:"font-semibold text-gray-900"},As={key:1,class:"flex min-h-36 items-center justify-center text-center text-sm text-gray-500"},Bs={key:0,class:"rounded-xl bg-gray-50 p-4"},js={key:1,class:"rounded-xl border border-red-200 bg-red-50 p-4"},zs={class:"flex gap-3"},Gs={class:"mt-1 text-sm text-red-800"},qs={class:"mt-3 flex cursor-pointer items-start gap-2 text-sm font-medium text-red-900"};function Ws(s,e,g,P,a,o){const w=l("tw-validation-errors"),v=l("fundraiser-page-selector"),y=l("ArrowRightIcon"),b=l("ExclamationTriangleIcon"),h=l("tw-modal");return r(),p(h,{ref:"modal",title:"Merge fundraiser pages",size:"lg",variant:"danger",loading:s.LoadingMergingFundraiserPage,"ok-disabled":s.mergeDisabled,"ok-text":s.mergeButtonText,onOpened:s.resetMergeState,onClosed:e[3]||(e[3]=x=>s.$emit("closed")),onCancel:e[4]||(e[4]=x=>s.$emit("closed")),onOk:s.mergeFundraiserPage},{default:u(()=>[m(w,{"validation-result-error":s.ValidationErrorMessage,onClose:e[0]||(e[0]=x=>s.ValidationErrorMessage=null)},null,8,["validation-result-error"]),t("div",gs,[t("div",null,[e[6]||(e[6]=t("h4",{class:"text-base font-semibold text-gray-900"}," Choose the destination page ",-1)),e[7]||(e[7]=t("p",{class:"mt-1 text-sm text-gray-600"}," Search for the page that should remain active after the merge. ",-1)),m(v,{modelValue:s.FundraiserPageSelected,"onUpdate:modelValue":e[1]||(e[1]=x=>s.FundraiserPageSelected=x),"except-ids":[s.fundraiserPage.id],class:"mt-3","fundraiser-id":s.fundraiserPage.fundraiser_id},{default:u(()=>[...e[5]||(e[5]=[f(" Select a destination page ",-1)])]),_:1},8,["modelValue","except-ids","fundraiser-id"])]),t("div",ps,[t("section",hs,[e[11]||(e[11]=t("p",{class:"text-xs font-bold uppercase tracking-wide text-amber-800"}," Source page — will be hidden ",-1)),t("div",_s,[s.fundraiserPage.cached?.owner_avatar_url_small?(r(),d("img",{key:0,src:s.fundraiserPage.cached.owner_avatar_url_small,alt:s.pageOwnerName(s.fundraiserPage),class:"size-10 rounded-full object-cover"},null,8,ws)):c("",!0),t("div",vs,[t("h5",bs,n(s.fundraiserPage.title),
21),t("p",ys,n(s.pageOwnerName(s.fundraiserPage)),1),t("p",Ps," Page ID: "+n(s.fundraiserPage.id),1)])]),t("dl",Cs,[t("div",null,[e[8]||(e[8]=t("dt",{class:"text-gray-500"}," Donations ",-1)),t("dd",xs,n(s.pageDonationsCount(s.fundraiserPage)),1)]),t("div",null,[e[9]||(e[9]=t("dt",{class:"text-gray-500"}," Raised ",-1)),t("dd",Fs,n(s.pageRaised(s.fundraiserPage)),1)]),t("div",Is,[e[10]||(e[10]=t("dt",{class:"text-gray-500"}," Team ",-1)),t("dd",ks,n(s.pageTeamName(s.fundraiserPage)),1)])])]),t("div",Ms,[m(y,{class:"size-7 rotate-90 sm:rotate-0","aria-hidden":"true"}),e[12]||(e[12]=t("span",{class:"sr-only"},"merges into",-1))]),t("section",{class:B(["rounded-xl border-2 p-4",s.FundraiserPageSelected?"border-blue-300 bg-blue-50":"border-dashed border-gray-300 bg-gray-50"])},[t("p",{class:B(["text-xs font-bold uppercase tracking-wide",s.FundraiserPageSelected?"text-blue-800":"text-gray-500"])}," Destination page — remains active ",2),s.FundraiserPageSelected?(r(),d(k,{key:0},[t("div",Es,[s.FundraiserPageSelected.cached?.owner_avatar_url_small?(r(),d("img",{key:0,src:s.FundraiserPageSelected.cached.owner_avatar_url_small,alt:s.pageOwnerName(s.FundraiserPageSelected),class:"size-10 rounded-full object-cover"},null,8,Ss)):c("",!0),t("div",Us,[t("h5",Vs,n(s.FundraiserPageSelected.title),1),t("p",Rs,n(s.pageOwnerName(s.FundraiserPageSelected)),1),t("p",Ns," Page ID: "+n(s.FundraiserPageSelected.id),1)])]),t("dl",Ls,[t("div",null,[e[13]||(e[13]=t("dt",{class:"text-gray-500"}," Donations ",-1)),t("dd",Ds,n(s.pageDonationsCount(s.FundraiserPageSelected)),1)]),t("div",null,[e[14]||(e[14]=t("dt",{class:"text-gray-500"}," Raised ",-1)),t("dd",Ts,n(s.pageRaised(s.FundraiserPageSelected)),1)]),t("div",Os,[e[15]||(e[15]=t("dt",{class:"text-gray-500"}," Team ",-1)),t("dd",$s,n(s.pageTeamName(s.FundraiserPageSelected)),1)])])],64)):(r(),d("div",As," Select a destination above to compare the pages. "))],2)]),s.FundraiserPageSelected?(r(),d("div",Bs,[...e[16]||(e[16]=[t("h4",{class:"font-semibold text-gray-900"}," What will happen ",-1),t("ul",{class:"mt-2 list-disc space-y-1 pl-5 text-sm text-gray-700"},[t("li",null,"Donations, recurring subscriptions, subscribers, updates, invitations, and slideshow media from the source will move to the destination."),t("li",null,"The destination page keeps its title, owner, team, URL, and other page details."),t("li",null,"If the destination has no thank-you message, it will receive the source page's message."),t("li",null,"The source page will be hidden and neither page can be merged again until this operation is undone.")],-1)])])):c("",!0),s.FundraiserPageSelected?(r(),d("div",js,[t("div",zs,[m(b,{class:"mt-0.5 size-6 shrink-0 text-red-600","aria-hidden":"true"}),t("div",null,[e[20]||(e[20]=t("h4",{class:"font-semibold text-red-900"}," Confirm the direction carefully ",-1)),t("p",Gs,[t("strong",null,n(s.fundraiserPage.title),1),e[17]||(e[17]=f(" will be hidden. ",-1)),t("strong",null,n(s.FundraiserPageSelected.title),1),e[18]||(e[18]=f(" will remain active. ",-1))]),t("label",qs,[ge(t("input",{"onUpdate:modelValue":e[2]||(e[2]=x=>s.MergeConfirmed=x),type:"checkbox",class:"mt-0.5 rounded border-red-300 text-red-600 focus:ring-red-600"},null,512),[[pe,s.MergeConfirmed]]),e[19]||(e[19]=t("span",null,"I confirm that the source and destination pages are correct.",-1))])])])])):c("",!0)])]),_:1},8,["loading","ok-disabled","ok-text","onOpened","onOk"])}const Zs=I(fs,[["render",Ws]]),Hs={name:"UserQuickEditModal",components:{TwLoadingSpinner:_e,TwCheckbox:L,TwEmail:he,TwInput:$,TwModal:U},mixins:[S],props:{userId:{type:Number,required:!0}},data(){return{LoadingSaving:!1,LoadingFetching:!0,ChangePassword:!1,UserName:null,UserEmail:null,UserPassword:null,UserDisplayName:null}},methods:{async resetData(){const s=await G().fetchItemById(this.userId);this.UserName=s.name,this.UserEmail=s.email,this.UserDisplayName=s.display_name,this.UserPassword=null,this.LoadingFetching=!1},async saveUserQuickEdit(){try{this.ValidationErrorMessage=null,this.LoadingSaving=!0,await G().itemPatch({id:this.userId,...this.UserName!=null&&{name:this.UserName},...this.UserEmail!=null&&{email:this.UserEmail},...this.UserDisplayName!=null&&{display_name:this.UserDisplayName}}),this.LoadingSaving=!1,await this.$refs.modal.close()}catch(s){throw console.error(s),this.LoadingSaving=!1,s.response&&(this.ValidationErrorMessage=s.response.data),s}}}}
2,Qs={key:1},Ks={class:"grid grid-cols-2 gap-4"},Ys={class:"my-4"};function Js(s,e,g,P,a,o){const w=l("tw-loading-spinner"),v=l("tw-email"),y=l("tw-input"),b=l("tw-modal");return r(),p(b,{ref:"modal",loading:a.LoadingSaving,"ok-text":"Save User Info",onOk:o.saveUserQuickEdit,onOpened:o.resetData},{default:u(()=>[a.LoadingFetching?(r(),p(w,{key:0})):(r(),d("div",Qs,[t("div",Ks,[t("div",null,[m(v,{modelValue:a.UserEmail,"onUpdate:modelValue":e[0]||(e[0]=h=>a.UserEmail=h),label:"User Email"},null,8,["modelValue"])]),t("div",null,[m(y,{modelValue:a.UserName,"onUpdate:modelValue":e[1]||(e[1]=h=>a.UserName=h),label:"User full name"},null,8,["modelValue"])])]),t("div",Ys,[m(y,{modelValue:a.UserDisplayName,"onUpdate:modelValue":e[2]||(e[2]=h=>a.UserDisplayName=h),label:"User display name","small-label":"If this user does not want their real name to be publicly visible, you can fill this field"},null,8,["modelValue"])])]))]),_:1},8,["loading","onOk","onOpened"])}const Xs=I(Hs,[["render",Js]]),et={name:"FundraiserPageManageDropdown",components:{UserQuickEditModal:Xs,FundraiserPageMergeModal:Zs,FundraiserPageResetPasswordModal:cs,FundraiserPageRebuildCacheButton:os,FundraiserPageAutoLoginButton:rs,TwDropdownItem:j,TwDropdown:we,Cog6ToothIcon:Ee},mixins:[Q],props:{fundraiserPage:{type:Object,required:!0}},emits:["updated"],computed:{organizationId(){const s=this.fundraiserPage?.fundraiser;return s?.beneficiary_type==="App\\Models\\Organization"?s.beneficiary_id:null},canManageFundraiserPage(){return R().can(O.FUNDRAISER_PAGES_MANAGE,this.organizationId)}},methods:{async deleteFundraiserPage(){if(confirm(`Are you sure you want to delete the fundraiser page "${this.fundraiserPage.title}"?`))try{await V().itemDelete(this.fundraiserPage.id),this.$notify("Fundraiser page deleted successfully","success"),this.$emit("updated")}catch(s){this.$notify(s.response?.data?.message||"Unable to delete fundraiser page.","danger")}}}};function st(s,e,g,P,a,o){const w=l("Cog6ToothIcon"),v=l("tw-dropdown-item"),y=l("fundraiser-page-auto-login-button"),b=l("fundraiser-page-rebuild-cache-button"),h=l("tw-dropdown"),x=l("user-quick-edit-modal"),F=l("fundraiser-page-reset-password-modal"),i=l("fundraiser-page-merge-modal");return r(),d(k,null,[m(h,{size:"sm","no-dropdown-icon":""},{button:u(()=>[m(w,{class:"h-4"})]),default:u(()=>[m(v,{to:{name:"FundraiserPageDetailsPage",params:{fundraiserPageId:g.fundraiserPage.id}}},{default:u(()=>[...e[4]||(e[4]=[f(" Edit ",-1)])]),_:1},8,["to"]),m(v,{to:{name:"FundraiserPageDonationsPage",params:{fundraiserPageId:g.fundraiserPage.id}}},{default:u(()=>[...e[5]||(e[5]=[f(" Donations ",-1)])]),_:1},8,["to"]),m(v,{target:"_blank",to:{name:"FundraiserPagePublicPage",params:{fundraiserPageId:g.fundraiserPage.id,slug:g.fundraiserPage.slug}}},{default:u(()=>[...e[6]||(e[6]=[f(" View Page ",-1)])]),_:1},8,["to"]),o.canManageFundraiserPage?(r(),p(y,{key:0,"fundraiser-page":g.fundraiserPage,component:"tw-dropdown-item"},null,8,["fundraiser-page"])):c("",!0),o.canManageFundraiserPage?(r(),p(v,{key:1,onClick:e[0]||(e[0]=C=>s.$refs.fundraiserPageResetPasswordModal.open())},{default:u(()=>[...e[7]||(e[7]=[f(" Reset Password ",-1)])]),_:1})):c("",!0),o.canManageFundraiserPage?(r(),p(v,{key:2,onClick:e[1]||(e[1]=C=>s.$refs.fundraiserPageMergeModal.open())},{default:u(()=>[...e[8]||(e[8]=[f(" Merge into another fundraiser ",-1)])]),_:1})):c("",!0),o.canManageFundraiserPage?(r(),p(v,{key:3,onClick:e[2]||(e[2]=C=>s.$refs[`userEditModal${g.fundraiserPage.owner_user_id}`].open())},{default:u(()=>[...e[9]||(e[9]=[f(" Change user details ",-1)])]),_:1})):c("",!0),o.canManageFundraiserPage?(r(),p(b,{key:4,"fundraiser-page":g.fundraiserPage,component:"tw-dropdown-item"},null,8,["fundraiser-page"])):c("",!0),o.canManageFundraiserPage?(r(),p(v,{key:5,variant:"danger",onClick:o.deleteFundraiserPage},{default:u(()=>[...e[10]||(e[10]=[f(" Delete ",-1)])]),_:1},8,["onClick"])):c("",!0)]),_:1}),o.canManageFundraiserPage?(r(),p(x,{key:0,ref:`userEditModal${g.fundraiserPage.owner_user_id}`,"user-id":g.fundraiserPage.owner_user_id},null,8,["user-id"])):c("",!0),o.canManageFundraiserPage?(r(),p(F,{key:1,ref:"fundraiserPageResetPasswordModal","fundraiser-page":g.fundraiserPage},null,8,["fundraiser-page"])):c("",!0),o.canManageFundraiserPage?(r(),p(i,{key:2,ref:"fundraiserPageMergeModal","fundraiser-page":g.fundraiserPage,onMerged:e[3]||(e[3]=C=>s.$emit("updated"))},null,8,["fundraiser-page"])):c("",!0)],64)}
2const tt=I(et,[["render",st]]),at={name:"FundraiserPageImportFromCsvModal",components:{TwButton:E,TwCheckbox:L,TwSelect:J,TwGridDual:Y,TwUploadField:K,TwModal:U},mixins:[S],props:{fundraiser:{type:Object,required:!0}},emits:["processed"],data(){return{ProposedColumns:null,AvailableColumnsInCsv:[],MatchedColumns:{},CsvUpload:null,CsvUploadProcessedResult:null,CsvUploadProcessedIdentifiersResult:null,Loading:!1,UnpublishAll:!1,PublishAllImported:!1,OverrideExistingEmails:!1,LoadingProposingColumns:!1,LoadingProcessing:!1,LoadingProcessingIdentifier:!1,ShowMatchedDetails:!0,ShowUnmatchedDetails:!0,ShowFailedDetails:!0,SendEmailNotificationsToNewUsers:!0,SendEmailNotificationsToExistingUsers:!1,ForcePasswordResetExistingUsers:!1,AllowMultiplePagesPerUser:!1}},computed:{allMandatoryFieldsMatched(){const s=["firstname","lastname","email"];return this.AllowMultiplePagesPerUser||s.unshift("identifier"),s.every(e=>this.MatchedColumns[e]!==null&&this.MatchedColumns[e]!=="")},okText(){return this.CsvUploadProcessedIdentifiersResult?"Import":"Preview Import First"},defaultGoalFormatted(){return this.$filters.formatCurrency(this.fundraiser.settings.default_goal,this.fundraiser.currency||this.fundraiser.settings?.currency)}},methods:{async processCsvImport(){try{this.ValidationErrorMessage=null,this.LoadingProcessing=!0,this.CsvUploadProcessedIdentifiersResult=null;const{data:s}=await axios.post(`/api/v1/fundraisers/${this.fundraiser.id}/csv-import-process`,{upload_id:this.CsvUpload.id,columns:this.MatchedColumns,unpublish_all:this.UnpublishAll,publish_all_imported:this.PublishAllImported,override_existing_emails:this.OverrideExistingEmails,send_email_notifications_to_new_users:this.SendEmailNotificationsToNewUsers,send_email_notifications_to_existing_users:this.SendEmailNotificationsToExistingUsers,force_password_reset_existing_users:this.ForcePasswordResetExistingUsers,allow_multiple_pages_per_user:this.AllowMultiplePagesPerUser});this.CsvUploadProcessedResult=s,this.LoadingProcessing=!1,await this.$refs.modal.close(),this.$notify(`Created ${s.created.length} supporter pages, updated ${s.updated.length} supporter pages, failed ${s.failed.length} rows`),this.$emit("processed",this.CsvUploadProcessedResult)}catch(s){throw console.error(s),this.LoadingProcessing=!1,s.response&&(this.ValidationErrorMessage=s.response.data),s}},async processIdentifiersCsvImport(){try{this.ValidationErrorMessage=null,this.LoadingProcessingIdentifier=!0;const{data:s}=await axios.post(`/api/v1/fundraisers/${this.fundraiser.id}/csv-import-process-identifiers`,{upload_id:this.CsvUpload.id,columns:this.MatchedColumns,unpublish_all:this.UnpublishAll,publish_all_imported:this.PublishAllImported,override_existing_emails:this.OverrideExistingEmails,send_email_notifications_to_new_users:this.SendEmailNotificationsToNewUsers,send_email_notifications_to_existing_users:this.SendEmailNotificationsToExistingUsers,force_password_reset_existing_users:this.ForcePasswordResetExistingUsers,allow_multiple_pages_per_user:this.AllowMultiplePagesPerUser});this.CsvUploadProcessedIdentifiersResult=s,this.LoadingProcessingIdentifier=!1,this.$emit("processed",this.CsvUploadProcessedResult)}catch(s){throw console.error(s),this.LoadingProcessingIdentifier=!1,s.response&&(this.ValidationErrorMessage=s.response.data),s}},async proposeColumns(s){try{this.CsvUpload=s,this.ValidationErrorMessage=null,this.LoadingProposingColumns=!0,this.CsvUploadProcessedIdentifiersResult=null;const{data:e}=await axios.post(`/api/v1/fundraisers/${this.fundraiser.id}/csv-import-guess-columns`,{upload_id:s.id});this.AvailableColumnsInCsv=e.available_columns_in_csv?e.available_columns_in_csv:[],this.ProposedColumns=e;for(const g of Object.keys(this.ProposedColumns.expected_columns))this.MatchedColumns[g]=this.ProposedColumns.matched_columns[g];this.LoadingProposingColumns=!1}catch(e){throw console.error(e),this.LoadingProposingColumns=!1,e.response&&(this.ValidationErrorMessage=e.response.data),e}}}},rt={class:"flex my-7"},it={key:0},nt={class:"-mb-2 md:mb-3 text-sm"},ot={class:"mb-4 md:mb-3"},lt={key:0,class:"text-xs mt-1"},dt={key:0,class:"text-green-600"},ut={key:1,class:"text-red-500"},mt={key:1,class:"text-xs mt-1"},ct={key:0,class:"text-green-600"},ft={key:1,class:"text-red-500"},gt={key:2,class:"text-xs mt-1 text-red-700"},pt={key:3,class:"text-xs mt-1 text-yellow-700"},ht={key:4,class:"text-xs mt-1 text-red-700"},_t={key:5,class:"text-xs mt-1"},wt={key:0,class:"clearfix mt-4"},vt={class:"text-sm text-green-700 bg-green-50 p-4"},bt={class:"font-bold"},yt={key:0,class:"mt-2"},Pt={class:"list-disc pl-5"},Ct={key:0,class:"block"},xt={class:"text-sm text-yellow-700 bg-yellow-50 p-4 mt-4"},Ft={class:"font-bold"},It={key:0,class:"mt-2"},kt={class:"list-disc pl-5"},Mt={key:0,class:"block"},Et={class:"flex justify-center my-4"},St={key:1,class:"text-sm text-red-700 bg-red-50 p-4 mt-4"},Ut={class:"font-bold"},Vt={key:0,class:"mt-2"},Rt={class:"list-disc pl-5"},Nt={key:0,class:"block"};function Lt(s,e,g,P,a,o){const w=l("tw-grid-dual"),v=l("tw-upload-field"),y=l("tw-select"),b=l("tw-checkbox"),h=l("icon"),x=l("tw-button"),F=l("tw-modal");return r(),p(F,{ref:"modal",size:"xl",loading:a.LoadingProcessing,title:"Import From Csv","ok-text":o.okText,"ok-disabled":a.LoadingProcessing||!o.allMandatoryFieldsMatched||!a.CsvUploadProcessedIdentifiersResult||a.LoadingProcessingIdentifier,onOk:o.processCsvImport},{default:u(()=>[m(w,null,{default:u(()=>[...e[10]||(e[10]=[t("div",null,[t("div",{class:"form-label"}," Expected fields "),t("div",null," first name, last name, email ")],-1),t("div",null,[t("div",{class:"form-label"}," Optional fields "),t("div",null," identifier, display name, alternative email, phone numbers, default password, goal, deadline, published, team name ")],-1)])]),_:1}),t("div",rt,[m(v,{"file-types":["text/csv"],onUploaded:o.proposeColumns},{default:u(()=>[...e[11]||(e[11]=[f(" Upload CSV File ",-1)])]),_:1},8,["onUploaded"])]),a.ProposedColumns?(r(),d("div",it,[e[20]||(e[20]=t("div",{class:"form-label mb-4"}," Map Columns for CSV ",-1)),(r(!0),d(k,null,M(Object.keys(a.ProposedColumns.expected_columns),(i,C)=>(r(),p(w,{key:"proposed-columns-"+C},{default:u(()=>[t("div",nt,n(a.ProposedColumns.expected_columns[i]),1),t("div",ot,[m(y,{modelValue:a.MatchedColumns[i],"onUpdate:modelValue":D=>a.MatchedColumns[i]=D,options:a.AvailableColumnsInCsv},null,8,["modelValue","onUpdate:modelValue","options"]),i==="goal"&&!a.MatchedColumns[i]?(r(),d("div",lt,[e[12]||(e[12]=f(" Goal used will be the default goal of the fundraiser: ",-1)),g.fundraiser.settings.default_goal?(r(),d("strong",dt,n(o.defaultGoalFormatted),1)):(r(),d("strong",ut," Please set a default goal in the Group Member settings"))])):c("",!0),i==="deadline"&&!a.MatchedColumns[i]?(r(),d("div",mt,[e[13]||(e[13]=f(" Deadline used will be the default deadline of the fundraiser: ",-1)),g.fundraiser.settings.default_deadline?(r(),d("strong",ct,n(s.$filters.formatDateOnly(g.fundraiser.settings.default_deadline)),1)):(r(),d("strong",ft," Please set a default deadline in the Group Member settings"))])):c("",!0),i==="email"&&!a.MatchedColumns[i]?(r(),d("div",gt," Please note that if you do not match the email column, the system will use the identifier as the email address for the supporter page. ")):c("",!0),i==="identifier"&&a.AllowMultiplePagesPerUser&&!a.MatchedColumns[i]?(r(),d("div",pt," Identifier can be left unmapped in this mode. A unique identifier will be generated for each row so the same user can own multiple supporter pages. ")):c("",!0),i==="published"&&a.PublishAllImported?(r(),d("div",ht," This field will be ignored and all supporter pages will be published immediately. ")):c("",!0),i==="team"&&a.MatchedColumns[i]?(r(),d("div",_t," Supporter pages will join a team with the matching name. If the team does not exist for this fundraiser, it will be created automatically. ")):c("",!0)])]),_:2},1024))),128)),m(w,null,{default:u(()=>[t("div",null,[m(b,{modelValue:a.UnpublishAll,"onUpdate:modelValue":e[0]||(e[0]=i=>a.UnpublishAll=i),"label-secondary":"All current fundraisers for this campaign will be unpublished so any fundraisers not mentioned in the CSV will stay unpublished",label:"Unpublish any existing supporter pages"},null,8,["modelValue"]),m(b,{modelValue:a.PublishAllImported,"onUpdate:modelValue":e[1]||(e[1]=i=>a.PublishAllImported=i),"label-secondary":"All fundraisers in the CSV will be published immediately regardless of the column value in the csv.",label:"Publish all supporter pages from the CSV immediately"},null,8,["modelValue"]),m(b,{modelValue:a.OverrideExistingEmails,"onUpdate:modelValue":e[2]||(e[2]=i=>a.OverrideExistingEmails=i),"label-secondary":"If a fundraiser from the csv is found in GroupRev but that user has a different email address for login than the one in the csv, their login email will be updated, their password reset and their new credentials included in the notification email",label:"Change the emails of the existing users to those in the CSV"},null,8,["modelValue"]),m(b,{modelValue:a.SendEmailNotificationsToNewUsers,"onUpdate:modelValue":e[3]||(e[3]=i=>a.SendEmailNotificationsToNewUsers=i),"label-secondary":"Users that will have their email reset to the one in the csv file are considered new users and their password will be reset",label:"Send email notifications to new users"},null,8,["modelValue"]),m(b,{modelValue:a.SendEmailNotificationsToExistingUsers,"onUpdate:modelValue":e[4]||(e[4]=i=>a.SendEmailNotificationsToExistingUsers=i),"label-secondary":"This will not reset the
2ir password nor will it send any credential information, just a notification that their fundraiser has been created/updated.",label:"Send email notifications to existing users"},null,8,["modelValue"]),m(b,{modelValue:a.ForcePasswordResetExistingUsers,"onUpdate:modelValue":e[5]||(e[5]=i=>a.ForcePasswordResetExistingUsers=i),"label-secondary":"This will reset the password to the existing users, and their new password will be included in the notification email.",label:"Force password reset for existing users"},null,8,["modelValue"]),m(b,{modelValue:a.AllowMultiplePagesPerUser,"onUpdate:modelValue":e[6]||(e[6]=i=>a.AllowMultiplePagesPerUser=i),"label-secondary":"When enabled, supporter pages will only match existing records by identifier. Duplicate email rows can create multiple supporter pages for the same user, and identifiers will be auto-generated if left blank.",label:"Allow multiple supporter pages per user"},null,8,["modelValue"])])]),_:1}),a.CsvUploadProcessedIdentifiersResult?(r(),d("div",wt,[t("div",vt,[t("span",{class:"cursor-pointer hover:bg-green-200 p-2 rounded-lg",onClick:e[7]||(e[7]=i=>a.ShowMatchedDetails=!a.ShowMatchedDetails)},[m(h,{class:"mr-1",icon:a.ShowMatchedDetails?"chevron-down":"chevron-right"},null,8,["icon"]),e[14]||(e[14]=f()),t("span",bt,n(a.CsvUploadProcessedIdentifiersResult.matched.length)+" / "+n(a.CsvUploadProcessedIdentifiersResult.uploaded_in_csv_count),1),e[15]||(e[15]=f(" matched supporter pages already existing.",-1))]),a.ShowMatchedDetails?(r(),d("div",yt,[t("ul",Pt,[(r(!0),d(k,null,M(a.CsvUploadProcessedIdentifiersResult.matched,(i,C)=>(r(),d("li",{key:"matched-"+C,class:"mb-2"},[i.team?(r(),d("span",Ct,"Team: "+n(i.team),1)):c("",!0),f(" "+n(i.identifier)+", "+n(i.email)+" "+n(i.displayname?i.displayname:null)+", "+n(i.firstname)+", "+n(i.lastname)+" "+n(i.fundraiser_page_email)+" "+n(i.fundraiser_owner_email_changed?" - Email Updated":"")+" "+n(i.fundraiser_owner_email_notification_send?" - Email notification will be sent":"")+" "+n(i.fundraiser_owner_credentials_reset?` - Password will be reset to '${i.fundraiser_owner_new_password}'`:null)+" "+n(i.fundraiser_to_be_published?" - Publish":" - Do Not Publish"),1)]))),128))])])):c("",!0)]),t("div",xt,[t("span",{class:"cursor-pointer hover:bg-yellow-200 p-2 rounded-lg",onClick:e[8]||(e[8]=i=>a.ShowUnmatchedDetails=!a.ShowUnmatchedDetails)},[m(h,{class:"mr-1",icon:a.ShowUnmatchedDetails?"chevron-down":"chevron-right"},null,8,["icon"]),e[16]||(e[16]=f()),t("span",Ft,n(a.CsvUploadProcessedIdentifiersResult.not_matched.length)+" / "+n(a.CsvUploadProcessedIdentifiersResult.uploaded_in_csv_count),1),e[17]||(e[17]=f(" not matched, they will be created supporter pages.",-1))]),a.ShowUnmatchedDetails?(r(),d("div",It,[t("ul",kt,[(r(!0),d(k,null,M(a.CsvUploadProcessedIdentifiersResult.not_matched,(i,C)=>(r(),d("li",{key:"not-matched-"+C},[i.team?(r(),d("span",Mt,"Team: "+n(i.team),1)):c("",!0),f(" "+n(i.identifier)+", "+n(i.email)+", "+n(i.displayname?i.displayname:null)+", "+n(i.firstname)+", "+n(i.lastname)+", "+n(i.email)+" "+n(i.fundraiser_owner_email_changed?"Email Updated":"")+" - "+n(i.fundraiser_owner_email_notification_send?"Email notification will be sent":"")+" "+n(i.fundraiser_owner_credentials_reset?` - Password will be reset to '${i.fundraiser_owner_new_password}'`:null)+" "+n(i.fundraiser_to_be_published?" - Publish":" - Do Not Publish"),1)]))),128))])])):c("",!0)])])):c("",!0),t("div",Et,[m(x,{size:"lg",variant:"warning",loading:a.LoadingProcessingIdentifier,onClick:o.processIdentifiersCsvImport},{default:u(()=>[...e[18]||(e[18]=[f(" Preview Import Result ",-1)])]),_:1},8,["loading","onClick"])]),a.CsvUploadProcessedResult?.failed?.length?(r(),d("div",St,[t("span",{class:"cursor-pointer hover:bg-red-200 p-2 rounded-lg",onClick:e[9]||(e[9]=i=>a.ShowFailedDetails=!a.ShowFailedDetails)},[m(h,{class:"mr-1",icon:a.ShowFailedDetails?"chevron-down":"chevron-right"},null,8,["icon"]),t("span",Ut,n(a.CsvUploadProcessedResult.failed.length),1),e[19]||(e[19]=f(" rows failed during import. ",-1))]),a.ShowFailedDetails?(r(),d("div",Vt,[t("ul",Rt,[(r(!0),d(k,null,M(a.CsvUploadProcessedResult.failed,(i,C)=>(r(),d("li",{key:"failed-"+C,class:"mb-2"},[i.team?(r(),d("span",Nt,"Team: "+n(i.team),1)):c("",!0),f(" "+n(i.identifier)+", "+n(i.email)+", "+n(i.displayname?i.displayname:null)+", "+n(i.firstname)+", "+n(i.lastname)+" - "+n(i.error_class)+": "+n(i.error_message),1)]))),128))])])):c("",!0)])):c("",!0)])):c("",!0)]),_:1},8,["loading","ok-text","ok-disabled","onOk"])}
2const Dt=I(at,[["render",Lt]]),Tt={name:"FundraiserPagesGenerateCsvExportButton",components:{TwButton:E},props:{filters:{type:Object,default:()=>({})}},emits:["generate-csv-export-batch","csv-export"],data(){return{LoadingDownloadingCsv:!1,ValidationErrorMessage:null}},methods:{async generateCsvExport(){try{this.ValidationErrorMessage=null,this.LoadingDownloadingCsv=!0;const s=await V().generateCsvExport(this.filters);this.$emit("generate-csv-export-batch",s.batch),this.$emit("csv-export",s.csv_export),console.log(s),this.LoadingDownloadingCsv=!1}catch(s){throw console.error(s),this.LoadingDownloadingCsv=!1,s.response&&(this.ValidationErrorMessage=s.response.data),s}}}};function Ot(s,e,g,P,a,o){const w=l("tw-button");return r(),p(w,{variant:"outline-light",icon:"file",size:"sm",loading:a.LoadingDownloadingCsv,onClick:o.generateCsvExport},{default:u(()=>[f(n(a.LoadingDownloadingCsv?"Preparing CSV...":"Generate CSV"),1)]),_:1},8,["loading","onClick"])}const $t=I(Tt,[["render",Ot]]),At={name:"FundraiserChildTeamImportFromCsvModal",components:{TwButton:E,TwCheckbox:L,TwGridDual:Y,TwModal:U,TwSelect:J,TwUploadField:K,TwValidationErrors:N},mixins:[S],props:{fundraiser:{type:Object,required:!0}},emits:["processed"],data(){return{AvailableColumnsInCsv:[],CsvUpload:null,ImportResult:null,LoadingGuessingColumns:!1,LoadingPreview:!1,LoadingProcessing:!1,MatchedColumns:{},PreviewResult:null,ProposedColumns:null,PublishAllImported:!1,SendEmailNotificationsToNewUsers:!0,ValidationErrorMessage:null}},computed:{allMandatoryFieldsMatched(){return["player_first_name","player_last_name","contact_email","contact_first_name","contact_last_name","team_name"].every(e=>this.MatchedColumns[e])},completed(){return this.ImportResult!==null},importableRowsCount(){return(this.PreviewResult?.created?.length||0)+(this.PreviewResult?.updated?.length||0)},okDisabled(){return this.completed?!1:this.LoadingGuessingColumns||this.LoadingPreview||this.LoadingProcessing||!this.PreviewResult||this.importableRowsCount===0},okText(){return this.completed?"Close":"Import Sports Teams"}},methods:{open(){this.reset(),this.$refs.modal.open()},reset(){this.AvailableColumnsInCsv=[],this.CsvUpload=null,this.ImportResult=null,this.LoadingGuessingColumns=!1,this.LoadingPreview=!1,this.LoadingProcessing=!1,this.MatchedColumns={},this.PreviewResult=null,this.ProposedColumns=null,this.PublishAllImported=!1,this.SendEmailNotificationsToNewUsers=!0,this.ValidationErrorMessage=null},clearPreview(){this.PreviewResult=null,this.ImportResult=null},requestPayload(){return{upload_id:this.CsvUpload.id,columns:this.MatchedColumns,publish_all_imported:this.PublishAllImported,send_email_notifications_to_new_users:this.SendEmailNotificationsToNewUsers}},handleError(s,e){const g=s.response?.data,P=g?.message||e;this.ValidationErrorMessage=g&&typeof g=="object"?g:{message:P},this.$notify(P,"danger")},async proposeColumns(s){this.CsvUpload=s,this.ProposedColumns=null,this.MatchedColumns={},this.clearPreview(),this.ValidationErrorMessage=null,this.LoadingGuessingColumns=!0;try{const{data:e}=await axios.post(`/api/v1/fundraisers/${this.fundraiser.id}/child-team-csv-import-guess-columns`,{upload_id:s.id});this.ProposedColumns=e,this.AvailableColumnsInCsv=e.available_columns_in_csv||[],this.MatchedColumns={...e.matched_columns}}catch(e){console.error(e),this.handleError(e,"Unable to read the child team CSV file.")}finally{this.LoadingGuessingColumns=!1}},async previewImport(){this.clearPreview(),this.ValidationErrorMessage=null,this.LoadingPreview=!0;try{const{data:s}=await axios.post(`/api/v1/fundraisers/${this.fundraiser.id}/child-team-csv-import-preview`,this.requestPayload());this.PreviewResult=s}catch(s){console.error(s),this.handleError(s,"Unable to preview the child team import.")}finally{this.LoadingPreview=!1}},async processImport(){this.ValidationErrorMessage=null,this.LoadingProcessing=!0;try{const{data:s}=await axios.post(`/api/v1/fundraisers/${this.fundraiser.id}/child-team-csv-import-process`,this.requestPayload());this.ImportResult=s,this.$emit("processed",s),s.failed.length>
20?this.$notify(`Imported ${s.created.length} child pages, updated ${s.updated.length}, and failed ${s.failed.length} rows.`,"danger"):(this.$notify(`Created ${s.created.length} child pages and updated ${s.updated.length}.`,"success"),await this.$refs.modal.close())}catch(s){console.error(s),this.handleError(s,"Unable to import the child teams.")}finally{this.LoadingProcessing=!1}},async handleOk(){if(this.completed){await this.$refs.modal.close();return}await this.processImport()}}},Bt={class:"flex items-center gap-4 my-6"},jt={key:0,class:"text-sm text-gray-600"},zt={key:1,class:"text-sm text-gray-600"},Gt={key:0},qt={class:"flex items-center justify-between mb-4"},Wt={class:"text-xs text-gray-600"},Zt={class:"-mb-2 md:mb-3 text-sm"},Ht={class:"mb-4 md:mb-3"},Qt={class:"border-t pt-4 mt-2"},Kt={class:"flex justify-center my-5"},Yt={key:1},Jt={class:"grid grid-cols-2 md:grid-cols-3 gap-3 my-5"},Xt={class:"rounded-lg bg-green-50 p-3"},ea={class:"text-2xl font-semibold text-green-700"},sa={class:"rounded-lg bg-blue-50 p-3"},ta={class:"text-2xl font-semibold text-blue-700"},aa={class:"rounded-lg bg-amber-50 p-3"},ra={class:"text-2xl font-semibold text-amber-700"},ia={class:"rounded-lg bg-purple-50 p-3"},na={class:"text-2xl font-semibold text-purple-700"},oa={class:"rounded-lg bg-cyan-50 p-3"},la={class:"text-2xl font-semibold text-cyan-700"},da={class:"rounded-lg bg-orange-50 p-3"},ua={class:"text-2xl font-semibold text-orange-700"},ma={class:"text-sm text-gray-600 mb-4"},ca={key:0,class:"rounded-lg bg-red-50 p-4 my-4 text-sm text-red-800"},fa={class:"font-semibold mb-2"},ga={class:"list-disc pl-5 max-h-48 overflow-y-auto space-y-1"},pa={key:0},ha={key:1,class:"rounded-lg border border-gray-200 p-4 my-4"},_a={class:"cursor-pointer font-semibold text-sm"},wa={class:"max-h-72 overflow-y-auto mt-3 divide-y"},va={class:"font-semibold"},ba={class:"text-gray-600"},ya={key:2,class:"my-5"},Pa={class:"rounded-lg bg-green-50 p-4 text-green-800"},Ca={key:0,class:"rounded-lg bg-red-50 p-4 mt-4 text-sm text-red-800"},xa={class:"font-semibold mb-2"},Fa={class:"list-disc pl-5 max-h-48 overflow-y-auto space-y-1"},Ia={key:0};function ka(s,e,g,P,a,o){const w=l("tw-validation-errors"),v=l("tw-upload-field"),y=l("tw-select"),b=l("tw-grid-dual"),h=l("tw-checkbox"),x=l("tw-button"),F=l("tw-modal");return r(),p(F,{ref:"modal",size:"xl",loading:a.LoadingProcessing,title:"Import Sports Teams from CSV","ok-text":o.okText,"ok-disabled":o.okDisabled,onOk:o.handleOk},{default:u(()=>[e[12]||(e[12]=t("p",{class:"text-sm mb-5"}," Create a supporter page for every child and assign it to the matching team. When a player email is provided, the page belongs to that player account; otherwise it belongs to the parent or contact account. Multiple children may share the same parent account. ",-1)),m(w,{"validation-result-error":a.ValidationErrorMessage,onClosed:e[0]||(e[0]=i=>a.ValidationErrorMessage=null)},null,8,["validation-result-error"]),e[13]||(e[13]=t("div",{class:"rounded-lg bg-gray-50 p-4 text-sm"},[t("div",{class:"font-semibold mb-1"}," Required CSV fields "),t("div",null," Player first name, player last name, parent/contact email, parent/contact first name, parent/contact last name, and team name. "),t("div",{class:"text-xs text-gray-600 mt-2"}," Player email is optional. Introductory rows before the CSV header and blank rows between teams are supported. "),t("details",{class:"border-t border-gray-200 mt-4 pt-3"},[t("summary",{class:"cursor-pointer font-semibold text-gray-700"}," Accepted CSV header variants "),t("dl",{class:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-3 mt-3 text-xs"},[t("div",null,[t("dt",{class:"font-semibold text-gray-700"}," Player First Name "),t("dd",{class:"text-gray-600"}," player first name, player_first_name, child first name, child_first_name ")]),t("div",null,[t("dt",{class:"font-semibold text-gray-700"}," Player Last Name "),t("dd",{class:"text-gray-600"}," player last name, player_last_name, child last name, child_last_name ")]),t("div",null,[t("dt",{class:"font-semibold text-gray-700"},[f(" Player Email "),t("span",{class:"font-normal"},"(optional)")]),t("dd",{class:"text-gray-600"}," player email, player_email, child email, child_email ")]),t("div",null,[t("dt",{class:"font-semibold text-gray-700"}," Parent/Contact Email "),t("dd",{class:"text-gray-600"}
2," contact email, contact_email, parent email, parent_email, email, email address ")]),t("div",null,[t("dt",{class:"font-semibold text-gray-700"}," Parent/Contact First Name "),t("dd",{class:"text-gray-600"}," contact first name, contact_first_name, parent first name, parent_first_name ")]),t("div",null,[t("dt",{class:"font-semibold text-gray-700"}," Parent/Contact Last Name "),t("dd",{class:"text-gray-600"}," contact last name, contact_last_name, parent last name, parent_last_name ")]),t("div",null,[t("dt",{class:"font-semibold text-gray-700"}," Team Name "),t("dd",{class:"text-gray-600"}," team name, team_name, team ")])]),t("p",{class:"text-xs text-gray-500 mt-3"}," Header matching ignores capitalization, spaces, underscores, and punctuation. You can also map any CSV header manually after uploading the file. ")])],-1)),t("div",Bt,[m(v,{"file-types":["text/csv",".csv"],onUploaded:o.proposeColumns},{default:u(()=>[...e[3]||(e[3]=[f(" Upload Sports Team CSV ",-1)])]),_:1},8,["onUploaded"]),a.CsvUpload?(r(),d("span",jt,n(a.CsvUpload.filename),1)):c("",!0),a.LoadingGuessingColumns?(r(),d("span",zt,"Detecting columns...")):c("",!0)]),a.ProposedColumns?(r(),d("div",Gt,[t("div",qt,[t("div",null,[e[4]||(e[4]=t("div",{class:"form-label"}," Map CSV columns ",-1)),t("div",Wt," Header detected on row "+n(a.ProposedColumns.header_row)+". ",1)])]),(r(!0),d(k,null,M(a.ProposedColumns.expected_columns,(i,C)=>(r(),p(b,{key:C},{default:u(()=>[t("div",Zt,n(i),1),t("div",Ht,[m(y,{modelValue:a.MatchedColumns[C],"onUpdate:modelValue":[D=>a.MatchedColumns[C]=D,o.clearPreview],options:a.AvailableColumnsInCsv},null,8,["modelValue","onUpdate:modelValue","options"])])]),_:2},1024))),128)),t("div",Qt,[m(h,{modelValue:a.PublishAllImported,"onUpdate:modelValue":[e[1]||(e[1]=i=>a.PublishAllImported=i),o.clearPreview],label:"Publish all imported child pages","label-secondary":"Publishing requires the fundraiser beneficiary to be verified."},null,8,["modelValue","onUpdate:modelValue"]),m(h,{modelValue:a.SendEmailNotificationsToNewUsers,"onUpdate:modelValue":[e[2]||(e[2]=i=>a.SendEmailNotificationsToNewUsers=i),o.clearPreview],label:"Email newly created page owner accounts","label-secondary":"Each newly created account receives one welcome email, even when it owns multiple child pages."},null,8,["modelValue","onUpdate:modelValue"])]),t("div",Kt,[m(x,{size:"lg",variant:"warning",loading:a.LoadingPreview,disabled:!o.allMandatoryFieldsMatched||a.LoadingGuessingColumns||a.LoadingProcessing,onClick:o.previewImport},{default:u(()=>[...e[5]||(e[5]=[f(" Preview Sports Team Import ",-1)])]),_:1},8,["loading","disabled","onClick"])])])):c("",!0),a.PreviewResult&&!a.ImportResult?(r(),d("div",Yt,[t("div",Jt,[t("div",Xt,[t("div",ea,n(a.PreviewResult.summary.pages_to_create),1),e[6]||(e[6]=t("div",{class:"text-xs text-green-800"}," Pages to create ",-1))]),t("div",sa,[t("div",ta,n(a.PreviewResult.summary.pages_to_update),1),e[7]||(e[7]=t("div",{class:"text-xs text-blue-800"}," Pages to update ",-1))]),t("div",aa,[t("div",ra,n(a.PreviewResult.summary.users_to_create),1),e[8]||(e[8]=t("div",{class:"text-xs text-amber-800"}," Owner accounts to create ",-1))]),t("div",ia,[t("div",na,n(a.PreviewResult.summary.teams_to_create),1),e[9]||(e[9]=t("div",{class:"text-xs text-purple-800"}," Teams to create ",-1))]),t("div",oa,[t("div",la,n(a.PreviewResult.summary.children_with_player_email),1),e[10]||(e[10]=t("div",{class:"text-xs text-cyan-800"}," Children using player email ",-1))]),t("div",da,[t("div",ua,n(a.PreviewResult.summary.children_using_parent_email),1),e[11]||(e[11]=t("div",{class:"text-xs text-orange-800"}," Children using parent email ",-1))])]),t("div",ma," Reusing "+n(a.PreviewResult.summary.users_to_reuse)+" owner accounts and "+n(a.PreviewResult.summary.teams_to_reuse)+" teams already in GroupRev. ",1),a.PreviewResult.failed.length?(r(),d("div",ca,[t("div",fa,n(a.PreviewResult.failed.length)+" rows cannot be imported ",1),t("ul",ga,[(r(!0),d(k,null,M(a.PreviewResult.failed,i=>(r(),d("li",{key:`preview-failed-${i.row_number}`},[f(" Row "+n(i.row_number),1),i.player_first_name||i.player_last_name?(r(),d("span",pa," — "+n(i.player_first_name)+" "+n(i.player_last_name),1)):c("",!0),f(": "+n(i.error_message),1)]))),128))])])):c("",!0),o.importableRowsCount?(r(),d("details",ha,[t("summary",_a," Review "+n(o.importableRowsCount)+" importable child pages ",1),t("div",wa,[(r(!0),d(k,null,M([...a.PreviewResult.created,...a.PreviewResult.updated],i=>(r(),d("div",{key:`preview-row-${i.identifier}`,class:"py-2 text-sm flex flex-wrap items-center justify-between gap-2"},[t("div",null,[t("span",va,n(i.player_name),1),t("span",ba," — "+n(i.owner_email)+" — "+n(i.team_name),1)]),t("span",{class:B([i.fundraiser_page_id?"text-blue-700 bg-blue-50":"text-green-700 bg-green-50","rounded-full px-2 py-1 text-xs"])},n(i.fundraiser_page_id?"Update page":"Create page"),3)]))),128))])])):c("",!0)])):c("",!0),a.ImportResult?(r(),d("div",ya,[t("div",Pa," Created "+n(a.ImportResult.created.length)+" child pages and updated "+n(a.ImportResult.updated.length)+" child pages. ",1),a.ImportResult.failed.length?(r(),d("div",Ca,[t("div",xa,n(a.ImportResult.failed.length)+" rows failed during import ",1),t("ul",Fa,[(r(!0),d(k,null,M(a.ImportResult.failed,i=>(r(),d("li",{key:`import-failed-${i.row_number}`}
2,[f(" Row "+n(i.row_number),1),i.player_first_name||i.player_last_name?(r(),d("span",Ia," — "+n(i.player_first_name)+" "+n(i.player_last_name),1)):c("",!0),f(": "+n(i.error_message),1)]))),128))])])):c("",!0)])):c("",!0)]),_:1},8,["loading","ok-text","ok-disabled","onOk"])}const Ma=I(At,[["render",ka]]),Ea=z({name:"FundraiserPagesResetPasswordModal",components:{TwCheckbox:L,TwValidationErrors:N,TwInput:$,TwModal:U},mixins:[S],props:{fundraiser:{type:Object,required:!0}},data(){return{LoadingResettingPasswords:!1,RandomPassword:!1,DontSendEmailNotification:!1,ValidationErrorMessage:null,NewPassword:null}},watch:{DontSendEmailNotification(s){s&&(this.RandomPassword=!1)}},methods:{opened(){this.ValidationErrorMessage=null,this.DontSendEmailNotification=!1,this.fundraiser.settings?.default_password?(this.NewPassword=this.fundraiser.settings.default_password,this.RandomPassword=!1):(this.NewPassword=null,this.RandomPassword=!0)},async resetPasswords(){if(this.LoadingResettingPasswords)return;const s=this.DontSendEmailNotification?"No email notifications will be sent.":"Each user will be notified of their new password.";if(confirm(`Reset the password for every user with a page in ${this.fundraiser.title}? ${s}`))try{this.ValidationErrorMessage=null,this.LoadingResettingPasswords=!0;const e=await T().resetFundraiserPageOwnerPasswords(this.fundraiser.id,this.RandomPassword?null:this.NewPassword,!this.DontSendEmailNotification),g=e.reset_count===1?"user":"users";this.$notify(`Password reset successfully for ${e.reset_count} ${g}`,"success"),this.$refs.modal.close()}catch(e){this.ValidationErrorMessage=e.response?.data,this.$notify(e.response?.data?.message||"Unable to reset fundraiser page user passwords.","danger")}finally{this.LoadingResettingPasswords=!1}}}}),Sa=["disabled"];function Ua(s,e,g,P,a,o){const w=l("tw-checkbox"),v=l("tw-input"),y=l("tw-validation-errors"),b=l("tw-modal");return r(),p(b,{ref:"modal","loading-overlay":"",loading:s.LoadingResettingPasswords,"ok-disabled":!s.RandomPassword&&!s.NewPassword,title:`Reset passwords for ${s.fundraiser.title}`,onOk:s.resetPasswords,onOpened:s.opened},{default:u(()=>[t("fieldset",{disabled:s.LoadingResettingPasswords},[e[5]||(e[5]=t("p",{class:"mb-4 text-sm"}," This resets the password for every unique user who has a page in this fundraiser. By default, each user receives an email with their new password. ",-1)),m(w,{modelValue:s.RandomPassword,"onUpdate:modelValue":e[0]||(e[0]=h=>s.RandomPassword=h),readonly:s.DontSendEmailNotification},{default:u(()=>[...e[3]||(e[3]=[f(" Generate a random password ",-1)])]),_:1},8,["modelValue","readonly"]),m(w,{modelValue:s.DontSendEmailNotification,"onUpdate:modelValue":e[1]||(e[1]=h=>s.DontSendEmailNotification=h)},{default:u(()=>[...e[4]||(e[4]=[f(" Don't send email notification ",-1)])]),_:1},8,["modelValue"]),s.RandomPassword?c("",!0):(r(),p(v,{key:0,modelValue:s.NewPassword,"onUpdate:modelValue":e[2]||(e[2]=h=>s.NewPassword=h),label:"New Password:"},null,8,["modelValue"])),m(y,{"validation-result-error":s.ValidationErrorMessage},null,8,["validation-result-error"])],8,Sa)]),_:1},8,["loading","ok-disabled","title","onOk","onOpened"])}const Va=I(Ea,[["render",Ua]]),Ra={name:"FundraiserPagesIndexPage",components:{FundraiserPagesResetPasswordModal:Va,FundraiserChildTeamImportFromCsvModal:Ma,BatchMonitor:Ce,FundraiserPagesGenerateCsvExportButton:$t,TwBadge:W,FundraiserPageImportFromCsvModal:Dt,FundraiserPageManageDropdown:tt,TwTable:Pe,FundraiserInvitesSendNotificationButton:ss,TwCard:ye,FundraiserInvitesList:Ke,TwCheckbox:L,FundraiserPagesInviteUsersByEmailModal:Be,TwTransitionListContainer:be,TwButton:E,FundraiserPageCreateModal:Te,TwPaginator:ve},mixins:[q,Q,ke],props:{fundraiserId:{type:Number,default:null},ownerUserId:{type:Number,default:null},showFundraiser:{type:Boolean,default:!1},showFundraiserPageTitle:{type:Boolean,default:!1}},data(){return{ShowFundraiserInvites:!1,ShowFundraiserPagesUnpublished:!1}},computed:{allowInvite(){return!!(this.fundraiserId&&this.canManageFundraiser(this.fundraiser))},canResetFundraiserPagePasswords(){return!!(this.fundraiserId&&(this.fundraiser?.owner_user_id===this.loggedInUser?.id||R().can(O.FUNDRAISER_PAGES_MANAGE,this.organizationIdForFundraiser(this.fundraiser))))},loggedInUser(){return R().user},customFieldsVisibleInSupportersTable(){return this.fundraiser&&this.fundraiser.custom_fields?this.fundraiser.custom_fields.filter(s=>s.show_in_supporters_table):[]},fields(){const s=[{name:"created_at",label:"Created",sortable:!0,formatter:e=>this.$filters.formatDate(e)},{name:"cached.raised",label:"Raised",sortable:!1},{name:"goal",label:"Goal",sortable:!0},{name:"cached.percentage_raised",label:"% Raised",sortable:!1,formatter:e=>e+"%"},{name:"cached.remaining",label:"Remaining",sortable:!1},{name:"deadline",label:"Deadline",sortable:!0,formatter:e=>this.$filters.formatDate(e)},{name:"published",label:"Published",sortable:!0,formatter:e=>e?"Published":"Not Published"}];return this.fundraiser&&(s.unshift({name:"identifier",label:"Custom Identifier",searchable:!0,sortable:!0}),s.unshift({name:"cached.owner_legal_name",label:"User",searchable:!0,sortable:!1}),s.unshift({name:"owner.email",label:"Email",searchable:!0,sortable:!1})),this.fundraiser&&this.fundraiser.settings&&this.fundraiser.settings.enable_teams&&s.splice(2,0,{name:"team.name",label:"Team",searchable:!0,sortable:!1}
2),this.showFundraiser&&s.unshift({name:"fundraiser.title",label:"Campaign",searchable:!0,sortable:!1}),(this.showFundraiserPageTitle||this.fundraiser&&this.fundraiser.settings&&!this.fundraiser.settings.lock_title)&&s.unshift({name:"title",label:"Title",searchable:!0,sortable:!0}),this.fundraiser&&this.fundraiser.fundraiser_page_milestones&&this.fundraiser.fundraiser_page_milestones.length>0&&(console.log("We have milestones"),s.push({name:"cached.milestone_reached_title",label:"Milestone",searchable:!1,sortable:!1})),this.customFieldsVisibleInSupportersTable.forEach(e=>{s.push({name:`custom_fields.${e.name}`,label:e.name,sortable:!1})}),s.push({name:"actions",label:" ",sortable:!1}),s},fundraiser(){return T().getItemById(this.fundraiserId)},itemsStoreModule(){return V()},filters(){return{...this.ownerUserId&&{owner_user_id:this.ownerUserId},...this.fundraiserId&&{fundraiser_id:this.fundraiserId},...this.ShowFundraiserPagesUnpublished&&{filter_show_unpublished:1},...this.LocalFilters}}},watch:{ShowFundraiserPagesUnpublished(){this.fetchItems({clear:!0})}},mounted(){this.fetchItems({clear:!0})},methods:{organizationIdForFundraiser(s){return s?.beneficiary_type==="App\\Models\\Organization"?s.beneficiary_id:null},canManageFundraiser(s){return R().can(O.FUNDRAISERS_MANAGE,this.organizationIdForFundraiser(s))},canViewFundraiser(s){return s?.owner_user_id===this.loggedInUser?.id||R().can(O.ORGANIZATIONS_VIEW,this.organizationIdForFundraiser(s))},fundraiserInvitesCreated(){T().fetchItemById(this.fundraiserId),this.fetchItems({clear:!0})},fundraiserPageCurrency(s){return s.currency_metadata?.code||s.currency||s.fundraiser?.currency_metadata?.code||s.fundraiser?.currency||s.fundraiser?.settings?.currency||this.fundraiser?.currency_metadata?.code||this.fundraiser?.currency||this.fundraiser?.settings?.currency},formatFundraiserPageCurrency(s,e){return this.$filters.formatCurrency(s,this.fundraiserPageCurrency(e))}}},Na={class:"flex flex-row flex-wrap gap-4"},La={class:"mb-4"},Da={key:0,class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ta={class:"flex gap-4"},Oa={key:0},$a={class:"ml-auto flex shrink-0 items-center justify-end gap-2"},Aa={key:0,class:"grid grid-cols-3 my-10"},Ba={key:1,class:"flex flex-row justify-center my-10"},ja={key:1,class:"text-center"},za={class:"flex items-center justify-between"},Ga={key:1},qa={key:0,class:"border-t flex justify-between"},Wa={class:"mt-2"};function Za(s,e,g,P,a,o){const w=l("tw-button"),v=l("tw-card"),y=l("tw-checkbox"),b=l("fundraiser-pages-generate-csv-export-button"),h=l("batch-monitor"),x=l("fundraiser-invites-send-notification-button"),F=l("fundraiser-invites-list"),i=l("router-link"),C=l("tw-badge"),D=l("fundraiser-page-manage-dropdown"),X=l("tw-table"),ee=l("tw-transition-list-container"),se=l("tw-paginator"),te=l("fundraiser-page-create-modal"),ae=l("fundraiser-pages-invite-users-by-email-modal"),re=l("fundraiser-page-import-from-csv-modal"),ie=l("fundraiser-child-team-import-from-csv-modal"),ne=l("fundraiser-pages-reset-password-modal");return r(),d("div",null,[o.allowInvite?(r(),p(v,{key:0,class:"bg-amber-50 mb-8",shadow:!1},{default:u(()=>[e[15]||(e[15]=t("h4",{class:"mb-2"}," Invite Group Members ",-1)),e[16]||(e[16]=t("p",{class:"mb-5 text-sm"}," Invite individuals to fundraise for your cause, or create fundraising pages for them. ",-1)),t("div",Na,[m(w,{variant:"amber","fa-icon":"envelope",size:"sm",onClick:e[0]||(e[0]=_=>s.$refs.fundraiserPagesInviteUsersByEmailModal.open())},{default:u(()=>[...e[11]||(e[11]=[f(" Invite via email ",-1)])]),_:1}),m(w,{"fa-icon":"file-text",variant:"amber",size:"sm",onClick:e[1]||(e[1]=_=>s.$refs.fundraiserPageInvitesImportFromCsvModal.open())},{default:u(()=>[...e[12]||(e[12]=[f(" Import from CSV ",-1)])]),_:1}),o.fundraiser?.settings?.enable_teams?(r(),p(w,{key:0,"fa-icon":"people-group",variant:"amber",size:"sm",onClick:e[2]||(e[2]=_=>s.$refs.fundraiserChildTeamImportFromCsvModal.open())},{default:u(()=>[...e[13]||(e[13]=[f(" Import Teams ",-1)])]),_:1})):c("",!0),o.allowInvite?(r(),p(w,{key:1,icon:"pen-to-square",variant:"outline",size:"sm",onClick:e[3]||(e[3]=_=>s.$refs.fundraiserPageCreateModal.open())},{default:u(()=>[...e[14]||(e[14]=[f(" Create Page ",-1)])]),_:1})):c("",!0)])]),_:1})):c("",!0),t("div",La,[m(ee,null,{default:u(()=>[t("div",null,[o.fundraiser?(r(),d("div",Da,[t("div",Ta,[m(y,{modelValue:a.ShowFundraiserInvites,"onUpdate:modelValue":e[4]||(e[4]=_=>a.ShowFundraiserInvites=_),class:"mb-2"},{default:u(()=>[e[17]||(e[17]=f(" Show pending invites ",-1)),o.fundraiser.cached.fundraiser_invites_count&&o.fundraiser.fundraiser_invites_count>0?(r(),d("span",Oa,[t("strong",null,n(o.fundraiser.cached.fundraiser_invites_count),1)])):c("",!0)]),_:1},8,["modelValue"]),m(y,{modelValue:a.ShowFundraiserPagesUnpublished,"onUpdate:modelValue":e[5]||(e[5]=_=>a.ShowFundraiserPagesUnpublished=_)},{default:u(()=>[...e[18]||(e[18]=[f(" Show Unpublished Fundraisers ",-1)])]),_:1},8,["modelValue"])]),t("div",$a,[o.canResetFundraiserPagePasswords?(r(),p(w,{key:0,"fa-icon":"key",variant:"outline",size:"sm",onClick:e[6]||(e[6]=_=>s.$refs.fundraiserPagesResetPasswordModal.open())},{default:u(()=>[...e[19]||(e[19]=[f(" Reset User Passwords ",-1)])]),_:1})):c("",!0),o.allowInvite&&o.fundraiser?(r(),p(b,{key:1,filters:{fundraiser_id:o.fundraiser.id}
2,onCsvExport:e[7]||(e[7]=_=>s.CsvExport=_),onGenerateCsvExportBatch:e[8]||(e[8]=_=>s.CsvExportBatch=_)},null,8,["filters"])):c("",!0)])])):c("",!0),t("div",null,[s.CsvExportBatch?(r(),d("div",Aa,[s.CsvExportBatch?(r(),p(h,{key:0,"model-value":s.CsvExportBatch,class:"col-start-2",onFinished:s.finishedCsvExportBatch},null,8,["model-value","onFinished"])):c("",!0)])):c("",!0),s.CsvExport&&s.CsvExport.status==="completed"?(r(),d("div",Ba,[s.CsvExport.upload?(r(),p(w,{key:0,size:"lg",href:s.CsvExport.upload.url_secret},{default:u(()=>[...e[20]||(e[20]=[f(" Download CSV Export ",-1)])]),_:1},8,["href"])):(r(),d("div",ja," Something went wrong. "))])):c("",!0)]),o.fundraiser&&a.ShowFundraiserInvites?(r(),p(v,{key:1,class:"mb-8 bg-gray-50",shadow:!1},{default:u(()=>[t("div",za,[e[21]||(e[21]=t("h4",null,"Invites",-1)),m(x,{fundraiser:o.fundraiser},null,8,["fundraiser"])]),m(F,{fundraiser:o.fundraiser},null,8,["fundraiser"])]),_:1})):c("",!0)]),m(X,{rows:s.items,loading:s.LoadingFetchingItems,"order-by":s.orderBy,"order-direction":s.orderDirection,fields:o.fields,filters:o.filters,onSortChanged:s.sortChanged,onFiltersChanged:s.filtersChanged,onFetchItems:s.fetchItems},xe({"cell(cached.owner_legal_name)":u(_=>[_.row.cached&&_.row.cached.owner_legal_name?(r(),p(i,{key:0,to:{name:"FundraiserPageDashboardPage",params:{fundraiserPageId:_.row.id}},class:"underline"},{default:u(()=>[f(n(_.row.cached.owner_legal_name),1)]),_:2},1032,["to"])):c("",!0)]),"cell(title)":u(_=>[m(i,{to:{name:"FundraiserPageDashboardPage",params:{fundraiserPageId:_.row.id}},class:"underline"},{default:u(()=>[f(n(_.row.title),1)]),_:2},1032,["to"])]),"cell(cached.raised)":u(_=>[f(n(o.formatFundraiserPageCurrency(_.row.cached?.raised,_.row)),1)]),"cell(goal)":u(_=>[f(n(o.formatFundraiserPageCurrency(_.row.goal,_.row)),1)]),"cell(cached.remaining)":u(_=>[f(n(o.formatFundraiserPageCurrency(_.row.cached?.remaining,_.row)),1)]),"cell(published)":u(_=>[m(C,{variant:_.row.published?"green":"amber"},{default:u(()=>[f(n(_.row.published?"Published":"Not Published"),1)]),_:2},1032,["variant"])]),"cell(actions)":u(_=>[m(D,{"fundraiser-page":_.row,onUpdated:s.fetchItems},null,8,["fundraiser-page","onUpdated"])]),_:2},[g.showFundraiser?{name:"cell(fundraiser.title)",fn:u(_=>[o.canViewFundraiser(_.row.fundraiser)?(r(),p(i,{key:0,to:{name:"FundraiserDashboardPage",params:{fundraiserId:_.row.fundraiser_id}},class:"underline"},{default:u(()=>[f(n(_.row.fundraiser.title),1)]),_:2},1032,["to"])):(r(),d("span",Ga,n(_.row.fundraiser.title),1))]),key:"0"}:void 0]),1032,["rows","loading","order-by","order-direction","fields","filters","onSortChanged","onFiltersChanged","onFetchItems"])]),_:1}),s.showPaginator?(r(),d("div",qa,[t("div",Wa,n(s.total)+" records. ",1),m(se,{modelValue:s.page,"onUpdate:modelValue":e[9]||(e[9]=_=>s.page=_),size:"sm",class:"mt-6","per-page":s.perPage,total:s.total},null,8,["modelValue","per-page","total"])])):c("",!0),e[22]||(e[22]=t("div",{class:"clear-both"},null,-1)),o.fundraiser&&o.allowInvite?(r(),p(te,{key:1,ref:"fundraiserPageCreateModal",fundraiser:o.fundraiser,onCreated:e[10]||(e[10]=_=>s.fetchItems())},null,8,["fundraiser"])):c("",!0),o.fundraiser&&o.allowInvite?(r(),p(ae,{key:2,ref:"fundraiserPagesInviteUsersByEmailModal",fundraiser:o.fundraiser,onCreated:o.fundraiserInvitesCreated},null,8,["fundraiser","onCreated"])):c("",!0),o.fundraiser&&o.allowInvite?(r(),p(re,{key:3,ref:"fundraiserPageInvitesImportFromCsvModal",fundraiser:o.fundraiser,onProcessed:o.fundraiserInvitesCreated},null,8,["fundraiser","onProcessed"])):c("",!0),o.fundraiser&&o.allowInvite&&o.fundraiser.settings?.enable_teams?(r(),p(ie,{key:4,ref:"fundraiserChildTeamImportFromCsvModal",fundraiser:o.fundraiser,onProcessed:o.fundraiserInvitesCreated},null,8,["fundraiser","onProcessed"])):c("",!0),o.fundraiser&&o.canResetFundraiserPagePasswords?(r(),p(ne,{key:5,ref:"fundraiserPagesResetPasswordModal",fundraiser:o.fundraiser},null,8,["fundraiser"])):c("",!0)])])}const Xa=I(Ra,[["render",Za]]);export{Xa as default};
3//# sourceMappingURL=FundraiserPagesIndexPage-CUDEC1uu.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.