'use client';
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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/components/Popover/components/index.ts
var components_exports = {};
__export(components_exports, {
  PopoverModalContent: () => PopoverModalContent
});
module.exports = __toCommonJS(components_exports);

// src/components/Popover/components/PopoverModalContent.tsx
var import_react2 = require("react");
var import_react_icons4 = require("@paalan/react-icons");
var import_lib16 = require("@paalan/react-shared/lib");

// src/base/Box/Box.tsx
var import_system = require("@paalan/react-shared/system");
var import_utils = require("@paalan/react-shared/utils");
var import_jsx_runtime = require("react/jsx-runtime");
var Box = (0, import_utils.forwardRef)((props, ref) => {
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_system.StyledComponent, { ...props, ref });
});
Box.withComponent = import_system.WithStyledComponent;

// src/base/Center/Center.tsx
var import_lib = require("@paalan/react-shared/lib");
var import_utils2 = require("@paalan/react-shared/utils");
var import_jsx_runtime2 = require("react/jsx-runtime");
var Center = (0, import_utils2.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box, { className: (0, import_lib.cn)("flex items-center justify-center", className), ...restProps, ref, children });
});

// src/base/Container/Container.tsx
var import_lib2 = require("@paalan/react-shared/lib");
var import_utils3 = require("@paalan/react-shared/utils");
var import_jsx_runtime3 = require("react/jsx-runtime");
var Container = (0, import_utils3.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box, { className: (0, import_lib2.cn)("container", className), ...restProps, ref, children });
});

// src/base/Flex/Flex.tsx
var import_lib3 = require("@paalan/react-shared/lib");
var import_utils4 = require("@paalan/react-shared/utils");
var import_jsx_runtime4 = require("react/jsx-runtime");
var Flex = (0, import_utils4.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box, { className: (0, import_lib3.cn)("flex", className), ...restProps, ref, children });
});

// src/base/Grid/Grid.tsx
var import_lib4 = require("@paalan/react-shared/lib");
var import_utils5 = require("@paalan/react-shared/utils");
var import_jsx_runtime5 = require("react/jsx-runtime");
var Grid = (0, import_utils5.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box, { className: (0, import_lib4.cn)("grid", className), ...restProps, ref, children });
});
var GridItem = (0, import_utils5.forwardRef)((props, ref) => {
  const { children, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box, { ...restProps, ref, children });
});

// src/base/HStack/HStack.tsx
var import_lib5 = require("@paalan/react-shared/lib");
var import_utils6 = require("@paalan/react-shared/utils");
var import_jsx_runtime6 = require("react/jsx-runtime");
var HStack = (0, import_utils6.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box, { className: (0, import_lib5.cn)("flex flex-row items-center gap-2", className), ...restProps, ref, children });
});

// src/base/Heading/Heading.tsx
var import_lib6 = require("@paalan/react-shared/lib");
var import_utils7 = require("@paalan/react-shared/utils");
var import_jsx_runtime7 = require("react/jsx-runtime");
var headingSizes = {
  h1: "text-3xl font-bold",
  h2: "text-2xl font-bold",
  h3: "text-xl font-semibold",
  h4: "text-lg font-semibold",
  h5: "text-base font-semibold",
  h6: "text-sm font-semibold"
};
var Heading = (0, import_utils7.forwardRef)((props, ref) => {
  const { children, as: headTag = "h1", className, ...restProps } = props;
  const size = headingSizes[headTag];
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Box, { as: headTag, ...restProps, ref, className: (0, import_lib6.cn)(size, className), children });
});

// src/base/Paper/Paper.tsx
var import_lib7 = require("@paalan/react-shared/lib");
var import_utils8 = require("@paalan/react-shared/utils");
var import_class_variance_authority = require("class-variance-authority");
var import_jsx_runtime8 = require("react/jsx-runtime");
var paperVariants = (0, import_class_variance_authority.cva)("bg-background text-foreground", {
  variants: {
    shadow: {
      default: "shadow",
      sm: "shadow-sm",
      md: "shadow-md",
      lg: "shadow-lg",
      xl: "shadow-xl",
      "2xl": "shadow-2xl",
      inner: "shadow-inner",
      none: "shadow-none"
    }
  },
  defaultVariants: {
    shadow: "default"
  }
});
var Paper = (0, import_utils8.forwardRef)(
  ({ withBorder, shadow, className, ...props }, ref) => {
    return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
      Box,
      {
        ref,
        className: (0, import_lib7.cn)(paperVariants({ shadow }), withBorder ? "border border-border" : "", className),
        ...props
      }
    );
  }
);

