import "./ComboBox.css";
import {AvatarContext as $3ffa2cd930156220$export$a20dad690e1279e2} from "./Avatar.mjs";
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, iconCenterWrapper as $13afb0ea5f0ed767$export$31d1842a0fd736e6, label as $13afb0ea5f0ed767$export$1237798dc640739a, sectionHeading as $13afb0ea5f0ed767$export$300ac6f106ef584d} from "./Menu.mjs";
import $81cf3d4588736e7d$export$2e2bcd8739ae039 from "./Checkmark.mjs";
import $4b69f02ec06b9226$export$2e2bcd8739ae039 from "./Chevron.mjs";
import {FieldErrorIcon as $9afd80978c252040$export$bda0d075e0e342c9, FieldGroup as $9afd80978c252040$export$f0fe469072bc6950, FieldLabel as $9afd80978c252040$export$1acdcf5a973a8414, HelpText as $9afd80978c252040$export$a67c0bc59081311a, Input as $9afd80978c252040$export$f5b8910cec6cf069} from "./Field.mjs";
import {FormContext as $9b916426527cebe7$export$c24727297075ec6a, useFormProps as $9b916426527cebe7$export$a6b5be5c6b451665} from "./Form.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 $5rXoR$intlStringsmjs from "./intlStrings.mjs";
import {Popover as $88b746eba92c8d0d$export$5b6b19405a83ff9d} from "./Popover.mjs";
import {pressScale as $10ea7662e51a285b$export$56e8cba416805d8d} from "./pressScale.mjs";
import {ProgressCircle as $41ddd91dbbf0c389$export$c79b9d6b4cc92af7} from "./ProgressCircle.mjs";
import {useScale as $859432f3b3573fcb$export$a8d2043b2d807f4d} from "./utils.mjs";
import {useSpectrumContextProps as $5ce63c423902f47d$export$764f6146fadd77f7} from "../icons/useSpectrumContextProps.mjs";
import {jsx as $5rXoR$jsx, Fragment as $5rXoR$Fragment, jsxs as $5rXoR$jsxs} from "react/jsx-runtime";
import {ComboBox as $5rXoR$ComboBox, ListBoxItem as $5rXoR$ListBoxItem, Provider as $5rXoR$Provider, ListBoxSection as $5rXoR$ListBoxSection, ComboBoxStateContext as $5rXoR$ComboBoxStateContext, ListBoxLoadMoreItem as $5rXoR$ListBoxLoadMoreItem, Collection as $5rXoR$Collection, InputContext as $5rXoR$InputContext, Button as $5rXoR$Button, Virtualizer as $5rXoR$Virtualizer, ListLayout as $5rXoR$ListLayout, ListBox as $5rXoR$ListBox, ListStateContext as $5rXoR$ListStateContext} from "react-aria-components";
import {CollectionNode as $5rXoR$CollectionNode, createLeafComponent as $5rXoR$createLeafComponent} from "@react-aria/collections";
import {createContext as $5rXoR$createContext, forwardRef as $5rXoR$forwardRef, useContext as $5rXoR$useContext, useRef as $5rXoR$useRef, useImperativeHandle as $5rXoR$useImperativeHandle, useState as $5rXoR$useState, useCallback as $5rXoR$useCallback, useMemo as $5rXoR$useMemo, useEffect as $5rXoR$useEffect} from "react";
import {createFocusableRef as $5rXoR$createFocusableRef} from "@react-spectrum/utils";
import {useResizeObserver as $5rXoR$useResizeObserver, useSlotId as $5rXoR$useSlotId, mergeRefs as $5rXoR$mergeRefs} from "@react-aria/utils";
import {useLocalizedStringFormatter as $5rXoR$useLocalizedStringFormatter} from "@react-aria/i18n";


function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}
/*
 * 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 $a2f262fac286a920$export$d414ccceff7063c3 = /*#__PURE__*/ (0, $5rXoR$createContext)(null);
