import { parse as j, icon as F } from "../../../../@fortawesome_fontawesome-svg-core@6.7.2/node_modules/@fortawesome/fontawesome-svg-core/index.mjs";
import n from "../../../../prop-types@15.8.1/node_modules/prop-types/index.mjs";
import C from "react";
function N(e, t) {
  var r = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var a = Object.getOwnPropertySymbols(e);
    t && (a = a.filter(function(o) {
      return Object.getOwnPropertyDescriptor(e, o).enumerable;
    })), r.push.apply(r, a);
  }
  return r;
}
function f(e) {
  for (var t = 1; t < arguments.length; t++) {
    var r = arguments[t] != null ? arguments[t] : {};
    t % 2 ? N(Object(r), !0).forEach(function(a) {
      b(e, a, r[a]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : N(Object(r)).forEach(function(a) {
      Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
    });
  }
  return e;
}
function h(e) {
  "@babel/helpers - typeof";
  return h = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, h(e);
}
function b(e, t, r) {
  return t in e ? Object.defineProperty(e, t, {
    value: r,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[t] = r, e;
}
function L(e, t) {
  if (e == null)
    return {};
  var r = {}, a = Object.keys(e), o, i;
  for (i = 0; i < a.length; i++)
    o = a[i], !(t.indexOf(o) >= 0) && (r[o] = e[o]);
  return r;
}
function U(e, t) {
  if (e == null)
    return {};
  var r = L(e, t), a, o;
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    for (o = 0; o < i.length; o++)
      a = i[o], !(t.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(e, a) && (r[a] = e[a]);
  }
  return r;
}
function _(e) {
  return $(e) || K(e) || H(e) || M();
}
function $(e) {
  if (Array.isArray(e))
    return k(e);
}
function K(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null)
    return Array.from(e);
}
function H(e, t) {
  if (e) {
    if (typeof e == "string")
      return k(e, t);
    var r = Object.prototype.toString.call(e).slice(8, -1);
    if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set")
      return Array.from(e);
    if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))
      return k(e, t);
  }
}
function k(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var r = 0, a = new Array(t); r < t; r++)
    a[r] = e[r];
  return a;
}
function M() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function V(e) {
  var t, r = e.beat, a = e.fade, o = e.beatFade, i = e.bounce, y = e.shake, m = e.flash, s = e.spin, l = e.spinPulse, u = e.spinReverse, g = e.pulse, x = e.fixedWidth, w = e.inverse, d = e.border, P = e.listItem, c = e.flip, p = e.size, v = e.rotation, I = e.pull, S = (t = {
    "fa-beat": r,
    "fa-fade": a,
    "fa-beat-fade": o,
    "fa-bounce": i,
    "fa-shake": y,
    "fa-flash": m,
    "fa-spin": s,
    "fa-spin-reverse": u,
    "fa-spin-pulse": l,
    "fa-pulse": g,
    "fa-fw": x,
    "fa-inverse": w,
    "fa-border": d,
    "fa-li": P,
    "fa-flip": c === !0,
    "fa-flip-horizontal": c === "horizontal" || c === "both",
    "fa-flip-vertical": c === "vertical" || c === "both"
  }, b(t, "fa-".concat(p), typeof p < "u" && p !== null), b(t, "fa-rotate-".concat(v), typeof v < "u" && v !== null && v !== 0), b(t, "fa-pull-".concat(I), typeof I < "u" && I !== null), b(t, "fa-swap-opacity", e.swapOpacity), t);
  return Object.keys(S).map(function(O) {
    return S[O] ? O : null;
  }).filter(function(O) {
    return O;
  });
}
function q(e) {
  return e = e - 0, e === e;
}
function W(e) {
  return q(e) ? e : (e = e.replace(/[\-_\s]+(.)?/g, function(t, r) {
    return r ? r.toUpperCase() : "";
  }), e.substr(0, 1).toLowerCase() + e.substr(1));
}
var B = ["style"];
function G(e) {
  return e.charAt(0).toUpperCase() + e.slice(1);
}
function J(e) {
  return e.split(";").map(function(t) {
    return t.trim();
  }).filter(function(t) {
    return t;
  }).reduce(function(t, r) {
    var a = r.indexOf(":"), o = W(r.slice(0, a)), i = r.slice(a + 1).trim();
    return o.startsWith("webkit") ? t[G(o)] = i : t[o] = i, t;
  }, {});
}
function E(e, t) {
  var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  if (typeof t == "string")
    return t;
  var a = (t.children || []).map(function(s) {
    return E(e, s);
  }), o = Object.keys(t.attributes || {}).reduce(function(s, l) {
    var u = t.attributes[l];
    switch (l) {
      case "class":
        s.attrs.className = u, delete t.attributes.class;
        break;
      case "style":
        s.attrs.style = J(u);
        break;
      default:
        l.indexOf("aria-") === 0 || l.indexOf("data-") === 0 ? s.attrs[l.toLowerCase()] = u : s.attrs[W(l)] = u;
    }
    return s;
  }, {
    attrs: {}
  }), i = r.style, y = i === void 0 ? {} : i, m = U(r, B);
  return o.attrs.style = f(f({}, o.attrs.style), y), e.apply(void 0, [t.tag, f(f({}, o.attrs), m)].concat(_(a)));
}
var R = !1;
try {
  R = process.env.NODE_ENV === "production";
} catch {
}
function Q() {
  if (!R && console && typeof console.error == "function") {
    var e;
    (e = console).error.apply(e, arguments);
  }
}
function T(e) {
  if (e && h(e) === "object" && e.prefix && e.iconName && e.icon)
    return e;
  if (j.icon)
    return j.icon(e);
  if (e === null)
    return null;
  if (e && h(e) === "object" && e.prefix && e.iconName)
    return e;
  if (Array.isArray(e) && e.length === 2)
    return {
      prefix: e[0],
      iconName: e[1]
    };
  if (typeof e == "string")
    return {
      prefix: "fas",
      iconName: e
    };
}
function A(e, t) {
  return Array.isArray(t) && t.length > 0 || !Array.isArray(t) && t ? b({}, e, t) : {};
}
var z = {
  border: !1,
  className: "",
  mask: null,
  maskId: null,
  fixedWidth: !1,
  inverse: !1,
  flip: !1,
  icon: null,
  listItem: !1,
  pull: null,
  pulse: !1,
  rotation: null,
  size: null,
  spin: !1,
  spinPulse: !1,
  spinReverse: !1,
  beat: !1,
  fade: !1,
  beatFade: !1,
  bounce: !1,
  shake: !1,
  symbol: !1,
  title: "",
  titleId: null,
  transform: null,
  swapOpacity: !1
}, D = /* @__PURE__ */ C.forwardRef(function(e, t) {
  var r = f(f({}, z), e), a = r.icon, o = r.mask, i = r.symbol, y = r.className, m = r.title, s = r.titleId, l = r.maskId, u = T(a), g = A("classes", [].concat(_(V(r)), _((y || "").split(" ")))), x = A("transform", typeof r.transform == "string" ? j.transform(r.transform) : r.transform), w = A("mask", T(o)), d = F(u, f(f(f(f({}, g), x), w), {}, {
    symbol: i,
    title: m,
    titleId: s,
    maskId: l
  }));
  if (!d)
    return Q("Could not find icon", u), null;
  var P = d.abstract, c = {
    ref: t
  };
  return Object.keys(r).forEach(function(p) {
    z.hasOwnProperty(p) || (c[p] = r[p]);
  }), X(P[0], c);
});
D.displayName = "FontAwesomeIcon";
D.propTypes = {
  beat: n.bool,
  border: n.bool,
  beatFade: n.bool,
  bounce: n.bool,
  className: n.string,
  fade: n.bool,
  flash: n.bool,
  mask: n.oneOfType([n.object, n.array, n.string]),
  maskId: n.string,
  fixedWidth: n.bool,
  inverse: n.bool,
  flip: n.oneOf([!0, !1, "horizontal", "vertical", "both"]),
  icon: n.oneOfType([n.object, n.array, n.string]),
  listItem: n.bool,
  pull: n.oneOf(["right", "left"]),
  pulse: n.bool,
  rotation: n.oneOf([0, 90, 180, 270]),
  shake: n.bool,
  size: n.oneOf(["2xs", "xs", "sm", "lg", "xl", "2xl", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x"]),
  spin: n.bool,
  spinPulse: n.bool,
  spinReverse: n.bool,
  symbol: n.oneOfType([n.bool, n.string]),
  title: n.string,
  titleId: n.string,
  transform: n.oneOfType([n.string, n.object]),
  swapOpacity: n.bool
};
var X = E.bind(null, C.createElement);
export {
  D as FontAwesomeIcon
};
//# sourceMappingURL=index.es.mjs.map
