import "./ListView.css";
import {ActionButtonGroupContext as $10401bdc118cbc90$export$33f5f2f2cb85d743} from "./ActionButtonGroup.mjs";
import {ActionMenuContext as $8bf3cd2442eb485e$export$7f4b66acaca28bd5} from "./ActionMenu.mjs";
import {centerBaseline as $1f4b04be3f24aae3$export$9d7e2342a7e53afa} from "./CenterBaseline.mjs";
import {Checkbox as $9b405e0f8095dce0$export$48513f6b9f8ce62d} from "./Checkbox.mjs";
import $4b69f02ec06b9226$export$2e2bcd8739ae039 from "./Chevron.mjs";
import {IconContext as $ac8c32e6775ddd1f$export$a49f528ae1a4d0ed} from "../icons/Icon.mjs";
import {ImageContext as $dbd6f0b2503b938c$export$8151eb379fcf2442} from "./Image.mjs";
import $alyq6$intlStringsmjs from "./intlStrings.mjs";
import $d9f847a2895a93dc$export$2e2bcd8739ae039 from "./LinkOut.mjs";
import {ProgressCircle as $41ddd91dbbf0c389$export$c79b9d6b4cc92af7} from "./ProgressCircle.mjs";
import {Text as $8e847109a6ab556d$export$5f1af8db9871e1d6, TextContext as $8e847109a6ab556d$export$9afb8bc826b033ea} from "./Content.mjs";
import {useActionBarContainer as $f21f2186348fbc5b$export$13f32e21845e01d0} from "./ActionBar.mjs";
import {useScale as $859432f3b3573fcb$export$a8d2043b2d807f4d} from "./utils.mjs";
import {useSpectrumContextProps as $5ce63c423902f47d$export$764f6146fadd77f7} from "../icons/useSpectrumContextProps.mjs";
import {jsx as $alyq6$jsx, jsxs as $alyq6$jsxs, Fragment as $alyq6$Fragment} from "react/jsx-runtime";
import {CollectionRendererContext as $alyq6$CollectionRendererContext, DefaultCollectionRenderer as $alyq6$DefaultCollectionRenderer, GridListLoadMoreItem as $alyq6$GridListLoadMoreItem, Collection as $alyq6$Collection, Virtualizer as $alyq6$Virtualizer, ListLayout as $alyq6$ListLayout, GridList as $alyq6$GridList, useSlottedContext as $alyq6$useSlottedContext, CheckboxContext as $alyq6$CheckboxContext, GridListItem as $alyq6$GridListItem, Provider as $alyq6$Provider, DEFAULT_SLOT as $alyq6$DEFAULT_SLOT} from "react-aria-components";
import {createContext as $alyq6$createContext, forwardRef as $alyq6$forwardRef, useRef as $alyq6$useRef, useContext as $alyq6$useContext} from "react";
import {useDOMRef as $alyq6$useDOMRef} from "@react-spectrum/utils";
import {useLocalizedStringFormatter as $alyq6$useLocalizedStringFormatter, useLocale as $alyq6$useLocale} from "react-aria";


function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}
/*
 * Copyright 2026 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 $6d4c8b365b6e9016$export$870039b0abfe3de0 = /*#__PURE__*/ (0, $alyq6$createContext)(null);
