'use strict';

var _extends = require('../../../../../@babel_runtime@7.24.8/node_modules/@babel/runtime/helpers/esm/extends.cjs');
var React = require('react');
var index$6 = require('../../../../../@radix-ui_primitive@1.0.1/node_modules/@radix-ui/primitive/dist/index.cjs');
var index$5 = require('../../../../../@radix-ui_react-compose-refs@1.0.1_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.cjs');
var index = require('../../../../../@radix-ui_react-context@1.0.1_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-context/dist/index.cjs');
var index$2 = require('../../../../../@radix-ui_react-use-controllable-state@1.0.1_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs');
var index$4 = require('../../../../../@radix-ui_react-primitive@1.0.3_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3._44pjkdrkjq3hxuh62jsxoggm4e/node_modules/@radix-ui/react-primitive/dist/index.cjs');
var index$1 = require('../../../../../@radix-ui_react-menu@2.0.5_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-menu/dist/index.cjs');
var index$3 = require('../../../../../@radix-ui_react-id@1.0.1_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-id/dist/index.cjs');

/* -------------------------------------------------------------------------------------------------
 * DropdownMenu
 * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$DROPDOWN_MENU_NAME = 'DropdownMenu';
const [$d08ef79370b62062$var$createDropdownMenuContext, $d08ef79370b62062$export$c0623cd925aeb687] = index.createContextScope($d08ef79370b62062$var$DROPDOWN_MENU_NAME, [
    index$1.createMenuScope
]);
const $d08ef79370b62062$var$useMenuScope = index$1.createMenuScope();
const [$d08ef79370b62062$var$DropdownMenuProvider, $d08ef79370b62062$var$useDropdownMenuContext] = $d08ef79370b62062$var$createDropdownMenuContext($d08ef79370b62062$var$DROPDOWN_MENU_NAME);
const $d08ef79370b62062$export$e44a253a59704894 = (props)=>{
    const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , dir: dir , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true  } = props;
    const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
    const triggerRef = React.useRef(null);
    const [open = false, setOpen] = index$2.useControllableState({
        prop: openProp,
        defaultProp: defaultOpen,
        onChange: onOpenChange
    });
    return /*#__PURE__*/ React.createElement($d08ef79370b62062$var$DropdownMenuProvider, {
        scope: __scopeDropdownMenu,
        triggerId: index$3.useId(),
        triggerRef: triggerRef,
        contentId: index$3.useId(),
        open: open,
        onOpenChange: setOpen,
        onOpenToggle: React.useCallback(()=>setOpen((prevOpen)=>!prevOpen
            )
        , [
            setOpen
        ]),
        modal: modal
    }, /*#__PURE__*/ React.createElement(index$1.Root, _extends.default({}, menuScope, {
        open: open,
        onOpenChange: setOpen,
        dir: dir,
        modal: modal
    }), children));
};
/* -------------------------------------------------------------------------------------------------
 * DropdownMenuTrigger
 * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$TRIGGER_NAME = 'DropdownMenuTrigger';
const $d08ef79370b62062$export$d2469213b3befba9 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
    const { __scopeDropdownMenu: __scopeDropdownMenu , disabled: disabled = false , ...triggerProps } = props;
    const context = $d08ef79370b62062$var$useDropdownMenuContext($d08ef79370b62062$var$TRIGGER_NAME, __scopeDropdownMenu);
    const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
    return /*#__PURE__*/ React.createElement(index$1.Anchor, _extends.default({
        asChild: true
    }, menuScope), /*#__PURE__*/ React.createElement(index$4.Primitive.button, _extends.default({
        type: "button",
        id: context.triggerId,
        "aria-haspopup": "menu",
        "aria-expanded": context.open,
        "aria-controls": context.open ? context.contentId : undefined,
        "data-state": context.open ? 'open' : 'closed',
        "data-disabled": disabled ? '' : undefined,
        disabled: disabled
    }, triggerProps, {
        ref: index$5.composeRefs(forwardedRef, context.triggerRef),
        onPointerDown: index$6.composeEventHandlers(props.onPointerDown, (event)=>{
            // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)
            // but not when the control key is pressed (avoiding MacOS right click)
            if (!disabled && event.button === 0 && event.ctrlKey === false) {
                context.onOpenToggle(); // prevent trigger focusing when opening
                // this allows the content to be given focus without competition
                if (!context.open) event.preventDefault();
            }
        }),
        onKeyDown: index$6.composeEventHandlers(props.onKeyDown, (event)=>{
            if (disabled) return;
            if ([
                'Enter',
                ' '
            ].includes(event.key)) context.onOpenToggle();
            if (event.key === 'ArrowDown') context.onOpenChange(true); // prevent keydown from scrolling window / first focused item to execute
            // that keydown (inadvertently closing the menu)
            if ([
                'Enter',
                ' ',
                'ArrowDown'
            ].includes(event.key)) event.preventDefault();
        })
    })));
});
const $d08ef79370b62062$export$cd369b4d4d54efc9 = (props)=>{
    const { __scopeDropdownMenu: __scopeDropdownMenu , ...portalProps } = props;
    const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
    return /*#__PURE__*/ React.createElement(index$1.Portal, _extends.default({}, menuScope, portalProps));
};
/* -------------------------------------------------------------------------------------------------
 * DropdownMenuContent
 * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$CONTENT_NAME = 'DropdownMenuContent';
const $d08ef79370b62062$export$6e76d93a37c01248 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
    const { __scopeDropdownMenu: __scopeDropdownMenu , ...contentProps } = props;
    const context = $d08ef79370b62062$var$useDropdownMenuContext($d08ef79370b62062$var$CONTENT_NAME, __scopeDropdownMenu);
    const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
    const hasInteractedOutsideRef = React.useRef(false);
    return /*#__PURE__*/ React.createElement(index$1.Content, _extends.default({
        id: context.contentId,
        "aria-labelledby": context.triggerId
    }, menuScope, contentProps, {
        ref: forwardedRef,
        onCloseAutoFocus: index$6.composeEventHandlers(props.onCloseAutoFocus, (event)=>{
            var _context$triggerRef$c;
            if (!hasInteractedOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
            hasInteractedOutsideRef.current = false; // Always prevent auto focus because we either focus manually or want user agent focus
            event.preventDefault();
        }),
        onInteractOutside: index$6.composeEventHandlers(props.onInteractOutside, (event)=>{
            const originalEvent = event.detail.originalEvent;
            const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
            const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
            if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;
        }),
        style: {
            ...props.style,
            '--radix-dropdown-menu-content-transform-origin': 'var(--radix-popper-transform-origin)',
            '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)',
            '--radix-dropdown-menu-content-available-height': 'var(--radix-popper-available-height)',
            '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)',
            '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)'
        }
    }));
});
const $d08ef79370b62062$export$246bebaba3a2f70e = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
    const { __scopeDropdownMenu: __scopeDropdownMenu , ...groupProps } = props;
    const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
    return /*#__PURE__*/ React.createElement(index$1.Group, _extends.default({}, menuScope, groupProps, {
        ref: forwardedRef
    }));
});
const $d08ef79370b62062$export$76e48c5b57f24495 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
    const { __scopeDropdownMenu: __scopeDropdownMenu , ...labelProps } = props;
    const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
    return /*#__PURE__*/ React.createElement(index$1.Label, _extends.default({}, menuScope, labelProps, {
        ref: forwardedRef
    }));
});
const $d08ef79370b62062$export$ed97964d1871885d = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
    const { __scopeDropdownMenu: __scopeDropdownMenu , ...itemProps } = props;
    const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
    return /*#__PURE__*/ React.createElement(index$1.Item, _extends.default({}, menuScope, itemProps, {
        ref: forwardedRef
    }));
});
const $d08ef79370b62062$export$3323ad73d55f587e = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
    const { __scopeDropdownMenu: __scopeDropdownMenu , ...radioGroupProps } = props;
    const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
    return /*#__PURE__*/ React.createElement(index$1.RadioGroup, _extends.default({}, menuScope, radioGroupProps, {
        ref: forwardedRef
    }));
});
const $d08ef79370b62062$export$e4f69b41b1637536 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
    const { __scopeDropdownMenu: __scopeDropdownMenu , ...radioItemProps } = props;
    const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
    return /*#__PURE__*/ React.createElement(index$1.RadioItem, _extends.default({}, menuScope, radioItemProps, {
        ref: forwardedRef
    }));
});
const $d08ef79370b62062$export$da160178fd3bc7e9 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
    const { __scopeDropdownMenu: __scopeDropdownMenu , ...separatorProps } = props;
    const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
    return /*#__PURE__*/ React.createElement(index$1.Separator, _extends.default({}, menuScope, separatorProps, {
        ref: forwardedRef
    }));
});
/* -------------------------------------------------------------------------------------------------
 * DropdownMenuSub
 * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$export$2f307d81a64f5442 = (props)=>{
    const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , open: openProp , onOpenChange: onOpenChange , defaultOpen: defaultOpen  } = props;
    const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
    const [open = false, setOpen] = index$2.useControllableState({
        prop: openProp,
        defaultProp: defaultOpen,
        onChange: onOpenChange
    });
    return /*#__PURE__*/ React.createElement(index$1.Sub, _extends.default({}, menuScope, {
        open: open,
        onOpenChange: setOpen
    }), children);
};
const $d08ef79370b62062$export$21dcb7ec56f874cf = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
    const { __scopeDropdownMenu: __scopeDropdownMenu , ...subTriggerProps } = props;
    const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
    return /*#__PURE__*/ React.createElement(index$1.SubTrigger, _extends.default({}, menuScope, subTriggerProps, {
        ref: forwardedRef
    }));
});
const $d08ef79370b62062$export$f34ec8bc2482cc5f = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
    const { __scopeDropdownMenu: __scopeDropdownMenu , ...subContentProps } = props;
    const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu);
    return /*#__PURE__*/ React.createElement(index$1.SubContent, _extends.default({}, menuScope, subContentProps, {
        ref: forwardedRef,
        style: {
            ...props.style,
            '--radix-dropdown-menu-content-transform-origin': 'var(--radix-popper-transform-origin)',
            '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)',
            '--radix-dropdown-menu-content-available-height': 'var(--radix-popper-available-height)',
            '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)',
            '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)'
        }
    }));
});
/* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$export$be92b6f5f03c0fe9 = $d08ef79370b62062$export$e44a253a59704894;
const $d08ef79370b62062$export$41fb9f06171c75f4 = $d08ef79370b62062$export$d2469213b3befba9;
const $d08ef79370b62062$export$602eac185826482c = $d08ef79370b62062$export$cd369b4d4d54efc9;
const $d08ef79370b62062$export$7c6e2c02157bb7d2 = $d08ef79370b62062$export$6e76d93a37c01248;
const $d08ef79370b62062$export$eb2fcfdbd7ba97d4 = $d08ef79370b62062$export$246bebaba3a2f70e;
const $d08ef79370b62062$export$b04be29aa201d4f5 = $d08ef79370b62062$export$76e48c5b57f24495;
const $d08ef79370b62062$export$6d08773d2e66f8f2 = $d08ef79370b62062$export$ed97964d1871885d;
const $d08ef79370b62062$export$a98f0dcb43a68a25 = $d08ef79370b62062$export$3323ad73d55f587e;
const $d08ef79370b62062$export$371ab307eab489c0 = $d08ef79370b62062$export$e4f69b41b1637536;
const $d08ef79370b62062$export$1ff3c3f08ae963c0 = $d08ef79370b62062$export$da160178fd3bc7e9;
const $d08ef79370b62062$export$d7a01e11500dfb6f = $d08ef79370b62062$export$2f307d81a64f5442;
const $d08ef79370b62062$export$2ea8a7a591ac5eac = $d08ef79370b62062$export$21dcb7ec56f874cf;
const $d08ef79370b62062$export$6d4de93b380beddf = $d08ef79370b62062$export$f34ec8bc2482cc5f;

exports.Content = $d08ef79370b62062$export$7c6e2c02157bb7d2;
exports.DropdownMenu = $d08ef79370b62062$export$e44a253a59704894;
exports.DropdownMenuContent = $d08ef79370b62062$export$6e76d93a37c01248;
exports.DropdownMenuGroup = $d08ef79370b62062$export$246bebaba3a2f70e;
exports.DropdownMenuItem = $d08ef79370b62062$export$ed97964d1871885d;
exports.DropdownMenuLabel = $d08ef79370b62062$export$76e48c5b57f24495;
exports.DropdownMenuPortal = $d08ef79370b62062$export$cd369b4d4d54efc9;
exports.DropdownMenuRadioGroup = $d08ef79370b62062$export$3323ad73d55f587e;
exports.DropdownMenuRadioItem = $d08ef79370b62062$export$e4f69b41b1637536;
exports.DropdownMenuSeparator = $d08ef79370b62062$export$da160178fd3bc7e9;
exports.DropdownMenuSub = $d08ef79370b62062$export$2f307d81a64f5442;
exports.DropdownMenuSubContent = $d08ef79370b62062$export$f34ec8bc2482cc5f;
exports.DropdownMenuSubTrigger = $d08ef79370b62062$export$21dcb7ec56f874cf;
exports.DropdownMenuTrigger = $d08ef79370b62062$export$d2469213b3befba9;
exports.Group = $d08ef79370b62062$export$eb2fcfdbd7ba97d4;
exports.Item = $d08ef79370b62062$export$6d08773d2e66f8f2;
exports.Label = $d08ef79370b62062$export$b04be29aa201d4f5;
exports.Portal = $d08ef79370b62062$export$602eac185826482c;
exports.RadioGroup = $d08ef79370b62062$export$a98f0dcb43a68a25;
exports.RadioItem = $d08ef79370b62062$export$371ab307eab489c0;
exports.Root = $d08ef79370b62062$export$be92b6f5f03c0fe9;
exports.Separator = $d08ef79370b62062$export$1ff3c3f08ae963c0;
exports.Sub = $d08ef79370b62062$export$d7a01e11500dfb6f;
exports.SubContent = $d08ef79370b62062$export$6d4de93b380beddf;
exports.SubTrigger = $d08ef79370b62062$export$2ea8a7a591ac5eac;
exports.Trigger = $d08ef79370b62062$export$41fb9f06171c75f4;
exports.createDropdownMenuScope = $d08ef79370b62062$export$c0623cd925aeb687;
//# sourceMappingURL=index.cjs.map
