/* @oracle/oraclejet-preact: undefined */
import { jsxs, Fragment, jsx } from 'preact/jsx-runtime';
import { memo, forwardRef } from 'preact/compat';
import { useRef, useCallback, useState, useEffect, useMemo, useImperativeHandle } from 'preact/hooks';
import './LayerHost-7931b424.js';
import './StyledCheckbox-d6c8f557.js';
import './SelectorStyles.styles.css';
import './CollectionInteractionContext-7cf19abc.js';
import './DragAndDropStyles.styles.css';
import './ReorderableItemStyles.styles.css';
import { R as ReorderableContext } from './ReorderableContext-0daeea89.js';
import { H as HiddenAccessible } from './HiddenAccessible-61197e7c.js';
import { g as getScrollPosition, L as List, S as SkeletonContainer } from './List-4636ba9b.js';
import { i as isKeyDefined } from './keys-49c92dbb.js';
import { a as useReorderableItem, u as useReorderable } from './useReorderableItem-857636b7.js';
import { c as classNames } from './classNames-4e12b00d.js';
import { styles } from './UNSAFE_ListView/themes/ListViewStyles.css.js';
import { L as LIST_ITEM_SELECTOR, s as scrollToVisible } from './useNavigation-b257c33a.js';
import { m as mergeProps } from './mergeProps-88ea8306.js';
import { f as findElementByKey, h as dragToScroll, k as keyExtractor } from './collectionUtils-5313629f.js';
import { M as Menu } from './SelectMenuGroupContext-aa1fe822.js';
import 'preact';
import './logger-c92f309c.js';
import './TooltipContentStyles.styles.css';
import './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentBaseTheme.styles.css';
import './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css.js';
import './tooltipUtils-af0abd38.js';
import './IconStyle.styles.css';
import './UNSAFE_Menu/themes/MenuItemStyles.css.js';
import './UNSAFE_Separator/themes/SeparatorStyles.css.js';
import './MenuSeparatorStyles.styles.css';
import './UNSAFE_Menu/themes/redwood/MenuSeparatorBaseTheme.styles.css';
import './UNSAFE_Menu/themes/redwood/MenuSeparatorVariants.css.js';
import { j as isMenuChildrenFalsy } from './Dropdown-019aba37.js';
import './MenuStyles.styles.css';
import { f as findItemContext } from './useItemAction-27b29f5c.js';
import { u as useContextMenuGesture } from './useContextMenuGesture-e09f4c69.js';
import { L as LOADMORE_STYLE_CLASS } from './LoadMoreCollection-d9f22790.js';
import './index-aec1cc7f.js';
import './UNSAFE_Layer/themes/LayerHostStyles.css.js';
import './LayerHostStyles.styles.css';
import './Check-ac39fe00.js';
import './Icon-4983d06e.js';
import './size-af1e638c.js';
import './utils-b1eb54f9.js';
import './themeContract.css-1ffed3bf.js';
import './colorUtils-b3804ee8.js';
import './_curry1-63949a9b.js';
import './useTooltip-94af94d4.js';
import './useTooltipControlled-f2cfa454.js';
import './useId-03dbfdf0.js';
import './useHover-85077adb.js';
import './useToggle-8b7fcefe.js';
import './useFocus-38c95977.js';
import './useTouch-4828df25.js';
import './useAnimation-fe39685e.js';
import './useComponentTheme-d2f9e47f.js';
import './useTestId-f24ac480.js';
import './useThemeInterpolations-e144e8ec.js';
import './useColorScheme-c4f6caab.js';
import './useScale-434ad939.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 './unsafeDomAccess-453eb74e.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 './TooltipContentVariants.styles.css';
import './vanilla-extract-recipes-createRuntimeFn.esm-2aaf8c98.js';
import './UNSAFE_Icon/themes/IconStyle.css.js';
import './clientHints-a42b510c.js';
import './CheckboxOff-3359a12d.js';
import './CheckboxOn-930b64de.js';
import './CheckboxMixed-c4594250.js';
import './UNSAFE_Checkbox/themes/CheckboxIconContract.css.js';
import './UNSAFE_Checkbox/themes/redwood/CheckboxIconTheme.js';
import './UNSAFE_Checkbox/themes/CheckboxIconStyles.css.js';
import './CheckboxIconStyles.styles.css';
import './UNSAFE_Checkbox/themes/redwood/CheckboxIconBaseTheme.css.js';
import './UNSAFE_Checkbox/themes/redwood/CheckboxIconBaseTheme.styles.css';
import './UNSAFE_Checkbox/themes/redwood/CheckboxIconVariants.css.js';
import './CheckboxIconVariants.styles.css';
import './TabbableModeContext-7d8ad946.js';
import './useTabbableMode-090ed4b5.js';
import './StyledCheckbox.styles.css';
import './HiddenAccessibleStyles.styles.css';
import './VirtualizedCollection-0160e675.js';
import './Collection-e1ef8b8d.js';
import './useViewportIntersect-6ff65310.js';
import './FocusTrap-b59d5752.js';
import './tabbableUtils-c8311ec6.js';
import './head-8f89fe66.js';
import './_arity-be492b9e.js';
import './_isArray-694cc52d.js';
import './_isString-675f1de9.js';
import './FocusTracker-70300f1c.js';
import './PRIVATE_FocusTracker/themes/FocusTrackerStyles.css.js';
import './FocusTrackerStyles.styles.css';
import './useInteractionStyle-99e32c23.js';
import './useActive-fb6d4d52.js';
import './flexitem-7b7f7920.js';
import './flexitem.styles.css';
import './vanilla-extract-sprinkles-createRuntimeSprinkles.esm-2d655d37.js';
import './PRIVATE_List/themes/ListStyles.css.js';
import './ImageVars.styles.css';
import './ListStyles.styles.css';
import './Skeleton-d6f0969e.js';
import './dimensions-e4fbc23d.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 './Flex-03129963.js';
import './boxalignment-8980856d.js';
import './arrayUtils-35a58161.js';
import './boxalignment.styles.css';
import './flexbox-529f25da.js';
import './flexbox.styles.css';
import './FlexStyles.styles.css';
import './ImageVars.css-7b3180c8.js';
import './useTheme-0e7497db.js';
import './useCollectionInteractionContext-3895c632.js';
import './useSelection-65134722.js';
import './useUser-06d34d19.js';
import './textSelectionUtils-e87a47ff.js';
import './useAdditiveSelection-3ba8e3e3.js';
import './Inset-8afb9876.js';
import './UNSAFE_Inset/themes/InsetStyles.css.js';
import './InsetStyles.styles.css';
import './PRIVATE_List/themes/redwood/ListBaseTheme.styles.css';
import './useTranslationBundle-4822502f.js';
import './dndUtils-deb68797.js';
import './hooks/PRIVATE_useReorderable/themes/ReorderableItemStyles.css.js';
import './ListViewStyles.styles.css';
import './useCurrentKey-5f865bbd.js';
import './useReorderableContext-79b1c941.js';
import './useCollectionFocusRing-23ac7f97.js';
import './useTabbableModeSet-159b0279.js';
import './Selector-23bccbe7.js';
import './BaseSelector-7cbc48bc.js';
import './PRIVATE_BaseSelector/themes/SelectorStyles.css.js';
import './Sheet-f9f8a4a4.js';
import './Modal-c0f730b8.js';
import './useModal-953082f2.js';
import './Layer-535577b5.js';
import './UNSAFE_Layer/themes/LayerStyles.css.js';
import './LayerStyles.styles.css';
import './UNSAFE_Modal/themes/ModalStyles.css.js';
import './ModalStyles.styles.css';
import './popupUtils-51366a29.js';
import './WindowOverlay-7264c44a.js';
import './vanilla-extract-dynamic.esm-c909758c.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 './refUtils-76275c69.js';
import './useAnimationStatus-b881f39a.js';
import './animationUtils-5f409a6c.js';
import './UNSAFE_Menu/themes/MenuStyles.css.js';
import './UNSAFE_Menu/themes/DropdownMenuStyles.css.js';
import './DropdownMenuStyles.styles.css';
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/redwood/MenuItemBaseTheme.css.js';
import './UNSAFE_Menu/themes/redwood/MenuItemBaseTheme.styles.css';
import './UNSAFE_Menu/themes/redwood/MenuItemVariants.css.js';
import './MenuItemStyles.styles.css';
import './MenuItemVariants.styles.css';
import './Text-834eb35e.js';
import './UNSAFE_Text/themes/TextStyles.css.js';
import './TextStyles.styles.css';
import './usePress-051f5adb.js';
import './EnvironmentProvider-6a0a8212.js';
import './LayerManager-52a26c55.js';
import './Floating-4a82db94.js';
import './useFloating-b9d680f7.js';
import './positionUtils-f26caad9.js';
import './useOutsideClick-b777a43e.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 './UNSAFE_Floating/themes/FloatingContract.css.js';
import './useUnsafeDomElementRef-32290273.js';
import './SeparatorStyles.styles.css';
import './keyboardUtils-986fe923.js';
import './usePopupAnimation-96d2bc83.js';
import './popupAnimationUtils-175151d9.js';
import './UNSAFE_Dropdown/themes/dropdownStyles.css.js';
import './dropdownStyles.styles.css';
import './useOutsideMousedown-c45c22c0.js';
import './useEffectEvent-1bb008cb.js';

