require("./TreeView.css");
var $7a26131f6144af2b$exports = require("./ActionButtonGroup.cjs");
var $e5a758dd286599f2$exports = require("./ActionMenu.cjs");
var $e991cbcdf82ced71$exports = require("./CenterBaseline.cjs");
var $af04e099a53d3e85$exports = require("./Checkbox.cjs");
var $1df9f1c9262ce5df$exports = require("./Chevron.cjs");
var $bde97c91243ed164$exports = require("../../icons/Icon.cjs");
var $4526404114e78c80$exports = require("./intlStrings.cjs");
var $387d58020e2a8028$exports = require("./ListView.cjs");
var $1c116ea4b0d2d023$exports = require("./ProgressCircle.cjs");
var $6367bc87eb7d24ad$exports = require("./Content.cjs");
var $85bf454149fe9ddc$exports = require("./ActionBar.cjs");
var $150382364eecc4bc$exports = require("./useDOMRef.cjs");
var $ee7b4c497f520c08$exports = require("./utils.cjs");
var $6K4Mt$reactjsxruntime = require("react/jsx-runtime");
var $6K4Mt$reactariacomponentsButton = require("react-aria-components/Button");
var $6K4Mt$reactstatelyuseVirtualizerState = require("react-stately/useVirtualizerState");
var $6K4Mt$reactariacomponentsslots = require("react-aria-components/slots");
var $6K4Mt$reactariacomponentsTree = require("react-aria-components/Tree");
var $6K4Mt$react = require("react");
var $6K4Mt$reactariaI18nProvider = require("react-aria/I18nProvider");
var $6K4Mt$reactariauseLocalizedStringFormatter = require("react-aria/useLocalizedStringFormatter");
var $6K4Mt$reactariacomponentsVirtualizer = require("react-aria-components/Virtualizer");


function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}

function $parcel$export(e, n, v, s) {
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}

$parcel$export(module.exports, "TreeView", () => $8a2a97a0cb171e69$export$6940b0d9c820eca7);
$parcel$export(module.exports, "TreeViewItem", () => $8a2a97a0cb171e69$export$6e77ea6719814e9c);
$parcel$export(module.exports, "TreeViewItemContent", () => $8a2a97a0cb171e69$export$9a5779ed3fade674);
$parcel$export(module.exports, "TreeViewLoadMoreItem", () => $8a2a97a0cb171e69$export$6ceebe2a029205c);
/*
 * Copyright 2024 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */ 





















