"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useTargetZone = void 0;
var react_1 = require("react");
var layout_1 = require("../../utils/layout");
exports.useTargetZone = function (containerRef) {
    var _a = react_1.useState({ left: 0, right: 0 }), targetOffset = _a[0], setTargetOffset = _a[1];
    var onLayoutChange = function () {
        var newTargetOffset = containerRef.current
            ? layout_1.getTileTargetZoneOffsets(containerRef.current)
            : { left: 0, right: 0 };
        if (newTargetOffset.left !== targetOffset.left || newTargetOffset.right !== targetOffset.right) {
            setTargetOffset(newTargetOffset);
        }
    };
    return [targetOffset, { onLayoutChange: onLayoutChange }];
};
