1import{e as S,x as B,P as L,j as E,J as x,K as _,r as T,c as u,a as o,t as n,Q as F,n as b,q as e,d as q,F as D,b as c,m as j,o as i,bZ as H}from"./6cDNPm8M.js";import"./CuWLTwbY.js";import{b as J}from"./Dl-OjOkT.js";import{B as p}from"./LP1ISviR.js";import{S as K}from"./cT72l0D1.js";import{u as Q}from"./BKJB8iX5.js";import{c as m,a as g,r as A,u as R}from"./C849Q5FJ.js";import{_ as Z}from"./DlAUqK2U.js";import"./CgJ4c8o7.js";const G={class:"my-menu__title"},O={class:"my-menu__box my-menu__box--small"},X={class:"form__parent"},Y={class:"l-grid l-grid--normal l-grid--sm"},ee={class:"l-col--1-1"},re={class:"h4"},oe={key:0},se={class:"alert__small alert__small--info alert__small--arrow-bot"},le={key:1,class:"l-col--1-1 form__row"},te={key:0},ae={key:0},ne={class:"l-col--1-1 l-col--md-1-2 form__row"},de={class:"l-col--1-1 l-col--md-1-2 form__row"},me={key:0,class:"l-grid l-grid--normal l-grid--sm"},ie={class:"l-col--1-1"},ue={class:"h4"},ce={class:"l-col--1-1 l-col--md-2-3 form__row"},pe={class:"l-col--1-1 l-col--md-1-3 form__row"},he={class:"l-col--1-1 l-col--md-1-2 form__row"},fe={class:"l-col--1-1 l-col--md-1-2 form__row"},_e={key:1},be={class:"l-grid l-grid--normal l-grid--sm"},ge={class:"l-col--1-1"},ye={class:"h4"},$e={class:"l-col--1-1 l-col--md-1-2 form__row"},ve={class:"l-col--1-1 l-col--md-1-2 form__row"},Ne={class:"l-grid l-grid--normal l-grid--sm"},we={class:"l-col--1-1 l-col--md-1-1"},Ve=["disabled"],Ie={key:1},qe=S({__name:"AccountInfo",setup(Ae){const y=B(!1),{busEmit:C}=L(),{countries:v}=Q(),{t:d}=E(),a=x(),N=_(()=>a.user?.isIslander),W=_(()=>a.user?.isAnyStaff),M=_(()=>a.user?.isCommuter),w=_(()=>a.user?.isAgent),$=_(()=>N.value||W.value||M.value||w.value),h=_(()=>a.user?.isWagenborgPassHolder??!1),V=()=>`${f.streetAdress??""} ${f.houseNumber}`.length<=40,k=()=>!(s=>typeof s>"u"||s==="")(f.mobilePhone),I=l=>!l||l.length>=9&&l.length<=15&&!isNaN(l),f=T({firstName:a.user?.firstName,lastName:a.user?.lastName,gender:a.user?.gender,houseNumber:a.user?.houseNumber,streetAddress:a.user?.streetAdress,zip:a.user?.zip,city:a.user?.city,countryCode:a.user?.country,phone:a.user?.telephone,mobilePhone:a.user?.cellPhone}),z={firstName:{required:m.withMessage(()=>d("errors.required.firstName"),A)},lastName:{required:m.withMessage(()=>d("errors.required.lastName"),A)},houseNumber:{required:m.withMessage(()=>d("errors.required.houseNumber"),g(()=>h.value)),validLength:m.withMessage(()=>d("errors.length.address"),V)},streetAddress:{required:m.withMessage(()=>d("errors.required.streetAdress"),g(()=>h.value)),validLength:m.withMessage(()=>d("errors.length.address"),V)},zip:{required:m.withMessage(()=>d("errors.required.zip"),g(()=>h.value))},city:{required:m.withMessage(()=>d("errors.required.city"),g(()=>h.value))},countryCode:{required:m.withMessage(()=>d("errors.required.country"),g(()=>h.value))},phone:{valid:m.withMessage(()=>d("errors.length.phoneNumber"),I)},mobilePhone:{requiredIf:m.withMessage(()=>d("errors.required.cellPhone"),k),valid:m.withMessage(()=>d("errors.length.phoneNumber"),I)}},r=R(z,f),P=l=>{const s=v.find(t=>t.value===l);return s?s.text:l},U=async()=>{if(r.value.$touch(),await r.value.$validate()){const s={...f,address:`${f.streetAddress} ${f.houseNumber}`};y.value=!0,a.updateCustomer(s).then(t=>{a.setUser(H(t)),C("Success",d("myWagenborg.personalInformation.infoSaved"))}).finally(()=>{y.value=!1})}};return(l,s)=>(i(),u("div",null,[o("div",null,[o("div",G,n(l.$t("myWagenborg.personalInformation.title")),1),o("div",O,[o("div",X,[o("form",{novalidate:"",onSubmit:F(U,["prevent"])},[o("div",Y,[o("div",ee,[o("h4",re,n(l.$t("myWagenborg.personalInformation.title")),1)]),e(N)?(i(),u("div",oe,[o("div",se,[o("p",null,n(l.$t("myWagenborg.personalInformation.islanderInfo")),1)])])):b("",!0),e($)?(i(),u("div",le,[o("div",null,[o("p",null,[q(n(e(r).firstName.$model)+" ",1),e(w)?(i(),u("br",te)):b("",!0),q(" "+n(e(r).lastName.$model),1)]),o("p",null,n(e(r).streetAddress.$model)+" "+n(e(r).houseNumber.$model),1),o("p",null,n(e(r).zip.$model)+" "+n(e(r).city.$model),1),e(r).countryCode.$model?(i(),u("p",ae,n(P(e(r).countryCode.$model)),1)):b("",!0)]),s[9]||(s[9]=o("br",null,null,-1))])):(i(),u(D,{key:2},[o("div",ne,[c(e(p),{modelValue:e(r).firstName.$model,"onUpdate:modelValue":s[0]||(s[0]=t=>e(r).firstName.$model=t),errors:e(r).firstName.$errors,"has-error":e(r).firstName.$error,label:l.$t("myWagenborg.personalInformation.firstName"),class:"form__row",name:"firstname",type:"text"},null,8,["modelValue","errors","has-error","label"])]),o("div",de,[c(e(p),{modelValue:e(r).lastName.$model,"onUpdate:modelValue":s[1]||(s[1]=t=>e(r).lastName.$model=t),errors:e(r).lastName.$errors,"has-error":e(r).lastName.$error,label:l.$t("myWagenborg.personalInformation.lastName"),class:"form__row",name:"lastname",type:"text"},null,8,["modelValue","errors","has-error","label"])])],64))]),s[11]||(s[11]=o("hr",null,null,-1)),e(h)&&!e($)?(i(),u("div",me,[o("div",ie,[o("h4",ue,n(l.$t("myWagenborg.personalInformation.address")),1)]),o("div",ce,[c(e(p),{modelValue:e(r).streetAddress.$model,"onUpdate:modelValue":s[2]||(s[2]=t=>e(r).streetAddress.$model=t),errors:e(r).streetAddress.$errors,"has-error":e(r).streetAddress.$error,label:l.$t("myWagenborg.personalInformation.street"),class:"form__row",name:"street",type:"text"},null,8,["modelValue","errors","has-error","label"])]),o("div",pe,[c(e(p),{modelValue:e(r).houseNumber.$model,"onUpdate:modelValue":s[3]||(s[3]=t=>e(r).houseNumber.$model=t),errors:e(r).houseNumber.$errors,"has-error":e(r).houseNumber.$error,label:l.$t("myWagenborg.personalInformation.houseNumber"),class:"form__row",name:"houseNumber",type:"text"},null,8,["modelValue","errors","has-error","label"])]),o("div",he,[c(e(p),{modelValue:e(r).zip.$model,"onUpdate:modelValue":s[4]||(s[4]=t=>e(r).zip.$model=t),errors:e(r).zip.$errors,"has-error":e(r).zip.$error,label:l.$t("myWagenborg.personalInformation.zipCode"),class:"form__row",name:"zip",type:"text"},null,8,["modelValue","errors","has-error","label"])]),o("div",fe,[c(e(p),{modelValue:e(r).city.$model,"onUpdate:modelValue":s[5]||(s[5]=t=>e(r).city.$model=t),errors:e(r).city.$errors,"has-error":e(r).city.$error,label:l.$t("myWagenborg.personalInformation.city"),class:"form__row",name:"city",type:"text"},null,8,["modelValue","errors","has-error","label"])]),c(e(J),{modelValue:e(r).countryCode.$model,"onUpdate:modelValue":s[6]||(s[6]=t=>e(r).countryCode.$model=t),errors:e(r).countryCode.$errors,"has-error":e(r).countryCode.$error,"label-text":l.$t("payment.form.country")+"*",options:e(v),class:"l-col--1-1 l-col--md-1-2 form__row"},null,8,["modelValue","errors","has-error","label-text","options"])])):b("",!0),e(h)&&!e($)?(i(),u("hr",_e)):b("",!0),o("div",be,[o("div",ge,[o("h4",ye,n(l.$t("myWagenborg.personalInformation.contact")),1)]),o("div",$e,[c(e(p),{modelValue:e(r).mobilePhone.$model,"onUpdate:modelValue":s[7]||(s[7]=t=>e(r).mobilePhone.$model=t),errors:e(r).mobilePhone.$errors,"has-error":e(r).mobilePhone.$error,label:l.$t("myWagenborg.personalInformation.cellPhone"),class:"form__row",name:"mobile",type:"text"},null,8,["modelValue","errors","has-error","label"])]),o("div",ve,[c(e(p),{modelValue:e(r).phone.$model,"onUpdate:modelValue":s[8]||(s[8]=t=>e(r).phone.$model=t),errors:e(r).phone.$errors,"has-error":e(r).phone.$error,label:l.$t("myWagenborg.personalInformation.telep
1hone"),class:"form__row",name:"telephone",type:"text"},null,8,["modelValue","errors","has-error","label"])])]),s[12]||(s[12]=o("hr",null,null,-1)),o("div",Ne,[o("div",we,[o("span",null,[o("p",null,n(l.$t("myWagenborg.personalInformation.note")),1)]),s[10]||(s[10]=o("br",null,null,-1)),o("button",{disabled:e(y),class:"btn btn--active",type:"submit"},[e(y)?(i(),j(K,{key:0,size:.75,color:"white"})):(i(),u("span",Ie,n(l.$t("myWagenborg.personalInformation.buttonText")),1))],8,Ve)])])],32)])])])]))}}),Le=Z(qe,[["__scopeId","data-v-0e737310"]]);export{Le 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.