"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isScrolledIntoView = exports.clearScrollTimer = exports.scroll = void 0;
var scroll = function (element) { return element && element.scrollIntoView({ block: 'end', behavior: 'smooth' }); };
exports.scroll = scroll;
var clearScrollTimer = function (scrollTimer) {
    if (scrollTimer) {
        clearTimeout(scrollTimer);
    }
};
exports.clearScrollTimer = clearScrollTimer;
var isScrolledIntoView = function (element, scrollableParent) {
    if (element && scrollableParent) {
        var elemTop = element.offsetTop;
        var elemBottom = element.offsetTop + element.clientHeight;
        var clientHeight = scrollableParent.clientHeight, scrollTop = scrollableParent.scrollTop;
        return elemTop >= 0 && elemBottom > scrollTop && elemBottom < scrollTop + clientHeight;
    }
};
exports.isScrolledIntoView = isScrolledIntoView;
