import{r as t,h as e,a as s}from"./p-9add63ef.js";import"./p-445fd8b4.js";import{o as i}from"./p-b719a497.js";import{a as r}from"./p-401e165e.js";import{a}from"./p-259c3935.js";import"./p-d3366af3.js";const o=":host{display:block;position:relative}.customer-details{display:grid;gap:0.75em}";const d=o;const n=class{constructor(e){t(this,e);this.customerId=undefined;this.heading=undefined;this.customer=undefined;this.loading=undefined;this.error=undefined}componentWillLoad(){i(this.el,(()=>{this.fetch()}))}async fetch(){if(""===this.customerId){return}try{this.loading=true;this.customer=await await a({path:r(`surecart/v1/customers/${this.customerId}`,{expand:["shipping_address","billing_address","tax_identifier"]})})}catch(t){if(t===null||t===void 0?void 0:t.message){this.error=t.message}else{this.error=wp.i18n.__("Something went wrong","surecart")}console.error(this.error)}finally{this.loading=false}}render(){return e("sc-customer-details",{key:"6031246d62717e72b0f2ad69a2da34e865d7b56d",exportparts:"base, heading, heading-text, heading-title, heading-description, error__base, error__icon, error__text, error__title, error__message, test-tag__base, test-tag__content, button__base, button__label, button__prefix",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 s(this)}};n.style=d;export{n as sc_dashboard_customer_details};
//# sourceMappingURL=p-d2d03331.entry.js.map