(async()=>{const t=document.querySelector('script[src*="omnitokHotspots.v2"]');let e,s=t.getAttribute("data-env"),n={hotspots:3,modal:4,animation:2};const l=await(async()=>{switch(s){case"production":default:hostApi="https://oc-cache.production.alquimio.cloud/hotspots";break;case"staging":hostApi="https://product-feature-service.staging.alquimio.cloud/hotspots";break;case"local":hostApi="http://localhost:3001/hotspots"}return hostApi})(),i=()=>{const t=document.getElementById("hotspotContentContainer");t&&t.remove(),o=0};let o=0;const a=t=>{const e=document.getElementsByClassName("gallery-img"),s=document.getElementsByClassName("gallery-buttons");for(let n=0;n{const e=document.getElementsByClassName("hotspotsKspCarousel"),s=document.getElementsByClassName("gallery-buttons-ksp");for(let n=0;n{switch(t.type){case"KSP":return`\n
\n \n \n \n \n \n \n \n \n \n \n
\n `;case"TEXT":return`\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n `;case"VIDEO":return`\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n `;default:return`\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n `}},d=t=>`\n
\n \n \n
\n `,p=t=>{switch(t.type){case"KSP":const e=t.additionalAttr.find((t=>"KSP"===t.key));let s="",n="";return e&&e.value&&e.value.length>0&&(s=e.value.map(((t,e)=>{n+=``;return`\n
\n \n
\n ${t.title}\n
\n
\n
\n ${t.text}\n
\n
\n `})).join("")),`\n
\n ${s}\n ${d(t)}\n
\n ${n}\n
\n
\n `;case"GALLERY":const l=t.additionalAttr.find((t=>"IMAGES"===t.key));let i="",o="";return l&&(i=l.value.map(((t,e)=>(o+=``,`\n \n `))).join("")),`\n
\n
\n ${i} \n
\n ${d(t)}\n
\n ${o}\n
\n
\n `;case"VIDEO":const a=t.additionalAttr.find((t=>"URL"===t.key));if(a){const t=a.value.split("v=")[1];let e=``;if(a.value.includes("vimeo")){e=``}return`\n
\n \n
\n `}default:const r=t.additionalAttr.find((t=>"TEXT"===t.key));let c="",p="";return r&&r.value&&r.value.length>0&&(c=r.value.map(((t,e)=>{p+=``;return`\n
\n
\n ${t.title}\n
\n
\n
\n ${t.text}\n
\n
\n `})).join("")),`\n
\n ${c}\n ${d(t)}\n
\n ${p}\n
\n
\n `}},h=t=>{i();const s=document.createElement("div");if(s.innerHTML=(t=>`\n \n `)(t),s.style.zIndex=n.modal,s.style.position="absolute",s.style.left="0%",s.style.top="-10%",TAG_HTML_HOTSPOTS.append(s),document.getElementById("closeModal").addEventListener("click",i),"VIDEO"!==t.type){const t=document.getElementsByClassName("gallery-buttons"),e=document.getElementsByClassName("gallery-buttons-ksp");for(let e=0;e{const s=t&&t.length>0?t.length:e.length,n=0===o?s-1:o-1;t&&t.length>0&&t[n].click(),e&&e.length>0&&e[n].click()})),document.getElementById("nextBtn").addEventListener("click",(()=>{const s=t&&t.length>0?t.length:e.length,n=o===s-1?0:o+1;t&&t.length>0&&t[n].click(),e&&e.length>0&&e[n].click()}));for(let t=0;t{document.getElementById("more__info__"+t.id).style.visibility="visible"},g=t=>{document.getElementById("more__info__"+t.id).style.visibility="hidden"},v=(t,e)=>{t.properties.forEach((t=>{"string"==typeof t.value&&(e.style[t.key]=t.value)}))},u=t=>{let e;t.forEach((t=>{if("id"===t.type)e=document.getElementById(t.identificator),v(t,e);else{e=document.getElementsByClassName(t.identificator);for(let s=0;s!0===t.visible)),e.stylesConfig&&e.stylesConfig.container&&Array.isArray(e.stylesConfig.container)){const t=e.stylesConfig.container.find((t=>"ZINDEX"===t.key));t&&(n=t.value)}e.hotspots.forEach((t=>{const e=document.createElement("span"),s=document.createElement("div");e.className="hotspots__identify",s.id="more__info__"+t.id,s.classList.add("more__info"),s.innerText="KSP"===t.type?"Saber más":"TEXT"===t.type?"Especificaciones":"VIDEO"===t.type?"Video":"Características",s.style.top=Number(t.layout.posY)-7+"%",s.style.left=Number(t.layout.posX)-4+"%",e.style.display="grid",e.style.top=`${t.layout.posY}%`,e.style.left=`${t.layout.posX}%`,e.style.position="absolute",e.style.zIndex=n.hotspots,e.style.cursor="pointer",e.style.borderRadius="50%",e.className="hotspots__span",e.innerHTML=(t=>`${c(t)}`)(t),e.addEventListener("click",h.bind(this,t)),e.addEventListener("mouseover",y.bind(this,t)),e.addEventListener("mouseleave",g.bind(this,t)),TAG_HTML_HOTSPOTS.append(s),TAG_HTML_HOTSPOTS.append(e);const l=document.getElementById(`hotspot${t.type}`);l.style.width=t.layout.width+"px",l.style.height=t.layout.height+"px"})),e.stylesConfig&&(e.stylesConfig.container&&Array.isArray(e.stylesConfig.container)&&(b=TAG_HTML_HOTSPOTS,e.stylesConfig.container.forEach((t=>{"string"==typeof t.value&&(b.style[t.key]=t.value)}))),e.stylesConfig.elements&&Array.isArray(e.stylesConfig.elements)&&u(e.stylesConfig.elements))}}catch(t){console.log("No fue posible cargar los hotspots.....",t)}var b})();