import e from "../../components/messages/CompletionMessagePaper.js";
import t from "../oauth/OAuthPromptRenderer.js";
import "../oauth/index.js";
import n from "./renderers/AiMessage.js";
import r from "./renderers/ChoicesRenderer.js";
import i from "./renderers/ClaudeMessage.js";
import a from "./renderers/ConfirmPromptRenderer.js";
import o from "./renderers/DocumentDebugRenderer.js";
import s from "./renderers/DocumentFormRenderer.js";
import c from "./renderers/DocumentMessageRenderer.js";
import l from "./renderers/ErrorMessageRenderer.js";
import u from "./renderers/LinkMessageRenderer.js";
import d from "./renderers/MarkdownMessageRenderer.js";
import f from "./renderers/PlainMessageRenderer.js";
import p from "./renderers/SecretInputRenderer.js";
import m from "./renderers/TextPromptRenderer.js";
import "react";
import { Fragment as h, jsx as g } from "react/jsx-runtime";
//#region src/features/documents/DocumentRenderer.tsx
var _ = new Map([
	["ai-message", ({ document: e, isLastItem: t }) => /* @__PURE__ */ g(n, {
		document: e,
		isLastItem: t
	})],
	["claude-message", ({ document: e, isLastItem: t }) => /* @__PURE__ */ g(i, {
		document: e,
		isLastItem: t
	})],
	["debug", ({ document: e }) => /* @__PURE__ */ g("div", {
		className: "mb-4 flex",
		children: /* @__PURE__ */ g(o, { document: e })
	})],
	["form", ({ parentWorkflow: t, workflow: n, document: r, isActive: i }) => /* @__PURE__ */ g(e, {
		role: "document",
		fullWidth: !0,
		timestamp: new Date(r.createdAt),
		children: /* @__PURE__ */ g(s, {
			parentWorkflow: t,
			workflow: n,
			document: r,
			enabled: i,
			viewOnly: !i
		})
	})],
	["message", ({ document: e }) => /* @__PURE__ */ g(c, { document: e })],
	["error", ({ document: e }) => /* @__PURE__ */ g(l, { document: e })],
	["plain", ({ document: e }) => /* @__PURE__ */ g(f, { document: e })],
	["markdown", ({ document: e }) => /* @__PURE__ */ g(d, { document: e })],
	["link", ({ document: e }) => /* @__PURE__ */ g(u, { document: e })],
	["oauth-prompt", ({ parentWorkflow: e, workflow: n, document: r, isActive: i }) => /* @__PURE__ */ g(t, {
		parentWorkflow: e,
		workflow: n,
		document: r,
		isActive: i
	})],
	["text-prompt", ({ parentWorkflow: e, workflow: t, document: n, isActive: r }) => /* @__PURE__ */ g(m, {
		parentWorkflow: e,
		workflow: t,
		document: n,
		isActive: r
	})],
	["choices", ({ parentWorkflow: e, workflow: t, document: n, isActive: i }) => /* @__PURE__ */ g(r, {
		parentWorkflow: e,
		workflow: t,
		document: n,
		isActive: i
	})],
	["confirm-prompt", ({ parentWorkflow: e, workflow: t, document: n, isActive: r }) => /* @__PURE__ */ g(a, {
		parentWorkflow: e,
		workflow: t,
		document: n,
		isActive: r
	})],
	["secret-input", ({ parentWorkflow: e, workflow: t, document: n, isActive: r }) => /* @__PURE__ */ g(p, {
		parentWorkflow: e,
		workflow: t,
		document: n,
		isActive: r
	})]
]);
function v(e) {
	let t = e;
	return t?.widgets?.[0]?.widget ? t.widgets[0].widget : t?.form?.widget ? t.form.widget : "form";
}
var y = (e) => {
	let t = e.document, n = v(t.ui), r = _.get(n);
	return /* @__PURE__ */ g("div", { children: r ? /* @__PURE__ */ g(r, { ...e }) : /* @__PURE__ */ g(h, { children: "unknown document type" }) });
};
//#endregion
export { y as default };
