import{j as m,$ as S,r as d,f9 as V,L as j}from"./index-Cc-6WbPt.js";const z=({children:e})=>m.jsx(S,{flexDirection:"column",sx:{gap:20},pb:"60vh",children:e});var p=new Map,l=new WeakMap,w=0,M=void 0;function B(e){return e?(l.has(e)||(w+=1,l.set(e,w.toString())),l.get(e)):"0"}function T(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?B(e.root):e[t]}`).toString()}function _(e){const t=T(e);let n=p.get(t);if(!n){const i=new Map;let u;const o=new IntersectionObserver(s=>{s.forEach(r=>{var c;const g=r.isIntersecting&&u.some(f=>r.intersectionRatio>=f);e.trackVisibility&&typeof r.isVisible>"u"&&(r.isVisible=g),(c=i.get(r.target))==null||c.forEach(f=>{f(g,r)})})},e);u=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:o,elements:i},p.set(t,n)}return n}function $(e,t,n={},i=M){if(typeof window.IntersectionObserver>"u"&&i!==void 0){const c=e.getBoundingClientRect();return t(i,{isIntersecting:i,target:e,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:c,intersectionRect:c,rootBounds:c}),()=>{}}const{id:u,observer:o,elements:s}=_(n),r=s.get(e)||[];return s.has(e)||s.set(e,r),r.push(t),o.observe(e),function(){r.splice(r.indexOf(t),1),r.length===0&&(s.delete(e),o.unobserve(e)),s.size===0&&(o.disconnect(),p.delete(u))}}function O({threshold:e,delay:t,trackVisibility:n,rootMargin:i,root:u,triggerOnce:o,skip:s,initialInView:r,fallbackInView:c,onChange:g}={}){var f;const[h,C]=d.useState(null),b=d.useRef(g),[x,A]=d.useState({inView:!!r,entry:void 0});b.current=g,d.useEffect(()=>{if(s||!h)return;let v;return v=$(h,(I,y)=>{A({inView:I,entry:y}),b.current&&b.current(I,y),y.isIntersecting&&o&&v&&(v(),v=void 0)},{root:u,rootMargin:i,threshold:e,trackVisibility:n,delay:t},c),()=>{v&&v()}},[Array.isArray(e)?e.toString():e,h,u,i,o,s,n,c,t]);const R=(f=x.entry)==null?void 0:f.target,E=d.useRef(void 0);!h&&R&&!o&&!s&&E.current!==R&&(E.current=R,A({inView:!!r,entry:void 0}));const a=[C,x.inView,x.entry];return a.ref=a[0],a.inView=a[1],a.entry=a[2],a}const D={textDecoration:"none",scrollMarginTop:"5vh"},W=({name:e,children:t})=>{const{setVisibility:n,clear:i}=d.useContext(V),{ref:u}=O({threshold:[0,1],rootMargin:"0% 0% 0% 0%",root:document.getElementById("content"),onChange:(o,s)=>{n({anchor:e,visibility:s.intersectionRatio})}});return d.useEffect(()=>i,[i]),m.jsx(j,{sx:D,ref:u,id:e,children:t})};export{z as A,W as a};
