1import{_ as X,a as Y}from"./TabPane-LbBsldHe.js";import{u as R,a as ee,b as B,d as S,r as m,f as h,i as j,g as u,h as e,t as o,s as y,j as v,v as U,y as C,x as D,F as z,_ as te,n as se,N as ae,C as A,D as H,k as N,l as I,J as P,p as Q,w as L,ac as le,q as Z,X as oe,G as ne,H as re,o as ie,$ as ue}from"./index-BHjICRXb.js";import{u as E}from"./useMutation-CczpCh9U.js";import{_ as F}from"./BaseInput-6ZvMZA2O.js";import{v as J}from"./verified-QtaP8iHD.js";const de="/assets/4-DnasUCfg.png",pe={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50"},ce={class:"bg-white rounded-lg shadow-lg w-full max-w-md p-6"},fe={class:"text-xl font-semibold mb-4 text-red-600"},me={class:"mb-6 text-gray-700"},ve={class:"mb-6"},ge={for:"delete-password",class:"block text-gray-700 mb-2"},he={class:"flex justify-end space-x-3"},_e=["disabled"],be=["disabled"],we={key:0},ye={key:1},xe={key:0,class:"mt-4 text-red-600 text-sm"},$e={__name:"ModalDeleteAccount",props:{show:{type:Boolean,default:!1}},emits:["close","deleted"],setup(x,{emit:d}){const n=d,{t:p}=R(),r=m(""),a=ee(),i=B(),{mutate:g,isPending:_,isError:V,error:$}=E({mutationFn:async()=>(await S.delete("/user",{data:{password:r.value}})).data,onSuccess:()=>{n("deleted"),i.clear(),a.replace("/login"),window.history.replaceState(null,null,"/login"),k()},onError:w=>{w&&(w.message=w.response.data?.message||w.response.data?.errors?.password?.join(", ")||p("profile.delete_account.error"))}});function k(){n("close")}return(w,q)=>x.show?(u(),h("div",pe,[e("form",ce,[e("h2",fe,o(w.$t("profile.delete_account.modal_title")),1),e("p",me,o(w.$t("profile.delete_account.modal_message")),1),e("div",ve,[e("label",ge,o(w.$t("profile.delete_account.modal_password_label")),1),y(F,{id:"delete-password",type:"password",modelValue:r.value,"onUpdate:modelValue":q[0]||(q[0]=s=>r.value=s),disabled:v(_),autocomplete:"current-password",placeholder:w.$t("profile.delete_account.modal_password_placeholder")},null,8,["modelValue","disabled","placeholder"])]),e("div",he,[e("button",{class:"px-4 py-2 rounded bg-gray-200 text-gray-700 hover:bg-gray-300",type:"button",onClick:k,disabled:v(_)},o(w.$t("profile.delete_account.cancel")),9,_e),e("button",{class:"px-4 py-2 rounded bg-red-600 text-white hover:bg-red-700",onClick:q[1]||(q[1]=(...s)=>v(g)&&v(g)(...s)),disabled:v(_),type:"button"},[v(_)?(u(),h("span",we,o(w.$t("profile.delete_account.deleting")),1)):(u(),h("span",ye,o(w.$t("profile.delete_account.delete")),1))],8,be)]),v(V)?(u(),h("div",xe,o(v($)?.message||w.$t("profile.delete_account.error")),1)):j("",!0)])])):j("",!0)}},ke={class:"flex flex-col gap-6"},Ce={class:"text-sm text-grayscale-title"},Ve={__name:"DeleteAccountTab",setup(x){const d=m(!1),n=()=>{d.value=!0};return(p,r)=>(u(),h(z,null,[e("div",ke,[e("p",Ce,o(p.$t("profile.delete_account.info")),1),y(D,{class:"w-fit h-12",variant:"outline-danger",onClick:n},{default:U(()=>[C(o(p.$t("profile.delete_account.button")),1)]),_:1})]),y($e,{show:d.value,"onUpdate:show":r[0]||(r[0]=a=>d.value=a),onClose:r[1]||(r[1]=a=>d.value=!1)},null,8,["show"])],64))}},je={name:"UiAlert",components:{BaseButton:D},props:{type:{type:String,default:"info",validator:x=>["info","success","warning","error"].includes(x)},message:{type:String,default:""},closable:{type:Boolean,default:!0},duration:{type:Number,default:0}},data(){return{visible:!0}},computed:{typeClass(){switch(this.type){case"success":return"bg-green-50 text-green-800 border border-green-200";case"warning":return"bg-yellow-50 text-yellow-800 border border-yellow-200";case"error":return"bg-red-50 text-red-800 border border-red-200";default:return"bg-blue-50 text-blue-800 border border-blue-200"}}},mounted(){this.duration>0&&setTimeout(this.close,this.duration)},methods:{close(){this.visible=!1,this.$emit("close")}}},Me={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ue=["stroke"];function Se(x,d,n,p,r,a){const i=se("BaseButton");return r.visible?(u(),h("div",{key:0,class:A(["relative px-6 py-4 rounded mb-4 text-base transition-opacity",a.typeClass]),role:"alert"},[ae(x.$slots,"default",{},()=>[C(o(n.message),1)]),y(i,{variant:"ghost",class:"size-2 absolute top-4 right-6 bg-transparent border-none leading-none text-inherit cursor-pointer",onClick:a.close},{default:U(()=>[(u(),h("svg",Me,[e("path",{d:"M18 6L6 18M18 18L6 6",stroke:n.type==="success"?"#16a34a":n.type==="warning"?"#ca8a04":n.type==="error"?"#dc2626":"#2563eb","stroke-width":"1.5","stroke-linecap":"round"},null,8,Ue)]))]),_:1},8,["onClick"])],2)):j("",!0)}const K=te(je,[["render",Se]]),qe={class:"flex flex-col md:flex-row items-center gap-4"},Fe=["src"],Pe={key:1,class:"size-[70px] rounded-full bg-primary-500 text-white flex items-center justify-center font-bold"},De={class:"flex flex-col justify-center gap-2"},Le={class:"flex gap-3 items-center"},Ee={class:"font-bold"},Ie={class:"font-bold"},Te={key:0,class:"text-sm"},Be={class:"flex flex-col gap-4 mt-5 max-w-[436px]"},He={class:"flex flex-col items-start justify-between gap-1.5"},Ne={class:"text-grayscale-label"},Ke={class:"flex flex-col items-start justify-between gap-1.5"},Oe={class:"text-grayscale-label"},ze={class:"flex gap-2 items-center"},Re={class:"font-bold"},Ae={__name:"ProfileForm",setup(x){const{t:d}=R(),n=m(null),p=m(""),r=m(""),a=m(""),i=m(null),g=m(null),_=B(),V=m(!1),$=Q(()=>w?.value?.name?.split(" ")?.map(t=>t[0]?.toUpperCase())?.slice(0,2)?.join("")??""),k=N({name:"",email:"",image:""}),{data:w,isPending:q}=H({queryKey:["user"],queryFn:()=>S.get("/user").then(t=>t.data.data),staleTime:1e3*60*5,enabled:!!localStorage.getItem("api_token")}),s=()=>{a.value="",V.value=!0},c=()=>{const t=new FormData;t.append("name",p.value),t.append("email",r.value),n.value&&n.value.files&&n.value.files.length>0&&t.append("image",n.value.files[0]),V.value&&t.append("remove_image","1"),M(t)},{mutate:M,isPending:T}=E({mutationFn:t=>S.post("/user?_method=put",t).then(l=>l.data),onSuccess:()=>
1{_.invalidateQueries({queryKey:["user"]}),i.value=d("profile.form.success_update"),g.value="success"},onError:t=>{t.response&&t.response.data&&t.response.data.errors&&Object.assign(k,t.response.data.errors),i.value=d("profile.form.failed_update"),g.value="error"},onMutate:()=>{k.name="",k.email="",k.image="",i.value=null,g.value=null}});I(w,t=>{t&&t&&(p.value=t.name||"",r.value=t.email||"",a.value=t.profile_photo_url||"")},{immediate:!0});const f=t=>{const l=t.target.files[0];l&&(a.value=URL.createObjectURL(l),V.value=!1)};return(t,l)=>(u(),h("form",{onSubmit:L(c,["prevent"]),class:"flex flex-col w-full max-w-md"},[e("div",qe,[a.value?(u(),h("img",{key:0,src:a.value,alt:"profile",class:"size-[70px] object-cover rounded-full"},null,8,Fe)):(u(),h("div",Pe,o($.value),1)),e("div",De,[e("div",Le,[y(D,{onClick:l[0]||(l[0]=b=>t.$refs.fileInput.click()),type:"button",variant:"outline",class:"h-9 w-fit"},{default:U(()=>[e("span",Ee,o(t.$t("profile.form.upload_photo")),1)]),_:1}),a.value?(u(),P(D,{key:0,onClick:s,type:"button",variant:"outline",class:"h-9 w-fit text-error-500"},{default:U(()=>[e("span",Ie,o(t.$t("profile.form.remove")),1)]),_:1})):j("",!0)]),a.value?j("",!0):(u(),h("span",Te,o(t.$t("profile.form.photo_hint")),1))])]),e("input",{type:"file",onChange:f,class:"mt-2 hidden",ref_key:"fileInput",ref:n},null,544),e("div",Be,[e("div",He,[e("span",Ne,[C(o(t.$t("profile.form.name")),1),l[3]||(l[3]=e("span",{class:"text-error-500"},"*",-1))]),y(F,{modelValue:p.value,"onUpdate:modelValue":l[1]||(l[1]=b=>p.value=b),error:k?.name,placeholder:t.$t("profile.form.name_placeholder"),required:""},null,8,["modelValue","error","placeholder"])]),e("div",Ke,[e("span",Oe,o(t.$t("profile.form.email")),1),y(F,{modelValue:r.value,"onUpdate:modelValue":l[2]||(l[2]=b=>r.value=b),error:k?.email,placeholder:t.$t("profile.form.email_placeholder"),readonly:""},null,8,["modelValue","error","placeholder"])])]),y(D,{type:"submit",loading:v(T)||v(q),class:"w-fit mt-10 h-12"},{default:U(()=>[e("div",ze,[l[4]||(l[4]=e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M5.78125 16.5625V12.3438C5.78125 11.826 6.20098 11.4062 6.71875 11.4062H13.2812C13.799 11.4062 14.2188 11.826 14.2188 12.3438V17.0312M12.3438 6.25L6.71875 6.25C6.20098 6.25 5.78125 5.83027 5.78125 5.3125L5.78125 2.5M17.0293 5.77927L14.2207 2.97073C13.9193 2.66933 13.5105 2.5 13.0843 2.5H4.10714C3.21953 2.5 2.5 3.21953 2.5 4.10714V15.8929C2.5 16.7805 3.21953 17.5 4.10714 17.5H15.8929C16.7805 17.5 17.5 16.7805 17.5 15.8929V6.91569C17.5 6.48945 17.3307 6.08067 17.0293 5.77927Z",stroke:"white","stroke-width":"1.5","stroke-linecap":"round"})],-1)),e("span",Re,o(t.$t("profile.form.save")),1)])]),_:1},8,["loading"]),i.value?(u(),P(K,{key:0,type:g.value,class:"mt-4",duration:3e3},{default:U(()=>[C(o(i.value),1)]),_:1},8,["type"])):j("",!0)],32))}},Qe={class:"flex flex-col gap-1"},Ze={class:"text-lg text-grayscale-title font-bold"},Ge={class:"text-sm text-grayscale-title"},Je={class:"flex flex-col items-start justify-between gap-1.5 max-w-[436px] mt-1"},We={class:"text-grayscale-label"},Xe={class:"flex flex-col items-start justify-between gap-1.5 max-w-[436px]"},Ye={class:"text-grayscale-label"},et={key:0,class:"flex flex-col gap-1.5"},tt={class:"text-grayscale-label text-xs"},st={class:"w-full max-w-lg h-2 rounded bg-gray-200 overflow-hidden"},at={class:"text-xs text-grayscale-label"},lt={class:"flex flex-col items-start justify-between gap-1.5 max-w-[436px]"},ot={class:"text-grayscale-label"},nt={class:"flex gap-2 items-center"},rt={class:"font-bold"},it={__name:"UpdatePasswordTab",setup(x){const{t:d}=R(),n=m(""),p=m(""),r=m(""),a=m(0),i=m(null),g=m(null),_=B();I(p,s=>{a.value=V(s)});const V=s=>{let c=0;return s.length>=8&&c++,/[A-Z]/.test(s)&&c++,/[0-9]/.test(s)&&c++,/[^A-Za-z0-9]/.test(s)&&c++,c},$=N({currentPassword:"",newPassword:"",confirmPassword:""}),{isPending:k}=H({queryKey:["user"],queryFn:()=>S.get("/user").then(s=>s.data.data),staleTime:1e3*60*5,enabled:!!localStorage.getItem("api_token")}),{mutate:w,isPending:q}=E({mutationFn:async()=>
1{if(p.value!==r.value)throw{response:{data:{message:d("profile.password.mismatch"),errors:{confirmPassword:d("profile.password.mismatch")}}}};return(await S.post("/user?_method=put&tab=password",{current_password:n.value,new_password:p.value,new_password_confirmation:r.value})).data},onSuccess:()=>{_.invalidateQueries({queryKey:["user"]}),i.value=d("profile.password.success_update"),g.value="success"},onError:s=>{s.response&&s.response.data&&s.response.data.errors&&Object.assign($,s.response.data.errors),i.value=s?.response?.data?.message||d("profile.password.failed_update"),g.value="error"},onMutate:()=>{$.whatsappNumber="",$.otp="",i.value=null,g.value=null}});return(s,c)=>(u(),h("form",{onSubmit:c[3]||(c[3]=L((...M)=>v(w)&&v(w)(...M),["prevent"])),class:"flex flex-col gap-4"},[e("div",Qe,[e("span",Ze,o(s.$t("profile.password.title")),1),e("span",Ge,o(s.$t("profile.password.subtitle")),1)]),c[8]||(c[8]=e("input",{type:"text",name:"username",autocomplete:"username",class:"hidden"},null,-1)),e("div",Je,[e("span",We,[C(o(s.$t("profile.password.current_password")),1),c[4]||(c[4]=e("span",{class:"text-error-500"},"*",-1))]),y(F,{type:"password",class:"max-w-lg",modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=M=>n.value=M),error:$?.currentPassword,placeholder:s.$t("profile.password.current_password"),required:"",autocomplete:"current-password"},null,8,["modelValue","error","placeholder"])]),e("div",Xe,[e("span",Ye,[C(o(s.$t("profile.password.new_password")),1),c[5]||(c[5]=e("span",{class:"text-error-500"},"*",-1))]),y(F,{type:"password",class:"max-w-lg",modelValue:p.value,"onUpdate:modelValue":c[1]||(c[1]=M=>p.value=M),error:$?.newPassword,placeholder:s.$t("profile.password.new_password"),required:"",autocomplete:"new-password"},null,8,["modelValue","error","placeholder"])]),p.value!=""?(u(),h("div",et,[e("span",tt,o(s.$t("profile.password.strength_title")),1),e("div",st,[e("div",{class:A(["h-2 transition-all duration-300",a.value===0?"w-0 bg-gray-200":a.value===1?"w-1/4 bg-error-500":a.value===2?"w-2/4 bg-warning-500":a.value===3?"w-3/4 bg-primary-500":"w-full bg-success-500"])},null,2)]),e("span",at,o(a.value===0?s.$t("profile.password.too_weak"):a.value===1?s.$t("profile.password.weak"):a.value===2?s.$t("profile.password.medium"):a.value===3?s.$t("profile.password.strong"):s.$t("profile.password.very_strong")),1)])):j("",!0),e("div",lt,[e("span",ot,[C(o(s.$t("profile.password.confirm_password")),1),c[6]||(c[6]=e("span",{class:"text-error-500"},"*",-1))]),y(F,{type:"password",class:"max-w-lg",modelValue:r.value,"onUpdate:modelValue":c[2]||(c[2]=M=>r.value=M),error:$?.confirmPassword,placeholder:s.$t("profile.password.confirm_password"),required:"",autocomplete:"new-password"},null,8,["modelValue","error","placeholder"])]),y(D,{type:"submit",loading:v(q)||v(k),class:"w-fit mt-6 h-12",disabled:a.value<2},{default:U(()=>[e("div",nt,[c[7]||(c[7]=e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M5.78125 16.5625V12.3438C5.78125 11.826 6.20098 11.4062 6.71875 11.4062H13.2812C13.799 11.4062 14.2188 11.826 14.2188 12.3438V17.0312M12.3438 6.25L6.71875 6.25C6.20098 6.25 5.78125 5.83027 5.78125 5.3125L5.78125 2.5M17.0293 5.77927L14.2207 2.97073C13.9193 2.66933 13.5105 2.5 13.0843 2.5H4.10714C3.21953 2.5 2.5 3.21953 2.5 4.10714V15.8929C2.5 16.7805 3.21953 17.5 4.10714 17.5H15.8929C16.7805 17.5 17.5 16.7805 17.5 15.8929V6.91569C17.5 6.48945 17.3307 6.08067 17.0293 5.77927Z",stroke:"white","stroke-width":"1.5","stroke-linecap":"round"})],-1)),e("span",rt,o(s.$t("profile.password.update")),1)])]),_:1},8,["loading","disabled"]),i.value?(u(),P(K,{key:1,type:g.value,class:"mt-4",duration:3e3},{default:U(()=>[C(o(i.value),1)]),_:1},8,["type"])):j("",!0)],32))}},ut={class:"flex flex-col gap-8 max-w-[685px]"},dt=le({__name:"ProfileTab",setup(x){return(d,n)=>(u(),h("div",ut,[y(Ae),n[0]||(n[0]=e("div",{class:"w-full border-t border-grayscale-line"},null,-1)),y(it),n[1]||(n[1]=e("div",{class:"w-full border-t border-grayscale-line"},null,-1)),y(Ve)]))}}),pt={class:"flex flex-col"},ct={class:"text-sm text-grayscale-title"},ft={class:"list-decimal list-inside"},mt={class:"flex flex-col items-start justify-between gap-1.5"},vt={class:"text-grayscale-label"},gt={class:"flex flex-row items-start gap-2 w-full"},ht={class:"flex flex-col items-start justify-between gap-1.5"},_t={class:"text-grayscale-label"},bt={class:"flex gap-2 items-center"},wt={class:"font-bold"},yt={__name:"PhoneTab",setup(x){const{t:d}=R(),n=m(""),p=m(""),r=m(null),a=m(null),i=B();I(n,s=>{n.value=s.replace(/\D/g,"")},{immediate:!0,flush:"post"}),I(p,s=>{p.value=s.replace(/\D/g,"")},{immediate:!0,flush:"post"});const g=N({whatsappNumber:"",otp:""}),{data:_,isPending:V}=H({queryKey:["user"],queryFn:()=>S.get("/user").then(s=>s.data.data),staleTime:1e3*60*5,enabled:!!localStorage.getItem("api_token")}),{mutate:$,isPending:k}=E({mutationFn:async()=>(await S.post("/cart-verifyphone",{phone:n.value?.replace(/^0/,"62").replace(/\D/g,""),isPhoneVerified:_?.value?.phone!=null,phone_verify:p.value,otp:p.value})).data,onSuccess:()=>{i.invalidateQueries({queryKey:["user"]}),r.value=d("profile.phone.success_update"),a.value="success"},onError:s=>{s.response&&s.response.data&&s.response.data.errors&&Object.assign(g,s.response.data.errors),r.value=s?.response?.data?.message||d("profile.phone.failed_update"),a.value="error"},onMutate:()=>{g.whatsappNumber="",g.otp="",r.value=null,a.value=null}}),{mutate:w,isPending:q}=E({mutationFn:async()=>
1{if(!n.value)throw g.whatsappNumber=d("profile.phone.otp_empty"),new Error(d("profile.phone.otp_empty"));return(await S.post("/cart-resendotp",{phone:n.value?.replace(/^0/,"62").replace(/\D/g,"")})).data},onSuccess:()=>{r.value=d("profile.phone.otp_sent"),a.value="success"},onError:s=>{s.response&&s.response.data&&s.response.data.errors&&Object.assign(g,s.response.data.errors),r.value=s.message||d("profile.phone.otp_failed"),a.value="error"},onMutate:()=>{g.whatsappNumber="",r.value=null,a.value=null}});return I(_,s=>{s&&s&&(n.value=s.phone||"")},{immediate:!0}),(s,c)=>(u(),h("div",pt,[e("div",ct,[C(o(s.$t("profile.phone.instructions_title"))+" ",1),e("ol",ft,[e("li",null,o(s.$t("profile.phone.step1")),1),e("li",null,o(s.$t("profile.phone.step2")),1),e("li",null,o(s.$t("profile.phone.step3")),1),e("li",null,o(s.$t("profile.phone.step4")),1)])]),e("form",{onSubmit:c[2]||(c[2]=L((...M)=>v($)&&v($)(...M),["prevent"])),class:"flex flex-col gap-4 mt-5"},[e("div",mt,[e("span",vt,[C(o(s.$t("profile.phone.label")),1),c[3]||(c[3]=e("span",{class:"text-error-500"},"*",-1))]),e("div",gt,[y(F,{class:"max-w-[436px] w-full",modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=M=>n.value=M),error:g?.whatsappNumber,placeholder:s.$t("profile.phone.placeholder"),required:""},null,8,["modelValue","error","placeholder"]),y(D,{onClick:v(w),type:"button",variant:"outline-primary",class:"h-12 w-fit shrink-0",loading:v(q)},{default:U(()=>[C(o(s.$t("profile.phone.send_otp")),1)]),_:1},8,["onClick","loading"])])]),e("div",ht,[e("span",_t,[C(o(s.$t("profile.phone.otp_label")),1),c[4]||(c[4]=e("span",{class:"text-error-500"},"*",-1))]),y(F,{class:"max-w-[436px] w-full",modelValue:p.value,"onUpdate:modelValue":c[1]||(c[1]=M=>p.value=M),error:g?.otp,placeholder:s.$t("profile.phone.otp_placeholder"),required:""},null,8,["modelValue","error","placeholder"])]),y(D,{type:"submit",loading:v(k)||v(V),disabled:v(k)||v(V)||!n.value||!p.value,class:"w-fit mt-6 h-12"},{default:U(()=>[e("div",bt,[c[5]||(c[5]=e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M5.78125 16.5625V12.3438C5.78125 11.826 6.20098 11.4062 6.71875 11.4062H13.2812C13.799 11.4062 14.2188 11.826 14.2188 12.3438V17.0312M12.3438 6.25L6.71875 6.25C6.20098 6.25 5.78125 5.83027 5.78125 5.3125L5.78125 2.5M17.0293 5.77927L14.2207 2.97073C13.9193 2.66933 13.5105 2.5 13.0843 2.5H4.10714C3.21953 2.5 2.5 3.21953 2.5 4.10714V15.8929C2.5 16.7805 3.21953 17.5 4.10714 17.5H15.8929C16.7805 17.5 17.5 16.7805 17.5 15.8929V6.91569C17.5 6.48945 17.3307 6.08067 17.0293 5.77927Z",stroke:"white","stroke-width":"1.5","stroke-linecap":"round"})],-1)),e("span",wt,o(s.$t("profile.phone.save")),1)])]),_:1},8,["loading","disabled"]),r.value?(u(),P(K,{key:0,type:a.value,class:"mt-4",duration:3e3},{default:U(()=>[C(o(r.value),1)]),_:1},8,["type"])):j("",!0)],32)]))}},xt={class:"flex flex-col gap-4"},$t={class:"flex flex-col gap-2 w-full"},kt={class:"flex gap-2 items-center font-medium break-all"},Ct=["src"],Vt={class:"text-sm md:text-base break-all"},jt={class:"flex gap-2 justify-end flex-wrap"},Mt=["onClick"],Ut=["onClick"],St=["onClick"],qt={class:"font-semibold text-sm"},Ft={class:"flex flex-col items-start justify-between gap-1.5 w-full"},Pt={class:"text-grayscale-label"},Dt={class:"flex flex-col items-start justify-between gap-1.5"},Lt={class:"text-grayscale-label"},Et={class:"flex flex-col items-start justify-between gap-1.5"},It={class:"text-grayscale-label"},Tt={class:"flex gap-2"},Bt={class:"flex gap-2 items-center"},Ht={class:"font-bold"},Nt={__name:"BankTab",setup(x){const d=m(""),n=m(""),p=m(""),r=m(null),a=m(null),i=m(null),g=B(),_=N({bank_name:"",account_number:"",account_holder:""}),{data:V,isPending:$}=H({queryKey:["user"],queryFn:()=>S.get("/user").then(f=>f.data.data),staleTime:1e3*60*5,enabled:!!localStorage.getItem("api_token")});function k(){d.value="",n.value="",p.value="",r.value=null,Object.keys(_).forEach(f=>_[f]="")}function w(f){r.value=f.id,d.value=f.bank_name,n.value=f.account_number,p.value=f.account_holder,a.value=null}function q(){k()}const{mutate:s,isPending:c}=E({mutationFn:async()=>{const t={action:r.value?"update":"store",bank_name:d.value,account_number:n.value,account_holder:p.value};return r.value&&(t.bank_information_id=r.value),(await S.post("/user?_method=put&tab=bank",t)).data},onSuccess:()=>{g.invalidateQueries({queryKey:["user"]}),a.value=r.value?"Rekening berhasil diperbarui":"Rekening berhasil ditambahkan",i.value="success",k()},onError:f=>{f.response?.data?.errors&&Object.assign(_,f.response.data.errors),a.value=f?.response?.data?.message||"Gagal menyimpan rekening",i.value="error"},onMutate:()=>{Object.keys(_).forEach(f=>_[f]=""),a.value=null,i.value=null}}),{mutate:M}=E({mutationFn:async f=>(await S.post("/user?_method=put&tab=bank",{action:"setDefault",bank_information_id:f})).data,onSuccess:()=>{g.invalidateQueries({queryKey:["user"]}),a.value="Rekening utama berhasil diperbarui",i.value="success"},onError:f=>{a.value=f?.response?.data?.message||"Gagal mengatur rekening utama",i.value="error"}}),{mutate:T}=E({mutationFn:async f=>(await S.post("/user?_method=put&tab=bank",{action:"delete",bank_information_id:f})).data,onSuccess:()=>{g.invalidateQueries({queryKey:["user"]}),a.value="Rekening berhasil dihapus",i.value="success",r.value&&k()},onError:f=>{a.value=f?.response?.data?.message||"Gagal menghapus rekening",i.value="error"}});return(f,t)=>(u(),h("div",xt,[e("div",$t,[(u(!0),h(z,null,Z(v(V)?.bank_informations,l=>(u(),h("div",{key:l.id,class:A(["rounded-xl border p-4 flex flex-col gap-1 md:grid md:grid-cols-3 md:items-center",l.isDefault?"border-primary-500 bg-primary-50":"border-grayscale-line bg-white"])},[e("span",kt,[l.isDefault?(u(),h("img",{key:0,src:v(J),alt:"verified",class:"size-5 shrink-0"},null,8,Ct)):j("",!0),C(" "+o(l.bank_name),1)]),e("span",Vt,o(l.account_number)+" â "+o(l.account_holder),1),e("div",jt,[l.isDefault?j("",!0):(u(),h("button",{key:0,t
1ype:"button",class:"text-xs px-3 py-1.5 rounded-lg border border-primary-500 text-primary-600 hover:bg-primary-50 transition",onClick:b=>v(M)(l.id)},o(f.$t("profile.bank.set_default")),9,Mt)),e("button",{type:"button",class:"text-xs px-3 py-1.5 rounded-lg border border-grayscale-line hover:bg-gray-50 transition",onClick:b=>w(l)},o(f.$t("profile.bank.edit")),9,Ut),e("button",{type:"button",class:"text-xs px-3 py-1.5 rounded-lg border border-error-500 text-error-600 hover:bg-red-50 transition",onClick:b=>v(T)(l.id)},o(f.$t("profile.bank.delete")),9,St)])],2))),128))]),e("form",{onSubmit:t[3]||(t[3]=L((...l)=>v(s)&&v(s)(...l),["prevent"])),class:"flex flex-col gap-4 max-w-[436px] w-full"},[e("p",qt,o(r.value?f.$t("profile.bank.edit_title"):f.$t("profile.bank.add_title")),1),e("div",Ft,[e("span",Pt,[C(o(f.$t("profile.bank.bank_name")),1),t[4]||(t[4]=e("span",{class:"text-error-500"},"*",-1))]),y(F,{class:"max-w-lg w-full",modelValue:d.value,"onUpdate:modelValue":t[0]||(t[0]=l=>d.value=l),error:_?.bank_name,placeholder:f.$t("profile.bank.bank_name_placeholder"),required:""},null,8,["modelValue","error","placeholder"])]),e("div",Dt,[e("span",Lt,[C(o(f.$t("profile.bank.account_number")),1),t[5]||(t[5]=e("span",{class:"text-error-500"},"*",-1))]),y(F,{class:"max-w-lg w-full",modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=l=>n.value=l),error:_?.account_number,placeholder:f.$t("profile.bank.account_number_placeholder"),required:""},null,8,["modelValue","error","placeholder"])]),e("div",Et,[e("span",It,[C(o(f.$t("profile.bank.account_holder")),1),t[6]||(t[6]=e("span",{class:"text-error-500"},"*",-1))]),y(F,{class:"max-w-lg w-full",modelValue:p.value,"onUpdate:modelValue":t[2]||(t[2]=l=>p.value=l),error:_?.account_holder,placeholder:f.$t("profile.bank.account_holder_placeholder"),required:""},null,8,["modelValue","error","placeholder"])]),e("div",Tt,[y(D,{type:"submit",loading:v(c)||v($),class:"w-fit h-12"},{default:U(()=>[e("div",Bt,[t[7]||(t[7]=e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M5.78125 16.5625V12.3438C5.78125 11.826 6.20098 11.4062 6.71875 11.4062H13.2812C13.799 11.4062 14.2188 11.826 14.2188 12.3438V17.0312M12.3438 6.25L6.71875 6.25C6.20098 6.25 5.78125 5.83027 5.78125 5.3125L5.78125 2.5M17.0293 5.77927L14.2207 2.97073C13.9193 2.66933 13.5105 2.5 13.0843 2.5H4.10714C3.21953 2.5 2.5 3.21953 2.5 4.10714V15.8929C2.5 16.7805 3.21953 17.5 4.10714 17.5H15.8929C16.7805 17.5 17.5 16.7805 17.5 15.8929V6.91569C17.5 6.48945 17.3307 6.08067 17.0293 5.77927Z",stroke:"white","stroke-width":"1.5","stroke-linecap":"round"})],-1)),e("span",Ht,o(r.value?f.$t("profile.bank.save_changes"):f.$t("profile.bank.add_button")),1)])]),_:1},8,["loading"]),r.value?(u(),h("button",{key:0,type:"button",class:"px-4 h-12 rounded-lg border border-grayscale-line text-sm hover:bg-gray-50 transition",onClick:q},o(f.$t("profile.bank.cancel")),1)):j("",!0)]),a.value?(u(),P(K,{key:0,type:i.value,class:"mt-4",duration:3e3},{default:U(()=>[C(o(a.value),1)]),_:1},8,["type"])):j("",!0)],32)]))}},Kt={class:"flex flex-col gap-2"},Ot={class:"flex flex-col gap-2 w-full"},zt=["onMousedown"],Rt={class:"flex gap-2 items-center break-all"},At=["src"],Qt={class:"break-all text-sm md:text-base"},Zt={class:"flex gap-2 items-center flex-wrap justify-between"},Gt={class:"break-all text-sm md:text-base"},Jt={class:"flex gap-2 flex-wrap"},Wt=["onClick"],Xt=["onClick"],Yt=["onClick"],es={class:"font-semibold text-sm"},ts={class:"flex flex-col items-start justify-between gap-1.5"},ss={class:"text-grayscale-label"},as={class:"flex flex-col items-start justify-between gap-1.5"},ls={class:"text-grayscale-label"},os={class:"flex flex-col items-start justify-between gap-1.5"},ns={class:"text-grayscale-label"},rs={class:"flex gap-2"},is={class:"flex gap-2 items-center"},us={class:"font-bold"},ds={__name:"TargetInvoiceTab",setup(x){const d=m(""),n=m(""),p=m(""),r=m(null),a=m(null),i=m(null),g=B(),_=m(null),V=N({name:"",phone:"",email:""}),{data:$,isPending:k}=H({queryKey:["user"],queryFn:()=>S.get("/user").then(t=>t.data.data),staleTime:1e3*60*5,enabled:!!localStorage.getItem("api_token")});function w(){d.value="",n.value="",p.value="",r.value=null,Object.keys(V).forEac
1h(t=>V[t]="")}function q(t){r.value=t.id,d.value=t.name,n.value=t.phone,p.value=t.email,a.value=null}function s(){w()}const{mutate:c,isPending:M}=E({mutationFn:async()=>{const l={action:r.value?"update":"store",name:d.value,phone:n.value,email:p.value};return r.value&&(l.invoice_for_id=r.value),(await S.post("/user?_method=put&tab=invoice",l)).data},onSuccess:()=>{g.invalidateQueries({queryKey:["user"]}),a.value=r.value?"Invoice berhasil diperbarui":"Invoice berhasil ditambahkan",i.value="success",w()},onError:t=>{t.response?.data?.errors&&Object.assign(V,t.response.data.errors),a.value=t?.response?.data?.message||"Gagal menyimpan invoice",i.value="error"},onMutate:()=>{Object.keys(V).forEach(t=>V[t]=""),a.value=null,i.value=null}}),{mutate:T}=E({mutationFn:async t=>(await S.post("/user?_method=put&tab=invoice",{invoice_for_id:t,action:"setDefault"})).data,onSuccess:()=>{g.invalidateQueries({queryKey:["user"]}),a.value="Invoice berhasil dijadikan default",i.value="success"},onError:t=>{a.value=t?.response?.data?.message||"Gagal menjadikan invoice default",i.value="error"}}),{mutate:f}=E({mutationFn:async t=>(await S.post("/user?_method=put&tab=invoice",{invoice_for_id:t,action:"delete"})).data,onSuccess:()=>{g.invalidateQueries({queryKey:["user"]}),a.value="Invoice berhasil dihapus",i.value="success",r.value&&w()},onError:t=>{a.value=t?.response?.data?.message||"Gagal menghapus invoice",i.value="error"}});return I(n,t=>{n.value=t.replace(/\D/g,"")},{immediate:!0,flush:"post"}),(t,l)=>(u(),h("div",Kt,[e("div",Ot,[(u(!0),h(z,null,Z(v($)?.invoice_fors,(b,W)=>(u(),h("div",{key:W,class:A(["rounded-xl border p-4 cursor-pointer transition-transform duration-200 hover:scale-105 hover:shadow-lg flex flex-col gap-1 md:grid md:grid-cols-3 md:items-center",[b.isDefault?"border-primary-500 bg-primary-50":"border-grayscale-line bg-white",{"hover:scale-100":_.value===b.
1id}]]),onMousedown:O=>_.value=b.id,onMouseup:l[0]||(l[0]=O=>_.value=null),onMouseleave:l[1]||(l[1]=O=>_.value=null)},[e("span",Rt,[b.isDefault?(u(),h("img",{key:0,src:v(J),alt:"verified",class:"size-5 shrink-0"},null,8,At)):j("",!0),C(" "+o(b.name),1)]),e("span",Qt,o(b.phone),1),e("div",Zt,[e("span",Gt,o(b.email),1),e("div",Jt,[b.isDefault?j("",!0):(u(),h("button",{key:0,type:"button",class:"text-xs px-3 py-1.5 rounded-lg border border-primary-500 text-primary-600 hover:bg-primary-50 transition",onClick:L(O=>v(T)(b.id),["stop"])},o(t.$t("profile.target_invoice.set_default")),9,Wt)),b.id!==null?(u(),h(z,{key:1},[e("button",{type:"button",class:"text-xs px-3 py-1.5 rounded-lg border border-grayscale-line hover:bg-gray-50 transition",onClick:L(O=>q(b),["stop"])},o(t.$t("profile.target_invoice.edit")),9,Xt),e("button",{type:"button",class:"text-xs px-3 py-1.5 rounded-lg border border-error-500 text-error-600 hover:bg-red-50 transition",onClick:L(O=>v(f)(b.id),["stop"])},o(t.$t("profile.target_invoice.delete")),9,Yt)],64)):j("",!0)])])],42,zt))),128))]),e("form",{onSubmit:l[5]||(l[5]=L((...b)=>v(c)&&v(c)(...b),["prevent"])),class:"flex flex-col gap-4 max-w-md"},[e("p",es,o(r.value?t.$t("profile.target_invoice.edit_title"):t.$t("profile.target_invoice.add_title")),1),e("div",ts,[e("span",ss,[C(o(t.$t("profile.target_invoice.name")),1),l[6]||(l[6]=e("span",{class:"text-error-500"},"*",-1))]),y(F,{class:"max-w-[436px]",modelValue:d.value,"onUpdate:modelValue":l[2]||(l[2]=b=>d.value=b),error:V?.name,placeholder:t.$t("profile.target_invoice.name_placeholder"),required:""},null,8,["modelValue","error","placeholder"])]),e("div",as,[e("span",ls,[C(o(t.$t("profile.target_invoice.phone")),1),l[7]||(l[7]=e("span",{class:"text-error-500"},"*",-1))]),y(F,{class:"max-w-[436px]",modelValue:n.value,"onUpdate:modelValue":l[3]||(l[3]=b=>n.value=b),error:V?.phone,placeholder:t.$t("profile.target_invoice.phone_placeholder"),required:""},null,8,["modelValue","error","placeholder"])]),e("div",os,[e("span",ns,[C(o(t.$t("profile.target_invoice.email")),1),l[8]||(l[8]=e("span",{class:"text-error-500"},"*",-1))]),y(F,{class:"max-w-[436px]",modelValue:p.value,"onUpdate:modelValue":l[4]||(l[4]=b=>p.value=b),error:V?.email,placeholder:t.$t("profile.target_invoice.email_placeholder"),required:""},null,8,["modelValue","error","placeholder"])]),e("div",rs,[y(D,{type:"submit",loading:v(M)||v(k),class:"w-fit h-12 mt-6"},{default:U(()=>[e("div",is,[e("span",us,o(r.value?t.$t("profile.target_invoice.save_changes"):t.$t("profile.target_invoice.add_button")),1)])]),_:1},8,["loading"]),r.value?(u(),h("button",{key:0,type:"button",class:"px-4 h-12 mt-6 rounded-lg border border-grayscale-line text-sm hover:bg-gray-50 transition",onClick:s},o(t.$t("profile.target_invoice.cancel")),1)):j("",!0)]),a.value?(u(),P(K,{key:0,type:i.value,class:"mt-4",duration:3e3},{default:U(()=>[C(o(a.value),1)]),_:1},8,["type"])):j("",!0)],32)]))}},ps={class:"max-w-md flex flex-col gap-6"},cs=["innerHTML"],fs={class:"flex gap-2 items-center"},ms={class:"font-bold"},vs={__name:"ContactUsTab",setup(x){const d=()=>{window.open("https://api.whatsapp.com/send?phone=6281329501184&text=Halo%20Publikasimedia%2C%20%2Amau%20konsul%2A.","_blank","noopener,noreferrer")};return(n,p)=>(u(),h("div",ps,[e("p",{class:"text-sm text-grayscale-title",innerHTML:n.$t("profile.contact_us.description")},null,8,cs),y(D,{class:"w-fit",size:"lg",onClick:d},{default:U(()=>[e("div",fs,[p[0]||(p[0]=e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M10 10L10 13.75M10 7.22046V7.1875M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),e("span",ms,o(n.$t("profile.contact_us.button")),1)])]),_:1})]))}},gs={class:"w-full flex flex-col gap-2"},hs=["name","accept","disabled"],_s={key:0,class:"flex flex-col items-center gap-3"},bs={class:"gap-1 flex-col flex items-center"},ws={class:"font-bold text-primary-500"},ys={class:"text-sm flex flex-row gap-1"},xs=["src"],$s={key:1},ks={class:"w-full flex flex-col items-center gap-2 p-4"},Cs={class:"w-full bg-gray-200 rounded-full h-3"},Vs={class:"text-sm text-primary-500 font-bold"},js={class:"text-xs text-grayscale-placeholder"},Ms={key:0,class:"text-error-500 text-sm"},G={__name:"UploadForm",props:{name:{type:String,default:"file"},uploading:{type:Boolean,default:!1},uploadProgress:{type:Number,default:0},uploadError:{type:String,default:""},accept:{type:String,default:".doc,.docx,.pdf"},onFileChange:{type:Function,default:()=>{}}},setup(x){const d=m(null),n=m(!1),p=x;I(()=>p?.uploading,a=>{!a&&d.value&&(d.value.value="")}
1);const r=a=>{n.value=!1;const i=a.dataTransfer.files;i&&i.length>0&&(d.value.files=i,p.onFileChange({target:d.value}))};return(a,i)=>(u(),h("div",gs,[e("div",{class:A(["border border-dashed py-8 w-full rounded-lg",[n.value?"border-primary-500 bg-primary-50":"",x.uploading?"cursor-not-allowed":"cursor-pointer"]]),onDragover:i[1]||(i[1]=L(g=>n.value=!0,["prevent"])),onDragleave:i[2]||(i[2]=L(g=>n.value=!1,["prevent"])),onDrop:L(r,["prevent"]),onClick:i[3]||(i[3]=g=>d.value?.click())},[e("input",{type:"file",ref_key:"fileInputRef",ref:d,class:"hidden",name:x.name,onChange:i[0]||(i[0]=(...g)=>x.onFileChange&&x.onFileChange(...g)),accept:x.accept,disabled:x.uploading},null,40,hs),x.uploading?(u(),h("div",$s,[e("div",ks,[e("div",Cs,[e("div",{class:"bg-primary-500 h-3 rounded-full transition-all duration-300",style:ne({width:x.uploadProgress+"%"})},null,4)]),e("span",Vs,o(x.uploadProgress)+"%",1),e("span",js,o(a.$t("upload.uploading")),1)])])):(u(),h("div",_s,[i[4]||(i[4]=e("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M7.85714 20.5712C5.7269 20.5712 4 19.2382 4 17.2835C4 15.3289 5.7269 13.7444 7.85714 13.7444C8.002 13.7444 8.145 13.7517 8.28571 13.766V13.7444H8.33877C8.30375 13.4867 8.28571 13.2242 8.28571 12.9579C8.28571 9.48298 11.3558 6.66602 15.1429 6.66602C17.7074 6.66602 19.9431 7.95777 21.1193 9.87083C21.4067 9.83204 21.7008 9.81195 22 9.81195C25.3137 9.81195 28 12.2768 28 15.3173C28 17.8203 26.1797 19.7283 23.6875 20.3572M15.8106 25.3327V16.3004M15.8106 16.3004L11.875 20.0254M15.8106 16.3004L19.75 20.0254",stroke:"#2E77F9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),e("div",bs,[e("span",ws,o(a.$t("upload.drag_drop_hint")),1),e("div",ys,[e("img",{src:v(oe),alt:"info",class:"size-4"},null,8,xs),C(" "+o(a.$t("upload.max_size_hint",{size:"2 MB"})),1)])])]))],34),x.uploadError!=""?(u(),h("span",Ms,o(x.uploadError),1)):j("",!0)]))}},Us={class:"flex flex-col items-start justify-between gap-1.5"},Ss={class:"text-grayscale-title"},qs={key:0},Fs=["src"],Ps={class:"flex flex-col items-start justify-between gap-1.5"},Ds={class:"text-grayscale-title"},Ls={key:1},Es=["src"],Is={class:"flex flex-col items-start justify-between gap-1.5"},Ts={class:"text-grayscale-label"},Bs={class:"flex gap-2 items-center"},Hs={class:"font-bold"},Ns={class:"flex gap-2 items-center"},Ks={class:"font-bold"},Os={__name:"AdditionalTab",setup(x){const d=m(""),n=m(""),p=m(""),r=m(""),a=m(""),i=m(null),g=m(null),_=m(!1),V=B(),$=N({address:"",bukti_ktp:[],bukti_npwp:[]}),k=Q(()=>!!p.value&&!n.value),w=Q(()=>!!a.value&&!r.value),q=t=>{if(_.value=!0,t.target.files[0]){const l=t.target.name;l==="ktp"?(n.value=t.target.files[0],p.value=URL.createObjectURL(t.target.files[0])):l==="npwp"&&(r.value=t.target.files[0],a.value=URL.createObjectURL(t.target.files[0]))}_.value=!1},{data:s,isPending:c}=H({queryKey:["user"],queryFn:()=>S.get("/user").then(t=>t.data.data),staleTime:1e3*60*5,enabled:!!localStorage.getItem("api_token")}),{mutate:M,isPending:T}=E({mutationFn:async()=>{const t=new FormData;return n.value&&t.append("bukti_ktp",n.value),r.value&&t.append("bukti_npwp",r.value),t.append("alamat",d.value),(await S.post("/user?_method=put&tab=detail",t)).data},onSuccess:()=>{V.invalidateQueries({queryKey:["user"]}),i.value="Data berhasil diperbarui",g.value="success",n.value="",r.value=""},onError:t=>{t.response&&t.response.data&&t.response.data.errors&&Object.assign($,t.response.data.errors),i.value=t?.response?.data?.message||"Data gagal disimpan",g.value="error"},onMutate:()=>{$.bukti_ktp=[],$.bukti_npwp=[],i.value=null,g.value=null}}),f=t=>{window.open(t,"_blank","noopener,noreferrer")};return I(s,t=>{t&&t.detail&&(p.value=t.detail.ktp_url||"",a.value=t.detail.npwp_url||"",d.value=t.detail.alamat||"")},{immediate:!0}),(t,l)=>(u(),h("form",{onSubmit:l[3]||(l[3]=L((...b)=>v(M)&&v(M)(...b),["prevent"])),class:"flex flex-col gap-4 w-full md:w-[80%]"},[e("div",Us,[e("span",Ss,o(t.$t("profile.documents.upload_ktp")),1),k.value?j("",!0):(u(),P(G,{key:0,accept:"image/jpg,image/png,image/jpeg",onFileChange:q,name:"ktp","upload-error":$.bukti_ktp?.join(),uploading:_.value},null,8,["upload-error","uploading"]))]),p.value?(u(),h("div",qs,[e("img",{src:p.value,alt:"KTP Preview",class:"mt-2 max-h-48 object-contain border cursor-pointer",onClick:l[0]||(l[0]=b=>f(p.value))},null,8,Fs)])):j("",!0),e("div",Ps,[e("span",Ds,o(t.$t("profile.documents.upload_npwp")),1),w.value?j("",!0):(u(),P(G,{key:0,accept:"image/jpg,image/png,image/jpeg",onFileChange:q,name:"npwp","upload-error":$.bukti_npwp?.join()},null,8,["upload-error"]))]),a.value?(u(),h("div",Ls,[e("img",{src:a.value,alt:"NPWP Preview",class:"mt-2 max-h-48 object-contain border cursor-pointer",onClick:l[1]||(l[1]=b=>f(a.value))},null,8,Es)])):j("",!0),e("div",Is,[e("span",Ts,o(t.$t("profile.documents.address")),1),y(F,{modelValue:d.value,"onUpdate:modelValue":l[2]||(l[2]=b=>d.value=b),type:"textarea",placeholder:t.$t("profile.documents.address_placeholder"),rows:"4"},null,8,["modelValue","placeholder"])]),k.value&&w.value&&!n.value&&!r.value&&!d.value?(u(),P(D,{key:2,type:"button",disabled:"",size:"lg",class:"w-fit opacity-50 h-12 mt-6"},{default:U(()=>[e("div",Bs,[l[4]||(l[4]=e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M5.78125 16.5625V12.3438C5.78125 11.826 6.20098 11.4062 6.71875 11.4062H13.2812C13.799 11.4062 14.2188 11.826 14.2188 12.3438V17.0312M12.3438 6.25L6.71875 6.25C6.20098 6.25 5.78125 5.83027 5.78125 5.3125L5.78125 2.5M17.0293 5.77927L14.2207 2.97073C13.9193 2.66933 13.5105 2.5 13.0843 2.5H4.10714C3.21953 2.5 2.5 3.21953 2.5 4.10714V15.8929C2.5 16.7805 3.21953 17.5 4.10714 17.5H15.8929C16.7805 17.5 17.5 16.7805 17.5 15.8929V6.91569C17.5 6.48945 17.3307 6.08067 17.0293 5.77927Z",stroke:"white","stroke-width":"1.5","stroke-linecap":"round"})],-1)),e("span",Hs,o(t.$t("profile.documents.all_uploaded")),1)])]),_:1})):(u(),P(D,{key:3,type:"submit",loading:v(T)||v(c),class:"w-fit h-12 mt-6"},{default:U(()=>[e("div",Ns,[l[5]||(l[5]=e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M5.78125 16.5625V12.3438C5.78125 11.826 6.20098 11.4062 6.71875 11.4062H13.2812C13.799 11.4062 14.2188 11.826 14.2188 12.3438V17.0312M12.3438 6.25L6.71875 6.25C6.20098 6.25 5.78125 5.83027 5.78125 5.3125L5.78125 2.5M17.0293 5.77927L14.2207 2.97073C13.9193 2.66933 13.5105 2.5 13.0843 2.5H4.10714C3.21953 2.5 2.5 3.21953 2.5 4.10714V15.8929C2.5 16.7805 3.21953 17.5 4.10714 17.5H15.8929C16.7805 17.5 17.5 16.7805 17.5 15.8929V6.91569C17.5 6.48945 17.3307 6.08067 17.0293 5.77927Z",stroke:"white","stroke-width":"1.5","stroke-linecap":"round"})],-1)),e("span",Ks,o(t.$t("profile.documents.save")),1)])]),_:1},8,["loading"])),i.value?(u(),P(K,{key:4,type:g.value,class:"mt-4",duration:3e3},{default:U(()=>[C(o(i.value),1)]),_:1},8,["type"])):j("",!0)],32))}},zs={class:"flex flex-col gap-3"},Rs={class:"font-['Product_Sans',sans-serif] font-bold text-2xl leading-[34px] text-[#161616]"},As={class:"flex flex-col md:flex-row justify-between items-start rounded-xl border border-grayscale-line p-4 sm:p-6 gap-2"},Qs=["src","alt"],Zs=["src"],ea={__name:"ProfilePage",setup(x){const d=re(),{t:n}=R(),p=m(d.query.tabIndex||"0"),r=Q(()=>[{label:n("profile.tabs.profile"),component:dt},{label:n("profile.tabs.phone"),component:yt},{label:n("profile.tabs.bank"),component:Nt},{label:n("profile.tabs.documents"),component:Os},{label:n("profile.tabs.target_invoice"),component:ds},{label:n("profile.tabs.contact_us"),component:vs}]),a=m({}),i=async()=>{try{const _=await S.get("/news",{params:{page:"profile",per_page:1}});_.data.data.length>0&&(a.value=_.data.data[0])}catch(_){console.error("Error fetching banner:",_)}},g=()=>{a.value.link&&(window.location.href=a.value.link)};return ie(i),(_,V)=>(u(),h("div",zs,[e("h1",Rs,o(_.$t("profile.account_settings")),1),y(Y,{textSize:"xs",defaultActiveIndex:p.value},{default:U(()=>[(u(!0),h(z,null,Z(r.value,($,k)=>(u(),P(X,{key:k,label:$.label,index:k.toString()},{default:U(()=>[e("div",As,[(u(),P(ue($.component),{class:"flex-1"})),a.value.img?(u(),h("img",{key:0,src:a.value.img,alt:a.value.title,class:"w-full lg:w-fit lg:h-dvh hidden",onClick:g},null,8,Qs)):(u(),h("img",{key:1,src:v(de),alt:"banner",class:"w-full md:w-1/3 hidden"},null,8,Zs))])]),_:2},1032,["label","index"]))),128))]),_:1},8,["defaultActiveIndex"])]))}};export{ea 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.