const g='main[data-component-name="Markdown/Markdown"]',h='[data-component-name="Markdoc/Heading/Heading"]';function a(){return document.querySelector(g)}function u(t){const e=Array.from(t.querySelectorAll(h));return e.length>0?e:Array.from(t.querySelectorAll("h1, h2, h3, h4, h5, h6"))}function l(){const t=a();if(!t)return[];const e=u(t);if(e.length===0)return[{offset:n(t),height:t.offsetHeight}];const o=[],f=n(t),s=n(e[0]);s>f&&o.push({offset:f,height:s-f});for(let r=0;r<e.length;r++){const c=n(e[r]),i=(r+1<e.length?n(e[r+1]):n(t)+t.offsetHeight)-c;i>0&&o.push({height:i,offset:c})}return o}const m=()=>{const t=a(),e=t?n(t):0,o=d();return e-o},d=()=>document.querySelector("nav")?.offsetHeight??0;function n(t){if(!t)return 0;const e=window.getComputedStyle(t),o=parseFloat(e.getPropertyValue("margin-top"))||0;return t.offsetTop-o}export{m as getArticleOffsetTop,l as getBlocksHeight,d as getNavHeight};
