window.scrollToBottom = (element) => { if (element) { requestAnimationFrame(function () { element.scroll({ top: element.scrollHeight, behavior: 'smooth' }); }) } }; window.getScrollInfo = (element) => { if (!element) return null; return { scrollTop: element.scrollTop, scrollHeight: element.scrollHeight, clientHeight: element.clientHeight }; };