/**
 * ldesign v0.2.3
 * (c) 2022年9月24日 swimly
 * @license MIT
 */

import Vue from 'vue';
import cloneDeep from 'lodash/cloneDeep';
import { defaultGlobalConfig, mergeWith } from './context.js';
import 'lodash';
import '../../_chunks/dep-b1584b65.js';

const ConfigProvider = Vue.extend({
  name: "ConfigProvider",
  props: {
    globalConfig: Object
  },

  data() {
    return {
      defaultData: cloneDeep(defaultGlobalConfig)
    };
  },

  provide() {
    return {
      globalConfig: this.mergedGlobalConfig
    };
  },

  computed: {
    mergedGlobalConfig() {
      const mergedGlobalConfig = mergeWith(this.defaultData, this.globalConfig);
      return mergedGlobalConfig;
    }

  },

  render() {
    const h = arguments[0];

    if (this.$slots.default.length === 1) {
      return this.$slots.default[0];
    }

    return h("div", [this.$slots.default]);
  }

});

export { ConfigProvider as default };
//# sourceMappingURL=config-provider.js.map
