import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { or, eq, and } from 'ember-truth-helpers';
import argOrDefault from '../helpers/arg-or-default.js';
import classNames from '../helpers/class-names.js';

const EuiProgress = setComponentTemplate(precompileTemplate(`
  {{#if @max}}
    {{#if (or (has-block "label") (has-block "valueText") @valueText)}}
      <div
        class={{classNames
          (if (eq @size "l") "euiProgress__data--l")
          componentName="EuiProgressData"
          color=(argOrDefault @color "success")
        }}
      >
        {{#if (has-block "label")}}
          <span class="euiProgress__label">
            {{yield to="label"}}
          </span>
        {{/if}}
        {{#if (or (has-block "valueText") @valueText)}}
          <span class="euiProgress__valueText {{@labelClasses}}">
            {{#if (eq @valueText true)}}
              {{@value}}
            {{else}}
              {{yield to="valueText"}}
            {{/if}}
          </span>
        {{/if}}
      </div>
    {{/if}}
    <progress
      class={{classNames
        "euiProgress--native"
        componentName="EuiProgress"
        size=(argOrDefault @size "m")
        position=(argOrDefault @position "static")
        color=(argOrDefault @color "success")
      }}
      max={{@max}}
      value={{@value}}
      aria-hidden={{and
        (has-block "label")
        (or @valueText (has-block "valueText"))
      }}
      ...attributes
    ></progress>
  {{else}}
    <div
      class={{classNames
        "euiProgress--indeterminate"
        componentName="EuiProgress"
        size=(argOrDefault @size "m")
        position=(argOrDefault @position "static")
        color=(argOrDefault @color "success")
      }}
      ...attributes
    ></div>
  {{/if}}
`, {
  strictMode: true,
  scope: () => ({
    or,
    classNames,
    eq,
    argOrDefault,
    and
  })
}), templateOnly("eui-progress", "EuiProgress"));

export { EuiProgress as default };
//# sourceMappingURL=eui-progress.js.map
