import { jsx as i } from "react/jsx-runtime"; import p from "react"; import { o as b } from "./create-component-CVXl33PD.mjs"; import { _ as r, n as l, E as a, c as $, x as n, r as B, a as s, b as h } from "./class-map-CwiboTfb.mjs"; import "./ripple-pQcEjR05.mjs"; import { r as R } from "./animation-DjClVFum.mjs"; import { i as g, u as z } from "./static-DdXEOlS4.mjs"; import { m as M } from "./delegate-BXi1gVeU.mjs"; import { s as L } from "./form-submitter-ChT3Wi0f.mjs"; import { m as T, i as _ } from "./element-internals-3IY9gE4L.mjs"; /** * @license * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ function x(t, o = !0) { return o && getComputedStyle(t).getPropertyValue("direction").trim() === "rtl"; } /** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: Apache-2.0 */ const D = M(T(B)); let e = class extends D { get name() { return this.getAttribute("name") ?? ""; } set name(o) { this.setAttribute("name", o); } /** * The associated form element with which this element's value will submit. */ get form() { return this[_].form; } /** * The labels this element is associated with. */ get labels() { return this[_].labels; } constructor() { super(), this.disabled = !1, this.softDisabled = !1, this.flipIconInRtl = !1, this.href = "", this.target = "", this.ariaLabelSelected = "", this.toggle = !1, this.selected = !1, this.type = "submit", this.value = "", this.flipIcon = x(this, this.flipIconInRtl), this.addEventListener("click", this.handleClick.bind(this)); } willUpdate() { this.href && (this.disabled = !1, this.softDisabled = !1); } render() { const o = this.href ? g`div` : g`button`, { ariaLabel: m, ariaHasPopup: k, ariaExpanded: I } = this, w = m && this.ariaLabelSelected, C = this.toggle ? this.selected : a; let y = a; return this.href || (y = w && this.selected ? this.ariaLabelSelected : m), z`<${o} class="icon-button ${$(this.getRenderClasses())}" id="button" aria-label="${y || a}" aria-haspopup="${!this.href && k || a}" aria-expanded="${!this.href && I || a}" aria-pressed="${C}" aria-disabled=${!this.href && this.softDisabled || a} ?disabled="${!this.href && this.disabled}" @click="${this.handleClickOnChild}"> ${this.renderFocusRing()} ${this.renderRipple()} ${this.selected ? a : this.renderIcon()} ${this.selected ? this.renderSelectedIcon() : a} ${this.renderTouchTarget()} ${this.href && this.renderLink()} `; } renderLink() { const { ariaLabel: o } = this; return n` `; } getRenderClasses() { return { "flip-icon": this.flipIcon, selected: this.toggle && this.selected }; } renderIcon() { return n``; } renderSelectedIcon() { return n``; } renderTouchTarget() { return n``; } renderFocusRing() { return n``; } renderRipple() { const o = !this.href && (this.disabled || this.softDisabled); return n``; } connectedCallback() { this.flipIcon = x(this, this.flipIconInRtl), super.connectedCallback(); } /** Handles a click on this element. */ handleClick(o) { if (!this.href && this.softDisabled) { o.stopImmediatePropagation(), o.preventDefault(); return; } } /** * Handles a click on the child
or