/**
 * DevExtreme (renovation/ui/scheduler/model/untyped_getCurrentView.js)
 * Version: 23.2.4 (build 24056-0112)
 * Build date: Sun Feb 25 2024
 *
 * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
"use strict";
exports.renovationGetCurrentView = void 0;
var _type = require("../../../../core/utils/type");
const VIEW_TYPES = ["day", "week", "workWeek", "month", "timelineDay", "timelineWeek", "timelineWorkWeek", "timelineMonth", "agenda"];
const renovationGetCurrentView = (currentView, views) => {
    let currentViewProps = views.find(view => {
        const names = (0, _type.isObject)(view) ? [view.name, view.type] : [view];
        if (names.includes(currentView)) {
            return true
        }
        return false
    });
    if (void 0 === currentViewProps) {
        if (VIEW_TYPES.includes(currentView)) {
            currentViewProps = currentView
        } else {
            [currentViewProps] = views
        }
    }
    return currentViewProps
};
exports.renovationGetCurrentView = renovationGetCurrentView;
