import "./TabsPicker.css";
import {centerBaseline as $1f4b04be3f24aae3$export$9d7e2342a7e53afa} from "./CenterBaseline.mjs";
import {checkmark as $13afb0ea5f0ed767$export$292abbf31ed842a, description as $13afb0ea5f0ed767$export$6d59db4903f20f7d, icon as $13afb0ea5f0ed767$export$1ca1ec8b29a4ce27, label as $13afb0ea5f0ed767$export$1237798dc640739a, menuitem as $13afb0ea5f0ed767$export$f68e44d881264486, sectionHeader as $13afb0ea5f0ed767$export$562e61a0817eb32e, sectionHeading as $13afb0ea5f0ed767$export$300ac6f106ef584d} from "./Menu.mjs";
import $81cf3d4588736e7d$export$2e2bcd8739ae039 from "./Checkmark.mjs";
import $4b69f02ec06b9226$export$2e2bcd8739ae039 from "./Chevron.mjs";
import {FieldLabel as $9afd80978c252040$export$1acdcf5a973a8414} from "./Field.mjs";
import {HeaderContext as $8e847109a6ab556d$export$e0e4026c12a8bdbb, HeadingContext as $8e847109a6ab556d$export$d688439359537581, Text as $8e847109a6ab556d$export$5f1af8db9871e1d6, TextContext as $8e847109a6ab556d$export$9afb8bc826b033ea} from "./Content.mjs";
import {IconContext as $ac8c32e6775ddd1f$export$a49f528ae1a4d0ed} from "../../icons/Icon.mjs";
import {Popover as $88b746eba92c8d0d$export$5b6b19405a83ff9d} from "./Popover.mjs";
import {pressScale as $10ea7662e51a285b$export$56e8cba416805d8d} from "./pressScale.mjs";
import {useFocusableRef as $80ecb974df713a30$export$96a734597687c040} from "./useDOMRef.mjs";
import {useFormProps as $9b916426527cebe7$export$a6b5be5c6b451665} from "./Form.mjs";
import {useSpectrumContextProps as $5ce63c423902f47d$export$764f6146fadd77f7} from "../../icons/useSpectrumContextProps.mjs";
import {jsxs as $vecDw$jsxs, jsx as $vecDw$jsx, Fragment as $vecDw$Fragment} from "react/jsx-runtime";
import {Select as $vecDw$Select, SelectValue as $vecDw$SelectValue} from "react-aria-components/Select";
import {Button as $vecDw$Button} from "react-aria-components/Button";
import {Provider as $vecDw$Provider, DEFAULT_SLOT as $vecDw$DEFAULT_SLOT} from "react-aria-components/slots";
import {ListBox as $vecDw$ListBox, ListBoxItem as $vecDw$ListBoxItem} from "react-aria-components/ListBox";
import {createContext as $vecDw$createContext, forwardRef as $vecDw$forwardRef, useRef as $vecDw$useRef, useContext as $vecDw$useContext} from "react";
import {useLocale as $vecDw$useLocale} from "react-aria/I18nProvider";

/*
 * 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 $0067ea932a992b6a$export$b72b8dade9393cd5 = /*#__PURE__*/ (0, $vecDw$createContext)(null);
