import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE__ant_design_cssinjs__ from "@ant-design/cssinjs";
import * as __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__ from "./hooks/index.mjs";
const genCommonStyle = (token, componentPrefixCls)=>{
    const { fontFamily, fontSize } = token;
    const rootPrefixSelector = '[class^="'.concat(componentPrefixCls, '"], [class*=" ').concat(componentPrefixCls, '"]');
    return {
        [rootPrefixSelector]: {
            fontFamily,
            fontSize,
            boxSizing: 'border-box',
            '&::before, &::after': {
                boxSizing: 'border-box'
            },
            [rootPrefixSelector]: {
                boxSizing: 'border-box',
                '&::before, &::after': {
                    boxSizing: 'border-box'
                }
            }
        }
    };
};
const genStyleHook = (component, styleFn)=>(props)=>{
        const { theme, token, hashId } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.useToken)();
        const { getPrefixCls, iconPrefixCls } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.useConfig)();
        const prefixCls = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.usePrefixCls)(component);
        const rootPrefixCls = getPrefixCls();
        const wrapSSR = (0, __WEBPACK_EXTERNAL_MODULE__ant_design_cssinjs__.useStyleRegister)({
            theme: theme,
            token,
            hashId,
            path: [
                'formily-antd',
                component,
                prefixCls,
                iconPrefixCls
            ]
        }, ()=>{
            const componentCls = ".".concat(prefixCls);
            const mergedToken = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.merge)(token, {
                componentCls,
                prefixCls,
                iconCls: ".".concat(iconPrefixCls),
                antCls: ".".concat(rootPrefixCls)
            });
            const styleInterpolation = styleFn(mergedToken, props, {
                hashId,
                prefixCls,
                rootPrefixCls,
                iconPrefixCls
            });
            return [
                genCommonStyle(token, prefixCls),
                styleInterpolation
            ];
        });
        return {
            wrapSSR,
            hashId,
            componentCls: prefixCls,
            rootPrefixCls
        };
    };
export { genCommonStyle, genStyleHook };
