import {
  __decorateClass,
  __privateAdd,
  __privateGet
} from "../../chunks/chunk.QU3DSPNU.js";
var _GdsMenuButton_instances, isLink_get, defaultRel_get;
import { property } from "lit/decorators.js";
import { classMap } from "lit/directives/class-map.js";
import { ifDefined } from "lit/directives/if-defined.js";
import { literal, html as staticHtml } from "lit/static-html.js";
import { GdsElement } from "../../gds-element.js";
import { gdsCustomElement } from "../../scoping.js";
import { tokens } from "../../tokens.style.js";
import {
  withLayoutChildProps,
  withSizeXProps
} from "../../utils/mixins/declarative-layout-mixins.js";
import MenuButtonStyles from "./menu-button.styles.js";
let GdsMenuButton = class extends withSizeXProps(
  withLayoutChildProps(GdsElement)
) {
  constructor() {
    super();
    __privateAdd(this, _GdsMenuButton_instances);
    this.disabled = false;
    this.label = "";
    this.href = "";
    this.compact = false;
    this.selected = false;
  }
  render() {
    const classes = {
      button: true,
      selected: this.selected,
      compact: this.compact
    };
    const tag = __privateGet(this, _GdsMenuButton_instances, isLink_get) ? literal`a` : literal`button`;
    return staticHtml`
      <${tag}
        class="${classMap(classes)}"
        ?disabled="${this.disabled}"
        aria-label="${this.label}"
        href=${ifDefined(__privateGet(this, _GdsMenuButton_instances, isLink_get) ? this.href : void 0)}
        target=${ifDefined(__privateGet(this, _GdsMenuButton_instances, isLink_get) ? this.target : void 0)}
        rel=${ifDefined(__privateGet(this, _GdsMenuButton_instances, isLink_get) ? this.rel || __privateGet(this, _GdsMenuButton_instances, defaultRel_get) : void 0)}
        download=${ifDefined(__privateGet(this, _GdsMenuButton_instances, isLink_get) ? this.download : void 0)}
      >
        <slot name="lead"></slot>
        <slot part="main-slot"></slot>
        <slot name="trail"></slot>
      </${tag}>
    `;
  }
};
_GdsMenuButton_instances = new WeakSet();
isLink_get = function() {
  return this.href.length > 0;
};
defaultRel_get = function() {
  return this.target === "_blank" ? "noreferrer noopener" : void 0;
};
GdsMenuButton.styles = [tokens, MenuButtonStyles];
GdsMenuButton.shadowRootOptions = {
  mode: "open",
  delegatesFocus: true
};
__decorateClass([
  property({ type: Boolean, reflect: true })
], GdsMenuButton.prototype, "disabled", 2);
__decorateClass([
  property()
], GdsMenuButton.prototype, "label", 2);
__decorateClass([
  property()
], GdsMenuButton.prototype, "href", 2);
__decorateClass([
  property()
], GdsMenuButton.prototype, "target", 2);
__decorateClass([
  property()
], GdsMenuButton.prototype, "rel", 2);
__decorateClass([
  property()
], GdsMenuButton.prototype, "download", 2);
__decorateClass([
  property({ type: Boolean, reflect: true })
], GdsMenuButton.prototype, "compact", 2);
__decorateClass([
  property({ type: Boolean, reflect: true })
], GdsMenuButton.prototype, "selected", 2);
GdsMenuButton = __decorateClass([
  gdsCustomElement("gds-menu-button")
], GdsMenuButton);
export {
  GdsMenuButton
};
