import { jsx as o } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { getCapitalErrorMessage as l } from "../../../../utils/capital/getCapitalErrorMessage.js";
import m from "../../../../../core/Errors/AdyenPlatformExperienceError.js";
import { ErrorMessageDisplay as u } from "../../../../internal/ErrorMessageDisplay/ErrorMessageDisplay.js";
import { useCallback as E, useMemo as c } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import g from "../../../../internal/Button/Button.js";
import { ButtonVariant as C } from "../../../../internal/Button/types.js";
import { ErrorTypes as s } from "../../../../../core/Http/utils.js";
import R from "../../../../../core/Context/preact/useCoreContext.js";
import { Fragment as d } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/dist/preact.module.js";
const w = ({
  emptyGrantOffer: t,
  error: e,
  onContactSupport: i,
  onBack: r,
  unsupportedRegion: n
}) => {
  const { i18n: a } = R(), p = E(
    () => /* @__PURE__ */ o(d, { children: r && /* @__PURE__ */ o(g, { variant: C.SECONDARY, onClick: r, children: a.get("capital.common.actions.goBack") }) }),
    [a, r]
  ), f = c(() => n ? new m(s.ERROR, "UnsupportedRegion", "Unsupported Region Configuration", "UNSUPPORTED_REGION") : t ? new m(s.ERROR, "EmptyConfig", "Empty Configuration", "EMPTY_CONFIG") : e, [t, n, e]);
  return /* @__PURE__ */ o(
    u,
    {
      absolutePosition: !1,
      withImage: !0,
      onContactSupport: i,
      renderSecondaryButton: p,
      outlined: !1,
      ...l(f, i)
    }
  );
};
export {
  w as CapitalErrorMessageDisplay
};
