import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { concat } from '@ember/helper';
import objectAt from 'ember-composable-helpers/helpers/object-at';
import without from 'ember-composable-helpers/helpers/without';
import randomId from '../-private/random-id.js';
import EuiAccordionAccordionComponent from './eui-accordion.js';
import EuiTextComponent from './eui-text.js';

const EuiNotificationEventMessages = setComponentTemplate(precompileTemplate(`
    <div class="euiNotificationEventMessages" ...attributes>
      {{#let
        (objectAt 0 @messages) (without (objectAt 0 @messages) @messages)
        as |first rest|
      }}

        {{#if first}}
          <EuiText @size="s" @color="subdued">
            <p>{{first}}</p>
          </EuiText>
        {{/if}}

        {{#if rest}}

          <EuiAccordion
            id={{concat "euiNotificationEventMessagesAccordion" (randomId)}}
            class="euiNotificationEventMessages__accordion"
            @buttonClassName="euiNotificationEventMessages__accordionButton"
            @arrowDisplay="none"
          >
            <:buttonContent as |isOpen|>
              {{@accordionButtonText}}
              {{#unless isOpen}}
                ({{@accordionHideText}})
              {{/unless}}
            </:buttonContent>

            <:content>
              <div class="euiNotificationEventMessages__accordionContent">
                {{#each rest as |msg|}}
                  <EuiText @size="s" @color="subdued">
                    <p>{{msg}}</p>
                  </EuiText>
                {{/each}}
              </div>
            </:content>

          </EuiAccordion>
        {{/if}}

      {{/let}}
    </div>
  `, {
  strictMode: true,
  scope: () => ({
    objectAt,
    without,
    EuiText: EuiTextComponent,
    EuiAccordion: EuiAccordionAccordionComponent,
    concat,
    randomId
  })
}), templateOnly("eui-notification-event-messages", "EuiNotificationEventMessages"));

export { EuiNotificationEventMessages as default };
//# sourceMappingURL=eui-notification-event-messages.js.map
