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

const EuiPanel = setComponentTemplate(precompileTemplate(`
  {{#let
    (argOrDefault @hasShadow true)
    (argOrDefault @color "plain")
    (argOrDefault @grow true)
    as |hasShadow color grow|
  }}
    {{#let
      (eq color "plain") (or (eq color "plain") (eq color "transparent"))
      as |canHaveShadow canHaveBorder|
    }}
      {{#if @onClick}}
        <div
          role="button"
          class={{classNames
            (if (argOrDefault @isClickable true) "euiPanel--isClickable")
            (if (and canHaveShadow (eq hasShadow true)) "euiPanel--hasShadow")
            (if
              (and (not canHaveShadow) (eq hasShadow false))
              "euiPanel--noShadow"
            )
            (if (and canHaveBorder (eq @hasBorder true)) "euiPanel--hasBorder")
            (if
              (and (not canHaveBorder) (eq @hasBorder false))
              "euiPanel--noBorder"
            )
            (unless grow "euiPanel--flexGrowZero")
            componentName="EuiPanel"
            paddingSize=(argOrDefault @paddingSize "m")
            borderRadius=(argOrDefault @borderRadius "m")
            color=color
          }}
          {{on "click" @onClick}}
          ...attributes
        >
          {{yield}}
        </div>
      {{else}}
        <div
          class={{classNames
            (if (and canHaveShadow (eq hasShadow true)) "euiPanel--hasShadow")
            (if
              (and (not canHaveShadow) (eq hasShadow false))
              "euiPanel--noShadow"
            )
            (if (and canHaveBorder (eq @hasBorder true)) "euiPanel--hasBorder")
            (if
              (and (not canHaveBorder) (eq @hasBorder false))
              "euiPanel--noBorder"
            )
            (unless grow "euiPanel--flexGrowZero")
            componentName="EuiPanel"
            paddingSize=(argOrDefault @paddingSize "m")
            borderRadius=(argOrDefault @borderRadius "m")
            color=color
          }}
          ...attributes
        >
          {{yield}}
        </div>
      {{/if}}
    {{/let}}
  {{/let}}
`, {
  strictMode: true,
  scope: () => ({
    argOrDefault,
    eq,
    or,
    classNames,
    and,
    not,
    on
  })
}), templateOnly("eui-panel", "EuiPanel"));

export { EuiPanel as default };
//# sourceMappingURL=eui-panel.js.map
