import { e as m } from "./custom-element-eaccb8d2.mjs";
import { P as u, n as p } from "./plus-base-1920dd44.mjs";
import { i as d } from "./query-48157d42.mjs";
import { n as c } from "./static-be5c3b1c.mjs";
import { s as f } from "./index-975d3293.mjs";
const h = f({
  slots: {
    host: "breadcrumb flex flex-row items-center justify-start font-sans"
  },
  variants: {
    size: {
      sm: {
        host: "gap-1.5"
      },
      md: {
        host: "gap-2"
      },
      lg: {
        host: "gap-2.5"
      }
    }
  },
  compoundVariants: [],
  defaultVariants: {
    size: "md",
    active: !1,
    disabled: !1,
    readonly: !1
  }
});
var b = Object.defineProperty, g = Object.getOwnPropertyDescriptor, i = (t, e, a, s) => {
  for (var r = s > 1 ? void 0 : s ? g(e, a) : e, l = t.length - 1, n; l >= 0; l--)
    (n = t[l]) && (r = (s ? n(e, a, r) : n(r)) || r);
  return s && r && b(e, a, r), r;
};
let o = class extends u {
  constructor() {
    super(...arguments), this.size = "md", this.separator = "/";
  }
  get slotItems() {
    var t;
    return [...(t = this.defaultSlot) == null ? void 0 : t.assignedElements({ flatten: !0 })].filter((e) => e.tagName.toLowerCase() === "plus-breadcrumb-item");
  }
  handleChanges() {
    var t;
    (t = this.slotItems) == null || t.forEach((e, a) => {
      e.setAttribute("size", this.size), e.setAttribute("separator", this.separator);
    });
  }
  updated(t) {
    super.updated(t), this.handleChanges();
  }
  handleClickItem({ target: t }) {
    var e;
    if (t instanceof HTMLElement && t.tagName.toLowerCase() === "plus-breadcrumb-item") {
      const { id: a } = t;
      (e = this.slotItems) == null || e.forEach((s, r) => {
        s.id === a ? s.setAttribute("active", "true") : s.setAttribute("active", "false");
      });
    }
  }
  render() {
    const { size: t } = this, { host: e } = h({ size: t });
    return c`
      <nav class=${e()} aria-label="Breadcrumb">
        <slot @slotchange=${() => this.handleChanges()} @click=${this.handleClickItem}></slot>
      </nav>
    `;
  }
};
i([
  d("slot")
], o.prototype, "defaultSlot", 2);
i([
  p({ type: String })
], o.prototype, "size", 2);
i([
  p({ type: String })
], o.prototype, "separator", 2);
o = i([
  m("plus-breadcrumb")
], o);
export {
  o as BreadCrumbComponent
};
