"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/atoms/drawer.tsx
var drawer_exports = {};
__export(drawer_exports, {
  Content: () => Content2,
  Drawer: () => Drawer,
  Root: () => Root2,
  Trigger: () => Trigger2
});
module.exports = __toCommonJS(drawer_exports);
var import_react = require("react");
var Dialog = __toESM(require("@radix-ui/react-dialog"), 1);
var import_themes4 = require("@radix-ui/themes");

// src/icons/close-panel-arrow.tsx
var React = __toESM(require("react"), 1);
var import_jsx_runtime = require("react/jsx-runtime");
var ClosePanelArrowIcon = React.forwardRef(
  (_a, forwardedRef) => {
    var _b = _a, { color = "currentColor" } = _b, props = __objRest(_b, ["color"]);
    return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
      "svg",
      __spreadProps(__spreadValues({
        fill: "none",
        height: "16",
        viewBox: "0 0 16 16",
        width: "16",
        xmlns: "http://www.w3.org/2000/svg"
      }, props), {
        ref: forwardedRef,
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
            "path",
            {
              clipRule: "evenodd",
              d: "M3.19315 2.16529C3.43937 1.93445 3.82611 1.94693 4.05695 2.19315L9.87499 7.15624C9.87499 7.15624 10.4479 7.72916 9.87499 8.30207L4.05695 12.8068C3.82611 13.0531 3.43937 13.0656 3.19315 12.8347C2.94693 12.6038 2.93445 12.2171 3.16529 11.9709L8.72916 7.72916L3.16529 3.02908C2.93445 2.78285 2.94693 2.39612 3.19315 2.16529Z",
              fill: color,
              fillRule: "evenodd"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
            "path",
            {
              clipRule: "evenodd",
              d: "M12.1733 2.58667C12.1733 2.26266 11.9107 2 11.5867 2C11.2627 2 11 2.26266 11 2.58667V12.7201C11 13.044 11.2627 13.3067 11.5867 13.3067C11.9107 13.3067 12.1733 13.044 12.1733 12.7201V2.58667Z",
              fill: color,
              fillRule: "evenodd"
            }
          )
        ]
      })
    );
  }
);
ClosePanelArrowIcon.displayName = "ArrowDownIcon";

// src/atoms/flex.tsx
var import_themes = require("@radix-ui/themes");

// src/atoms/separator.tsx
var import_themes2 = require("@radix-ui/themes");

// src/atoms/icon-button.tsx
var import_themes3 = require("@radix-ui/themes");

// src/atoms/toast.tsx
var import_react_icons = require("@radix-ui/react-icons");
var import_react_toastify = require("react-toastify");
var import_react_toastify2 = require("react-toastify");
var import_jsx_runtime2 = require("react/jsx-runtime");
function CloseButton() {
  return null;
}
function ToastContainer(props) {
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
    import_react_toastify.ToastContainer,
    __spreadValues({
      autoClose: 5e3,
      closeButton: CloseButton,
      closeOnClick: true,
      draggable: true,
      hideProgressBar: true,
      icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_icons.InfoCircledIcon, {}),
      newestOnTop: true,
      pauseOnFocusLoss: true,
      pauseOnHover: true,
      position: "bottom-right",
      rtl: false,
      style: { zIndex: 999999 }
    }, props)
  );
}

// src/atoms/drawer.tsx
var import_jsx_runtime3 = require("react/jsx-runtime");
function Root2(props) {
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Dialog.Root, __spreadValues({}, props));
}
var preventDefault = (e) => {
  e.preventDefault();
};
function Content2(props) {
  const _a = props, { position = "right", className, children } = _a, rest = __objRest(_a, ["position", "className", "children"]);
  const containerRef = (0, import_react.useRef)(null);
  (0, import_react.useEffect)(() => {
    containerRef.current = document.getElementsByClassName("radix-themes")[0];
  }, []);
  const mobileHeaderSize = 48;
  const desktopHeaderSize = 64;
  const separatorSize = 1;
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Dialog.Portal, { container: containerRef.current, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_themes4.Theme, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Dialog.Overlay, { className: "DrawerOverlay" }),
    /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ToastContainer, {}),
    /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
      Dialog.Content,
      __spreadProps(__spreadValues({
        className: `DrawerContent ${position} ${className || ""}`,
        onPointerDownOutside: preventDefault
      }, rest), {
        children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
          import_themes4.Grid,
          {
            height: "100%",
            overflow: "hidden",
            rows: {
              initial: `${mobileHeaderSize}px ${separatorSize}px calc(100% - ${mobileHeaderSize + separatorSize}px)`,
              sm: `${desktopHeaderSize}px ${separatorSize}px calc(100% - ${desktopHeaderSize + separatorSize}px)`
            },
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_themes.Flex, { align: "center", px: { initial: "4", md: "6" }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_themes3.IconButton, { color: "gray", variant: "outline", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ClosePanelArrowIcon, {}) }) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_themes2.Separator, { orientation: "horizontal", size: "4" }),
              children
            ]
          }
        )
      })
    )
  ] }) });
}
function Trigger2(props) {
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Dialog.Trigger, __spreadValues({ asChild: true }, props));
}
var Drawer = {
  Root: Dialog.Root,
  Trigger: Trigger2,
  Content: Content2,
  Close: Dialog.Close,
  Title: Dialog.Title,
  Description: Dialog.Description
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  Content,
  Drawer,
  Root,
  Trigger
});
//# sourceMappingURL=drawer.cjs.map