/* @oracle/oraclejet-preact: undefined */
import { jsx } from 'preact/jsx-runtime';
import { n as getBarGapRatio, o as findNearestDataPoint, p as getStartAndEndAxesOffset } from './utils-24c54d43.js';
import { u as useUser } from './useUser-06d34d19.js';
import { B as BarGroup, g as getBarPosition, a as getSeriesOffsetAndWidth, b as getBarCenterCoordinate } from './BarGroup-3c121a3c.js';
import { g as getNextItemInSeries, a as getPrevItemInSeries, b as getNextItemInGroup, c as getPrevItemInGroup, d as getItemColor } from './dataStyleUtils-82159c06.js';
import { forwardRef } from 'preact/compat';
import { C as Chart } from './Chart-8c63da28.js';
import './themeContract.css-1ffed3bf.js';
import './utils-b1eb54f9.js';
import './colorUtils-b3804ee8.js';
import './_curry1-63949a9b.js';
import './getLocale-1c41e86a.js';
import './stringUtils-0fe25200.js';
import './labelUtils-e347bdbe.js';
import './textUtils-3ed25dd1.js';
import './accUtils-9d5183c4.js';
import './clientHints-a42b510c.js';
import './utils-49903d04.js';
import './datatipUtils-0a36125e.js';
import './clientUtils-cccff45f.js';
import './dimensionUtils-6d5dac30.js';
import './scale-9a834124.js';
import 'preact/hooks';
import './LayerHost-7931b424.js';
import './index-aec1cc7f.js';
import 'preact';
import './UNSAFE_Layer/themes/LayerHostStyles.css.js';
import './LayerHostStyles.styles.css';
import './PRIVATE_Chart/themes/ChartStyles.css.js';
import './ChartStyles.styles.css';
import './classNames-4e12b00d.js';
import './colorUtils-77b8874f.js';
import './TrackResizeContainer-3d7b18b7.js';
import './useSize-3b5c56f5.js';
import './useResizeObserver-13641643.js';
import './useAddBusyState-7a6af61f.js';
import './BusyStateContext-9ee9751d.js';
import './useBusyStateContext-4d3c27c0.js';
import './unsafeDomAccess-453eb74e.js';
import './size-af1e638c.js';
import './UNSAFE_visErrors.js';
import './useTextDimensions-45f79df4.js';
import './useCssVars-bc2527ac.js';
import './useTheme-0e7497db.js';
import './useColorScheme-c4f6caab.js';
import './useScale-434ad939.js';
import './ReferenceLineArea-53129f72.js';
import './PRIVATE_PlotArea/themes/PlotAreaStyles.css.js';
import './PlotAreaStyles.styles.css';
import './hooks/PRIVATE_useVisDnd/themes/VisDndStyles.css.js';
import './VisDndStyles.styles.css';
import './lineUtils-87255164.js';
import './useId-03dbfdf0.js';
import './Axis-e23d7b41.js';
import './PRIVATE_Axis/themes/AxisStyles.css.js';
import './AxisStyles.styles.css';
import './MultilineText-c7d80332.js';
import './PRIVATE_Axis/themes/redwood/AxisTheme.js';
import './PRIVATE_Axis/themes/redwood/AxisBaseTheme.css.js';
import './PRIVATE_Axis/themes/redwood/AxisBaseTheme.styles.css';
import './PRIVATE_Axis/themes/redwood/AxisVariants.css.js';
import './vanilla-extract-recipes-createRuntimeFn.esm-2aaf8c98.js';
import './useComponentTheme-d2f9e47f.js';
import './logger-c92f309c.js';
import './useChartViewport-03efd960.js';
import './eventsUtils-14cb0a49.js';
import './usePinch-301da5f6.js';
import './usePointerGesture-ddf231cc.js';
import './mergeProps-88ea8306.js';
import './useChartNav-49b52017.js';
import './layoutUtils-ec5be703.js';
import './useVisHover-d7a0b2f3.js';
import './ScrollBar-c7a5d361.js';
import './PRIVATE_ChartScrollBar/themes/ScrollBarStyles.css.js';
import './ScrollBarStyles.styles.css';
import './useSelectDrill-f669e729.js';
import './useChartDataCursor-f79f98ec.js';
import './hooks/PRIVATE_useChartDataCursor/themes/DataCursorStyles.css.js';
import './DataCursorStyles.styles.css';
import './Marker-81aae9f0.js';
import './SvgShapesStyles.styles.css';
import './useChartDatatip-8dd22b71.js';
import './useDatatip-4895a07a.js';
import './Layer-535577b5.js';
import './UNSAFE_Layer/themes/LayerStyles.css.js';
import './LayerStyles.styles.css';
import './useThemeInterpolations-e144e8ec.js';
import './theme-63551f30.js';
import './Theme-e6dec6db.js';
import './mergeInterpolations-30cd9a69.js';
import './mergeDeepWithKey-33e3d1be.js';
import './_curry3-577eb45e.js';
import './_curry2-01c87f61.js';
import './_isObject-1fab0f5b.js';
import './useDensity-1acb0153.js';
import './Floating-4a82db94.js';
import './useFloating-b9d680f7.js';
import './positionUtils-f26caad9.js';
import './refUtils-76275c69.js';
import './useOutsideClick-b777a43e.js';
import './arrayUtils-35a58161.js';
import './useModal-953082f2.js';
import './UNSAFE_Floating/themes/redwood/FloatingTheme.js';
import './UNSAFE_Floating/themes/FloatingStyles.css.js';
import './FloatingStyles.styles.css';
import './UNSAFE_Floating/themes/redwood/FloatingBaseTheme.css.js';
import './UNSAFE_Floating/themes/redwood/FloatingBaseTheme.styles.css';
import './UNSAFE_Floating/themes/redwood/FloatingVariants.css.js';
import './vanilla-extract-dynamic.esm-c909758c.js';
import './UNSAFE_Floating/themes/FloatingContract.css.js';
import './useUnsafeDomElementRef-32290273.js';
import './hooks/PRIVATE_useDatatip/themes/useDatatip.css.js';
import './useDatatip.styles.css';
import './VisTabularDatatip-85b00c1b.js';
import './PRIVATE_VisTabularDatatip/themes/VisTabularDatatipStyles.css.js';
import './VisTabularDatatipStyles.styles.css';
import './useChartDrill-e3b9ede4.js';
import './useVisDrill-04536d3b.js';
import './useDoubleTap-4e290707.js';
import './clientUtils-71f2dbaf.js';
import './useSelection-82bec039.js';
import './BaseButton-41068c85.js';
import './useHover-85077adb.js';
import './useToggle-8b7fcefe.js';
import './useActive-fb6d4d52.js';
import './dimensions-e4fbc23d.js';
import './UNSAFE_BaseButton/themes/redwood/BaseButtonTheme.js';
import './UNSAFE_BaseButton/themes/BaseButtonStyles.css.js';
import './BaseButtonStyles.styles.css';
import './UNSAFE_BaseButton/themes/redwood/BaseButtonVariants.css.js';
import './UNSAFE_BaseButton/themes/redwood/BaseButtonBaseTheme.styles.css';
import './BareButton-1e3df7cb.js';
import './useBareButton-ff4bd21e.js';
import './usePress-051f5adb.js';
import './usePressClick-945cc43b.js';
import './TabbableModeContext-7d8ad946.js';
import './useTabbableMode-090ed4b5.js';
import './buttonUtils-55fb1df7.js';
import './id-83adac50.js';
import './useTestId-f24ac480.js';
import './Text-834eb35e.js';
import './UNSAFE_Text/themes/TextStyles.css.js';
import './TextStyles.styles.css';
import './useTranslationBundle-4822502f.js';
import './hooks/PRIVATE_useVisSelection/themes/ClearSelection.css.js';
import './ClearSelection.styles.css';
import './cssUtils-9e0e0351.js';
import './useChartContextMenu-5de82cd7.js';
import './useContextMenu-730d6c12.js';
import './SelectMenuGroupContext-aa1fe822.js';
import './Sheet-f9f8a4a4.js';
import './Modal-c0f730b8.js';
import './UNSAFE_Modal/themes/ModalStyles.css.js';
import './ModalStyles.styles.css';
import './tabbableUtils-c8311ec6.js';
import './head-8f89fe66.js';
import './_arity-be492b9e.js';
import './_isArray-694cc52d.js';
import './_isString-675f1de9.js';
import './popupUtils-51366a29.js';
import './WindowOverlay-7264c44a.js';
import './UNSAFE_WindowOverlay/themes/WindowOverlayStyles.css.js';
import './WindowOverlayStyles.styles.css';
import './UNSAFE_WindowOverlay/themes/WindowOverlayContract.css.js';
import './UNSAFE_WindowOverlay/themes/redwood/WindowOverlayTheme.js';
import './UNSAFE_WindowOverlay/themes/redwood/WindowOverlayBaseTheme.css.js';
import './UNSAFE_WindowOverlay/themes/redwood/WindowOverlayBaseTheme.styles.css';
import './UNSAFE_WindowOverlay/themes/redwood/WindowOverlayVariants.css.js';
import './UNSAFE_Sheet/themes/SheetStyles.css.js';
import './SheetStyles.styles.css';
import './useAnimationStatus-b881f39a.js';
import './useAnimation-fe39685e.js';
import './animationUtils-5f409a6c.js';
import './Dropdown-019aba37.js';
import './keyboardUtils-986fe923.js';
import './usePopupAnimation-96d2bc83.js';
import './popupAnimationUtils-175151d9.js';
import './CollectionInteractionContext-7cf19abc.js';
import './UNSAFE_Dropdown/themes/dropdownStyles.css.js';
import './dropdownStyles.styles.css';
import './useOutsideMousedown-c45c22c0.js';
import './useEffectEvent-1bb008cb.js';
import './UNSAFE_Menu/themes/MenuStyles.css.js';
import './MenuStyles.styles.css';
import './UNSAFE_Menu/themes/DropdownMenuStyles.css.js';
import './DropdownMenuStyles.styles.css';
import './Flex-03129963.js';
import './boxalignment-8980856d.js';
import './boxalignment.styles.css';
import './vanilla-extract-sprinkles-createRuntimeSprinkles.esm-2d655d37.js';
import './flexbox-529f25da.js';
import './flexbox.styles.css';
import './flexitem-7b7f7920.js';
import './flexitem.styles.css';
import './FlexStyles.styles.css';
import './Skeleton-d6f0969e.js';
import './borders-98a63040.js';
import './UNSAFE_Skeleton/themes/redwood/SkeletonTheme.js';
import './UNSAFE_Skeleton/themes/SkeletonStyles.css.js';
import './SkeletonStyles.styles.css';
import './UNSAFE_Skeleton/themes/redwood/SkeletonBaseTheme.css.js';
import './UNSAFE_Skeleton/themes/redwood/SkeletonBaseTheme.styles.css';
import './UNSAFE_Skeleton/themes/redwood/SkeletonVariants.css.js';
import './UNSAFE_Menu/themes/MenuSkeletonStyles.css.js';
import './MenuSkeletonStyles.styles.css';
import './LiveRegion-cebac18d.js';
import './LiveRegionStyles.styles.css';
import './UNSAFE_Menu/themes/redwood/MenuItemTheme.js';
import './UNSAFE_Menu/themes/MenuItemStyles.css.js';
import './MenuItemStyles.styles.css';
import './UNSAFE_Menu/themes/redwood/MenuItemBaseTheme.css.js';
import './UNSAFE_Menu/themes/redwood/MenuItemBaseTheme.styles.css';
import './UNSAFE_Menu/themes/redwood/MenuItemVariants.css.js';
import './MenuItemVariants.styles.css';
import './useInteractionStyle-99e32c23.js';
import './TooltipContentStyles.styles.css';
import './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentBaseTheme.styles.css';
import './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css.js';
import './TooltipContentVariants.styles.css';
import './tooltipUtils-af0abd38.js';
import './EnvironmentProvider-6a0a8212.js';
import './LayerManager-52a26c55.js';
import './IconStyle.styles.css';
import './UNSAFE_Separator/themes/SeparatorStyles.css.js';
import './SeparatorStyles.styles.css';
import './MenuSeparatorStyles.styles.css';
import './UNSAFE_Menu/themes/redwood/MenuSeparatorBaseTheme.styles.css';
import './UNSAFE_Menu/themes/redwood/MenuSeparatorVariants.css.js';
import './useContextMenuGesture-e09f4c69.js';
import './textSelectionUtils-e87a47ff.js';
import './useChartDnd-aa8bc33b.js';
import './utils-8e622bdf.js';
import './useDnd-c5ae190c.js';
import './useTooltip-94af94d4.js';
import './useTooltipControlled-f2cfa454.js';
import './useFocus-38c95977.js';
import './useTouch-4828df25.js';
import './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentTheme.js';
import './hooks/UNSAFE_useTooltip/themes/TooltipContentStyles.css.js';
import './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentBaseTheme.css.js';
import './useChartMarquee-761eb7db.js';
import './useVisDragModeControls-af64848c.js';
import './Button-71c397c6.js';
import './Icon-4983d06e.js';
import './UNSAFE_Icon/themes/IconStyle.css.js';
import './Move-94f6dc8c.js';
import './hooks/PRIVATE_useVisDragModeControls/themes/useVisDragModeControls.css.js';
import './useVisDragModeControls.styles.css';
import './ZoomAlt-6a880eb4.js';
import './ButtonSetSingle-5af3a67b.js';
import './useButtonSetContext-6a483d7f.js';
import './ButtonSet-b7464e9a.js';
import './UNSAFE_ButtonSet/themes/ButtonSetStyles.css.js';
import './ButtonSetStyles.styles.css';
import './ButtonSetPositionContext-5730d367.js';
import './toggleButtonUtils-75e3d781.js';
import './useRovingTabIndexContainer-5992e107.js';
import './ButtonSetItem-280755f3.js';
import './ButtonSetButton-8685c752.js';
import './ToggleButtonLabel-7f53fbee.js';
import './ButtonLabelLayout-1631c997.js';
import './useButtonLabelLayoutTheme-448e671d.js';
import './UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutTheme.js';
import './UNSAFE_ButtonLabelLayout/themes/ButtonLabelLayoutStyles.css.js';
import './ButtonLabelLayoutStyles.styles.css';
import './UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutBaseTheme.css.js';
import './UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutBaseTheme.styles.css';
import './UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutVariants.css.js';
import './ButtonLabelLayoutVariants.styles.css';
import './HiddenAccessible-61197e7c.js';
import './HiddenAccessibleStyles.styles.css';
import './ButtonSetIconButton-c8ed85f9.js';
import './useButtonSetPositionContext-1dc5156a.js';
import './IconToggleButton-808818f5.js';
import './useToggleAction-fc0f5399.js';
import './hooks/PRIVATE_useChartMarquee/themes/useChartMarquee.css.js';
import './useChartMarquee.styles.css';
import './useVisTouchResponse-a59ab166.js';
import './useOverviewContext-79377674.js';
import './OverviewSlidingWindow-a8a4c9ef.js';
import './PRIVATE_VisOverview/themes/VisOverview.css.js';
import './VisOverview.styles.css';
import './DragH-3ab8136b.js';

