"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = _default;

function _react() {
  const data = _interopRequireDefault(require("react"));

  _react = function _react() {
    return data;
  };

  return data;
}

function _assert() {
  const data = _interopRequireDefault(require("assert"));

  _assert = function _assert() {
    return data;
  };

  return data;
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _default(api) {
  return {
    name: 'base',

    validate(val) {
      (0, _assert().default)(typeof val === 'string', `Configure item base should be String, but got ${val}`);
    },

    onChange() {
      api.service.restart(
      /* why */
      'Config base Changed');
    },

    group: 'route',
    type: 'string',
    default: '/',
    title: {
      'zh-CN': '路由 Base',
      'en-US': 'Route Base'
    },
    description: {
      'zh-CN': '指定 react-router 的 base 属性，决定路由从 URL 的哪层路径开始计算，部署到非根目录时有用。',
      'en-US': 'Specify the base of the react-router to be configured when deploying to a non-root directory.'
    }
  };
}