"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getRelativeGuideSnaps = void 0;
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _mediaSingle = require("../media-single");
var getRelativeGuideSnaps = exports.getRelativeGuideSnaps = function getRelativeGuideSnaps(relativeGuides, aspectRatio) {
  var snapsWidthFromMatchingHeight = Object.keys(relativeGuides.height || {}).map(function (heightKey) {
    var height = Number.parseInt(heightKey);
    return (0, _mediaSingle.roundToNearest)(height * aspectRatio);
  });
  var snapsWidthFromMatchingWidth = Object.keys(relativeGuides.width || {}).map(function (widthKey) {
    return Number.parseInt(widthKey);
  });
  return [].concat((0, _toConsumableArray2.default)(snapsWidthFromMatchingWidth), (0, _toConsumableArray2.default)(snapsWidthFromMatchingHeight));
};