class l{async fetchData(t){const n=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,a;try{const e=await(await fetch(n,{headers:{client_id:t=="internet"?"ClientHF_v6":"ClientHF_v4"}})).json(),s=e.htmlHead;r=e,a=s}catch(i){console.error("Error fetching header data:",i)}finally{return this.addHeadScripts(a),new Promise(i=>{i(r)})}}addHeadScripts(t){const n="<!--SB-START-->",r="<!--SB-END-->",a=document.getElementsByTagName("head").item(0);if(document.getElementsByTagName("body").item(0)?.classList.add("container"),a){const e=document.createElement("div");for(e.innerHTML=n+t+r;e.firstChild;)a.appendChild(e.firstChild)}}async CreateHeader(t){return(await this.fetchData(t)).htmlHeader}async CreateFooter(t){return(await this.fetchData(t)).htmlFooter}}export{l as H};
