import { U as h } from "./ui-image-b7b48fe5-Cf9Vq5pI.js";
import { r as o, h as t, H as i } from "./index-97d17652-WK_DbPS4.js";
const n = ":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, inherit)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}", s = n, a = class {
  constructor(e) {
    o(this, e), this.structure = void 0, this.width = void 0, this.height = void 0, this.borderRadius = void 0, this.marginBottom = void 0, this.marginTop = void 0, this.marginLeft = void 0, this.marginRight = void 0, this.animation = !0, this.rows = void 0, this.size = void 0, this.color = void 0, this.primaryColor = void 0, this.secondaryColor = void 0;
  }
  handleStructureChange(e, r) {
    r !== e && this.handleStructure(e);
  }
  handleStructure(e) {
    switch (e) {
      case "logo":
        return this.renderLogo();
      case "image":
        return this.renderImage();
      case "title":
        return this.renderTitle();
      case "text":
        return this.renderText();
      case "rectangle":
        return this.renderRectangle();
      case "circle":
        return this.renderCircle();
      default:
        return null;
    }
  }
  renderLogo() {
    return t("div", { class: "SkeletonContainer" }, t("div", { class: "Logo " + (this.animation ? "Skeleton" : "") }));
  }
  renderImage() {
    return t("div", { class: "Image " + (this.animation ? "Skeleton" : "") });
  }
  renderTitle() {
    return t("div", { class: "SkeletonContainer" }, t("div", { class: "Title " + (this.animation ? "Skeleton" : "") }));
  }
  renderText() {
    return t("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((e, r) => t("div", { key: r, class: "Text " + (this.animation ? "Skeleton" : "") })));
  }
  renderRectangle() {
    return t("div", { class: "SkeletonContainer" }, t("div", { class: "Rectangle " + (this.animation ? "Skeleton" : "") }));
  }
  renderCircle() {
    return t("div", { class: "SkeletonContainer" }, t("div", { class: "Circle " + (this.animation ? "Skeleton" : "") }));
  }
  render() {
    let e = "";
    switch (this.structure) {
      case "logo":
        e = `
          :host {
            --emw-skeleton-logo-width: ${this.width};
            --emw-skeleton-logo-height: ${this.height};
            --emw-skeleton-logo-border-radius: ${this.borderRadius}px;
            --emw-skeleton-logo-margin-bottom: ${this.marginBottom}px;
            --emw-skeleton-logo-margin-top: ${this.marginTop}px;
            --emw-skeleton-logo-margin-left: ${this.marginLeft}px;
            --emw-skeleton-logo-margin-right: ${this.marginRight}px;
            --emw-skeleton-logo-background: ${this.color};
            --emw-skeleton-primary-color: ${this.primaryColor};
            --emw-skeleton-secondary-color: ${this.secondaryColor};
          }
        `;
        break;
      case "image":
        e = `
          :host {
            --emw-skeleton-image-width: ${this.width};
            --emw-skeleton-image-height: ${this.height};
            --emw-skeleton-image-border-radius: ${this.borderRadius}px;
            --emw-skeleton-image-margin-bottom: ${this.marginBottom}px;
            --emw-skeleton-image-margin-top: ${this.marginTop}px;
            --emw-skeleton-image-margin-left: ${this.marginLeft}px;
            --emw-skeleton-image-margin-right: ${this.marginRight}px;
            --emw-skeleton-image-background: ${this.color};
            --emw-skeleton-primary-color: ${this.primaryColor};
            --emw-skeleton-secondary-color: ${this.secondaryColor};
          }
        `;
        break;
      case "title":
        e = `
          :host {
            --emw-skeleton-title-width: ${this.width};
            --emw-skeleton-title-height: ${this.height};
            --emw-skeleton-title-border-radius: ${this.borderRadius}px;
            --emw-skeleton-title-margin-bottom: ${this.marginBottom}px;
            --emw-skeleton-title-margin-top: ${this.marginTop}px;
            --emw-skeleton-title-margin-left: ${this.marginLeft}px;
            --emw-skeleton-title-margin-right: ${this.marginRight}px;
            --emw-skeleton-title-background: ${this.color};
            --emw-skeleton-primary-color: ${this.primaryColor};
            --emw-skeleton-secondary-color: ${this.secondaryColor};
          }
        `;
        break;
      case "text":
        e = `
          :host {
            --emw-skeleton-text-width: ${this.width};
            --emw-skeleton-text-height: ${this.height};
            --emw-skeleton-text-border-radius: ${this.borderRadius}px;
            --emw-skeleton-text-margin-bottom: ${this.marginBottom}px;
            --emw-skeleton-text-margin-top: ${this.marginTop}px;
            --emw-skeleton-text-margin-left: ${this.marginLeft}px;
            --emw-skeleton-text-margin-right: ${this.marginRight}px;
            --emw-skeleton-text-background: ${this.color};
            --emw-skeleton-primary-color: ${this.primaryColor};
            --emw-skeleton-secondary-color: ${this.secondaryColor};
          }
        `;
        break;
      case "rectangle":
        e = `
          :host {
            --emw-skeleton-rectangle-width: ${this.width};
            --emw-skeleton-rectangle-height: ${this.height};
            --emw-skeleton-rectangle-border-radius: ${this.borderRadius}px;
            --emw-skeleton-rectangle-margin-bottom: ${this.marginBottom}px;
            --emw-skeleton-rectangle-margin-top: ${this.marginTop}px;
            --emw-skeleton-rectangle-margin-left: ${this.marginLeft}px;
            --emw-skeleton-rectangle-margin-right: ${this.marginRight}px;
            --emw-skeleton-rectangle-background: ${this.color};
            --emw-skeleton-primary-color: ${this.primaryColor};
            --emw-skeleton-secondary-color: ${this.secondaryColor};
          }
        `;
        break;
      case "circle":
        e = `
          :host {
            --emw-skeleton-circle-size: ${this.size};
            --emw-skeleton-circle-background: ${this.color};
            --emw-skeleton-primary-color: ${this.primaryColor};
            --emw-skeleton-secondary-color: ${this.secondaryColor};
          }
        `;
        break;
      default:
        e = "";
    }
    return t(i, { key: "3bb792a149db7fe732d5cbfa092cdb4d6ca0689e" }, t("style", { key: "a4607599b60659f385ae2660513e38b383739674" }, e), this.handleStructure(this.structure));
  }
  static get watchers() {
    return {
      structure: ["handleStructureChange"]
    };
  }
};
a.style = s;
export {
  h as ui_image,
  a as ui_skeleton
};
