import{i as C}from"./index.BByckzaO.js";const B="astro:before-preparation",W="astro:after-preparation",V="astro:before-swap",K="astro:after-swap",j=e=>document.dispatchEvent(new Event(e));class M extends Event{from;to;direction;navigationType;sourceElement;info;newDocument;constructor(t,n,o,s,c,l,d,r,f){super(t,n),this.from=o,this.to=s,this.direction=c,this.navigationType=l,this.sourceElement=d,this.info=r,this.newDocument=f,Object.defineProperties(this,{from:{enumerable:!0},to:{enumerable:!0,writable:!0},direction:{enumerable:!0,writable:!0},navigationType:{enumerable:!0},sourceElement:{enumerable:!0},info:{enumerable:!0},newDocument:{enumerable:!0,writable:!0}})}}class G extends M{formData;loader;constructor(t,n,o,s,c,l,d,r,f){super(B,{cancelable:!0},t,n,o,s,c,l,d),this.formData=r,this.loader=f.bind(this,this),Object.defineProperties(this,{formData:{enumerable:!0},loader:{enumerable:!0,writable:!0}})}}class z extends M{direction;viewTransition;swap;constructor(t,n,o){super(V,void 0,t.from,t.to,t.direction,t.navigationType,t.sourceElement,t.info,t.newDocument),this.direction=t.direction,this.viewTransition=n,this.swap=o.bind(this,this),Object.defineProperties(this,{direction:{enumerable:!0},viewTransition:{enumerable:!0},swap:{enumerable:!0,writable:!0}})}}async function J(e,t,n,o,s,c,l,d){const r=new G(e,t,n,o,s,c,window.document,l,d);return document.dispatchEvent(r)&&(await r.loader(),r.defaultPrevented||(j(W),r.navigationType!=="traverse"&&S({scrollX,scrollY}))),r}async function Q(e,t,n){const o=new z(e,t,n);return document.dispatchEvent(o),o.swap(),o}const Z=history.pushState.bind(history),g=history.replaceState.bind(history),S=e=>{history.state&&(history.scrollRestoration="manual",g({...history.state,...e},""))},L=!!document.startViewTransition,R=()=>!!document.querySelector('[name="astro-view-transitions-enabled"]'),H=(e,t)=>e.pathname===t.pathname&&e.search===t.search;let v,b,A=!1,F;const N=e=>document.dispatchEvent(new Event(e)),_=()=>N("astro:page-load"),ee=()=>{let e=document.createElement("div");e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),e.className="astro-route-announcer",document.body.append(e),setTimeout(()=>{let t=document.title||document.querySelector("h1")?.textContent||location.pathname;e.textContent=t},60)},w="data-astro-transition-persist",q="data-astro-transition",$="data-astro-transition-fallback";let x,E=0;history.state?(E=history.state.index,scrollTo({left:history.state.scrollX,top:history.state.scrollY})):R()&&(g({index:E,scrollX,scrollY},""),history.scrollRestoration="manual");const te=(e,t)=>{let n=!1,o=!1;return(...s)=>{if(n){o=!0;return}e(...s),n=!0,setTimeout(()=>{o&&(o=!1,e(...s)),n=!1},t)}};async function ne(e,t){try{const n=await fetch(e,t),s=(n.headers.get("content-type")??"").split(";",1)[0].trim();return s!=="text/html"&&s!=="application/xhtml+xml"?null:{html:await n.text(),redirected:n.redirected?n.url:void 0,mediaType:s}}catch{return null}}function U(){const e=document.querySelector('[name="astro-view-transitions-fallback"]');return e?e.getAttribute("content"):"animate"}function oe(){let e=Promise.resolve();for(const t of Array.from(document.scripts)){if(t.dataset.astroExec==="")continue;const n=t.getAttribute("type");if(n&&n!=="module"&&n!=="text/javascript")continue;const o=document.createElement("script");o.innerHTML=t.innerHTML;for(const s of t.attributes){if(s.name==="src"){const c=new Promise(l=>{o.onload=o.onerror=l});e=e.then(()=>c)}o.setAttribute(s.name,s.value)}o.dataset.astroExec="",t.replaceWith(o)}return e}const X=(e,t,n,o,s)=>{const c=H(t,e),l=document.title;document.title=o;let d=!1;if(e.href!==location.href&&!s)if(n.history==="replace"){const r=history.state;g({...n.state,index:r.index,scrollX:r.scrollX,scrollY:r.scrollY},"",e.href)}else Z({...n.state,index:++E,scrollX:0,scrollY:0},"",e.href);if(v=e,c||(scrollTo({left:0,top:0,behavior:"instant"}),d=!0),s)scrollTo(s.scrollX,s.scrollY);else{if(e.hash){history.scrollRestoration="auto";const r=history.state;location.href=e.href,history.state||g(r,"")}else d||scrollTo({left:0,top:0,behavior:"instant"});history.scrollRestoration="manual"}document.title=l};function re(e){const t=[];for(const n of e.querySelectorAll("head link[rel=stylesheet]"))if(!document.querySelector(`[${w}="${n.getAttribute(w)}"], link[rel=stylesheet][href="${n.getAttribute("href")}"]`)){const o=document.createElement("link");o.setAttribute("rel","preload"),o.setAttribute("as","style"),o.setAttribute("href",n.getAttribute("href")),t.push(new Promise(s=>{["load","error"].forEach(c=>o.addEventListener(c,s)),document.head.append(o)}))}return t}async function P(e,t,n,o){const s=(i,m)=>{const h=i.getAttribute(w),p=h&&m.head.querySelector(`[${w}="${h}"]`);if(p)return p;if(i.matches("link[rel=stylesheet]")){const T=i.getAttribute("href");return m.head.querySelector(`link[rel=stylesheet][href="${T}"]`)}return null},c=()=>{const i=document.activeElement;if(i?.closest(`[${w}]`)){if(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement){const m=i.selectionStart,h=i.selectionEnd;return{activeElement:i,start:m,end:h}}return{activeElement:i}}else return{activeElement:null}},l=({activeElement:i,start:m,end:h})=>{i&&(i.focus(),(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)&&(i.selectionStart=m,i.selectionEnd=h))},d=i=>{const m=document.documentElement,h=[...m.attributes].filter(({name:a})=>(m.removeAttribute(a),a.startsWith("data-astro-")));[...i.newDocument.documentElement.attributes,...h].forEach(({name:a,value:u})=>m.setAttribute(a,u));for(const a of document.scripts)for(const u of i.newDocument.scripts)if(!a.src&&a.textContent===u.textContent||a.src&&a.type===u.type&&a.src===u.src){u.dataset.astroExec="";break}for(const a of Array.from(document.head.children)){const u=s(a,i.newDocument);u?u.remove():a.remove()}document.head.append(...i.newDocument.head.children);const p=document.body,T=c();document.body.replaceWith(i.newDocument.body);for(const a of p.querySelectorAll(`[${w}]`)){const u=a.getAttribute(w),D=document.querySelector(`[${w}="${u}"]`);D&&D.replaceWith(a)}l(T)};async function r(i){function m(a){const u=a.effect;return!u||!(u instanceof KeyframeEffect)||!u.target?!1:window.getComputedStyle(u.target,u.pseudoElement).animationIterationCount==="infinite"}const h=document.getAnimations();document.documentElement.setAttribute($,i);const T=document.getAnimations().filter(a=>!h.includes(a)&&!m(a));return Promise.all(T.map(a=>a.finished))}if(!A)document.documentElement.setAttribute(q,e.direction),o==="animate"&&await r("old");else throw new DOMException("Transition was skipped");const f=document.title,y=await Q(e,b,d);X(y.to,y.from,t,f,n),N(K),o==="animate"&&!A&&r("new").then(()=>F())}async function Y(e,t,n,o,s){if(!R()||location.origin!==n.origin){location.href=n.href;return}const c=s?"traverse":o.history==="replace"?"replace":"push";if(c!=="traverse"&&S({scrollX,scrollY}),H(t,n)&&(e!=="back"&&n.hash||e==="back"&&t.hash)){X(n,t,o,document.title,s);return}const l=await J(t,n,e,c,o.sourceElement,o.info,o.formData,d);if(l.defaultPrevented){location.href=n.href;return}async function d(r){const f=r.to.href,y={};if(r.formData){y.method="POST";const h=r.sourceElement instanceof HTMLFormElement?r.sourceElement:r.sourceElement instanceof HTMLElement&&"form"in r.sourceElement?r.sourceElement.form:r.sourceElement?.closest("form");y.body=h?.attributes.getNamedItem("enctype")?.value==="application/x-www-form-urlencoded"?new URLSearchParams(r.formData):r.formData}const i=await ne(f,y);if(i===null){r.preventDefault();return}if(i.redirected&&(r.to=new URL(i.redirected)),x??=new DOMParser,r.newDocument=x.parseFromString(i.html,i.mediaType),r.newDocument.querySelectorAll("noscript").forEach(h=>h.remove()),!r.newDocument.querySelector('[name="astro-view-transitions-enabled"]')&&!r.formData){r.preventDefault();return}const m=re(r.newDocument);m.length&&await Promise.all(m)}if(A=!1,L)b=document.startViewTransition(async()=>await P(l,o,s));else{const r=(async()=>{await new Promise(f=>setTimeout(f)),await P(l,o,s,U())})();b={updateCallbackDone:r,ready:r,finished:new Promise(f=>F=f),skipTransition:()=>{A=!0}}}b.ready.then(async()=>{await oe(),_(),ee()}),b.finished.then(()=>{document.documentElement.removeAttribute(q),document.documentElement.removeAttribute($)}),await b.ready}async function k(e,t){await Y("forward",v,new URL(e,location.href),t??{})}function se(e){if(!R()&&e.state){location.reload();return}if(e.state===null)return;const t=history.state,n=t.index,o=n>E?"forward":"back";E=n,Y(o,v,new URL(location.href),{},t)}const I=()=>{S({scrollX,scrollY})};{(L||U()!=="none")&&(v=new URL(location.href),addEventListener("popstate",se),addEventListener("load",_),"onscrollend"in window?addEventListener("scrollend",I):addEventListener("scroll",te(I,350),{passive:!0}));for(const e of document.scripts)e.dataset.astroExec=""}function ie(){const e=document.querySelector('[name="astro-view-transitions-fallback"]');return e?e.getAttribute("content"):"animate"}function O(e){return e.dataset.astroReload!==void 0}(L||ie()!=="none")&&(document.addEventListener("click",e=>{let t=e.target;if(e.composed&&(t=e.composedPath()[0]),t instanceof Element&&(t=t.closest("a, area")),!(t instanceof HTMLAnchorElement)&&!(t instanceof SVGAElement)&&!(t instanceof HTMLAreaElement))return;const n=t instanceof HTMLElement?t.target:t.target.baseVal,o=t instanceof HTMLElement?t.href:t.href.baseVal,s=new URL(o,location.href).origin;O(t)||t.hasAttribute("download")||!t.href||n&&n!=="_self"||s!==location.origin||e.button!==0||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.defaultPrevented||(e.preventDefault(),k(o,{history:t.dataset.astroHistory==="replace"?"replace":"auto",sourceElement:t}))}),document.addEventListener("submit",e=>{let t=e.target;if(t.tagName!=="FORM"||e.defaultPrevented||O(t))return;const n=t,o=e.submitter,s=new FormData(n,o);let c=o?.getAttribute("formaction")??n.action??location.pathname;const l=o?.getAttribute("formmethod")??n.method;if(l==="dialog"||location.origin!==new URL(c,location.href).origin)return;const d={sourceElement:o??n};if(l==="get"){const r=new URLSearchParams(s),f=new URL(c);f.search=r.toString(),c=f.toString()}else d.formData=s;e.preventDefault(),k(c,d)}),C({prefetchAll:!0}));