// src/base/Portal/Portal.tsx
var import_react = require("react");
var import_react_hooks = require("@paalan/react-hooks");
var import_utils9 = require("@paalan/react-shared/utils");
var import_react_dom = require("react-dom");
var import_jsx_runtime9 = require("react/jsx-runtime");
var createPortalNode = (props) => {
  const node = document.createElement("div");
  node.setAttribute("data-portal", "true");
  if (typeof props.className === "string") {
    node.classList.add(...props.className.split(" "));
  }
  if (typeof props.style === "object") {
    Object.assign(node.style, props.style);
  }
  if (typeof props.id === "string") {
    node.setAttribute("id", props.id);
  }
  return node;
};
var defaultProps = {};
var Portal = (0, import_react.forwardRef)((props, ref) => {
  const { children, target, ...others } = { ...defaultProps, ...props };
  const [mounted, setMounted] = (0, import_react.useState)(false);
  const nodeRef = (0, import_react.useRef)(null);
  (0, import_react_hooks.useIsomorphicEffect)(() => {
    setMounted(true);
    nodeRef.current = !target ? createPortalNode(others) : typeof target === "string" ? document.querySelector(target) : target;
    if (!nodeRef.current) return;
    (0, import_utils9.assignRef)(ref, nodeRef.current);
    if (!target && nodeRef.current) {
      document.body.appendChild(nodeRef.current);
    }
    return () => {
      if (!target && nodeRef.current) {
        document.body.removeChild(nodeRef.current);
      }
    };
  }, [target]);
  if (!mounted || !nodeRef.current) {
    return null;
  }
  return (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children }), nodeRef.current);
});
Portal.displayName = "Portal";

// src/base/Stack/Stack.tsx
var import_lib8 = require("@paalan/react-shared/lib");
var import_utils10 = require("@paalan/react-shared/utils");
var import_jsx_runtime10 = require("react/jsx-runtime");
var Stack = (0, import_utils10.forwardRef)((props, ref) => {
  const { children, className, direction, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Box, { className: (0, import_lib8.cn)("flex flex-col gap-2", className), flexDirection: direction, ...restProps, ref, children });
});

// src/base/Text/Text.tsx
var import_lib9 = require("@paalan/react-shared/lib");
var import_utils11 = require("@paalan/react-shared/utils");
var import_jsx_runtime11 = require("react/jsx-runtime");
var Text = (0, import_utils11.forwardRef)((props, ref) => {
  const { children, className, as = "p", ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box, { as, ref, className: (0, import_lib9.cn)("", className), ...restProps, children });
});

