/* OxygenHub report frame (oxygenhub#127): the hub adds this to a report's HTML pages. It tells the page around the frame how tall the report is, so the frame grows to fit instead of scrolling, and takes the hub's theme (data-theme="dark" or "light" on ) for report.css. It sends nothing but sizes, and reads nothing but the theme. */ (function () { if (window.parent === window) return; var root = document.documentElement, last = 0; var send = function () { var h = Math.ceil(Math.max(root.scrollHeight, document.body ? document.body.scrollHeight : 0)); if (h && h !== last) { last = h; window.parent.postMessage({ oxygenhubReport: { height: h } }, "*"); } }; window.addEventListener("message", function (e) { if (e.source !== window.parent) return; var t = e.data && e.data.oxygenhubTheme; if (t === "dark" || t === "light") root.dataset.theme = t; }); window.addEventListener("load", send); if (window.ResizeObserver) new ResizeObserver(send).observe(root); else setInterval(send, 500); window.parent.postMessage({ oxygenhubReport: { ready: true } }, "*"); })();