import { I18nController as e } from "../internal/controllers/i18n.controller.js";
import { scopedRegistry as t } from "../internal/decorators/scoped-registry.js";
import { useStyles as n } from "../internal/styles/index.js";
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
import { Icon as i } from "../icon/icon2.js";
import a from "./sort-button.js";
import { LitElement as o, html as s } from "lit";
import { property as c } from "lit/decorators/property.js";
import { ButtonFormControlMixin as l } from "@nvidia-elements/forms/mixins";
//#region src/sort-button/sort-button.ts
var u = {
	none: "ascending",
	ascending: "descending",
	descending: "none"
}, d = class extends l(o) {
	static {
		this.styles = n([a]);
	}
	static {
		this.metadata = {
			tag: "nve-sort-button",
			version: "0.2.3"
		};
	}
	static {
		this.elementDefinitions = { [i.metadata.tag]: i };
	}
	#e;
	render() {
		return s`<div internal-host focus-within><nve-icon part="icon" .name="${this.sort === "descending" ? "sort-descending" : "sort-ascending"}" aria-hidden="true"></nve-icon></div>`;
	}
	constructor() {
		super(), this.sort = "none", this.#e = new e(this), this.i18n = this.#e.i18n, this.#t = () => {
			this._internals.ariaLabel = `${this.#e.i18n.sort} ${u[this.sort]}`, this.dispatchEvent(new CustomEvent("sort", {
				detail: {
					value: this.sort,
					next: u[this.sort]
				},
				bubbles: !0,
				composed: !0
			}));
		}, this.type = "button";
	}
	connectedCallback() {
		super.connectedCallback(), this._internals.role = "spinbutton", this.addEventListener("click", this.#t);
	}
	disconnectedCallback() {
		super.disconnectedCallback(), this.removeEventListener("click", this.#t);
	}
	#t;
};
r([c({
	type: String,
	reflect: !0
})], d.prototype, "sort", void 0), r([c({ type: Object })], d.prototype, "i18n", void 0), d = r([t()], d);
//#endregion
export { d as SortButton };

//# sourceMappingURL=sort-button2.js.map