"use strict";(self.webpackChunkcustom_webkit_material_v3=self.webpackChunkcustom_webkit_material_v3||[]).push([[1422],{"./src/common/shared/header-footer.component.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{C:()=>HeaderFooterComponent});var _home_jenkins2_workspace_inail_storybook_inail_dev_ApacheStorybooks_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");class HeaderFooterComponent{fetchData(type){var _this=this;return(0,_home_jenkins2_workspace_inail_storybook_inail_dev_ApacheStorybooks_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__.A)(function*(){const urlInternet="internet"==type?"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 responseHtml,responseHead;try{const response=yield fetch(urlInternet,{headers:{client_id:"internet"==type?"ClientHF_v6":"ClientHF_v4"}}),json=yield response.json(),headContent=json.htmlHead;responseHtml=json,responseHead=headContent}catch(error){console.error("Error fetching header data:",error)}finally{return _this.addHeadScripts(responseHead),new Promise(resolve=>{resolve(responseHtml)})}})()}addHeadScripts(script){const headElement=document.getElementsByTagName("head").item(0),body=document.getElementsByTagName("body").item(0);if(body?.classList.add("container"),headElement){const tempDiv=document.createElement("div");for(tempDiv.innerHTML="\x3c!--SB-START--\x3e"+script+"\x3c!--SB-END--\x3e";tempDiv.firstChild;)headElement.appendChild(tempDiv.firstChild)}}CreateHeader(type){var _this2=this;return(0,_home_jenkins2_workspace_inail_storybook_inail_dev_ApacheStorybooks_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__.A)(function*(){return(yield _this2.fetchData(type)).htmlHeader})()}CreateFooter(type){var _this3=this;return(0,_home_jenkins2_workspace_inail_storybook_inail_dev_ApacheStorybooks_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__.A)(function*(){return(yield _this3.fetchData(type)).htmlFooter})()}}},"./src/stories/header/internet/header-internet.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Header:()=>Header,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _common_shared_header_footer_component__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/common/shared/header-footer.component.ts");const __WEBPACK_DEFAULT_EXPORT__={title:"Patterns/Header & Footer/Internet/Header",tags:["!autodocs"],decorators:[Story=>{document.createElement("div");return(()=>{const headerElement=document.createElement("header");(new _common_shared_header_footer_component__WEBPACK_IMPORTED_MODULE_0__.C).CreateHeader("internet").then(html=>{headerElement.innerHTML=html});const body=document.querySelector("body");body&&!document.querySelector("header")&&body.appendChild(headerElement)})(),Story()}],parameters:{lighthouseAddon:{disable:!0},showCodeAddon:{disable:!0},userExperience:{disable:!0},controls:{disable:!0},actions:{disable:!0}}},Header={},__namedExportsOrder=["Header"];Header.parameters={...Header.parameters,docs:{...Header.parameters?.docs,source:{originalSource:"{}",...Header.parameters?.docs?.source}}}}}]);