import{b as _,a as v}from"./BasePage-aJlR_RJI.js";import{_ as C}from"./USelect.vue_vue_type_script_setup_true_lang-Cw4e8KSA.js";import{_ as b}from"./UInput.vue_vue_type_script_setup_true_lang-BjaSJgmr.js";import{c as N}from"./helper.service-Dk93koq0.js";import{u as $,O as S}from"./index-DruWBKkm.js";import{j as V,r as U,g as u,k,h as G,o as E,w as d,a as r,u as w}from"./index-CdEV5Lsj.js";import"./ULabel.vue_vue_type_script_setup_true_lang-DmdMPZfT.js";import"./UDivider.vue_vue_type_script_setup_true_lang-CBOjoWJ-.js";const M={__name:"Page",setup(D){const e=$(),a=V({companyName:"",email:"",country:""}),p=U([]),y=u(()=>e.company.details.validation),f=u(()=>!a.companyName||!a.email||!a.country);k(async()=>{e.hasCompanyData||await e.getCompany(),a.companyName=e.company.details.companyName,a.email=e.company.details.email,a.country=e.company.details.country,p.value=e.company.details.countries});async function g(o){var m;N(a,e.company.details)&&(await e.updateCompanyDetails(a),e.company.details.companyName=a.companyName,e.company.details.email=a.email,e.company.details.country=a.country,a.country!==e.company.details.country&&(e.company.address.state=""));const l=!!((m=e.company.details.validation)!=null&&m.errors);o(!l)}return(o,t)=>{const l=b,m=C,h=_;return E(),G(v,{group:o.$t("group.company"),"group-step":w(S)*2,title:o.$t("title.company"),step:1,"prevent-next":f.value,prev:{name:"GettingStarted/Analytics/Step1"},next:{name:"GettingStarted/Company/Step2"},skip:{name:"GettingStarted/Company/Step2"},onContinue:g},{default:d(()=>[r(h,null,{default:d(()=>{var s,i,c;return[r(l,{modelValue:a.companyName,"onUpdate:modelValue":t[0]||(t[0]=n=>a.companyName=n),label:o.$t("label.companyName"),placeholder:o.$t("placeholder.companyName"),"max-length":"255"},null,8,["modelValue","label","placeholder"]),r(l,{modelValue:a.email,"onUpdate:modelValue":t[1]||(t[1]=n=>a.email=n),error:(c=(i=(s=y.value)==null?void 0:s.errors)==null?void 0:i.email)==null?void 0:c.join(""),label:o.$t("label.email"),placeholder:o.$t("placeholder.companyEmail")},null,8,["modelValue","error","label","placeholder"]),r(m,{modelValue:a.country,"onUpdate:modelValue":t[2]||(t[2]=n=>a.country=n),searchable:"",options:p.value,label:o.$t("label.country"),placeholder:o.$t("placeholder.country"),"value-key":"value"},null,8,["modelValue","options","label","placeholder"])]}),_:1})]),_:1},8,["group","group-step","title","prevent-next"])}}};export{M as default};
