"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.validate = void 0;
var _calcNightWithDeals = require("./calcNightWithDeals");
const validate = _ref => {
  let {
    dataSource: {
      calendar: {
        highlights = [],
        minNightsWithDeals
      } = {}
    } = {},
    value: {
      calendar: [from, to] = []
    } = {}
  } = _ref;
  let valid = true;
  if (!from || !to) valid = false;
  if (from && to && (0, _calcNightWithDeals.calcNightWithDeals)(from, to, highlights) < minNightsWithDeals) valid = false;
  return valid;
};
exports.validate = validate;
//# sourceMappingURL=validate.js.map