import "proxy-polyfill";
import tokens from "@gympass/yoga-tokens";
import theme from "../../theme";
const skeleton = theme(tokens);
const CACHE_PLACEHOLDER = null;
const withoutKey = (fn, key) => !{}.hasOwnProperty.call(fn, key) || key === "prototype";
const createFakeObj = (paths, object) => {
  const fn = (props) => paths.reduce((acc, path) => acc[path], props);
  Object.keys(object).forEach((key) => {
    fn[key] = CACHE_PLACEHOLDER;
  });
  return new Proxy(fn, {
    get(target, key) {
      if (withoutKey(fn, key))
        return target[key];
      if (fn[key])
        return fn[key];
      fn[key] = createFakeObj([...paths, key], object[key]);
      return fn[key];
    }
  });
};
var themeReader_default = createFakeObj(["theme", "yoga"], skeleton);
export {
  themeReader_default as default
};
