"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const deepmerge_1 = tslib_1.__importDefault(require("deepmerge"));
// tslint:disable:object-literal-sort-keys
exports.navigation = {
    'bluebase.navigator.root': [
        {
            key: 'bluebase-navigator-root-internal-default',
            priority: 5,
            value: async (inputNavigator, _ctx, BB) => {
                const navigator = {
                    type: 'switch',
                    initialRouteName: 'Root',
                    routes: [
                        {
                            name: 'Root',
                            path: '',
                            navigator: await BB.Filters.run('bluebase.navigator.main', {}),
                            navigationOptions: {
                                header: null,
                            },
                        },
                    ],
                };
                return deepmerge_1.default(inputNavigator, navigator);
            },
        },
    ],
    'bluebase.navigator.main': [
        {
            key: 'bluebase-navigator-main-internal-default',
            priority: 5,
            // tslint:disable-line:object-literal-sort-keys
            value: async (inputNavigator, _ctx, BB) => {
                let mainRoutes = [
                    {
                        name: 'Home',
                        path: '',
                        exact: true,
                        screen: 'HomeScreen',
                        navigationOptions: {
                            headerLeft: null,
                            title: BB.Configs.getValue('title'),
                        },
                    },
                ];
                const routeMap = BB.Plugins.getRouteMap();
                Object.values(routeMap).forEach(routesArr => (mainRoutes = mainRoutes.concat(routesArr)));
                const navigator = {
                    type: 'stack',
                    initialRouteName: 'Home',
                    routes: mainRoutes,
                };
                return deepmerge_1.default(inputNavigator, navigator);
            },
        },
    ],
};