const $0067ea932a992b6a$var$inputButton = function anonymous(props) {
    let rules = " ";
    if (props.isFocusVisible) rules += ' _Lf12';
    else rules += ' _Le12';
    rules += ' Oh12';
    rules += ' Olc12';
    rules += ' _Mc12';
    rules += ' _Kd12';
    rules += ' zXcEWr12';
    rules += ' yXcEWr12';
    rules += ' BXcEWr12';
    rules += ' AXcEWr12';
    if (props.size === "XL") rules += ' Nl12';
    else if (props.size === "L") rules += ' Nj12';
    else if (props.size === "S") rules += ' Nf12';
    else if (props.size === "XS") rules += ' Ne12';
    else rules += ' Nk12';
    if (props.isQuiet) rules += ' _qd12';
    else rules += ' _qtb12';
    if (props.size === "XL") rules += ' -Anxdcc-Zt12';
    else if (props.size === "L") rules += ' -Anxdcc-ZStdtne12';
    else if (props.size === "S") rules += ' -Anxdcc-Zr12';
    else rules += ' -Anxdcc-Z3fn9H12';
    rules += ' __v6TNLWb12';
    rules += ' _Pc12';
    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.isDisabled) rules += ' pp12';
    else {
        if (props.isPressed) rules += ' po12';
        else if (props.isFocusVisible) rules += ' po12';
        else if (props.isHovered) rules += ' po12';
        else rules += ' pt12';
    }
    rules += ' sd12';
    rules += ' _Wd12';
    rules += ' _je12';
    rules += ' oa12';
    rules += ' na12';
    rules += ' ka12';
    rules += ' ja12';
    rules += ' eb12';
    rules += ' Yd12';
    rules += ' Xb12';
    rules += ' _2b12';
    rules += ' qc12';
    rules += ' qsd12';
    rules += ' SMBFGYc12';
    rules += ' RfBFGYc12';
    rules += ' g912';
    if (props.isQuiet) rules += ' Ln12';
    rules += ' __ca12';
    if (props.density === "compact") rules += ' Fx12';
    else rules += ' Fz12';
    rules += ' _oa12';
    rules += ' -S_-Sd12';
    rules += ' -R_-Rd12';
    return rules;
};
let $0067ea932a992b6a$export$b1e5508a851be14d = function anonymous(props) {
    let rules = " ";
    rules += ' _Le12';
    rules += ' se12';
    rules += ' Deb5jcb12';
    rules += ' _oa12';
    rules += ' Za12';
    rules += ' K40ub4c12';
    rules += ' _Na12';
    rules += ' Pa12';
    rules += ' Tt12';
    rules += ' Qt12';
    rules += ' St12';
    rules += ' Rt12';
    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';
    }
    return rules;
};
const $0067ea932a992b6a$var$valueStyles = " _ua12 _Nc12 Pc12 _Yb12 _7c12 sd12 eb12 Fb12";
const $0067ea932a992b6a$var$iconStyles = " _va12 _Sd12 -_8sjo0b-t5ZbAob12";
const $0067ea932a992b6a$var$iconCenterWrapper = function anonymous(props) {
    let rules = " ";
    rules += ' sd12';
    rules += ' z2U5Crc12';
    rules += ' y2U5Crc12';
    rules += ' B2U5Crc12';
    rules += ' A2U5Crc12';
    if (props.labelBehavior === "hide") rules += ' SssxDec12';
    return rules;
};
let $0067ea932a992b6a$var$InsideSelectValueContext = /*#__PURE__*/ (0, $vecDw$createContext)(false);
function $0067ea932a992b6a$var$Picker(props1, ref) {
    [props1, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props1, ref, $0067ea932a992b6a$export$b72b8dade9393cd5);
    let domRef = (0, $80ecb974df713a30$export$96a734597687c040)(ref);
    props1 = (0, $9b916426527cebe7$export$a6b5be5c6b451665)(props1);
    let { direction: direction = 'bottom', align: align = 'start', shouldFlip: shouldFlip = true, children: children, items: items, density: density, labelBehavior: labelBehavior = 'show', valueId: valueId, ...pickerProps } = props1;
    let isQuiet = true;
    const menuOffset = 6;
    const size = 'M';
    let ariaLabelledby = props1['aria-labelledby'] ?? '';
    let { direction: dir } = (0, $vecDw$useLocale)();
    let RTLFlipOffset = dir === 'rtl' ? -1 : 1;
    return /*#__PURE__*/ (0, $vecDw$jsxs)("div", {
        children: [
            /*#__PURE__*/ (0, $vecDw$jsx)((0, $vecDw$Select), {
                ...pickerProps,
                className: "",
                "aria-labelledby": `${labelBehavior === 'hide' ? valueId : ''} ${ariaLabelledby}`,
                children: ({ isOpen: isOpen })=>/*#__PURE__*/ (0, $vecDw$jsxs)((0, $vecDw$Fragment), {
                        children: [
                            /*#__PURE__*/ (0, $vecDw$jsx)((0, $9afd80978c252040$export$1acdcf5a973a8414), {
                                isQuiet: isQuiet
                            }),
                            /*#__PURE__*/ (0, $vecDw$jsxs)((0, $vecDw$Button), {
                                ref: domRef,
                                style: (renderProps)=>(0, $10ea7662e51a285b$export$56e8cba416805d8d)(domRef)(renderProps),
                                // Prevent press scale from sticking while Picker is open.
                                // @ts-ignore
                                isPressed: false,
                                className: (renderProps)=>$0067ea932a992b6a$var$inputButton({
                                        ...renderProps,
                                        size: 'M',
                                        isOpen: isOpen,
                                        isQuiet: isQuiet,
                                        density: density
                                    }),
                                children: [
                                    /*#__PURE__*/ (0, $vecDw$jsx)((0, $vecDw$SelectValue), {
                                        className: $0067ea932a992b6a$var$valueStyles + ' ' + "WzII9b",
                                        children: ({ defaultChildren: defaultChildren })=>{
                                            return /*#__PURE__*/ (0, $vecDw$jsx)((0, $vecDw$Provider), {
                                                values: [
                                                    [
                                                        (0, $ac8c32e6775ddd1f$export$a49f528ae1a4d0ed),
                                                        {
                                                            slots: {
                                                                icon: {
                                                                    render: (0, $1f4b04be3f24aae3$export$9d7e2342a7e53afa)({
                                                                        slot: 'icon',
                                                                        styles: $0067ea932a992b6a$var$iconCenterWrapper({
                                                                            labelBehavior: labelBehavior
                                                                        })
                                                                    }),
                                                                    styles: (0, $13afb0ea5f0ed767$export$1ca1ec8b29a4ce27)
                                                                }
                                                            }
                                                        }
                                                    ],
                                                    [
                                                        (0, $8e847109a6ab556d$export$9afb8bc826b033ea),
                                                        {
                                                            slots: {
                                                                // Default slot is useful when converting other collections to PickerItems.
                                                                [(0, $vecDw$DEFAULT_SLOT)]: {
                                                                    id: valueId,
                                                                    styles: function anonymous(props) {
                                                                        let rules = " ";
                                                                        if (props.labelBehavior === "hide") rules += ' sk12';
                                                                        else rules += ' sb12';
                                                                        rules += ' _ub12';
                                                                        rules += ' _Nc12';
                                                                        rules += ' Pc12';
                                                                        rules += ' _Yb12';
                                                                        rules += ' _7c12';
                                                                        return rules;
                                                                    }({
                                                                        labelBehavior: labelBehavior
                                                                    })
                                                                }
                                                            }
                                                        }
                                                    ],
                                                    [
                                                        $0067ea932a992b6a$var$InsideSelectValueContext,
                                                        true
                                                    ]
                                                ],
                                                children: defaultChildren
                                            });
                                        }
                                    }),
                                    /*#__PURE__*/ (0, $vecDw$jsx)((0, $4b69f02ec06b9226$export$2e2bcd8739ae039), {
                                        size: size,
                                        className: $0067ea932a992b6a$var$iconStyles
                                    })
                                ]
                            }),
                            /*#__PURE__*/ (0, $vecDw$jsx)((0, $88b746eba92c8d0d$export$5b6b19405a83ff9d), {
                                hideArrow: true,
                                offset: menuOffset,
                                crossOffset: RTLFlipOffset * -12,
                                placement: `${direction} ${align}`,
                                shouldFlip: shouldFlip,
                                styles: " Nh12 ZbWuche12",
                                children: /*#__PURE__*/ (0, $vecDw$jsx)("div", {
                                    className: " sd12 Za12 Fb12",
                                    children: /*#__PURE__*/ (0, $vecDw$jsx)((0, $vecDw$Provider), {
                                        values: [
                                            [
                                                (0, $8e847109a6ab556d$export$e0e4026c12a8bdbb),
                                                {
                                                    styles: (0, $13afb0ea5f0ed767$export$562e61a0817eb32e)({
                                                        size: size
                                                    })
                                                }
                                            ],
                                            [
                                                (0, $8e847109a6ab556d$export$d688439359537581),
                                                {
                                                    // @ts-ignore
                                                    role: 'presentation',
                                                    styles: (0, $13afb0ea5f0ed767$export$300ac6f106ef584d)
                                                }
                                            ],
                                            [
                                                (0, $8e847109a6ab556d$export$9afb8bc826b033ea),
                                                {
                                                    slots: {
                                                        'description': {
                                                            styles: (0, $13afb0ea5f0ed767$export$6d59db4903f20f7d)({
                                                                size: size,
                                                                isFocused: false,
                                                                isDisabled: false
                                                            })
                                                        }
                                                    }
                                                }
                                            ]
                                        ],
                                        children: /*#__PURE__*/ (0, $vecDw$jsx)((0, $vecDw$ListBox), {
                                            items: items,
                                            className: $0067ea932a992b6a$export$b1e5508a851be14d,
                                            children: children
                                        })
                                    })
                                })
                            })
                        ]
                    })
            }),
            /*#__PURE__*/ (0, $vecDw$jsx)($0067ea932a992b6a$var$TabLine, {
                isDisabled: props1.isDisabled
            })
        ]
    });
}
/**
 * Pickers allow users to choose a single option from a collapsible list of options when space is limited.
 */ let $0067ea932a992b6a$export$ba25329847403e11 = /*#__PURE__*/ (0, $vecDw$forwardRef)($0067ea932a992b6a$var$Picker);
