import"./goofishItemUrl-DrzhgGQ-.js";var e=`xyxp-goofish-search-heat`,t=`xyxp-goofish-search-heat-fallback`;function n(e=window.location.href){try{let t=new URL(e);return t.origin===`https://www.goofish.com`?t.pathname.includes(`search`)?!0:/search/i.test(t.hash):!1}catch{return!1}}function r(e,t,n,r,i=8){let a=window.innerWidth,o=window.innerHeight,s=Math.max(1,n),c=Math.max(1,r);return{left:Math.max(i,Math.min(e,a-s-i)),top:Math.max(i,Math.min(t,o-c-i))}}function i(e,t=8){let n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return!0;let r=window.innerWidth,i=window.innerHeight;return n.right<t||n.bottom<t||n.left>r-t||n.top>i-t}function a(e){window.addEventListener(`popstate`,e),window.addEventListener(`hashchange`,e);let t=t=>{let n=history[t];history[t]=function(...t){let r=n.apply(this,t);return e(),r}};t(`pushState`),t(`replaceState`)}export{n as a,a as i,e as n,i as o,r,t};