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 { array } from '@ember/helper';
import { on } from '@ember/modifier';
import optional from 'ember-composable-helpers/helpers/optional';
import style from 'ember-style-modifier/modifiers/style';
import { and, or, not, eq } from 'ember-truth-helpers';
import argOrDefault, { argOrDefaultDecorator } from '../helpers/arg-or-default.js';
import classNames from '../helpers/class-names.js';
import inlineStyles from '../helpers/inline-styles.js';
import useState from '../helpers/use-state.js';
import useIsWithinBreakpoints from '../modifiers/use-is-within-breakpoints.js';
import EuiBreadcrumbs from './eui-breadcrumbs.js';
import EuiFlexGroup from './eui-flex-group.js';
import EuiFlexItem from './eui-flex-item.js';
import EuiIcon from './eui-icon.js';
import EuiSpacer from './eui-spacer.js';
import EuiTab from './eui-tab.js';
import EuiTabs from './eui-tabs.js';
import EuiTextComponent from './eui-text.js';
import EuiTitle from './eui-title.js';

var _dec, _dec2, _dec3, _class, _descriptor, _descriptor2, _descriptor3;
const TEMPLATES = ['default', 'centeredBody', 'centeredContent', 'empty'];
let EuiPageTemplate = setComponentTemplate(precompileTemplate(`
    {{#let
      (argOrDefault @responsive true)
      (argOrDefault @alignItems "top")
      (useState false)
      (and (argOrDefault @hasDescriptionBlock true) (has-block "description"))
      (and
        (argOrDefault @hasRightSideItemsBlock true) (has-block "rightSideItems")
      )
      (or
        (and (argOrDefault @hasPageTitleBlock true) (has-block "pageTitle"))
        @pageTitle
      )
      (and (argOrDefault @hasDefaultBlock true) (has-block "default"))
      as |responsive alignItems isResponsiveBreakpoint hasDescriptionBlock hasRightSideItemsBlock hasPageTitleBlock hasDefaultBlock|
    }}
      <div
        class={{classNames
          "euiPageHeaderContent"
          (if @restrictWidth "euiPanel--restrictWidth-custom" "")
        }}
        {{style (inlineStyles width=@restrictWidth)}}
        {{useIsWithinBreakpoints
          sizes=(array "xs" "s")
          isActive=(not (not responsive))
          setIsWithinBreakpointsValue=isResponsiveBreakpoint.setState
        }}
        ...attributes
      >
        {{#if @breadcrumbs}}
          <EuiBreadcrumbs
            @breadcrumbs={{@breadcrumbs}}
            class={{@breadcrumbProps.className}}
          />
          <EuiSpacer @size="s" />
        {{/if}}
        {{#if (or (eq alignItems "top") isResponsiveBreakpoint.value)}}
          <EuiFlexGroup
            class="euiPageHeaderContent__top"
            @responsive={{not (not responsive)}}
            @alignItems={{if hasPageTitleBlock "flexStart" "baseline"}}
            @gutterSize="l"
          >
            {{#if (and isResponsiveBreakpoint.value (eq responsive "reverse"))}}
              {{#if hasRightSideItemsBlock}}
                <EuiFlexItem @grow={{false}}>
                  <EuiFlexGroup
                    @wrap={{true}}
                    @responsive={{false}}
                    class={{classNames
                      "euiPageHeaderContent__rightSideItems"
                      @rightSideGroupProps.className
                    }}
                  >
                    {{yield
                      (component EuiFlexItem grow=false)
                      to="rightSideItems"
                    }}
                  </EuiFlexGroup>
                </EuiFlexItem>
              {{/if}}
              <EuiFlexItem>
                {{#if (and (not hasPageTitleBlock) @tabs)}}
                  <EuiTabs
                    @size="xl"
                    @display="condensed"
                    @bottomBorder={{false}}
                  >
                    {{#each @tabs as |tab|}}
                      <EuiTab
                        @isSelected={{tab.isSelected}}
                        @href={{tab.href}}
                        {{on "click" (optional tab.onClick)}}
                      >
                        {{tab.label}}
                      </EuiTab>
                    {{/each}}
                  </EuiTabs>
                {{/if}}
                {{#if hasPageTitleBlock}}
                  <EuiTitle
                    class={{@pageTitleProps.className}}
                    @size="l"
                    @tagName="h1"
                  >
                    {{#if @iconType}}
                      <EuiIcon
                        @size="xl"
                        @type={{@iconType}}
                        @iconClasses={{classNames
                          "euiPageHeaderContent__titleIcon"
                          @iconProps.className
                        }}
                      />
                    {{/if}}

                    {{@pageTitle}}
                    {{yield to="pageTitle"}}

                  </EuiTitle>
                {{/if}}

                {{#if hasDescriptionBlock}}
                  {{#if (or hasPageTitleBlock @tabs)}}
                    <EuiSpacer />
                  {{/if}}
                  <EuiText @grow={{false}}>
                    {{@description}}
                    {{yield to="description"}}
                  </EuiText>
                {{/if}}
              </EuiFlexItem>
            {{else}}
              <EuiFlexItem>
                {{#if (and (not hasPageTitleBlock) @tabs)}}
                  <EuiTabs
                    @size="xl"
                    @display="condensed"
                    @bottomBorder={{false}}
                  >
                    {{#each @tabs as |tab|}}
                      <EuiTab
                        @isSelected={{tab.isSelected}}
                        {{on "click" (optional tab.onClick)}}
                      >
                        {{tab.label}}
                      </EuiTab>
                    {{/each}}
                  </EuiTabs>
                {{/if}}
                {{#if hasPageTitleBlock}}
                  <EuiTitle
                    class={{@pageTitleProps.className}}
                    @size="l"
                    @tagName="h1"
                  >
                    {{#if @iconType}}
                      <EuiIcon
                        @size="xl"
                        @type={{@iconType}}
                        @iconClasses={{classNames
                          "euiPageHeaderContent__titleIcon"
                          @iconProps.className
                        }}
                      />
                    {{/if}}

                    {{@pageTitle}}
                    {{yield to="pageTitle"}}
                  </EuiTitle>
                {{/if}}

                {{#if hasDescriptionBlock}}
                  {{#if (or hasPageTitleBlock @tabs)}}
                    <EuiSpacer />
                  {{/if}}
                  <EuiText @grow={{false}}>
                    {{@description}}
                    {{yield to="description"}}
                  </EuiText>
                {{/if}}
              </EuiFlexItem>
              {{#if hasRightSideItemsBlock}}
                <EuiFlexItem @grow={{false}}>
                  <EuiFlexGroup
                    @wrap={{true}}
                    @responsive={{false}}
                    class={{classNames
                      "euiPageHeaderContent__rightSideItems"
                      @rightSideGroupProps.className
                    }}
                  >
                    {{yield
                      (component EuiFlexItem grow=false)
                      to="rightSideItems"
                    }}
                  </EuiFlexGroup>
                </EuiFlexItem>
              {{/if}}
            {{/if}}
          </EuiFlexGroup>
          {{#if (or hasDefaultBlock (and hasPageTitleBlock @tabs))}}
            <div class="euiPageHeaderContent__bottom">
              <EuiSpacer />
              {{yield to="default"}}
              {{#if hasPageTitleBlock}}
                <EuiTabs @size="l" @display="condensed" @bottomBorder={{false}}>
                  {{#each @tabs as |tab|}}
                    <EuiTab
                      @isSelected={{tab.isSelected}}
                      {{on "click" (optional tab.onClick)}}
                    >
                      {{tab.label}}
                    </EuiTab>
                  {{/each}}
                </EuiTabs>
              {{/if}}
            </div>
          {{/if}}
        {{else}}
          <EuiFlexGroup
            class="euiPageHeaderContent__top"
            @responsive={{not (not responsive)}}
            {{!@glint-expect-error}}
            @alignItems={{if (eq alignItems "bottom") "flexEnd" alignItems}}
            @gutterSize="l"
          >
            <EuiFlexItem>
              {{#if (and (not hasPageTitleBlock) @tabs)}}
                <EuiTabs
                  @size="xl"
                  @display="condensed"
                  @bottomBorder={{false}}
                >
                  {{#each @tabs as |tab|}}
                    <EuiTab
                      @isSelected={{tab.isSelected}}
                      @href={{tab.href}}
                      {{on "click" (optional tab.onClick)}}
                    >
                      {{tab.label}}
                    </EuiTab>
                  {{/each}}
                </EuiTabs>
              {{/if}}
              {{#if hasPageTitleBlock}}
                <EuiTitle
                  class={{@pageTitleProps.className}}
                  @size="l"
                  @tagName="h1"
                >
                  {{#if @iconType}}
                    <EuiIcon
                      @size="xl"
                      @type={{@iconType}}
                      @iconClasses={{classNames
                        "euiPageHeaderContent__titleIcon"
                        @iconProps.className
                      }}
                    />
                  {{/if}}

                  {{@pageTitle}}
                  {{yield to="pageTitle"}}
                </EuiTitle>
              {{/if}}

              {{#if hasDescriptionBlock}}
                {{#if (or hasPageTitleBlock @tabs)}}
                  <EuiSpacer />
                {{/if}}
                <EuiText @grow={{false}}>
                  {{@description}}
                  {{yield to="description"}}
                </EuiText>
              {{/if}}
              {{#if (or hasDefaultBlock (and hasPageTitleBlock @tabs))}}
                <div class="euiPageHeaderContent__bottom">
                  <EuiSpacer />
                  {{yield to="default"}}
                  {{#if hasPageTitleBlock}}
                    <EuiTabs
                      @size="l"
                      @display="condensed"
                      @bottomBorder={{false}}
                    >
                      {{#each @tabs as |tab|}}
                        <EuiTab
                          @isSelected={{tab.isSelected}}
                          {{on "click" (optional tab.onClick)}}
                        >
                          {{tab.label}}
                        </EuiTab>
                      {{/each}}
                    </EuiTabs>
                  {{/if}}
                </div>
              {{/if}}
            </EuiFlexItem>
            {{#if hasRightSideItemsBlock}}
              <EuiFlexItem @grow={{false}}>
                <EuiFlexGroup
                  @wrap={{true}}
                  @responsive={{false}}
                  class={{classNames
                    "euiPageHeaderContent__rightSideItems"
                    @rightSideGroupProps.className
                  }}
                >
                  {{yield
                    (component EuiFlexItem grow=false)
                    to="rightSideItems"
                  }}
                </EuiFlexGroup>
              </EuiFlexItem>
            {{/if}}
          </EuiFlexGroup>
        {{/if}}
      </div>
    {{/let}}
  `, {
  strictMode: true,
  scope: () => ({
    argOrDefault,
    useState,
    and,
    or,
    classNames,
    style,
    inlineStyles,
    useIsWithinBreakpoints,
    array,
    not,
    EuiBreadcrumbs,
    EuiSpacer,
    eq,
    EuiFlexGroup,
    EuiFlexItem,
    EuiTabs,
    EuiTab,
    on,
    optional,
    EuiTitle,
    EuiIcon,
    EuiText: EuiTextComponent
  })
}), (_dec = argOrDefaultDecorator(460), _dec2 = argOrDefaultDecorator(false), _dec3 = argOrDefaultDecorator('default'), (_class = class EuiPageTemplate extends Component {
  constructor(...args) {
    super(...args);
    // Defaults
    _initializerDefineProperty(this, "minHeight", _descriptor, this);
    _initializerDefineProperty(this, "fullHeight", _descriptor2, this);
    _initializerDefineProperty(this, "template", _descriptor3, this);
  }
  get classes() {
    return 'euiPageTemplate '.concat(this.fullHeightClass);
  }
  get fullHeightClass() {
    return this.fullHeight && this.canFullHeight ? 'eui-fullHeight eui-yScroll' : '';
  }
  get canFullHeight() {
    return this.template === 'default' || this.template === 'empty';
  }
}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "minHeight", [_dec], {
  configurable: true,
  enumerable: true,
  writable: true,
  initializer: null
}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "fullHeight", [_dec2], {
  configurable: true,
  enumerable: true,
  writable: true,
  initializer: null
}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, "template", [_dec3], {
  configurable: true,
  enumerable: true,
  writable: true,
  initializer: null
})), _class)));

export { TEMPLATES, EuiPageTemplate as default };
//# sourceMappingURL=eui-page-header-content.js.map