// src/base/Typography/Typography.tsx
var import_lib10 = require("@paalan/react-shared/lib");
var import_utils12 = require("@paalan/react-shared/utils");
var import_jsx_runtime12 = require("react/jsx-runtime");
var H1 = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "h1",
    ref,
    className: (0, import_lib10.cn)("scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl", className),
    ...props
  }
));
H1.displayName = "H1";
var H2 = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "h2",
    ref,
    className: (0, import_lib10.cn)(
      "mt-10 scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight transition-colors first:mt-0",
      className
    ),
    ...props
  }
));
H2.displayName = "H2";
var H3 = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "h3",
    ref,
    className: (0, import_lib10.cn)("mt-8 scroll-m-20 text-2xl font-semibold tracking-tight", className),
    ...props
  }
));
H3.displayName = "H3";
var H4 = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "h4", ref, className: (0, import_lib10.cn)("scroll-m-20 text-xl font-semibold tracking-tight", className), ...props }));
H4.displayName = "H4";
var H5 = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "h5", ref, className: (0, import_lib10.cn)("scroll-m-20 text-lg font-semibold tracking-tight", className), ...props }));
H5.displayName = "H5";
var H6 = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "h6", ref, className: (0, import_lib10.cn)("scroll-m-20 text-base font-semibold tracking-tight", className), ...props }));
H6.displayName = "H6";
var P = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "p", ref, className: (0, import_lib10.cn)("leading-7 [&:not(:first-child)]:mt-4", className), ...props }));
P.displayName = "P";
var BlockQuote = (0, import_utils12.forwardRef)(
  ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
    Box,
    {
      as: "blockquote",
      ref,
      className: (0, import_lib10.cn)(
        "mt-6 border-l-2 border-slate-300 pl-6 italic text-slate-800 dark:border-slate-600 dark:text-slate-200",
        className
      ),
      ...props
    }
  )
);
BlockQuote.displayName = "BlockQuote";
var TableLayout = (0, import_utils12.forwardRef)(
  ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "table", ref, className: (0, import_lib10.cn)("w-full", className), ...props })
);
TableLayout.displayName = "Table";
var THead = (0, import_utils12.forwardRef)(
  ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "thead", ref, className: (0, import_lib10.cn)("", className), ...props })
);
THead.displayName = "THead";
var TBody = (0, import_utils12.forwardRef)(
  ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "tbody", ref, className: (0, import_lib10.cn)("", className), ...props })
);
TBody.displayName = "TBody";
var TR = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "tr",
    ref,
    className: (0, import_lib10.cn)(
      "m-0 border-t border-slate-300 p-0 even:bg-slate-100 dark:border-slate-700 dark:even:bg-slate-800",
      className
    ),
    ...props
  }
));
TR.displayName = "TR";
var TD = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "td",
    ref,
    className: (0, import_lib10.cn)(
      "border border-slate-200 px-4 py-2 text-left dark:border-slate-700 [&[align=center]]:text-center [&[align=right]]:text-right",
      className
    ),
    ...props
  }
));
TD.displayName = "TD";
var TH = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "th",
    ref,
    className: (0, import_lib10.cn)(
      "border border-slate-200 px-4 py-2 text-left font-bold dark:border-slate-700 [&[align=center]]:text-center [&[align=right]]:text-right",
      className
    ),
    ...props
  }
));
TH.displayName = "TH";
var UL = (0, import_utils12.forwardRef)(({ className, unstyled = false, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "ul",
    ref,
    className: (0, import_lib10.cn)(
      {
        "m-4 list-disc [&>li]:mt-2": !unstyled
      },
      className
    ),
    ...props
  }
));
UL.displayName = "UL";
var OL = (0, import_utils12.forwardRef)(({ className, unstyled = false, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "ol",
    ref,
    className: (0, import_lib10.cn)(
      {
        "m-4 list-decimal [&>li]:mt-2": !unstyled
      },
      className
    ),
    ...props
  }
));
OL.displayName = "OL";
var LI = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "li", ref, className: (0, import_lib10.cn)("", className), ...props }));
LI.displayName = "LI";
var Code = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "code",
    ref,
    className: (0, import_lib10.cn)("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-normal", className),
    ...props
  }
));
Code.displayName = "Code";
var Lead = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "p", ref, className: (0, import_lib10.cn)("text-xl text-muted-foreground", className), ...props }));
Lead.displayName = "Lead";
var Large = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "div", ref, className: (0, import_lib10.cn)("text-lg font-semibold", className), ...props }));
Large.displayName = "Large";
var Small = (0, import_utils12.forwardRef)(
  ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "small", ref, className: (0, import_lib10.cn)("text-sm font-medium leading-none", className), ...props })
);
Small.displayName = "Small";
var Subtle = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "p", ref, className: (0, import_lib10.cn)("text-sm text-muted-foreground", className), ...props }));
Subtle.displayName = "Subtle";
var Strong = (0, import_utils12.forwardRef)(
  ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "strong", ref, className: (0, import_lib10.cn)("font-semibold", className), ...props })
);
Strong.displayName = "Strong";

