import{cc as f,db as h,eb as c,ec as p,k as a,q as u,t as l}from"./chunk-BYJPVSLE.js";var n=class{constructor(){this.title="Home",this.status=!0}static toFormData(r){let t=new FormData;return r.id&&t.append("id",r.id),r.user_id&&t.append("user_id",r.user_id),r.title&&t.append("title",r.title),r.flat_no&&t.append("flat_no",r.flat_no),r.address&&t.append("address",r.address),r.latitude&&t.append("latitude",r.latitude),r.longitude&&t.append("longitude",r.longitude),r.zipcode&&t.append("zipcode",r.zipcode),t.append("status",r.status?"1":"0"),t}};var w=(()=>{class e{constructor(t){this.http=t,this.url=f.apiBaseUrl+"address-book/",this.carts=[]}get(t={}){let i=new h;return t.customer_id&&(i=i.set("customer_id",t.customer_id)),t.restaurant_id&&(i=i.set("restaurant_id",t.restaurant_id)),t.nopaginate&&(i=i.set("nopaginate",t.nopaginate)),this.http.get(`${this.url}`,{params:i}).pipe(a(p.handleError))}show(t){return this.http.get(this.url+t).pipe(a(p.handleError))}create(t){return this.http.post(this.url,n.toFormData(t)).pipe(a(p.handleError))}update(t){return this.http.post(this.url+t.id,n.toFormData(t)).pipe(a(p.handleError))}delete(t){return this.http.delete(this.url+t).pipe(a(p.handleError))}static{this.\u0275fac=function(i){return new(i||e)(l(c))}}static{this.\u0275prov=u({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{n as a,w as b};
