let m=1;const f=(e=!1)=>{var t=new Date(performance.timing.domLoading).getTime(),n=Date.now(),o=1e3,r=t+o;(e||n>r)&&location.reload()},l=e=>{const t=document.getElementsByTagName("head")[0];for(const n of e){for(const r of t.children)r instanceof HTMLScriptElement&&r.src.includes(n)&&t.removeChild(r);const o=document.createElement("script");o.src=n,t.appendChild(o)}},u=(e,t,n,o,r=!1)=>{const c=e();return new MutationObserver((i,s)=>{document.querySelector("main#contenutoPrincipale")&&(s.disconnect(),t.viewMode==="docs"&&(r&&f(),m<n?m+=1:(l(o),m=1)),t.viewMode==="story"&&l(o))}).observe(document.body,{childList:!0,subtree:!0}),c},v=()=>{const e=document.querySelector("header");e&&e.remove()},h=()=>{const e=document.querySelector("footer");e&&e.remove()},y=()=>{const e=document.querySelector("head");if(e){const n=Array.from(e.childNodes);let o=-1,r=-1;n.forEach((c,a)=>{var i,s;if(c.nodeType===Node.COMMENT_NODE){const d=c;((i=d.textContent)==null?void 0:i.trim())==="SB-START"?o=a:((s=d.textContent)==null?void 0:s.trim())==="SB-END"&&(r=a)}}),o!==-1&&r!==-1&&n.slice(o,r+1).forEach(c=>c.remove())}const t=document.getElementsByTagName("body").item(0);t==null||t.classList.remove("container")};export{u as a,h as b,y as c,v as r};
