import{j,r as v}from"./app-Dory5LSx.js";import{c as A}from"./clsx-B-dksMZM.js";function $({className:e}){return j.jsx("div",{className:A("absolute bottom-1 right-1 h-2 w-2 rounded-full bg-success ring-2 ring-white dark:bg-success-dark dark:ring-gray-200",e)})}var x=new Map,h=new WeakMap,I=0,B=void 0;function O(e){return e?(h.has(e)||(I+=1,h.set(e,I.toString())),h.get(e)):"0"}function V(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?O(e.root):e[t]}`).toString()}function M(e){const t=V(e);let s=x.get(t);if(!s){const u=new Map;let c;const i=new IntersectionObserver(n=>{n.forEach(r=>{var o;const g=r.isIntersecting&&c.some(d=>r.intersectionRatio>=d);e.trackVisibility&&typeof r.isVisible>"u"&&(r.isVisible=g),(o=u.get(r.target))==null||o.forEach(d=>{d(g,r)})})},e);c=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),s={id:t,observer:i,elements:u},x.set(t,s)}return s}function T(e,t,s={},u=B){if(typeof window.IntersectionObserver>"u"&&u!==void 0){const o=e.getBoundingClientRect();return t(u,{isIntersecting:u,target:e,intersectionRatio:typeof s.threshold=="number"?s.threshold:0,time:0,boundingClientRect:o,intersectionRect:o,rootBounds:o}),()=>{}}const{id:c,observer:i,elements:n}=M(s),r=n.get(e)||[];return n.has(e)||n.set(e,r),r.push(t),i.observe(e),function(){r.splice(r.indexOf(t),1),r.length===0&&(n.delete(e),i.unobserve(e)),n.size===0&&(i.disconnect(),x.delete(c))}}function z({threshold:e,delay:t,trackVisibility:s,rootMargin:u,root:c,triggerOnce:i,skip:n,initialInView:r,fallbackInView:o,onChange:g}={}){var d;const[b,S]=v.useState(null),l=v.useRef(),[R,m]=v.useState({inView:!!r,entry:void 0});l.current=g,v.useEffect(()=>{if(n||!b)return;let f;return f=T(b,(E,p)=>{m({inView:E,entry:p}),l.current&&l.current(E,p),p.isIntersecting&&i&&f&&(f(),f=void 0)},{root:c,rootMargin:u,threshold:e,trackVisibility:s,delay:t},o),()=>{f&&f()}},[Array.isArray(e)?e.toString():e,b,c,u,i,n,s,o,t]);const w=(d=R.entry)==null?void 0:d.target,y=v.useRef();!b&&w&&!i&&!n&&y.current!==w&&(y.current=w,m({inView:!!r,entry:void 0}));const a=[S,R.inView,R.entry];return a.ref=a[0],a.inView=a[1],a.entry=a[2],a}export{$ as B,z as u};
