import { jsx as _jsx } from "react/jsx-runtime";
import { DiffReviewPanel } from "./DiffReviewPanel.js";
export function StructuredDiff(props) {
    const maxLines = props.maxLines ?? 220;
    return _jsx(DiffReviewPanel, { diff: props.diff, maxLines: maxLines, title: "Structured diff", sourceLabel: "tool result" });
}
export function isUnifiedDiff(text) {
    return /(^|\n)@@\s+-\d+/.test(text) || /(^|\n)---\s+.+\n\+\+\+\s+/.test(text);
}
export function diffLineColor(line) {
    if (line.startsWith("@@"))
        return "cyan";
    if (line.startsWith("+++") || line.startsWith("---"))
        return "gray";
    if (line.startsWith("+"))
        return "green";
    if (line.startsWith("-"))
        return "red";
    return undefined;
}
