import { jsx as e } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { useModalContext as a } from "../../../../internal/Modal/Modal.js";
import { TypographyElement as n, TypographyVariant as u } from "../../../../internal/Typography/types.js";
import f from "../../../../internal/Typography/Typography.js";
import { useDisputeFlow as l } from "../../context/dispute/context.js";
import { DefendDisputeFileUpload as c } from "./DefendDisputeFileUpload.js";
import { DefendDisputeReason as D } from "./DefendDisputeReason.js";
import { DefendDisputeResponse as y } from "./DefendDisputeResponse.js";
/* empty css                       */
import { useMemo as g } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import T from "../../../../../core/Context/preact/useCoreContext.js";
const M = ({ onDisputeDefend: s }) => {
  const { i18n: o } = T(), { applicableDocuments: p, flowState: t, dispute: i } = l(), { withinModal: r } = a(), d = r ? n.H2 : n.DIV, m = g(
    () => i?.dispute.type === "REQUEST_FOR_INFORMATION" ? o.get("disputes.management.defend.requestForInformation.title") : o.get("disputes.management.defend.chargeback.title"),
    [i?.dispute.type, o]
  );
  return /* @__PURE__ */ e("div", { className: "adyen-pe-defend-dispute__container", children: [
    t !== "defenseSubmitResponseView" && /* @__PURE__ */ e(f, { className: "adyen-pe-defend-dispute__title", el: d, variant: u.TITLE, medium: !0, children: m }),
    t === "defendReasonSelectionView" && /* @__PURE__ */ e(D, {}),
    t === "uploadDefenseFilesView" && !!p?.length && /* @__PURE__ */ e(c, {}),
    t === "defenseSubmitResponseView" && /* @__PURE__ */ e(y, { onDisputeDefend: s })
  ] });
};
export {
  M as DefendDisputeFlow
};
