import { isFocusable as e } from "../internal/utils/focus.js";
import { generateId as t } from "../internal/utils/dom.js";
import { keyNavigationList as n } from "../internal/controllers/keynav-list.controller.js";
import { attachInternals as r } from "../internal/utils/a11y.js";
import { typeSSR as i } from "../internal/controllers/type-ssr.controller.js";
import { scopedRegistry as a } from "../internal/decorators/scoped-registry.js";
import { useStyles as o } from "../internal/styles/index.js";
import { __decorate as s } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
import { Icon as c } from "../icon/icon2.js";
import l from "./breadcrumb.js";
import { LitElement as u, html as d, nothing as f } from "lit";
import { state as p } from "lit/decorators/state.js";
//#region src/breadcrumb/breadcrumb.ts
var m = class extends u {
	constructor(...e) {
		super(...e), this.breadcrumbItems = [];
	}
	get keynavListConfig() {
		return { items: Array.from(this.shadowRoot.querySelectorAll("slot")).flatMap((e) => e.assignedElements()).filter((t) => e(t)) };
	}
	static {
		this.styles = o([l]);
	}
	static {
		this.metadata = {
			tag: "nve-breadcrumb",
			version: "2.0.2"
		};
	}
	static {
		this.elementDefinitions = { [c.metadata.tag]: c };
	}
	render() {
		return d`<ol internal-host>${this.breadcrumbItems.map((e, t) => d`<li><slot name="${e.slot}" @slotchange="${this.#e}"></slot>${t < this.breadcrumbItems.length - 1 ? d`<nve-icon part="icon" separator aria-hidden="true" name="chevron" direction="right" size="sm"></nve-icon>` : f}</li>`)}</ol><slot ?hidden-slot="${!this.breadcrumbItems.length}" @slotchange="${this.#t}"></slot>`;
	}
	connectedCallback() {
		super.connectedCallback(), r(this), this._internals.role = "navigation";
	}
	#e(e) {
		e.target.assignedElements().length || this.#n();
	}
	#t(e) {
		if (e.target && e.target.assignedElements().length) {
			this.#n();
			let e = this.shadowRoot.querySelector("slot:not([name])").assignedElements();
			e.filter((e) => e.matches("nve-button, nve-icon-button, span, a")).forEach((e) => e.slot = t()), e.filter((e) => e.matches("nve-button, nve-icon-button")).forEach((e) => e.container = "inline"), this.breadcrumbItems = e.length ? e : this.breadcrumbItems;
		}
	}
	#n() {
		Array.from(this.shadowRoot.querySelectorAll("slot")).flatMap((e) => e.assignedElements()).forEach((e) => e.slot = "");
	}
};
s([p()], m.prototype, "breadcrumbItems", void 0), m = s([
	i(),
	a(),
	n()
], m);
//#endregion
export { m as Breadcrumb };

//# sourceMappingURL=breadcrumb2.js.map