import { proxyCustomElement, HTMLElement, h, Fragment } from '@stencil/core/internal/client';
import { _ as __ } from './default-i18n.js';
import './index2.js';
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}";

const ScWordPressUser = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.__attachShadow();
  }
  renderContent() {
    var _a, _b, _c, _d, _e, _f, _g, _h;
    if (!this.user) {
      return this.renderEmpty();
    }
    return (h(Fragment, null, !!((_a = this === null || this === void 0 ? void 0 : this.user) === null || _a === void 0 ? void 0 : _a.display_name) && (h("sc-stacked-list-row", { style: { '--columns': '3' }, mobileSize: 480 }, h("div", null, h("strong", null, __('Display Name', 'surecart'))), h("div", null, (_b = this.user) === null || _b === void 0 ? void 0 : _b.display_name), h("div", null))), !!((_c = this === null || this === void 0 ? void 0 : this.user) === null || _c === void 0 ? void 0 : _c.email) && (h("sc-stacked-list-row", { style: { '--columns': '3' }, mobileSize: 480 }, h("div", null, h("strong", null, __('Account Email', 'surecart'))), h("div", null, (_d = this.user) === null || _d === void 0 ? void 0 : _d.email), h("div", null))), !!((_e = this === null || this === void 0 ? void 0 : this.user) === null || _e === void 0 ? void 0 : _e.first_name) && (h("sc-stacked-list-row", { style: { '--columns': '3' }, mobileSize: 480 }, h("div", null, h("strong", null, __('First Name', 'surecart'))), h("div", null, (_f = this.user) === null || _f === void 0 ? void 0 : _f.first_name), h("div", null))), !!((_g = this === null || this === void 0 ? void 0 : this.user) === null || _g === void 0 ? void 0 : _g.last_name) && (h("sc-stacked-list-row", { style: { '--columns': '3' }, mobileSize: 480 }, h("div", null, h("strong", null, __('Last Name', 'surecart'))), h("div", null, (_h = this.user) === null || _h === void 0 ? void 0 : _h.last_name), h("div", null)))));
  }
  renderEmpty() {
    return h("slot", { name: "empty" }, __('User not found.', 'surecart'));
  }
  render() {
    return (h("sc-dashboard-module", { class: "customer-details" }, h("span", { slot: "heading" }, this.heading || __('Account Details', 'surecart'), " "), h("sc-button", { type: "link", href: addQueryArgs(window.location.href, {
        action: 'edit',
        model: 'user',
      }), slot: "end" }, h("sc-icon", { name: "edit-3", slot: "prefix" }), __('Update', 'surecart')), h("sc-card", { "no-padding": true }, h("sc-stacked-list", null, this.renderContent()))));
  }
  static get style() { return scWordpressUserCss; }
}, [1, "sc-wordpress-user", {
    "heading": [1],
    "user": [16]
  }]);
function defineCustomElement$1() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["sc-wordpress-user", "sc-alert", "sc-button", "sc-card", "sc-dashboard-module", "sc-icon", "sc-spinner", "sc-stacked-list", "sc-stacked-list-row"];
  components.forEach(tagName => { switch (tagName) {
    case "sc-wordpress-user":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, ScWordPressUser);
      }
      break;
    case "sc-alert":
      if (!customElements.get(tagName)) {
        defineCustomElement$9();
      }
      break;
    case "sc-button":
      if (!customElements.get(tagName)) {
        defineCustomElement$8();
      }
      break;
    case "sc-card":
      if (!customElements.get(tagName)) {
        defineCustomElement$7();
      }
      break;
    case "sc-dashboard-module":
      if (!customElements.get(tagName)) {
        defineCustomElement$6();
      }
      break;
    case "sc-icon":
      if (!customElements.get(tagName)) {
        defineCustomElement$5();
      }
      break;
    case "sc-spinner":
      if (!customElements.get(tagName)) {
        defineCustomElement$4();
      }
      break;
    case "sc-stacked-list":
      if (!customElements.get(tagName)) {
        defineCustomElement$3();
      }
      break;
    case "sc-stacked-list-row":
      if (!customElements.get(tagName)) {
        defineCustomElement$2();
      }
      break;
  } });
}
defineCustomElement$1();

const ScWordpressUser = ScWordPressUser;
const defineCustomElement = defineCustomElement$1;

export { ScWordpressUser, defineCustomElement };