/**
 * A private item that will be used by ReorderableCardFlexView, location TBD (could be moved to PRIVATE_CardFlexView)
 */
function ListViewReorderableItem({ children, dragKey, setDragKey, onReorder, rootRef, itemKey }) {
    const itemRef = useRef(null);
    const itemStyles = {
        itemOverlayFront: styles.reorderableItemOverlayFront,
        itemOverlayRear: styles.reorderableItemOverlayRear,
        itemDragger: styles.reorderableItemDragger
    };
    const getItem = () => itemRef?.current?.closest(LIST_ITEM_SELECTOR);
    const setTransferData = useCallback((event) => {
        event.dataTransfer?.setData('text/listview-items-key', JSON.stringify(itemKey));
    }, [itemKey]);
    const { rootProps, isDragged, overlayZoneBeforeProps, overlayZoneAfterProps } = useReorderableItem({
        isDisabled: onReorder ? false : true,
        dragKey,
        setDragKey,
        onReorder,
        rootRef,
        ref: itemRef,
        getItem,
        setTransferData,
        itemStyles,
        itemSelector: LIST_ITEM_SELECTOR,
        isVertical: true
    });
    const classes = classNames([rootProps?.class, styles.reorderableItemDnd]);
    return (jsxs("div", { ...rootProps, class: classes, children: [children, !isDragged && isKeyDefined(dragKey) && (jsxs(Fragment, { children: [jsx("div", { ...overlayZoneBeforeProps }), jsx("div", { ...overlayZoneAfterProps })] }))] }));
}
const MemoizeListViewReorderableItem = memo(ListViewReorderableItem, (prev, next) => {
    if (prev && next) {
        return prev.children === next.children && prev.dragKey === next.dragKey;
    }
    return false;
});

