import{bi as c,r as o,aT as s}from"./index-BuFgUdF6.js";let a=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function f(r){var u,n;let e=(u=r.innerText)!=null?u:"",l=r.cloneNode(!0);if(!c(l))return e;let t=!1;for(let F of l.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))F.remove(),t=!0;let i=t?(n=l.innerText)!=null?n:"":e;return a.test(i)&&(i=i.replace(a,"")),i}function m(r){let u=r.getAttribute("aria-label");if(typeof u=="string")return u.trim();let n=r.getAttribute("aria-labelledby");if(n){let e=n.split(" ").map(l=>{let t=document.getElementById(l);if(t){let i=t.getAttribute("aria-label");return typeof i=="string"?i.trim():f(t).trim()}return null}).filter(Boolean);if(e.length>0)return e.join(", ")}return f(r).trim()}function g(r){let u=o.useRef(""),n=o.useRef("");return s(()=>{let e=r.current;if(!e)return"";let l=e.innerText;if(u.current===l)return n.current;let t=m(e).trim().toLowerCase();return u.current=l,n.current=t,t})}export{g as s};
