JezK
Edit File: sc-wordpress-user.js
import{proxyCustomElement,HTMLElement,h,Fragment}from"@stencil/core/internal/client";import{d as defineCustomElement$9}from"./sc-alert2.js";import{d as defineCustomElement$8}from"./sc-button2.js";import{d as defineCustomElement$7}from"./sc-card2.js";import{d as defineCustomElement$6}from"./sc-dashboard-module2.js";import{d as defineCustomElement$5}from"./sc-icon2.js";import{d as defineCustomElement$4}from"./sc-spinner2.js";import{d as defineCustomElement$3}from"./sc-stacked-list2.js";import{d as defineCustomElement$2}from"./sc-stacked-list-row2.js";import{a as addQueryArgs}from"./add-query-args.js";const scWordpressUserCss=":host{display:block;position:relative}.customer-details{display:grid;gap:0.75em}",ScWordpressUserStyle0=scWordpressUserCss,ScWordPressUser=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.heading=void 0,this.user=void 0}renderContent(){var e,s,t,n,r,o,i,l;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,wp.i18n.__("Display Name","surecart"))),h("div",null,null===(s=this.user)||void 0===s?void 0:s.display_name),h("div",null)),!!(null===(t=null==this?void 0:this.user)||void 0===t?void 0:t.email)&&h("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},h("div",null,h("strong",null,wp.i18n.__("Account Email","surecart"))),h("div",null,null===(n=this.user)||void 0===n?void 0:n.email),h("div",null)),!!(null===(r=null==this?void 0:this.user)||void 0===r?void 0:r.first_name)&&h("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},h("div",null,h("strong",null,wp.i18n.__("First Name","surecart"))),h("div",null,null===(o=this.user)||void 0===o?void 0:o.first_name),h("div",null)),!!(null===(i=null==this?void 0:this.user)||void 0===i?void 0:i.last_name)&&h("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},h("div",null,h("strong",null,wp.i18n.__("Last Name","surecart"))),h("div",null,null===(l=this.user)||void 0===l?void 0:l.last_name),h("div",null))):this.renderEmpty()}renderEmpty(){return h("slot",{name:"empty"},wp.i18n.__("User not found.","surecart"))}render(){return h("sc-dashboard-module",{key:"aea6f8e5db352af05091cba07679d6ffb8060260",class:"customer-details"},h("span",{key:"c0a0f61a728654fce708399c5e59529d7a15ed7d",slot:"heading"},this.heading||wp.i18n.__("Account Details","surecart")," "),h("sc-button",{key:"92f8524191f0412e70327ce98d30689fdc196956",type:"link",href:addQueryArgs(window.location.href,{action:"edit",model:"user"}),slot:"end"},h("sc-icon",{key:"0f62e51c584f62b2b0d067b73f4cdef33ee31219",name:"edit-3",slot:"prefix"}),wp.i18n.__("Update","surecart")),h("sc-card",{key:"63834ded40385085314b8965b844b3f8a894cd3e","no-padding":!0},h("sc-stacked-list",{key:"076ceb2365fc070cef6af35626f741181f07ef82"},this.renderContent())))}static get style(){return ScWordpressUserStyle0}},[1,"sc-wordpress-user",{heading:[1],user:[16]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["sc-wordpress-user","sc-alert","sc-button","sc-card","sc-dashboard-module","sc-icon","sc-spinner","sc-stacked-list","sc-stacked-list-row"].forEach((e=>{switch(e){case"sc-wordpress-user":customElements.get(e)||customElements.define(e,ScWordPressUser);break;case"sc-alert":customElements.get(e)||defineCustomElement$9();break;case"sc-button":customElements.get(e)||defineCustomElement$8();break;case"sc-card":customElements.get(e)||defineCustomElement$7();break;case"sc-dashboard-module":customElements.get(e)||defineCustomElement$6();break;case"sc-icon":customElements.get(e)||defineCustomElement$5();break;case"sc-spinner":customElements.get(e)||defineCustomElement$4();break;case"sc-stacked-list":customElements.get(e)||defineCustomElement$3();break;case"sc-stacked-list-row":customElements.get(e)||defineCustomElement$2()}}))}const ScWordpressUser=ScWordPressUser,defineCustomElement=defineCustomElement$1;export{ScWordpressUser,defineCustomElement};