"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getComponent = void 0;
var _constants = require("./constants");
var _Payment = require("../../Payment/Payment.constants");
var _components = require("../components");
const {
  CARD,
  PCIPROXY,
  TPV
} = _Payment.METHOD;
const {
  ADDON,
  ADYEN,
  CHECKOUT,
  SIPAY,
  PAYCOMET
} = _Payment.PROVIDER;
const getComponent = function () {
  let {
    cardValidation = false,
    method,
    methodConfig,
    provider
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  let component;
  const isValidPayment = method === TPV || [CARD, PCIPROXY].includes(method) && cardValidation;
  if (methodConfig && isValidPayment) component = _constants.MODALS[methodConfig.modal];else if (provider === ADDON && isValidPayment) component = _components.FormAddon;else if (provider === ADYEN && isValidPayment) component = _components.FormAdyen;else if (provider === CHECKOUT && isValidPayment) component = _components.FormCheckout;else if (provider === SIPAY && isValidPayment) component = _components.FormSipay;else if (provider === PAYCOMET && isValidPayment) component = _components.FormPaycomet;
  return component;
};
exports.getComponent = getComponent;
//# sourceMappingURL=getComponent.js.map