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 { useEditorStyleRegister } from "../../../Hooks/useStyle";
var genStyle = function(token) {
    var _obj;
    return _define_property({}, token.componentCls, (_obj = {
        display: 'flex',
        flexDirection: 'column',
        '&-toolbar-wrapper': _define_property({
            marginBottom: 16
        }, "@media (max-width: 768px)", {
            marginBottom: 12
        }),
        '&-content': _define_property({
            display: 'grid',
            gap: 16,
            gridTemplateColumns: 'repeat(auto-fit, minmax(var(--donut-item-min-width, 200px), 1fr))'
        }, "@media (max-width: 480px)", {
            gap: 8
        }),
        '&-toolbar': _define_property({
            display: 'flex',
            justifyContent: 'space-between',
            marginBottom: 8
        }, "@media (max-width: 768px)", {
            flexDirection: 'column',
            gap: 8,
            marginBottom: 6
        }),
        '&-chart-wrapper': _define_property({}, "@media (max-width: 768px)", {
            marginBottom: 12
        }),
        '&-row': _define_property({
            display: 'flex',
            alignItems: 'center',
            flexDirection: 'row'
        }, "@media (max-width: 768px)", {
            flexDirection: 'column',
            alignItems: 'stretch'
        }),
        '&-chart': _define_property({
            width: 'var(--donut-chart-width, 200px)',
            height: 'var(--donut-chart-height, 200px)'
        }, "@media (max-width: 768px)", {
            alignSelf: 'center',
            marginBottom: 8
        }),
        '&-single': _define_property({
            width: '100%',
            height: 'var(--donut-chart-height, 200px)'
        }, "@media (max-width: 768px)", {
            height: 'var(--donut-chart-height, 180px)'
        }),
        '&-legend': _define_property({
            marginLeft: 12
        }, "@media (max-width: 768px)", {
            marginLeft: 0,
            marginTop: 8,
            maxHeight: '120px',
            overflowY: 'auto'
        }),
        '&-legend-item': _define_property({
            display: 'flex',
            alignItems: 'center',
            fontSize: 12,
            padding: '4px 0'
        }, "@media (max-width: 768px)", {
            fontSize: 11,
            marginBottom: 4,
            padding: '4px 0',
            minHeight: '24px'
        }),
        '&-legend-color': _define_property({
            display: 'inline-block',
            width: 12,
            height: 12,
            borderRadius: 4,
            background: 'var(--donut-legend-color, #ccc)',
            marginRight: 6,
            flexShrink: 0
        }, "@media (max-width: 768px)", {
            width: 10,
            height: 10,
            borderRadius: 4,
            marginRight: 4
        }),
        '&-legend-label': _define_property({
            flex: 1,
            color: '#767E8B',
            fontSize: 13,
            whiteSpace: 'nowrap',
            overflow: 'hidden',
            textOverflow: 'ellipsis'
        }, "@media (max-width: 768px)", {
            fontSize: 11,
            flex: '0 1 auto',
            minWidth: '60px'
        }),
        '&-legend-value': _define_property({
            color: '#343A45',
            fontSize: 13,
            fontWeight: 500,
            marginLeft: 15,
            display: 'flex',
            flexDirection: 'column',
            alignItems: 'flex-end'
        }, "@media (max-width: 768px)", {
            fontSize: 11,
            fontWeight: 400,
            marginLeft: 8
        }),
        '&-legend-percent': _define_property({
            marginLeft: 8,
            fontSize: 12,
            color: '#343A45'
        }, "@media (max-width: 768px)", {
            marginLeft: 0,
            fontSize: 10,
            marginTop: 1
        }),
        '&-statistic-container': {
            display: 'flex',
            gap: '16px',
            marginBottom: '16px',
            flexWrap: 'wrap',
            alignItems: 'flex-start'
        }
    }, // 响应式网格调整
    _define_property(_obj, "@media (max-width: 768px)", {
        gap: 12,
        gridTemplateColumns: '1fr'
    }), _define_property(_obj, "@media (max-width: 480px)", {
        gap: 8
    }), _obj));
};
export function useStyle(prefixCls) {
    return useEditorStyleRegister('DonutChart', function(token) {
        var donutToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            genStyle(donutToken)
        ];
    });
}
