import { cn } from "../../lib/utils.js";
import { Card } from "../ui/card.js";
import { c } from "react/compiler-runtime";
import React from "react";
import { jsx, jsxs } from "react/jsx-runtime";
var CompletionMessagePaper_default = (s) => {
	let l = c(38), { role: u, children: d, timestamp: f, metadata: p, fullWidth: m, className: h } = s, g = m === void 0 ? !1 : m, _;
	l[0] === Symbol.for("react.memo_cache_sentinel") ? (_ = {
		system: {
			color: "#efb108",
			align: "left"
		},
		user: {
			color: "#0496d0",
			align: "right"
		},
		assistant: {
			color: "#004a98",
			align: "left"
		},
		document: {
			color: "#0e2135",
			align: "left"
		},
		tool: {
			color: "#efb108",
			align: "left"
		},
		error: {
			color: "#dc0d33",
			align: "left"
		}
	}, l[0] = _) : _ = l[0];
	let v = _, y = (u ? v[u] : void 0) ?? v.assistant, b = u === "user", x = _temp, S = b ? "justify-end" : "justify-start", C;
	l[1] !== h || l[2] !== S ? (C = cn("animate-in fade-in mb-1 flex flex-row items-start duration-300", S, h), l[1] = h, l[2] = S, l[3] = C) : C = l[3];
	let w = g ? "w-full max-w-full" : "w-auto max-w-[75%]", T = b ? "items-end" : "items-start", E;
	l[4] !== w || l[5] !== T ? (E = cn("flex min-w-50 flex-col", w, T), l[4] = w, l[5] = T, l[6] = E) : E = l[6];
	let D;
	l[7] !== y || l[8] !== u ? (D = u ? /* @__PURE__ */ jsx("span", {
		className: "text-xs font-semibold tracking-wider uppercase",
		style: { color: y.color },
		children: u
	}) : "", l[7] = y, l[8] = u, l[9] = D) : D = l[9];
	let O;
	l[10] === f ? O = l[11] : (O = f && /* @__PURE__ */ jsx("span", {
		className: "text-muted-foreground font-mono text-xs",
		children: x(f)
	}), l[10] = f, l[11] = O);
	let k;
	l[12] !== D || l[13] !== O ? (k = /* @__PURE__ */ jsxs("div", {
		className: "mb-2 flex items-center gap-2 opacity-70",
		children: [D, O]
	}), l[12] = D, l[13] = O, l[14] = k) : k = l[14];
	let A;
	l[15] !== b || l[16] !== p ? (A = p && Object.keys(p).length > 0 && /* @__PURE__ */ jsx("div", {
		className: cn("bg-muted mFax-w-full mb-2 rounded-md p-2", b ? "self-end" : "self-start"),
		children: Object.entries(p).map(_temp2)
	}), l[15] = b, l[16] = p, l[17] = A) : A = l[17];
	let j = g ? "w-full" : "w-auto", M;
	l[18] === j ? M = l[19] : (M = cn("relative max-w-full px-6 py-4 wrap-break-word shadow-none", j), l[18] = j, l[19] = M);
	let N = b ? "user" : "text-foreground", P;
	l[20] === N ? P = l[21] : (P = cn("leading-relaxed wrap-break-word whitespace-pre-wrap", N), l[20] = N, l[21] = P);
	let F;
	l[22] === d ? F = l[23] : (F = /* @__PURE__ */ jsx("div", {
		className: "message-content",
		children: d
	}), l[22] = d, l[23] = F);
	let I;
	l[24] !== P || l[25] !== F ? (I = /* @__PURE__ */ jsx("div", {
		className: P,
		children: F
	}), l[24] = P, l[25] = F, l[26] = I) : I = l[26];
	let L;
	l[27] !== M || l[28] !== I ? (L = /* @__PURE__ */ jsx(Card, {
		className: M,
		children: I
	}), l[27] = M, l[28] = I, l[29] = L) : L = l[29];
	let R;
	l[30] !== k || l[31] !== A || l[32] !== L || l[33] !== E ? (R = /* @__PURE__ */ jsxs("div", {
		className: E,
		children: [
			k,
			A,
			L
		]
	}), l[30] = k, l[31] = A, l[32] = L, l[33] = E, l[34] = R) : R = l[34];
	let z;
	return l[35] !== R || l[36] !== C ? (z = /* @__PURE__ */ jsx("div", {
		className: C,
		children: R
	}), l[35] = R, l[36] = C, l[37] = z) : z = l[37], z;
};
function _temp(r) {
	return r.toLocaleTimeString([], {
		hour: "2-digit",
		minute: "2-digit"
	});
}
function _temp2(r) {
	let [a, o] = r;
	return /* @__PURE__ */ jsxs("div", {
		className: "text-muted-foreground font-mono text-xs",
		children: [
			/* @__PURE__ */ jsxs("strong", { children: [a, ":"] }),
			" ",
			String(o)
		]
	}, a);
}
export { CompletionMessagePaper_default as default };
