require("./Menu.css");
var $af04e099a53d3e85$exports = require("./Checkbox.cjs");
var $e991cbcdf82ced71$exports = require("./CenterBaseline.cjs");
var $dba2b18fc5727f9b$exports = require("./Checkmark.cjs");
var $1df9f1c9262ce5df$exports = require("./Chevron.cjs");
var $2d04acb918636de0$exports = require("./Divider.cjs");
var $6367bc87eb7d24ad$exports = require("./Content.cjs");
var $bde97c91243ed164$exports = require("../icons/Icon.cjs");
var $053b76ed3d29e13b$exports = require("./Image.cjs");
var $493371ef39bf7a55$exports = require("./Popover.cjs");
var $377d9a1b51957cfd$exports = require("./LinkOut.cjs");
var $308b180f49d82d28$exports = require("../icons/runtime.cjs");
var $2061c83559b50a66$exports = require("./pressScale.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $4tP7K$reactjsxruntime = require("react/jsx-runtime");
var $4tP7K$reactariacomponents = require("react-aria-components");
var $4tP7K$react = require("react");
var $4tP7K$reactaria = require("react-aria");
var $4tP7K$reactariainteractions = require("@react-aria/interactions");
var $4tP7K$reactariautils = require("@react-aria/utils");


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

$parcel$export(module.exports, "MenuContext", () => $e741ea6b88ce4866$export$c7e742effb1c51e2);
$parcel$export(module.exports, "sectionHeader", () => $e741ea6b88ce4866$export$562e61a0817eb32e);
$parcel$export(module.exports, "sectionHeading", () => $e741ea6b88ce4866$export$300ac6f106ef584d);
$parcel$export(module.exports, "menuitem", () => $e741ea6b88ce4866$export$f68e44d881264486);
$parcel$export(module.exports, "checkmark", () => $e741ea6b88ce4866$export$292abbf31ed842a);
$parcel$export(module.exports, "checkbox", () => $e741ea6b88ce4866$export$b07e517d22efa1ca);
$parcel$export(module.exports, "icon", () => $e741ea6b88ce4866$export$1ca1ec8b29a4ce27);
$parcel$export(module.exports, "iconCenterWrapper", () => $e741ea6b88ce4866$export$31d1842a0fd736e6);
$parcel$export(module.exports, "label", () => $e741ea6b88ce4866$export$1237798dc640739a);
$parcel$export(module.exports, "description", () => $e741ea6b88ce4866$export$6d59db4903f20f7d);
$parcel$export(module.exports, "Menu", () => $e741ea6b88ce4866$export$d9b273488cd8ce6f);
$parcel$export(module.exports, "MenuSection", () => $e741ea6b88ce4866$export$4b1545b4f2016d26);
$parcel$export(module.exports, "MenuItem", () => $e741ea6b88ce4866$export$2ce376c2cc3355c8);
$parcel$export(module.exports, "MenuTrigger", () => $e741ea6b88ce4866$export$27d2ad3c5815583e);
$parcel$export(module.exports, "SubmenuTrigger", () => $e741ea6b88ce4866$export$ecabc99eeffab7ca);
/*
 * 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 $e741ea6b88ce4866$export$c7e742effb1c51e2 = /*#__PURE__*/ (0, $4tP7K$react.createContext)(null);
const $e741ea6b88ce4866$var$menuItemGrid = {
    size: {
        S: [
            "calc(1.5rem * 3 / 8)",
            'auto',
            'auto',
            'minmax(0, 1fr)',
            'auto',
            'auto',
            'auto',
            "calc(1.5rem * 3 / 8)"
        ],
        M: [
            "calc(2rem * 3 / 8)",
            'auto',
            'auto',
            'minmax(0, 1fr)',
            'auto',
            'auto',
            'auto',
            "calc(2rem * 3 / 8)"
        ],
        L: [
            "calc(2.5rem * 3 / 8)",
            'auto',
            'auto',
            'minmax(0, 1fr)',
            'auto',
            'auto',
            'auto',
            "calc(2.5rem * 3 / 8)"
        ],
        XL: [
            "calc(3rem * 3 / 8)",
            'auto',
            'auto',
            'minmax(0, 1fr)',
            'auto',
            'auto',
            'auto',
            "calc(3rem * 3 / 8)"
        ]
    }
};
let $e741ea6b88ce4866$export$b1e5508a851be14d = function anonymous(props, overrides) {
    let rules = " ";
    let width = false;
    let maxWidth = 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") width = true;
        if (p[1] === "L") maxWidth = true;
        rules += p[0];
    }
    rules += ' _Le11';
    rules += ' se11';
    if (props.size === "XL") rules += ' Dk92HIe11';
    else if (props.size === "L") rules += ' DyaX9Fb11';
    else if (props.size === "M") rules += ' Deb5jcb11';
    else if (props.size === "S") rules += ' DGTLJAe11';
    rules += ' _oa11';
    rules += ' K40ub4c11';
    if (!width) rules += ' Za11';
    if (props.isPopover) rules += ' _Na11';
    if (props.isPopover) rules += ' Pa11';
    if (props.isPopover) {
        if (!maxWidth) rules += ' Lh11';
    }
    if (props.isPopover) rules += ' Tt11';
    if (props.isPopover) rules += ' Qt11';
    if (props.isPopover) rules += ' St11';
    if (props.isPopover) rules += ' Rt11';
    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 += ' __ya11';
    return rules;
};
let $e741ea6b88ce4866$export$fe2e36411d703b3d = function anonymous(props) {
    let rules = " ";
    rules += ' z2mU11';
    rules += ' yzZKy11';
    rules += ' eb11';
    rules += ' se11';
    rules += ' CcAc39c11';
    if (props.size === "XL") rules += ' Dk92HIe11';
    else if (props.size === "L") rules += ' DyaX9Fb11';
    else if (props.size === "M") rules += ' Deb5jcb11';
    else if (props.size === "S") rules += ' DGTLJAe11';
    return rules;
};
let $e741ea6b88ce4866$export$562e61a0817eb32e = function anonymous(props) {
    let rules = " ";
    rules += ' pt11';
    rules += ' z3mU11';
    rules += ' yAZKy11';
    rules += ' _oa11';
    rules += ' MAyFGYc11';
    rules += ' Tu7Fubd11';
    rules += ' Qu7Fubd11';
    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 $e741ea6b88ce4866$export$300ac6f106ef584d = " uk11 ucJ9TBTb11 ud3Euai11 uea11 ugb11 uhd11 uje11 u2NhKxcl11 uic11 -_6BNtrc-c11 vx11 xd11 _xa11 xX0cczbc11 _xX0cczba11 _Fd11 _FnuYUweb11 pt11 Jy11 Gy11 Iy11 Hy11";
let $e741ea6b88ce4866$export$f68e44d881264486 = 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';
        if (props.isFocused) rules += ' ple11';
        else rules += ' plb11';
    }
    rules += ' se11';
    rules += ' ea11';
    rules += ' egLWx3bb11';
    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';
        rules += ' gle11';
    } else rules += ' g911';
    if (!position) rules += ' _Pc11';
    if (!gridColumnStart) rules += ' z2mU11';
    if (!gridColumnEnd) rules += ' yzZKy11';
    rules += ' CcAc39c11';
    rules += ' DLwlgod11';
    rules += ' EpvfBwb11';
    rules += ' EDNKd2dZQmDFe11';
    rules += ' UDNKd2dai5a011';
    rules += ' FF11';
    rules += ' _Xa11';
    if (props.isLink) rules += ' ry11';
    else rules += ' ri11';
    rules += ' Yd11';
    rules += ' Xb11';
    rules += ' _2b11';
    rules += ' _yb11';
    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 $e741ea6b88ce4866$export$292abbf31ed842a = function anonymous(props) {
    let rules = " ";
    if (props.isSelected) rules += ' _6c11';
    else rules += ' _6b11';
    rules += ' z2CW8rb11';
    rules += ' y2CW8rb11';
    rules += ' B2CW8rb11';
    rules += ' A2CW8rb11';
    if (props.isPressed) rules += ' ps11';
    else if (props.isFocusVisible) rules += ' ps11';
    else if (props.isHovered) rules += ' ps11';
    else rules += ' pu11';
    rules += ' -_8sjo0b-t5ZbAob11';
    if (props.isFocused) rules += ' -_8sjo0b-lt8pvGJ11';
    else rules += ' -_8sjo0b-lta11';
    rules += ' Hw11';
    rules += ' fa11';
    return rules;
};
let $e741ea6b88ce4866$export$b07e517d22efa1ca = " z2CW8rb11 y2CW8rb11 B2CW8rb11 A2CW8rb11 Hw11";
let $e741ea6b88ce4866$export$1ca1ec8b29a4ce27 = " sb11 ZuUmpre11 FuUmpre11 Ht11 Hsu11 -_8sjo0b-t5ZbAob11";
let $e741ea6b88ce4866$export$31d1842a0fd736e6 = " sd11 z2U5Crc11 y2U5Crc11 B2U5Crc11 A2U5Crc11";
let $e741ea6b88ce4866$var$image = function anonymous(props) {
    let rules = " ";
    rules += ' z2U5Crc11';
    rules += ' y2U5Crc11';
    rules += ' B2U5Crc11';
    rules += ' AvoofG11';
    rules += ' Ht11';
    rules += ' Hsu11';
    rules += ' Jt11';
    rules += ' _dc11';
    rules += ' oa11';
    rules += ' na11';
    rules += ' ka11';
    rules += ' ja11';
    if (props.size === "XL") rules += ' ZF11';
    else if (props.size === "L") rules += ' Zx11';
    else if (props.size === "M") rules += ' Zw11';
    else if (props.size === "S") rules += ' ZC11';
    else rules += ' Zw11';
    if (props.size === "XL") rules += ' Fz11';
    else if (props.size === "L") rules += ' Fw11';
    else if (props.size === "M") rules += ' Fv11';
    else if (props.size === "S") rules += ' Fx11';
    else rules += ' Fv11';
    rules += ' fa11';
    rules += ' _Ha11';
    return rules;
};
let $e741ea6b88ce4866$export$1237798dc640739a = function anonymous(props) {
    let rules = " ";
    rules += ' zv6x9r11';
    rules += ' yv6x9r11';
    rules += ' Bv6x9r11';
    rules += ' Av6x9r11';
    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';
    }
    rules += ' xc11';
    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';
    }
    rules += ' p40ub4c11';
    rules += ' JAzEcG11';
    return rules;
};
let $e741ea6b88ce4866$export$6d59db4903f20f7d = function anonymous(props) {
    let rules = " ";
    rules += ' z9u7zPc11';
    rules += ' y9u7zPc11';
    rules += ' B9u7zPc11';
    rules += ' A9u7zPc11';
    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';
    } 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-d11';
        rules += ' vx11';
    } else if (props.size === "L") {
        rules += ' -_6BNtrc-c11';
        rules += ' vx11';
    } else if (props.size === "M") {
        rules += ' -_6BNtrc-b11';
        rules += ' vx11';
    } else if (props.size === "S") {
        rules += ' -_6BNtrc-a11';
        rules += ' vx11';
    } else {
        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';
    } 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 === "M") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "S") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    }
    if (props.isDisabled) rules += ' pp11';
    else if (props.isFocused) rules += ' pt11';
    else {
        if (props.isPressed) rules += ' pt11';
        else if (props.isFocusVisible) rules += ' pt11';
        else if (props.isHovered) rules += ' pt11';
        else rules += ' pv11';
    }
    rules += ' Yd11';
    rules += ' Xb11';
    rules += ' _2b11';
    return rules;
};
let $e741ea6b88ce4866$var$value = " z8bmXs11 y8bmXs11 B8bmXs11 A8bmXs11 Iv11";
let $e741ea6b88ce4866$var$keyboard = function anonymous(props) {
    let rules = " ";
    rules += ' z45MTAd11';
    rules += ' y45MTAd11';
    rules += ' B45MTAd11';
    rules += ' A45MTAd11';
    rules += ' Iv11';
    rules += ' uk11';
    rules += ' ucJ9TBTb11';
    rules += ' ud3Euai11';
    rules += ' uea11';
    rules += ' ugb11';
    rules += ' uhd11';
    rules += ' uje11';
    rules += ' u2NhKxcl11';
    rules += ' uic11';
    rules += ' -_6BNtrc-c11';
    rules += ' vx11';
    rules += ' xb11';
    rules += ' _xa11';
    rules += ' _Fd11';
    rules += ' _FnuYUweb11';
    if (props.isDisabled) rules += ' pp11';
    else rules += ' pn11';
    if (props.isDisabled) rules += ' plc11';
    rules += ' _Wb11';
    rules += ' _3f11';
    return rules;
};
let $e741ea6b88ce4866$var$descriptor = " z0cdLvd11 y0cdLvd11 B0cdLvd11 A0cdLvd11 Iv11 -_8sjo0b-t5ZbAob11";
let $e741ea6b88ce4866$var$InternalMenuContext = /*#__PURE__*/ (0, $4tP7K$react.createContext)({
    size: 'M',
    isSubmenu: false,
    hideLinkOutIcon: false
});
let $e741ea6b88ce4866$var$InternalMenuTriggerContext = /*#__PURE__*/ (0, $4tP7K$react.createContext)(null);
let $e741ea6b88ce4866$var$wrappingDiv = " sd11 Za11 Fb11";
const $e741ea6b88ce4866$export$d9b273488cd8ce6f = /*#__PURE__*/ (0, $4tP7K$react.forwardRef)(function Menu(props, ref) {
    [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $e741ea6b88ce4866$export$c7e742effb1c51e2);
    let { isSubmenu: isSubmenu, size: ctxSize } = (0, $4tP7K$react.useContext)($e741ea6b88ce4866$var$InternalMenuContext);
    let { children: children, size: size = ctxSize, UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className, styles: styles, hideLinkOutIcon: hideLinkOutIcon = false } = props;
    let ctx = (0, $4tP7K$react.useContext)($e741ea6b88ce4866$var$InternalMenuTriggerContext);
    let inPopover = (0, $4tP7K$react.useContext)((0, $493371ef39bf7a55$exports.InPopoverContext));
    let isPopover = (ctx || isSubmenu) && !inPopover;
    let content = /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)($e741ea6b88ce4866$var$InternalMenuContext.Provider, {
        value: {
            size: size,
            isSubmenu: true,
            hideLinkOutIcon: hideLinkOutIcon
        },
        children: /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $4tP7K$reactariacomponents.Provider), {
            values: [
                [
                    (0, $6367bc87eb7d24ad$exports.HeaderContext),
                    {
                        styles: $e741ea6b88ce4866$export$562e61a0817eb32e({
                            size: size
                        })
                    }
                ],
                [
                    (0, $6367bc87eb7d24ad$exports.HeadingContext),
                    {
                        // @ts-ignore
                        role: 'presentation',
                        styles: $e741ea6b88ce4866$export$300ac6f106ef584d
                    }
                ],
                [
                    (0, $6367bc87eb7d24ad$exports.TextContext),
                    {
                        slots: {
                            'description': {
                                styles: $e741ea6b88ce4866$export$6d59db4903f20f7d({
                                    size: size
                                })
                            }
                        }
                    }
                ],
                [
                    (0, $493371ef39bf7a55$exports.InPopoverContext),
                    false
                ]
            ],
            children: /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $4tP7K$reactariacomponents.Menu), {
                ...props,
                className: $e741ea6b88ce4866$export$b1e5508a851be14d({
                    size: size,
                    isPopover: isPopover
                }, isPopover ? null : styles),
                children: children
            })
        })
    });
    if (isPopover) return /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $493371ef39bf7a55$exports.Popover), {
        ref: ref,
        padding: "none",
        hideArrow: true,
        children: /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)("div", {
            style: UNSAFE_style,
            className: (UNSAFE_className || '') + $e741ea6b88ce4866$var$wrappingDiv,
            children: content
        })
    });
    return content;
});
function $e741ea6b88ce4866$export$2e0a83ec2e27ecbb(props) {
    return /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $4tP7K$reactariacomponents.Separator), {
        ...props,
        className: (0, $308b180f49d82d28$exports.mergeStyles)((0, $2d04acb918636de0$exports.divider)({
            size: 'M',
            orientation: 'horizontal',
            isStaticColor: false
        }), " se11 skk11 z3mU11 yAZKy11 JydxGIe11 GydxGIe11")
    });
}
function $e741ea6b88ce4866$export$4b1545b4f2016d26(props) {
    // remember, context doesn't work if it's around Section nor inside
    let { size: size } = (0, $4tP7K$react.useContext)($e741ea6b88ce4866$var$InternalMenuContext);
    return /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsxs)((0, $4tP7K$reactjsxruntime.Fragment), {
        children: [
            /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $4tP7K$reactariacomponents.MenuSection), {
                ...props,
                className: $e741ea6b88ce4866$export$fe2e36411d703b3d({
                    size: size
                }),
                children: props.children
            }),
            /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)($e741ea6b88ce4866$export$2e0a83ec2e27ecbb, {})
        ]
    });
}
const $e741ea6b88ce4866$var$checkmarkIconSize = {
    S: 'XS',
    M: 'M',
    L: 'L',
    XL: 'XL'
};
const $e741ea6b88ce4866$var$linkIconSize = {
    S: 'M',
    M: 'L',
    L: 'XL',
    XL: 'XL'
};
function $e741ea6b88ce4866$export$2ce376c2cc3355c8(props1) {
    let ref = (0, $4tP7K$react.useRef)(null);
    let isLink = props1.href != null;
    let isLinkOut = isLink && props1.target === '_blank';
    let { size: size, hideLinkOutIcon: hideLinkOutIcon } = (0, $4tP7K$react.useContext)($e741ea6b88ce4866$var$InternalMenuContext);
    let textValue = props1.textValue || (typeof props1.children === 'string' ? props1.children : undefined);
    let { direction: direction } = (0, $4tP7K$reactaria.useLocale)();
    return /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $4tP7K$reactariacomponents.MenuItem), {
        ...props1,
        textValue: textValue,
        ref: ref,
        style: (0, $2061c83559b50a66$exports.pressScale)(ref, props1.UNSAFE_style),
        className: (renderProps)=>(props1.UNSAFE_className || '') + $e741ea6b88ce4866$export$f68e44d881264486({
                ...renderProps,
                isFocused: renderProps.hasSubmenu && renderProps.isOpen || renderProps.isFocused,
                size: size,
                isLink: isLink
            }, props1.styles),
        children: (renderProps)=>{
            let { children: children } = props1;
            let checkboxRenderProps = {
                ...renderProps,
                size: size,
                isFocused: false,
                isFocusVisible: false,
                isIndeterminate: false,
                isReadOnly: false,
                isInvalid: false,
                isRequired: false
            };
            return /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $4tP7K$reactjsxruntime.Fragment), {
                children: /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsxs)((0, $4tP7K$reactariacomponents.Provider), {
                    values: [
                        [
                            (0, $bde97c91243ed164$exports.IconContext),
                            {
                                slots: {
                                    icon: {
                                        render: (0, $e991cbcdf82ced71$exports.centerBaseline)({
                                            slot: 'icon',
                                            styles: $e741ea6b88ce4866$export$31d1842a0fd736e6
                                        }),
                                        styles: $e741ea6b88ce4866$export$1ca1ec8b29a4ce27
                                    },
                                    descriptor: {
                                        render: (0, $e991cbcdf82ced71$exports.centerBaseline)({
                                            slot: 'descriptor',
                                            styles: $e741ea6b88ce4866$var$descriptor
                                        })
                                    } // TODO: remove once we have default?
                                }
                            }
                        ],
                        [
                            (0, $6367bc87eb7d24ad$exports.TextContext),
                            {
                                slots: {
                                    [(0, $4tP7K$reactariacomponents.DEFAULT_SLOT)]: {
                                        styles: $e741ea6b88ce4866$export$1237798dc640739a({
                                            size: size
                                        })
                                    },
                                    label: {
                                        styles: $e741ea6b88ce4866$export$1237798dc640739a({
                                            size: size
                                        })
                                    },
                                    description: {
                                        styles: $e741ea6b88ce4866$export$6d59db4903f20f7d({
                                            ...renderProps,
                                            size: size
                                        })
                                    },
                                    value: {
                                        styles: $e741ea6b88ce4866$var$value
                                    }
                                }
                            }
                        ],
                        [
                            (0, $6367bc87eb7d24ad$exports.KeyboardContext),
                            {
                                styles: $e741ea6b88ce4866$var$keyboard({
                                    size: size,
                                    isDisabled: renderProps.isDisabled
                                })
                            }
                        ],
                        [
                            (0, $053b76ed3d29e13b$exports.ImageContext),
                            {
                                styles: $e741ea6b88ce4866$var$image({
                                    size: size
                                })
                            }
                        ]
                    ],
                    children: [
                        renderProps.selectionMode === 'single' && !renderProps.hasSubmenu && /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $dba2b18fc5727f9b$exports.default), {
                            size: $e741ea6b88ce4866$var$checkmarkIconSize[size],
                            className: $e741ea6b88ce4866$export$292abbf31ed842a({
                                ...renderProps,
                                size: size
                            })
                        }),
                        renderProps.selectionMode === 'multiple' && !renderProps.hasSubmenu && /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)("div", {
                            className: (0, $308b180f49d82d28$exports.mergeStyles)($e741ea6b88ce4866$export$b07e517d22efa1ca, (0, $af04e099a53d3e85$exports.box)(checkboxRenderProps)),
                            children: /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $dba2b18fc5727f9b$exports.default), {
                                size: size,
                                className: (0, $af04e099a53d3e85$exports.iconStyles)
                            })
                        }),
                        typeof children === 'string' ? /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $6367bc87eb7d24ad$exports.Text), {
                            slot: "label",
                            children: children
                        }) : children,
                        isLinkOut && !hideLinkOutIcon && /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)("div", {
                            slot: "descriptor",
                            className: $e741ea6b88ce4866$var$descriptor,
                            children: /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $377d9a1b51957cfd$exports.default), {
                                size: $e741ea6b88ce4866$var$linkIconSize[size],
                                className: function anonymous(props) {
                                    let rules = " ";
                                    if (props.direction === "rtl") {
                                        rules += ' -Z4Pn4c-a11';
                                        rules += ' __Ha11';
                                    }
                                    return rules;
                                }({
                                    direction: direction
                                })
                            })
                        }),
                        renderProps.hasSubmenu && /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)("div", {
                            slot: "descriptor",
                            className: $e741ea6b88ce4866$var$descriptor,
                            children: /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $1df9f1c9262ce5df$exports.default), {
                                size: size,
                                className: function anonymous(props) {
                                    let rules = " ";
                                    if (props.direction === "rtl") {
                                        rules += ' -Z4Pn4c-a11';
                                        rules += ' __Ha11';
                                    }
                                    return rules;
                                }({
                                    direction: direction
                                })
                            })
                        })
                    ]
                })
            });
        }
    });
}
/**
 * The MenuTrigger serves as a wrapper around a Menu and its associated trigger,
 * linking the Menu's open state with the trigger's press state.
 */ function $e741ea6b88ce4866$export$27d2ad3c5815583e(props) {
    // RAC sets isPressed via PressResponder when the menu is open.
    // We don't want press scaling to appear to get "stuck", so override this.
    // For mouse interactions, menus open on press start. When the popover underlay appears
    // it covers the trigger button, causing onPressEnd to fire immediately and no press scaling
    // to occur. We override this by listening for pointerup on the document ourselves.
    let [isPressed, setPressed] = (0, $4tP7K$react.useState)(false);
    let { addGlobalListener: addGlobalListener } = (0, $4tP7K$reactariautils.useGlobalListeners)();
    let onPressStart = (e)=>{
        if (e.pointerType !== 'mouse') return;
        setPressed(true);
        addGlobalListener(document, 'pointerup', ()=>{
            setPressed(false);
        }, {
            once: true,
            capture: true
        });
    };
    let { align: align = 'start', direction: direction = 'bottom', shouldFlip: shouldFlip } = props;
    let placement;
    switch(direction){
        case 'left':
        case 'right':
        case 'start':
        case 'end':
            placement = `${direction} ${align === 'end' ? 'bottom' : 'top'}`;
            break;
        case 'bottom':
        case 'top':
        default:
            placement = `${direction} ${align}`;
    }
    return /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)($e741ea6b88ce4866$var$InternalMenuTriggerContext.Provider, {
        value: {
            align: props.align,
            direction: props.direction,
            shouldFlip: props.shouldFlip
        },
        children: /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $493371ef39bf7a55$exports.PopoverContext).Provider, {
            value: {
                hideArrow: true,
                offset: 8,
                crossOffset: 0,
                placement: placement,
                shouldFlip: shouldFlip
            },
            children: /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $493371ef39bf7a55$exports.InPopoverContext).Provider, {
                value: false,
                children: /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $4tP7K$reactariacomponents.MenuTrigger), {
                    ...props,
                    children: /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $4tP7K$reactariainteractions.PressResponder), {
                        onPressStart: onPressStart,
                        isPressed: isPressed,
                        children: props.children
                    })
                })
            })
        })
    });
}
function $e741ea6b88ce4866$export$ecabc99eeffab7ca(props) {
    // For submenus, the offset from the edge of the popover should be 10px.
    // Subtract 8px for the padding around the parent menu.
    // Offset by padding + border so that the first item in a submenu lines up with the parent menu item.
    return /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsxs)((0, $4tP7K$reactariacomponents.SubmenuTrigger), {
        ...props,
        children: [
            props.children[0],
            /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)((0, $493371ef39bf7a55$exports.PopoverContext).Provider, {
                value: {
                    hideArrow: true,
                    offset: -2,
                    crossOffset: -8,
                    placement: 'end top'
                },
                children: props.children[1]
            })
        ]
    });
}
function $e741ea6b88ce4866$export$aebfca372ec4a7db(props) {
    return /*#__PURE__*/ (0, $4tP7K$reactjsxruntime.jsx)("div", {});
}


//# sourceMappingURL=Menu.cjs.map