const $0067ea932a992b6a$var$selectedIndicator = function anonymous(props) {
    let rules = " ";
    if (props.isDisabled) rules += ' gH12';
    else rules += ' g012';
    if (props.isDisabled) rules += ' gld12';
    else rules += ' gle12';
    rules += ' FLvNfn12';
    rules += ' _je12';
    rules += ' og12';
    rules += ' ng12';
    rules += ' kg12';
    rules += ' jg12';
    rules += ' Jk7Otrc12';
    rules += ' Xa12';
    rules += ' _2b12';
    return rules;
};
function $0067ea932a992b6a$var$TabLine(props) {
    return /*#__PURE__*/ (0, $vecDw$jsx)("div", {
        className: $0067ea932a992b6a$var$selectedIndicator(props)
    });
}
function $0067ea932a992b6a$export$d601881f38163e28(props) {
    let ref = (0, $vecDw$useRef)(null);
    let isLink = props.href != null;
    const size = 'M';
    return /*#__PURE__*/ (0, $vecDw$jsx)((0, $vecDw$ListBoxItem), {
        ...props,
        ref: ref,
        textValue: props.textValue || (typeof props.children === 'string' ? props.children : undefined),
        style: (0, $10ea7662e51a285b$export$56e8cba416805d8d)(ref, props.UNSAFE_style),
        className: (renderProps)=>(props.UNSAFE_className || '') + (0, $13afb0ea5f0ed767$export$f68e44d881264486)({
                ...renderProps,
                size: size,
                isLink: isLink
            }, props.styles),
        children: (renderProps)=>{
            let { children: children } = props;
            return /*#__PURE__*/ (0, $vecDw$jsx)($0067ea932a992b6a$var$DefaultProvider, {
                context: (0, $ac8c32e6775ddd1f$export$a49f528ae1a4d0ed),
                value: {
                    slots: {
                        icon: {
                            render: (0, $1f4b04be3f24aae3$export$9d7e2342a7e53afa)({
                                slot: 'icon',
                                styles: $0067ea932a992b6a$var$iconCenterWrapper({})
                            }),
                            styles: (0, $13afb0ea5f0ed767$export$1ca1ec8b29a4ce27)
                        }
                    }
                },
                children: /*#__PURE__*/ (0, $vecDw$jsxs)($0067ea932a992b6a$var$DefaultProvider, {
                    context: (0, $8e847109a6ab556d$export$9afb8bc826b033ea),
                    value: {
                        slots: {
                            [(0, $vecDw$DEFAULT_SLOT)]: {
                                styles: (0, $13afb0ea5f0ed767$export$1237798dc640739a)({
                                    size: size
                                })
                            }
                        }
                    },
                    children: [
                        !isLink && /*#__PURE__*/ (0, $vecDw$jsx)((0, $81cf3d4588736e7d$export$2e2bcd8739ae039), {
                            size: size,
                            className: (0, $13afb0ea5f0ed767$export$292abbf31ed842a)({
                                ...renderProps,
                                size: size
                            })
                        }),
                        typeof children === 'string' ? /*#__PURE__*/ (0, $vecDw$jsx)((0, $8e847109a6ab556d$export$5f1af8db9871e1d6), {
                            children: children
                        }) : children
                    ]
                })
            });
        }
    });
}
// A Context.Provider that only sets a value if not inside SelectValue.
function $0067ea932a992b6a$var$DefaultProvider({ context: context, value: value, children: children }) {
    let inSelectValue = (0, $vecDw$useContext)($0067ea932a992b6a$var$InsideSelectValueContext);
    if (inSelectValue) return children;
    return /*#__PURE__*/ (0, $vecDw$jsx)(context.Provider, {
        value: value,
        children: children
    });
}


export {$0067ea932a992b6a$export$b72b8dade9393cd5 as PickerContext, $0067ea932a992b6a$export$b1e5508a851be14d as menu, $0067ea932a992b6a$export$ba25329847403e11 as Picker, $0067ea932a992b6a$export$d601881f38163e28 as PickerItem};
//# sourceMappingURL=TabsPicker.mjs.map
