import { Badge as e } from "../../../components/ui/badge.js";
import { Dialog as t, DialogContent as n, DialogHeader as r, DialogTitle as i } from "../../../components/ui/dialog.js";
import a from "../document-details/DocumentDetails.js";
import o from "../document-details/PromptDetails.js";
import { useState as s } from "react";
import { jsx as c, jsxs as l } from "react/jsx-runtime";
//#region src/features/documents/components/DocumentMetadataPills.tsx
var u = ({ data: e }) => /* @__PURE__ */ c("div", {
	className: "bg-muted max-h-96 overflow-auto rounded-md p-4 font-mono whitespace-pre-wrap",
	children: JSON.stringify(e, null, 2)
}), d = {
	prompt: (e) => /* @__PURE__ */ c(o, { promptData: e }),
	document: (e) => /* @__PURE__ */ c(a, { data: e })
}, f = ({ metaData: a }) => {
	let [o, f] = s(null), [p, m] = s(null), [h, g] = s(!1), _ = (e, t) => {
		f(e), m(t), g(!0);
	};
	return /* @__PURE__ */ l("div", {
		className: "px-6",
		children: [/* @__PURE__ */ c("div", {
			className: "mb-8 flex flex-wrap gap-2",
			children: Object.entries(a).map(([t, n]) => /* @__PURE__ */ c(e, {
				variant: "outline",
				className: "hover:bg-accent hover:text-accent-foreground cursor-pointer rounded-full px-3 py-1 transition-colors",
				onClick: () => _(n, t),
				children: t
			}, t))
		}), o && /* @__PURE__ */ c(t, {
			open: h,
			onOpenChange: g,
			children: /* @__PURE__ */ l(n, {
				className: "max-h-3/4 max-w-2xl overflow-auto",
				children: [/* @__PURE__ */ c(r, { children: /* @__PURE__ */ l(i, {
					className: "flex items-center gap-2",
					children: [p, /* @__PURE__ */ c("span", {
						className: "text-muted-foreground text-xs font-normal",
						children: "Metadata"
					})]
				}) }), /* @__PURE__ */ c("div", {
					className: "mt-4",
					children: ((e) => e && d[e] ? d[e](o) : /* @__PURE__ */ c(u, { data: o }))(p)
				})]
			})
		})]
	});
};
//#endregion
export { f as default };
