import Vue from 'vue'
import App from './App'
import i18n from './i18n'
import store from './store'
import router from './router'
import baiduMap from './baiduMap'

import '@/vab'
import './assets/css/diy.css'

//import VueAMap, {initAMapApiLoader} from '@vuemap/vue-amap';
// import '@vuemap/vue-amap/dist/style.css'


import { sprintf, translateTitle as __ } from '@/utils/i18n'

// Vue.use(VueAMap);

// initAMapApiLoader({
//   key: 'a00a7af766135e741fee8505247afb0b',
//   plugins:['AMap.CircleEditor'],
// })


/**
 * @description 正式环境默认使用mock，正式项目记得注释后再打包
 */
import { baseURL, pwa } from './config'
import { isExternal } from 'vue-plugin-utils'

if (process.env.NODE_ENV === 'production' && !isExternal(baseURL)) {
  /*
  const { mockXHR } = require('@/utils/static')
  mockXHR()
  */
}

if (pwa) require('./registerServiceWorker')

Vue.config.productionTip = false
Vue.prototype.sprintf = sprintf
Vue.prototype.__ = __

new Vue({
  el: '#app',
  i18n,
  store,
  router,
  baiduMap,
  render: (h) => h(App),
})
