import flattenColorPaletteImport from 'tailwindcss/lib/util/flattenColorPalette';
import tailwindColors from 'tailwindcss/colors';
import { useMediaQuery } from 'react-responsive';
import { getByPath as getByPath$1 } from '@clickbar/dot-diver';
import { isNumber, isNaN, omit, get, clamp, truncate, mapValues, transform, map, mergeWith, pick, upperFirst } from 'lodash-es';
import { useState, useLayoutEffect } from 'react';
import { exhaustive } from 'exhaustive';
import { paramCase, capitalCase, camelCase, dotCase, headerCase, noCase, pathCase, constantCase, sentenceCase, snakeCase, pascalCase } from 'change-case';
import { extendTailwindMerge, twMerge as twMerge$1 } from 'tailwind-merge';
import { createClassed } from '@tw-classed/react';
export { deriveClassed, makeStrict } from '@tw-classed/react';
import { createClassed as createClassed$1 } from '@tw-classed/core';
import clsx2, { clsx } from 'clsx';
import createVariatGroupTransfomer from 'tailwind-group-variant';

var __defProp = Object.defineProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};

// src/config/index.ts
var config_exports = {};
__export(config_exports, {
  appStateColorSchemeNames: () => appStateColorSchemeNames,
  colorPalette: () => colorPalette,
  colorSchemeNames: () => colorSchemeNames,
  dataAttributes: () => dataAttributes,
  getDataAttributes: () => getDataAttributes,
  mainColorSchemeNames: () => mainColorSchemeNames,
  paletteColorsConfig: () => paletteColorsConfig,
  screens: () => screens,
  testClassName: () => testClassName
});

// src/config/colors/helpers/generateColorGroup.ts
function generateColorGroup(colorGroup) {
  return (props) => {
    const resolvedColorEntries = Object.entries(props).map(([k, v]) => {
      const val = colorGroup[v];
      return [k, val];
    });
    return {
      ...Object.fromEntries(resolvedColorEntries),
      ...colorGroup
    };
  };
}

// src/config/colors/variousColors.ts
var variousColors = {
  "various-blue": generateColorGroup(tailwindColors.blue)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-emerald": generateColorGroup(tailwindColors.emerald)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-orange": generateColorGroup(tailwindColors.orange)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-fuchsia": generateColorGroup(tailwindColors.fuchsia)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-yellow": generateColorGroup(tailwindColors.yellow)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-rose": generateColorGroup(tailwindColors.rose)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-cyan": generateColorGroup(tailwindColors.cyan)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-violet": generateColorGroup(tailwindColors.violet)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-teal": generateColorGroup(tailwindColors.teal)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-pink": generateColorGroup(tailwindColors.pink)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-lime": generateColorGroup(tailwindColors.lime)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-gray": generateColorGroup(tailwindColors.gray)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-neutral": generateColorGroup(tailwindColors.neutral)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-stone": generateColorGroup(tailwindColors.stone)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-zinc": generateColorGroup(tailwindColors.zinc)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  "various-slate": generateColorGroup(tailwindColors.slate)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  })
};

// src/config/colors/colors.constants.ts
var colorScaleKeys = [
  "50",
  "100",
  "200",
  "300",
  "400",
  "500",
  "600",
  "700",
  "800",
  "900"
];
var hexAlphaCodes = {
  "100": "FF",
  "95": "F2",
  "90": "E6",
  "85": "D9",
  "80": "CC",
  "75": "BF",
  "70": "B3",
  "65": "A6",
  "60": "99",
  "55": "8C",
  "50": "80",
  "45": "73",
  "40": "66",
  "35": "59",
  "30": "4D",
  "25": "40",
  "23": "3B",
  "20": "33",
  "15": "26",
  "12": "1F",
  "10": "1A",
  "9": "17",
  "8": "14",
  "7": "12",
  "6": "0F",
  "5": "0D",
  "4": "0A",
  "3": "08",
  "2": "05",
  "1": "03",
  "0": "00"
};
var hexTransparencyPresetMap = {
  tint: "5",
  ghost: "20",
  subtle: "30",
  weak: "50",
  moderate: "70",
  high: "90",
  strong: "95",
  intense: "100"
};

// src/config/colors/helpers/arrayToColorGroup.ts
function arrayToColorGroup(colorArr) {
  const entries = colorArr.map(
    (color, index) => [colorScaleKeys[index], color]
  );
  return Object.fromEntries(entries);
}

// src/config/colors/helpers/generateHexAlpha.ts
function generateHexAlpha(hexColor, options) {
  const hex = hexColor.slice(0, 7);
  let hexAlphaCode;
  if (typeof options === "string") {
    hexAlphaCode = hexAlphaCodes[hexTransparencyPresetMap[options]];
  } else {
    const transparency = getTransparencyOption(options);
    const transparencyPreset = getTransparencyPresetOption(options);
    const code = transparencyPreset ? hexTransparencyPresetMap[transparencyPreset] : transparency;
    hexAlphaCode = code ? hexAlphaCodes[code] : void 0;
  }
  return `${hex}${hexAlphaCode ?? ""}`;
}
function getTransparencyPresetOption(option) {
  function isPreset(option2) {
    return "transparencyPreset" in option2;
  }
  return isPreset(option) ? option.transparencyPreset : void 0;
}
function getTransparencyOption(option) {
  function isPreset(option2) {
    return "transparency" in option2;
  }
  return isPreset(option) ? option.transparency : void 0;
}

// src/config/colors/helpers/generateHexAlphaColorGroup.ts
function generateHexAlphaColorGroup(hex, alphaOverrides, options) {
  const defaultColorGroup = {
    tint: generateHexAlpha(hex, "tint"),
    ghost: generateHexAlpha(hex, "ghost"),
    subtle: generateHexAlpha(hex, "subtle"),
    weak: generateHexAlpha(hex, "weak"),
    moderate: generateHexAlpha(hex, "moderate"),
    high: generateHexAlpha(hex, "high"),
    strong: generateHexAlpha(hex, "strong"),
    intense: generateHexAlpha(hex, "intense"),
    DEFAULT: hex
  };
  const overrides = Object.fromEntries(
    Object.entries(alphaOverrides ?? {}).map(([key, value]) => {
      if (!value)
        return [key, value];
      const { hexColor, ...hexAlphaOptions } = getHexAlphaOverrideOptions({
        hexColor: hex,
        overrideValue: value
      });
      return [key, generateHexAlpha(hexColor, hexAlphaOptions)];
    })
  );
  const colorGroup = Object.fromEntries(
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    Object.entries({ ...defaultColorGroup, ...overrides }).filter((entry) => Boolean(entry[1])).map(([key, value]) => {
      function getKey() {
        const { prefix } = options ?? {};
        if (!prefix)
          return key;
        if (key === "DEFAULT")
          return prefix;
        return `${prefix}-${key}`;
      }
      return [getKey(), value];
    })
  );
  return colorGroup;
}
function getHexAlphaOverrideOptions({
  hexColor,
  overrideValue
}) {
  if (typeof overrideValue === "string" && overrideValue in hexTransparencyPresetMap) {
    return {
      transparencyPreset: overrideValue,
      hexColor
    };
  }
  if (typeof overrideValue === "string" && overrideValue in hexAlphaCodes) {
    return {
      transparency: overrideValue,
      hexColor
    };
  }
  if (typeof overrideValue === "string") {
    return {
      hexColor: overrideValue
    };
  }
  return {
    hexColor: overrideValue.hexColor ?? hexColor,
    transparencyPreset: getTransparencyPresetOption(overrideValue),
    transparency: getTransparencyOption(overrideValue)
  };
}
function notEmpty(value) {
  return value !== null && value !== void 0;
}