// src/base/VStack/VStack.tsx
var import_lib11 = require("@paalan/react-shared/lib");
var import_utils13 = require("@paalan/react-shared/utils");
var import_jsx_runtime13 = require("react/jsx-runtime");
var VStack = (0, import_utils13.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box, { className: (0, import_lib11.cn)("flex flex-col items-stretch gap-2", className), ...restProps, ref, children });
});

// src/base/Wrap/Wrap.tsx
var import_lib12 = require("@paalan/react-shared/lib");
var import_utils14 = require("@paalan/react-shared/utils");
var import_jsx_runtime14 = require("react/jsx-runtime");
var Wrap = (0, import_utils14.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Box, { className: (0, import_lib12.cn)("flex flex-wrap gap-2", className), ...restProps, ref, children });
});
var WrapItem = (0, import_utils14.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Box, { className: (0, import_lib12.cn)("flex flex-none items-start", className), ...restProps, ref, children });
});

// src/components/Command/Command.tsx
var React2 = __toESM(require("react"), 1);
var import_react_icons2 = require("@paalan/react-icons");
var import_lib14 = require("@paalan/react-shared/lib");
var import_cmdk = require("cmdk");

// src/components/Dialog/Dialog.tsx
var React = __toESM(require("react"), 1);
var import_react_icons = require("@paalan/react-icons");
var import_lib13 = require("@paalan/react-shared/lib");
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
var import_jsx_runtime15 = require("react/jsx-runtime");
var DialogRoot = DialogPrimitive.Root;
var DialogTrigger = DialogPrimitive.Trigger;
var DialogPortal = ({ ...props }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogPrimitive.Portal, { ...props });
DialogPortal.displayName = DialogPrimitive.Portal.displayName;
var DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
  DialogPrimitive.Overlay,
  {
    ref,
    className: (0, import_lib13.cn)(
      "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
      className
    ),
    ...props
  }
));
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
var DialogContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DialogPortal, { children: [
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogOverlay, {}),
  /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
    DialogPrimitive.Content,
    {
      ref,
      className: (0, import_lib13.cn)(
        "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
        className
      ),
      ...props,
      children: [
        children,
        /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
          /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_icons.Cross2Icon, { className: "size-4" }),
          /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: "Close" })
        ] })
      ]
    }
  )
] }));
DialogContent.displayName = DialogPrimitive.Content.displayName;
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_lib13.cn)("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
DialogHeader.displayName = "DialogHeader";
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_lib13.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props });
DialogFooter.displayName = "DialogFooter";
var DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
  DialogPrimitive.Title,
  {
    ref,
    className: (0, import_lib13.cn)("text-lg font-semibold leading-none tracking-tight", className),
    ...props
  }
));
DialogTitle.displayName = DialogPrimitive.Title.displayName;
var DialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogPrimitive.Description, { ref, className: (0, import_lib13.cn)("text-sm text-muted-foreground", className), ...props }));
DialogDescription.displayName = DialogPrimitive.Description.displayName;
var Dialog = ({
  content,
  children,
  trigger,
  triggerClassName,
  header,
  contentClassName,
  footer,
  ...props
}) => {
  const dialogContent = content || children;
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DialogRoot, { ...props, children: [
    trigger && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogTrigger, { asChild: true, className: triggerClassName, children: trigger }),
    /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DialogContent, { className: (0, import_lib13.cn)(contentClassName), children: [
      header && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(DialogHeader, { className: header.className, children: [
        header.title && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogTitle, { children: header.title }),
        /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogDescription, { children: header.description })
      ] }),
      dialogContent,
      footer && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DialogFooter, { className: footer.className, children: footer.content })
    ] })
  ] });
};
Dialog.displayName = "Dialog";