const $8a2a97a0cb171e69$var$TreeRendererContext = /*#__PURE__*/ (0, $6K4Mt$react.createContext)({});
const $8a2a97a0cb171e69$var$treeViewWrapper = function anonymous(props, overrides) {
    let rules = " ";
    let minHeight = false;
    let minWidth = false;
    let position = false;
    let matches = String(overrides || '').matchAll(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L|F|M|K)[^\s]+/g);
    for (let p of matches){
        if (p[1] === "M") minHeight = true;
        if (p[1] === "N") minWidth = true;
        if (p[1] === "_P") position = true;
        rules += p[0];
    }
    if (!minHeight) rules += ' Ma12';
    if (!minWidth) rules += ' NMaAbMd12';
    rules += ' sd12';
    rules += ' _Bb12';
    rules += ' __ca12';
    if (!position) rules += ' _Pc12';
    rules += ' _Nb12';
    rules += ' Pb12';
    return rules;
};
// TODO: the below is needed so the borders of the top and bottom row isn't cut off if the TreeView is wrapped within a container by always reserving the 2px needed for the
// keyboard focus ring. Perhaps find a different way of rendering the outlines since the top of the item doesn't
// scroll into view due to how the ring is offset. Alternatively, have the tree render the top/bottom outline like it does in Listview
const $8a2a97a0cb171e69$var$tree = function anonymous(props) {
    let rules = " ";
    if (props.isFocusVisible) rules += ' _Lf12';
    else rules += ' _Le12';
    rules += ' Oh12';
    rules += ' Olc12';
    rules += ' _Mc12';
    rules += ' _Kb12';
    rules += ' _4c12';
    rules += ' Ma12';
    rules += ' Na12';
    rules += ' Za12';
    rules += ' Fb12';
    rules += ' _Na12';
    rules += ' Pa12';
    rules += ' _oa12';
    if (props.isEmpty) rules += ' _Ca12';
    if (props.isEmpty) rules += ' eb12';
    rules += ' -lPUMEc-Zu12';
    return rules;
};
let $8a2a97a0cb171e69$var$InternalTreeViewContext = /*#__PURE__*/ (0, $6K4Mt$react.createContext)({});
const $8a2a97a0cb171e69$export$6940b0d9c820eca7 = /*#__PURE__*/ (0, $6K4Mt$react.forwardRef)(function TreeView(props, ref) {
    let { children: children, selectionStyle: selectionStyle = 'checkbox', UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style } = props;
    let scale = (0, $ee7b4c497f520c08$exports.useScale)();
    let renderer;
    if (typeof children === 'function') renderer = children;
    let domRef = (0, $150382364eecc4bc$exports.useDOMRef)(ref);
    let scrollRef = (0, $6K4Mt$react.useRef)(null);
    let { selectedKeys: selectedKeys, onSelectionChange: onSelectionChange, actionBar: actionBar, actionBarHeight: actionBarHeight } = (0, $85bf454149fe9ddc$exports.useActionBarContainer)({
        ...props,
        scrollRef: scrollRef
    });
    return /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsxs)("div", {
        ref: domRef,
        className: (UNSAFE_className ?? '') + $8a2a97a0cb171e69$var$treeViewWrapper(null, props.styles),
        style: UNSAFE_style,
        children: [
            /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)((0, $6K4Mt$reactariacomponentsVirtualizer.Virtualizer), {
                layout: (0, $6K4Mt$reactstatelyuseVirtualizerState.ListLayout),
                layoutOptions: {
                    rowHeight: scale === 'large' ? 50 : 40
                },
                children: /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)($8a2a97a0cb171e69$var$TreeRendererContext.Provider, {
                    value: {
                        renderer: renderer
                    },
                    children: /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)($8a2a97a0cb171e69$var$InternalTreeViewContext.Provider, {
                        value: {
                            selectionStyle: selectionStyle
                        },
                        children: /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)((0, $6K4Mt$reactariacomponentsTree.Tree), {
                            ...props,
                            style: {
                                paddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0,
                                scrollPaddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0
                            },
                            className: $8a2a97a0cb171e69$var$tree,
                            selectionBehavior: selectionStyle === 'highlight' ? 'replace' : 'toggle',
                            selectedKeys: selectedKeys,
                            defaultSelectedKeys: undefined,
                            onSelectionChange: onSelectionChange,
                            ref: scrollRef,
                            children: props.children
                        })
                    })
                })
            }),
            actionBar
        ]
    });
});
const $8a2a97a0cb171e69$var$rowBackgroundColor = {
    default: '--s2-container-bg',
    isFocusVisibleWithin: "[color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(19, 19, 19), rgb(242, 242, 242)) 7%)]",
    isHovered: "[color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(19, 19, 19), rgb(242, 242, 242)) 7%)]",
    isPressed: "[color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(19, 19, 19), rgb(242, 242, 242)) 7%)]",
    isSelected: {
        default: "[color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(19, 19, 19), rgb(242, 242, 242)) 7%)]",
        isFocusVisibleWithin: "[color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(19, 19, 19), rgb(242, 242, 242)) 10%)]",
        isHovered: "[color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(19, 19, 19), rgb(242, 242, 242)) 10%)]",
        isPressed: "[color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(19, 19, 19), rgb(242, 242, 242)) 10%)]"
    },
    forcedColors: {
        default: 'Background'
    }
};
const $8a2a97a0cb171e69$var$treeRow = function anonymous(props) {
    let rules = " ";
    rules += ' _Le12';
    rules += ' _Pc12';
    rules += ' sd12';
    rules += ' Fv12';
    rules += ' Za12';
    rules += ' _oa12';
    rules += ' uk12';
    rules += ' ucJ9TBTb12';
    rules += ' ud3Euai12';
    rules += ' uea12';
    rules += ' ugb12';
    rules += ' uhd12';
    rules += ' uje12';
    rules += ' u2NhKxcl12';
    rules += ' uic12';
    rules += ' -_6BNtrc-c12';
    rules += ' vx12';
    rules += ' xb12';
    rules += ' _xa12';
    rules += ' _Fd12';
    rules += ' _FnuYUweb12';
    if (props.isSelected) {
        if (props.isPressed) rules += ' po12';
        else if (props.isFocusVisible) rules += ' po12';
        else if (props.isHovered) rules += ' po12';
        else rules += ' pt12';
    } else {
        if (props.isPressed) rules += ' pt12';
        else if (props.isFocusVisible) rules += ' pt12';
        else if (props.isHovered) rules += ' pt12';
        else rules += ' pv12';
    }
    rules += ' plb12';
    if (props.isLink) rules += ' ry12';
    else rules += ' ri12';
    if (props.isSelected) {
        if (props.isPressed) rules += ' -qH4xad-gRfT7e12';
        else if (props.isHovered) rules += ' -qH4xad-gRfT7e12';
        else if (props.isFocusVisibleWithin) rules += ' -qH4xad-gRfT7e12';
        else rules += ' -qH4xad-gj1B7i12';
    } else if (props.isPressed) rules += ' -qH4xad-gj1B7i12';
    else if (props.isHovered) rules += ' -qH4xad-gj1B7i12';
    else if (props.isFocusVisibleWithin) rules += ' -qH4xad-gj1B7i12';
    else rules += ' -qH4xad-gEzkoQe12';
    rules += ' -qH4xad-lga12';
    rules += ' -_8Gqznb-oa12';
    rules += ' oa12';
    rules += ' na12';
    rules += ' ka12';
    rules += ' ja12';
    return rules;
};
const $8a2a97a0cb171e69$var$treeCellGrid = function anonymous(props) {
    let rules = " ";
    rules += ' se12';
    rules += ' Za12';
    rules += ' Fb12';
    rules += ' _oa12';
    rules += ' oa12';
    rules += ' na12';
    rules += ' ka12';
    rules += ' ja12';
    rules += ' _cb12';
    rules += ' eb12';
    rules += ' Dw9uTxc12';
    rules += ' EM8Mfn12';
    rules += ' CgjMZ2c12';
    rules += ' Rp12';
    if (props.selectionStyle === "highlight") {
        if (props.isSelected) rules += ' ple12';
    } else {
        if (props.isDisabled) rules += ' pp12';
        rules += ' plb12';
    }
    if (props.isFocusVisible) rules += ' -_7xg3bb-Oh12';
    else rules += ' -_7xg3bb-O8Izf8c12';
    rules += ' -_7xg3bb-lOc12';
    rules += ' -pKMv1c-Oh12';
    rules += ' -pKMv1c-lOc12';
    if (props.selectionStyle === "highlight") rules += ' -EH8uVb-iw12';
    else rules += ' -EH8uVb-iA12';
    rules += ' -EH8uVb-lia12';
    rules += ' _yb12';
    return rules;
};
const $8a2a97a0cb171e69$var$treeRowBackground = function anonymous(props) {
    let rules = " ";
    rules += ' _Pa12';
    rules += ' _9a12';
    rules += ' Wr12';
    rules += ' _lr12';
    rules += ' _Ar12';
    rules += ' _zr12';
    if (props.selectionStyle === "highlight") {
        if (props.isSelected) {
            if (props.isFocusVisible) rules += ' gaZwDBe12';
            else if (props.isPressed) rules += ' gaZwDBe12';
            else if (props.isHovered) rules += ' gaZwDBe12';
            else rules += ' glzvDBe12';
            rules += ' gle12';
        } else rules += ' gs9yXOb12';
    } else {
        rules += ' gs9yXOb12';
        rules += ' gla12';
    }
    if (props.isPreviousSelected) {
        if (props.isSelected) rules += ' od12';
        else rules += ' o4VHKAc12';
    } else rules += ' o4VHKAc12';
    if (props.isPreviousSelected) {
        if (props.isSelected) rules += ' nd12';
        else rules += ' n4VHKAc12';
    } else rules += ' n4VHKAc12';
    if (props.isNextSelected) {
        if (props.isSelected) rules += ' kd12';
        else rules += ' k4VHKAc12';
    } else rules += ' k4VHKAc12';
    if (props.isNextSelected) {
        if (props.isSelected) rules += ' jd12';
        else rules += ' j4VHKAc12';
    } else rules += ' j4VHKAc12';
    if (props.isPreviousSelected) rules += ' _ka12';
    else rules += ' _kb12';
    if (props.isNextSelected) rules += ' ha12';
    else rules += ' hb12';
    rules += ' mb12';
    rules += ' lb12';
    rules += ' _jf12';
    if (props.isSelected) rules += ' i4pzfu12';
    else rules += ' iA12';
    return rules;
};
const $8a2a97a0cb171e69$var$treeCheckbox = function anonymous(props) {
    let rules = " ";
    rules += ' zoRzcu12';
    rules += ' yoRzcu12';
    rules += ' BoRzcu12';
    rules += ' AoRzcu12';
    rules += ' Ix12';
    rules += ' Hy12';
    rules += ' Rd12';
    if (props.isDisabled) rules += ' _6b12';
    else rules += ' _6c12';
    return rules;
};
const $8a2a97a0cb171e69$var$treeIcon = " z2U5Crc12 y2U5Crc12 B2U5Crc12 A2U5Crc12 Ht12 Hsu12 -_8sjo0b-t5ZbAob12";
const $8a2a97a0cb171e69$var$treeContent = " zk52g2d12 yk52g2d12 Bk52g2d12 Ak52g2d12 _Yb12 _7c12 _Nc12 Pc12";
const $8a2a97a0cb171e69$var$treeActions = " zkG38H12 ykG38H12 BkG38H12 AkG38H12 Ir12 Hs12";
const $8a2a97a0cb171e69$var$treeActionMenu = " z6Nrfjc12 y6Nrfjc12 B6Nrfjc12 A6Nrfjc12";
let $8a2a97a0cb171e69$var$treeRowFocusRing = function anonymous(props) {
    let rules = " ";
    if (props.isFocusVisible) rules += ' _Lf12';
    else rules += ' _Le12';
    if (props.selectionStyle === "highlight") {
        rules += ' Oh12';
        rules += ' Ola12';
    } else {
        rules += ' Oh12';
        rules += ' Olc12';
    }
    rules += ' _Mc12';
    rules += ' _MlkNNfn12';
    rules += ' _Kb12';
    rules += ' _KlToPtrc12';
    rules += ' _Pa12';
    if (props.isFirstItem) rules += ' Wr12';
    else rules += ' WLPOtrc12';
    if (props.selectionStyle === "highlight") {
        if (props.isSelected) {
            if (props.isNextSelected) rules += ' _lr12';
            else rules += ' _lr12';
        } else if (props.isNextSelected) rules += ' _lLPOtrc12';
        else rules += ' _lr12';
    } else if (props.selectionStyle === "checkbox") rules += ' _lr12';
    rules += ' _Ar12';
    rules += ' _zr12';
    rules += ' oa12';
    rules += ' na12';
    rules += ' ka12';
    rules += ' ja12';
    rules += ' _9c12';
    rules += ' _Ob12';
    return rules;
};
const $8a2a97a0cb171e69$export$6e77ea6719814e9c = (props)=>{
    let { href: href } = props;
    let { selectionStyle: selectionStyle } = (0, $6K4Mt$react.useContext)($8a2a97a0cb171e69$var$InternalTreeViewContext);
    return /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)((0, $6K4Mt$reactariacomponentsTree.TreeItem), {
        ...props,
        className: (renderProps)=>$8a2a97a0cb171e69$var$treeRow({
                ...renderProps,
                isLink: !!href,
                selectionStyle: selectionStyle,
                isPreviousSelected: (0, $387d58020e2a8028$exports.isPrevSelected)(renderProps.id, renderProps.state)
            })
    });
};
const $8a2a97a0cb171e69$export$9a5779ed3fade674 = (props)=>{
    let { children: children } = props;
    let scale = (0, $ee7b4c497f520c08$exports.useScale)();
    let { selectionStyle: selectionStyle } = (0, $6K4Mt$react.useContext)($8a2a97a0cb171e69$var$InternalTreeViewContext);
    return /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)((0, $6K4Mt$reactariacomponentsTree.TreeItemContent), {
        children: ({ isExpanded: isExpanded, hasChildItems: hasChildItems, selectionMode: selectionMode, selectionBehavior: selectionBehavior, isDisabled: isDisabled, isSelected: isSelected, id: id, state: state, isHovered: isHovered, isFocusVisible: isFocusVisible })=>{
            return /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsxs)("div", {
                className: $8a2a97a0cb171e69$var$treeCellGrid({
                    isDisabled: isDisabled,
                    isNextSelected: $8a2a97a0cb171e69$var$isNextSelected(id, state),
                    isSelected: isSelected,
                    selectionStyle: selectionStyle
                }),
                children: [
                    /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)("div", {
                        className: $8a2a97a0cb171e69$var$treeRowBackground({
                            isHovered: isHovered,
                            isFocusVisible: isFocusVisible,
                            isSelected: isSelected,
                            selectionStyle: selectionStyle,
                            isNextSelected: $8a2a97a0cb171e69$var$isNextSelected(id, state),
                            isPreviousSelected: (0, $387d58020e2a8028$exports.isPrevSelected)(id, state)
                        })
                    }),
                    isFocusVisible && /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)("div", {
                        className: $8a2a97a0cb171e69$var$treeRowFocusRing({
                            isFocusVisible: isFocusVisible,
                            selectionStyle: selectionStyle,
                            isSelected: isSelected,
                            isNextSelected: $8a2a97a0cb171e69$var$isNextSelected(id, state),
                            isFirstItem: (0, $387d58020e2a8028$exports.isFirstItem)(id, state)
                        })
                    }),
                    selectionMode !== 'none' && selectionBehavior === 'toggle' && selectionStyle !== 'highlight' && /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)("div", {
                        className: $8a2a97a0cb171e69$var$treeCheckbox({
                            isDisabled: isDisabled || !state.selectionManager.canSelectItem(id) || state.disabledKeys.has(id)
                        }),
                        children: /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)((0, $af04e099a53d3e85$exports.Checkbox), {
                            slot: "selection"
                        })
                    }),
                    /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)("div", {
                        className: " z7fSmKc12 y7fSmKc12 B7fSmKc12 A7fSmKc12 ZecPNad12"
                    }),
                    /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)($8a2a97a0cb171e69$var$ExpandableRowChevron, {
                        isDisabled: isDisabled,
                        isExpanded: isExpanded,
                        scale: scale,
                        isHidden: !hasChildItems
                    }),
                    /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)((0, $6K4Mt$reactariacomponentsslots.Provider), {
                        values: [
                            [
                                (0, $6367bc87eb7d24ad$exports.TextContext),
                                {
                                    styles: $8a2a97a0cb171e69$var$treeContent
                                }
                            ],
                            [
                                (0, $bde97c91243ed164$exports.IconContext),
                                {
                                    render: (0, $e991cbcdf82ced71$exports.centerBaseline)({
                                        slot: 'icon',
                                        styles: $8a2a97a0cb171e69$var$treeIcon
                                    }),
                                    styles: " ZuUmpre12 FuUmpre12 _va12"
                                }
                            ],
                            [
                                (0, $7a26131f6144af2b$exports.ActionButtonGroupContext),
                                {
                                    styles: $8a2a97a0cb171e69$var$treeActions,
                                    isDisabled: isDisabled
                                }
                            ],
                            [
                                (0, $e5a758dd286599f2$exports.ActionMenuContext),
                                {
                                    styles: $8a2a97a0cb171e69$var$treeActionMenu,
                                    isQuiet: true,
                                    isDisabled: isDisabled
                                }
                            ]
                        ],
                        children: typeof children === 'string' ? /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)((0, $6367bc87eb7d24ad$exports.Text), {
                            children: children
                        }) : children
                    })
                ]
            });
        }
    });
};
const $8a2a97a0cb171e69$var$centeredWrapper = " sd12 eb12 _Ca12 Za12 Fb12";
const $8a2a97a0cb171e69$export$6ceebe2a029205c = (props)=>{
    let { loadingState: loadingState, onLoadMore: onLoadMore } = props;
    let stringFormatter = (0, $6K4Mt$reactariauseLocalizedStringFormatter.useLocalizedStringFormatter)((0, ($parcel$interopDefault($4526404114e78c80$exports))), '@react-spectrum/s2');
    let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
    return /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)((0, $6K4Mt$reactariacomponentsTree.TreeLoadMoreItem), {
        isLoading: isLoading,
        onLoadMore: onLoadMore,
        className: " Za12 Js12 Gs12",
        children: ()=>{
            return /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)("div", {
                className: $8a2a97a0cb171e69$var$centeredWrapper,
                children: /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)((0, $1c116ea4b0d2d023$exports.ProgressCircle), {
                    isIndeterminate: true,
                    "aria-label": stringFormatter.format('table.loadingMore')
                })
            });
        }
    });
};
const $8a2a97a0cb171e69$var$expandButton = function anonymous(props) {
    let rules = " ";
    rules += ' z8dW5Qb12';
    rules += ' y8dW5Qb12';
    rules += ' B8dW5Qb12';
    rules += ' A8dW5Qb12';
    if (props.isDisabled) {
        rules += ' pp12';
        rules += ' plc12';
    } else rules += ' p40ub4c12';
    rules += ' Fv12';
    rules += ' Zw12';
    rules += ' sd12';
    rules += ' _wb12';
    rules += ' _cb12';
    rules += ' _Ca12';
    rules += ' _Le12';
    rules += ' ri12';
    if (props.isExpanded) {
        if (props.isRTL) rules += ' _Za12';
        else rules += ' _Zb12';
    }
    rules += ' Td12';
    rules += ' Qd12';
    rules += ' Sd12';
    rules += ' Rd12';
    rules += ' Yd12';
    rules += ' Xb12';
    rules += ' _2b12';
    rules += ' g912';
    rules += ' _je12';
    rules += ' __ca12';
    if (props.isHidden) rules += ' _6b12';
    return rules;
};
function $8a2a97a0cb171e69$var$ExpandableRowChevron(props1) {
    let expandButtonRef = (0, $6K4Mt$react.useRef)(null);
    let [fullProps, ref] = (0, $6K4Mt$reactariacomponentsslots.useContextProps)({
        ...props1,
        slot: 'chevron'
    }, expandButtonRef, (0, $6K4Mt$reactariacomponentsButton.ButtonContext));
    let { isExpanded: isExpanded, scale: scale, isHidden: isHidden } = fullProps;
    let { direction: direction } = (0, $6K4Mt$reactariaI18nProvider.useLocale)();
    return /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)((0, $6K4Mt$reactariacomponentsButton.Button), {
        ...props1,
        ref: ref,
        slot: "chevron",
        className: (renderProps)=>$8a2a97a0cb171e69$var$expandButton({
                ...renderProps,
                isExpanded: isExpanded,
                isRTL: direction === 'rtl',
                scale: scale,
                isHidden: isHidden
            }),
        children: /*#__PURE__*/ (0, $6K4Mt$reactjsxruntime.jsx)((0, $1df9f1c9262ce5df$exports.default), {
            className: function anonymous(props) {
                let rules = " ";
                if (props.direction === "rtl") {
                    rules += ' -Z4Pn4c-a12';
                    rules += ' __Ha12';
                } else if (props.direction === "ltr") {
                    rules += ' -Z4Pn4c-b12';
                    rules += ' __Ha12';
                }
                if (props.direction === "rtl") {
                    rules += ' -_04Pn4c-a12';
                    rules += ' __Ha12';
                } else if (props.direction === "ltr") {
                    rules += ' -_04Pn4c-b12';
                    rules += ' __Ha12';
                }
                rules += ' -_8sjo0b-t5ZbAob12';
                return rules;
            }({
                direction: direction
            })
        })
    });
}
function $8a2a97a0cb171e69$var$isNextSelected(id, state) {
    if (id == null || !state) return false;
    let keyAfter = state.collection.getKeyAfter(id);
    // We need to skip non-item nodes because the selection manager will map non-item nodes to their parent before checking selection
    let node = keyAfter ? state.collection.getItem(keyAfter) : null;
    while(node && node.type !== 'item' && keyAfter){
        keyAfter = state.collection.getKeyAfter(keyAfter);
        node = keyAfter ? state.collection.getItem(keyAfter) : null;
    }
    return keyAfter != null && state.selectionManager.isSelected(keyAfter);
}


//# sourceMappingURL=TreeView.cjs.map
