import { cn as e } from "../../../../lib/utils.js";
import { Badge as t } from "../../../../components/ui/badge.js";
import { Position as n } from "../../../../node_modules/@xyflow/system/dist/esm/index.js";
import { Handle as r } from "../../../../node_modules/@xyflow/react/dist/esm/index.js";
import "react";
import { jsx as i, jsxs as a } from "react/jsx-runtime";
//#region src/features/debug/components/workflow-flow/StateNode.tsx
var o = "bottom-source", s = "bottom-target", c = "!bg-muted-foreground/30 !h-3 !w-1 !rounded-sm opacity-0", l = "!bg-muted-foreground/30 !h-1 !w-3 !rounded-sm opacity-0";
function u(e) {
	return e.isCurrent ? "border-primary shadow-primary/20 bg-primary/5 ring-primary/30 z-10 shadow-lg ring-4" : e.isEnd ? "border-green-500/30 bg-green-500/10" : e.isStart ? "border-blue-500/30 bg-blue-500/10" : e.isVisited ? "border-border/60 bg-muted/40" : `border-border/40 bg-card/60 ${e.forceVisible ? "opacity-100" : "opacity-80 hover:opacity-100"}`;
}
function d(e) {
	return e.isCurrent ? "text-primary font-semibold" : e.isVisited ? "text-foreground" : "text-muted-foreground";
}
function f(e) {
	let t = e === "LR";
	return {
		target: t ? n.Left : n.Top,
		source: t ? n.Right : n.Bottom,
		backEdge: t ? n.Bottom : n.Right
	};
}
var p = ({ data: t }) => {
	let n = f(t.direction);
	return /* @__PURE__ */ a("div", {
		className: e("relative flex min-w-32 flex-col items-center gap-2 rounded-xl border px-5 py-3 shadow-sm transition-all duration-300", u(t)),
		children: [
			t.isCurrent && /* @__PURE__ */ i(m, {}),
			/* @__PURE__ */ i(r, {
				type: "target",
				position: n.target,
				className: c
			}),
			/* @__PURE__ */ i(r, {
				type: "source",
				position: n.source,
				className: c
			}),
			/* @__PURE__ */ i(r, {
				type: "source",
				id: o,
				position: n.backEdge,
				className: l
			}),
			/* @__PURE__ */ i(r, {
				type: "target",
				id: s,
				position: n.backEdge,
				className: l
			}),
			/* @__PURE__ */ i("span", {
				className: e("text-sm font-medium tracking-tight", d(t)),
				children: t.label
			}),
			/* @__PURE__ */ i(h, { data: t })
		]
	});
}, m = () => /* @__PURE__ */ a("span", {
	className: "absolute -top-1 -right-1 flex h-3 w-3",
	children: [/* @__PURE__ */ i("span", { className: "bg-primary/50 absolute inline-flex h-full w-full animate-ping rounded-full opacity-75" }), /* @__PURE__ */ i("span", { className: "bg-primary relative inline-flex h-3 w-3 rounded-full" })]
}), h = ({ data: e }) => /* @__PURE__ */ a("div", {
	className: "flex items-center gap-1.5",
	children: [
		e.visitCount > 1 && /* @__PURE__ */ a(t, {
			variant: "secondary",
			className: "bg-secondary/50 text-secondary-foreground hover:bg-secondary/70 h-5 px-1.5 text-[10px]",
			children: [e.visitCount, "x"]
		}),
		e.isEnd && /* @__PURE__ */ i(t, {
			variant: "outline",
			className: "h-5 border-green-500/30 bg-green-500/5 px-1.5 text-[10px] text-green-600",
			children: "End"
		}),
		e.isStart && /* @__PURE__ */ i(t, {
			variant: "outline",
			className: "h-5 border-blue-500/30 bg-blue-500/5 px-1.5 text-[10px] text-blue-600",
			children: "Start"
		})
	]
});
//#endregion
export { p as default };
