"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const lodashEs = require("lodash-es");
function mergeSxValues(values, theme, helpers) {
  const css = values.reduce((ret, partial) => {
    if (!partial) {
      return ret;
    }
    if (Array.isArray(partial)) {
      return mergeSxValues(partial, theme, helpers);
    }
    return lodashEs.merge(ret, typeof partial === "function" ? partial(theme, helpers) : partial);
  }, {});
  return css;
}
function mergeSxList(sxList) {
  return (theme, helpers) => mergeSxValues(sxList, theme, helpers);
}
function mergeStylesList(stylesList) {
  return (theme, props, helpers) => {
    const css = stylesList.reduce(
      (prev, partial) => typeof partial === "function" ? lodashEs.merge(prev, partial(theme, props, helpers)) : lodashEs.merge(prev, partial),
      {}
    );
    return css;
  };
}
exports.mergeStylesList = mergeStylesList;
exports.mergeSxList = mergeSxList;
