"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")), _view = _interopRequireWildcard(require("./view")), AmosConfig = endConf.AmosConfig, loginURI = AmosConfig.httpURI.loginURI, injectRoutes = function(e) {
    var o = (0, _customRoutes.default)((0, _calcRoutes.default)(e, _view.default));
    return [ {
        path: "login",
        component: _view.Login
    }, {
        path: "region",
        component: _view.RegionList
    }, {
        path: "main",
        component: _view.RootView,
        childRoutes: (0, _toConsumableArray2.default)(o)
    } ];
}, progressStart = function() {
    _rayProgress.default.start();
}, rootRoutes = function(e) {
    return {
        path: "/",
        onChange: progressStart,
        indexRedirect: _view.Login,
        indexRoute: {
            onEnter: function(e, o) {
                window.location.href = loginURI;
            }
        },
        childRoutes: injectRoutes(e)
    };
}, _default = rootRoutes;

exports.default = _default;