import { html } from 'lit';
import { property } from 'lit/decorators.js';
import FlowRdfElement from '../../internal/flow-ui-rdf-element.mjs';
import styles from './busy-overlay.styles.mjs';
import { boolean } from '../../internal/boolean.mjs';

var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result)
    __defProp(target, key, result);
  return result;
};
class FlowUiBusyOverlay extends FlowRdfElement {
  constructor() {
    super(...arguments);
    this.busy = false;
    this.variant = "neutral";
    this.size = "medium";
    this.overlayParent = false;
  }
  connectedCallback() {
    super.connectedCallback();
    this.busy = boolean(this.busy, true);
    this.overlayParent = boolean(this.overlayParent, true);
  }
  render() {
    return html`
      <slot></slot>
      <div class="busy-overlay">
        <slot name="busy-animation">
          <flow-ui-progress-ring variant=${this.variant} indeterminate></flow-ui-progress-ring>
        </slot>
      </div>
    `;
  }
}
FlowUiBusyOverlay.styles = styles;
__decorateClass([
  property({ reflect: true, type: Boolean })
], FlowUiBusyOverlay.prototype, "busy", 2);
__decorateClass([
  property({ reflect: true })
], FlowUiBusyOverlay.prototype, "variant", 2);
__decorateClass([
  property({ reflect: true })
], FlowUiBusyOverlay.prototype, "size", 2);
__decorateClass([
  property({ type: Boolean, reflect: true, attribute: "overlay-parent" })
], FlowUiBusyOverlay.prototype, "overlayParent", 2);

export { FlowUiBusyOverlay as default };
