function g(a,c){const n="data-tcr-highlight",s="tcr-role=";for(const t of Array.from(document.querySelectorAll(`[${n}]`)))t.remove();const m=t=>{const e=t.getAttribute("role");if(e?.trim())return e.trim();const r=t.tagName.toLowerCase();if(r==="button")return"button";if(r==="a")return t.getAttribute("href")===null?"generic":"link";if(r==="select")return"combobox";if(r==="textarea")return"textbox";if(r==="input"){const i=(t.type||"text").toLowerCase();return i==="checkbox"?"checkbox":i==="radio"?"radio":["submit","button","reset"].includes(i)?"button":"textbox"}return r},p=t=>{const e=t.getAttribute("aria-label");return e?.trim()?e.trim():(t.textContent??"").trim().replace(/\s+/g," ")};let o=null,u;for(const t of a){try{if(t.startsWith(s)){const e=t.slice(s.length),[r,...i]=e.split(";name="),f=i.join(";name=").trim().toLowerCase();o=Array.from(document.querySelectorAll("*")).find(l=>m(l)===r&&p(l).toLowerCase()===f)??null}else o=document.querySelector(t)}catch{o=null}if(o){u=t;break}}if(!o)return{found:!1};o.scrollIntoView({behavior:"smooth",block:"center"});const d=()=>{const t=o.getBoundingClientRect(),e=document.createElement("div");e.setAttribute(n,"true"),e.style.cssText=["position: fixed !important",`top: ${String(t.top)}px !important`,`left: ${String(t.left)}px !important`,`width: ${String(Math.max(t.width,4))}px !important`,`height: ${String(Math.max(t.height,4))}px !important`,"border: 2px solid #F35800 !important","border-radius: 3px !important","background: rgba(243, 88, 0, 0.12) !important","box-shadow: 0 0 0 9999px rgba(0, 9, 44, 0.28) !important","pointer-events: none !important","z-index: 2147483647 !important","transition: opacity 200ms ease-out !important","opacity: 1 !important","margin: 0 !important","padding: 0 !important"].join(";"),document.body.appendChild(e),window.setTimeout(()=>{e.style.opacity="0",window.setTimeout(()=>e.remove(),220)},c)};return window.setTimeout(d,320),{found:!0,usedSelector:u}}const h=2600;async function b(a,c){try{const[n]=await chrome.scripting.executeScript({target:{tabId:a},func:g,args:[[...c],h]});return n?.result??{found:!1}}catch(n){return{error:n.message}}}export{b as h};
//# sourceMappingURL=chunk-BA4MF1F5.js.map
