import { A as e, F as t, M as n, _ as r, at as i, b as a, d as o, f as s, h as c, l, m as u, p as d, rt as f, st as p, v as m, w as h } from "./vue.runtime.esm-bundler-Bxqkjqhc.js";
import { E as g, p as _ } from "./keys-CY3tkCsv.js";
import { t as v } from "./useI18n-CWX9ZTCW.js";
import { t as y } from "./createLucideIcon-Di4mqmGn.js";
import { t as b } from "./circle-alert-CPIth9bC.js";
import { t as x } from "./info-DiINxXfZ.js";
import { t as S } from "./list-checks-CMtEXe9l.js";
import { t as C } from "./triangle-alert-DWQySIE2.js";
var w = y("arrow-right", [["path", {
	d: "M5 12h14",
	key: "1ays0h"
}], ["path", {
	d: "m12 5 7 7-7 7",
	key: "xquz4c"
}]]), T = y("wrench", [["path", {
	d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",
	key: "1ngwbx"
}]]), E = { class: "tpl:flex tpl:flex-col tpl:gap-4 tpl:p-4" }, D = { class: "tpl:flex tpl:items-center tpl:gap-2" }, O = { class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, k = ["title"], A = {
	key: 0,
	class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
}, j = {
	key: 1,
	class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
}, M = { class: "tpl:ml-auto tpl:font-normal tpl:opacity-70" }, N = {
	key: 1,
	class: "tpl:m-0 tpl:mb-3 tpl:flex tpl:list-none tpl:flex-col tpl:gap-2 tpl:p-0"
}, P = { class: "tpl:m-0 tpl:mb-2 tpl:text-xs tpl:text-[var(--tpl-text)]" }, F = { class: "tpl:m-0 tpl:mb-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, I = { class: "tpl:flex tpl:gap-1.5" }, L = ["onClick"], R = ["title", "onClick"], z = /* @__PURE__ */ a({
	__name: "IssuesPanel",
	setup(a) {
		let { t: y, format: z } = v(), B = h(g, null), V = h(_, null), H = o(() => (B?.issues.value ?? []).filter((e) => e.severity === "error")), U = o(() => (B?.issues.value ?? []).filter((e) => e.severity === "warning")), W = o(() => (B?.issues.value ?? []).filter((e) => e.severity === "info")), G = o(() => H.value.length + U.value.length + W.value.length);
		function K(e) {
			V && e.blockId && V.selectBlock(e.blockId);
		}
		function q(e) {
			B?.applyFix(e);
		}
		return (a, o) => (e(), c("div", E, [s("header", D, [
			m(f(S), {
				size: 16,
				"stroke-width": 1.5
			}),
			s("h3", O, p(f(y).issues.panelTitle), 1),
			G.value > 0 ? (e(), c("span", {
				key: 0,
				class: "tpl:ml-auto tpl:rounded-full tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-0.5 tpl:text-[11px] tpl:text-[var(--tpl-text-muted)]",
				title: f(z)(f(y).issues.issueCountTooltip, { count: G.value })
			}, p(G.value), 9, k)) : u("", !0)
		]), !f(B) || f(B).unavailable.value ? (e(), c("div", A)) : G.value === 0 ? (e(), c("div", j, p(f(y).issues.emptyState), 1)) : (e(!0), c(l, { key: 2 }, n([
			{
				key: "errors",
				title: f(y).issues.groupErrors,
				icon: f(b),
				items: H.value,
				tone: "tpl:text-[var(--tpl-danger)]"
			},
			{
				key: "warnings",
				title: f(y).issues.groupWarnings,
				icon: f(C),
				items: U.value,
				tone: "tpl:text-[var(--tpl-warning)]"
			},
			{
				key: "info",
				title: f(y).issues.groupInfo,
				icon: f(x),
				items: W.value,
				tone: "tpl:text-[var(--tpl-text-muted)]"
			}
		], (a) => (e(), c("section", { key: a.key }, [a.items.length > 0 ? (e(), c("header", {
			key: 0,
			class: i(["tpl:mb-2 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-[11px] tpl:font-semibold tpl:uppercase tpl:tracking-wide", a.tone])
		}, [
			(e(), d(t(a.icon), {
				size: 12,
				"stroke-width": 2
			})),
			r(" " + p(a.title) + " ", 1),
			s("span", M, p(a.items.length), 1)
		], 2)) : u("", !0), a.items.length > 0 ? (e(), c("ul", N, [(e(!0), c(l, null, n(a.items, (t) => (e(), c("li", {
			key: `${t.ruleId}-${t.blockId ?? "template"}`,
			class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3"
		}, [
			s("p", P, p(t.message), 1),
			s("p", F, p(t.ruleId), 1),
			s("div", I, [t.blockId ? (e(), c("button", {
				key: 0,
				type: "button",
				class: "tpl:flex tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text)]",
				onClick: (e) => K(t)
			}, [m(f(w), {
				size: 10,
				"stroke-width": 2
			}), r(" " + p(f(y).issues.jump), 1)], 8, L)) : u("", !0), t.fix ? (e(), c("button", {
				key: 1,
				type: "button",
				class: "tpl:flex tpl:items-center tpl:gap-1 tpl:rounded-md tpl:bg-[var(--tpl-primary)] tpl:px-2 tpl:py-1 tpl:text-[11px] tpl:font-medium tpl:text-white",
				title: t.fix.description,
				onClick: (e) => q(t)
			}, [m(f(T), {
				size: 10,
				"stroke-width": 2
			}), r(" " + p(f(y).issues.fix), 1)], 8, R)) : u("", !0)])
		]))), 128))])) : u("", !0)]))), 128))]));
	}
});
//#endregion
export { z as default };
