"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTargetWithinElementCoordinates = getTargetWithinElementCoordinates;
function getTargetWithinElementCoordinates(elementRect, coordinatesWithinElement = {
    xPercent: 0.5,
    yPercent: 0.5,
}) {
    if (elementRect.x !== undefined &&
        elementRect.y !== undefined &&
        elementRect.height !== undefined &&
        elementRect.width !== undefined) {
        return {
            x: Math.round(elementRect.x + elementRect.width * coordinatesWithinElement.xPercent),
            y: Math.round(elementRect.y + elementRect.height * coordinatesWithinElement.yPercent),
        };
    }
    throw new Error('Unable to determine the center coordinates of the target element, bounding box info missing');
}
