import{o as n,c as i,a as e,x as g,s as x,g as f,b as w,d as v,h as s,an as b,F as y,l as k,j as a,av as A,t as l,p as c,B as $,w as C,aw as M}from"./app-B-4i4xU3.js";function B(m,r){return n(),i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{d:"M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z"}),e("path",{d:"M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z"})])}const V={class:"flex flex-col h-full"},j={class:"p-3 md:p-4 xl:p-6 h-full flex flex-col justify-between gap-4"},N={class:"space-y-4"},D={class:"flex w-[60px] sm:w-[88px] bg-slate-50 dark:bg-slate-900 rounded-lg flex-col gap-2 justify-center items-center shrink-0"},Z={class:"px-1.5 py-[3px] bg-slate-800 rounded-md text-white text-xs font-medium uppercase"},E={class:"overflow-hidden"},F={class:"text-slate-950 dark:text-white text-lg font-medium leading-normal tracking-tight"},H={class:"text-slate-500 text-base font-normal leading-normal"},S={class:"text-slate-500 text-base font-normal leading-normal truncate"},z={key:0,class:"text-blue-500 mt-1 text-sm font-normal leading-[18px] italic"},L=["onClick"],R={class:"text-xs md:text-sm font-normal"},T={key:0,class:"w-full bg-white dark:bg-slate-800 p-2 md:p-3 lg:p-4 rounded md:rounded-lg border border-slate-200 dark:border-slate-700"},q={class:"text-slate-600 dark:text-slate-400 text-xl font-medium leading-normal italic"},G={class:"w-full flex justify-end"},I={class:"text-base font-medium leading-normal"},P={__name:"ManageAddress",setup(m){const r=g(),p=x(),u=f();w(()=>{d(),window.scrollTo(0,0)});const d=()=>{r.fetchAddresses()},h=o=>{p.push({name:"edit-address",params:{id:o.id}})};return(o,J)=>{const _=v("router-link");return n(),i("div",V,[s(b,{title:o.$t("Manage Address")},null,8,["title"]),e("div",j,[e("div",N,[(n(!0),i(y,null,k(a(r).addresses,t=>(n(),i("div",{key:t.id,class:"p-2 md:p-3 lg:p-4 flex gap-2 md:gap-4 xl:gap-6 rounded-lg border border-slate-200 dark:border-slate-700 w-full bg-white dark:bg-slate-800 relative"},[e("div",D,[s(a(A),{class:"w-6 h-6 text-primary-600"}),e("div",Z,l(t==null?void 0:t.address_type),1)]),e("div",E,[e("div",F,l(t==null?void 0:t.name),1),e("div",H,l(t==null?void 0:t.phone),1),e("div",S,l((t!=null&&t.flat_no?(t==null?void 0:t.flat_no)+", ":"")+(t==null?void 0:t.address_line)+", "+(t!=null&&t.address_line2?(t==null?void 0:t.address_line2)+", ":""))+" "+l(t==null?void 0:t.area),1),t.is_default?(n(),i("div",z,l(o.$t("Default Address")),1)):c("",!0)]),e("button",{class:$(["absolute top-2 md:top-3 lg:top-4 px-1 py-0.5 md:px-2 md:py-1 rounded-md border border-primary hover:bg-primary text-primary hover:text-white transition-all flex items-center gap-0.5",a(u).langDirection=="rtl"?"left-2 md:left-3 lg:left-4":"right-2 md:right-3 lg:right-4"]),type:"button",onClick:K=>h(t)},[s(a(B),{class:"w-4 h-4 md:w-5 md:h-5"}),e("div",R,l(o.$t("Edit")),1)],10,L)]))),128)),a(r).addresses.length===0?(n(),i("div",T,[e("div",q,l(o.$t("Address list is empty")),1)])):c("",!0)]),e("div",G,[s(_,{to:"/manage-address/new",class:"p-2 md:p-3 lg:p-4 flex gap-2 rounded md:rounded-lg bg-primary text-white items-center"},{default:C(()=>[s(a(M),{class:"w-5 h-5"}),e("div",I,l(o.$t("New Address")),1)]),_:1})])])])}}};export{P as default};
