"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 BIZUM = _helpers.PAYMENT_METHOD.BIZUM,
  CARD = _helpers.PAYMENT_METHOD.CARD,
  TPV = _helpers.PAYMENT_METHOD.TPV;
const ACTION_BOOK_NOW = _getButtonPaymentKey.L10N.ACTION_BOOK_NOW,
  ACTION_FINAL_DETAILS = _getButtonPaymentKey.L10N.ACTION_FINAL_DETAILS,
  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,
    provider = _ref.provider;
  return [BIZUM, TPV].includes(method) ? date && (0, _locale.dateDiff)((0, _locale.UTC)(new Date()), (0, _locale.parseDate)(date)).days > 0 ? ACTION_BOOK_NOW : ACTION_PAY_NOW : cardValidation && method === CARD && provider === _helpers.PAYMENT_PROVIDER.ADDON ? ACTION_FINAL_DETAILS : ACTION_BOOK_NOW;
};
exports.getButtonPaymentKey = getButtonPaymentKey;
//# sourceMappingURL=getButtonPaymentKey.js.map