const useListViewReorder = ({ onReorder, rootRef, viewportConfig }) => {
    const isReorderEnabled = onReorder != undefined;
    const [dragKey, setDragKey] = useState(undefined);
    const { reorderProps, reorderContext, reorderInstructionsId, reorderInstructions } = useReorderable({
        onReorder,
        rootRef,
        itemSelector: LIST_ITEM_SELECTOR,
        isDisabled: !isReorderEnabled,
        columns: 1
    });
    // ensure the current item is scrolled into view during keyboard reordering,
    // disable that during mouse reordering
    const reorderScrollIntoView = useRef(false);
    useEffect(() => {
        if (isReorderEnabled && reorderScrollIntoView.current) {
            const rootElement = rootRef.current;
            const elem = findElementByKey(rootElement, reorderContext.currentItemKey.current, LIST_ITEM_SELECTOR);
            if (elem) {
                const scroller = viewportConfig?.scrollerRef.current || rootElement;
                // make sure item is visible
                scrollToVisible(elem, scroller, 0);
                reorderScrollIntoView.current = false;
            }
        }
    });
    const reorderItemProps = useMemo(() => {
        return { dragKey, setDragKey, onReorder, rootRef };
    }, [dragKey, onReorder, rootRef]);
    if (!isReorderEnabled) {
        return {
            reorderProps,
            reorderContext,
            reorderInstructionsId,
            reorderInstructions
        };
    }
    const handleKeyDown = (event) => {
        // listview only do keyboard reordering with arrow up/down keys
        if (isReorderEnabled &&
            (event.key === 'ArrowUp' || event.key === 'ArrowDown') &&
            (event.metaKey || event.ctrlKey) &&
            event.shiftKey) {
            reorderScrollIntoView.current = true;
            reorderProps.onKeyDown?.(event);
        }
    };
    const handleDragOver = (event) => {
        if (dragKey !== undefined) {
            reorderScrollIntoView.current = false;
            dragToScroll(event, dragKey !== undefined, rootRef.current);
        }
    };
    const reorderEventProps = mergeProps({ onKeyDown: handleKeyDown, onDragOver: handleDragOver });
    return {
        reorderProps: reorderEventProps,
        reorderItemProps,
        reorderContext,
        reorderInstructionsId,
        reorderInstructions
    };
};

