import { r as c, s as m, u, y as h, e as p, g as i } from "./base-408a2cb0.js";
import { t as b } from "./state-fcb7c7f1.js";
import "./property-ca27685b.js";
const v = `.sil-menu-toggle{width:3em;height:3em;background:transparent;position:relative;border:none}.sil-menu-toggle__bar{height:2px;width:1.5em;background-color:var(--foreground);position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);transition:transform .3s}.sil-menu-toggle__bar:nth-child(1){transform:translate(-50%,calc(-50% - 6px))}.sil-menu-toggle__bar:nth-child(2){transform:translate(-50%,-50%) scale(1)}.sil-menu-toggle__bar:nth-child(3){transform:translate(-50%,calc(-50% + 6px))}.sil-menu-toggle--active .sil-menu-toggle__bar:nth-child(1){transform:translate(-50%,-50%) rotate(45deg)}.sil-menu-toggle--active .sil-menu-toggle__bar:nth-child(2){transform:translate(-50%,-50%) scaleX(0)}.sil-menu-toggle--active .sil-menu-toggle__bar:nth-child(3){transform:translate(-50%,-50%) rotate(-45deg)}
`;
var _ = Object.defineProperty, f = Object.getOwnPropertyDescriptor, g = (s, t, n, a) => {
  for (var e = a > 1 ? void 0 : a ? f(t, n) : t, l = s.length - 1, o; l >= 0; l--)
    (o = s[l]) && (e = (a ? o(t, n, e) : o(e)) || e);
  return a && e && _(t, n, e), e;
};
let r = class extends m {
  constructor() {
    super(...arguments), this.active = !1;
  }
  toggle() {
    this.active = !this.active;
    const s = new CustomEvent("menu", {
      bubbles: !0,
      detail: { active: this.active }
    });
    this.dispatchEvent(s), this.setAttribute("active", `${this.active}`);
  }
  render() {
    const { classes: s, bemm: t } = u(i("menuToggle"), {
      return: "string"
    });
    return h`
      <button
        class="${s({}, this.active ? { m: "active" } : null)}"
        @click="${this.toggle}"
        aria-label="Toggle menu"
      >
        <span class="${t("bar")}"></span>
        <span class="${t("bar")}"></span>
        <span class="${t("bar")}"></span>
      </button>
    `;
  }
};
r.styles = c(v);
g([
  b()
], r.prototype, "active", 2);
r = g([
  p(i("menuToggle"))
], r);
export {
  r as MenuToggle
};
