import{_ as C}from"./USelect.vue_vue_type_script_setup_true_lang-BgoCOcXc.js";import{b as E,c as w,a as G,_ as j}from"./BasePage-C3DiNX0e.js";import{_ as Q}from"./UInput.vue_vue_type_script_setup_true_lang-eIU5RwOc.js";import{b as B,u as O,O as x}from"./index-_-ijfL1Q.js";import{h as y,o as h,w as n,a as o,x as F,Q as I,O as N,a5 as P,k as $,f as M,a1 as L,A as T,u as m,a6 as b}from"./index-DRopsKkO.js";import{_ as q}from"./UAlert.vue_vue_type_script_setup_true_lang-BbXl4P3t.js";import"./ULabel.vue_vue_type_script_setup_true_lang-B9XE8rwf.js";import"./UDivider.vue_vue_type_script_setup_true_lang-CGxguuHo.js";import"./useMutationObserver-DtW-3lQD.js";const z={__name:"ErrorAlert",props:{errorMessage:{type:String,default:"Error"}},setup(D){return(a,S)=>{const t=B,_=G,i=w,s=E,u=q;return h(),y(u,{class:"py-5",color:"red",variant:"thirdary"},{default:n(()=>[o(s,{gap:"sm",align:"center"},{default:n(()=>[o(s,{gap:"xs",align:"center"},{default:n(()=>[o(i,{gap:"xs","no-mobile":"",class:"justify-center"},{default:n(()=>[o(t,{name:"exclamation-circle-fill",color:"red"}),o(_,{class:"font-semibold text-gray-900",html:"Error"})]),_:1}),o(_,{class:"text-gray-600"},{default:n(()=>[I(N(D.errorMessage),1)]),_:1})]),_:1}),F(a.$slots,"default")]),_:3})]),_:3})}}},oe={__name:"Page",setup(D){const a=O(),S=P(a.domains.signUpFormData),t=$(()=>a.domains.signUpData.validation),_=$(()=>!!(Object.keys(t.value.errors||{}).length>0||t.value.message)),{username:i,password:s,securityQuestion:u,securityAnswer:v}=S,V={rightIconSlot:"border-none hover:border-none bg-transparent"};M(async()=>{a.hasSignUpFormData?(a.setDomainsLoading(!0),await a.getDomainRegistrarsSignUpData(),a.setDomainsLoading(!1)):await L.push({name:"GettingStarted/Domains/Step5"})});async function A(e){const{...r}=a.domains.signUpFormData,p={...r,phone:`${a.domainPhoneCodeValue}${r.phone}`};await a.signUpDomainRegistrar({registrar:"enom",formData:p}),e(!_.value)}const R=$(()=>!i.value||!s.value||!u.value||!v.value);return(e,r)=>{const p=Q,U=w,k=C;return h(),y(j,{group:e.$t("group.domains"),"group-step":m(x)*5,title:e.$t("title.enom"),description:e.$t("pageDescription.enom"),step:2,"max-steps":2,"prevent-next":R.value,prev:{name:"GettingStarted/Domains/Step5"},next:{name:"GettingStarted/Domains/Step2"},skip:{name:"GettingStarted/Domains/Step7"},onContinue:A},{default:n(()=>[t.value.message?(h(),y(z,{key:0,"error-message":t.value.message},null,8,["error-message"])):T("",!0),o(U,null,{default:n(()=>{var d,c,g,f;return[o(p,{modelValue:m(i),"onUpdate:modelValue":r[0]||(r[0]=l=>b(i)?i.value=l:null),error:(c=(d=t.value.errors)==null?void 0:d.username)==null?void 0:c.join(""),label:e.$t("label.username"),placeholder:e.$t("placeholder.username")},null,8,["modelValue","error","label","placeholder"]),o(p,{modelValue:m(s),"onUpdate:modelValue":r[1]||(r[1]=l=>b(s)?s.value=l:null),error:(f=(g=t.value.errors)==null?void 0:g.password)==null?void 0:f.join(""),type:"password",label:e.$t("label.password"),placeholder:e.$t("placeholder.password"),config:V},null,8,["modelValue","error","label","placeholder"])]}),_:1}),o(U,null,{default:n(()=>{var d,c,g,f;return[o(k,{modelValue:m(u),"onUpdate:modelValue":r[2]||(r[2]=l=>b(u)?u.value=l:null),error:(c=(d=t.value.errors)==null?void 0:d.securityQuestion)==null?void 0:c.join(""),searchable:"","value-key":"value",options:m(a).domains.signUpData.enom.securityQuestions,label:e.$t("label.securityQuestion"),placeholder:e.$t("placeholder.securityQuestion")},null,8,["modelValue","error","options","label","placeholder"]),o(p,{modelValue:m(v),"onUpdate:modelValue":r[3]||(r[3]=l=>b(v)?v.value=l:null),error:(f=(g=t.value.errors)==null?void 0:g.securityAnswer)==null?void 0:f.join(""),label:e.$t("label.securityAnswer"),placeholder:e.$t("placeholder.enterAnswer")},null,8,["modelValue","error","label","placeholder"])]}),_:1})]),_:1},8,["group","group-step","title","description","prevent-next"])}}};export{oe as default};
