"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
require("react");
const createVarsResolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs");
require("clsx");
const getThemeColor = require("../../core/MantineProvider/color-functions/get-theme-color/get-theme-color.cjs");
const useProps = require("../../core/MantineProvider/use-props/use-props.cjs");
const useStyles = require("../../core/styles-api/use-styles/use-styles.cjs");
const Box = require("../../core/Box/Box.cjs");
const factory = require("../../core/factory/factory.cjs");
const Code_module_css = require("./Code.module.css.cjs");
const defaultProps = {};
const varsResolver = createVarsResolver.createVarsResolver((theme, { color }) => ({
  root: {
    "--code-bg": color ? getThemeColor.getThemeColor(color, theme) : void 0
  }
}));
const Code = factory.factory((_props, ref) => {
  const props = useProps.useProps("Code", defaultProps, _props);
  const {
    classNames,
    className,
    style,
    styles,
    unstyled,
    vars,
    color,
    block,
    variant,
    mod,
    ...others
  } = props;
  const getStyles = useStyles.useStyles({
    name: "Code",
    props,
    classes: Code_module_css.default,
    className,
    style,
    classNames,
    styles,
    unstyled,
    vars,
    varsResolver
  });
  return /* @__PURE__ */ jsxRuntime.jsx(
    Box.Box,
    {
      component: block ? "pre" : "code",
      variant,
      ref,
      mod: [{ block }, mod],
      ...getStyles("root"),
      ...others,
      dir: "ltr"
    }
  );
});
Code.classes = Code_module_css.default;
Code.displayName = "@mantine/core/Code";
exports.Code = Code;
