import{Fragment,h}from"@stencil/core";import{__}from"@wordpress/i18n";import{addQueryArgs}from"@wordpress/url";export class ScWordPressUser{constructor(){this.heading=void 0,this.user=void 0}renderContent(){var e,s,r,t,i,l,n,o;return this.user?h(Fragment,null,!!(null===(e=null==this?void 0:this.user)||void 0===e?void 0:e.display_name)&&h("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},h("div",null,h("strong",null,__("Display Name","surecart"))),h("div",null,null===(s=this.user)||void 0===s?void 0:s.display_name),h("div",null)),!!(null===(r=null==this?void 0:this.user)||void 0===r?void 0:r.email)&&h("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},h("div",null,h("strong",null,__("Account Email","surecart"))),h("div",null,null===(t=this.user)||void 0===t?void 0:t.email),h("div",null)),!!(null===(i=null==this?void 0:this.user)||void 0===i?void 0:i.first_name)&&h("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},h("div",null,h("strong",null,__("First Name","surecart"))),h("div",null,null===(l=this.user)||void 0===l?void 0:l.first_name),h("div",null)),!!(null===(n=null==this?void 0:this.user)||void 0===n?void 0:n.last_name)&&h("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},h("div",null,h("strong",null,__("Last Name","surecart"))),h("div",null,null===(o=this.user)||void 0===o?void 0:o.last_name),h("div",null))):this.renderEmpty()}renderEmpty(){return h("slot",{name:"empty"},__("User not found.","surecart"))}render(){return h("sc-dashboard-module",{key:"4c133f2802ce2021ae1242caa0c1770029d7ebc8",class:"customer-details"},h("span",{key:"b859fd54e44515e370bfcb0128f855cae28c5573",slot:"heading"},this.heading||__("Account Details","surecart")," "),h("sc-button",{key:"ff569cbca6554e06b9f87dbe91a342f6b8f118aa",type:"link",href:addQueryArgs(window.location.href,{action:"edit",model:"user"}),slot:"end"},h("sc-icon",{key:"079f1aa35d80940718a9f726bb9e4b6df2f81bbb",name:"edit-3",slot:"prefix"}),__("Update","surecart")),h("sc-card",{key:"98057f2e46db8249c8b42fe2c1cd1051d91404e8","no-padding":!0},h("sc-stacked-list",{key:"cb7996b4e2ca3afb7b303f78a6b3a94162d9e5e4"},this.renderContent())))}static get is(){return"sc-wordpress-user"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-wordpress-user.css"]}}static get styleUrls(){return{$:["sc-wordpress-user.css"]}}static get properties(){return{heading:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"heading",reflect:!1},user:{type:"unknown",mutable:!1,complexType:{original:"WordPressUser",resolved:"WordPressUser",references:{WordPressUser:{location:"import",path:"../../../../types",id:"src/types.ts::WordPressUser"}}},required:!1,optional:!1,docs:{tags:[],text:""}}}}}