import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { hash, fn } from '@ember/helper';
import optional from 'ember-composable-helpers/helpers/optional';
import classNames from '../helpers/class-names.js';
import EuiBadge from './eui-badge.js';

const EuiComboBoxPill = setComponentTemplate(precompileTemplate(`
  {{#let
    (classNames
      "euiComboBoxPill" (if @asPlainText "euiComboBoxPill--plainText")
    )
    (optional @onClose)
    as |classes onClose|
  }}
    {{#if @onClose}}
      <EuiBadge
        class={{classes}}
        @closeButtonProps={{hash
          tabIndex=-1
          dataSelectedIconIndex=@dataSelectedIconIndex
        }}
        @color={{@color}}
        @iconOnClick={{fn onClose @option}}
        @iconOnClickAriaLabel={{@iconOnClickAriaLabel}}
        @iconSide="right"
        @iconType="cross"
        ...attributes
      >
        {{yield}}
      </EuiBadge>
    {{else if @asPlainText}}
      <span class={{classes}}>
        {{yield}}
      </span>
    {{else}}
      <EuiBadge
        class={{classes}}
        @color={{@color}}
        @closeButtonProps={{hash dataSelectedIconIndex=@dataSelectedIconIndex}}
        ...attributes
      >
        {{yield}}
      </EuiBadge>
    {{/if}}
  {{/let}}
`, {
  strictMode: true,
  scope: () => ({
    classNames,
    optional,
    EuiBadge,
    hash,
    fn
  })
}), templateOnly("eui-combo-box-pill", "EuiComboBoxPill"));

export { EuiComboBoxPill as default };
//# sourceMappingURL=eui-combo-box-pill.js.map
