function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
import { MOBILE_BREAKPOINT } from "../Constants/mobile";
import { resetComponent, useEditorStyleRegister } from "../Hooks/useStyle";
var genStyle = function(token) {
    return _define_property({}, token.componentCls, {
        boxSizing: 'border-box',
        height: 'max-content',
        maxWidth: '100%',
        outline: 'none',
        tabSize: 4,
        position: 'relative',
        lineHeight: 1.7,
        whiteSpace: 'normal',
        // 主容器默认样式
        display: 'flex',
        flexDirection: 'column',
        maxHeight: '100%',
        font: 'var(--font-text-paragraph-lg)',
        letterSpacing: 'var(--letter-spacing-paragraph-lg, normal)',
        color: 'var(--color-gray-text-default)',
        // 全局样式
        '*': {
            scrollbarWidth: 'thin',
            scrollbarColor: 'hsl(240 5.9% 90%) transparent',
            boxSizing: 'border-box'
        },
        'div[data-composition] div:not([data-no-focus]).empty:first-child::before': {
            display: 'none'
        },
        '> *': {
            boxSizing: 'border-box',
            scrollbarWidth: 'thin',
            fontVariantNumeric: 'tabular-nums',
            WebkitTextSizeAdjust: '100%',
            msTextSizeAdjust: '100%',
            WebkitFontSmoothing: 'antialiased',
            scrollbarColor: 'hsl(#e4e4e7) transparent'
        },
        '&-edit-area': {
            outline: 'none !important'
        },
        '&-toolbar-container': {
            width: '100%',
            maxWidth: '100%',
            position: 'sticky',
            zIndex: 99,
            top: 0
        },
        '&-container': _define_property({
            // 默认 padding，可以通过 contentStyle 覆盖
            // 使用 CSS 变量，允许通过内联样式覆盖
            padding: 'var(--content-padding, 4px 20px)',
            overflow: 'auto',
            display: 'flex',
            position: 'relative',
            gap: 24,
            outline: 'none'
        }, "@media (max-width: ".concat(MOBILE_BREAKPOINT, ")"), {
            padding: 'var(--content-padding, 4px 4px)'
        }),
        '&-content': {},
        '&-focus': {
            height: 64
        }
    });
};
/**
 * BubbleChat
 * @param prefixCls
 * @returns
 */ export function useStyle(prefixCls) {
    return useEditorStyleRegister('MarkdownEditor', function(token) {
        var editorToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            resetComponent(editorToken),
            genStyle(editorToken)
        ];
    });
}