/**
 * @license
 * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.
 * Licensed under The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 * @ignore
 */
function createStackedGroupNavigator(getDataItem, series, numSeries, stackGroups, getStackGroup, isItemNavigable) {
    const hasMultipleStacks = Array.isArray(stackGroups) && stackGroups.length > 1;
    const seriesToStackIndex = series
        ? series.map((s) => {
            const stackName = getStackGroup(s) ?? 'default';
            const idx = stackGroups.indexOf(stackName);
            return idx >= 0 ? idx : 0;
        })
        : new Array(numSeries).fill(0);
    const stackToSeries = stackGroups.map(() => []);
    for (let i = 0; i < numSeries; i++) {
        const stIdx = seriesToStackIndex[i] ?? 0;
        if (stackToSeries[stIdx]) {
            stackToSeries[stIdx].push(i);
        }
    }
    const itemValue = (seriesIndex, groupIndex) => {
        const it = getDataItem(seriesIndex, groupIndex);
        return it?.value;
    };
    const valueSign = (value) => {
        if (value == null || value === 0)
            return 0;
        return value > 0 ? 1 : -1;
    };
    /**
     * Compute the stacked extreme coordinate for the given series at the given group:
     * - Positive values: cumulative positive sum up to and including this series within its stack (top edge).
     * - Negative values: cumulative negative sum up to and including this series within its stack (bottom edge).
     * - Zero/undefined: 0 (baseline).
     */
    const stackedEdge = (seriesIndex, groupIndex) => {
        const v = itemValue(seriesIndex, groupIndex);
        const sgn = valueSign(v);
        const stIdx = seriesToStackIndex[seriesIndex];
        const seriesInStack = stackToSeries[stIdx] || [];
        let sum = 0;
        for (let i = 0; i < seriesInStack.length; i++) {
            const s = seriesInStack[i];
            const val = itemValue(s, groupIndex);
            if (sgn > 0) {
                // Accumulate only positive contributions
                if ((val ?? 0) > 0)
                    sum += val;
            }
            else {
                // Accumulate only negative contributions
                if ((val ?? 0) < 0)
                    sum += val;
            }
            if (s === seriesIndex)
                break;
        }
        return sum;
    };
    /**
     * Returns all series indices ordered bottom->top by their stacked extreme coordinate
     * for a given group. Ties are broken by series index to provide a stable order.
     */
    const orderedSeriesByStackedEdge = (groupIndex) => Array.from({ length: numSeries }, (_, s) => ({ s, pos: stackedEdge(s, groupIndex) }))
        .sort((a, b) => (a.pos === b.pos ? a.s - b.s : a.pos - b.pos))
        .map((e) => e.s);
    /**
     * In-group navigation across all stacks:
     * - "next": move toward the top (larger stackedEdge)
     * - "prev": move toward the bottom (smaller stackedEdge)
     */
    const moveWithinStack = (info, direction) => {
        const group = info.groupIndex;
        const ordered = orderedSeriesByStackedEdge(group);
        const currIdx = ordered.indexOf(info.seriesIndex);
        if (currIdx === -1)
            return;
        const step = direction === 'next' ? 1 : -1;
        for (let k = currIdx + step; k >= 0 && k < ordered.length; k += step) {
            const nextSeries = ordered[k];
            if (isItemNavigable(nextSeries, group)) {
                return { seriesIndex: nextSeries, groupIndex: group };
            }
        }
        return;
    };
    return {
        hasMultipleStacks,
        moveWithinStack
    };
}

