function _array_like_to_array(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
function _array_with_holes(arr) {
    if (Array.isArray(arr)) return arr;
}
function _array_without_holes(arr) {
    if (Array.isArray(arr)) return _array_like_to_array(arr);
}
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 _iterable_to_array(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _iterable_to_array_limit(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
        for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
            _arr.push(_s.value);
            if (i && _arr.length === i) break;
        }
    } catch (err) {
        _d = true;
        _e = err;
    } finally{
        try {
            if (!_n && _i["return"] != null) _i["return"]();
        } finally{
            if (_d) throw _e;
        }
    }
    return _arr;
}
function _non_iterable_rest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _non_iterable_spread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
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;
}
function _object_without_properties(source, excluded) {
    if (source == null) return {};
    var target = {}, sourceKeys, key, i;
    if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
        sourceKeys = Reflect.ownKeys(source);
        for(i = 0; i < sourceKeys.length; i++){
            key = sourceKeys[i];
            if (excluded.indexOf(key) >= 0) continue;
            if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
            target[key] = source[key];
        }
        return target;
    }
    target = _object_without_properties_loose(source, excluded);
    if (Object.getOwnPropertySymbols) {
        sourceKeys = Object.getOwnPropertySymbols(source);
        for(i = 0; i < sourceKeys.length; i++){
            key = sourceKeys[i];
            if (excluded.indexOf(key) >= 0) continue;
            if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
            target[key] = source[key];
        }
    }
    return target;
}
function _object_without_properties_loose(source, excluded) {
    if (source == null) return {};
    var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
    for(i = 0; i < sourceKeys.length; i++){
        key = sourceKeys[i];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
    }
    return target;
}
function _sliced_to_array(arr, i) {
    return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
function _to_consumable_array(arr) {
    return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
}
function _unsupported_iterable_to_array(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _array_like_to_array(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(n);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
import { BoxAndWiskers, BoxPlotController } from "@sgratzl/chartjs-chart-boxplot";
import { ConfigProvider } from "antd";
import { CategoryScale, Chart as ChartJS, Legend, LinearScale, Tooltip } from "chart.js";
import classNames from "clsx";
import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
import { Chart } from "react-chartjs-2";
import ChartStatistic from "../ChartStatistic";
import { ChartContainer, ChartFilter, ChartToolBar, downloadChart } from "../components";
import { defaultColorList } from "../const";
import { useDetectTheme } from "../hooks";
import { hexToRgba, resolveCssVariable } from "../utils";
import { useStyle } from "./style";
var boxPlotChartComponentsRegistered = false;
/**
 * 计算箱线图统计值
 */ function calculateBoxPlotStats(values) {
    var _Math, _Math1;
    if (!values || values.length === 0) {
        return {
            min: 0,
            q1: 0,
            median: 0,
            q3: 0,
            max: 0,
            mean: 0,
            outliers: []
        };
    }
    // 过滤有效数值并排序
    var sorted = values.filter(function(v) {
        return typeof v === 'number' && Number.isFinite(v);
    }).sort(function(a, b) {
        return a - b;
    });
    if (sorted.length === 0) {
        return {
            min: 0,
            q1: 0,
            median: 0,
            q3: 0,
            max: 0,
            mean: 0,
            outliers: []
        };
    }
    var n = sorted.length;
    var mean = sorted.reduce(function(a, b) {
        return a + b;
    }, 0) / n;
    // 计算四分位数
    var q1Index = Math.floor(n * 0.25);
    var medianIndex = Math.floor(n * 0.5);
    var q3Index = Math.floor(n * 0.75);
    var q1 = sorted[q1Index];
    var median = sorted[medianIndex];
    var q3 = sorted[q3Index];
    // 计算 IQR 和异常值边界
    var iqr = q3 - q1;
    var lowerBound = q1 - 1.5 * iqr;
    var upperBound = q3 + 1.5 * iqr;
    // 找出非异常值的范围
    var nonOutliers = sorted.filter(function(v) {
        return v >= lowerBound && v <= upperBound;
    });
    var outliers = sorted.filter(function(v) {
        return v < lowerBound || v > upperBound;
    });
    var min = nonOutliers.length > 0 ? (_Math = Math).min.apply(_Math, _to_consumable_array(nonOutliers)) : sorted[0];
    var max = nonOutliers.length > 0 ? (_Math1 = Math).max.apply(_Math1, _to_consumable_array(nonOutliers)) : sorted[n - 1];
    return {
        min: min,
        q1: q1,
        median: median,
        q3: q3,
        max: max,
        mean: mean,
        outliers: outliers
    };
}
var BoxPlotChart = function BoxPlotChart(_0) {
    var title = _0.title, data = _0.data, _0_width = _0.width, width = _0_width === void 0 ? 600 : _0_width, _0_height = _0.height, height = _0_height === void 0 ? 400 : _0_height, className = _0.className, classNamesProp = _0.classNames, style = _0.style, styles = _0.styles, dataTime = _0.dataTime, theme = _0.theme, color = _0.color, _0_showLegend = _0.showLegend, showLegend = _0_showLegend === void 0 ? true : _0_showLegend, _0_legendPosition = _0.legendPosition, legendPosition = _0_legendPosition === void 0 ? 'bottom' : _0_legendPosition, _0_showGrid = _0.showGrid, showGrid = _0_showGrid === void 0 ? true : _0_showGrid, xAxisLabel = _0.xAxisLabel, yAxisLabel = _0.yAxisLabel, _0_showOutliers = _0.showOutliers, showOutliers = _0_showOutliers === void 0 ? true : _0_showOutliers, toolbarExtra = _0.toolbarExtra, _0_renderFilterInToolbar = _0.renderFilterInToolbar, renderFilterInToolbar = _0_renderFilterInToolbar === void 0 ? false : _0_renderFilterInToolbar, statisticConfig = _0.statistic, _0_loading = _0.loading, loading = _0_loading === void 0 ? false : _0_loading, props = _object_without_properties(_0, [
        "title",
        "data",
        "width",
        "height",
        "className",
        "classNames",
        "style",
        "styles",
        "dataTime",
        "theme",
        "color",
        "showLegend",
        "legendPosition",
        "showGrid",
        "xAxisLabel",
        "yAxisLabel",
        "showOutliers",
        "toolbarExtra",
        "renderFilterInToolbar",
        "statistic",
        "loading"
    ]);
    // 注册 Chart.js 组件
    useMemo(function() {
        if (boxPlotChartComponentsRegistered) {
            return undefined;
        }
        if (typeof window === 'undefined') {
            return undefined;
        }
        ChartJS.register(CategoryScale, LinearScale, Tooltip, Legend, BoxPlotController, BoxAndWiskers);
        boxPlotChartComponentsRegistered = true;
        return undefined;
    }, []);
    var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
    var prefixCls = getPrefixCls('boxplot-chart');
    var _useStyle = useStyle(prefixCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
    // 处理 ChartStatistic 组件配置
    var statistics = useMemo(function() {
        if (!statisticConfig) return null;
        if (Array.isArray(statisticConfig) && statisticConfig.length === 0) return null;
        return Array.isArray(statisticConfig) ? statisticConfig : [
            statisticConfig
        ];
    }, [
        statisticConfig
    ]);
    // 响应式尺寸计算
    var _useState = _sliced_to_array(useState(typeof window !== 'undefined' ? window.innerWidth : 768), 2), windowWidth = _useState[0], setWindowWidth = _useState[1];
    var isMobile = windowWidth <= 768;
    var responsiveWidth = isMobile ? '100%' : width;
    var responsiveHeight = isMobile ? Math.min(windowWidth * 0.8, 400) : height;
    // 监听窗口大小变化
    useEffect(function() {
        var handleResize = function handleResize() {
            setWindowWidth(window.innerWidth);
        };
        if (typeof window !== 'undefined') {
            window.addEventListener('resize', handleResize);
            return function() {
                return window.removeEventListener('resize', handleResize);
            };
        }
    }, []);
    var chartRef = useRef(null);
    // 数据安全检查
    var safeData = Array.isArray(data) ? data : [];
    // 从数据中提取分类
    var categories = useMemo(function() {
        var uniqueCategories = _to_consumable_array(new Set(safeData.map(function(item) {
            return item === null || item === void 0 ? void 0 : item.category;
        }))).filter(Boolean);
        return uniqueCategories;
    }, [
        safeData
    ]);
    // 从数据中提取 filterLabel
    var validFilterLabels = useMemo(function() {
        return safeData.map(function(item) {
            return item === null || item === void 0 ? void 0 : item.filterLabel;
        }).filter(function(filterLabel) {
            return filterLabel !== undefined;
        });
    }, [
        safeData
    ]);
    var filterLabels = useMemo(function() {
        return validFilterLabels.length > 0 ? _to_consumable_array(new Set(validFilterLabels)) : undefined;
    }, [
        validFilterLabels
    ]);
    // 状态管理
    var _useState1 = _sliced_to_array(useState(categories.find(Boolean) || ''), 2), selectedFilter = _useState1[0], setSelectedFilter = _useState1[1];
    var _useState2 = _sliced_to_array(useState(filterLabels && filterLabels.length > 0 ? filterLabels[0] : undefined), 2), selectedFilterLabel = _useState2[0], setSelectedFilterLabel = _useState2[1];
    // 当数据变化导致当前选中分类失效时，自动回退
    useEffect(function() {
        if (selectedFilter && !categories.includes(selectedFilter)) {
            setSelectedFilter(categories.find(Boolean) || '');
        }
    }, [
        categories,
        selectedFilter
    ]);
    // 筛选数据
    var filteredData = useMemo(function() {
        var base = selectedFilter ? safeData.filter(function(item) {
            return item.category === selectedFilter;
        }) : safeData;
        var withFilterLabel = !filterLabels || !selectedFilterLabel ? base : base.filter(function(item) {
            return item.filterLabel === selectedFilterLabel;
        });
        return withFilterLabel.filter(function(item) {
            return item && item.label !== null && item.label !== undefined && item.label !== '';
        });
    }, [
        safeData,
        selectedFilter,
        filterLabels,
        selectedFilterLabel
    ]);
    // 从数据中提取唯一的类型
    var types = useMemo(function() {
        return _to_consumable_array(new Set(filteredData.map(function(item) {
            return item.type;
        }))).filter(Boolean);
    }, [
        filteredData
    ]);
    // 从数据中提取唯一的标签
    var labels = useMemo(function() {
        return _to_consumable_array(new Set(filteredData.map(function(item) {
            return item.label;
        })));
    }, [
        filteredData
    ]);
    // 构建 Chart.js 数据结构
    var processedData = useMemo(function() {
        var datasets = types.map(function(type, index) {
            var provided = color;
            var pickByIndex = function pickByIndex(i) {
                return Array.isArray(provided) ? provided[i] || provided[0] || defaultColorList[i % defaultColorList.length] : provided || defaultColorList[i % defaultColorList.length];
            };
            var baseColor = pickByIndex(index);
            // 解析 CSS 变量为实际颜色值
            var resolvedBaseColor = resolveCssVariable(baseColor);
            // 为每个标签收集数据
            var typeData = labels.map(function(label) {
                var dataPoint = filteredData.find(function(item) {
                    return item.label === label && item.type === type;
                });
                if (!dataPoint || !dataPoint.values || dataPoint.values.length === 0) {
                    return null;
                }
                var stats = calculateBoxPlotStats(dataPoint.values);
                return _object_spread({
                    min: stats.min,
                    q1: stats.q1,
                    median: stats.median,
                    q3: stats.q3,
                    max: stats.max,
                    mean: stats.mean
                }, showOutliers && stats.outliers.length > 0 ? {
                    outliers: stats.outliers
                } : {});
            });
            return {
                label: type || '默认',
                data: typeData,
                backgroundColor: hexToRgba(resolvedBaseColor, 0.5),
                borderColor: resolvedBaseColor,
                borderWidth: 1,
                outlierColor: hexToRgba(resolvedBaseColor, 0.8),
                padding: 10,
                itemRadius: showOutliers ? 3 : 0
            };
        });
        // 如果没有类型分组，创建默认数据集
        if (datasets.length === 0) {
            var boxplotData = labels.map(function(label) {
                var dataPoint = filteredData.find(function(item) {
                    return item.label === label;
                });
                if (!dataPoint || !dataPoint.values || dataPoint.values.length === 0) {
                    return null;
                }
                var stats = calculateBoxPlotStats(dataPoint.values);
                return _object_spread({
                    min: stats.min,
                    q1: stats.q1,
                    median: stats.median,
                    q3: stats.q3,
                    max: stats.max,
                    mean: stats.mean
                }, showOutliers && stats.outliers.length > 0 ? {
                    outliers: stats.outliers
                } : {});
            });
            var resolvedColor = resolveCssVariable(defaultColorList[0]);
            datasets.push({
                label: '默认',
                data: boxplotData,
                backgroundColor: hexToRgba(resolvedColor, 0.5),
                borderColor: resolvedColor,
                borderWidth: 1,
                outlierColor: hexToRgba(resolvedColor, 0.8),
                padding: 10,
                itemRadius: showOutliers ? 3 : 0
            });
        }
        return {
            labels: labels,
            datasets: datasets
        };
    }, [
        filteredData,
        types,
        labels,
        color,
        showOutliers
    ]);
    var detectedTheme = useDetectTheme();
    var resolvedTheme = theme !== null && theme !== void 0 ? theme : detectedTheme;
    var isLight = resolvedTheme === 'light';
    var axisTextColor = isLight ? 'rgba(0, 25, 61, 0.3255)' : 'rgba(255, 255, 255, 0.8)';
    var gridColor = isLight ? 'rgba(0,0,0,0.08)' : 'rgba(255,255,255,0.2)';
    // 图表配置选项
    var options = {
        responsive: true,
        maintainAspectRatio: false,
        plugins: {
            legend: {
                display: showLegend && types.length > 1,
                position: legendPosition,
                labels: {
                    color: axisTextColor,
                    font: {
                        size: isMobile ? 10 : 12,
                        weight: 'normal'
                    },
                    padding: isMobile ? 10 : 12,
                    usePointStyle: true,
                    pointStyle: 'rectRounded'
                }
            },
            tooltip: {
                backgroundColor: isLight ? 'rgba(255,255,255,0.95)' : 'rgba(0,0,0,0.85)',
                titleColor: isLight ? '#333' : '#fff',
                bodyColor: isLight ? '#333' : '#fff',
                borderColor: isLight ? 'rgba(0,0,0,0.12)' : 'rgba(255,255,255,0.2)',
                borderWidth: 1,
                cornerRadius: isMobile ? 6 : 8,
                displayColors: true,
                callbacks: {
                    label: function label(context) {
                        var _ref, _ref1, _ref2, _ref3, _ref4;
                        var _raw_max, _raw_q3, _raw_median, _raw_q1, _raw_min;
                        var raw = context.raw;
                        if (!raw) return '';
                        var lines = [
                            "最大值: ".concat((_ref = (_raw_max = raw.max) === null || _raw_max === void 0 ? void 0 : _raw_max.toFixed(2)) !== null && _ref !== void 0 ? _ref : '-'),
                            "Q3: ".concat((_ref1 = (_raw_q3 = raw.q3) === null || _raw_q3 === void 0 ? void 0 : _raw_q3.toFixed(2)) !== null && _ref1 !== void 0 ? _ref1 : '-'),
                            "中位数: ".concat((_ref2 = (_raw_median = raw.median) === null || _raw_median === void 0 ? void 0 : _raw_median.toFixed(2)) !== null && _ref2 !== void 0 ? _ref2 : '-'),
                            "Q1: ".concat((_ref3 = (_raw_q1 = raw.q1) === null || _raw_q1 === void 0 ? void 0 : _raw_q1.toFixed(2)) !== null && _ref3 !== void 0 ? _ref3 : '-'),
                            "最小值: ".concat((_ref4 = (_raw_min = raw.min) === null || _raw_min === void 0 ? void 0 : _raw_min.toFixed(2)) !== null && _ref4 !== void 0 ? _ref4 : '-')
                        ];
                        if (raw.mean !== undefined) {
                            lines.push("均值: ".concat(raw.mean.toFixed(2)));
                        }
                        return lines;
                    }
                }
            }
        },
        scales: {
            x: {
                display: true,
                title: {
                    display: !!xAxisLabel,
                    text: xAxisLabel || '',
                    color: axisTextColor,
                    font: {
                        size: isMobile ? 10 : 12,
                        weight: 'normal'
                    }
                },
                grid: {
                    display: showGrid,
                    color: gridColor,
                    lineWidth: 1
                },
                ticks: {
                    color: axisTextColor,
                    font: {
                        size: isMobile ? 10 : 12
                    }
                }
            },
            y: {
                display: true,
                title: {
                    display: !!yAxisLabel,
                    text: yAxisLabel || '',
                    color: axisTextColor,
                    font: {
                        size: isMobile ? 10 : 12,
                        weight: 'normal'
                    }
                },
                grid: {
                    display: showGrid,
                    color: gridColor,
                    lineWidth: 1
                },
                ticks: {
                    color: axisTextColor,
                    font: {
                        size: isMobile ? 10 : 12
                    }
                }
            }
        },
        animation: {
            duration: isMobile ? 200 : 400
        }
    };
    var handleDownload = function handleDownload() {
        downloadChart(chartRef.current, 'boxplot-chart');
    };
    // 筛选器选项
    var filterOptions = useMemo(function() {
        return categories.map(function(category) {
            return {
                label: category || '默认',
                value: category || '默认'
            };
        });
    }, [
        categories
    ]);
    var filteredDataByFilterLabel = useMemo(function() {
        return filterLabels === null || filterLabels === void 0 ? void 0 : filterLabels.map(function(item) {
            return {
                key: item,
                label: item
            };
        });
    }, [
        filterLabels
    ]);
    // 空数据处理
    if (safeData.length === 0 || labels.length === 0) {
        return wrapSSR(/*#__PURE__*/ React.createElement(ChartContainer, {
            baseClassName: classNames("".concat(prefixCls, "-container"), hashId),
            theme: resolvedTheme,
            className: classNames(classNamesProp === null || classNamesProp === void 0 ? void 0 : classNamesProp.root, className),
            isMobile: isMobile,
            variant: props.variant,
            style: _object_spread({
                width: responsiveWidth,
                height: responsiveHeight
            }, style, styles === null || styles === void 0 ? void 0 : styles.root)
        }, /*#__PURE__*/ React.createElement(ChartToolBar, {
            title: title || '箱线图',
            onDownload: function onDownload() {},
            extra: toolbarExtra,
            dataTime: dataTime,
            loading: loading
        }), /*#__PURE__*/ React.createElement("div", {
            className: classNames("".concat(prefixCls, "-empty-wrapper"), hashId),
            style: {
                display: 'flex',
                alignItems: 'center',
                justifyContent: 'center',
                height: responsiveHeight,
                color: '#999',
                fontSize: '14px'
            }
        }, "暂无有效数据")));
    }
    return wrapSSR(/*#__PURE__*/ React.createElement(ChartContainer, {
        baseClassName: classNames("".concat(prefixCls, "-container"), hashId),
        theme: resolvedTheme,
        className: classNames(classNamesProp === null || classNamesProp === void 0 ? void 0 : classNamesProp.root, className),
        isMobile: isMobile,
        variant: props.variant,
        style: _object_spread({
            width: responsiveWidth,
            height: responsiveHeight
        }, style, styles === null || styles === void 0 ? void 0 : styles.root)
    }, /*#__PURE__*/ React.createElement(ChartToolBar, {
        title: title || '箱线图',
        theme: resolvedTheme,
        onDownload: handleDownload,
        extra: toolbarExtra,
        dataTime: dataTime,
        loading: loading,
        filter: renderFilterInToolbar && filterOptions.length > 1 ? /*#__PURE__*/ React.createElement(ChartFilter, _object_spread_props(_object_spread({
            filterOptions: filterOptions,
            selectedFilter: selectedFilter,
            onFilterChange: setSelectedFilter
        }, filterLabels && {
            customOptions: filteredDataByFilterLabel,
            selectedCustomSelection: selectedFilterLabel,
            onSelectionChange: setSelectedFilterLabel
        }), {
            theme: resolvedTheme,
            variant: "compact"
        })) : undefined
    }), statistics && /*#__PURE__*/ React.createElement("div", {
        className: classNames(classNamesProp === null || classNamesProp === void 0 ? void 0 : classNamesProp.statisticContainer, "".concat(prefixCls, "-statistic-container")),
        style: styles === null || styles === void 0 ? void 0 : styles.statisticContainer
    }, statistics.map(function(config, index) {
        return /*#__PURE__*/ React.createElement(ChartStatistic, _object_spread_props(_object_spread({
            key: index
        }, config), {
            theme: resolvedTheme
        }));
    })), !renderFilterInToolbar && filterOptions.length > 1 && /*#__PURE__*/ React.createElement(ChartFilter, _object_spread_props(_object_spread({
        filterOptions: filterOptions,
        selectedFilter: selectedFilter,
        onFilterChange: setSelectedFilter
    }, filterLabels && {
        customOptions: filteredDataByFilterLabel,
        selectedCustomSelection: selectedFilterLabel,
        onSelectionChange: setSelectedFilterLabel
    }), {
        theme: resolvedTheme
    })), /*#__PURE__*/ React.createElement("div", {
        className: classNames(classNamesProp === null || classNamesProp === void 0 ? void 0 : classNamesProp.wrapper, "".concat(prefixCls, "-wrapper")),
        style: _object_spread({
            height: responsiveHeight
        }, styles === null || styles === void 0 ? void 0 : styles.wrapper)
    }, /*#__PURE__*/ React.createElement(Chart, {
        ref: chartRef,
        type: "boxplot",
        data: processedData,
        options: options
    }))));
};
export default BoxPlotChart;