/**
 * The internal component used to render a custom context menu
 */
function ListViewContextMenu({ contextMenuConfig, testId, contextMenuContext, ...menuProps }) {
    const accessibleLabel = contextMenuConfig.accessibleLabel;
    let menuItems;
    // Important to call items renderer only when isOpen is true so we know there is a contextMenuContext
    if (menuProps.isOpen) {
        menuItems = contextMenuConfig.itemsRenderer(contextMenuContext);
        if (isMenuChildrenFalsy(menuItems)) {
            return null;
        }
    }
    else {
        menuItems = null;
    }
    return (jsx(Menu, { ...menuProps, ...(accessibleLabel && {
            'aria-label': accessibleLabel
        }), testId: testId, children: menuItems }));
}

const TOUCH_OFFSET_VALUE = 40;
const menuPropGestureStates = {
    mouse: {
        initialFocus: 'menu',
        placement: 'bottom-start',
        offsetValue: 0
    },
    keyboard: {
        initialFocus: 'firstItem',
        placement: 'bottom-start',
        offsetValue: 0
    },
    touch: {
        initialFocus: 'firstItem',
        placement: 'end',
        offsetValue: TOUCH_OFFSET_VALUE
    }
};
const initialMenuProps = {
    isOpen: false,
    initialFocus: 'menu',
    placement: 'bottom-start',
    offsetValue: 0,
    anchorRef: { current: null }
};
const useListViewContextMenu = (dataState, contextMenuConfig, scrollListRef, updateCurrentKey) => {
    /*Context Menu section
     TODO: A version of context Menu listview will be merged using useContextMenuGesture instead. Once it's merged we
     can go back to this to create a hook or utility that could be share among all collection comps. JET-60320
    */
    /*
    Steps to open a menu:
      1.- useContextMenu handler is called when menu is supposed to be opened.
      2.- We set contextMenuContext when contextMenuRenderer is called.
      3.- We dispatch opening the menu with the correct anchor.
      5.- Menu receives updated props and updated contextMenuContext.
      6.- Menu is opened.
  
      */
    //Supposed to be updated when menu is about to be opened
    //We set an initial key value for the context menu context, to allow user use object destructuring inside the
    //contextMenuRenderer. It doesn't matter if the key is not correct at the initial rendering since menu starts
    //being closed always
    const [contextMenuContext, setContextMenuContext] = useState();
    const [menuProps, setMenuProps] = useState(initialMenuProps);
    const currentKeyRef = useRef();
    const notifyCurrentKeyChanged = (detail) => {
        currentKeyRef.current = detail.value;
    };
    const { triggerProps } = useContextMenuGesture(({ gesture, anchor, target }) => {
        let anchorBasedOnGesture = anchor;
        if (gesture === 'keyboard') {
            //We find the element where the position of the menu is going to be based of
            const elem = findElementByKey(scrollListRef.current, currentKeyRef.current, LIST_ITEM_SELECTOR);
            //We set the correct anchor
            anchorBasedOnGesture = elem ? elem : anchor;
            const context = findItemContext(currentKeyRef.current, dataState);
            setContextMenuContext(context);
        }
        else {
            //We search for the key using the target of the event
            const key = keyExtractor(target, LIST_ITEM_SELECTOR);
            const context = findItemContext(key, dataState);
            setContextMenuContext(context);
            //We update the key so when we close logical focus is on the correct item
            updateCurrentKey(key);
        }
        setMenuProps({
            ...menuPropGestureStates[gesture],
            anchorRef: { current: anchorBasedOnGesture },
            isOpen: true
        });
    }, {
        isDisabled: !contextMenuConfig //If there is no a context menu renderer we disable the hook
    });
    const handleCloseContextMenu = useCallback((detail) => {
        /*
        TODO: Focus ring should be visible when context menu was closed because of selecting an item using keyboard,
        but should not be visible when the selection was done using mouse or touch. This would probably means menu
        onClose API is going to be changed a little bit so we can satisfy this requirement. JET-62372
        */
        //Focus has to be set on the current target that was obtained
        //during context menu gesture when menu is dismissed or item is "selected"
        if (detail.reason === 'dismissed' || detail.reason === 'itemAction') {
            scrollListRef.current?.focus({ preventScroll: true });
        }
        // We close the menu.The only prop that matters here is isOpen
        setMenuProps({ ...initialMenuProps });
    }, [scrollListRef]);
    return {
        menuProps: { ...menuProps, onClose: handleCloseContextMenu },
        onClose: handleCloseContextMenu,
        contextMenuContext: contextMenuContext,
        triggerProps,
        notifyCurrentKeyChanged
    };
};

