import { audit as e } from "../internal/controllers/audit.controller.js";
import { appendRootNodeStyle 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 { useStyles as i } from "../internal/styles/index.js";
import { __decorate as a } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
import o from "./button-group.js";
import s from "./button-group.global.js";
import { LitElement as c, html as l } from "lit";
import { property as u } from "lit/decorators/property.js";
import { queryAssignedElements as d } from "lit/decorators/query-assigned-elements.js";
//#region src/button-group/button-group.ts
var f = class extends c {
	constructor(...e) {
		super(...e), this.orientation = "horizontal", this.#t = (e) => this.#r(e.target);
	}
	get keynavListConfig() {
		return {
			items: this.#e,
			layout: this.orientation
		};
	}
	static {
		this.styles = i([o]);
	}
	static {
		this.metadata = {
			tag: "nve-button-group",
			version: "2.0.2",
			children: [
				"nve-button",
				"nve-icon-button",
				"nve-divider"
			]
		};
	}
	get #e() {
		return [...this.iconButtons, ...this.buttons];
	}
	render() {
		return l`<div internal-host><slot @slotchange="${this.#n}"></slot></div>`;
	}
	connectedCallback() {
		super.connectedCallback(), r(this), t(this, s), this._internals.role = "group", this.addEventListener("click", this.#t);
	}
	disconnectedCallback() {
		super.disconnectedCallback(), this.removeEventListener("click", this.#t);
	}
	#t;
	updated(e) {
		super.updated(e), this.#n();
	}
	#n() {
		this.container === "flat" && this.#e.forEach((e) => e.container = "flat"), this.interaction && this.#e.forEach((e) => e.interaction = this.interaction), this.dividers.length ? this._internals.states.add("split") : this._internals.states.delete("split");
	}
	#r(e) {
		e.matches?.("nve-button, nve-icon-button") && (this.behaviorSelect === "single" ? (this.#e.forEach((e) => e.pressed = !1), e.pressed = !0) : this.behaviorSelect === "multi" && (e.pressed = !e.pressed));
	}
};
a([u({
	type: String,
	attribute: "behavior-select"
})], f.prototype, "behaviorSelect", void 0), a([u({
	type: String,
	reflect: !0
})], f.prototype, "container", void 0), a([u({
	type: String,
	reflect: !0
})], f.prototype, "orientation", void 0), a([u({
	type: String,
	reflect: !0
})], f.prototype, "interaction", void 0), a([u({
	type: String,
	reflect: !0
})], f.prototype, "size", void 0), a([d({ selector: "nve-divider" })], f.prototype, "dividers", void 0), a([d({ selector: "nve-icon-button" })], f.prototype, "iconButtons", void 0), a([d({ selector: "nve-button" })], f.prototype, "buttons", void 0), f = a([e(), n()], f);
//#endregion
export { f as ButtonGroup };

//# sourceMappingURL=button-group2.js.map