import { _ as _applyDecoratedDescriptor, a as _initializerDefineProperty } from '../_rollupPluginBabelHelpers-9wjJaosZ.js';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { on } from '@ember/modifier';
import set from 'ember-set-helper/helpers/set';
import argOrDefault from '../helpers/arg-or-default.js';
import classNames from '../helpers/class-names.js';
import EuiButtonEmpty from './eui-button-empty.js';
import EuiHideForComponent from './eui-hide-for.js';
import EuiIcon from './eui-icon.js';
import EuiPopoverComponent from './eui-popover.js';
import EuiShowForComponent from './eui-show-for.js';

var _class, _descriptor;
let EuiHeaderLinksComponent = setComponentTemplate(precompileTemplate(`
    <nav class="euiHeaderLinks">
      <EuiHideFor @sizes={{this.popoverBreakpoints}}>
        <div
          class={{classNames
            "euiHeaderLinks__list"
            componentName="EuiHeaderLinks"
            gutterSize=(argOrDefault @gutterSize "xs")
          }}
        >
          {{yield}}
        </div>
      </EuiHideFor>

      {{#if this.hasMobileVersion}}
        <EuiShowFor @sizes={{this.popoverBreakpoints}}>
          <EuiPopover
            @isOpen={{this.pop1}}
            @anchorPosition="downRight"
            @panelPaddingSize={{argOrDefault @panelPaddingSize "none"}}
            @closePopover={{set this "pop1" false}}
          >
            <:button>
              <EuiButtonEmpty
                @color="text"
                {{on "click" (set this "pop1" true)}}
              >
                <EuiIcon @type="apps" />
              </EuiButtonEmpty>
            </:button>
            <:content>
              <div
                class={{classNames
                  "euiHeaderLinks__mobileList"
                  componentName="EuiHeaderLinks"
                  mobileGutterSize=(argOrDefault @gutterSize "xs")
                }}
              >
                {{yield}}
              </div>
            </:content>
          </EuiPopover>
        </EuiShowFor>
      {{/if}}
    </nav>
  `, {
  strictMode: true,
  scope: () => ({
    EuiHideFor: EuiHideForComponent,
    classNames,
    argOrDefault,
    EuiShowFor: EuiShowForComponent,
    EuiPopover: EuiPopoverComponent,
    set,
    EuiButtonEmpty,
    on,
    EuiIcon
  })
}), (_class = class EuiHeaderLinksComponent extends Component {
  constructor(...args) {
    super(...args);
    _initializerDefineProperty(this, "pop1", _descriptor, this);
  }
  get popoverBreakpoints() {
    return this.args.popoverBreakpoints || ['xs', 's'];
  }
  get hasMobileVersion() {
    return this.popoverBreakpoints?.length > 0;
  }
}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "pop1", [tracked], {
  configurable: true,
  enumerable: true,
  writable: true,
  initializer: function () {
    return false;
  }
})), _class));

export { EuiHeaderLinksComponent as default };
//# sourceMappingURL=eui-header-links.js.map
