import { LitElement as b, css as I } from "lit";
import { property as u, state as p } from "lit/decorators.js";
const n = {
  xxs: 12,
  xs: 16,
  s: 20,
  m: 24,
  l: 28,
  xl: 32,
  xxl: 40
}, g = Object.keys(n), f = "xs", v = 8, c = 32, x = "currentColor";
function y(t, e, s) {
  const l = parseInt(t, 10), i = l % s === 0;
  return l >= e && i;
}
const z = {
  large: (t) => y(t, c, v),
  regular: (t) => g.includes(t)
};
function C(t) {
  const e = z.large(t);
  return { isValid: e, size: e ? t : c };
}
function m(t) {
  const e = z.regular(t), s = e ? n[t] : n[f];
  return { isValid: e, size: s };
}
const _ = (t, e, s, l) => {
  const i = t.endsWith("Large") || t.endsWith("-large");
  let r, o;
  if (s) {
    if ({ isValid: r, size: o } = i ? C(s) : m(s), !r) {
      const S = i ? `Invalid prop "size" value supplied to "${l}". The prop value should be a number equal or greater than ${c} and multiple of ${v}.` : `Invalid prop "size" value supplied to "${l}". The prop value should be one of the following values: ${g.join(", ")}.`;
      console.error(S);
    }
  } else
    o = i ? c : n[f];
  return {
    class: [t, e].filter(Boolean).join(" "),
    width: o,
    height: o
  };
};
var L = Object.defineProperty, h = (t, e, s, l) => {
  for (var i = void 0, r = t.length - 1, o; r >= 0; r--)
    (o = t[r]) && (i = o(e, s, i) || i);
  return i && L(e, s, i), i;
};
const d = class d extends b {
  constructor() {
    super(...arguments), this.fill = x, this.defaultClasses = "";
  }
  firstUpdated() {
    this.updateIconSize();
  }
  willUpdate(e) {
    e.has("size") && this.updateIconSize();
  }
  updateIconSize() {
    const e = _(this.defaultClasses, "", this.size, this.name);
    this._svgWidth = e.width, this._svgHeight = e.height;
  }
  attributeChangedCallback(e, s, l) {
    if (e === "class" && l !== null) {
      const i = l.trim().split(" ").filter((r) => !this.defaultClasses.split(" ").includes(r));
      this.class = [this.defaultClasses, ...i].join(" ");
    } else
      super.attributeChangedCallback(e, s, l);
  }
};
d.styles = I`
        :host {
            display: inline-block;
            /* Inline SVGs can cause an additional ~4px height in their containers (such as this host).*/
            line-height: 0;
        }

        :host svg {
            /* When the --icon-size-override CSS variable does not exist, the height and width in the HTML attributes will be used. */
            width: var(--icon-size-override);
            height: var(--icon-size-override);
        }
    `;
let a = d;
h([
  u({ type: String, reflect: !0 })
], a.prototype, "size");
h([
  u({ type: String, reflect: !0 })
], a.prototype, "fill");
h([
  p()
], a.prototype, "_svgWidth");
h([
  p()
], a.prototype, "_svgHeight");
export {
  a as PieIconComponent
};
