"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"), _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.default = void 0;

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")), _amosTool = require("amos-tool"), _rayProgress = _interopRequireDefault(require("ray-progress")), endConf = _interopRequireWildcard(require("amos-processor/lib/config/endconf")), _calcRoutes = _interopRequireDefault(require("./calcRoutes")), _customRoutes = _interopRequireDefault(require("./customRoutes")), _asyncView = _interopRequireWildcard(require("./asyncView")), AmosConfig = endConf.AmosConfig, loginURI = AmosConfig.httpURI.loginURI, progressStart = function() {
    _rayProgress.default.start();
}, injectRoutes = function(e) {
    var o = (0, _customRoutes.default)((0, _calcRoutes.default)(e, _asyncView.default));
    return [ {
        path: "login",
        component: _asyncView.AsyncLogin
    }, {
        path: "region",
        component: _asyncView.AsyncRegionList
    }, {
        path: "main",
        component: _asyncView.AsyncRootView,
        childRoutes: (0, _toConsumableArray2.default)(o)
    } ];
}, rootRoutes = function(e) {
    return {
        path: "/",
        onChange: progressStart,
        indexRedirect: _asyncView.AsyncLogin,
        indexRoute: {
            onEnter: function(e, o) {
                window.location.href = loginURI;
            }
        },
        childRoutes: injectRoutes(e)
    };
}, _default = rootRoutes;

exports.default = _default;