import { defineComponent, reactive, provide, watch } from 'vue';
import { changeConfirmLocale } from '../modal/locale.mjs';
import warning from '../_util/warning.mjs';
import { withInstall } from '../_util/type.mjs';

const ANT_MARK = "internalMark";
const LocaleProvider = defineComponent({
  compatConfig: { MODE: 3 },
  name: "ALocaleProvider",
  props: {
    locale: {
      type: Object
    },
    ANT_MARK__: String
  },
  setup(props, { slots }) {
    warning(
      props.ANT_MARK__ === ANT_MARK,
      "LocaleProvider",
      "`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead"
    );
    const state = reactive({
      antLocale: {
        ...props.locale,
        exist: true
      },
      ANT_MARK__: ANT_MARK
    });
    provide("localeData", state);
    watch(
      () => props.locale,
      (locale2) => {
        changeConfirmLocale(locale2 && locale2.Modal);
        state.antLocale = {
          ...locale2,
          exist: true
        };
      },
      { immediate: true }
    );
    return () => {
      var _a;
      return (_a = slots.default) == null ? void 0 : _a.call(slots);
    };
  }
});
LocaleProvider.install = function(app) {
  app.component(LocaleProvider.name, LocaleProvider);
  return app;
};
const locale = withInstall(LocaleProvider);

export { ANT_MARK, locale as default };
//# sourceMappingURL=index.mjs.map
