import c from "./index-extends.js";
import T from "./index-objectWithoutPropertiesLoose.js";
import M from "./index-deepmerge.js";
const _ = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
function v(i) {
  return Math.round(i * 1e5) / 1e5;
}
const p = {
  textTransform: "uppercase"
}, d = '"Roboto", "Helvetica", "Arial", sans-serif';
function A(i, n) {
  const h = typeof n == "function" ? n(i) : n, {
    fontFamily: r = d,
    // The default font size of the Material Specification.
    fontSize: f = 14,
    // px
    fontWeightLight: a = 300,
    fontWeightRegular: t = 400,
    fontWeightMedium: o = 500,
    fontWeightBold: g = 700,
    // Tell MUI what's the font-size on the html element.
    // 16px is the default font-size used by browsers.
    htmlFontSize: l = 16,
    // Apply the CSS properties to all the variants.
    allVariants: b,
    pxToRem: S
  } = h, W = T(h, _);
  process.env.NODE_ENV;
  const x = f / 14, m = S || ((s) => `${s / l * x}rem`), e = (s, u, y, z, R) => c({
    fontFamily: r,
    fontWeight: s,
    fontSize: m(u),
    // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
    lineHeight: y
  }, r === d ? {
    letterSpacing: `${v(z / u)}em`
  } : {}, R, b), F = {
    h1: e(a, 96, 1.167, -1.5),
    h2: e(a, 60, 1.2, -0.5),
    h3: e(t, 48, 1.167, 0),
    h4: e(t, 34, 1.235, 0.25),
    h5: e(t, 24, 1.334, 0),
    h6: e(o, 20, 1.6, 0.15),
    subtitle1: e(t, 16, 1.75, 0.15),
    subtitle2: e(o, 14, 1.57, 0.1),
    body1: e(t, 16, 1.5, 0.15),
    body2: e(t, 14, 1.43, 0.15),
    button: e(o, 14, 1.75, 0.4, p),
    caption: e(t, 12, 1.66, 0.4),
    overline: e(t, 12, 2.66, 1, p),
    // TODO v6: Remove handling of 'inherit' variant from the theme as it is already handled in Material UI's Typography component. Also, remember to remove the associated types.
    inherit: {
      fontFamily: "inherit",
      fontWeight: "inherit",
      fontSize: "inherit",
      lineHeight: "inherit",
      letterSpacing: "inherit"
    }
  };
  return M(c({
    htmlFontSize: l,
    pxToRem: m,
    fontFamily: r,
    fontSize: f,
    fontWeightLight: a,
    fontWeightRegular: t,
    fontWeightMedium: o,
    fontWeightBold: g
  }, F), W, {
    clone: !1
    // No need to clone deep
  });
}
export {
  A as default
};
