import { cx as e } from "../../../theme/tools.js";
import { actor as t, body as n, description as r, details as i, dot as a, gutter as o, header as s, item as c, line as l, list as u, meta as d, metric as f, metricLabel as p, metricValue as m, metrics as h, source as g, time as _, title as v } from "./auditTimeline.css.js";
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
//#region src/backoffice/organisms/audit_timeline/AuditTimeline.tsx
var S = ({ events: S, emptyState: C = null, density: w = "comfortable", className: T, renderEvent: E }) => S.length === 0 ? /* @__PURE__ */ b(y, { children: C }) : /* @__PURE__ */ b("ol", {
	className: e(u({ density: w }), T),
	children: S.map((e, u) => {
		let y = u === S.length - 1, C = E?.(e, {
			index: u,
			isLast: y
		});
		if (C != null) return /* @__PURE__ */ b("li", {
			className: c,
			children: C
		}, e.id);
		let w = null;
		y || (w = /* @__PURE__ */ b("div", { className: l }));
		let T = null;
		e.time != null && (T = /* @__PURE__ */ b("div", {
			className: _,
			children: e.time
		}));
		let D = null;
		e.description != null && (D = /* @__PURE__ */ b("div", {
			className: r,
			children: e.description
		}));
		let O = [];
		e.actor != null && O.push(/* @__PURE__ */ b("span", {
			className: t,
			children: e.actor
		}, "actor")), e.source != null && O.push(/* @__PURE__ */ b("span", {
			className: g,
			children: e.source
		}, "source")), e.meta != null && O.push(/* @__PURE__ */ b("span", { children: e.meta }, "meta"));
		let k = null;
		O.length > 0 && (k = /* @__PURE__ */ b("div", {
			className: d,
			children: O
		}));
		let A = null;
		e.metrics != null && e.metrics.length > 0 && (A = /* @__PURE__ */ b("div", {
			className: h,
			children: e.metrics.map((e) => /* @__PURE__ */ x("span", {
				className: f,
				children: [/* @__PURE__ */ b("span", {
					className: p,
					children: e.label
				}), /* @__PURE__ */ b("span", {
					className: m,
					children: e.value
				})]
			}, e.id))
		}));
		let j = null;
		return e.details != null && (j = /* @__PURE__ */ b("div", {
			className: i,
			children: e.details
		})), /* @__PURE__ */ x("li", {
			className: c,
			children: [/* @__PURE__ */ x("div", {
				className: o,
				"aria-hidden": "true",
				children: [/* @__PURE__ */ b("div", { className: a({ tone: e.tone ?? "neutral" }) }), w]
			}), /* @__PURE__ */ x("div", {
				className: n,
				children: [
					/* @__PURE__ */ x("div", {
						className: s,
						children: [/* @__PURE__ */ b("div", {
							className: v,
							children: e.title
						}), T]
					}),
					D,
					k,
					A,
					j
				]
			})]
		}, e.id);
	})
});
//#endregion
export { S as AuditTimeline, S as default };

//# sourceMappingURL=AuditTimeline.js.map