/**
 * @license
 * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.
 * Licensed under The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 * @ignore
 */
/**
 * Get next item in unstacked bar chart.
 * @param info
 * @param viewportEndIndex
 * @param numSeries
 * @param isNavigable
 * @returns
 */
function getNextItem(info, viewportEndIndex, numSeries, isNavigable) {
    const nextItemInGroup = getNextItemInGroup(info, numSeries, isNavigable);
    if (nextItemInGroup)
        return nextItemInGroup;
    if (info.groupIndex < viewportEndIndex) {
        let nextItem = { seriesIndex: 0, groupIndex: info.groupIndex + 1 };
        if (isNavigable(nextItem.seriesIndex, nextItem.groupIndex))
            return nextItem;
        nextItem = getNextItem(nextItem, viewportEndIndex, numSeries, isNavigable);
        if (nextItem)
            return nextItem;
    }
    return;
}
/**
 * Get prev item in unstacked bar chart.
 * @param info
 * @param viewportStartIndex
 * @param numSeries
 * @param isNavigable
 * @returns
 */
function getPreviousItem(info, viewportStartIndex, numSeries, isNavigable) {
    const prevItemInGroup = getPrevItemInGroup(info, isNavigable);
    if (prevItemInGroup)
        return prevItemInGroup;
    if (info.groupIndex > viewportStartIndex) {
        let prevItem = { groupIndex: info.groupIndex - 1, seriesIndex: numSeries - 1 };
        if (isNavigable(prevItem.seriesIndex, prevItem.groupIndex))
            return prevItem;
        prevItem = getPreviousItem(prevItem, viewportStartIndex, numSeries, isNavigable);
        if (prevItem)
            return prevItem;
    }
    return info;
}
function getBarChartNavUtil(getDataItem, series, numSeries, viewportStartIndex, viewportEndIndex, isStacked, isRtl, isHoriz, stackGroups, getStackGroup) {
    const isItemNavigable = (seriesIndex, groupIndex) => {
        const barItem = getDataItem(seriesIndex, groupIndex);
        return Boolean(barItem);
    };
    const getNextChartItem = (itemInfo, arrow) => {
        if (!isStacked &&
            (((arrow === 'ArrowDown' || arrow === 'ArrowUp') && !isHoriz) ||
                ((arrow === 'ArrowLeft' || arrow === 'ArrowRight') && isHoriz))) {
            return itemInfo;
        }
        let newInfo;
        // TODO: this is just to keep typescript happy.
        // figure out consistent typing while doing type cleanup.
        const info = {
            groupIndex: itemInfo.groupIndex,
            seriesIndex: itemInfo.seriesIndex
        };
        if (info.groupIndex < viewportStartIndex) {
            info.groupIndex = viewportStartIndex;
            return info;
        }
        else if (info.groupIndex > viewportEndIndex) {
            info.groupIndex = viewportEndIndex;
            return info;
        }
        if (isStacked) {
            // Stacked-group navigation helpers moved to stackedGroupNavUtils
            const { moveWithinStack } = createStackedGroupNavigator(getDataItem, series, numSeries, stackGroups, getStackGroup, isItemNavigable);
            if ((arrow === 'ArrowLeft' && !isHoriz) || (arrow === 'ArrowUp' && isHoriz)) {
                newInfo =
                    isRtl && !isHoriz
                        ? getNextItemInSeries(info, viewportEndIndex, isItemNavigable)
                        : getPrevItemInSeries(info, viewportStartIndex, isItemNavigable);
            }
            else if ((arrow === 'ArrowRight' && !isHoriz) || (arrow === 'ArrowDown' && isHoriz)) {
                newInfo =
                    isRtl && !isHoriz
                        ? getPrevItemInSeries(info, viewportStartIndex, isItemNavigable)
                        : getNextItemInSeries(info, viewportEndIndex, isItemNavigable);
            }
            else if ((arrow === 'ArrowDown' && !isHoriz) || (arrow === 'ArrowLeft' && isHoriz)) {
                const dir = isRtl && isHoriz ? 'next' : 'prev';
                newInfo = moveWithinStack(info, dir);
            }
            else if ((arrow === 'ArrowUp' && !isHoriz) || (arrow === 'ArrowRight' && isHoriz)) {
                const dir = isRtl && isHoriz ? 'prev' : 'next';
                newInfo = moveWithinStack(info, dir);
            }
        }
        else {
            if (!isHoriz) {
                if (arrow === 'ArrowRight') {
                    newInfo = isRtl
                        ? getPreviousItem(info, viewportStartIndex, numSeries, isItemNavigable)
                        : getNextItem(info, viewportEndIndex, numSeries, isItemNavigable);
                }
                else if (arrow === 'ArrowLeft') {
                    newInfo = isRtl
                        ? getNextItem(info, viewportEndIndex, numSeries, isItemNavigable)
                        : getPreviousItem(info, viewportStartIndex, numSeries, isItemNavigable);
                }
            }
            else {
                if (arrow === 'ArrowDown') {
                    newInfo = getNextItem(info, viewportEndIndex, numSeries, isItemNavigable);
                }
                else if (arrow === 'ArrowUp') {
                    newInfo = getPreviousItem(info, viewportStartIndex, numSeries, isItemNavigable);
                }
            }
        }
        return newInfo || info;
    };
    return getNextChartItem;
}

