'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../../utils/index.cjs');
var useConfigInject = require('../../config-provider/src/hooks/useConfigInject.cjs');
require('../../message/index.cjs');
require('../../modal/index.cjs');
require('../../notification/index.cjs');
var index = require('../style/index.cjs');
var context = require('./context.cjs');
var props = require('./props.cjs');
var initDefaultProps = require('../../../utils/vue/initDefaultProps.cjs');
var _class = require('../../../utils/dom/class.cjs');
var useMessage = require('../../message/src/useMessage.cjs');
var useNotification = require('../../notification/src/useNotification.cjs');
var index$1 = require('../../modal/src/useModal/index.cjs');

function useApp() {
  return context.useInjectAppContext();
}
var AApp = /* @__PURE__ */ vue.defineComponent({
  name: "AApp",
  useApp,
  props: initDefaultProps.initDefaultProps(props.appProps(), {}),
  setup(props, {
    slots
  }) {
    const {
      prefixCls
    } = useConfigInject.default("app", props);
    const [wrapSSR, hashId] = index.default(prefixCls);
    const customClassName = vue.computed(() => {
      return _class.classNames(hashId.value, prefixCls.value, props.rootClassName);
    });
    const appConfig = context.useInjectAppConfigContext();
    const mergedAppConfig = vue.computed(() => ({
      message: {
        ...appConfig.message,
        ...props.message
      },
      notification: {
        ...appConfig.notification,
        ...props.notification
      }
    }));
    context.useProvideAppConfigContext(mergedAppConfig.value);
    const [messageApi, messageContextHolder] = useMessage.default(mergedAppConfig.value.message);
    const [notificationApi, notificationContextHolder] = useNotification.default(mergedAppConfig.value.notification);
    const [ModalApi, ModalContextHolder] = index$1.default();
    const memoizedContextValue = vue.computed(() => ({
      message: messageApi,
      notification: notificationApi,
      modal: ModalApi
    }));
    context.useProvideAppContext(memoizedContextValue.value);
    return () => {
      var _a;
      return wrapSSR(vue.createVNode("div", {
        "class": customClassName.value
      }, [ModalContextHolder(), messageContextHolder(), notificationContextHolder(), (_a = slots.default) == null ? void 0 : _a.call(slots)]));
    };
  }
});

exports.default = AApp;
//# sourceMappingURL=App.cjs.map
