import{t as e}from"./starlight-toc.CTCQXEge.js";var t=class extends e{set current(e){super.current=e;let t=this.querySelector(`.display-current`);t&&(t.textContent=e.textContent)}constructor(){super();let e=this.querySelector(`details`);if(!e)return;let t=()=>{e.open=!1};e.querySelectorAll(`a`).forEach(e=>{e.addEventListener(`click`,t)}),window.addEventListener(`click`,n=>{e.contains(n.target)||t()}),window.addEventListener(`keydown`,n=>{if(n.key===`Escape`&&e.open){let n=e.contains(document.activeElement);if(t(),n){let t=e.querySelector(`summary`);t&&t.focus()}}})}};customElements.define(`mobile-starlight-toc`,t);