import{_ as w}from"./B50g7Dgj.js";import{v as D,r as k,g as M,_ as v,o as f,c as U,a as l,t as c,L as F,M as V,d as _,G as x,s as E,n as N,E as I,b as m,w as u,p as C,q as h,H as $}from"./CibDhUcP.js";import{u as B,_ as H}from"./DPsU6NRC.js";import{_ as L}from"./CW5dyef9.js";import O from"./CTMooejj.js";import{_ as T}from"./BpJC44XK.js";import{u as j}from"./fWHo1AcK.js";import"./CBXHUQO1.js";import"./BCJxuefG.js";const P=D({__name:"AnalyticsConsent",emits:["agreeForAnalytics"],setup(n,{expose:t,emit:r}){t();const e=k(!1),i=r;M(e,a=>i("agreeForAnalytics",a));const p={checkAgree:e,emit:i};return Object.defineProperty(p,"__isScriptSetup",{enumerable:!1,value:!0}),p}}),z={class:"mb-4 font-medium text-lg"},R={class:"mb-3 text-gray-700 text-sm"},W={class:"flex gap-2 items-center cursor-pointer"},X={class:"bg-slate-100 px-6 py-4 rounded-md text-xs leading-4"},q=["innerHTML"];function G(n,t,r,e,i,p){return f(),U("div",null,[l("h3",z,c(n.$t("AnalyticsConsent")),1),l("div",R,[l("label",W,[F(l("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>e.checkAgree=a),type:"checkbox",name:"agree",class:"scale-110"},null,512),[[V,e.checkAgree]]),_(" "+c(n.$t("AgreeForAnalytics")),1)])]),l("div",X,[l("p",{innerHTML:n.$t("AnalyticsConsentShort")},null,8,q)])])}const K=Object.assign(v(P,[["render",G],["__file","AnalyticsConsent.vue"]]),{__name:"AnalyticsConsent"}),Y=D({__name:"SignupFormStep3",setup(n,{expose:t}){t();const r=x().public.WHM_EXTRAS,e=E(),i=N(),p=I(()=>!r&&x().public.MIXPANEL_API_KEY);e.signUpData.name="",e.signUpData.lastName="";const a=k(""),y=o=>{e.signUpData.consent=o},S=o=>{e.signUpData.analyticsConsent=o},{signInURL:g}=B(),A=async()=>{r||await d();const{error:o}=await e.saveAdditionalData();if(o){console.error(o);return}e.clearOtp(),e.clearData(),g(),i.currentStep=0},d=async()=>{const{error:o}=await e.signIn(e.signUpData.email,e.signUpData.password);o&&console.error(o)},{tracker:s}=j();s("page_view","page","signup process step 3");const b={isWhm:r,sStore:e,store:i,showAnalyticsConsent:p,additionalDataError:a,handleMarketingConsent:y,handleAnalyticsConsent:S,signInURL:g,handleAdditonalData:A,loginAfterSuccessfulSignup:d,tracker:s};return Object.defineProperty(b,"__isScriptSetup",{enumerable:!1,value:!0}),b}}),J={class:"flex gap-2"};function Q(n,t,r,e,i,p){const a=w,y=K,S=H,g=L,A=O,d=T;return f(),U("form",{onSubmit:$(e.handleAdditonalData,["prevent"])},[m(a,{modelValue:e.sStore.signUpData.name,"onUpdate:modelValue":t[0]||(t[0]=s=>e.sStore.signUpData.name=s),class:"mb-4",type:"text"},{default:u(()=>[_(c(n.$t("Name")),1)]),_:1},8,["modelValue"]),m(a,{modelValue:e.sStore.signUpData.lastName,"onUpdate:modelValue":t[1]||(t[1]=s=>e.sStore.signUpData.lastName=s),class:"mb-4",type:"text"},{default:u(()=>[_(c(n.$t("LastName")),1)]),_:1},8,["modelValue"]),e.showAnalyticsConsent?(f(),C(y,{key:0,class:"mb-8",onAgreeForAnalytics:t[2]||(t[2]=s=>e.handleAnalyticsConsent(s))})):h("",!0),m(S,{class:"mb-8",simple:!1,onAgreeForMarketing:t[3]||(t[3]=s=>e.handleMarketingConsent(s))}),e.additionalDataError?(f(),C(g,{key:1},{default:u(()=>[_(c(n.$t(e.additionalDataError)),1)]),_:1})):h("",!0),l("div",J,[m(d,{size:"small",palette:"ghost",class:"px-8 py-2",onClick:t[4]||(t[4]=s=>e.store.currentStep=2)},{default:u(()=>[m(A,{name:"tabler:chevron-left",class:"size-4"}),_(" "+c(n.$t("Back")),1)]),_:1}),m(d,{size:"small",class:"px-8 py-2",type:"submit",tag:"button"},{default:u(()=>[_(c(n.$t("Finish")),1)]),_:1})])],32)}const le=Object.assign(v(Y,[["render",Q],["__file","SignupFormStep3.vue"]]),{__name:"SignupFormStep3"});export{le as default};
