"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.DebugHashesPlugin = void 0;
const terminal_1 = require("@rushstack/terminal");
const PLUGIN_NAME = 'DebugHashesPlugin';
class DebugHashesPlugin {
    constructor(terminal) {
        this._terminal = terminal;
    }
    apply(hooks) {
        hooks.beforeExecuteOperations.tap(PLUGIN_NAME, (operations) => {
            const terminal = this._terminal;
            terminal.writeLine(terminal_1.Colorize.blue(`===== Begin Hash Computation =====`));
            for (const [operation, record] of operations) {
                terminal.writeLine(terminal_1.Colorize.cyan(`--- ${operation.name} ---`));
                record.getStateHashComponents().forEach((component) => {
                    terminal.writeLine(component);
                });
                terminal.writeLine(terminal_1.Colorize.green(`Result: ${record.getStateHash()}`));
                // Add a blank line between operations to visually separate them
                terminal.writeLine();
            }
            terminal.writeLine(terminal_1.Colorize.blue(`===== End Hash Computation =====`));
        });
    }
}
exports.DebugHashesPlugin = DebugHashesPlugin;
//# sourceMappingURL=DebugHashesPlugin.js.map