/**
 * This hook handles the currentItemOverride passing to PRIVATE_List layer.
 *
 * If the app provided new value for 'currentItemOverride', we pass that down to PRIVATE_List layer;
 * otherwise, we will pass down the value of internal override, which would be the value
 * updated by useListViewContextMenu hook
 *
 * @param currentItemOverride
 */
const useListViewCurrentItemOverride = (currentItemOverride) => {
    // the override that will be passed down to PRIVATE_List layer
    const listOverrideRef = useRef();
    // track the currentItemOverride attribute set by app
    const appOverrideRef = useRef();
    if (appOverrideRef.current !== currentItemOverride) {
        appOverrideRef.current = currentItemOverride;
        listOverrideRef.current = currentItemOverride;
    }
    // track the internal override updated by useListViewContextMenu hook
    // we can just update ref here since the hook will trigger a state update for its context, which will trigger a rerender
    const updateCurrentItemOverride = useCallback((key) => {
        listOverrideRef.current = { rowKey: key };
    }, []);
    return {
        currentItemOverride: listOverrideRef.current,
        updateCurrentItemOverride
    };
};

/**
 * A list view displays data items as a list or a grid with highly interactive features.
 */
const ListView = forwardRef(({ children, ...props }, ref) => {
    const { contextMenuConfig } = props;
    const listRef = useRef(null);
    const { currentItemOverride, updateCurrentItemOverride } = useListViewCurrentItemOverride(props.currentItemOverride);
    const dataMetadata = props.data
        ? props.data.map((aData) => {
            const key = props.getRowKey(aData);
            return { data: aData, metadata: { key } };
        })
        : null;
    const loadRange = props.onLoadMore ? props.onLoadMore : () => { };
    const dataState = dataMetadata
        ? {
            offset: 0,
            data: dataMetadata,
            sizePrecision: props.hasMore ? 'atLeast' : 'exact',
            totalSize: dataMetadata.length
        }
        : null;
    useImperativeHandle(ref, () => ({
        getScrollPosition: () => {
            if (listRef.current) {
                return getScrollPosition(listRef.current);
            }
            return { y: 0 };
        },
        focus: () => {
            if (listRef.current) {
                listRef.current.focus();
            }
        }
    }));
    /**
     * Reorder Section
     */
    const isReorderEnabled = props.onReorder != undefined;
    const { reorderProps, reorderItemProps, reorderContext, reorderInstructionsId, reorderInstructions } = useListViewReorder({
        onReorder: props.onReorder,
        rootRef: listRef,
        viewportConfig: props.viewportConfig
    });
    const { triggerProps, menuProps, contextMenuContext, notifyCurrentKeyChanged } = useListViewContextMenu(dataState, contextMenuConfig, listRef, updateCurrentItemOverride);
    const onPersistCurrentItem = (detail) => {
        props.onPersistCurrentItem?.(detail);
        notifyCurrentKeyChanged(detail);
    };
    const reorderableItemRenderer = useCallback((context) => (jsx(MemoizeListViewReorderableItem, { ...reorderItemProps, itemKey: context.metadata.key, children: children(context) })), [children, reorderItemProps]);
    if (isReorderEnabled && reorderItemProps) {
        return (jsxs(Fragment, { children: [jsxs(ReorderableContext.Provider, { value: reorderContext, children: [jsx(List, { ...props, "aria-describedby": reorderInstructionsId, contextMenuTriggerProps: triggerProps, reorderProps: reorderProps, onLoadRange: loadRange, scrollerRef: listRef, data: dataState, currentItemOverride: currentItemOverride, onPersistCurrentItem: onPersistCurrentItem, children: reorderableItemRenderer }), jsx("span", { id: reorderInstructionsId, children: jsx(HiddenAccessible, { children: reorderInstructions }) })] }), contextMenuConfig && (jsx(ListViewContextMenu, { ...menuProps, testId: props.testId ? props.testId + '-menu' : undefined, contextMenuConfig: contextMenuConfig, contextMenuContext: contextMenuContext }))] }));
    }
    const customInitialSkeleton = (skeletonRenderer) => {
        return (jsx(SkeletonContainer, { minimumCount: 25, children: (index) => {
                const context = {
                    loadingStatus: 'initial',
                    index: index
                };
                return skeletonRenderer(context);
            } }));
    };
    const customLoadMoreSkeleton = (skeletonRenderer) => {
        return (jsx("div", { class: LOADMORE_STYLE_CLASS, children: jsx(SkeletonContainer, { minimumCount: 3, children: (index) => {
                    const context = {
                        loadingStatus: 'loadMore',
                        index: index
                    };
                    return skeletonRenderer(context);
                } }) }));
    };
    return (jsxs(Fragment, { children: [jsx(List, { ...props, loadingIndicator: props.skeletonRenderer ? customInitialSkeleton(props.skeletonRenderer) : undefined, loadMoreIndicator: props.skeletonRenderer ? customLoadMoreSkeleton(props.skeletonRenderer) : undefined, onLoadRange: loadRange, scrollerRef: listRef, data: dataState, contextMenuTriggerProps: triggerProps, currentItemOverride: currentItemOverride, onPersistCurrentItem: onPersistCurrentItem, children: children }), contextMenuConfig && (jsx(ListViewContextMenu, { ...menuProps, contextMenuConfig: contextMenuConfig, contextMenuContext: contextMenuContext, testId: props.testId ? props.testId + '-menu' : undefined }))] }));
});

export { ListView };
//# sourceMappingURL=UNSAFE_ListView.js.map
