/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 8770:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "getLanguage": function() { return /* binding */ getLanguage; },
  "initi18n": function() { return /* binding */ initi18n; },
  "lang": function() { return /* binding */ lang; }
});

// UNUSED EXPORTS: default, geti18n, locale, setLanguage, setLocale

;// CONCATENATED MODULE: external "js-cookie"
var external_js_cookie_namespaceObject = require("js-cookie");
var external_js_cookie_default = /*#__PURE__*/__webpack_require__.n(external_js_cookie_namespaceObject);
;// CONCATENATED MODULE: external "@zpc_npm/vue-iclient-leaflet/_lang/en"
var en_namespaceObject = require("@zpc_npm/vue-iclient-leaflet/_lang/en");
var en_default = /*#__PURE__*/__webpack_require__.n(en_namespaceObject);
;// CONCATENATED MODULE: external "@zpc_npm/vue-iclient-leaflet/_lang/zh"
var zh_namespaceObject = require("@zpc_npm/vue-iclient-leaflet/_lang/zh");
var zh_default = /*#__PURE__*/__webpack_require__.n(zh_namespaceObject);
;// CONCATENATED MODULE: external "element-plus/es/locale/lang/zh-cn"
var zh_cn_namespaceObject = require("element-plus/es/locale/lang/zh-cn");
var zh_cn_default = /*#__PURE__*/__webpack_require__.n(zh_cn_namespaceObject);
;// CONCATENATED MODULE: external "element-plus/es/locale/lang/en"
var lang_en_namespaceObject = require("element-plus/es/locale/lang/en");
var lang_en_default = /*#__PURE__*/__webpack_require__.n(lang_en_namespaceObject);
// EXTERNAL MODULE: external "xe-utils"
var external_xe_utils_ = __webpack_require__(6869);
var external_xe_utils_default = /*#__PURE__*/__webpack_require__.n(external_xe_utils_);
;// CONCATENATED MODULE: external "vue-i18n/index.mjs"
var index_mjs_namespaceObject = require("vue-i18n/index.mjs");
;// CONCATENATED MODULE: ./src/common/_lang/index.js







const dateTimeFormats = {
  en: (en_default()).dateTimeFormat,
  zh: (zh_default()).dateTimeFormat
};
const messages = {
  en: { ...(lang_en_default()),
    ...(en_default())
  },
  zh: { ...(zh_cn_default()),
    ...(zh_default())
  }
};
let i18n = {};
let rooti18n;
function getLanguage() {
  let lang = external_js_cookie_default().get("language");

  if (!lang) {
    if (navigator.appName === "Netscape") {
      lang = navigator.language;
    } else {
      lang = navigator.browserLanguage;
    }
  }

  if (lang) {
    if (lang.indexOf("zh") === 0) {
      return "zh";
    }

    if (lang.indexOf("en") === 0) {
      return "en";
    }
  }

  return "zh";
}
function setLanguage(lang) {
  Cookies.set("language", lang);
}
function geti18n() {
  return rooti18n || i18n;
}
const locale = {
  install(Vue, opts) {
    initi18n(Vue, opts);
  }

};
function setLocale(locales) {
  i18n.global.mergeLocaleMessage && i18n.global.mergeLocaleMessage(i18n.global.locale, locales);
}
const lang = external_xe_utils_default().clone(messages, true);
function initi18n(Vue, config) {
  config = config || {};

  if (config.i18n) {
    i18n = config.i18n;

    if (!i18n.global.getDateTimeFormat() || Object.keys(i18n.global.getDateTimeFormat()).length === 0) {
      i18n.global.setDateTimeFormat("en", (en_default()).dateTimeFormat);
      i18n.global.setDateTimeFormat("zh", (zh_default()).dateTimeFormat);
    }

    i18n.global.mergeLocaleMessage && i18n.global.mergeLocaleMessage("en", lang.en);
    i18n.global.mergeLocaleMessage && i18n.global.mergeLocaleMessage("zh", lang.zh);
  } else if (!Object.prototype.hasOwnProperty.call(Vue.config.globalProperties, "$i18n")) {
    Object.defineProperty(Vue.config.globalProperties, "$i18n", {
      get: function get() {
        if (!rooti18n && this.$options && this.$options.i18n) {
          rooti18n = this.$options.i18n;
        }

        return rooti18n || i18n;
      }
    });
    i18n = (0,index_mjs_namespaceObject.createI18n)({
      dateTimeFormats,
      locale: getLanguage(),
      fallbackLocale: "en",
      messages
    });
    Vue.use(i18n);

    if (config.locale) {
      setLocale(config.locale);
    }

    const locale = config.i18n || i18n || config.locale;

    if (!Vue.iclient) {
      Vue.iclient = {
        locale
      };
    } else {
      Vue.iclient.locale = locale;
    }
  }
}
/* harmony default export */ var _lang = ((/* unused pure expression or super */ null && (i18n)));

/***/ }),

/***/ 6869:
/***/ (function(module) {

module.exports = require("xe-utils");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
!function() {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* binding */ src_init; }
});

// EXTERNAL MODULE: ./src/common/_lang/index.js + 6 modules
var _lang = __webpack_require__(8770);
;// CONCATENATED MODULE: external "@zpc_npm/vue-iclient-leaflet/_utils/style/theme/setTheme"
var setTheme_namespaceObject = require("@zpc_npm/vue-iclient-leaflet/_utils/style/theme/setTheme");
;// CONCATENATED MODULE: ./src/init.js



function init(Vue, opts = {}) {
  if (!Vue.iclient || !Vue.iclient.theme) {
    initTheme(Vue, opts);
  }

  if (!Vue.iclient || !Vue.iclient.locale) {
    initI18n(Vue, opts);
  }

  const theme = Vue.iclient && Vue.iclient.theme || opts.theme || "light";
  const locale = Vue.iclient && Vue.iclient.locale || opts.locale || opts.i18n || _lang.lang[(0,_lang.getLanguage)()];
  return {
    locale,
    theme
  };
} // 初始化主题


function initTheme(Vue, opts = {}) {
  const theme = opts.theme || "light";
  (0,setTheme_namespaceObject.setTheme)(Vue, theme);
  return theme;
} // 初始化国际化


function initI18n(Vue, opts = {}) {
  const locale = opts && opts.i18n ? {
    i18n: opts.i18n
  } : {
    locale: opts && opts.locale || _lang.lang[(0,_lang.getLanguage)()]
  };
  (0,_lang.initi18n)(Vue, locale);
  return opts && (opts.locale || opts.i18n) || _lang.lang[(0,_lang.getLanguage)()];
}

/* harmony default export */ var src_init = ((Vue, opts) => {
  const {
    theme,
    locale
  } = Vue.iclient || {};

  if (!Vue.iclient || !theme || !locale) {
    Vue.iclient = init(Vue, opts);
    Vue.config.globalProperties.$iclient = Vue.iclient;
  }
});
}();
module.exports = __webpack_exports__;
/******/ })()
;