"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const useCss = require("./use-css.cjs");
const MantineThemeProvider = require("../../../../../@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs");
const rem = require("../../../../../@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/utils/units-converters/rem.cjs");
const px = require("../../../../../@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/utils/units-converters/px.cjs");
function getStylesRef(refName) {
  return `___ref-${refName || ""}`;
}
function getBreakpointValue(theme, breakpoint) {
  return breakpoint in theme.breakpoints && typeof breakpoint !== "number" ? px.px(theme.breakpoints[breakpoint]) : px.px(breakpoint);
}
const getHelpers = (theme) => ({
  light: '[data-mantine-color-scheme="light"] &',
  dark: '[data-mantine-color-scheme="dark"] &',
  rtl: '[dir="rtl"] &',
  ltr: '[dir="ltr"] &',
  notRtl: '[dir="ltr"] &',
  notLtr: '[dir="rtl"] &',
  ref: getStylesRef,
  smallerThan: (breakpoint) => `@media (max-width: ${rem.em(getBreakpointValue(theme, breakpoint) - 0.1)})`,
  largerThan: (breakpoint) => `@media (min-width: ${rem.em(getBreakpointValue(theme, breakpoint))})`
});
function createStyles(input) {
  const getCssObject = typeof input === "function" ? input : () => input;
  return function useStyles(params) {
    const theme = MantineThemeProvider.useMantineTheme();
    const helpers = getHelpers(theme);
    const cssObject = getCssObject(theme, params, helpers);
    const { css, cx } = useCss.useCss();
    const classes = Object.keys(cssObject).reduce((acc, key) => {
      acc[key] = css(cssObject[key]);
      return acc;
    }, {});
    return { classes, cx, theme };
  };
}
exports.createStyles = createStyles;
exports.getHelpers = getHelpers;
exports.getStylesRef = getStylesRef;
