import{r as s,h as t,a as i}from"./p-e97fde0a.js";import{a as e}from"./p-6135d661.js";import{o as a}from"./p-b719a497.js";import{a as r}from"./p-401e165e.js";import"./p-d3366af3.js";const d=":host{display:block;position:relative}.customer-details{display:grid;gap:0.75em}";const o=d;const n=class{constructor(t){s(this,t);this.customerId=undefined;this.heading=undefined;this.customer=undefined;this.loading=undefined;this.error=undefined}componentWillLoad(){a(this.el,(()=>{this.fetch()}))}async fetch(){if(""===this.customerId){return}try{this.loading=true;this.customer=await await e({path:r(`surecart/v1/customers/${this.customerId}`,{expand:["shipping_address","billing_address","tax_identifier"]})})}catch(s){if(s===null||s===void 0?void 0:s.message){this.error=s.message}else{this.error=wp.i18n.__("Something went wrong","surecart")}console.error(this.error)}finally{this.loading=false}}render(){return t("sc-customer-details",{key:"1896331a0ec0570d43006588d70ed8bfa9d85b99",customer:this.customer,loading:this.loading,error:this.error,heading:this.heading,"edit-link":r(window.location.href,{action:"edit",model:"customer",id:this.customerId})})}get el(){return i(this)}};n.style=o;export{n as sc_dashboard_customer_details};
//# sourceMappingURL=p-0675fbe5.entry.js.map