import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { on } from '@ember/modifier';
import { or } from 'ember-truth-helpers';
import EuiButtonIcon from '../eui-button-icon.js';
import EuiCopyComponent from '../eui-copy.js';

const EuiCodeBlockControls = setComponentTemplate(precompileTemplate(`
    {{#if (or @showCopyButton @showFullScreenButton)}}
      <div class="euiCodeBlock__controls">
        {{#if @showFullScreenButton}}
          <EuiButtonIcon
            class="euiCodeBlock__fullScreenButton"
            @iconType={{if @isFullScreen "fullScreenExit" "fullScreen"}}
            @color="text"
            aria-label={{if @isFullScreen "Collapse" "Expand"}}
            {{on "click" @toggleFullScreen}}
          />
        {{/if}}

        {{#if @showCopyButton}}
          <div class="euiCodeBlock__copyButton">
            <EuiCopy
              @textToCopy={{@textToCopy}}
              @afterMessage="Copied"
              as |copy|
            >
              <EuiButtonIcon
                {{on "click" copy}}
                @iconType="copyClipboard"
                @color="text"
                aria-label="Copy"
              />
            </EuiCopy>
          </div>
        {{/if}}
      </div>
    {{/if}}
  `, {
  strictMode: true,
  scope: () => ({
    or,
    EuiButtonIcon,
    on,
    EuiCopy: EuiCopyComponent
  })
}), templateOnly("controls", "EuiCodeBlockControls"));

export { EuiCodeBlockControls as default };
//# sourceMappingURL=controls.js.map
