import { t as e } from "../../utils-B7XIe3qq.js";
import { t } from "../../dist-BCCeHAQm.js";
import * as n from "react";
import { jsx as r, jsxs as i } from "react/jsx-runtime";
//#region src/react/primitives/attack-path.tsx
var a = {
	initial_access: "Initial Access",
	execution: "Execution",
	persistence: "Persistence",
	privilege_escalation: "Privilege Escalation",
	defense_evasion: "Defense Evasion",
	credential_access: "Credential Access",
	discovery: "Discovery",
	lateral_movement: "Lateral Movement",
	collection: "Collection",
	exfiltration: "Exfiltration",
	impact: "Impact",
	command_and_control: "Command & Control"
}, o = t("group relative flex flex-col items-center gap-1 rounded-xl border px-4 py-3 text-center backdrop-blur-[20px] transition-all duration-200", {
	variants: {
		severity: {
			critical: "border-accent-rose/40 bg-accent-rose/10 hover:bg-accent-rose/15",
			high: "border-accent-rose/30 bg-accent-rose/5 hover:bg-accent-rose/10",
			medium: "border-accent-amber/30 bg-accent-amber/5 hover:bg-accent-amber/10",
			low: "border-accent-cyan/30 bg-accent-cyan/5 hover:bg-accent-cyan/10"
		},
		mitigated: {
			true: "opacity-60",
			false: ""
		}
	},
	defaultVariants: { mitigated: !1 }
}), s = "border-border-glass bg-glass hover:bg-glass-hover";
function c() {
	return /* @__PURE__ */ r("div", {
		"aria-hidden": "true",
		className: "flex shrink-0 items-center px-1 text-foreground-muted",
		children: /* @__PURE__ */ i("svg", {
			xmlns: "http://www.w3.org/2000/svg",
			viewBox: "0 0 24 24",
			fill: "none",
			stroke: "currentColor",
			strokeWidth: 2,
			strokeLinecap: "round",
			strokeLinejoin: "round",
			className: "size-4",
			children: [/* @__PURE__ */ r("path", { d: "M5 12h14" }), /* @__PURE__ */ r("path", { d: "m12 5 7 7-7 7" })]
		})
	});
}
function l({ className: t, step: n, showTechniques: c = !1, onClick: l, ...u }) {
	let d = n.description || c && n.techniques && n.techniques.length > 0;
	return /* @__PURE__ */ i("div", {
		"data-slot": "attack-path-step",
		role: "listitem",
		className: e(n.severity ? o({
			severity: n.severity,
			mitigated: n.mitigated ?? !1
		}) : e(o({ mitigated: n.mitigated ?? !1 }), s), l && "cursor-pointer", t),
		onClick: l ? () => l(n) : void 0,
		...u,
		children: [
			/* @__PURE__ */ r("span", {
				className: "text-[10px] font-bold uppercase tracking-wider text-foreground-muted",
				children: a[n.type]
			}),
			/* @__PURE__ */ r("span", {
				className: "text-xs font-medium text-foreground",
				children: n.label
			}),
			n.mitigated && /* @__PURE__ */ r("span", {
				"aria-label": "Mitigated",
				className: "absolute -right-1 -top-1 flex size-5 items-center justify-center rounded-full bg-accent-emerald text-[10px] text-white",
				children: /* @__PURE__ */ r("svg", {
					xmlns: "http://www.w3.org/2000/svg",
					viewBox: "0 0 24 24",
					fill: "none",
					stroke: "currentColor",
					strokeWidth: 3,
					strokeLinecap: "round",
					strokeLinejoin: "round",
					className: "size-3",
					children: /* @__PURE__ */ r("path", { d: "M20 6 9 17l-5-5" })
				})
			}),
			d && /* @__PURE__ */ i("div", {
				className: "pointer-events-none absolute left-1/2 top-full z-10 mt-2 hidden w-48 -translate-x-1/2 rounded-lg border border-border-glass bg-surface-secondary/95 p-3 text-left shadow-lg backdrop-blur-xl group-hover:block",
				children: [n.description && /* @__PURE__ */ r("p", {
					className: "text-xs text-foreground-secondary",
					children: n.description
				}), c && n.techniques && n.techniques.length > 0 && /* @__PURE__ */ r("ul", {
					className: "mt-2 flex flex-col gap-1",
					children: n.techniques.map((e) => /* @__PURE__ */ r("li", {
						className: "text-[11px] font-mono text-foreground-muted",
						children: e
					}, e))
				})]
			})
		]
	});
}
function u({ className: t, steps: a, title: o, showTechniques: s = !1, onStepClick: u, ...d }) {
	return /* @__PURE__ */ i("div", {
		"data-slot": "attack-path",
		role: "list",
		"aria-label": o ?? "Attack Path",
		className: e("flex flex-col gap-3", t),
		...d,
		children: [o && /* @__PURE__ */ r("div", {
			className: "text-sm font-semibold text-foreground",
			children: o
		}), /* @__PURE__ */ r("div", {
			className: "flex items-center gap-1 overflow-x-auto pb-2",
			children: a.map((e, t) => /* @__PURE__ */ i(n.Fragment, { children: [/* @__PURE__ */ r(l, {
				step: e,
				showTechniques: s,
				onClick: u ?? void 0
			}), t < a.length - 1 && /* @__PURE__ */ r(c, {})] }, e.id))
		})]
	});
}
//#endregion
export { u as AttackPath, l as AttackPathStep, o as stepVariants };

//# sourceMappingURL=attack-path.js.map