"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var theme_exports = {};
__export(theme_exports, {
  default: () => theme_default
});
module.exports = __toCommonJS(theme_exports);
var import_yoga_common = require("@gympass/yoga-common");
var import_componentThemes = __toESM(require("./componentThemes"));
const getComponentThemes = (theme2) => {
  const { colors, baseFont, baseFontSize } = theme2;
  const components = Object.entries(import_componentThemes.default).reduce(
    (componentsStyles, [names, themed]) => {
      const name = names.toLowerCase();
      return __spreadProps(__spreadValues({}, componentsStyles), {
        [name]: themed(__spreadProps(__spreadValues({}, theme2), {
          colors,
          baseFont,
          baseFontSize
        }))
      });
    },
    {}
  );
  return { components };
};
const theme = (tokens) => {
  const baseFont = tokens.fonts.rubik;
  const baseFontSize = tokens.fontSizes.medium;
  const colors = __spreadProps(__spreadValues({}, tokens.colors), {
    primary: tokens.colors.vibin,
    secondary: tokens.colors.stamina,
    feedback: {
      success: Object.assign([tokens.colors.success, tokens.colors.hope], {
        light: tokens.colors.success,
        dark: tokens.colors.hope
      }),
      informative: Object.assign([tokens.colors.neutral, tokens.colors.relax], {
        light: tokens.colors.neutral,
        dark: tokens.colors.relax
      }),
      attention: Object.assign([tokens.colors.attention, tokens.colors.verve], {
        light: tokens.colors.attention,
        dark: tokens.colors.verve
      }),
      neutral: Object.assign([tokens.colors.light, tokens.colors.medium], {
        light: tokens.colors.light,
        dark: tokens.colors.medium
      })
    },
    text: {
      primary: tokens.colors.stamina,
      secondary: tokens.colors.deep,
      disabled: tokens.colors.steady
    },
    elements: {
      selectionAndIcons: tokens.colors.medium,
      lineAndBorders: tokens.colors.light,
      backgroundAndDisabled: tokens.colors.clear
    }
  });
  return __spreadProps(__spreadValues({}, tokens), {
    colors,
    baseFont,
    baseFontSize,
    v3theme: false
  });
};
const composeTheme = (tokens, customTheming = {}) => {
  const baseTheme = theme(tokens);
  const customTheme = (0, import_yoga_common.merge)(baseTheme, customTheming);
  const componentTheming = getComponentThemes(customTheme);
  return (0, import_yoga_common.merge)(componentTheming, customTheme);
};
var theme_default = composeTheme;
