"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createRunWorkflowPublisher = createRunWorkflowPublisher;
exports.resolveRunWorkflowPublicationCommentUrl = resolveRunWorkflowPublicationCommentUrl;
const publisher_1 = require("../../workflows/publisher");
const workflow_template_root_1 = require("./workflow-template-root");
function createRunWorkflowPublisher(context) {
    return (0, publisher_1.createWorkflowPublisher)({
        repoRoot: "repoRoot" in context
            ? context.repoRoot
            : (0, workflow_template_root_1.getWorkflowTemplateRepoRoot)(context),
        ticketTrackerKind: context.config.ticketTracker.kind,
        displayTimeZone: context.displayTimeZone ?? context.config.i18n.displayTimeZone,
        workflowLabels: context.config.ticketTracker.workflowLabels,
        ticketTracker: context.ticketTracker,
    });
}
function resolveRunWorkflowPublicationCommentUrl(publication) {
    return (publication?.visibleUpdateComment?.url ??
        publication?.workflowStateComment?.url ??
        null);
}
