'use strict';

var rangeIncludesDate = require('./rangeIncludesDate.cjs');
var DateLib = require('../classes/DateLib.cjs');

/**
 * Determines whether a given range overlaps with another range.
 *
 * @since 9.2.2
 * @group Utilities
 */
function rangeOverlaps(rangeLeft, rangeRight, dateLib = DateLib.defaultDateLib) {
    return (rangeIncludesDate.rangeIncludesDate(rangeLeft, rangeRight.from, false, dateLib) ||
        rangeIncludesDate.rangeIncludesDate(rangeLeft, rangeRight.to, false, dateLib) ||
        rangeIncludesDate.rangeIncludesDate(rangeRight, rangeLeft.from, false, dateLib) ||
        rangeIncludesDate.rangeIncludesDate(rangeRight, rangeLeft.to, false, dateLib));
}

exports.rangeOverlaps = rangeOverlaps;
//# sourceMappingURL=rangeOverlaps.cjs.map