// src/components/Command/Command.tsx
var import_jsx_runtime16 = require("react/jsx-runtime");
var CommandModal = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
  import_cmdk.Command,
  {
    ref,
    className: (0, import_lib14.cn)(
      "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
      className
    ),
    ...props
  }
));
CommandModal.displayName = import_cmdk.Command.displayName;
var CommandDialog = ({ children, ...props }) => {
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DialogRoot, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DialogContent, { className: "overflow-hidden p-0", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CommandModal, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5", children }) }) });
};
var CommandInput = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center border-b px-3", "data-cmdk-input-wrapper": "", children: [
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_icons2.MagnifyingGlassIcon, { className: "mr-2 size-4 shrink-0 opacity-50" }),
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
    import_cmdk.Command.Input,
    {
      ref,
      className: (0, import_lib14.cn)(
        "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
        className
      ),
      ...props
    }
  )
] }));
CommandInput.displayName = import_cmdk.Command.Input.displayName;
var CommandList = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
  import_cmdk.Command.List,
  {
    ref,
    className: (0, import_lib14.cn)("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
    ...props
  }
));
CommandList.displayName = import_cmdk.Command.List.displayName;
var CommandEmpty = React2.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_cmdk.Command.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
var CommandGroup = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
  import_cmdk.Command.Group,
  {
    ref,
    className: (0, import_lib14.cn)(
      "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
      className
    ),
    ...props
  }
));
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
var CommandSeparator = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_cmdk.Command.Separator, { ref, className: (0, import_lib14.cn)("-mx-1 h-px bg-border", className), ...props }));
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
var CommandLoading = React2.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_cmdk.Command.Loading, { ref, ...props }));
CommandLoading.displayName = import_cmdk.Command.Loading.displayName;
var CommandItem = React2.forwardRef(({ className, onSelect, ...props }, ref) => {
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
    import_cmdk.Command.Item,
    {
      ref,
      ...props,
      className: (0, import_lib14.cn)(
        "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
        className
      ),
      onSelect: (value) => {
        onSelect?.(props.value ?? value);
      }
    }
  );
});
CommandItem.displayName = import_cmdk.Command.Item.displayName;
var CommandShortcut = ({ className, ...props }) => {
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: (0, import_lib14.cn)("ml-auto text-xs tracking-widest text-muted-foreground", className), ...props });
};
CommandShortcut.displayName = "CommandShortcut";
var Command = ({
  inputOptions,
  emptyResultContent = "No results found.",
  groups,
  ...props
}) => {
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(CommandDialog, { ...props, children: [
    /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CommandInput, { placeholder: "Search...", ...inputOptions }),
    /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(CommandList, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CommandEmpty, { children: emptyResultContent }),
      groups.map(({ items, ...group }, index) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(React2.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CommandGroup, { ...group, children: items.map(({ icon, label, shortcut, ...item }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(CommandItem, { ...item, id: `${group.heading} - ${label}`, children: [
          icon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { as: "span", className: "mr-2", children: icon }),
          /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { as: "span", className: "text-sm", children: label }),
          shortcut && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CommandShortcut, { children: shortcut })
        ] }, label)) }),
        index !== groups.length && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CommandSeparator, {})
      ] }, group.heading))
    ] })
  ] });
};
Command.displayName = "Command";
var CommandNoResultFound = ({
  optionsLength,
  emptyOptionMessage,
  emptyOptionContent,
  searchValue,
  initialSearchContent
}) => {
  if (optionsLength > 0) return null;
  if (!searchValue && initialSearchContent) {
    return typeof initialSearchContent === "string" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Box, { className: "py-6 text-center text-sm", children: initialSearchContent }) : initialSearchContent;
  }
  if (emptyOptionContent) return emptyOptionContent;
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box, { className: "py-6 text-center text-sm", children: [
    emptyOptionMessage ?? `No results found${searchValue ? ` for "${searchValue}"` : ""}`,
    "."
  ] });
};
CommandNoResultFound.displayName = "CommandNoResultFound";

// src/components/Loading/Loading.tsx
var import_react_icons3 = require("@paalan/react-icons");
var import_lib15 = require("@paalan/react-shared/lib");
var import_jsx_runtime17 = require("react/jsx-runtime");
var Loading = ({ className, spin = true, content, parentClassName, ...props }) => {
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Flex, { className: (0, import_lib15.cn)("inline-flex items-center gap-2 text-gray-800 dark:text-gray-200", parentClassName), children: [
    /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
      import_react_icons3.LoadingIcon,
      {
        ...props,
        className: (0, import_lib15.cn)(
          "text-gray-500 dark:text-gray-50",
          {
            "animate-spin": !!spin
          },
          className
        )
      }
    ),
    content
  ] });
};

