import{b as f,c as g,_ as b}from"./BasePage-C3DiNX0e.js";import{_ as h}from"./USelect.vue_vue_type_script_setup_true_lang-BgoCOcXc.js";import{_}from"./UInput.vue_vue_type_script_setup_true_lang-eIU5RwOc.js";import{u as C,O as $,c as v}from"./index-_-ijfL1Q.js";import{l as V,r as A,k as S,f as z,h as U,o as k,w as r,a as l,u as G}from"./index-DRopsKkO.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 I={__name:"Page",setup(w){const a=C(),e=V({streetAddress:"",city:"",state:"",zip:""}),o=A([]),i=S(()=>{var t;return((t=o.value)==null?void 0:t.length)&&!e.state||!e.streetAddress||!e.city||!e.zip});z(async()=>{var t;a.hasCompanyData||await a.getCompany(),o.value=a.statesForSelectedCountry,e.streetAddress=a.company.address.streetAddress,e.city=a.company.address.city,e.state=((t=o.value)==null?void 0:t.length)&&(a.company.address.state||""),e.zip=a.company.address.zip});async function u(t){var d;v(e,a.company.address)&&(await a.updateCompanyAddress(e),a.company.address.streetAddress=e.streetAddress,a.company.address.city=e.city,a.company.address.state=(d=o.value)!=null&&d.length?e.state:null,a.company.address.zip=e.zip),t()}return(t,s)=>{const d=_,m=g,c=h,y=f;return k(),U(b,{group:t.$t("group.company"),"group-step":G($)*3,title:t.$t("title.companyAddress"),step:4,"prevent-next":i.value,prev:{name:"GettingStarted/Company/Step3"},next:{name:"GettingStarted/Payments/Step1"},skip:{name:"GettingStarted/Payments/Step1"},onContinue:u},{default:r(()=>[l(y,null,{default:r(()=>[l(m,null,{default:r(()=>[l(d,{modelValue:e.streetAddress,"onUpdate:modelValue":s[0]||(s[0]=n=>e.streetAddress=n),label:t.$t("label.address"),placeholder:t.$t("placeholder.address")},null,8,["modelValue","label","placeholder"]),l(d,{modelValue:e.city,"onUpdate:modelValue":s[1]||(s[1]=n=>e.city=n),label:t.$t("label.city"),placeholder:t.$t("placeholder.city")},null,8,["modelValue","label","placeholder"])]),_:1}),l(m,null,{default:r(()=>{var n;return[l(c,{modelValue:e.state,"onUpdate:modelValue":s[2]||(s[2]=p=>e.state=p),searchable:"",options:o.value,label:t.$t("label.state"),placeholder:t.$t("placeholder.state"),disabled:!((n=o.value)!=null&&n.length),"value-key":"value"},null,8,["modelValue","options","label","placeholder","disabled"]),l(d,{modelValue:e.zip,"onUpdate:modelValue":s[3]||(s[3]=p=>e.zip=p),label:t.$t("label.zipCode"),placeholder:t.$t("placeholder.zipCode")},null,8,["modelValue","label","placeholder"])]}),_:1})]),_:1})]),_:1},8,["group","group-step","title","prevent-next"])}}};export{I as default};
