import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
import { d as defineCustomElement$4 } from './ecl-button2.js';
import { d as defineCustomElement$3 } from './ecl-icon2.js';
import { d as defineCustomElement$2 } from './ecl-link2.js';

const EclBreadcrumbItem$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.theme = 'ec';
    this.styleClass = undefined;
    this.variant = undefined;
    this.path = undefined;
    this.currentPage = false;
    this.ellipsis = false;
    this.buttonAriaLabel = '';
  }
  getClass() {
    const styleClasses = [
      `ecl-breadcrumb__segment`,
      `sc-ecl-breadcrumb-${this.theme}`,
      this.styleClass
    ];
    if (this.ellipsis) {
      styleClasses.push('ecl-breadcrumb__segment--ellipsis');
    }
    if (this.currentPage) {
      styleClasses.push('ecl-breadcrumb__current-page');
    }
    return styleClasses.join(' ');
  }
  getLinkClass() {
    const linkClasses = [
      `sc-ecl-breadcrumb-${this.theme}`,
      'ecl-breadcrumb__link',
      'ecl-link--no-visited',
    ];
    if (this.el.closest('.ecl-breadcrumb--negative')) {
      linkClasses.push('ecl-link--negative');
    }
    return linkClasses.join(' ');
  }
  getLiAttrs() {
    const attrs = { 'data-ecl-breadcrumb-item': 'static' };
    if (this.ellipsis) {
      attrs['data-ecl-breadcrumb-ellipsis'] = 'data-ecl-breadcrumb-ellipsis';
    }
    return attrs;
  }
  render() {
    return (h("li", Object.assign({ class: this.getClass() }, this.getLiAttrs()), !this.currentPage && !this.ellipsis ?
      h("ecl-link", { variant: "standalone", path: this.path, "style-class": this.getLinkClass() }, h("ecl-icon", { slot: "icon-after", "style-class": `ecl-breadcrumb__icon sc-ecl-breadcrumb-${this.theme}`, icon: "corner-arrow", transform: "rotate-90", size: "2xs" }), h("slot", null)) :
      h("slot", null), this.ellipsis ?
      h("ecl-button", { "style-class": `ecl-breadcrumb__ellipsis sc-ecl-breadcrumb-${this.theme}`, variant: "ghost", "data-ecl-breadcrumb-ellipsis-button": true, "aria-label": this.buttonAriaLabel }, "...", h("ecl-icon", { "style-class": `ecl-breadcrumb__icon sc-ecl-breadcrumb-${this.theme}`, size: "2xs", transform: "rotate-90", icon: "corner-arrow", slot: "icon-after" })) : '', this.currentPage ?
      h("slot", null) : ''));
  }
  get el() { return this; }
}, [4, "ecl-breadcrumb-item", {
    "theme": [1],
    "styleClass": [1, "style-class"],
    "variant": [1],
    "path": [1],
    "currentPage": [4, "current-page"],
    "ellipsis": [4],
    "buttonAriaLabel": [1, "button-aria-label"]
  }]);
function defineCustomElement$1() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["ecl-breadcrumb-item", "ecl-button", "ecl-icon", "ecl-link"];
  components.forEach(tagName => { switch (tagName) {
    case "ecl-breadcrumb-item":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, EclBreadcrumbItem$1);
      }
      break;
    case "ecl-button":
      if (!customElements.get(tagName)) {
        defineCustomElement$4();
      }
      break;
    case "ecl-icon":
      if (!customElements.get(tagName)) {
        defineCustomElement$3();
      }
      break;
    case "ecl-link":
      if (!customElements.get(tagName)) {
        defineCustomElement$2();
      }
      break;
  } });
}

const EclBreadcrumbItem = EclBreadcrumbItem$1;
const defineCustomElement = defineCustomElement$1;

export { EclBreadcrumbItem, defineCustomElement };

//# sourceMappingURL=ecl-breadcrumb-item.js.map