// src/config/colors/helpers/objectMap.ts
function objectMap(obj, fn) {
  return Object.fromEntries(
    Object.entries(obj).map(([k, v]) => fn({ key: k, value: v })).filter(notEmpty)
  );
}

// src/config/colors/colors.ts
var flattenColorPalette = typeof flattenColorPaletteImport === "function" ? flattenColorPaletteImport : flattenColorPaletteImport.default;
var black = "#000000";
var white = "#FFFFFF";
var neutral = generateColorGroup(
  arrayToColorGroup([
    "#f6f7f9",
    "#5e7495",
    "#425571",
    "#46556b",
    "#3d4c62",
    "#324156",
    "#2b374a",
    "#262f3e",
    "#212a38",
    "#1c2532"
  ])
)({
  light: "400",
  DEFAULT: "600",
  dark: "800",
  soft: "100"
});
var contentInverse = generateHexAlphaColorGroup("#e3e5e8", {
  intense: white,
  DEFAULT: "#d2d4d7"
});
var base = {
  DEFAULT: "#F6F6F6",
  inverse: "#0D0E11"
};
var highlightAlphaMap = {
  DEFAULT: "7",
  tint: "2",
  ghost: "4",
  subtle: "7",
  weak: "10",
  moderate: "12",
  high: "15",
  strong: "25",
  intense: "30"
};
var paletteColorsConfig = {
  highlight: generateHexAlphaColorGroup(neutral[500], highlightAlphaMap),
  "highlight-inverse": generateHexAlphaColorGroup(
    variousColors["various-slate"].light,
    highlightAlphaMap
  ),
  white,
  black,
  base,
  neutral,
  heart: generateColorGroup({
    "50": "#fff0fa",
    "100": "#ffe4f7",
    "200": "#ffc9f0",
    "300": "#ff9ce2",
    "400": "#ff5fcc",
    "500": "#ff30b4",
    "600": "#f50d93",
    "700": "#e6007e",
    "800": "#b00460",
    "900": "#920952"
  })({
    DEFAULT: "700",
    dark: "800",
    light: "400",
    soft: "100"
  }),
  info: generateColorGroup(tailwindColors.cyan)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  caution: generateColorGroup({
    "50": "#ffffea",
    "100": "#fffbc5",
    "200": "#fff885",
    "300": "#ffed46",
    "400": "#ffdf1b",
    "500": "#ffbf00",
    "600": "#e29300",
    "700": "#bb6802",
    "800": "#985008",
    "900": "#7c420b"
  })({ DEFAULT: "500", dark: "600", light: "300", soft: "100" }),
  danger: generateColorGroup({
    "50": "#fff1f2",
    "100": "#ffdfe1",
    "200": "#ffc4c8",
    "300": "#ff9ba2",
    "400": "#ff626e",
    "500": "#ff3140",
    "600": "#f22837",
    "700": "#cb0a18",
    "800": "#a70d18",
    "900": "#8a121b"
  })({ DEFAULT: "500", dark: "700", light: "300", soft: "100" }),
  success: generateColorGroup(tailwindColors.emerald)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  gray: generateColorGroup(tailwindColors.gray)({
    DEFAULT: "500",
    dark: "600",
    light: "300",
    soft: "100"
  }),
  content: generateHexAlphaColorGroup("#15181E", {
    DEFAULT: "high",
    ghost: { hexColor: neutral["500"], transparencyPreset: "ghost" }
  }),
  "content-inverse": contentInverse,
  boundary: {
    focus: base.inverse,
    ...generateHexAlphaColorGroup(neutral[300], {
      DEFAULT: "subtle"
    })
  },
  "boundary-inverse": {
    focus: contentInverse.weak,
    ...generateHexAlphaColorGroup(base.DEFAULT, { DEFAULT: "subtle" })
  },
  surface: generateColorGroup(
    arrayToColorGroup([
      "#ffffff",
      "#f5f7f9",
      "#eceff3",
      "#e3e7ed",
      "#dae0e8",
      "#d3dae4",
      "#ccd5e0",
      "#c5d0de",
      "#bfccdb",
      "#b9c8d9"
    ])
  )({ DEFAULT: "50", dark: "400", light: "200", soft: "100" }),
  "surface-inverse": generateColorGroup(
    arrayToColorGroup([
      "#2d3542",
      "#282f3a",
      "#232832",
      "#1e222a",
      "#1a1d23",
      "#181b21",
      "#171a20",
      "#16181e",
      "#14171d",
      "#13151b"
    ])
  )({ DEFAULT: "400", dark: "700", light: "200", soft: "500" }),
  distinct: {
    "1": variousColors["various-blue"].DEFAULT,
    "2": variousColors["various-emerald"].DEFAULT,
    "3": variousColors["various-orange"].DEFAULT,
    "4": variousColors["various-fuchsia"].DEFAULT,
    "5": variousColors["various-yellow"].DEFAULT,
    "6": variousColors["various-rose"].DEFAULT,
    "7": variousColors["various-cyan"].DEFAULT,
    "8": variousColors["various-violet"].DEFAULT,
    "9": variousColors["various-teal"].DEFAULT,
    "10": variousColors["various-pink"].DEFAULT,
    "11": variousColors["various-lime"].DEFAULT,
    "12": variousColors["various-gray"].DEFAULT
  },
  ...variousColors
};
var utilityColorsConfig = {
  inherit: tailwindColors.inherit,
  current: tailwindColors.current,
  transparent: tailwindColors.transparent
};
var colorPalette = {
  ...utilityColorsConfig,
  ...objectMap(
    flattenColorPalette(paletteColorsConfig),
    ({ key, value }) => {
      return [`palette-${key}`, value];
    }
  )
};

