var USER_TASKS;
(function (USER_TASKS) {
    USER_TASKS["COMPLETE_SURVEY"] = "COMPLETE_SURVEY";
    USER_TASKS["VIEW_DEMO"] = "VIEW_DEMO";
    USER_TASKS["VIEW_DEMO_VIDEO"] = "VIEW_DEMO_VIDEO";
    USER_TASKS["DEPLOY_APP"] = "DEPLOY_APP";
    USER_TASKS["INVITE_TEAMMATE"] = "INVITE_TEAMMATE";
    USER_TASKS["DEPLOY_WORKFLOW"] = "DEPLOY_WORKFLOW";
    USER_TASKS["DEPLOY_SCHEDULED_JOB"] = "DEPLOY_SCHEDULED_JOB";
})(USER_TASKS || (USER_TASKS = {}));
var ORG_TASKS;
(function (ORG_TASKS) {
    ORG_TASKS["CONNECT_INTEGRATION"] = "CONNECT_INTEGRATION";
})(ORG_TASKS || (ORG_TASKS = {}));
export const TASKS = { ...USER_TASKS, ...ORG_TASKS };
export const isUserOnboardingTask = (task) => Object.values(USER_TASKS).includes(task.id);
export const isOrgOnboardingTask = (task) => Object.values(ORG_TASKS).includes(task.id);
export const getTasksFromAnalytics = (analytics) => {
    return analytics?.checklist?.tasks ?? [];
};
export const getRecommendedDatasourcesFromAnalytics = (analytics) => {
    return analytics?.recommendedDatasources ?? [];
};
export const getRecommendedDatasourcesFromAnswers = (surveyAnswers) => {
    return ((surveyAnswers?.answers?.find((answer) => answer.questionId === 'datasources')?.selectedOptions ?? [])
        .concat(surveyAnswers?.answers?.find((answer) => answer.questionId === 'apps')?.selectedOptions ?? [])
        // Always include REST API as a recommended datasource. Uses plugin ID format
        // (not display name) — IntegrationHome checks both pluginName and pluginId.
        .concat(['restapiintegration']));
};
//# sourceMappingURL=analytics.js.map