import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__ctrl_tinycolor__ from "@ctrl/tinycolor";
import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "../index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__theme_index_mjs__ from "../theme/index.mjs";
const CSSVariableProvider = (param)=>{
    let { children } = param;
    const { token } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useToken)();
    const colorBgScrollTrack = token.colorFillTertiary;
    const colorBgScrollBar = new __WEBPACK_EXTERNAL_MODULE__ctrl_tinycolor__.TinyColor(token.colorFill).onBackground(token.colorFillSecondary).toHexShortString();
    const colorBgScrollBarHover = new __WEBPACK_EXTERNAL_MODULE__ctrl_tinycolor__.TinyColor(token.colorFill).onBackground(token.colorFill).toHexShortString();
    const colorBgScrollBarActive = new __WEBPACK_EXTERNAL_MODULE__ctrl_tinycolor__.TinyColor(token.colorFill).onBackground(token.colorFill).onBackground(token.colorFill).toHexShortString();
    const colorBgDrawer = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
        const colorBgElevated = new __WEBPACK_EXTERNAL_MODULE__ctrl_tinycolor__.TinyColor(token.colorBgElevated);
        return colorBgElevated.isDark() ? token.colorBgElevated : colorBgElevated.darken(4).toHexString();
    }, [
        token.colorBgElevated
    ]);
    (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
        document.body.style.setProperty('--tb-spacing', "".concat(token.marginLG, "px"));
        document.body.style.setProperty('--tb-designer-offset', "".concat(token.marginXS, "px"));
        document.body.style.setProperty('--tb-header-height', "".concat(token.sizeXXL - 2, "px"));
        document.body.style.setProperty('--tb-box-bg', token.colorBgLayout);
        document.body.style.setProperty('--tb-box-bg', token.colorBgLayout);
        document.body.style.setProperty('--controlHeightLG', "".concat(token.controlHeightLG, "px"));
        document.body.style.setProperty('--paddingContentVerticalSM', "".concat(token.paddingContentVerticalSM, "px"));
        document.body.style.setProperty('--marginSM', "".concat(token.marginSM, "px"));
        document.body.style.setProperty('--colorInfoBg', token.colorInfoBg);
        document.body.style.setProperty('--colorInfoBorder', token.colorInfoBorder);
        document.body.style.setProperty('--colorText', token.colorText);
        document.body.style.setProperty('--colorPrimaryText', token.colorPrimaryText);
        document.body.style.setProperty('--colorPrimaryTextActive', token.colorPrimaryTextActive);
        document.body.style.setProperty('--colorPrimaryTextHover', token.colorPrimaryTextHover);
        document.body.style.setProperty('--colorBgScrollTrack', colorBgScrollTrack);
        document.body.style.setProperty('--colorBgScrollBar', colorBgScrollBar);
        document.body.style.setProperty('--colorBgScrollBarHover', colorBgScrollBarHover);
        document.body.style.setProperty('--colorBgScrollBarActive', colorBgScrollBarActive);
        document.body.style.setProperty('--colorBgDrawer', colorBgDrawer);
        document.body.style.setProperty('--colorSettings', token.colorSettings || __WEBPACK_EXTERNAL_MODULE__theme_index_mjs__.defaultTheme.token.colorSettings);
        document.body.style.setProperty('--colorBgSettingsHover', token.colorBgSettingsHover);
        document.body.style.setProperty('--colorBorderSettingsHover', token.colorBorderSettingsHover);
        document.body.style.setProperty('background-color', token.colorBgContainer);
    }, [
        token.marginLG,
        token.colorBgLayout,
        token.sizeXXL,
        token.marginXS,
        token.controlHeightLG,
        token.paddingContentVerticalSM,
        token.marginSM,
        token.colorInfoBg,
        token.colorInfoBorder,
        token.colorText,
        token.colorBgContainer,
        token.colorFillQuaternary,
        token.colorFillSecondary,
        token.colorFill,
        token.colorFillTertiary,
        colorBgScrollTrack,
        colorBgScrollBar,
        colorBgScrollBarHover,
        colorBgScrollBarActive,
        colorBgDrawer,
        token.colorPrimaryText,
        token.colorPrimaryTextActive,
        token.colorPrimaryTextHover,
        token.colorSettings,
        token.colorBgSettingsHover,
        token.colorBorderSettingsHover
    ]);
    return children;
};
CSSVariableProvider.displayName = 'CSSVariableProvider';
const CSSVariableProvider_rslib_entry_ = CSSVariableProvider;
export { CSSVariableProvider, CSSVariableProvider_rslib_entry_ as default };
