"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveWorkflowTemplateTargets = resolveWorkflowTemplateTargets;
exports.resolveWorkflowTemplateRecordTargets = resolveWorkflowTemplateRecordTargets;
exports.workflowTemplateTargetsSurface = workflowTemplateTargetsSurface;
const DEFAULT_WORKFLOW_TEMPLATE_TARGET = "issue";
function resolveWorkflowTemplateTargets(metadata) {
    return metadata?.targets ?? [DEFAULT_WORKFLOW_TEMPLATE_TARGET];
}
function resolveWorkflowTemplateRecordTargets(template) {
    const targets = template.targets ?? template.metadata?.targets;
    return targets === undefined || targets.length === 0
        ? [DEFAULT_WORKFLOW_TEMPLATE_TARGET]
        : [...targets];
}
function workflowTemplateTargetsSurface(template, surface) {
    return resolveWorkflowTemplateRecordTargets(template).includes(surface);
}
