"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getButtonPaymentKey = void 0;
var _locale = require("@mirai/locale");
var _getButtonPaymentKey = require("./getButtonPaymentKey.l10n");
var _helpers = require("../../helpers");
const APLAZAME = _helpers.PAYMENT_METHOD.APLAZAME,
  CARD = _helpers.PAYMENT_METHOD.CARD,
  PCIPROXY = _helpers.PAYMENT_METHOD.PCIPROXY,
  TPV = _helpers.PAYMENT_METHOD.TPV;
const ACTION_SAVE = _getButtonPaymentKey.L10N.ACTION_SAVE,
  ACTION_CONTINUE = _getButtonPaymentKey.L10N.ACTION_CONTINUE,
  ACTION_PAY_NOW = _getButtonPaymentKey.L10N.ACTION_PAY_NOW;
const getButtonPaymentKey = function () {
  let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
    cardValidation = _ref.cardValidation,
    date = _ref.date,
    method = _ref.method;
  return [CARD, PCIPROXY].includes(method) && !cardValidation ? ACTION_SAVE : method === CARD && cardValidation || method === APLAZAME || method == TPV && date && (0, _locale.dateDiff)((0, _locale.UTC)(new Date()), (0, _locale.parseDate)(date)).days > 0 ? ACTION_CONTINUE : ACTION_PAY_NOW;
};
exports.getButtonPaymentKey = getButtonPaymentKey;
//# sourceMappingURL=getButtonPaymentKey.js.map