"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.showClubRate = void 0;
var _dataSources = require("@mirai/data-sources");
var _getClubRate = require("./getClubRate");
var _Rates = require("../Rates.constants");
const storage = new _dataSources.Storage({
  adapter: _dataSources.SessionAdapter
});
const showClubRate = _ref => {
  let {
    cart,
    clubDiscount,
    dataSource,
    isPestana,
    session
  } = _ref;
  if (!isPestana && clubDiscount && !session && !storage.get(_Rates.CLUB_RATE_STORAGE_VIEWED) && cart.filter(board => (0, _getClubRate.getClubRate)({
    board,
    dataSource
  })).length > 0) {
    storage.set(_Rates.CLUB_RATE_STORAGE_VIEWED, true);
    return true;
  }
  return false;
};
exports.showClubRate = showClubRate;
//# sourceMappingURL=showClubRate.js.map