import { jsx, jsxs } from "react/jsx-runtime";
import "react";
import { cn } from "../../lib/utils.js";
import { menuItemVariants } from "../../lib/variants.js";
import Check from "../../node_modules/lucide-react/dist/esm/icons/check.js";
import ChevronRight from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
import { MenuRoot } from "../../node_modules/@base-ui/react/esm/menu/root/MenuRoot.js";
import { MenuPortal } from "../../node_modules/@base-ui/react/esm/menu/portal/MenuPortal.js";
import { MenuTrigger } from "../../node_modules/@base-ui/react/esm/menu/trigger/MenuTrigger.js";
import { MenuPositioner } from "../../node_modules/@base-ui/react/esm/menu/positioner/MenuPositioner.js";
import { MenuPopup } from "../../node_modules/@base-ui/react/esm/menu/popup/MenuPopup.js";
import { MenuGroup } from "../../node_modules/@base-ui/react/esm/menu/group/MenuGroup.js";
import { MenuGroupLabel } from "../../node_modules/@base-ui/react/esm/menu/group-label/MenuGroupLabel.js";
import { MenuItem } from "../../node_modules/@base-ui/react/esm/menu/item/MenuItem.js";
import { MenuCheckboxItem } from "../../node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItem.js";
import { MenuCheckboxItemIndicator } from "../../node_modules/@base-ui/react/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js";
import { MenuRadioGroup } from "../../node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroup.js";
import { MenuRadioItem } from "../../node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItem.js";
import { MenuRadioItemIndicator } from "../../node_modules/@base-ui/react/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js";
import { Separator } from "../../node_modules/@base-ui/react/esm/separator/Separator.js";
import { MenuSubmenuRoot } from "../../node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRoot.js";
import { MenuSubmenuTrigger } from "../../node_modules/@base-ui/react/esm/menu/submenu-trigger/MenuSubmenuTrigger.js";
function DropdownMenu({ ...props }) {
  return /* @__PURE__ */ jsx(MenuRoot, { "data-slot": "dropdown-menu", ...props });
}
function DropdownMenuPortal({ ...props }) {
  return /* @__PURE__ */ jsx(MenuPortal, { "data-slot": "dropdown-menu-portal", ...props });
}
function DropdownMenuTrigger({ ...props }) {
  return /* @__PURE__ */ jsx(MenuTrigger, { "data-slot": "dropdown-menu-trigger", ...props });
}
function DropdownMenuContent({
  align = "start",
  alignOffset = 0,
  side = "bottom",
  sideOffset = 4,
  className,
  ...props
}) {
  return /* @__PURE__ */ jsx(MenuPortal, { children: /* @__PURE__ */ jsx(
    MenuPositioner,
    {
      className: "isolate z-50 outline-none",
      align,
      alignOffset,
      side,
      sideOffset,
      children: /* @__PURE__ */ jsx(
        MenuPopup,
        {
          "data-slot": "dropdown-menu-content",
          className: cn(
            "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-md p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",
            className
          ),
          ...props
        }
      )
    }
  ) });
}
function DropdownMenuGroup({ ...props }) {
  return /* @__PURE__ */ jsx(MenuGroup, { "data-slot": "dropdown-menu-group", ...props });
}
function DropdownMenuLabel({
  className,
  inset,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    MenuGroupLabel,
    {
      "data-slot": "dropdown-menu-label",
      "data-inset": inset,
      className: cn(
        "text-muted-foreground px-2 py-1.5 text-xs font-medium data-[inset]:pl-8",
        className
      ),
      ...props
    }
  );
}
function DropdownMenuItem({
  className,
  inset = false,
  variant = "default",
  ...props
}) {
  return /* @__PURE__ */ jsx(
    MenuItem,
    {
      "data-slot": "dropdown-menu-item",
      className: cn(
        menuItemVariants({ variant, inset }),
        "group/dropdown-menu-item",
        className
      ),
      ...props
    }
  );
}
function DropdownMenuSub({ ...props }) {
  return /* @__PURE__ */ jsx(MenuSubmenuRoot, { "data-slot": "dropdown-menu-sub", ...props });
}
function DropdownMenuSubTrigger({
  className,
  inset,
  children,
  ...props
}) {
  return /* @__PURE__ */ jsxs(
    MenuSubmenuTrigger,
    {
      "data-slot": "dropdown-menu-sub-trigger",
      "data-inset": inset,
      className: cn(
        "focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
        className
      ),
      ...props,
      children: [
        children,
        /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto" })
      ]
    }
  );
}
function DropdownMenuSubContent({
  align = "start",
  alignOffset = -3,
  side = "right",
  sideOffset = 0,
  className,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    DropdownMenuContent,
    {
      "data-slot": "dropdown-menu-sub-content",
      className: cn(
        "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-md p-1 shadow-lg ring-1 duration-100 w-auto",
        className
      ),
      align,
      alignOffset,
      side,
      sideOffset,
      ...props
    }
  );
}
function DropdownMenuCheckboxItem({
  className,
  children,
  checked,
  ...props
}) {
  return /* @__PURE__ */ jsxs(
    MenuCheckboxItem,
    {
      "data-slot": "dropdown-menu-checkbox-item",
      className: cn(
        "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
        className
      ),
      checked,
      ...props,
      children: [
        /* @__PURE__ */ jsx(
          "span",
          {
            className: "pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none",
            "data-slot": "dropdown-menu-checkbox-item-indicator",
            children: /* @__PURE__ */ jsx(MenuCheckboxItemIndicator, { children: /* @__PURE__ */ jsx(Check, {}) })
          }
        ),
        children
      ]
    }
  );
}
function DropdownMenuRadioGroup({ ...props }) {
  return /* @__PURE__ */ jsx(
    MenuRadioGroup,
    {
      "data-slot": "dropdown-menu-radio-group",
      ...props
    }
  );
}
function DropdownMenuRadioItem({
  className,
  children,
  ...props
}) {
  return /* @__PURE__ */ jsxs(
    MenuRadioItem,
    {
      "data-slot": "dropdown-menu-radio-item",
      className: cn(
        "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
        className
      ),
      ...props,
      children: [
        /* @__PURE__ */ jsx(
          "span",
          {
            className: "pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none",
            "data-slot": "dropdown-menu-radio-item-indicator",
            children: /* @__PURE__ */ jsx(MenuRadioItemIndicator, { children: /* @__PURE__ */ jsx(Check, {}) })
          }
        ),
        children
      ]
    }
  );
}
function DropdownMenuSeparator({
  className,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    Separator,
    {
      "data-slot": "dropdown-menu-separator",
      className: cn("bg-border -mx-1 my-1 h-px", className),
      ...props
    }
  );
}
function DropdownMenuShortcut({
  className,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    "span",
    {
      "data-slot": "dropdown-menu-shortcut",
      className: cn(
        "text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest",
        className
      ),
      ...props
    }
  );
}
export {
  DropdownMenu,
  DropdownMenuCheckboxItem,
  DropdownMenuContent,
  DropdownMenuGroup,
  DropdownMenuItem,
  DropdownMenuLabel,
  DropdownMenuPortal,
  DropdownMenuRadioGroup,
  DropdownMenuRadioItem,
  DropdownMenuSeparator,
  DropdownMenuShortcut,
  DropdownMenuSub,
  DropdownMenuSubContent,
  DropdownMenuSubTrigger,
  DropdownMenuTrigger
};
//# sourceMappingURL=dropdown-menu.js.map
