class l{async fetchData(t){const a=t=="internet"?"https://www.inail.it/api/hf/public/fullhtml_rw?lang=it&isHeadSimple=true":"https://www.inail.it/api/hf_intra/public/fullhtml?nome_applicazione=storybook_webkit_unico&isHeadSimple=true";let r,i;try{const n=await(await fetch(a,{headers:{client_id:t=="internet"?"ClientHF_v6":"ClientHF_v4"}})).json(),s=n.htmlHead;r=n,i=s}catch(e){console.error("Error fetching header data:",e)}finally{return this.addHeadScripts(i),new Promise(e=>{e(r)})}}addHeadScripts(t){const a="<!--SB-START-->",r="<!--SB-END-->",i=document.getElementsByTagName("head").item(0),e=document.getElementsByTagName("body").item(0);if(e==null||e.classList.add("container"),i){const n=document.createElement("div");for(n.innerHTML=a+t+r;n.firstChild;)i.appendChild(n.firstChild)}}async CreateHeader(t){return(await this.fetchData(t)).htmlHeader}async CreateFooter(t){return(await this.fetchData(t)).htmlFooter}}export{l as H};
