"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isWorkingPlanItem = isWorkingPlanItem;
exports.normalizeWorkerStatus = normalizeWorkerStatus;
exports.isReleasePendingMainItem = isReleasePendingMainItem;
exports.isAutomationFailedItem = isAutomationFailedItem;
exports.getPlanQuickFilterLabel = getPlanQuickFilterLabel;
var MAIN_PENDING_WORKER_STATUSES = new Set(['main반영대기', 'main반영중', 'main반영실패']);
var AUTOMATION_FAILURE_WORKER_STATUSES = new Set([
    '브랜치실패',
    '자동작업실패',
    'release반영실패',
    'main반영실패',
]);
function isWorkingPlanItem(item) {
    return item.status === '작업중';
}
function normalizeWorkerStatus(workerStatus) {
    var _a;
    return (_a = workerStatus === null || workerStatus === void 0 ? void 0 : workerStatus.replace(/\s+/g, '')) !== null && _a !== void 0 ? _a : '';
}
function isReleasePendingMainItem(item) {
    var normalizedWorkerStatus = normalizeWorkerStatus(item.workerStatus);
    if (MAIN_PENDING_WORKER_STATUSES.has(normalizedWorkerStatus)) {
        return true;
    }
    return item.status === '릴리즈완료';
}
function isAutomationFailedItem(item) {
    return AUTOMATION_FAILURE_WORKER_STATUSES.has(normalizeWorkerStatus(item.workerStatus));
}
function getPlanQuickFilterLabel(filter) {
    if (filter === 'working') {
        return '현재 작업중';
    }
    if (filter === 'release-pending-main') {
        return '현재 release 상태';
    }
    if (filter === 'automation-failed') {
        return '현재 자동화 실패';
    }
    return null;
}