function OverviewBarChart(props) {
    return (jsx(BarChart, { datatip: () => ({ content: '' }), zoomAndScroll: "off", plotArea: {
            yMajorTick: {
                isRendered: false
            },
            xMajorTick: {}
        }, xAxis: {
            tickLabel: {
                autoRotate: false,
                // @ts-ignore
                isRendered: props.xAxis?.timeAxisType ? true : false
            }
        }, series: props.series, groups: props.groups, getDataItem: props.getDataItem, yAxis: {
            tickLabel: {
                isRendered: false
            }
        }, overview: "off" }));
}

/**
 * A Bar chart displays information graphically using rectangular bars with heights or lengths proportional to the values that they represent,
 * making relationships among the data easier to understand.
 */
const BarChart = forwardRef(({ width, height, selectedIds = [], hiddenIds = [], highlightedIds, hideAndShowBehavior = 'none', orientation = 'vertical', yAxis, xAxis, y2Axis, series, groups, stacking = 'off', getDataItem, selectionMode = 'none', drilling = 'off', dataItemGaps = 0.5, ...props }, ref) => {
    const { direction } = useUser();
    const isRtl = direction === 'rtl';
    const hiddenSet = new Set(hiddenIds);
    const isHoriz = orientation === 'horizontal';
    const timeAxisType = xAxis?.timeAxisType;
    const selectedSet = new Set(selectedIds);
    const highlightedSet = new Set(highlightedIds);
    const isStacked = stacking != 'off';
    const stackLabelStyle = typeof stacking === 'string' ? undefined : stacking.stackLabelStyle;
    const getStackGroup = typeof stacking != 'string' ? stacking.getStackGroup : () => 'default';
    const getStackLabel = typeof stacking === 'object' && stacking.getStackLabel ? stacking.getStackLabel : undefined;
    const getGapRatio = (startIndex, endIndex) => {
        return getBarGapRatio(isStacked, startIndex, endIndex);
    };
    const getNextChartItemFunc = (startIndex, endIndex) => {
        const stackGroups = isStacked
            ? Array.from(new Set(series.map((s) => getStackGroup(s) || 'default')))
            : [];
        return getBarChartNavUtil(getDataItem, series, series.length, startIndex, endIndex, isStacked, isRtl, isHoriz, stackGroups, getStackGroup);
    };
    const isSplitDualY = typeof y2Axis?.split === 'number';
    const getDataItemPos = (xScale, yScale, y2Scale, axisStepWidth, averageGroupZ, gapRatio) => {
        return getBarPosition(series, groups, getDataItem, xScale, yScale, y2Scale, hiddenSet, dataItemGaps, axisStepWidth, averageGroupZ, gapRatio, yAxis?.scale === 'log', isStacked, isRtl, isHoriz, isSplitDualY, getStackGroup, timeAxisType);
    };
    const findNearest = (xScale, yScale, y2Scale, axisStepWidth, averageGroupZ, gapRatio) => {
        const getSeriesDataInfo = getSeriesOffsetAndWidth(axisStepWidth, averageGroupZ, series, getDataItem, gapRatio, dataItemGaps, isStacked, isRtl, isHoriz);
        return findNearestDataPoint(series, groups, xScale, yScale, getDataItem, isStacked, getSeriesDataInfo, getBarCenterCoordinate, yAxis?.scale === 'log', dataItemGaps, hiddenSet, timeAxisType, y2Scale);
    };
    const getMarkerColorAndType = (seriesIndex, groupIndex) => {
        return {
            color: getItemColor(seriesIndex, groupIndex, series, getDataItem),
            type: 'circle'
        };
    };
    const getOffset = (groupCount) => {
        return getStartAndEndAxesOffset(false, false, isHoriz, groupCount, true);
    };
    return (jsx(Chart, { ref: ref, width: width, height: height, yAxis: yAxis, xAxis: xAxis, y2Axis: y2Axis, selectedIds: selectedSet, hiddenIds: hiddenIds, hideAndShowBehavior: hideAndShowBehavior, orientation: orientation, series: series, groups: groups, isStacked: isStacked, getDataItem: getDataItem, stackLabelStyle: stackLabelStyle, selectionMode: selectionMode, getStackGroup: getStackGroup, drilling: drilling, renderGridLinesInFront: false, findNearest: findNearest, getDataItemPos: getDataItemPos, getNavUtil: getNextChartItemFunc, getGapRatio: getGapRatio, getMarkerInfo: getMarkerColorAndType, isRtl: isRtl, getStartAndEndAxesOffset: getOffset, defaultOverviewContentRenderer: () => {
            return jsx(OverviewBarChart, { series: series, groups: groups, getDataItem: getDataItem });
        }, ...props, children: ({ groupsInfo, xStartIndex, xEndIndex, xScale, yScale, y2Scale, gapRatio, activeId, focusedItemInfo, hoveredItemInfo, axisStepWidth, averageGroupZ, isPointInsideMarquee, getTextDimensions, defaultFontSize, resolvedColors, getItemAriaLabel, plotAreaClipPathId }) => {
            return (jsx("g", { clipPath: `url(#${plotAreaClipPathId})`, children: groupsInfo
                    .slice(xStartIndex, xEndIndex + 1)
                    .map(({ item: group }, index) => (jsx(BarGroup, { yScale: yScale, splitDualY: isSplitDualY, y2Scale: y2Scale, xScale: xScale, groupIndex: index + xStartIndex, selectedIds: selectedSet, hiddenIds: hiddenSet, highlightedIds: highlightedIds ? highlightedSet : highlightedIds, isDrillEnabled: drilling === 'on', series: series, barGapRatio: gapRatio, dataItemGaps: dataItemGaps, isPointInsideMarquee: isPointInsideMarquee, isStacked: isStacked, axisStepWidth: axisStepWidth, averageGroupZ: averageGroupZ, group: group, timeAxisType: xAxis?.timeAxisType, colors: resolvedColors, activeId: activeId, isLog: yAxis?.scale === 'log', orientation: orientation, getDataItem: getDataItem, isSelectionEnabled: selectionMode != 'none', isRtl: isRtl, focusedItemInfo: focusedItemInfo, hoveredItemInfo: hoveredItemInfo, getTextDimensions: getTextDimensions, defaultFontSize: defaultFontSize, getStackGroup: getStackGroup, getStackLabel: getStackLabel, getItemAriaLabel: getItemAriaLabel }))) }));
        } }));
});

export { BarChart };
//# sourceMappingURL=UNSAFE_BarChart.js.map
