"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getComponent = void 0;
var _constants = require("./constants");
var _components = require("../components");
var _Payment = require("../Payment.constants");
const {
  APLAZAME,
  CARD,
  CARD_PREPAY,
  PCIPROXY,
  TPV
} = _Payment.METHOD;
const {
  HIPAY,
  MULTIPAGOS,
  OPENPAY,
  PAYBOX,
  REDSYS,
  REDUNIQ
} = _Payment.PROVIDER;
const getComponent = function () {
  let {
    cardValidation,
    method,
    methodConfig,
    provider
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  let component;
  if (methodConfig) component = _constants.COMPONENTS[methodConfig.component];else if ([CARD, CARD_PREPAY, PCIPROXY].includes(method) && !cardValidation) component = method === PCIPROXY ? _components.PCI : _components.Card;else if (method === TPV && [HIPAY, MULTIPAGOS, PAYBOX, REDSYS, REDUNIQ].includes(provider)) component = _components.Tpv;else if (method === TPV && provider === OPENPAY) component = _components.Openpay;else if (method === APLAZAME) component = _components.Aplazame;
  return component;
};
exports.getComponent = getComponent;
//# sourceMappingURL=getComponent.js.map