import { calculateAutoCloseConfig, calculateStatusClassName } from "./utils/PaymentResultToastUtils";
export function buildPaymentResultToastParams(_ref) {
  var paymentStatus = _ref.paymentStatus,
    orderTotalAmount = _ref.orderTotalAmount,
    gapAmount = _ref.gapAmount,
    changeGivenAmount = _ref.changeGivenAmount,
    failureReason = _ref.failureReason,
    isModalMode = _ref.isModalMode;
  if (!paymentStatus) return null;
  var autoCloseConfig = calculateAutoCloseConfig(paymentStatus, !!Number(changeGivenAmount || 0));
  if (isModalMode) {
    autoCloseConfig.autoClose = false;
    autoCloseConfig.autoCloseDelay = 0;
    autoCloseConfig.maskClosable = false;
  }
  return {
    statusClassName: calculateStatusClassName(paymentStatus),
    paymentStatus: paymentStatus,
    orderTotalAmount: Number(orderTotalAmount || 0),
    gapAmount: paymentStatus === 'partially_paid' ? Number(gapAmount || 0) : Number(changeGivenAmount || 0),
    failureReason: failureReason,
    autoCloseConfig: autoCloseConfig
  };
}