1import{_ as se}from"./6HuN2jx9.js";import{g as ne}from"./y6t94vq7.js";import{d as P,e as v,f as h,h as o,t as m,p as Y,l as j,k as H,j as G,i as d,g as t,P as K,D as le,m as A,u as X,U as ae,Q as ie,V as q,r as U,W,o as re,w as Q,G as ce,M as y,a as ue,q as de,b as Z,c as me,s as _e,K as pe,X as fe,E as be}from"./CFxGRstO.js";import{_ as J}from"./DlAUqK2U.js";import{u as ve}from"./0Zil6o2A.js";import{u as we}from"./_XV3GVHc.js";import{u as te}from"./Dav6wwHW.js";import{_ as oe}from"./DnMM_Yjt.js";import{_ as $e}from"./DBcM731C.js";import{_ as ge}from"./LVdPJ0Yr.js";import{_ as ye}from"./j7NHA3XA.js";import{c as he,e as xe,a as C,f as Ve,u as Ae,b as V}from"./CgWzIhW9.js";import{i as ee}from"./EUIPDkJ3.js";import{_ as ke}from"./Crz1aqcp.js";import"./B6H6uuii.js";import"./Cpj98o6Y.js";import"./BWBHGvIx.js";import"./CwOHyHLb.js";import"./owSR78tJ.js";import"./C5U6HIMD.js";import"./CbPSoDvq.js";import"./RrkodjGr.js";import"./DIJTWx4D.js";import"./DCH0OG8z.js";import"./Bg2uL3dI.js";import"./C16c000V.js";import"./pi_C2gdx.js";import"./GtZFfx2K.js";import"./Bl79MI2C.js";const Ce={class:"profile-information tw-mb-6 md:tw-mb-12 tw-mt-6"},Se={class:"tw-text-fs-base tw-leading-none !tw-text-white tw-mb-4 -tw-mt-6 tw-font-semibold"},De={class:"tw-mb-4"},Pe={for:"email",class:"form-label"},Ee={class:"tw-block tw-text-white/50 tw-mb-2"},Oe={class:"tw-mb-4"},Ie={for:"password",class:"form-label tw-flex !tw-mb-2"},Ue=P({__name:"Information",props:{profile:{},isPossibleChangeEmail:{type:Boolean}},setup(i){const r=ne();return(n,l)=>{const c=se;return v(),h("div",Ce,[o("h3",Se,m(n.$t("account.profile.profile_info.title")),1),o("div",De,[o("label",Pe,m(n.$t("account.profile.profile_info.email_label")),1),o("small",Ee,[o("u",null,m(i.profile.email),1)]),i.isPossibleChangeEmail?(v(),Y(c,{key:0,id:"email",to:"/account/change-email",class:"btn btn-md btn-outline-primary btn-spinner ripple !tw-inline-flex"},{default:j(()=>[H(m(n.$t("account.profile.profile_info.change_email")),1)]),_:1})):G("",!0)]),o("div",Oe,[o("label",Ie,m(n.$t("account.profile.profile_info.password_label")),1),d(c,{id:"password",to:"/account/change-password",class:"btn btn-md btn-outline-primary btn-spinner ripple !tw-inline-flex"},{default:j(()=>[H(m(t(r)),1)]),_:1})])])}}}),Me=Object.assign(Ue,{__name:"AccountProfileInformation"}),Fe={key:0,class:"tw-text-h6 tw-mb-2"},Le={key:1},Te=P({__name:"ActionStatusBar",props:{successful:{type:Boolean},successfulModifiers:{},message:{},messageModifiers:{},title:{},titleModifiers:{}},emits:["update:successful","update:message","update:title"],setup(i){const r=K(i,"successful"),n=K(i,"message"),l=K(i,"title");function c(){l.value="",n.value=""}const $=A(()=>r.value?"alert-success":n.value?"alert-danger":"");return(_,u)=>l.value||n.value?(v(),h("div",{key:0,class:le(["alert tw-text-center status-bar",t($)]),role:"alert"},[l.value?(v(),h("h6",Fe,m(l.value),1)):G("",!0),n.value?(v(),h("div",Le,m(n.value),1)):G("",!0),o("span",{class:"cross",onClick:c},"Ã")],2)):G("",!0)}}),Be=Object.assign(J(Te,[["__scopeId","data-v-001d2efb"]]),{__name:"AccountProfileActionStatusBar"}),Ne={class:"linked-account"},Re={class:"tw-flex tw-justify-between tw-items-center"},Ge={class:"tw-flex tw-items-center tw-w-4/12"},je={class:"tw-mr-2 tw-inline",width:"24px",height:"24px"},ze=["xlink:href"],qe={class:"tw-mb-0"},Ke={class:"tw-w-4/12"},Ye={key:0},Je={class:"tw-block tw-mb-0 tw-text-[0.875em]"},We={class:"tw-block tw-text-white/50 tw-mb-0 tw-text-[0.875em]"},Qe={key:1,class:"tw-block tw-text-white/50 tw-mb-0 tw-text-[0.875em]"},Xe=["disabled"],He=P({__name:"LinkedAccountItem",props:{providerId:{},disabled:{type:Boolean},item:{}},emits:["disconnect"],setup(i,{emit:r}){const n=i,l=r,{t:c}=X(),{toConnect:$}=te(),_=A(()=>n.item?c("account.disconnect"):c("account.connect")),u=A(()=>ae[n.providerId]),p=A(()=>we(u.value));async function f(){n.item?l("disconnect"):await $(n.providerId)}const S=ve().formatDate(n.item?.creation_date,"long");return(k,x)=>(v(),h("div",Ne,[o("div",Re,[o("div",Ge,[(v(),h("svg",je,[o("use",{"xlink:href":`#ico-account-${t(u)}`},null,8,ze)])),o("p",qe,m(t(p)),1)]),o("div",Ke,[i.item?(v(),h("div",Ye,[o("small",Je,m(k.$t("account.connected")),1),o("small",We,[o("i",null,m(t(S)),1)])])):(v(),h("small",Qe,[o("i",null,m(k.$t("account.not_connected")),1)]))]),o("button",{class:"btn btn-sm btn-outline-primary btn-connect",type:"button",disabled:i.disabled,onClick:f},m(t(_)),9,Xe)])]))}}),Ze=Object.assign(J(He,[["__scopeId","data-v-874bef74"]]),{__name:"AccountProfileLinkedAccountItem"}),et={class:"tw-text-sm tw-leading-tight"},tt={class:"tw-text-center tw-mb-6 tw-whitespace-pre-line"},ot={class:"tw-w-full tw-flex tw-flex-row-reverse tw-items-center tw-gap-4 tw-px-2 tw-mb-6"},st=P({__name:"DeleteModal",props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:ie(["confirmAction"],["update:modelValue"]),setup(i,{emit:r}){const n=r,l=K(i,"modelValue");function c(){l.value=!1}function $(){n("confirmAction"),c()}return(_,u)=>{const p=oe,f=$e;return v(),Y(f,{modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=S=>l.value=S),title:_.$t("account.delete_modal.title")},{default:j(()=>[o("div",et,[o("div",tt,m(_.$t("account.delete_modal.description")),1),o("div",ot,[d(p,{label:_.$t("account.delete_modal.cancel"),class:"btn btn-outline-primary tw-flex-1",type:"button",onClick:c},null,8,["label"]),d(p,{label:_.$t("account.delete_modal.confirm"),class:"btn btn-primary tw-flex-1",type:"button",onClick:$},null,8,["label"])])])]),_:1},8,["modelValue","title"])}}}),nt=Object.assign(st,{__name:"AccountProfileDeleteModal"}),lt={class:"oauth-buttons tw-mb-6 md:tw-mb-12 tw-mt-6"},at={class:"linked-accounts"},it=P({__name:"LinkedAccounts",async setup(i){let r,n;const{t:l}=X(),{isLoading:c,errorCode:$,isConnectSuccessful:_,oauthList:u,connect:p,disconnect:f,load:S}=te(),k=A(()=>c.value),x=U(!1),M=A(()=>_.value||x.value);async function F(){const a=ue(),e=de(),g=a.query.code;if(a.query.state&&g){const D=JSON.parse(String(a.query.state));await p(D.providerId,String(g)),await e.replace({query:{}}),x.value=!1}}async function L(a){const e=await f(a);x.value=e.success,_.value=!1}const T={[q.ACCOUNT_IS_ALREADY_USED]:l("account.error_messages.account_already_used"),[q.ACCOUNT_IS_ALREADY_REGISTERED]:l("account.error_messages.account_already_registred")},E={[q.ACCOUNT_IS_ALREADY_USED]:l("account.error_titles.account_already_used"),[q.ACCOUNT_IS_ALREADY_REGISTERED]:l("account.error_titles.account_already_registred")},B=A(()=>$.value?T[$.value]:_.value?l("account.status_messages.success_connect"):x.value?l("account.status_messages.success_disconnect"):""),N=A(()=>$.value?E[$.value]:_.value?l("account.status_titles.success_connect"):x.value?l("account.status_titles.success_disconnect"):""),O=U(W.GOOGLE),I=U(!1);function z(a){O.value=a,I.value=!0}return re(async()=>{await F()}),[r,n]=Q(()=>S()),await r,n(),(a,e)=>{const g=Be,D=Ze,w=nt;
1return v(),h("div",null,[d(g,{successful:t(M),title:t(N),message:t(B)},null,8,["successful","title","message"]),o("div",lt,[ce(a.$slots,"title",{},void 0,!0),o("div",at,[d(D,{"provider-id":t(W).GOOGLE,item:t(u).google,disabled:t(k),onDisconnect:e[0]||(e[0]=b=>z(t(W).GOOGLE))},null,8,["provider-id","item","disabled"]),d(w,{modelValue:t(I),"onUpdate:modelValue":e[1]||(e[1]=b=>y(I)?I.value=b:null),onConfirmAction:e[2]||(e[2]=b=>L(t(O)))},null,8,["modelValue"])])])])}}}),rt=Object.assign(J(it,[["__scopeId","data-v-3feb9dc5"]]),{__name:"AccountProfileLinkedAccounts"});function ct(){const{t:i}=X();return he({first_name:C().max(16,i("validation.profile.first_name")).nullable(),last_name:C().max(32,i("validation.profile.last_name")).nullable(),address:C().nullable(),city:C().max(32,i("validation.profile.city")).nullable(),state:C().max(32,i("validation.profile.state")).nullable(),zip:C().max(10,i("validation.profile.zip")).nullable(),country_id:Ve().nullable(),company:C().max(32,i("validation.profile.company")).nullable(),phone:C().max(32,i("validation.profile.phone")).nullable(),subscribed:xe().nullable()})}const ut={class:"tw-text-h2 !tw-text-yellow !tw-mb-4 tw-text-center"},dt={class:"md:tw-px-4 md:tw-pt-4"},mt={class:"billing-information tw-my-6"},_t={class:"tw-text-fs-base tw-leading-none !tw-text-white tw-mb-4 -tw-mt-6 tw-font-semibold"},pt={class:"form-check tw-py-4"},ft={class:"form-check-label md:tw-w-6/12 tw-text-fs-sm",for:"subscribed"},bt={class:"tw-text-end"},vt=P({__name:"ProfileForm",async setup(i){let r,n;const l=U(),c=U(!1),$=U(ee());if(l.value=([r,n]=Q(()=>Z("/api/account/profile")),r=await r,n(),r).value,!l.value)throw me({statusCode:404,statusMessage:"Page Not Found"});const _=([r,n]=Q(()=>Z("/api/countries")),r=await r,n(),r).value,{isSubmitting:u,errors:p,setFieldError:f,handleSubmit:S}=Ae({initialValues:l.value,validationSchema:ct()}),{value:k}=V("first_name"),{value:x}=V("last_name"),{value:M}=V("address"),{value:F}=V("city"),{value:L}=V("state"),{value:T}=V("zip"),{value:E}=V("country_id"),{value:B}=V("company"),{value:N}=V("phone"),{value:O}=V("subscribed");function I(){window.scrollTo({top:0,behavior:"smooth"})}const z=S(async a=>{const e=A(()=>_.find(b=>b.id===E.value)?.code),g={...a,subscribed:a.subscribed?1:0,country_code:e.value};for(const b in g){const R=b;g[R]===null&&(g[R]="")}const D=JSON.stringify(g),w=await $fetch("/api/account/update",{method:"POST",body:D});if(w.success){c.value=!0;const b=_e();b.setUser({...b.user,country:e.value}),$.value=ee(),I()}else for(const b in w.errors)f(b,w.errors[b])});return(a,e)=>{const g=Me,D=rt,w=ge,b=ye,R=oe;return v(),h("form",{onSubmit:e[19]||(e[19]=be((...s)=>t(z)&&t(z)(...s),["prevent"]))},[o("h1",ut,m(a.$t("account.profile.title")),1),o("div",dt,[d(g,{profile:t(l),"is-possible-change-email":t($)},null,8,["profile","is-possible-change-email"]),(v(),Y(D,{key:0},{title:j(()=>[...e[20]||(e[20]=[o("h3",{class:"tw-text-fs-base tw-leading-none !tw-text-white tw-mb-4 -tw-mt-6 tw-font-semibold"}," Linked accounts: ",-1)])]),_:1})),t(c)?(v(),h("div",{key:1,class:"alert alert-success",role:"alert",onClick:e[0]||(e[0]=s=>c.value=!1)},m(a.$t("account.profile.success_saved")),1)):G("",!0),o("div",mt,[o("h3",_t,m(a.$t("account.profile.billing_info.title")),1),d(w,{modelValue:t(k),"onUpdate:modelValue":e[1]||(e[1]=s=>y(k)?k.value=s:null),label:a.$t("account.profile.billing_info.firstname_label"),error:t(p).first_name,"is-disabled":t(u),onFocus:e[2]||(e[2]=s=>t(f)("first_name",""))},null,8,["modelValue","label","error","is-disabled"]),d(w,{modelValue:t(x),"onUpdate:modelValue":e[3]||(e[3]=s=>y(x)?x.value=s:null),label:a.$t("account.profile.billing_info.lastname_label"),error:t(p).last_name,"is-disabled":t(u),onFocus:e[4]||(e[4]=s=>t(f)("last_name",""))},null,8,["modelValue","label","error","is-disabled"]),d(w,{modelValue:t(M),"onUpdate:modelValue":e[5]||(e[5]=s=>y(M)?M.value=s:null),label:a.$t("account.profile.billing_info.address_label"),error:t(p).address,"is-disabled":t(u),onFocus:e[6]||(e[6]=s=>t(f)("address",""))},null,8,["modelValue","label","error","is-disabled"]),d(w,{modelValue:t(F),"onUpdate:modelValue":e[7]||
1(e[7]=s=>y(F)?F.value=s:null),label:a.$t("account.profile.billing_info.city_label"),error:t(p).city,"is-disabled":t(u),onFocus:e[8]||(e[8]=s=>t(f)("city",""))},null,8,["modelValue","label","error","is-disabled"]),d(w,{modelValue:t(L),"onUpdate:modelValue":e[9]||(e[9]=s=>y(L)?L.value=s:null),label:a.$t("account.profile.billing_info.state_label"),error:t(p).state,"is-disabled":t(u),onFocus:e[10]||(e[10]=s=>t(f)("state",""))},null,8,["modelValue","label","error","is-disabled"]),d(w,{modelValue:t(T),"onUpdate:modelValue":e[11]||(e[11]=s=>y(T)?T.value=s:null),label:a.$t("account.profile.billing_info.zip_label"),error:t(p).zip,"is-disabled":t(u),onFocus:e[12]||(e[12]=s=>t(f)("zip",""))},null,8,["modelValue","label","error","is-disabled"]),d(b,{modelValue:t(E),"onUpdate:modelValue":e[13]||(e[13]=s=>y(E)?E.value=s:null),label:a.$t("account.profile.billing_info.country_label"),items:t(_),"value-field":"id"},null,8,["modelValue","label","items"]),d(w,{modelValue:t(B),"onUpdate:modelValue":e[14]||(e[14]=s=>y(B)?B.value=s:null),label:a.$t("account.profile.billing_info.company_label"),error:t(p).company,"is-disabled":t(u),onFocus:e[15]||(e[15]=s=>t(f)("company",""))},null,8,["modelValue","label","error","is-disabled"]),d(w,{modelValue:t(N),"onUpdate:modelValue":e[16]||(e[16]=s=>y(N)?N.value=s:null),label:a.$t("account.profile.billing_info.phone_label"),error:t(p).phone,"is-disabled":t(u),onFocus:e[17]||(e[17]=s=>t(f)("phone",""))},null,8,["modelValue","label","error","is-disabled"])]),o("div",pt,[pe(o("input",{id:"subscribed","onUpdate:modelValue":e[18]||(e[18]=s=>y(O)?O.value=s:null),class:"form-check-input tw-mr-2",type:"checkbox"},null,512),[[fe,t(O)]]),o("label",ft,m(a.$t("account.profile.billing_info.subscribed_text")),1)]),o("div",bt,[d(R,{label:a.$t("account.profile.billing_info.save_label"),class:"btn btn-sm btn-primary btn-spinner",type:"submit",loading:t(u)},null,8,["label","loading"])])])],32)}}}),wt=Object.assign(J(vt,[["__scopeId","data-v-179dd8bf"]]),{__name:"AccountProfileForm"}),Jt=P({__name:"profile",setup(i){return(r,n)=>{const l=wt,c=ke;return v(),Y(c,{"active-item":"profile"},{default:j(()=>[d(l)]),_:1})}}});
1export{Jt 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.