1import{d as A,l as B,h as G,ae as q,I as M,O as J,Z,S as z,U as K,o as d,B as Q,w as S,a as c,u as t,j as i,c as f,b as W,ad as O,ab as U,t as l,aj as j,m as X,G as Y,E as ee,aa as te,p,H as N,q as L,s as oe,n as ae,ag as ne,J as se,k as re,F as R,x as ie,e as ce}from"./BMrxR1rr.js";import{u as le,a as me,b as ue,_ as de}from"./BDd9VKNe.js";import{_ as _e}from"./FtV10hcY.js";import{i as pe}from"./CSuGobLs.js";import{_ as fe,F as ve,t as he}from"./C1xmXCIa.js";import{r as V}from"./DjuG4DBI.js";import"./C8JlwzSv.js";const ge=["value"],ye={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},xe={key:0},be={class:"flex flex-col-reverse gap-3 sm:flex-row sm:justify-end"},Fe=["disabled","aria-busy"],Ee=A({name:"EventGuestIdentificationForm",__name:"EventGuestIdentificationForm",props:{event:{}},setup(P){const e=P,{t:o}=B(),s=G(),{isLoggedIn:v}=q(),h=`/api/events/${e.event.id}/guest-register`,$=s({name:"community_event_form",params:M(e.event)}),_=v.value,{firstName:I,lastName:k}=le(),g={firstName:I,lastName:k},y=J(K(),z(),Z(o("personProfile.form.validation.emailInvalid"))),x=he(_?j(g):j({...g,email:y})),b={firstName:"",lastName:"",email:""};return(T,r)=>{const m=me,F=ue,E=_e,w=pe,C=fe,a=O;return d(),Q(t(ve),{class:"event-guest-identification-form space-y-6",method:"post",action:h,"validation-schema":t(x),"initial-values":b},{default:S(({isSubmitting:n})=>[c("input",{type:"hidden",name:"redirect",value:t($)},null,8,ge),c("div",ye,[i(m),i(F)]),t(_)?W("",!0):(d(),f("div",xe,[i(E,{text:t(o)("auth.email_label"),for:"email",required:""},null,8,["text"]),i(w,{name:"email",autocomplete:"email",required:"",placeholder:t(o)("auth.email_placeholder")},null,8,["placeholder"]),i(C,{name:"email",class:"mt-1"})])),c("div",be,[i(a,{event:P.event,class:"inline-flex min-h-12 items-center justify-center rounded-xl border border-surface/20 px-6 py-3 text-center font-semibold text-surface transition-colors hover:bg-surface/5"},{default:S(()=>[U(l(t(o)("eventForm.backToEvent")),1)]),_:1},8,["event"]),c("button",{type:"submit",disabled:n,"aria-busy":n,class:"inline-flex min-h-12 cursor-pointer items-center justify-center rounded-xl bg-primary px-6 py-3 text-center font-semibold text-surface transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50"},l(n?t(o)("eventForm.submitting"):t(o)("eventForm.guestStep.register")),9,Fe)])]),_:1},8,["validation-schema"])}}}),we=Object.assign(Ee,{__name:"EventGuestIdentificationForm"}),Pe={class:"container py-12"},$e={class:"mx-auto max-w-2xl"},Ie={class:"mb-2 text-2xl font-bold text-surface"},ke={class:"mb-8 text-error"},Ce={class:"mb-8 text-surface"},Ne={class:"mb-8 text-surface"},Be=A({name:"CommunityEventRegisterPage",__name:"register",async setup(P){let e,o;const{t:s}=B(),v=X(),h=G(),$=Y(),{userInfo:_,fetch:I}=ee(),{isLoggedIn:k}=q(),{isEnabled:g}=te(),y=v.params.eventId,x=g("event-guest-registration");!k.value&&!x.value&&([e,o]=p(()=>N({path:h({name:"login"}),query:{redirect:v.fullPath}})),await e,o());const{data:b,error:T}=([e,o]=p(()=>L(`/community/events/${y}`,{transform:oe},"$pgSUsMayl8")),e=await e,o(),e);if(T.value||!b.value)throw ae({statusCode:404,statusMessage:"Event not found"});const r=b.value,m=ie("");function F(a={}){return{path:h({name:"community_event_form",params:M(r)}),query:a}}if(_.value?.profile){const{data:a}=([e,o]=p(()=>L(`/community/events/${y}/registration`,{transform:ne},"$VcOh_DNO6r")),e=await e,o(),e);let n=!!a.value;try{if(!n){const u=([e,o]=p(()=>V(r)),e=await e,o(),e);n=!u.success&&u.reason==="already_registered"}[e,o]=p(()=>N(F(n?{state:"already"}:{}))),await e,o()}catch(u){m.value=u.data?.message||s("eventForm.error")}}const E=ce(()=>!x.value&&!_.value?.profile),w=$.hub?.defaultPersonProfileTypeId;E.value&&!w&&console.error("[CommunityEventRegisterPage] Missing `defaultPersonProfileTypeId` configuration â the profile creation form will not submit without it.");async function C(){await I();try{const a=await V(r),n=!a.success&&a.reason==="already_registered";await N(F({profile:"new",...n?{state:"already"}:{}}))}catch(a){m.value=a.data?.message||s("eventForm.error")}}return se({title:r.name?`${r.name} â ${s("eventForm.title")}`:s("eventForm.title")}
1),re({meta:[{name:"robots",content:"noindex, nofollow"}]}),(a,n)=>{const u=O,D=de,H=we;return d(),f("div",Pe,[c("div",$e,[c("h1",Ie,l(t(r).name),1),t(m)?(d(),f(R,{key:0},[c("p",ke,l(t(m)),1),i(u,{event:t(r),class:"inline-flex min-h-12 items-center justify-center rounded-xl border border-surface/20 px-6 py-3 text-center font-semibold text-surface transition-colors hover:bg-surface/5"},{default:S(()=>[U(l(t(s)("eventForm.backToEvent")),1)]),_:1},8,["event"])],64)):t(E)?(d(),f(R,{key:1},[c("p",Ce,l(t(s)("eventForm.profileStep.subtitle")),1),i(D,{"profile-type-id":t(w),onSuccess:C},null,8,["profile-type-id"])],64)):(d(),f(R,{key:2},[c("p",Ne,l(t(s)("eventForm.guestStep.subtitle")),1),i(H,{event:t(r)},null,8,["event"])],64))])])}}});export{Be as default};
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.