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