// src/components/Popover/components/PopoverModalContent.tsx
var import_jsx_runtime18 = require("react/jsx-runtime");
var PopoverModalContent = ({
  searchPlaceholder = "Search...",
  emptyOptionMessage,
  emptyOptionContent,
  options,
  value,
  onValueChange,
  onSearchValueChange,
  commandClassName,
  commandInputClassName,
  commandGroupClassName,
  commandItemClassName,
  checkIconClassName,
  filter,
  filterBy = "label",
  isMulti,
  isLoading,
  loadingText = "Loading...",
  searchValue: searchValueProp,
  initialSearchContent
}) => {
  const [searchValue, setSearchValue] = (0, import_react2.useState)(searchValueProp || "");
  const filterRef = (0, import_react2.useRef)(filter);
  (0, import_react2.useEffect)(() => {
    setSearchValue(searchValueProp || "");
  }, [searchValueProp]);
  (0, import_react2.useEffect)(() => {
    filterRef.current = filter;
  }, [filter]);
  const filteredOptions = (0, import_react2.useMemo)(() => {
    if (!searchValue) return options;
    if (typeof filterRef.current === "function") {
      return options.filter((option, index) => filterRef.current?.(option, searchValue, index));
    }
    const filterKeys = filterBy === "both" ? ["label", "value"] : [filterBy];
    return options.filter((option) => {
      return filterKeys.some((key) => {
        const value2 = option[key];
        if (typeof value2 === "string") {
          return value2.toLowerCase().includes(searchValue.toLowerCase());
        }
        return false;
      });
    });
  }, [searchValue, filterBy, options]);
  const sortedOptions = (0, import_react2.useMemo)(() => {
    return filteredOptions.sort((a, b) => {
      return a.label.localeCompare(b.label);
    });
  }, [filteredOptions]);
  const checkIconClassNameFn = (value2) => {
    return typeof checkIconClassName === "function" ? checkIconClassName(value2) : checkIconClassName;
  };
  const handleSearchValueChange = (search) => {
    setSearchValue(search);
    onSearchValueChange?.(search);
  };
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(CommandModal, { className: commandClassName, shouldFilter: false, loop: true, children: [
    /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
      CommandInput,
      {
        placeholder: searchPlaceholder,
        className: (0, import_lib16.cn)("border-transparent focus:border-transparent focus:ring-0", commandInputClassName),
        value: searchValue,
        onValueChange: handleSearchValueChange
      }
    ),
    !isLoading && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
      CommandNoResultFound,
      {
        emptyOptionMessage,
        emptyOptionContent,
        optionsLength: sortedOptions.length,
        searchValue: searchValueProp ?? searchValue,
        initialSearchContent
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CommandGroup, { className: (0, import_lib16.cn)("max-h-64 overflow-auto", commandGroupClassName), children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CommandLoading, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Box, { className: "p-3 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Loading, { boxSize: "5", content: loadingText }) }) }) : sortedOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
      CommandItem,
      {
        value: option.value,
        className: (0, import_lib16.cn)("flex cursor-pointer", commandItemClassName, option.className),
        disabled: option.disabled,
        onSelect: (currentValue) => {
          onValueChange?.(currentValue === value ? "" : currentValue);
        },
        children: [
          isMulti && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_icons4.CheckIcon, { className: (0, import_lib16.cn)("mr-2 h-4 w-4", checkIconClassNameFn(option.value)) }),
          option.labelContent || option.label,
          !isMulti && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
            import_react_icons4.CheckIcon,
            {
              className: (0, import_lib16.cn)(
                "ml-auto h-4 w-4",
                value === option.value ? "opacity-100" : "opacity-0",
                checkIconClassNameFn(option.value)
              )
            }
          )
        ]
      },
      option.key || option.value
    )) })
  ] });
};
PopoverModalContent.displayName = "PopoverModalContent";
