import{cc as u,db as _,eb as m,ec as p,k as r,q as a,t as s}from"./chunk-BYJPVSLE.js";var o=class{static toFormData(e){let t=new FormData;return e.id&&t.append("id",e.id),e.customer_id&&t.append("customer_id",e.customer_id),e.customer_name&&t.append("customer_name",e.customer_name),e.stripe_token_id&&t.append("stripe_token_id",e.stripe_token_id),e.stripe_customer_id&&t.append("stripe_customer_id",e.stripe_customer_id),e.card_id&&t.append("card_id",e.card_id),e.card_number&&t.append("card_number",e.card_number),e.card_brand&&t.append("card_brand",e.card_brand),e.card_type&&t.append("card_type",e.card_type),e.exp_month&&t.append("exp_month",e.exp_month),e.exp_year&&t.append("exp_year",e.exp_year),e.country&&t.append("country",e.country),e.client_ip&&t.append("client_ip",e.client_ip),e.amount&&t.append("amount",e.amount.toString()),e.restaurant_id&&t.append("restaurant_id",e.restaurant_id),e.service_type&&t.append("service_type",e.service_type),e.order_id&&t.append("order_id",e.order_id),e.booking_id&&t.append("booking_id",e.booking_id),t}};var v=(()=>{class n{constructor(t){this.http=t,this.url=u.apiBaseUrl+"cards/"}get(t={}){let i=new _;return t.service_type&&(i=i.set("service_type",t.service_type)),t.customer_id&&(i=i.set("customer_id",t.customer_id)),t.nopaginate&&(i=i.set("nopaginate",t.nopaginate)),this.http.get(`${this.url}`,{params:i}).pipe(r(p.handleError))}show(t){return this.http.get(this.url+t).pipe(r(p.handleError))}create(t){return this.http.post(this.url,o.toFormData(t)).pipe(r(p.handleError))}update(t){return this.http.post(this.url+t.id,o.toFormData(t)).pipe(r(p.handleError))}delete(t){return this.http.delete(this.url+t).pipe(r(p.handleError))}payment_intent(t){return this.http.post(this.url+"payment-intent",o.toFormData(t)).pipe(r(p.handleError))}static{this.\u0275fac=function(i){return new(i||n)(s(m))}}static{this.\u0275prov=a({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();export{o as a,v as b};
