import { jsx, jsxs } from 'react/jsx-runtime';
import { useTranslation } from 'react-i18next';
import { c as cn } from '../utils-BJnb9o5c.js';
import { B as Button } from '../button-CePY5zne.js';
import { D as Dialog$1, a as DialogPortal$1, b as DialogHeader$1, c as DialogTitle$1, d as DialogDescription$1, e as DialogFooter$1, f as DialogOverlay$1, g as DialogClose$2, h as DialogTrigger$1 } from '../dialog-CqXuhXNS.js';
import { X } from '../x-_o2T3n6D.js';
import { D as DialogPopup, a as DialogClose$1 } from '../DialogTrigger-a3diAOif.js';
import 'react';
import '../index-Bo3AAQJp.js';
import '../index-CfriMyrd.js';
import '../index-BtkPdosV.js';
import '../createLucideIcon-C8ycilSN.js';
import '../useOpenInteractionType-CVfxIsuz.js';
import '../floating-ui.utils.dom-Bw_Rc4bg.js';
import 'react-dom';
import '../index-DZXbzIgC.js';
import '../index-CSMSzzKM.js';
import '../with-selector-Dv0G_V_o.js';

const Dialog = (props) => /* @__PURE__ */ jsx(Dialog$1, { ...props });
const DialogClose = (props) => /* @__PURE__ */ jsx(DialogClose$2, { ...props });
const DialogContent = ({
  className,
  children,
  showCloseButton = true,
  overlayClassName,
  keepMounted,
  ...props
}) => {
  const { t } = useTranslation();
  return /* @__PURE__ */ jsxs(DialogPortal$1, { keepMounted, children: [
    /* @__PURE__ */ jsx(DialogOverlay, { forceRender: true, className: overlayClassName }),
    /* @__PURE__ */ jsxs(
      DialogPopup,
      {
        "data-slot": "dialog-content",
        className: cn(
          "fixed top-1/2 start-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 gap-5 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
          className
        ),
        ...props,
        children: [
          children,
          showCloseButton && /* @__PURE__ */ jsxs(
            DialogClose$1,
            {
              "data-slot": "dialog-close",
              "data-testid": "dialog-close-button",
              render: /* @__PURE__ */ jsx(
                Button,
                {
                  variant: "ghost",
                  className: "absolute top-2 end-2",
                  size: "icon-sm"
                }
              ),
              children: [
                /* @__PURE__ */ jsx(X, {}),
                /* @__PURE__ */ jsx("span", { className: "sr-only", children: t("neetoatoms.dialog.close", "Close") })
              ]
            }
          )
        ]
      }
    )
  ] });
};
const DialogDescription = (props) => /* @__PURE__ */ jsx(DialogDescription$1, { ...props });
const DialogFooter = ({
  className,
  ...props
}) => /* @__PURE__ */ jsx(
  DialogFooter$1,
  {
    className: cn("-mx-6 -mb-6 border-t-0 px-6 py-4", className),
    ...props
  }
);
const DialogHeader = ({
  className,
  ...props
}) => /* @__PURE__ */ jsx(DialogHeader$1, { className: cn("gap-3", className), ...props });
const DialogOverlay = ({
  className,
  ...props
}) => /* @__PURE__ */ jsx(
  DialogOverlay$1,
  {
    className: cn("supports-backdrop-filter:backdrop-blur-none", className),
    ...props
  }
);
const DialogPortal = (props) => /* @__PURE__ */ jsx(DialogPortal$1, { ...props });
const DialogTitle = (props) => /* @__PURE__ */ jsx(DialogTitle$1, { ...props });
const DialogTrigger = (props) => /* @__PURE__ */ jsx(DialogTrigger$1, { ...props });

export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
//# sourceMappingURL=Dialog.js.map