let $6d4c8b365b6e9016$var$InternalListViewContext = /*#__PURE__*/ (0, $alyq6$createContext)({});
const $6d4c8b365b6e9016$var$listViewWrapper = 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 += ' Na12';
    rules += ' sd12';
    rules += ' _Bb12';
    rules += ' __ca12';
    if (!position) rules += ' _Pc12';
    rules += ' _Nb12';
    rules += ' Pb12';
    return rules;
};
// When any row has a trailing icon, reserve space so actions align.
const $6d4c8b365b6e9016$var$hasTrailingIconRows = ':has([data-has-trailing-icon]) [role="row"]';
const $6d4c8b365b6e9016$var$listView = function anonymous(props) {
    let rules = " ";
    if (props.isFocusVisible) rules += ' _Lf12';
    else rules += ' _Le12';
    rules += ' Oh12';
    rules += ' Olc12';
    rules += ' _Mc12';
    if (props.isQuiet) rules += ' _Ka12';
    else rules += ' _Kb12';
    rules += ' _4c12';
    rules += ' Ma12';
    rules += ' Na12';
    rules += ' Za12';
    rules += ' Fb12';
    rules += ' _oa12';
    rules += ' _Na12';
    rules += ' Pa12';
    if (props.size === "XL") {
        rules += ' -_6BNtrc-e12';
        rules += ' vx12';
    } else if (props.size === "L") {
        rules += ' -_6BNtrc-d12';
        rules += ' vx12';
    } else if (props.size === "S") {
        rules += ' -_6BNtrc-b12';
        rules += ' vx12';
    } else if (props.size === "XS") {
        rules += ' -_6BNtrc-a12';
        rules += ' vx12';
    } else {
        rules += ' -_6BNtrc-c12';
        rules += ' vx12';
    }
    if (props.isQuiet) rules += ' g912';
    else rules += ' gX12';
    rules += ' gla12';
    if (props.isQuiet) rules += ' od12';
    else rules += ' ob12';
    if (props.isQuiet) rules += ' nd12';
    else rules += ' nb12';
    if (props.isQuiet) rules += ' kd12';
    else rules += ' kb12';
    if (props.isQuiet) rules += ' jd12';
    else rules += ' jb12';
    rules += ' iq12';
    if (props.isQuiet) rules += ' _ka12';
    else rules += ' _kb12';
    if (props.isQuiet) rules += ' ha12';
    else rules += ' hb12';
    if (props.isQuiet) rules += ' ma12';
    else rules += ' mb12';
    if (props.isQuiet) rules += ' la12';
    else rules += ' lb12';
    rules += ' _jf12';
    rules += ' -Ev4N4b-Zd12';
    rules += ' -Ev4N4b-1bNH0cZuUmpre12';
    return rules;
};
const $6d4c8b365b6e9016$export$84d0dd190d551cd1 = /*#__PURE__*/ (0, $alyq6$forwardRef)(function ListView(props, ref) {
    [props, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props, ref, $6d4c8b365b6e9016$export$870039b0abfe3de0);
    let { children: children, isQuiet: isQuiet, selectionStyle: selectionStyle = 'checkbox', overflowMode: overflowMode = 'truncate', loadingState: loadingState, onLoadMore: onLoadMore, renderEmptyState: userRenderEmptyState, hideLinkOutIcon: hideLinkOutIcon = false, ...otherProps } = props;
    let scale = (0, $859432f3b3573fcb$export$a8d2043b2d807f4d)();
    let stringFormatter = (0, $alyq6$useLocalizedStringFormatter)((0, ($parcel$interopDefault($alyq6$intlStringsmjs))), '@react-spectrum/s2');
    let rowHeight = scale === 'large' ? 50 : 40;
    let domRef = (0, $alyq6$useDOMRef)(ref);
    let scrollRef = (0, $alyq6$useRef)(null);
    let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
    let renderEmptyState;
    if (userRenderEmptyState != null && !isLoading) renderEmptyState = (renderProps)=>/*#__PURE__*/ (0, $alyq6$jsx)("div", {
            className: $6d4c8b365b6e9016$var$emptyStateWrapper,
            children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $alyq6$CollectionRendererContext).Provider, {
                value: (0, $alyq6$DefaultCollectionRenderer),
                children: userRenderEmptyState(renderProps)
            })
        });
    else if (loadingState === 'loading') renderEmptyState = ()=>/*#__PURE__*/ (0, $alyq6$jsx)("div", {
            className: $6d4c8b365b6e9016$var$centeredWrapper,
            children: /*#__PURE__*/ (0, $alyq6$jsx)("div", {
                className: $6d4c8b365b6e9016$var$loadingSpinnerWrapper,
                children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $41ddd91dbbf0c389$export$c79b9d6b4cc92af7), {
                    isIndeterminate: true,
                    "aria-label": stringFormatter.format('table.loading')
                })
            })
        });
    let loadMoreSpinner = onLoadMore ? /*#__PURE__*/ (0, $alyq6$jsx)((0, $alyq6$GridListLoadMoreItem), {
        isLoading: loadingState === 'loadingMore',
        onLoadMore: onLoadMore,
        className: " Fb12 Za12 Tt12 Qt12",
        children: /*#__PURE__*/ (0, $alyq6$jsx)("div", {
            className: $6d4c8b365b6e9016$var$centeredWrapper,
            children: /*#__PURE__*/ (0, $alyq6$jsx)("div", {
                className: $6d4c8b365b6e9016$var$loadingSpinnerWrapper,
                children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $41ddd91dbbf0c389$export$c79b9d6b4cc92af7), {
                    isIndeterminate: true,
                    "aria-label": stringFormatter.format('table.loadingMore')
                })
            })
        })
    }) : null;
    let wrappedChildren;
    let gridListProps = otherProps;
    if (typeof children === 'function' && otherProps.items) {
        let { items: items, dependencies: dependencies = [], ...rest } = otherProps;
        gridListProps = rest;
        wrappedChildren = /*#__PURE__*/ (0, $alyq6$jsxs)((0, $alyq6$Fragment), {
            children: [
                /*#__PURE__*/ (0, $alyq6$jsx)((0, $alyq6$Collection), {
                    items: items,
                    dependencies: dependencies,
                    children: children
                }),
                loadMoreSpinner
            ]
        });
    } else wrappedChildren = /*#__PURE__*/ (0, $alyq6$jsxs)((0, $alyq6$Fragment), {
        children: [
            children,
            loadMoreSpinner
        ]
    });
    let { selectedKeys: selectedKeys, onSelectionChange: onSelectionChange, actionBar: actionBar, actionBarHeight: actionBarHeight } = (0, $f21f2186348fbc5b$export$13f32e21845e01d0)({
        ...props,
        scrollRef: scrollRef
    });
    return /*#__PURE__*/ (0, $alyq6$jsxs)("div", {
        ref: domRef,
        className: (props.UNSAFE_className || '') + $6d4c8b365b6e9016$var$listViewWrapper(null, props.styles),
        style: props.UNSAFE_style,
        children: [
            /*#__PURE__*/ (0, $alyq6$jsx)((0, $alyq6$Virtualizer), {
                layout: (0, $alyq6$ListLayout),
                layoutOptions: {
                    estimatedRowHeight: rowHeight,
                    loaderHeight: 60
                },
                children: /*#__PURE__*/ (0, $alyq6$jsx)($6d4c8b365b6e9016$var$InternalListViewContext.Provider, {
                    value: {
                        isQuiet: isQuiet,
                        selectionStyle: selectionStyle,
                        overflowMode: overflowMode,
                        scale: scale,
                        hideLinkOutIcon: hideLinkOutIcon
                    },
                    children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $alyq6$GridList), {
                        ref: scrollRef,
                        ...gridListProps,
                        selectionBehavior: selectionStyle === 'highlight' ? 'replace' : 'toggle',
                        selectionMode: gridListProps.selectionMode,
                        renderEmptyState: renderEmptyState,
                        style: {
                            paddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0,
                            scrollPaddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0
                        },
                        className: (renderProps)=>$6d4c8b365b6e9016$var$listView({
                                ...renderProps,
                                isQuiet: isQuiet
                            }),
                        selectedKeys: selectedKeys,
                        defaultSelectedKeys: undefined,
                        onSelectionChange: onSelectionChange,
                        children: wrappedChildren
                    })
                })
            }),
            actionBar
        ]
    });
});
const $6d4c8b365b6e9016$var$selectedBackground = "[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%)]";
const $6d4c8b365b6e9016$var$selectedActiveBackground = "[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%)]";
const $6d4c8b365b6e9016$var$listitem = function anonymous(props) {
    let rules = " ";
    rules += ' _Le12';
    rules += ' _oa12';
    rules += ' qh12';
    rules += ' Sd12';
    rules += ' Rd12';
    rules += ' Tt12';
    rules += ' Qt12';
    rules += ' g912';
    if (props.isDisabled) {
        rules += ' pp12';
        rules += ' plc12';
    } else 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 += ' _Pc12';
    rules += ' z2mU12';
    rules += ' yzZKy12';
    rules += ' se12';
    rules += ' C91zTN12';
    rules += ' DIVIQId12';
    rules += ' Exumf9b12';
    rules += ' UDNKd2dai5a012';
    rules += ' ea12';
    if (props.scale === "large") rules += ' MODqQub12';
    else rules += ' Mh12';
    rules += ' _Xa12';
    if (props.isLink) rules += ' ry12';
    else rules += ' ri12';
    if (props.isSelected) {
        if (props.selectionStyle === "checkbox") rules += ' -EH8uVb-iq12';
        else if (props.selectionStyle === "highlight") rules += ' -EH8uVb-iw12';
    } else rules += ' -EH8uVb-iq12';
    rules += ' -EH8uVb-lia12';
    rules += ' _ka12';
    if (props.isLastItem) {
        if (props.isQuiet) rules += ' ha12';
        else rules += ' hb12';
    } else rules += ' hb12';
    rules += ' ma12';
    rules += ' la12';
    rules += ' _jf12';
    if (props.isSelected) rules += ' iA12';
    else if (props.isNextSelected) rules += ' iA12';
    else rules += ' i4pzfu12';
    return rules;
};
const $6d4c8b365b6e9016$var$listRowBackground = function anonymous(props) {
    let rules = " ";
    if (props.isFocusVisible) rules += ' _Lf12';
    else rules += ' _Le12';
    rules += ' Oh12';
    rules += ' Olc12';
    rules += ' _Mc12';
    rules += ' _Kb12';
    rules += ' _Pa12';
    rules += ' _9a12';
    if (props.isFirstItem) rules += ' Wr12';
    else if (props.isPrevSelected) rules += ' Wr12';
    else if (props.isSelected) rules += ' WLPOtrc12';
    else rules += ' Wr12';
    rules += ' _Er12';
    rules += ' _Rr12';
    if (props.isSelected) rules += ' _lLPOtrc12';
    else rules += ' _lr12';
    if (props.isSelected) {
        if (props.selectionStyle === "highlight") {
            if (props.isPressed) rules += ' gaZwDBe12';
            else if (props.isHovered) rules += ' gaZwDBe12';
            else rules += ' glzvDBe12';
        } else if (props.selectionStyle === "checkbox") {
            if (props.isFocusVisible) rules += ' gRfT7e12';
            else if (props.isPressed) rules += ' gRfT7e12';
            else if (props.isHovered) rules += ' gRfT7e12';
            else rules += ' gj1B7i12';
        }
    } else if (props.isPressed) {
        if (props.selectionStyle === "checkbox") rules += ' gRfT7e12';
        else rules += ' g7IonAe12';
    } else if (props.isHovered) {
        if (props.selectionStyle === "checkbox") rules += ' gj1B7i12';
        else rules += ' gVQkD8c12';
    } else rules += ' gs9yXOb12';
    rules += ' gla12';
    if (props.isFirstItem) {
        if (props.isFocusVisible) rules += ' ob12';
        else if (props.isQuiet) rules += ' ob12';
        else if (props.isSelected) {
            if (props.selectionStyle === "highlight") rules += ' ob12';
            else if (props.selectionStyle === "checkbox") rules += ' od12';
        }
    }
    if (props.isFirstItem) {
        if (props.isFocusVisible) rules += ' nb12';
        else if (props.isQuiet) rules += ' nb12';
        else if (props.isSelected) {
            if (props.selectionStyle === "highlight") rules += ' nb12';
            else if (props.selectionStyle === "checkbox") rules += ' nd12';
        }
    }
    if (props.isLastItem) {
        if (props.isFocusVisible) rules += ' kb12';
        else if (props.isQuiet) rules += ' kb12';
        else if (props.isSelected) {
            if (props.selectionStyle === "highlight") rules += ' kb12';
            else if (props.selectionStyle === "checkbox") rules += ' kd12';
        }
    }
    if (props.isLastItem) {
        if (props.isFocusVisible) rules += ' jb12';
        else if (props.isQuiet) rules += ' jb12';
        else if (props.isSelected) {
            if (props.selectionStyle === "highlight") rules += ' jb12';
            else if (props.selectionStyle === "checkbox") rules += ' jd12';
        }
    }
    if (props.isPrevSelected) rules += ' _ka12';
    else {
        if (props.selectionStyle === "highlight") rules += ' _kb12';
        else if (props.selectionStyle === "checkbox") rules += ' _ka12';
    }
    if (props.isNextSelected) rules += ' ha12';
    else {
        if (props.selectionStyle === "highlight") rules += ' hb12';
        else if (props.selectionStyle === "checkbox") rules += ' ha12';
    }
    if (props.selectionStyle === "highlight") rules += ' mb12';
    else if (props.selectionStyle === "checkbox") rules += ' ma12';
    if (props.selectionStyle === "highlight") rules += ' lb12';
    else if (props.selectionStyle === "checkbox") rules += ' la12';
    rules += ' _jf12';
    if (props.isSelected) {
        if (props.selectionStyle === "highlight") rules += ' i4pzfu12';
        else if (props.selectionStyle === "checkbox") rules += ' iA12';
    } else rules += ' iA12';
    return rules;
};
let $6d4c8b365b6e9016$export$1237798dc640739a = function anonymous(props) {
    let rules = " ";
    rules += ' zv6x9r12';
    rules += ' yv6x9r12';
    rules += ' Bv6x9r12';
    rules += ' Av6x9r12';
    rules += ' _dc12';
    if (props.size === "XL") {
        rules += ' uk12';
        rules += ' ucJ9TBTb12';
        rules += ' ud3Euai12';
        rules += ' uea12';
        rules += ' ugb12';
        rules += ' uhd12';
        rules += ' uje12';
        rules += ' u2NhKxcl12';
        rules += ' uic12';
    } else if (props.size === "L") {
        rules += ' uk12';
        rules += ' ucJ9TBTb12';
        rules += ' ud3Euai12';
        rules += ' uea12';
        rules += ' ugb12';
        rules += ' uhd12';
        rules += ' uje12';
        rules += ' u2NhKxcl12';
        rules += ' uic12';
    } else if (props.size === "S") {
        rules += ' uk12';
        rules += ' ucJ9TBTb12';
        rules += ' ud3Euai12';
        rules += ' uea12';
        rules += ' ugb12';
        rules += ' uhd12';
        rules += ' uje12';
        rules += ' u2NhKxcl12';
        rules += ' uic12';
    } else if (props.size === "XS") {
        rules += ' uk12';
        rules += ' ucJ9TBTb12';
        rules += ' ud3Euai12';
        rules += ' uea12';
        rules += ' ugb12';
        rules += ' uhd12';
        rules += ' uje12';
        rules += ' u2NhKxcl12';
        rules += ' uic12';
    } else {
        rules += ' uk12';
        rules += ' ucJ9TBTb12';
        rules += ' ud3Euai12';
        rules += ' uea12';
        rules += ' ugb12';
        rules += ' uhd12';
        rules += ' uje12';
        rules += ' u2NhKxcl12';
        rules += ' uic12';
    }
    if (props.size === "XL") {
        rules += ' -_6BNtrc-e12';
        rules += ' vx12';
    } else if (props.size === "L") {
        rules += ' -_6BNtrc-d12';
        rules += ' vx12';
    } else if (props.size === "S") {
        rules += ' -_6BNtrc-b12';
        rules += ' vx12';
    } else if (props.size === "XS") {
        rules += ' -_6BNtrc-a12';
        rules += ' vx12';
    } else {
        rules += ' -_6BNtrc-c12';
        rules += ' vx12';
    }
    if (props.size === "XL") {
        rules += ' xb12';
        rules += ' _xa12';
    } else if (props.size === "L") {
        rules += ' xb12';
        rules += ' _xa12';
    } else if (props.size === "S") {
        rules += ' xb12';
        rules += ' _xa12';
    } else if (props.size === "XS") {
        rules += ' xb12';
        rules += ' _xa12';
    } else {
        rules += ' xb12';
        rules += ' _xa12';
    }
    if (props.size === "XL") {
        rules += ' _Fd12';
        rules += ' _FnuYUweb12';
    } else if (props.size === "L") {
        rules += ' _Fd12';
        rules += ' _FnuYUweb12';
    } else if (props.size === "S") {
        rules += ' _Fd12';
        rules += ' _FnuYUweb12';
    } else if (props.size === "XS") {
        rules += ' _Fd12';
        rules += ' _FnuYUweb12';
    } else {
        rules += ' _Fd12';
        rules += ' _FnuYUweb12';
    }
    rules += ' p40ub4c12';
    rules += ' _Nc12';
    rules += ' Pc12';
    rules += ' _Yb12';
    if (props.overflowMode === "wrap") rules += ' _7b12';
    else rules += ' _7c12';
    return rules;
};
let $6d4c8b365b6e9016$export$6d59db4903f20f7d = function anonymous(props) {
    let rules = " ";
    rules += ' z9u7zPc12';
    rules += ' y9u7zPc12';
    rules += ' B9u7zPc12';
    rules += ' A9u7zPc12';
    rules += ' _dc12';
    rules += ' _Nc12';
    rules += ' Pc12';
    rules += ' _Yb12';
    if (props.overflowMode === "wrap") rules += ' _7b12';
    else rules += ' _7c12';
    rules += ' uk12';
    rules += ' ucJ9TBTb12';
    rules += ' ud3Euai12';
    rules += ' uea12';
    rules += ' ugb12';
    rules += ' uhd12';
    rules += ' uje12';
    rules += ' u2NhKxcl12';
    rules += ' uic12';
    rules += ' -_6BNtrc-b12';
    rules += ' vx12';
    rules += ' xb12';
    rules += ' _xa12';
    rules += ' _Fd12';
    rules += ' _FnuYUweb12';
    if (props.isDisabled) rules += ' pp12';
    else {
        if (props.isPressed) rules += ' pt12';
        else if (props.isFocusVisible) rules += ' pt12';
        else if (props.isHovered) rules += ' pt12';
        else rules += ' pv12';
    }
    rules += ' Yd12';
    rules += ' Xb12';
    rules += ' _2b12';
    return rules;
};
let $6d4c8b365b6e9016$export$31d1842a0fd736e6 = " sd12 z2U5Crc12 y2U5Crc12 B2U5Crc12 AvoofG12 _dc12 eb12";
let $6d4c8b365b6e9016$export$1ca1ec8b29a4ce27 = " sb12 ZuUmpre12 FuUmpre12 Ht12 Hsu12 -_8sjo0b-t5ZbAob12";
let $6d4c8b365b6e9016$var$image = " z2U5Crc12 y2U5Crc12 B2U5Crc12 AvoofG12 Ht12 Hsu12 _dc12 oa12 na12 ka12 ja12 ZC12 fa12 _Hb12";
let $6d4c8b365b6e9016$var$actionButtonGroup = " zkG38H12 ykG38H12 BkG38H12 AvoofG12 _dc12 __Ac12 It12 Isu12";
let $6d4c8b365b6e9016$var$listActionMenu = " z6Nrfjc12 y6Nrfjc12 B6Nrfjc12 AvoofG12 _dc12";
const $6d4c8b365b6e9016$var$listCheckbox = function anonymous(props) {
    let rules = " ";
    rules += ' z2CW8rb12';
    rules += ' y2CW8rb12';
    rules += ' B2CW8rb12';
    rules += ' AvoofG12';
    rules += ' _dc12';
    rules += ' Hv12';
    if (props.isDisabled) rules += ' _6b12';
    else rules += ' _6c12';
    return rules;
};
const $6d4c8b365b6e9016$var$listTrailingIcon = " znWsohc12 ynWsohc12 BnWsohc12 AvoofG12 _dc12 sd12 eb12 It12 Isu12";
const $6d4c8b365b6e9016$var$centeredWrapper = " sd12 eb12 _Ca12 Za12 Fb12";
const $6d4c8b365b6e9016$var$loadingSpinnerWrapper = " TuNalie12 QuNalie12 SuNalie12 RuNalie12";
const $6d4c8b365b6e9016$var$emptyStateWrapper = " sd12 eb12 _Ca12 Za12 Fb12 _oa12 Tf12 Qf12 Sf12 Rf12";
function $6d4c8b365b6e9016$var$ListSelectionCheckbox({ isDisabled: isDisabled }) {
    let selectionContext = (0, $alyq6$useSlottedContext)((0, $alyq6$CheckboxContext), 'selection');
    let isSelectionDisabled = isDisabled || !!selectionContext?.isDisabled;
    return /*#__PURE__*/ (0, $alyq6$jsx)("div", {
        className: $6d4c8b365b6e9016$var$listCheckbox({
            isDisabled: isSelectionDisabled
        }),
        children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $9b405e0f8095dce0$export$48513f6b9f8ce62d), {
            slot: "selection"
        })
    });
}
function $6d4c8b365b6e9016$var$isNextSelected(id, state) {
    if (id == null || !state) return false;
    let keyAfter = state.collection.getKeyAfter(id);
    return keyAfter != null && state.selectionManager.isSelected(keyAfter);
}
function $6d4c8b365b6e9016$var$isPrevSelected(id, state) {
    if (id == null || !state) return false;
    let keyBefore = state.collection.getKeyBefore(id);
    return keyBefore != null && state.selectionManager.isSelected(keyBefore);
}
function $6d4c8b365b6e9016$var$isFirstItem(id, state) {
    if (id == null || !state) return false;
    return state.collection.getFirstKey() === id;
}
function $6d4c8b365b6e9016$var$isLastItem(id, state) {
    if (id == null || !state) return false;
    return state.collection.getLastKey() === id;
}
function $6d4c8b365b6e9016$export$c6bde0c04b033c0e(props1) {
    let ref = (0, $alyq6$useRef)(null);
    let { hasChildItems: hasChildItems, ...otherProps } = props1;
    let isLink = props1.href != null;
    let isLinkOut = isLink && props1.target === '_blank';
    let { isQuiet: isQuiet, selectionStyle: selectionStyle, overflowMode: overflowMode, scale: scale, hideLinkOutIcon: hideLinkOutIcon = false } = (0, $alyq6$useContext)($6d4c8b365b6e9016$var$InternalListViewContext);
    let textValue = props1.textValue || (typeof props1.children === 'string' ? props1.children : undefined);
    let { direction: direction } = (0, $alyq6$useLocale)();
    let hasTrailingIcon = hasChildItems || isLinkOut && !hideLinkOutIcon;
    return /*#__PURE__*/ (0, $alyq6$jsx)((0, $alyq6$GridListItem), {
        ...otherProps,
        textValue: textValue,
        ref: ref,
        ...hasTrailingIcon ? {
            'data-has-trailing-icon': ''
        } : {},
        className: (renderProps)=>$6d4c8b365b6e9016$var$listitem({
                ...renderProps,
                isLink: isLink,
                isQuiet: isQuiet,
                scale: scale,
                selectionStyle: selectionStyle,
                isPrevNotSelected: !$6d4c8b365b6e9016$var$isPrevSelected(renderProps.id, renderProps.state),
                isNextSelected: $6d4c8b365b6e9016$var$isNextSelected(renderProps.id, renderProps.state),
                isNextNotSelected: !$6d4c8b365b6e9016$var$isNextSelected(renderProps.id, renderProps.state),
                isFirstItem: $6d4c8b365b6e9016$var$isFirstItem(renderProps.id, renderProps.state),
                isLastItem: $6d4c8b365b6e9016$var$isLastItem(renderProps.id, renderProps.state)
            }),
        children: (renderProps)=>{
            let { children: children } = props1;
            let { selectionMode: selectionMode, selectionBehavior: selectionBehavior, isDisabled: isDisabled, id: id, state: state } = renderProps;
            return /*#__PURE__*/ (0, $alyq6$jsxs)((0, $alyq6$Provider), {
                values: [
                    [
                        (0, $8e847109a6ab556d$export$9afb8bc826b033ea),
                        {
                            slots: {
                                [(0, $alyq6$DEFAULT_SLOT)]: {
                                    styles: $6d4c8b365b6e9016$export$1237798dc640739a({
                                        ...renderProps,
                                        overflowMode: overflowMode
                                    })
                                },
                                label: {
                                    styles: $6d4c8b365b6e9016$export$1237798dc640739a({
                                        ...renderProps,
                                        overflowMode: overflowMode
                                    })
                                },
                                description: {
                                    styles: $6d4c8b365b6e9016$export$6d59db4903f20f7d({
                                        ...renderProps,
                                        overflowMode: overflowMode
                                    })
                                }
                            }
                        }
                    ],
                    [
                        (0, $ac8c32e6775ddd1f$export$a49f528ae1a4d0ed),
                        {
                            slots: {
                                icon: {
                                    render: (0, $1f4b04be3f24aae3$export$9d7e2342a7e53afa)({
                                        slot: 'icon',
                                        styles: $6d4c8b365b6e9016$export$31d1842a0fd736e6
                                    }),
                                    styles: $6d4c8b365b6e9016$export$1ca1ec8b29a4ce27
                                }
                            }
                        }
                    ],
                    [
                        (0, $dbd6f0b2503b938c$export$8151eb379fcf2442),
                        {
                            styles: $6d4c8b365b6e9016$var$image
                        }
                    ],
                    [
                        (0, $10401bdc118cbc90$export$33f5f2f2cb85d743),
                        {
                            styles: $6d4c8b365b6e9016$var$actionButtonGroup,
                            size: 'S',
                            isQuiet: true
                        }
                    ],
                    [
                        (0, $8bf3cd2442eb485e$export$7f4b66acaca28bd5),
                        {
                            styles: $6d4c8b365b6e9016$var$listActionMenu,
                            isQuiet: true,
                            size: 'S',
                            isDisabled: isDisabled
                        }
                    ]
                ],
                children: [
                    /*#__PURE__*/ (0, $alyq6$jsx)("div", {
                        className: $6d4c8b365b6e9016$var$listRowBackground({
                            ...renderProps,
                            selectionStyle: selectionStyle,
                            isQuiet: isQuiet,
                            isPrevSelected: $6d4c8b365b6e9016$var$isPrevSelected(id, state),
                            isNextSelected: $6d4c8b365b6e9016$var$isNextSelected(id, state),
                            isPrevNotSelected: !$6d4c8b365b6e9016$var$isPrevSelected(id, state),
                            isNextNotSelected: !$6d4c8b365b6e9016$var$isNextSelected(id, state),
                            isFirstItem: $6d4c8b365b6e9016$var$isFirstItem(id, state),
                            isLastItem: $6d4c8b365b6e9016$var$isLastItem(id, state)
                        })
                    }),
                    selectionMode !== 'none' && selectionBehavior === 'toggle' && /*#__PURE__*/ (0, $alyq6$jsx)($6d4c8b365b6e9016$var$ListSelectionCheckbox, {
                        isDisabled: isDisabled
                    }),
                    typeof children === 'string' ? /*#__PURE__*/ (0, $alyq6$jsx)((0, $8e847109a6ab556d$export$5f1af8db9871e1d6), {
                        slot: "label",
                        children: children
                    }) : children,
                    isLinkOut && !hideLinkOutIcon && /*#__PURE__*/ (0, $alyq6$jsx)("div", {
                        className: $6d4c8b365b6e9016$var$listTrailingIcon,
                        children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $d9f847a2895a93dc$export$2e2bcd8739ae039), {
                            size: "M",
                            className: function anonymous(props) {
                                let rules = " ";
                                if (props.direction === "rtl") {
                                    rules += ' -Z4Pn4c-a12';
                                    rules += ' __Ha12';
                                }
                                rules += ' -_8sjo0b-t5ZbAob12';
                                return rules;
                            }({
                                direction: direction
                            })
                        })
                    }),
                    hasChildItems && !isLinkOut && /*#__PURE__*/ (0, $alyq6$jsx)("div", {
                        className: $6d4c8b365b6e9016$var$listTrailingIcon,
                        children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $4b69f02ec06b9226$export$2e2bcd8739ae039), {
                            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
                            })
                        })
                    })
                ]
            });
        }
    });
}


export {$6d4c8b365b6e9016$export$870039b0abfe3de0 as ListViewContext, $6d4c8b365b6e9016$export$84d0dd190d551cd1 as ListView, $6d4c8b365b6e9016$export$1237798dc640739a as label, $6d4c8b365b6e9016$export$6d59db4903f20f7d as description, $6d4c8b365b6e9016$export$31d1842a0fd736e6 as iconCenterWrapper, $6d4c8b365b6e9016$export$1ca1ec8b29a4ce27 as icon, $6d4c8b365b6e9016$export$c6bde0c04b033c0e as ListViewItem};
//# sourceMappingURL=ListView.mjs.map
