import { __exports as y } from "./index-createStyled3.js";
import { __require as ne } from "./index-interopRequireDefault.js";
import { __require as ie } from "./index-extends2.js";
import { __require as se } from "./index-objectWithoutPropertiesLoose2.js";
import ue from "./index-_virtual78.js";
import ae from "./index-_virtual79.js";
import le from "./index-_virtual80.js";
import fe from "./index-_virtual81.js";
import de from "./index-_virtual82.js";
import ce from "./index-_virtual83.js";
var W;
function $e() {
  if (W) return y;
  W = 1;
  var _ = ne();
  Object.defineProperty(y, "__esModule", {
    value: !0
  }), y.default = X, y.shouldForwardProp = w, y.systemDefaultTheme = void 0;
  var f = _(ie()), x = _(se()), D = H(ue), M = ae, V = _(le), g = _(fe), L = _(de), I = _(ce);
  const z = ["ownerState"], B = ["variants"], G = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
  function N(e) {
    if (typeof WeakMap != "function") return null;
    var o = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
    return (N = function(n) {
      return n ? t : o;
    })(e);
  }
  function H(e, o) {
    if (e && e.__esModule) return e;
    if (e === null || typeof e != "object" && typeof e != "function") return { default: e };
    var t = N(o);
    if (t && t.has(e)) return t.get(e);
    var n = { __proto__: null }, d = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for (var u in e) if (u !== "default" && Object.prototype.hasOwnProperty.call(e, u)) {
      var i = d ? Object.getOwnPropertyDescriptor(e, u) : null;
      i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
    }
    return n.default = e, t && t.set(e, n), n;
  }
  function J(e) {
    return Object.keys(e).length === 0;
  }
  function K(e) {
    return typeof e == "string" && // 96 is one less than the char code
    // for "a" so this is checking that
    // it's a lowercase character
    e.charCodeAt(0) > 96;
  }
  function w(e) {
    return e !== "ownerState" && e !== "theme" && e !== "sx" && e !== "as";
  }
  const Q = y.systemDefaultTheme = (0, L.default)(), k = (e) => e && e.charAt(0).toLowerCase() + e.slice(1);
  function O({
    defaultTheme: e,
    theme: o,
    themeId: t
  }) {
    return J(o) ? e : o[t] || o;
  }
  function U(e) {
    return e ? (o, t) => t[e] : null;
  }
  function q(e, o) {
    let {
      ownerState: t
    } = o, n = (0, x.default)(o, z);
    const d = typeof e == "function" ? e((0, f.default)({
      ownerState: t
    }, n)) : e;
    if (Array.isArray(d))
      return d.flatMap((u) => q(u, (0, f.default)({
        ownerState: t
      }, n)));
    if (d && typeof d == "object" && Array.isArray(d.variants)) {
      const {
        variants: u = []
      } = d;
      let m = (0, x.default)(d, B);
      return u.forEach((r) => {
        let a = !0;
        typeof r.props == "function" ? a = r.props((0, f.default)({
          ownerState: t
        }, n, t)) : Object.keys(r.props).forEach((h) => {
          (t == null ? void 0 : t[h]) !== r.props[h] && n[h] !== r.props[h] && (a = !1);
        }), a && (Array.isArray(m) || (m = [m]), m.push(typeof r.style == "function" ? r.style((0, f.default)({
          ownerState: t
        }, n, t)) : r.style));
      }), m;
    }
    return d;
  }
  function X(e = {}) {
    const {
      themeId: o,
      defaultTheme: t = Q,
      rootShouldForwardProp: n = w,
      slotShouldForwardProp: d = w
    } = e, u = (i) => (0, I.default)((0, f.default)({}, i, {
      theme: O((0, f.default)({}, i, {
        defaultTheme: t,
        themeId: o
      }))
    }));
    return u.__mui_systemSx = !0, (i, m = {}) => {
      (0, D.internal_processStyles)(i, (l) => l.filter((p) => !(p != null && p.__mui_systemSx)));
      const {
        name: r,
        slot: a,
        skipVariantsResolver: h,
        skipSx: Y,
        // TODO v6: remove `lowercaseFirstLetter()` in the next major release
        // For more details: https://github.com/mui/material-ui/pull/37908
        overridesResolver: C = U(k(a))
      } = m, Z = (0, x.default)(m, G), ee = h !== void 0 ? h : (
        // TODO v6: remove `Root` in the next major release
        // For more details: https://github.com/mui/material-ui/pull/37908
        a && a !== "Root" && a !== "root" || !1
      ), te = Y || !1;
      let E;
      process.env.NODE_ENV !== "production" && r && (E = `${r}-${k(a || "Root")}`);
      let $ = w;
      a === "Root" || a === "root" ? $ = n : a ? $ = d : K(i) && ($ = void 0);
      const P = (0, D.default)(i, (0, f.default)({
        shouldForwardProp: $,
        label: E
      }, Z)), F = (l) => typeof l == "function" && l.__emotion_real !== l || (0, M.isPlainObject)(l) ? (p) => q(l, (0, f.default)({}, p, {
        theme: O({
          theme: p.theme,
          defaultTheme: t,
          themeId: o
        })
      })) : l, A = (l, ...p) => {
        let j = F(l);
        const v = p ? p.map(F) : [];
        r && C && v.push((s) => {
          const c = O((0, f.default)({}, s, {
            defaultTheme: t,
            themeId: o
          }));
          if (!c.components || !c.components[r] || !c.components[r].styleOverrides)
            return null;
          const S = c.components[r].styleOverrides, R = {};
          return Object.entries(S).forEach(([re, oe]) => {
            R[re] = q(oe, (0, f.default)({}, s, {
              theme: c
            }));
          }), C(s, R);
        }), r && !ee && v.push((s) => {
          var c;
          const S = O((0, f.default)({}, s, {
            defaultTheme: t,
            themeId: o
          })), R = S == null || (c = S.components) == null || (c = c[r]) == null ? void 0 : c.variants;
          return q({
            variants: R
          }, (0, f.default)({}, s, {
            theme: S
          }));
        }), te || v.push(u);
        const T = v.length - p.length;
        if (Array.isArray(l) && T > 0) {
          const s = new Array(T).fill("");
          j = [...l, ...s], j.raw = [...l.raw, ...s];
        }
        const b = P(j, ...v);
        if (process.env.NODE_ENV !== "production") {
          let s;
          r && (s = `${r}${(0, V.default)(a || "")}`), s === void 0 && (s = `Styled(${(0, g.default)(i)})`), b.displayName = s;
        }
        return i.muiName && (b.muiName = i.muiName), b;
      };
      return P.withConfig && (A.withConfig = P.withConfig), A;
    };
  }
  return y;
}
export {
  $e as __require
};
