import { DocBuilderRoot } from "./docBuilderRoot.js";
import { RulesBuilderUtil } from "../utils/rulesBuilderUtil.js";
export class DocBuilderEscalationRules extends DocBuilderRoot {
    docType = "EscalationRules";
    placeholder = "<!-- Escalation Rule description -->";
    promptKey = "PROMPT_DESCRIBE_ESCALATION_RULES";
    xmlRootKey = "escalationRule";
    static buildIndexTable(prefix, escalationRulesDescriptions, filterObject = null) {
        const filteredEscalationRules = filterObject ? escalationRulesDescriptions.filter(escalationRule => escalationRule.impactedObjects.includes(filterObject)) : escalationRulesDescriptions;
        if (filteredEscalationRules.length === 0) {
            return [];
        }
        const lines = [];
        lines.push(...[
            filterObject ? "## Related Escalation Rules" : "## Escalation Rules",
            "",
            "| Escalation Rule | Is Active |",
            "|     :----       |  :--: | "
        ]);
        for (const escalationRule of filteredEscalationRules) {
            const escalationRuleNameCell = `[${escalationRule.name}](${prefix}${escalationRule.name}.md)`;
            lines.push(...[
                `| ${escalationRuleNameCell} | ${escalationRule.active} |`
            ]);
        }
        lines.push("");
        return lines;
    }
    async buildInitialMarkdownLines() {
        const ruleBuilderUtil = new RulesBuilderUtil();
        await ruleBuilderUtil.buildInitialMarkDownLinesForEscalationRules(this.parsedXmlObject);
        const escalationRuleTableLines = [...ruleBuilderUtil.globalRuleTableLines];
        return [
            '<!-- Escalation Rule description -->',
            '## Escalation Rules list',
            ...escalationRuleTableLines,
            '',
        ];
    }
}
//# sourceMappingURL=docBuilderEscalationRules.js.map