// src/config/colors/helpers/hexToRgb.ts
var hexCharacters = "a-f\\d";
var match3or4Hex = `#?[${hexCharacters}]{3}[${hexCharacters}]?`;
var match6or8Hex = `#?[${hexCharacters}]{6}([${hexCharacters}]{2})?`;
var nonHexChars = new RegExp(`[^#${hexCharacters}]`, "gi");
var validHexSize = new RegExp(`^${match3or4Hex}$|^${match6or8Hex}$`, "i");
function hexRgb(hex, options = {}) {
  if (typeof hex !== "string" || nonHexChars.test(hex) || !validHexSize.test(hex)) {
    throw new TypeError("Expected a valid hex string");
  }
  hex = hex.replace(/^#/, "");
  let alphaFromHex = 1;
  if (hex.length === 8) {
    alphaFromHex = Number.parseInt(hex.slice(6, 8), 16) / 255;
    hex = hex.slice(0, 6);
  }
  if (hex.length === 4) {
    alphaFromHex = Number.parseInt(hex.slice(3, 4).repeat(2), 16) / 255;
    hex = hex.slice(0, 3);
  }
  if (hex.length === 3) {
    hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
  }
  const number = Number.parseInt(hex, 16);
  const red = number >> 16;
  const green = number >> 8 & 255;
  const blue = number & 255;
  const alpha = typeof options.alpha === "number" ? options.alpha : alphaFromHex;
  return { red, green, blue, alpha };
}

// src/config/colors/helpers/cssVariables.ts
function getCssColorVariable(str) {
  return `--color-${str}`;
}
function getCssAlphaVariable(str) {
  return `--alpha-${str}`;
}
function getCssVariableValue(cssVariable, alphaCssVariable) {
  if (alphaCssVariable) {
    return `rgb(var(${cssVariable}) / var(${alphaCssVariable}))`;
  }
  return `rgb(var(${cssVariable}) / <alpha-value>)`;
}
function getCssVariableRgb(hex) {
  const { red, green, blue, alpha } = hexRgb(hex);
  return { rgb: `${red} ${green} ${blue}`, alpha };
}

// src/config/colors/color-schemes/schemes/common-scheme.ts
var commonScheme = {
  all: {
    heart: "palette-heart",
    "heart-light": "palette-heart-light",
    "heart-dark": "palette-heart-dark",
    "heart-soft": "palette-heart-soft",
    info: "palette-info",
    "info-light": "palette-info-light",
    "info-dark": "palette-info-dark",
    "info-soft": "palette-info-soft",
    success: "palette-success",
    "success-light": "palette-success-light",
    "success-dark": "palette-success-dark",
    "success-soft": "palette-success-soft",
    danger: "palette-danger",
    "danger-light": "palette-danger-light",
    "danger-dark": "palette-danger-dark",
    "danger-soft": "palette-danger-soft",
    caution: "palette-caution",
    "caution-light": "palette-caution-light",
    "caution-dark": "palette-caution-dark",
    "caution-soft": "palette-caution-soft",
    "primary-content": "palette-content-inverse-intense",
    "secondary-content": "palette-content-inverse-intense"
  },
  lightMode: {
    base: "palette-base",
    boundary: "palette-various-slate-300",
    "boundary-tint": "palette-various-slate-50",
    "boundary-ghost": "palette-various-slate-100",
    "boundary-subtle": "palette-various-slate-200",
    "boundary-weak": "palette-various-slate-300",
    "boundary-moderate": "palette-various-slate-400",
    "boundary-high": "palette-various-slate-500",
    "boundary-strong": "palette-various-slate-600",
    "boundary-intense": "palette-various-slate-700",
    highlight: "palette-highlight",
    "highlight-tint": "palette-highlight-tint",
    "highlight-ghost": "palette-highlight-ghost",
    "highlight-subtle": "palette-highlight-subtle",
    "highlight-weak": "palette-highlight-weak",
    "highlight-moderate": "palette-highlight-moderate",
    "highlight-high": "palette-highlight-high",
    "highlight-strong": "palette-highlight-strong",
    "highlight-intense": "palette-highlight-intense",
    content: "palette-content",
    "content-tint": "palette-content-tint",
    "content-ghost": "palette-content-ghost",
    "content-subtle": "palette-content-subtle",
    "content-weak": "palette-content-weak",
    "content-moderate": "palette-content-moderate",
    "content-high": "palette-content-high",
    "content-strong": "palette-content-strong",
    "content-intense": "palette-content-intense",
    "content-min-contrast": "palette-neutral-light",
    "content-max-contrast": "palette-content-intense",
    "inverse-content-max-contrast": "palette-content-inverse-intense",
    "inverse-content-min-contrast": "palette-neutral-light",
    inverse: "palette-surface-inverse",
    "inverse-light": "palette-surface-inverse-light",
    "inverse-dark": "palette-surface-inverse-dark",
    "inverse-soft": "palette-surface-inverse-soft",
    "primary-content-max-contrast": "palette-content-intense",
    "primary-content-min-contrast": "palette-neutral-light",
    "secondary-content-max-contrast": "palette-content-high",
    "secondary-content-min-contrast": "palette-neutral-300",
    "inverse-content": "palette-content-intense"
  },
  darkMode: {
    base: "palette-base-inverse",
    boundary: "palette-various-zinc-700",
    "boundary-tint": "palette-various-zinc-950",
    "boundary-ghost": "palette-various-zinc-900",
    "boundary-subtle": "palette-various-zinc-800",
    "boundary-weak": "palette-various-zinc-700",
    "boundary-moderate": "palette-various-zinc-600",
    "boundary-high": "palette-various-zinc-500",
    "boundary-intense": "palette-various-zinc-400",
    highlight: "palette-highlight-inverse",
    "highlight-tint": "palette-highlight-inverse-tint",
    "highlight-ghost": "palette-highlight-inverse-ghost",
    "highlight-subtle": "palette-highlight-inverse-subtle",
    "highlight-weak": "palette-highlight-inverse-weak",
    "highlight-moderate": "palette-highlight-inverse-moderate",
    "highlight-high": "palette-highlight-inverse-high",
    "highlight-strong": "palette-highlight-inverse-strong",
    "highlight-intense": "palette-highlight-inverse-intense",
    content: "palette-content-inverse",
    "content-tint": "palette-content-inverse-tint",
    "content-ghost": "palette-content-inverse-ghost",
    "content-subtle": "palette-content-inverse-subtle",
    "content-weak": "palette-content-inverse-weak",
    "content-moderate": "palette-content-inverse-moderate",
    "content-high": "palette-content-inverse-high",
    "content-strong": "palette-content-inverse-strong",
    "content-intense": "palette-content-inverse-intense",
    "content-min-contrast": "palette-neutral-50",
    "content-max-contrast": "palette-content-inverse-intense",
    "inverse-content-max-contrast": "palette-content-intense",
    "inverse-content-min-contrast": "palette-neutral",
    inverse: "palette-surface",
    "inverse-light": "palette-surface-light",
    "inverse-dark": "palette-surface-dark",
    "inverse-soft": "palette-surface-soft",
    "primary-content-max-contrast": "palette-content-inverse-intense",
    "primary-content-min-contrast": "palette-various-slate-300",
    "secondary-content-max-contrast": "palette-content-inverse-high",
    "secondary-content-min-contrast": "palette-various-slate-300",
    "inverse-content": "palette-content-inverse-intense"
  }
};

// src/config/colors/color-schemes/color-schemes.helpers.ts
function resolveColorScheme(scheme) {
  return objectMap(scheme, ({ key, value }) => {
    const color = colorPalette[value];
    return [key, color];
  });
}
function getExtendedConfig(options) {
  if ("extend" in options)
    return options.extend;
  return void 0;
}
function defineColorScheme(options) {
  const { name, colorMode, scheme } = options;
  const extendedConfig = getExtendedConfig(options);
  const { scheme: extendedScheme } = extendedConfig ?? {};
  const colorModeScheme = (colorMode ?? extendedConfig?.colorMode) === "dark" ? commonScheme.darkMode : commonScheme.lightMode;
  const resolvedScheme = resolveColorScheme({ ...commonScheme.all, ...colorModeScheme, ...scheme });
  return {
    ...extendedConfig,
    name,
    colorMode,
    scheme: { ...extendedScheme, ...resolvedScheme },
    unresolvedScheme: scheme
  };
}
function defineColorSchemes(resolvedSchemeConfigs) {
  const colorSchemes2 = resolvedSchemeConfigs.reduce((acc, cur) => {
    acc[cur.name] = cur.scheme;
    return acc;
  }, {});
  const colorSchemeCssVariableClasses2 = getColorSchemesCssVariableClasses(colorSchemes2);
  const lightDefault = colorSchemes2.default;
  const rootScheme = colorSchemeCssVariableClasses2[":root"];
  const colorSchemeTokens2 = getColorSchemeTokens(lightDefault, rootScheme);
  return {
    colorSchemes: colorSchemes2,
    colorSchemeCssVariableClasses: colorSchemeCssVariableClasses2,
    colorSchemeTokens: colorSchemeTokens2,
    colorSchemeConfigs: resolvedSchemeConfigs
  };
}
function getColorSchemeTokens(scheme, variableMap) {
  return objectMap(scheme, ({ key: token }) => {
    const cssVariable = getCssColorVariable(token);
    const alphaVariable = getCssAlphaVariable(token);
    return [
      `${token}`,
      getCssVariableValue(cssVariable, alphaVariable in variableMap ? alphaVariable : void 0)
    ];
  });
}
function getColorSchemesCssVariableClasses(colorSchemes2) {
  return Object.fromEntries(
    Object.entries(colorSchemes2).flatMap(([schemeKey, value]) => {
      const cssThemeVariablesMap = Object.fromEntries(
        Object.entries(value).flatMap(([themeToken, hex]) => {
          const colorVariableName = getCssColorVariable(themeToken);
          const alphaVariableName = getCssAlphaVariable(themeToken);
          const { rgb, alpha } = getCssVariableRgb(hex);
          const entries = [[colorVariableName, rgb]];
          if (alpha >= 0 && alpha !== 1) {
            entries.push([alphaVariableName, `${parseFloat(alpha.toFixed(2))}`]);
          }
          return entries;
        })
      );
      return getColorSchemeCssVariableNames(schemeKey).map((cssVariableName) => {
        return [cssVariableName, { color: value.content, ...cssThemeVariablesMap }];
      });
    })
  );
}
function getColorSchemeCssVariableNames(schemeKey) {
  const [mode, ...rest] = schemeKey.split("/");
  const baseSchemeKey = rest.join("/");
  const dataColorSchemeClass = `[data-color-scheme="${schemeKey}"]`;
  const isDarkMode = mode === "dark";
  if (schemeKey === "default") {
    return [":root", dataColorSchemeClass];
  }
  if (schemeKey === "dark/default") {
    return ['[data-mode="dark"]', `[data-mode="dark"] [data-color-scheme="default"]`];
  }
  if (isDarkMode) {
    return [`[data-mode="dark"] [data-color-scheme="${baseSchemeKey}"]`];
  }
  return [dataColorSchemeClass];
}

// src/config/colors/color-schemes/schemes/danger.ts
var dangerScheme = defineColorScheme({
  name: "danger",
  colorMode: "dark",
  scheme: {
    primary: "palette-danger-100",
    "primary-light": "palette-danger-50",
    "primary-soft": "palette-danger-200",
    "primary-dark": "palette-danger-50",
    "primary-content": "palette-danger",
    secondary: "palette-various-rose-800",
    "secondary-dark": "palette-various-rose-900",
    "secondary-light": "palette-various-rose-700",
    "secondary-soft": "palette-various-rose-700",
    "secondary-content": "palette-content-intense",
    surface: "palette-danger-500",
    "surface-soft": "palette-danger-400",
    "surface-light": "palette-danger-300",
    "surface-dark": "palette-danger-600"
  }
});
var danger_default = dangerScheme;

// src/config/colors/color-schemes/schemes/neutral.base.ts
var neutralBaseColors = {
  boundary: "palette-various-slate-600",
  "boundary-tint": "palette-various-slate-900",
  "boundary-ghost": "palette-various-slate-800",
  "boundary-subtle": "palette-various-slate-700",
  "boundary-weak": "palette-various-slate-600",
  "boundary-moderate": "palette-various-slate-500",
  "boundary-high": "palette-various-slate-400",
  "boundary-strong": "palette-various-slate-300",
  "boundary-intense": "palette-various-slate-200",
  surface: "palette-neutral-400",
  "surface-light": "palette-neutral-200",
  "surface-dark": "palette-neutral-dark",
  "surface-soft": "palette-neutral-300",
  primary: "palette-various-slate-400",
  "primary-light": "palette-various-slate-300",
  "primary-dark": "palette-various-slate-500",
  "primary-soft": "palette-various-slate-100",
  secondary: "palette-various-slate-500",
  "secondary-light": "palette-various-slate-400",
  "secondary-dark": "palette-various-slate-600",
  "secondary-soft": "palette-various-slate-400"
};

// src/config/colors/color-schemes/schemes/neutral.ts
var neutral_default = defineColorScheme({
  name: "neutral",
  colorMode: "dark",
  scheme: {
    ...neutralBaseColors,
    surface: "palette-neutral-600",
    "surface-light": "palette-neutral-light",
    "surface-dark": "palette-neutral-dark",
    "surface-soft": "palette-neutral-500",
    secondary: "palette-various-slate-500",
    "secondary-light": "palette-various-slate-400",
    "secondary-dark": "palette-various-slate-600",
    "secondary-soft": "palette-various-slate-400"
  }
});

// src/config/colors/color-schemes/schemes/neutral-dark.ts
var neutral_dark_default = defineColorScheme({
  name: "neutral-dark",
  colorMode: "dark",
  scheme: {
    ...neutralBaseColors,
    surface: "palette-neutral-800",
    "surface-light": "palette-neutral-600",
    "surface-dark": "palette-neutral-900",
    "surface-soft": "palette-neutral-700",
    secondary: "palette-various-slate-500",
    "secondary-light": "palette-various-slate-400",
    "secondary-dark": "palette-various-slate-600",
    "secondary-soft": "palette-various-slate-200"
  }
});

// src/config/colors/color-schemes/schemes/neutral-light.ts
var neutral_light_default = defineColorScheme({
  name: "neutral-light",
  colorMode: "dark",
  scheme: {
    ...neutralBaseColors,
    boundary: "palette-various-slate-500",
    "boundary-tint": "palette-various-slate-800",
    "boundary-ghost": "palette-various-slate-700",
    "boundary-subtle": "palette-various-slate-600",
    "boundary-weak": "palette-various-slate-500",
    "boundary-moderate": "palette-various-slate-400",
    "boundary-high": "palette-various-slate-300",
    "boundary-strong": "palette-various-slate-200",
    "boundary-intense": "palette-various-slate-100",
    surface: "palette-neutral-400",
    "surface-light": "palette-neutral-200",
    "surface-dark": "palette-neutral-dark",
    "surface-soft": "palette-neutral-300",
    secondary: "palette-various-slate-500",
    "secondary-light": "palette-various-slate-400",
    "secondary-dark": "palette-various-slate-600",
    "secondary-soft": "palette-various-slate-400"
  }
});

// src/config/colors/color-schemes/schemes/surface.ts
var surface_default = defineColorScheme({
  name: "surface",
  colorMode: "light",
  scheme: {
    highlight: "palette-highlight",
    "highlight-weak": "palette-highlight-weak",
    "highlight-moderate": "palette-highlight-moderate",
    "highlight-high": "palette-highlight-high",
    "highlight-strong": "palette-highlight-strong",
    surface: "palette-surface",
    "surface-light": "palette-surface-100",
    "surface-dark": "palette-surface-dark",
    "surface-soft": "palette-surface-50",
    primary: "palette-neutral-500",
    "primary-light": "palette-neutral-300",
    "primary-dark": "palette-neutral-600",
    "primary-soft": "palette-various-slate-200",
    secondary: "palette-various-slate-400",
    "secondary-light": "palette-various-slate-300",
    "secondary-dark": "palette-various-slate-500",
    "secondary-soft": "palette-various-slate-100"
  }
});

// src/config/colors/color-schemes/schemes/surface.darkmode.ts
var surface_darkmode_default = defineColorScheme({
  name: "dark/surface",
  colorMode: "dark",
  scheme: {
    surface: "palette-surface-inverse",
    "surface-light": "palette-surface-inverse-300",
    "surface-dark": "palette-surface-inverse-500",
    "surface-soft": "palette-surface-inverse-200",
    primary: "palette-various-slate-500",
    "primary-light": "palette-various-slate-400",
    "primary-dark": "palette-various-slate-600",
    "primary-soft": "palette-various-slate-200",
    secondary: "palette-various-slate-600",
    "secondary-light": "palette-various-slate-500",
    "secondary-dark": "palette-various-slate-500",
    "secondary-soft": "palette-various-slate-300"
  }
});

// src/config/colors/color-schemes/schemes/surface-light.ts
var surface_light_default = defineColorScheme({
  name: "surface-light",
  colorMode: "light",
  scheme: {
    surface: "palette-surface-light",
    "surface-light": "palette-surface-100",
    "surface-dark": "palette-surface-dark",
    "surface-soft": "palette-surface-50",
    primary: "palette-neutral-500",
    "primary-light": "palette-neutral-400",
    "primary-dark": "palette-neutral-600",
    "primary-soft": "palette-various-slate-200",
    secondary: "palette-various-slate-400",
    "secondary-light": "palette-various-slate-300",
    "secondary-dark": "palette-various-slate-500",
    "secondary-soft": "palette-various-slate-100"
  }
});

// src/config/colors/color-schemes/schemes/surface-light.darkmode.ts
var surface_light_darkmode_default = defineColorScheme({
  name: "dark/surface-light",
  colorMode: "dark",
  scheme: {
    surface: "palette-surface-inverse-light",
    "surface-light": "palette-surface-inverse-100",
    "surface-dark": "palette-surface-inverse-300",
    "surface-soft": "palette-surface-inverse-50",
    primary: "palette-various-slate-500",
    "primary-light": "palette-various-slate-400",
    "primary-dark": "palette-various-slate-600",
    "primary-soft": "palette-various-slate-200",
    secondary: "palette-various-slate-600",
    "secondary-light": "palette-various-slate-500",
    "secondary-dark": "palette-various-slate-500",
    "secondary-soft": "palette-various-slate-300"
  }
});

// src/config/colors/color-schemes/schemes/surface-dark.ts
var surface_dark_default = defineColorScheme({
  name: "surface-dark",
  colorMode: "light",
  scheme: {
    surface: "palette-surface-dark",
    "surface-light": "palette-surface-50",
    "surface-dark": "palette-surface-800",
    "surface-soft": "palette-surface-100",
    primary: "palette-neutral-500",
    "primary-light": "palette-neutral-400",
    "primary-dark": "palette-neutral-600",
    "primary-soft": "palette-various-slate-200",
    secondary: "palette-various-slate-400",
    "secondary-light": "palette-various-slate-300",
    "secondary-dark": "palette-various-slate-500",
    "secondary-soft": "palette-various-slate-100"
  }
});

// src/config/colors/color-schemes/schemes/surface-dark.darkmode.ts
var surface_dark_darkmode_default = defineColorScheme({
  name: "dark/surface-dark",
  colorMode: "dark",
  scheme: {
    surface: "palette-surface-inverse-dark",
    "surface-light": "palette-surface-inverse-600",
    "surface-dark": "palette-surface-inverse-800",
    "surface-soft": "palette-surface-inverse-600",
    primary: "palette-various-slate-500",
    "primary-light": "palette-various-slate-400",
    "primary-dark": "palette-various-slate-600",
    "primary-soft": "palette-various-slate-200",
    secondary: "palette-various-slate-600",
    "secondary-light": "palette-various-slate-500",
    "secondary-dark": "palette-various-slate-500",
    "secondary-soft": "palette-various-slate-300"
  }
});

// src/config/colors/color-schemes/schemes/default.ts
var default_default = defineColorScheme({
  name: "default",
  colorMode: "light",
  scheme: surface_default.unresolvedScheme
});

// src/config/colors/color-schemes/schemes/default.darkmode.ts
var default_darkmode_default = defineColorScheme({
  name: "dark/default",
  colorMode: "dark",
  scheme: {
    surface: "palette-surface-inverse",
    "surface-light": "palette-surface-inverse-light",
    "surface-dark": "palette-surface-inverse-dark",
    "surface-soft": "palette-surface-inverse-soft",
    primary: "palette-neutral-500",
    "primary-light": "palette-neutral-300",
    "primary-dark": "palette-neutral-600",
    "primary-soft": "palette-various-slate-200",
    secondary: "palette-neutral-800",
    "secondary-light": "palette-neutral-700",
    "secondary-dark": "palette-neutral-900",
    "secondary-soft": "palette-neutral-500"
  }
});

// src/config/colors/color-schemes/schemes/inverse-scheme.ts
var inverseColorSchemes = [
  defineColorScheme({
    name: "inverse",
    colorMode: "dark",
    extend: surface_darkmode_default
  }),
  defineColorScheme({
    name: "inverse-light",
    colorMode: "dark",
    extend: surface_light_darkmode_default
  }),
  defineColorScheme({
    name: "inverse-dark",
    colorMode: "dark",
    extend: surface_dark_darkmode_default
  }),
  defineColorScheme({
    name: "dark/inverse",
    colorMode: "light",
    extend: surface_default
  }),
  defineColorScheme({
    name: "dark/inverse-light",
    colorMode: "light",
    extend: surface_light_default
  }),
  defineColorScheme({
    name: "dark/inverse-dark",
    colorMode: "light",
    extend: surface_dark_default
  })
];
var inverse_scheme_default = inverseColorSchemes;

// src/config/colors/color-schemes/schemes/state-schemes.ts
var stateColors = ["success", "info", "danger", "caution", "heart"];
var state_schemes_default = stateColors.flatMap((color) => {
  const config = {
    name: color,
    colorMode: "light",
    scheme: {
      "primary-content-max-contrast": `palette-${color}-500`,
      "primary-content-min-contrast": `palette-${color}-600`,
      content: `palette-white`,
      surface: `palette-${color}`,
      "surface-light": `palette-${color}-light`,
      "surface-dark": `palette-${color}-dark`,
      "surface-soft": `palette-${color}-soft`,
      primary: `palette-${color}-500`,
      "primary-light": `palette-${color}-300`,
      "primary-dark": `palette-${color}-600`,
      "primary-soft": `palette-${color}-200`,
      secondary: `palette-${color}-400`,
      "secondary-light": `palette-${color}-300`,
      "secondary-dark": `palette-${color}-500`,
      "secondary-soft": `palette-${color}-100`
    }
  };
  const darkConfig = {
    ...config,
    name: `dark/${color}`,
    colorMode: "dark"
  };
  return [config, darkConfig].map((e) => defineColorScheme(e));
});

// src/config/colors/color-schemes/schemes/index.ts
var colorSchemeConfigs = [
  default_default,
  default_darkmode_default,
  danger_default,
  neutral_default,
  neutral_dark_default,
  neutral_light_default,
  surface_default,
  surface_light_default,
  surface_dark_default,
  surface_darkmode_default,
  surface_light_darkmode_default,
  surface_dark_darkmode_default,
  ...inverse_scheme_default,
  ...state_schemes_default
];

// src/config/colors/color-schemes/color-schemes.ts
var mainColorSchemeNames = [
  "default",
  "surface",
  "surface-light",
  "surface-dark",
  "neutral",
  "neutral-light",
  "neutral-dark",
  "inverse",
  "inverse-light",
  "inverse-dark"
];
var appStateColorSchemeNames = [
  "danger",
  "info",
  "danger",
  "caution",
  "success"
];
var colorSchemeNames = [
  ...mainColorSchemeNames,
  ...appStateColorSchemeNames
];
Object.fromEntries(
  colorSchemeNames.map((schemeName) => {
    return [`${schemeName}-color-scheme`, `color-scheme=${schemeName}`];
  })
);
defineColorSchemes(colorSchemeConfigs);

// src/config/screens.ts
var screens = {
  sm: "640px",
  md: "768px",
  lg: "1024px",
  xl: "1280px",
  "2xl": "1536px"
};

// src/config/data-attributes.ts
var dataAttributes = {
  "data-antribute-list": "divide no-item-gutters no-gap zebra-items rounded-items",
  "data-antribute-card": "padding padding-none"
};
function getDataAttributes(dataAttributeOptions) {
  const entries = Object.entries(dataAttributeOptions).map(([attributeKey, filterValue]) => {
    const dataAttributeValue = dataAttributes[attributeKey];
    if (typeof dataAttributeValue === "string") {
      const filtered = filterStringAttributes(dataAttributeValue, filterValue);
      return [attributeKey, filtered];
    }
    if (typeof dataAttributeValue === "boolean") {
      return [attributeKey, String(filterValue)];
    }
    return [attributeKey, void 0];
  });
  function filterStringAttributes(str, values) {
    return str.split(" ").filter((attribute) => {
      return Boolean(
        values && typeof values === "object" && attribute in values && values[attribute]
      );
    }).join(" ");
  }
  return Object.fromEntries(entries);
}
getDataAttributes({ "data-antribute-card": { "padding-none": true } });

// src/config/index.ts
var testClassName = {
  root: "bg-neutral"
};

// src/constants/theme.ts
var LIGHT_MODE = "light";
var DARK_MODE = "dark";
var DEFAULT_THEME = DARK_MODE;
function getByPath(object, path, _maxDepth) {
  return getByPath$1(object, path);
}

// src/utils/notEmpty.ts
function notEmpty2(value) {
  return value !== null && value !== void 0;
}
function notEmptyEntry(entry) {
  const value = entry[1];
  return value !== null && value !== void 0;
}
function notFalsy(value) {
  return Boolean(value);
}

// src/utils/objectMap.ts
function objectMap2(obj, fn) {
  return Object.fromEntries(
    Object.entries(obj).map(([k, v], index) => fn({ key: k, value: v, index, get: getByPath })).filter(notEmpty2)
  );
}
function transformKeys(obj, transformKey) {
  return objectMap2(obj, ({ key, value }) => {
    return [transformKey({ key }), value];
  });
}
var parseUnitValue = (str) => {
  const match = str.match(/^(\d+(?:\.\d+)?)(\D*)$/);
  if (!match)
    return { value: NaN, unit: null };
  const [match1 = "", match2] = match;
  const value = parseFloat(match1);
  const isNumeric = isNumber(value) && !isNaN(value);
  return { value, unit: match2 || isNumeric ? "px" : null };
};

// src/hooks/useBreakpoints.tsx
var screenSizes = {
  xs: calculateXsScreenSize(),
  ...screens
};
var p = objectMap2(screenSizes, ({ key, value }) => {
  return [`$${key}`, value];
});
var breakpoints = objectMap2(screenSizes, ({ key, value: size }) => {
  return [`$${key}`, { above: `(min-width: ${size})`, below: `(max-width: ${size})` }];
});
function useBreakpoints() {
  const $xs = useMediaQuery({ query: breakpoints.$xs.below });
  const $sm = useMediaQuery({ query: breakpoints.$sm.above });
  const $md = useMediaQuery({ query: breakpoints.$md.above });
  const $lg = useMediaQuery({ query: breakpoints.$lg.above });
  const $xl = useMediaQuery({ query: breakpoints.$xl.above });
  const $2xl = useMediaQuery({ query: breakpoints.$2xl.above });
  const breakpointMap = {
    $xs,
    $sm,
    $md,
    $lg,
    $xl,
    $2xl
  };
  return breakpointMap;
}
function calculateXsScreenSize() {
  const smallScreen = parseUnitValue(screens.sm);
  return `${smallScreen.value - 1}${smallScreen.unit}`;
}

// src/utils/environment-utils.ts
function isClientSide() {
  return typeof window !== "undefined";
}
function isDevelopment() {
  if (typeof window === "undefined" && typeof process !== "undefined" && process.env.NODE_ENV === "development") {
    return true;
  }
  if (typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1")) {
    return true;
  }
  return false;
}

// src/hooks/useDarkMode.tsx
var getInitialIsDarkMode = (fallback) => {
  if (!isClientSide())
    return DEFAULT_THEME === DARK_MODE;
  const savedTheme = localStorage.getItem("color-theme");
  if (!savedTheme) {
    return Boolean(fallback);
  }
  return savedTheme === DARK_MODE;
};
var useDarkMode = () => {
  const initialIsDarkMode = getInitialIsDarkMode();
  const [isDarkMode, setIsDarkMode] = useState(initialIsDarkMode);
  function setDarkMode(enabled) {
    if (!isClientSide()) {
      return;
    }
    const htmlTag = document.documentElement;
    if (enabled) {
      htmlTag.classList.add(DARK_MODE);
      htmlTag.setAttribute("data-mode", DARK_MODE);
      localStorage.setItem("color-theme", DARK_MODE);
    } else {
      htmlTag.classList.remove(DARK_MODE);
      htmlTag.removeAttribute("data-mode");
      localStorage.setItem("color-theme", LIGHT_MODE);
    }
    setIsDarkMode(enabled);
  }
  const toggleDarkMode = () => {
    setDarkMode(!isDarkMode);
  };
  useLayoutEffect(() => {
    if (initialIsDarkMode !== isDarkMode) {
      setDarkMode(initialIsDarkMode);
    }
  }, [initialIsDarkMode, isDarkMode]);
  return { isDarkMode, setDarkMode, toggleDarkMode };
};
function useIsDarkMode() {
  const { isDarkMode } = useDarkMode();
  return isDarkMode;
}
function generatePropPickerFn(pickedRecord) {
  const pickedKeys = Object.keys(pickedRecord);
  const pickerFn = (props, options) => {
    const { defaultProps } = options ?? {};
    return { ...defaultProps, ...pick(props, pickedKeys) };
  };
  pickerFn.pickedKeys = pickedKeys;
  pickerFn.pickedRecord = pickedRecord;
  pickerFn.omit = (props) => omit(props, pickedKeys);
  return pickerFn;
}
var NO_DEFAULT_VALUE = "_pick_";
function pickProps(props, pickedProps, options) {
  const { shouldValidatePickProp = true } = options ?? {};
  const entries = Object.entries(pickedProps).map(([path, defaultValue]) => {
    const prop = get(props, path);
    if (defaultValue === NO_DEFAULT_VALUE) {
      return [path, prop];
    }
    if (shouldValidatePickProp) {
      validatePickProp(defaultValue, pickedProps);
    }
    return [path, prop ?? defaultValue];
  });
  return Object.fromEntries(entries);
}
function validatePickProp(input, pickedProps) {
  if (isDevelopment()) {
    const startsWith = ["_p", "pick"];
    const isLikelyTypo = typeof input === "string" && startsWith.some((typo) => input.startsWith(typo));
    if (isLikelyTypo) {
      const functionName = "`pickProps`";
      throw new Error(`
      Error thrown from ${functionName}
      
      A possible typo was detected in the arguments passed to the ${functionName} function.

      Expected value: "${NO_DEFAULT_VALUE}"

      Received value: "${input}" \u274C

      ${JSON.stringify(
        objectMap2(pickedProps, ({ key, value }) => [
          key,
          value === input ? `${value} \u274C` : value
        ]),
        null,
        2
      )}
 
      If this is intended, add \`shouldValidatePickProp: true\` to the options.

      Note: This error is thrown only during development.

      `);
    }
  }
}

// src/utils/toArray.ts
function toArray(v, options) {
  const val = Array.isArray(v) ? v : [v];
  if (options?.notEmpty)
    return val.filter(notEmpty2);
  return val;
}
var getRelativeElementData = (delta, options) => {
  const { minElement, maxElement, elements = [] } = options;
  const middle = Math.floor(elements.length / 2);
  const { relativeElement = elements[middle] } = options;
  const [relative, min, max] = [relativeElement, minElement, maxElement].map((element2) => {
    const lower = 0;
    const upper = Math.max(0, elements.length - 1);
    const unboundIndex = elements.findIndex((e) => e === element2);
    const boundIndex = clamp(unboundIndex, lower, upper);
    const boundElement = elements[boundIndex];
    return {
      boundIndex,
      unboundIndex,
      boundElement,
      isBoundsExceeded: isNaN(unboundIndex) ? null : unboundIndex !== boundIndex
    };
  });
  const {
    boundIndex: relativeIndex,
    // boundElement: relativeBoundElement,
    unboundIndex: originalRelativeIndex
  } = relative;
  const {
    boundIndex: upperBoundsIndex,
    boundElement: upperBoundElement,
    unboundIndex: originalMaxIndex
  } = max;
  const {
    boundIndex: lowerBoundIndex,
    boundElement: lowerBoundElement,
    unboundIndex: originalMinIndex
  } = min;
  const deltaIndex = relativeIndex + delta;
  const elementIndex = clamp(deltaIndex, lowerBoundIndex, upperBoundsIndex);
  const element = elements[elementIndex];
  const upperBoundsDistance = upperBoundsIndex - elementIndex;
  const lowerBoundsDistance = elementIndex - lowerBoundIndex;
  const isDeltaExceedingUpperBound = deltaIndex > upperBoundsIndex;
  const isDeltaExceedingLowerBound = deltaIndex < upperBoundsIndex;
  const isLowerBoundReached = upperBoundsIndex === deltaIndex;
  const isUpperBoundReached = lowerBoundIndex === deltaIndex;
  const isBoundsReached = isLowerBoundReached || isUpperBoundReached;
  const isDeltaExceedingBounds = isDeltaExceedingUpperBound || isDeltaExceedingLowerBound;
  return {
    element,
    elementIndex,
    relativeIndex,
    isBoundsReached,
    isDeltaExceedingBounds,
    isLowerBoundReached,
    isUpperBoundReached,
    isDeltaExceedingLowerBound,
    isDeltaExceedingUpperBound,
    upperBoundsDistance,
    lowerBoundsDistance,
    meta: {
      originalElements: elements,
      originalMaxElement: maxElement,
      originalMinElement: minElement,
      originalRelativeIndex,
      originalMinIndex,
      originalMaxIndex,
      elementDeltaString: [
        delta > 0 && `\u25B2 (${delta})`,
        delta < 0 && `\u{1F53B} (${delta})`,
        `${element}__${elementIndex} from ${relativeElement ?? ""}__${relativeIndex}`,
        !delta && `0 delta`,
        `${relativeElement ?? "N/A"} -> ${element}`,
        `Bounds: [${lowerBoundElement ?? ""}, ${upperBoundElement ?? ""}] [${lowerBoundIndex}, ${upperBoundsIndex}]`,
        isUpperBoundReached && "Upper Bounds Reached",
        isLowerBoundReached && "Lower Bounds Reached",
        isDeltaExceedingLowerBound && "Delta Exceeding Lower Bound",
        isDeltaExceedingUpperBound && "Delta Exceeding Upper Bound"
      ].filter(Boolean).join(" :: ")
    }
  };
};
var getRelativeSizePropData = (sizeChange, options) => {
  const {
    relativeSize = "md",
    minSize = "xs",
    maxSize = "lg",
    sizes = ["xs", "sm", "md", "lg"]
  } = options;
  const {
    element: sizeProp,
    elementIndex: sizePropIndex,
    relativeIndex: relativeSizePropIndex,
    meta: {
      originalMaxElement: originalMaxSizeProp,
      originalMaxIndex: originalMaxSizePropIndex,
      originalRelativeIndex: originalRelativeSizeIndex,
      originalElements: originalSizes,
      originalMinElement: originalMinSizeProp,
      originalMinIndex: originalMinSizeIndex,
      elementDeltaString: sizeDeltaString
    },
    ...rest
  } = getRelativeElementData(sizeChange, {
    elements: sizes,
    relativeElement: relativeSize,
    minElement: minSize,
    maxElement: maxSize
  });
  return {
    sizeProp,
    sizePropIndex,
    relativeSizePropIndex,
    meta: {
      originalMaxSizeProp,
      originalMaxSizePropIndex,
      originalRelativeSizeIndex,
      originalSizes,
      originalMinSizeProp,
      originalMinSizeIndex,
      sizeDeltaString
    },
    ...rest
  };
};
var getRelativeSizeProp = (sizeChange, options) => {
  const { sizeProp } = getRelativeSizePropData(sizeChange, options);
  return sizeProp;
};

// src/utils/hash.ts
function stringToArrayElement(str, arr, fallback) {
  if (!str)
    return fallback;
  const hash = hashCode(str);
  const index = Math.abs(hash % arr.length);
  return arr[index];
}
function hashCode(s) {
  const A = 54059;
  const B = 76963;
  const C = 86969;
  const hash = 37;
  let h = hash;
  for (let i = 0; i < s.length; i++) {
    h = h * A ^ s.charCodeAt(i) * B;
  }
  h = h * C % 4294967296;
  return h;
}

// src/utils/stringToDistinctColorClass.ts
var distinctColors = {
  bg: {
    fallback: "bg-neutral-500",
    colors: [
      "bg-palette-various-blue",
      "bg-palette-various-emerald",
      "bg-palette-various-orange",
      "bg-palette-various-fuchsia",
      "bg-palette-various-yellow",
      "bg-palette-various-rose",
      "bg-palette-various-cyan",
      "bg-palette-various-violet",
      "bg-palette-various-teal",
      "bg-palette-various-pink",
      "bg-palette-various-lime",
      "bg-palette-various-gray"
    ]
  },
  text: {
    fallback: "text-neutral-500",
    colors: [
      "text-palette-various-blue",
      "text-palette-various-emerald",
      "text-palette-various-orange",
      "text-palette-various-fuchsia",
      "text-palette-various-yellow",
      "text-palette-various-rose",
      "text-palette-various-cyan",
      "text-palette-various-violet",
      "text-palette-various-teal",
      "text-palette-various-pink",
      "text-palette-various-lime",
      "text-palette-various-gray"
    ]
  }
};
function stringToDistinctColorClass(str, classTokensMap, options) {
  const { forceDefaultClass } = options ?? {};
  const classTokenKeys = Object.entries(classTokensMap).map(([key, value]) => {
    return value ? key : void 0;
  }).filter(notEmpty2);
  const classArr = classTokenKeys.map((key) => {
    const { colors, fallback: defaultFallback } = distinctColors[key];
    const defaultClassTokenValue = classTokensMap[key];
    const defaultClassToken = typeof defaultClassTokenValue === "string" ? defaultClassTokenValue : void 0;
    const fallback = defaultClassToken ?? defaultFallback;
    if (forceDefaultClass) {
      return fallback;
    }
    const element = stringToArrayElement(str, colors, fallback);
    return element;
  });
  return classArr.join(" ");
}

// src/utils/buildId.ts
function buildId(parts, options = { separator: "::" }) {
  return parts.filter(notEmpty2).join(options.separator);
}
function getTruncatedName(name, { maxLength = 20, truncatedStyle = "FL" }) {
  const { firstName = "", middleName = "", lastName = "", fullName = "" } = getNameParts(name);
  const [F = "", M = "", L = ""] = [firstName, middleName, lastName].map((name2) => {
    if (!name2)
      return "";
    return name2[0]?.toUpperCase();
  });
  function withPeriod(input) {
    return input ? `${input}.` : "";
  }
  const truncatedName = exhaustive(truncatedStyle, {
    F: () => F,
    M: () => M,
    L: () => `${L}`,
    FL: () => `${F}${L}`,
    FML: () => `${F}${M}${L}`,
    "Firstname L.": () => `${firstName} ${withPeriod(L)}`,
    "F. Lastname": () => `${withPeriod(firstName)} ${middleName} ${lastName}`,
    "Firstname Lastname": () => `${firstName} ${lastName}`,
    "Firstname M. Lastname": () => `${firstName} ${withPeriod(M)} ${lastName}`,
    "Firstname Middlename Lastname": () => `${firstName} ${middleName} ${lastName}`,
    Firstname: () => F,
    Lastname: () => `${firstName} ${middleName} ${lastName}`,
    Middlename: () => middleName,
    none: () => fullName,
    _: () => fullName
  }).trim();
  return truncate(truncatedName, { length: maxLength, omission: "..." });
}
function getNameParts(name) {
  if (typeof name === "string") {
    const nameParts = name.trim().split(" ");
    const [firstName2, ...rest] = nameParts;
    const middleName2 = rest.length > 1 ? rest[0] : void 0;
    const lastName2 = rest[rest.length - 1];
    const fullName2 = nameParts.join(" ");
    return {
      firstName: firstName2,
      lastName: lastName2,
      middleName: middleName2,
      fullName: fullName2
    };
  }
  const { firstName, middleName, lastName, fullName } = name;
  return {
    firstName,
    middleName,
    lastName,
    fullName: fullName ?? [firstName, middleName, lastName].filter(Boolean).join(" ")
  };
}
var stringCaseFns = {
  param: paramCase,
  capital: capitalCase,
  capitalize: upperFirst,
  camel: camelCase,
  dot: dotCase,
  header: headerCase,
  noCase,
  path: pathCase,
  constant: constantCase,
  sentence: sentenceCase,
  snake: snakeCase,
  pascal: pascalCase
};
function changeCase(str, stringCase) {
  if (typeof str !== "string") {
    return void 0;
  }
  const caseFn = stringCaseFns[stringCase];
  return caseFn(str);
}

// src/utils/noopCx.ts
function noopCx(v) {
  return v;
}
var twMerge = extendTailwindMerge({
  classGroups: {
    "font-size": [
      {
        // Fixes incorect merging of text size
        text: ["h1", "h2", "h3", "h4", "h5", "h6"]
      }
    ]
  }
});
var { classed } = createClassed({ merger: twMerge });
var { classed: classedCore } = createClassed$1({ merger: twMerge });
var classedVariantMap = (variantMap) => variantMap;
var classTheme = (props) => {
  return clsx2(props.class, props.light, props.dark);
};
function relativeSizeVariants(options) {
  const { delta, variants, overrides } = options;
  const relativeSizeVariants2 = mapValues(variants, (_, size) => {
    const { sizeProp: decreasedSize } = getRelativeSizePropData(delta, {
      relativeSize: size
    });
    return variants[decreasedSize];
  });
  return { ...relativeSizeVariants2, ...overrides };
}
function generateCompoundVariants(compoundVariantPropMap) {
  const { commonVariantProps, compoundVariantMapLists } = transform(
    compoundVariantPropMap,
    (result, value, key) => {
      if (typeof value === "boolean" || typeof value === "string") {
        result.commonVariantProps[key] = value;
        return result;
      }
      const compoundVariantMapList = map(value, (className, variantMapKey) => ({
        [key]: variantMapKey,
        class: className
      }));
      result.compoundVariantMapLists.push(compoundVariantMapList);
      return result;
    },
    {
      commonVariantProps: {},
      compoundVariantMapLists: []
    }
  );
  return compoundVariantMapLists.flat().map(({ class: cls, ...props }) => {
    return {
      ...commonVariantProps,
      class: twMerge(cls, compoundVariantPropMap.className),
      ...props
    };
  });
}
var expandVariant = createVariatGroupTransfomer({});
var expandVariantMap = (variantMaps) => {
  const variantGroupString = (variant, str) => `${variant}${variant.startsWith(":") ? ":" : ""}(${str})`;
  const { expandEntries, classNameEntries } = variantMaps.reduce(
    (acc, entry) => {
      const [k, v] = entry;
      if (["className", "@"].find((e) => e === k)) {
        acc.classNameEntries.push([k, v]);
        return acc;
      }
      acc.expandEntries.push([k, v]);
      return acc;
    },
    { expandEntries: [], classNameEntries: [] }
  );
  const expandedVariants = expandEntries.map(([variant, str]) => {
    const classString = clsx2(str);
    const className2 = classString.split(" ").map((e) => {
      const str2 = e.trim();
      return str2 || void 0;
    }).filter(notEmpty2).join(",");
    const variantString = variantGroupString(variant, className2);
    return expandVariant(variantString);
  }).filter(notEmpty2);
  const expandedVariantClassName = expandedVariants.join(" ").trim();
  const className = classNameEntries.map((e) => clsx2(e[1])).join(" ");
  return twMerge$1(className, expandedVariantClassName);
};
function mergeVariants(variants, overrides) {
  const variantArray = Array.isArray(variants) ? variants : Object.values(variants);
  const mergerFn = (objectValue, sourceValue) => twMerge$1(`${objectValue || ""}`, `${sourceValue}`);
  const mergedVariants = mergeWith({}, ...[...variantArray, overrides], mergerFn);
  return mergedVariants;
}
function cx(...inputs) {
  return twMerge$1(clsx(inputs));
}

export { DARK_MODE, DEFAULT_THEME, LIGHT_MODE, buildId, changeCase, classTheme, classed, classedCore, classedVariantMap, config_exports as config, cx, expandVariant, expandVariantMap, generateCompoundVariants, generatePropPickerFn, getRelativeElementData, getRelativeSizeProp, getRelativeSizePropData, getTruncatedName, mergeVariants, noopCx, notEmpty2 as notEmpty, notEmptyEntry, notFalsy, objectMap2 as objectMap, p, pickProps, relativeSizeVariants, stringToArrayElement, stringToDistinctColorClass, toArray, transformKeys, useBreakpoints, useDarkMode, useIsDarkMode };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=helpers.js.map