const $a2f262fac286a920$var$inputButton = function anonymous(props) {
    let rules = " ";
    if (props.size === "XL") rules += ' -SFnbic-_JaP8ec11';
    else if (props.size === "L") rules += ' -SFnbic-_J0K2hn11';
    else if (props.size === "S") rules += ' -SFnbic-_JJOW22b11';
    else if (props.size === "XS") rules += ' -SFnbic-_JICefdd11';
    else rules += ' -SFnbic-_Jb11';
    rules += ' -Bu7z1c-oa11';
    rules += ' oj11';
    rules += ' nj11';
    rules += ' kj11';
    rules += ' jj11';
    rules += ' sd11';
    rules += ' _Le11';
    rules += ' _Wa11';
    rules += ' _je11';
    rules += ' eb11';
    rules += ' _Ca11';
    if (props.size === "XL") rules += ' ZC11';
    else if (props.size === "L") rules += ' Zo11';
    else if (props.size === "M") rules += ' Zm11';
    else if (props.size === "S") rules += ' Zu11';
    if (props.size === "XL") rules += ' Fx11';
    else if (props.size === "L") rules += ' Fp11';
    else if (props.size === "M") rules += ' Fn11';
    else if (props.size === "S") rules += ' Ft11';
    rules += ' Iw11';
    rules += ' fa11';
    rules += ' _va11';
    rules += ' Yd11';
    rules += ' Yle11';
    rules += ' Xb11';
    rules += ' Xlb11';
    rules += ' _2b11';
    rules += ' _2lb11';
    if (props.isDisabled) rules += ' gH11';
    else if (props.isOpen) rules += ' gF11';
    else {
        if (props.isPressed) rules += ' gF11';
        else if (props.isFocusVisible) rules += ' gF11';
        else if (props.isHovered) rules += ' gF11';
        else rules += ' gH11';
    }
    if (props.isDisabled) rules += ' gld11';
    else if (props.isOpen) rules += ' gle11';
    else if (props.isHovered) rules += ' gle11';
    else rules += ' glc11';
    if (props.isDisabled) rules += ' pp11';
    else {
        if (props.isPressed) rules += ' po11';
        else if (props.isFocusVisible) rules += ' po11';
        else if (props.isHovered) rules += ' po11';
        else rules += ' pt11';
    }
    rules += ' pla11';
    return rules;
};
const $a2f262fac286a920$var$iconStyles = " _va11 _Sd11 -_8sjo0b-t5ZbAob11";
const $a2f262fac286a920$var$loadingWrapperStyles = " z2mU11 yzZKy11 sd11 eb11 _Ca11 Jv11 Gv11";
const $a2f262fac286a920$var$progressCircleStyles = function anonymous(props) {
    let rules = " ";
    if (props.size === "XL") rules += ' Zp11';
    else if (props.size === "L") rules += ' Zn11';
    else if (props.size === "M") rules += ' Zm11';
    else if (props.size === "S") rules += ' Zu11';
    if (props.size === "XL") rules += ' Fq11';
    else if (props.size === "L") rules += ' Fo11';
    else if (props.size === "M") rules += ' Fn11';
    else if (props.size === "S") rules += ' Ft11';
    if (props.isInput) {
        rules += ' It11';
        rules += ' Isu11';
    }
    return rules;
};
const $a2f262fac286a920$var$emptyStateText = function anonymous(props) {
    let rules = " ";
    rules += ' FRuFGYc11';
    if (props.size === "XL") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "L") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "M") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "S") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    }
    if (props.size === "XL") {
        rules += ' -_6BNtrc-e11';
        rules += ' vx11';
    } else if (props.size === "L") {
        rules += ' -_6BNtrc-d11';
        rules += ' vx11';
    } else if (props.size === "M") {
        rules += ' -_6BNtrc-c11';
        rules += ' vx11';
    } else if (props.size === "S") {
        rules += ' -_6BNtrc-b11';
        rules += ' vx11';
    }
    if (props.size === "XL") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "L") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "M") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "S") {
        rules += ' xb11';
        rules += ' _xa11';
    }
    if (props.size === "XL") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "L") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "M") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "S") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    }
    if (props.size === "XL") rules += ' pt11';
    else if (props.size === "L") rules += ' pt11';
    else if (props.size === "M") rules += ' pt11';
    else if (props.size === "S") rules += ' pt11';
    rules += ' sd11';
    rules += ' eb11';
    rules += ' Sv11';
    if (props.size === "XL") rules += ' -F_-Fz11';
    else if (props.size === "L") rules += ' -F_-Fv11';
    else if (props.size === "M") rules += ' -F_-Fx11';
    else if (props.size === "S") rules += ' -F_-Fp11';
    return rules;
};
let $a2f262fac286a920$export$9901d82449b93cea = function anonymous(props) {
    let rules = " ";
    rules += ' Za11';
    rules += ' _oa11';
    rules += ' K40ub4c11';
    rules += ' Pa11';
    rules += ' _Nc11';
    rules += ' uk11';
    rules += ' ucJ9TBTb11';
    rules += ' ud3Euai11';
    rules += ' uea11';
    rules += ' ugb11';
    rules += ' uhd11';
    rules += ' uje11';
    rules += ' u2NhKxcl11';
    rules += ' uic11';
    if (props.size === "XL") {
        rules += ' -_6BNtrc-e11';
        rules += ' vx11';
    } else if (props.size === "L") {
        rules += ' -_6BNtrc-d11';
        rules += ' vx11';
    } else if (props.size === "S") {
        rules += ' -_6BNtrc-b11';
        rules += ' vx11';
    } else if (props.size === "XS") {
        rules += ' -_6BNtrc-a11';
        rules += ' vx11';
    } else {
        rules += ' -_6BNtrc-c11';
        rules += ' vx11';
    }
    rules += ' _Le11';
    return rules;
};
let $a2f262fac286a920$export$68265fb354482bae = function anonymous(props, overrides) {
    let rules = " ";
    let minWidth = false;
    let position = false;
    let gridColumnStart = false;
    let gridColumnEnd = 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)[^\s]+/g);
    for (let p of matches){
        if (p[1] === "N") minWidth = true;
        if (p[1] === "_P") position = true;
        if (p[1] === "z") gridColumnStart = true;
        if (p[1] === "y") gridColumnEnd = true;
        rules += p[0];
    }
    if (props.isFocusVisible) rules += ' _Lf11';
    else rules += ' _Le11';
    rules += ' Oh11';
    rules += ' Olc11';
    rules += ' _Mc11';
    rules += ' _Kd11';
    if (props.size === "XL") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "L") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "S") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "XS") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    }
    if (props.size === "XL") {
        rules += ' -_6BNtrc-e11';
        rules += ' vx11';
    } else if (props.size === "L") {
        rules += ' -_6BNtrc-d11';
        rules += ' vx11';
    } else if (props.size === "S") {
        rules += ' -_6BNtrc-b11';
        rules += ' vx11';
    } else if (props.size === "XS") {
        rules += ' -_6BNtrc-a11';
        rules += ' vx11';
    } else {
        rules += ' -_6BNtrc-c11';
        rules += ' vx11';
    }
    if (props.size === "XL") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "L") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "S") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "XS") {
        rules += ' xb11';
        rules += ' _xa11';
    } else {
        rules += ' xb11';
        rules += ' _xa11';
    }
    if (props.size === "XL") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "L") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "S") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "XS") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    }
    if (props.isDisabled) {
        rules += ' pp11';
        rules += ' plc11';
    } else {
        if (props.isPressed) rules += ' po11';
        else if (props.isFocusVisible) rules += ' po11';
        else if (props.isHovered) rules += ' po11';
        else rules += ' pt11';
    }
    rules += ' se11';
    rules += ' ea11';
    rules += ' _oa11';
    rules += ' Sd11';
    rules += ' Rd11';
    if (props.size === "XL") {
        if (!minWidth) rules += ' Nl11';
    } else if (props.size === "L") {
        if (!minWidth) rules += ' Nj11';
    } else if (props.size === "S") {
        if (!minWidth) rules += ' Nf11';
    } else if (props.size === "XS") {
        if (!minWidth) rules += ' Ne11';
    } else if (!minWidth) rules += ' Nk11';
    if (props.size === "XL") rules += ' -SFnbic-_JaP8ec11';
    else if (props.size === "L") rules += ' -SFnbic-_J0K2hn11';
    else if (props.size === "S") rules += ' -SFnbic-_JJOW22b11';
    else if (props.size === "XS") rules += ' -SFnbic-_JICefdd11';
    else rules += ' -SFnbic-_Jb11';
    rules += ' -Bu7z1c-ob11';
    rules += ' oj11';
    rules += ' nj11';
    rules += ' kj11';
    rules += ' jj11';
    rules += ' qh11';
    rules += ' -Qg41Lb-IAxCW0c11';
    rules += ' -Qg41Lb-gLWx3bIy11';
    rules += ' MAyFGYc11';
    rules += ' Td11';
    rules += ' QAzEcG11';
    rules += ' -aRvJDd-Tu7Fubd11';
    if (props.isFocused) rules += ' gF11';
    else rules += ' g911';
    if (!position) rules += ' _Pc11';
    if (!gridColumnStart) rules += ' z2mU11';
    if (!gridColumnEnd) rules += ' yzZKy11';
    rules += ' CHV1uCd11';
    if (props.size === "XL") rules += ' DTw5ujc11';
    else if (props.size === "L") rules += ' DdpPw411';
    else if (props.size === "M") rules += ' Dxy3qDe11';
    else if (props.size === "S") rules += ' DfLJE011';
    rules += ' EpvfBwb11';
    rules += ' EDNKd2dZQmDFe11';
    rules += ' UDNKd2dai5a011';
    rules += ' FF11';
    rules += ' _Xa11';
    if (props.isLink) rules += ' ry11';
    else rules += ' ri11';
    rules += ' Yd11';
    rules += ' Xb11';
    rules += ' _2b11';
    if (props.size === "XL") rules += ' -M_-Mk11';
    else if (props.size === "L") rules += ' -M_-Mh11';
    else if (props.size === "S") rules += ' -M_-Mg11';
    else if (props.size === "XS") rules += ' -M_-Mf11';
    else rules += ' -M_-Mi11';
    return rules;
};
let $a2f262fac286a920$export$c040ba7a724e8da1 = function anonymous(props) {
    let rules = " ";
    rules += ' pt11';
    rules += ' _oa11';
    rules += ' MAyFGYc11';
    rules += ' Tu7Fubd11';
    rules += ' Qu7Fubd11';
    if (props.size === "XL") rules += ' I2d3n11';
    else if (props.size === "L") rules += ' IaxPIqb11';
    else if (props.size === "M") rules += ' Ip2UVod11';
    else if (props.size === "S") rules += ' IH8XZ7c11';
    if (props.size === "XL") rules += ' H2d3n11';
    else if (props.size === "L") rules += ' HaxPIqb11';
    else if (props.size === "M") rules += ' Hp2UVod11';
    else if (props.size === "S") rules += ' HH8XZ7c11';
    if (props.size === "XL") rules += ' -M_-Mk11';
    else if (props.size === "L") rules += ' -M_-Mh11';
    else if (props.size === "S") rules += ' -M_-Mg11';
    else if (props.size === "XS") rules += ' -M_-Mf11';
    else rules += ' -M_-Mi11';
    return rules;
};
const $a2f262fac286a920$var$separatorWrapper = function anonymous(props) {
    let rules = " ";
    rules += ' sd11';
    if (props.size === "XL") rules += ' I2d3n11';
    else if (props.size === "L") rules += ' IaxPIqb11';
    else if (props.size === "M") rules += ' Ip2UVod11';
    else if (props.size === "S") rules += ' IH8XZ7c11';
    if (props.size === "XL") rules += ' H2d3n11';
    else if (props.size === "L") rules += ' HaxPIqb11';
    else if (props.size === "M") rules += ' Hp2UVod11';
    else if (props.size === "S") rules += ' HH8XZ7c11';
    rules += ' Fk11';
    rules += ' eb11';
    return rules;
};
const $a2f262fac286a920$var$dividerStyle = " gF11 gl_a11 og11 ng11 kg11 jg11 FLvNfn11 Za11";
const $a2f262fac286a920$var$avatar = " z2U5Crc11 y2U5Crc11 B2U5Crc11 A2U5Crc11 Ht11 Hsu11";
const $a2f262fac286a920$export$83379f5245567d78 = {
    S: {
        medium: 24,
        large: 30
    },
    M: {
        medium: 32,
        large: 40
    },
    L: {
        medium: 40,
        large: 50
    },
    XL: {
        medium: 48,
        large: 60
    }
};
let $a2f262fac286a920$var$InternalComboboxContext = /*#__PURE__*/ (0, $5rXoR$createContext)({
    size: 'M'
});
const $a2f262fac286a920$export$72b9695b8216309a = /*#__PURE__*/ (0, $5rXoR$forwardRef)(function ComboBox(props1, ref) {
    [props1, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props1, ref, $a2f262fac286a920$export$d414ccceff7063c3);
    let formContext = (0, $5rXoR$useContext)((0, $9b916426527cebe7$export$c24727297075ec6a));
    props1 = (0, $9b916426527cebe7$export$a6b5be5c6b451665)(props1);
    let { size: size = 'M', labelPosition: labelPosition = 'top', UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, ...comboBoxProps } = props1;
    return /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$ComboBox), {
        ...comboBoxProps,
        allowsEmptyCollection: true,
        style: UNSAFE_style,
        className: UNSAFE_className + function anonymous(props, overrides) {
            let rules = " ";
            let gridColumnStart = false;
            let gridColumnEnd = 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)[^\s]+/g);
            for (let p of matches){
                if (p[1] === "z") gridColumnStart = true;
                if (p[1] === "y") gridColumnEnd = true;
                rules += p[0];
            }
            rules += ' se11';
            if (props.isInForm) {
                if (!gridColumnStart) rules += ' z2mU11';
            }
            if (props.isInForm) {
                if (props.labelPosition === "side") {
                    if (!gridColumnEnd) rules += ' yvoofG11';
                }
            }
            if (props.isInForm) rules += ' DLwlgod11';
            else {
                if (props.labelPosition === "side") rules += ' DPlN5qb11';
                else if (props.labelPosition === "top") rules += ' DM8Mfn11';
            }
            if (props.labelPosition === "side") rules += ' EPlN5qb11';
            else if (props.labelPosition === "top") rules += ' E4w1sLc11';
            if (props.labelPosition === "side") rules += ' CbRM95c11';
            else if (props.labelPosition === "top") rules += ' Cxaocre11';
            if (props.size === "XL") {
                rules += ' -_6BNtrc-e11';
                rules += ' vx11';
            } else if (props.size === "L") {
                rules += ' -_6BNtrc-d11';
                rules += ' vx11';
            } else if (props.size === "S") {
                rules += ' -_6BNtrc-b11';
                rules += ' vx11';
            } else if (props.size === "XS") {
                rules += ' -_6BNtrc-a11';
                rules += ' vx11';
            } else {
                rules += ' -_6BNtrc-c11';
                rules += ' vx11';
            }
            rules += ' ea11';
            rules += ' _Fd11';
            rules += ' _FnuYUweb11';
            if (props.size === "XL") rules += ' -BhX7R-Fz11';
            else if (props.size === "L") rules += ' -BhX7R-Fv11';
            else if (props.size === "S") rules += ' -BhX7R-Fp11';
            else if (props.size === "XS") rules += ' -BhX7R-Fn11';
            else rules += ' -BhX7R-Fx11';
            rules += ' -AJjOLd-UVkF0Db11';
            rules += ' qg11';
            rules += ' __ca11';
            return rules;
        }({
            isInForm: !!formContext,
            labelPosition: labelPosition,
            size: size
        }, props1.styles),
        children: ({ isDisabled: isDisabled, isOpen: isOpen, isRequired: isRequired, isInvalid: isInvalid })=>/*#__PURE__*/ (0, $5rXoR$jsx)($a2f262fac286a920$var$ComboboxInner, {
                ...props1,
                isDisabled: isDisabled,
                isOpen: isOpen,
                isRequired: isRequired,
                isInvalid: isInvalid,
                ref: ref
            })
    });
});
const $a2f262fac286a920$var$avatarSize = {
    S: 16,
    M: 20,
    L: 22,
    XL: 26
};
const $a2f262fac286a920$var$checkmarkIconSize = {
    S: 'XS',
    M: 'M',
    L: 'L',
    XL: 'XL'
};
function $a2f262fac286a920$export$b674b8ff01584ab1(props) {
    let ref = (0, $5rXoR$useRef)(null);
    let isLink = props.href != null;
    let { size: size } = (0, $5rXoR$useContext)($a2f262fac286a920$var$InternalComboboxContext);
    return /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$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 || '') + $a2f262fac286a920$export$68265fb354482bae({
                ...renderProps,
                size: size,
                isLink: isLink
            }, props.styles),
        children: (renderProps)=>{
            let { children: children } = props;
            return /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$Fragment), {
                children: /*#__PURE__*/ (0, $5rXoR$jsxs)((0, $5rXoR$Provider), {
                    values: [
                        [
                            (0, $ac8c32e6775ddd1f$export$a49f528ae1a4d0ed),
                            {
                                slots: {
                                    icon: {
                                        render: (0, $1f4b04be3f24aae3$export$9d7e2342a7e53afa)({
                                            slot: 'icon',
                                            styles: (0, $13afb0ea5f0ed767$export$31d1842a0fd736e6)
                                        }),
                                        styles: (0, $13afb0ea5f0ed767$export$1ca1ec8b29a4ce27)
                                    }
                                }
                            }
                        ],
                        [
                            (0, $3ffa2cd930156220$export$a20dad690e1279e2),
                            {
                                slots: {
                                    avatar: {
                                        size: $a2f262fac286a920$var$avatarSize[size],
                                        styles: $a2f262fac286a920$var$avatar
                                    }
                                }
                            }
                        ],
                        [
                            (0, $8e847109a6ab556d$export$9afb8bc826b033ea),
                            {
                                slots: {
                                    label: {
                                        styles: (0, $13afb0ea5f0ed767$export$1237798dc640739a)({
                                            size: size
                                        })
                                    },
                                    description: {
                                        styles: (0, $13afb0ea5f0ed767$export$6d59db4903f20f7d)({
                                            ...renderProps,
                                            size: size
                                        })
                                    }
                                }
                            }
                        ]
                    ],
                    children: [
                        !isLink && !props.onAction && /*#__PURE__*/ (0, $5rXoR$jsx)((0, $81cf3d4588736e7d$export$2e2bcd8739ae039), {
                            size: $a2f262fac286a920$var$checkmarkIconSize[size],
                            className: (0, $13afb0ea5f0ed767$export$292abbf31ed842a)({
                                ...renderProps,
                                size: size
                            })
                        }),
                        typeof children === 'string' ? /*#__PURE__*/ (0, $5rXoR$jsx)((0, $8e847109a6ab556d$export$5f1af8db9871e1d6), {
                            slot: "label",
                            children: children
                        }) : children
                    ]
                })
            });
        }
    });
}
function $a2f262fac286a920$export$5510125537491b61(props) {
    let { size: size } = (0, $5rXoR$useContext)($a2f262fac286a920$var$InternalComboboxContext);
    return /*#__PURE__*/ (0, $5rXoR$jsxs)((0, $5rXoR$Fragment), {
        children: [
            /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$ListBoxSection), {
                ...props,
                children: props.children
            }),
            /*#__PURE__*/ (0, $5rXoR$jsx)($a2f262fac286a920$export$2e0a83ec2e27ecbb, {
                size: size
            })
        ]
    });
}
const $a2f262fac286a920$var$ComboboxInner = /*#__PURE__*/ (0, $5rXoR$forwardRef)(function ComboboxInner(props1, ref) {
    let { direction: direction = 'bottom', align: align = 'start', shouldFlip: shouldFlip = true, menuWidth: menuWidth, label: label, description: descriptionMessage, errorMessage: errorMessage, children: children, defaultItems: defaultItems, items: items, size: size = 'M', labelPosition: labelPosition = 'top', labelAlign: labelAlign = 'start', necessityIndicator: necessityIndicator, loadingState: loadingState, isDisabled: isDisabled, isOpen: isOpen, isRequired: isRequired, isInvalid: isInvalid, menuTrigger: menuTrigger, onLoadMore: onLoadMore } = props1;
    let stringFormatter = (0, $5rXoR$useLocalizedStringFormatter)((0, ($parcel$interopDefault($5rXoR$intlStringsmjs))), '@react-spectrum/s2');
    let inputRef = (0, $5rXoR$useRef)(null);
    let domRef = (0, $5rXoR$useRef)(null);
    let buttonRef = (0, $5rXoR$useRef)(null);
    // Expose imperative interface for ref
    (0, $5rXoR$useImperativeHandle)(ref, ()=>({
            ...(0, $5rXoR$createFocusableRef)(domRef, inputRef),
            select () {
                if (inputRef.current) inputRef.current.select();
            },
            getInputElement () {
                return inputRef.current;
            }
        }));
    // Better way to encode this into a style? need to account for flipping
    let menuOffset;
    if (size === 'S') menuOffset = 6;
    else if (size === 'M') menuOffset = 6;
    else if (size === 'L') menuOffset = 7;
    else menuOffset = 8;
    let triggerRef = (0, $5rXoR$useRef)(null);
    // Make menu width match input + button
    let [triggerWidth, setTriggerWidth] = (0, $5rXoR$useState)(null);
    let onResize = (0, $5rXoR$useCallback)(()=>{
        if (triggerRef.current) {
            let inputRect = triggerRef.current.getBoundingClientRect();
            let minX = inputRect.left;
            let maxX = inputRect.right;
            setTriggerWidth(maxX - minX + 'px');
        }
    }, [
        triggerRef,
        setTriggerWidth
    ]);
    (0, $5rXoR$useResizeObserver)({
        ref: triggerRef,
        onResize: onResize
    });
    let state = (0, $5rXoR$useContext)((0, $5rXoR$ComboBoxStateContext));
    let timeout = (0, $5rXoR$useRef)(null);
    let [showLoading, setShowLoading] = (0, $5rXoR$useState)(false);
    let isLoadingOrFiltering = loadingState === 'loading' || loadingState === 'filtering';
    let showFieldSpinner = (0, $5rXoR$useMemo)(()=>showLoading && (isOpen || menuTrigger === 'manual' || loadingState === 'loading'), [
        showLoading,
        isOpen,
        menuTrigger,
        loadingState
    ]);
    let spinnerId = (0, $5rXoR$useSlotId)([
        showFieldSpinner
    ]);
    let inputValue = state?.inputValue;
    let lastInputValue = (0, $5rXoR$useRef)(inputValue);
    (0, $5rXoR$useEffect)(()=>{
        if (isLoadingOrFiltering && !showLoading) {
            if (timeout.current === null) timeout.current = setTimeout(()=>{
                setShowLoading(true);
            }, 500);
            // If user is typing, clear the timer and restart since it is a new request
            if (inputValue !== lastInputValue.current) {
                clearTimeout(timeout.current);
                timeout.current = setTimeout(()=>{
                    setShowLoading(true);
                }, 500);
            }
        } else if (!isLoadingOrFiltering) {
            // If loading is no longer happening, clear any timers and hide the loading circle
            setShowLoading(false);
            if (timeout.current) clearTimeout(timeout.current);
            timeout.current = null;
        }
        lastInputValue.current = inputValue;
    }, [
        isLoadingOrFiltering,
        showLoading,
        inputValue
    ]);
    (0, $5rXoR$useEffect)(()=>{
        return ()=>{
            if (timeout.current) clearTimeout(timeout.current);
            timeout.current = null;
        };
    }, []);
    let renderer;
    let listBoxLoadingCircle = /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$ListBoxLoadMoreItem), {
        // Only show the spinner in the list when loading more
        isLoading: loadingState === 'loadingMore',
        onLoadMore: onLoadMore,
        className: $a2f262fac286a920$var$loadingWrapperStyles,
        children: /*#__PURE__*/ (0, $5rXoR$jsx)((0, $41ddd91dbbf0c389$export$c79b9d6b4cc92af7), {
            isIndeterminate: true,
            size: "S",
            styles: $a2f262fac286a920$var$progressCircleStyles({
                size: size
            }),
            // Same loading string as table
            "aria-label": stringFormatter.format('table.loadingMore')
        })
    });
    if (typeof children === 'function') renderer = /*#__PURE__*/ (0, $5rXoR$jsxs)((0, $5rXoR$Fragment), {
        children: [
            /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$Collection), {
                items: items ?? defaultItems,
                dependencies: props1.dependencies,
                children: children
            }),
            listBoxLoadingCircle
        ]
    });
    else // TODO: is there a case where the user might provide items to the Combobox but doesn't provide a function renderer?
    // Same case for other components that have this logic (TableView/CardView/Picker)
    renderer = /*#__PURE__*/ (0, $5rXoR$jsxs)((0, $5rXoR$Fragment), {
        children: [
            children,
            listBoxLoadingCircle
        ]
    });
    let scale = (0, $859432f3b3573fcb$export$a8d2043b2d807f4d)();
    return /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$Fragment), {
        children: /*#__PURE__*/ (0, $5rXoR$jsxs)($a2f262fac286a920$var$InternalComboboxContext.Provider, {
            value: {
                size: size
            },
            children: [
                /*#__PURE__*/ (0, $5rXoR$jsx)((0, $9afd80978c252040$export$1acdcf5a973a8414), {
                    isDisabled: isDisabled,
                    isRequired: isRequired,
                    size: size,
                    labelPosition: labelPosition,
                    labelAlign: labelAlign,
                    necessityIndicator: necessityIndicator,
                    contextualHelp: props1.contextualHelp,
                    children: label
                }),
                /*#__PURE__*/ (0, $5rXoR$jsxs)((0, $9afd80978c252040$export$f0fe469072bc6950), {
                    ref: triggerRef,
                    role: "presentation",
                    isDisabled: isDisabled,
                    isInvalid: isInvalid,
                    size: size,
                    styles: function anonymous(props) {
                        let rules = " ";
                        rules += ' zXcEWr11';
                        rules += ' yXcEWr11';
                        rules += ' BXcEWr11';
                        rules += ' AXcEWr11';
                        if (props.size === "XL") rules += ' Nl11';
                        else if (props.size === "L") rules += ' Nj11';
                        else if (props.size === "S") rules += ' Nf11';
                        else if (props.size === "XS") rules += ' Ne11';
                        else rules += ' Nk11';
                        if (props.isQuiet) rules += ' _qd11';
                        else rules += ' _qtb11';
                        if (props.size === "XL") rules += ' -Anxdcc-Zt11';
                        else if (props.size === "L") rules += ' -Anxdcc-ZStdtne11';
                        else if (props.size === "S") rules += ' -Anxdcc-Zr11';
                        else rules += ' -Anxdcc-Z3fn9H11';
                        rules += ' __v6TNLWb11';
                        rules += ' SMBFGYc11';
                        rules += ' RfBFGYc11';
                        rules += ' -S_-Sv11';
                        rules += ' -R_-Rjxyh811';
                        return rules;
                    }({
                        size: size
                    }),
                    children: [
                        /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$InputContext).Consumer, {
                            children: (ctx)=>/*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$InputContext).Provider, {
                                    value: {
                                        ...ctx,
                                        ref: (0, $5rXoR$mergeRefs)(ctx?.ref, inputRef)
                                    },
                                    children: /*#__PURE__*/ (0, $5rXoR$jsx)((0, $9afd80978c252040$export$f5b8910cec6cf069), {
                                        "aria-describedby": spinnerId
                                    })
                                })
                        }),
                        isInvalid && /*#__PURE__*/ (0, $5rXoR$jsx)((0, $9afd80978c252040$export$bda0d075e0e342c9), {
                            isDisabled: isDisabled
                        }),
                        showFieldSpinner && /*#__PURE__*/ (0, $5rXoR$jsx)((0, $41ddd91dbbf0c389$export$c79b9d6b4cc92af7), {
                            id: spinnerId,
                            isIndeterminate: true,
                            size: "S",
                            styles: $a2f262fac286a920$var$progressCircleStyles({
                                size: size,
                                isInput: true
                            }),
                            "aria-label": stringFormatter.format('table.loading')
                        }),
                        /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$Button), {
                            ref: buttonRef,
                            // Prevent press scale from sticking while ComboBox is open.
                            // @ts-ignore
                            isPressed: false,
                            style: (renderProps)=>(0, $10ea7662e51a285b$export$56e8cba416805d8d)(buttonRef)(renderProps),
                            className: (renderProps)=>$a2f262fac286a920$var$inputButton({
                                    ...renderProps,
                                    size: size,
                                    isOpen: isOpen
                                }),
                            children: /*#__PURE__*/ (0, $5rXoR$jsx)((0, $4b69f02ec06b9226$export$2e2bcd8739ae039), {
                                size: size,
                                className: $a2f262fac286a920$var$iconStyles
                            })
                        })
                    ]
                }),
                /*#__PURE__*/ (0, $5rXoR$jsx)((0, $9afd80978c252040$export$a67c0bc59081311a), {
                    size: size,
                    isDisabled: isDisabled,
                    isInvalid: isInvalid,
                    description: descriptionMessage,
                    children: errorMessage
                }),
                /*#__PURE__*/ (0, $5rXoR$jsx)((0, $88b746eba92c8d0d$export$5b6b19405a83ff9d), {
                    hideArrow: true,
                    triggerRef: triggerRef,
                    offset: menuOffset,
                    placement: `${direction} ${align}`,
                    shouldFlip: shouldFlip,
                    UNSAFE_style: {
                        '--trigger-width': menuWidth ? menuWidth + 'px' : triggerWidth
                    },
                    padding: "none",
                    styles: " NuHSBze11 ZuHSBze11",
                    children: /*#__PURE__*/ (0, $5rXoR$jsx)("div", {
                        className: " sd11 Za11 Fb11",
                        children: /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$Provider), {
                            values: [
                                [
                                    (0, $8e847109a6ab556d$export$e0e4026c12a8bdbb),
                                    {
                                        styles: $a2f262fac286a920$export$c040ba7a724e8da1({
                                            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
                                                })
                                            }
                                        }
                                    }
                                ]
                            ],
                            children: /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$Virtualizer), {
                                layout: (0, $5rXoR$ListLayout),
                                layoutOptions: {
                                    estimatedRowHeight: 32,
                                    padding: 8,
                                    estimatedHeadingHeight: 50,
                                    loaderHeight: $a2f262fac286a920$export$83379f5245567d78[size][scale]
                                },
                                children: /*#__PURE__*/ (0, $5rXoR$jsx)((0, $5rXoR$ListBox), {
                                    dependencies: props1.dependencies,
                                    renderEmptyState: ()=>/*#__PURE__*/ (0, $5rXoR$jsx)("span", {
                                            className: $a2f262fac286a920$var$emptyStateText({
                                                size: size
                                            }),
                                            children: loadingState === 'loading' ? stringFormatter.format('table.loading') : stringFormatter.format('combobox.noResults')
                                        }),
                                    items: items,
                                    className: $a2f262fac286a920$export$9901d82449b93cea({
                                        size: size
                                    }),
                                    children: renderer
                                })
                            })
                        })
                    })
                })
            ]
        })
    });
});
class $a2f262fac286a920$var$SeparatorNode extends (0, $5rXoR$CollectionNode) {
    static{
        this.type = 'separator';
    }
    filter(collection, newCollection) {
        let prevItem = newCollection.getItem(this.prevKey);
        if (prevItem && prevItem.type !== 'separator') {
            let clone = this.clone();
            newCollection.addDescendants(clone, collection);
            return clone;
        }
        return null;
    }
}
const $a2f262fac286a920$export$2e0a83ec2e27ecbb = /*#__PURE__*/ (0, $5rXoR$createLeafComponent)($a2f262fac286a920$var$SeparatorNode, function Divider({ size: size }, ref, node) {
    let listState = (0, $5rXoR$useContext)((0, $5rXoR$ListStateContext));
    let nextNode = node.nextKey != null && listState.collection.getItem(node.nextKey);
    if (node.prevKey == null || !nextNode || nextNode.type === 'separator' || nextNode.type === 'loader' && nextNode.nextKey == null) return null;
    return /*#__PURE__*/ (0, $5rXoR$jsx)("div", {
        className: $a2f262fac286a920$var$separatorWrapper({
            size: size
        }),
        children: /*#__PURE__*/ (0, $5rXoR$jsx)("div", {
            ref: ref,
            className: $a2f262fac286a920$var$dividerStyle
        })
    });
});


export {$a2f262fac286a920$export$d414ccceff7063c3 as ComboBoxContext, $a2f262fac286a920$export$9901d82449b93cea as listbox, $a2f262fac286a920$export$68265fb354482bae as listboxItem, $a2f262fac286a920$export$c040ba7a724e8da1 as listboxHeader, $a2f262fac286a920$export$83379f5245567d78 as LOADER_ROW_HEIGHTS, $a2f262fac286a920$export$72b9695b8216309a as ComboBox, $a2f262fac286a920$export$b674b8ff01584ab1 as ComboBoxItem, $a2f262fac286a920$export$5510125537491b61 as ComboBoxSection, $a2f262fac286a920$export$2e0a83ec2e27ecbb as Divider};
//# sourceMappingURL=ComboBox.mjs.map
