var e={},t=new Set,n=new WeakSet,r=!0,i=void 0,a=!1;function o(e){a||(a=!0,r??=e?.prefetchAll??!1,i??=e?.defaultStrategy??`hover`,s(),c(),l(),d())}function s(){for(let e of[`touchstart`,`mousedown`])document.addEventListener(e,e=>{let t=e.target.closest(`a`);m(t,`tap`)&&f(t.href,{ignoreSlowConnection:!0})},{passive:!0})}function c(){let e;document.body.addEventListener(`focusin`,e=>{let n=e.target.closest(`a`);m(n,`hover`)&&t(n.href)},{passive:!0}),document.body.addEventListener(`focusout`,r,{passive:!0}),g(()=>{for(let e of document.getElementsByTagName(`a`))n.has(e)||m(e,`hover`)&&(n.add(e),e.addEventListener(`mouseenter`,e=>t(e.currentTarget.href),{passive:!0}),e.addEventListener(`mouseleave`,r,{passive:!0}))});function t(t){e&&clearTimeout(e),e=setTimeout(()=>{f(t)},80)}function r(){e&&=(clearTimeout(e),0)}}function l(){let e;g(()=>{for(let t of document.getElementsByTagName(`a`))n.has(t)||m(t,`viewport`)&&(n.add(t),e??=u(),e.observe(t))})}function u(){let e=new WeakMap;return new IntersectionObserver((t,n)=>{for(let r of t){let t=r.target,i=e.get(t);r.isIntersecting?(i&&clearTimeout(i),e.set(t,setTimeout(()=>{n.unobserve(t),e.delete(t),f(t.href)},300))):i&&(clearTimeout(i),e.delete(t))}})}function d(){g(()=>{for(let e of document.getElementsByTagName(`a`))m(e,`load`)&&f(e.href)})}function f(n,r){n=n.replace(/#.*/,``);let i=r?.ignoreSlowConnection??!1;if(p(n,i))if(t.add(n),document.createElement(`link`).relList?.supports?.(`prefetch`)){let e=document.createElement(`link`);e.rel=`prefetch`,e.setAttribute(`href`,n),document.head.append(e)}else{let t=new Headers;for(let[n,r]of Object.entries(e))t.set(n,r);fetch(n,{priority:`low`,headers:t})}}function p(e,n){if(!navigator.onLine||!n&&h())return!1;try{let n=new URL(e,location.href);return location.origin===n.origin&&(location.pathname!==n.pathname||location.search!==n.search)&&!t.has(e)}catch{}return!1}function m(e,t){if(e?.tagName!==`A`)return!1;let n=e.dataset.astroPrefetch;return n===`false`?!1:t===`tap`&&(n!=null||r)&&h()?!0:n==null&&r||n===``?t===i:n===t}function h(){if(`connection`in navigator){let e=navigator.connection;return e.saveData||/2g/.test(e.effectiveType)}return!1}function g(e){e();let t=!1;document.addEventListener(`astro:page-load`,()=>{if(!t){t=!0;return}e()}),new MutationObserver(t=>{for(let n of t)for(let t of n.addedNodes)if(t instanceof Element&&(t.tagName===`A`||t.querySelector?.(`a`))){e();return}}).observe(document.body,{childList:!0,subtree:!0})}o();