import e, { useContext as f } from "react";
import S from "../../../classnames/index.mjs";
import "../config-provider/index.mjs";
import _ from "../message/useMessage.mjs";
import z from "../modal/useModal/index.mjs";
import w from "../notification/useNotification.mjs";
import C, { AppConfigContext as l } from "./context.mjs";
import D from "./style/index.mjs";
import { ConfigContext as F } from "../config-provider/context.mjs";
const I = () => e.useContext(C), n = (g) => {
  const {
    prefixCls: d,
    children: u,
    className: x,
    rootClassName: A,
    message: i,
    notification: a,
    style: N,
    component: t = "div"
  } = g, {
    getPrefixCls: v
  } = f(F), m = v("app", d), [M, O, b] = D(m), j = S(O, m, x, A, b), o = f(l), s = e.useMemo(() => ({
    message: Object.assign(Object.assign({}, o.message), i),
    notification: Object.assign(Object.assign({}, o.notification), a)
  }), [i, a, o.message, o.notification]), [r, E] = _(s.message), [c, P] = w(s.notification), [p, V] = z(), h = e.useMemo(() => ({
    message: r,
    notification: c,
    modal: p
  }), [r, c, p]), y = t === !1 ? e.Fragment : t, H = {
    className: j,
    style: N
  };
  return M(/* @__PURE__ */ e.createElement(C.Provider, {
    value: h
  }, /* @__PURE__ */ e.createElement(l.Provider, {
    value: s
  }, /* @__PURE__ */ e.createElement(y, Object.assign({}, t === !1 ? void 0 : H), V, E, P, u))));
};
process.env.NODE_ENV !== "production" && (n.displayName = "App");
n.useApp = I;
const Q = n;
export {
  Q as default
};
