'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-399a4a13.js');
const utils = require('./utils-311c1b40.js');

const breadcrumbCss = ".ibk-breadcrumb__container{display:inline-flex;align-items:center}.ibk-breadcrumb--separators .ibk-breadcrumb__container{border:solid var(--gray4);border-width:1px 0 1px 0;padding:30px 0}.ibk-breadcrumb__arrow{font-size:8px;color:var(--gray2);padding:3px 7px 0 7px}.ibk-breadcrumb--negative.ibk-breadcrumb--separators .ibk-breadcrumb__container{border-color:rgba(255,255,255,0.25)}.ibk-breadcrumb--negative .ibk-breadcrumb__arrow{color:rgba(255,255,255,0.25)}";

const IbkBreadcrumb = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    /** Se agregarán las flechas entre cada item del breadcrum */
    this.addingArrows = () => {
      const items = this.host.querySelectorAll('ibk-breadcrumb-item');
      const parent = this.host.querySelector('.ibk-breadcrumb__container');
      Array.from(items, (item, index) => {
        if (index > 0) {
          const arrow = document.createElement('i');
          arrow.setAttribute('class', 'ibk-breadcrumb__arrow icon-xs-arrow-right');
          parent.insertBefore(arrow, item);
        }
        if (this.negative) {
          item.setAttribute('negative', '');
        }
      });
    };
  }
  componentDidLoad() {
    this.addingArrows();
  }
  /** Configura la clase del componente basado en estados y modificadores */
  containerClass() {
    return utils.modifiersToClass('ibk-breadcrumb', [
      { separators: this.separators },
      { negative: this.negative }
    ]);
  }
  render() {
    return (index.h("div", { class: this.containerClass() }, index.h("div", { class: "ibk-breadcrumb__container" }, index.h("slot", null))));
  }
  get host() { return index.getElement(this); }
};
IbkBreadcrumb.style = breadcrumbCss;

exports.ibk_breadcrumb = IbkBreadcrumb;
