import { debug } from "../../logging.js";
import { escapeText } from "../../renderers/util.js";
import { getSettings } from "../../settings.js";
import { HEADINGS } from "../constants.js";
export function renderGlobalSecurity(renderer, chunk) {
    debug(`Rendering global security chunk`);
    const { showDebugPlaceholders } = getSettings().display;
    for (const entry of chunk.chunkData.entries) {
        const inPill = entry.in
            ? ` ${renderer.createPill("info", () => entry.in)}`
            : "";
        const typePill = entry.type
            ? ` ${renderer.createPill("info", () => entry.type)}`
            : "";
        renderer.createHeading(HEADINGS.SECTION_HEADING_LEVEL, `${escapeText(entry.name, { escape: "markdown" })}${inPill}${typePill}`, {
            id: entry.name,
            escape: "none",
        });
        if (entry.description) {
            renderer.createText(entry.description);
        }
        else if (showDebugPlaceholders) {
            renderer.createDebugPlaceholder({
                createTitle() {
                    renderer.createText("No description provided");
                },
                createExample() {
                    renderer.createCode("securitySchemes:\n  APIKey:\n    description: My API key description", {
                        variant: "default",
                        style: "block",
                    });
                },
            });
        }
    }
}
//# sourceMappingURL=globalSecurity.js.map