(()=>{const e="1774897125450-b06da264-1871-44ad-8b24-81a50ae88755";if(window.__embiLoadedScriptKeys=window.__embiLoadedScriptKeys||new Set,window.__embiLoadedScriptKeys.has(e))return void console.warn("EMBI main script (this artifact) already executed. Skipping duplicate load.");window.__embiLoadedScriptKeys.add(e);const t=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=768,n=3e4,i="100% 0px",s=!1,d={fetchMarginPercent:200,renderMarginPercent:100,mobileScaling:1},o={enabled:!0,loadDelay:100},r=(...e)=>s&&console.log(...e),a=(...e)=>console.warn(...e),l=(...e)=>console.error(...e);let c,p=null;function h(){if(!p||!p.parentNode)return;const e=p.parentNode;e.lastElementChild!==p&&e.appendChild(p)}const m=[{slot:"/22562061343/0500-01_hnt-br_corner_",tagId:"embi_display_video_sticky_a1208d6c",type:"DISPLAY_VIDEO_STICKY",ubication:"",position:"BOTTOM_RIGHT",manualInsertion:!1,mobileSizes:[[300,250],[336,280],[320,100],[320,50]],desktopSizes:[[300,250],[336,280]],offset:20,tbLoaderURL:"",loadImmediately:!1,adunitMobile:{code:"embi_display_video_sticky_a1208d6c",mediaTypes:{video:{context:"outstream",playerSize:[[300,250],[320,180],[360,203]],mimes:["video/mp4","video/webm","video/ogg"],protocols:[1,2,3,4,5,6,7,8],placement:2,plcmt:4,playbackmethod:[6],api:[2],skip:1},banner:{sizes:[[300,250],[336,280],[320,100],[320,50]]}},bids:[],ortb2Imp:{ext:{gpid:"/22562061343/0500-01_hnt-br_corner_",data:{pbadslot:"/22562061343/0500-01_hnt-br_corner_",divId:"embi_display_video_sticky_a1208d6c"},instl:0,rwdd:0}}},adunitDesktop:{code:"embi_display_video_sticky_a1208d6c",mediaTypes:{video:{context:"outstream",playerSize:[[300,250]],mimes:["video/mp4","video/webm","video/ogg"],protocols:[1,2,3,4,5,6,7,8],placement:2,plcmt:4,playbackmethod:[6],api:[2],skip:1},banner:{sizes:[[300,250],[336,280]]}},bids:[],ortb2Imp:{ext:{gpid:"/22562061343/0500-01_hnt-br_corner_",data:{pbadslot:"/22562061343/0500-01_hnt-br_corner_",divId:"embi_display_video_sticky_a1208d6c"},instl:0,rwdd:0}}}}];if(!m.length)return void console.warn("No products data found, skipping initialization.");function f(e){try{const t=e.split(",");for(const e of t){const t=y(e);if(t)return t}return null}catch(t){return l("Error getting first location available with selectors:",e,t),null}}function y(e){try{return document.querySelector(e)}catch(t){return l("Error getting element with selector:",e,t),null}}function u(){const e=[];return m.forEach(t=>{t.tagId&&e.push(t.tagId),t.tagId2&&e.push(t.tagId2)}),e}function g(e,n=null){let i=0,s=0;if(e&&e.length>0&&e.forEach(e=>{if(Array.isArray(e)&&2===e.length){const[t,n]=e;t>i&&(i=t),n>s&&(s=n)}}),n){const e=t?n.adunitMobile:n.adunitDesktop;if(e&&e.mediaTypes&&e.mediaTypes.video&&e.mediaTypes.video.playerSize){e.mediaTypes.video.playerSize.forEach(e=>{if(Array.isArray(e)&&2===e.length){const[t,n]=e;t>i&&(i=t),n>s&&(s=n)}})}}return{maxWidth:i>0?`${i}px`:"none",maxHeight:s>0?`${s}px`:"none"}}!function(e,t){if(!document.querySelector(`script[src='${e}']`)){const n=document.createElement("script");n.async=t,n.type="text/javascript",n.src=e,document.head.appendChild(n)}}("https://securepubads.g.doubleclick.net/tag/js/gpt.js");var b=window.googletag=window.googletag||{};b.cmd=b.cmd||[];const I={visibleAds:new Set,hiddenAdsInViewport:new Set,sentinelObserver:null,refreshInterval:null,sentinels:new Map,lastRefreshTime:new Map,displayedAds:new Set,createSentinel(e,t){try{const n=document.createElement("div");return n.id=`sentinel_${e}`,n.className="ad-sentinel",n.style.cssText="\n position: absolute;\n width: 1px;\n height: 1px;\n opacity: 0;\n pointer-events: none;\n ",t.parentNode.insertBefore(n,t.nextSibling),this.sentinels.set(e,n),r(`Created sentinel for: ${e}`),n}catch(t){return l(`Error creating sentinel for ${e}:`,t),null}},shouldRefreshAd(e){const t=m.find(t=>t.tagId===e),i=t&&("HIGH_IMPACT"===t.type||"FOOTER_INTOP"===t.type||"DISPLAY_VIDEO_STICKY"===t.type);if(!(this.visibleAds.has(e)||this.hiddenAdsInViewport.has(e)||i))return r(` ❌ ${e} not in viewport (visible or hidden)`),!1;if(i)r(` 📍 ${e} is ${t.type} overlay`);else{const t=this.hiddenAdsInViewport.has(e);r(` 📍 ${e} is ${t?"hidden":"visible"} in viewport`)}const s=this.lastRefreshTime.get(e);if(!s)return r(` ✅ ${e} ready for first refresh (never refreshed before)`),!0;const d=Date.now()-s,o=d>=n;return r(` ${o?"✅":"⏳"} ${e} time since refresh: ${Math.round(d/1e3)}s / ${n/1e3}s`),o},markDisplayed(e){if(!this.displayedAds.has(e)){this.displayedAds.add(e),r(`📺 Ad marked as displayed: ${e}`);const t=document.getElementById(e);if(t){const n=t.getBoundingClientRect(),i=n.top0,s=0===n.width&&0===n.height;r(` - In viewport: ${i}, Hidden: ${s}, Size: ${n.width}x${n.height}`),i&&!s?(this.visibleAds.add(e),r(" - Added to visible ads immediately")):i&&s&&(this.hiddenAdsInViewport.add(e),r(" - Added to hidden ads in viewport"))}}},triggerAdRefresh(e,t="entered viewport"){try{m.find(t=>t.tagId===e);if(this.shouldRefreshAd(e)){r(`🎯 Triggering immediate refresh for ${e} (${t})`);const n=m.find(t=>t.tagId===e||t.tagId2===e);n&&(e===n.tagId&&n.adSlot?(b.pubads().refresh([n.adSlot]),this.lastRefreshTime.set(e,Date.now())):e===n.tagId2&&n.adSlotB&&(b.pubads().refresh([n.adSlotB]),this.lastRefreshTime.set(e,Date.now())))}else if(this.displayedAds.has(e)){const t=this.lastRefreshTime.get(e),n=Math.round((Date.now()-t)/1e3);r(`⏭️ Skipping refresh for ${e} (refreshed ${n}s ago)`)}else r(`⏭️ Skipping refresh for ${e} (not displayed yet)`)}catch(t){l(`Error triggering refresh for ${e}:`,t)}},initialize(){try{this.sentinelObserver=new IntersectionObserver(e=>{e.forEach(e=>{const t=e.target.id.replace("sentinel_","");if(r(`🔍 Sentinel check: ${t}, intersecting: ${e.isIntersecting}`),e.isIntersecting){const e=document.getElementById(t);if(e){const n=e.getBoundingClientRect(),i=0===n.width&&0===n.height;if(r(` - Ad dimensions: ${n.width}x${n.height}, isHidden: ${i}`),i){const e=this.hiddenAdsInViewport.has(t);this.hiddenAdsInViewport.add(t),this.visibleAds.delete(t),r(`🔍 Hidden ad in viewport: ${t}`),!e&&this.shouldRefreshAd(t)&&this.triggerAdRefresh(t,"hidden ad entered viewport")}else{const e=this.visibleAds.has(t);this.visibleAds.add(t),this.hiddenAdsInViewport.delete(t),r(`🔍 Visible ad in viewport: ${t}`),!e&&this.shouldRefreshAd(t)&&this.triggerAdRefresh(t,"visible ad entered viewport")}}}else this.hiddenAdsInViewport.delete(t),this.visibleAds.delete(t),r(`🔍 Ad left viewport: ${t}`)}),r(`✅ Visible ads: ${this.visibleAds.size}, Hidden in viewport: ${this.hiddenAdsInViewport.size}`)},{rootMargin:i,threshold:0});const e=u();let t=0;e.forEach(e=>{const n=document.getElementById(e);if(n){const i=this.createSentinel(e,n);i&&(this.sentinelObserver.observe(i),t++,r(`👁️ Observing sentinel for: ${e}`))}else a(`⚠️ Element not found for observation: ${e}`)}),this.startRefreshTimer(),r(`✅ Fast refresh system initialized: ${t}/${e.length} ad units observed (GPT-only, sentinel-only)`),r(` - Refresh interval: ${n/1e3}s`),r(` - Observer margin: ${i}`)}catch(e){l("Error initializing refresh manager:",e)}},startRefreshTimer(){this.refreshInterval=setInterval(()=>{this.refreshVisibleAds()},n)},refreshVisibleAds(){try{const e=new Set;if(this.visibleAds.forEach(t=>e.add(t)),this.hiddenAdsInViewport.forEach(t=>e.add(t)),m.forEach(t=>{"DISPLAY_VIDEO_STICKY"===t.type&&e.add(t.tagId)}),0===e.size)return void r("⏭️ No ads in refresh range");r(`🔄 Periodic refresh: ${e.size} ad(s) (${this.visibleAds.size} visible + ${this.hiddenAdsInViewport.size} hidden + overlays)`),e.forEach(e=>{try{const t=document.getElementById(e),i=this.shouldRefreshAd(e);if(r(`🔍 Checking ${e}: element=${!!t}, shouldRefresh=${i}, displayed=${this.displayedAds.has(e)}`),t&&i){r(`✅ Refreshing ad: ${e}`);const t=m.find(t=>t.tagId===e||t.tagId2===e);t?e===t.tagId&&t.adSlot?(b.pubads().refresh([t.adSlot]),this.lastRefreshTime.set(e,Date.now()),r(`✅ Refreshed successfully: ${e} (slot 1)`)):e===t.tagId2&&t.adSlotB?(b.pubads().refresh([t.adSlotB]),this.lastRefreshTime.set(e,Date.now()),r(`✅ Refreshed successfully: ${e} (slot 2)`)):a(`⚠️ No matching adSlot found for ${e}`):a(`⚠️ No product found for ${e}`)}else if(t)if(this.displayedAds.has(e)){const t=this.lastRefreshTime.get(e),i=Math.round((Date.now()-t)/1e3);r(`⏭️ Skipping ${e} (refreshed ${i}s ago, interval: ${n/1e3}s)`)}else r(`⏭️ Skipping ${e} (not displayed yet)`);else a(`⚠️ Element not found: ${e}`)}catch(t){l(`Error refreshing ${e}:`,t)}})}catch(e){l("Error in refreshVisibleAds:",e)}},destroy(){this.sentinelObserver&&this.sentinelObserver.disconnect(),this.refreshInterval&&clearInterval(this.refreshInterval),this.sentinels.forEach(e=>{try{e&&e.parentNode&&e.parentNode.removeChild(e)}catch(e){l("Error removing sentinel:",e)}}),this.sentinels.clear(),this.lastRefreshTime.clear(),this.displayedAds.clear(),this.visibleAds.clear(),this.hiddenAdsInViewport.clear(),r("RefreshManager cleanup complete")}};function v(e,t="RIGHT_SIDE",n=20){const i=(p&&p.isConnected||(p=document.getElementById("embi-overlay-root"),p||(p=document.createElement("div"),p.id="embi-overlay-root",Object.assign(p.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483647"}),document.body.appendChild(p))),p),s=document.createElement("div");s.id="embi-corner-ad-container",function(e,t,n=20){e.style.position="fixed",e.style.left=t.includes("LEFT")?"24px":"auto",e.style.right=t.includes("RIGHT")?"24px":"auto",e.style.bottom=t.includes("BOTTOM")?"24px":t.includes("TOP")?"auto":`${n}px`,e.style.top=t.includes("TOP")?"24px":"auto",e.style.zIndex="2147483647",e.style.background="transparent",e.style.boxShadow="black 0 3px 10px 0",e.style.display="none",e.style.transition="bottom 0.3s ease-in-out",e.style.pointerEvents="auto"}(s,t,n);const d=document.createElement("div");d.id=e;const o=document.createElement("script");return o.textContent=`\n googletag.cmd.push(function() {\n googletag.display('${e}');\n });\n `,d.appendChild(o),s.appendChild(d),s.appendChild(function(e){const t=document.createElement("button");t.innerHTML="×",t.title="Close ad";const n="rgba(0, 0, 0, 0.6)";return Object.assign(t.style,{position:"absolute",top:"-20px",right:"0px",width:"16px",height:"16px",background:n,opacity:"1",padding:"0px",border:"none",borderRadius:"50%",color:"#fff",fontSize:"18px",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"10001",transition:"background 0.2s ease, transform 0.2s ease",boxShadow:"0 2px 8px rgba(0,0,0,0.3)"}),t.addEventListener("mouseenter",()=>{t.style.background="rgba(0, 0, 0, 0.8)",t.style.transform="scale(1.1)",t.style.boxShadow="0 4px 12px rgba(0,0,0,0.4)"}),t.addEventListener("mouseleave",()=>{t.style.background=n,t.style.transform="scale(1)",t.style.boxShadow="0 2px 8px rgba(0,0,0,0.3)"}),t.addEventListener("click",()=>{e.style.display="none"}),t}(s)),i.appendChild(s),h(),s}function E(e){try{if(e.manualInsertion&&"TABOOLA_INTEGRATION"!==e.type){const s=e.tagId;new MutationObserver((e,t)=>{document.getElementById(s)&&(b.cmd.push(function(){b.display(s)}),t.disconnect())}).observe(document.body,{childList:!0,subtree:!0})}else{const d=e.type,o=e.position,r=e.ubication,p=e.tagId,h=e.offset;function n(e,t){const n=document.createElement("script");n.textContent=`\n googletag.cmd.push(function() {\n googletag.display('${t}');\n });\n `,e.appendChild(n)}try{if("TABOOLA_INTEGRATION"===d)createTaboolaContainer(e);else if("HIGH_IMPACT"===d)INTERSTITIAL_CONTAINER=createInterstitialContainer(p);else if("DISPLAY_VIDEO_STICKY"===d)c=v(p,o,h);else if("FOOTER_INTOP"===d)footerInTopContainer=createfooterInTopContainer(p,o);else if("DOUBLE_BOX"===d){const m=f(`${r}`);if(!m)return l(`Elemento con clase '${r}' no encontrado en el DOM para el anuncio ${p}. No se pudo insertar el DIV.`),!1;const y=e.tagId2,u=t?e.mobileSizes:e.desktopSizes,{maxWidth:I,maxHeight:E}=g(u,e),w=document.createElement("div");w.id=`container_${p}`,(i=w).style.display="flex",i.style.flexDirection=t?"column":"row",i.style.gap="24px",i.style.marginBottom="24px",i.style.background="transparent",i.style.justifyContent="center";const $=document.createElement("div");$.id=`wrapper_${p}`,$.className="ad-slot-wrapper",$.style.maxWidth=I,$.style.maxHeight=E,$.style.overflow="hidden",$.style.display="flex",$.style.justifyContent="center",$.style.alignItems="center";const S=document.createElement("div");S.id=p,S.className="ad-slot",S.style.minHeight="1px";const _=document.createElement("script");_.textContent=`\n googletag.cmd.push(function() {\n googletag.display('${p}');\n });\n `,S.appendChild(_),$.appendChild(S),w.appendChild($);const A=document.createElement("div");A.id=`wrapper_${y}`,A.className="ad-slot-wrapper",A.style.maxWidth=I,A.style.maxHeight=E,A.style.overflow="hidden",A.style.display="flex",A.style.justifyContent="center",A.style.alignItems="center";const x=document.createElement("div");x.id=y,x.className="ad-slot",x.style.minHeight="1px";const T=document.createElement("script");switch(T.textContent=`\n googletag.cmd.push(function() {\n googletag.display('${y}');\n });\n `,x.appendChild(T),A.appendChild(x),w.appendChild(A),o){case"INSERT_BEFORE":m.insertAdjacentElement("beforebegin",w);break;case"INSERT_AFTER":m.insertAdjacentElement("afterend",w);break;default:m.appendChild(w)}}else if("DISPLAY_VIDEO"===d){const R=f(`${r}`);if(!R)return void l(`Elemento con clase '${r}' no encontrado en el DOM para el anuncio ${p}.`);const O=t?e.mobileSizes:e.desktopSizes,{maxWidth:C,maxHeight:k}=g(O,e),D=document.createElement("div");D.id=`wrapper_${p}`,D.className="ad-slot-wrapper",D.style.maxWidth=C,D.style.maxHeight=k,D.style.overflow="hidden",D.style.margin="0 auto 24px",D.style.display="flex",D.style.justifyContent="center",D.style.alignItems="center";const N=document.createElement("div");switch(N.id=p,N.className="ad-slot",N.style.minHeight="1px",n(N,p),D.appendChild(N),o){case"INSERT_BEFORE":R.insertAdjacentElement("beforebegin",D);break;case"INSERT_AFTER":R.insertAdjacentElement("afterend",D);break;default:R.appendChild(D)}}else if(e.isSticky)c=v(p,o),n(c,p);else{const z=f(`${r}`);if(!z)return void l(`Elemento con clase '${r}' no encontrado en el DOM para el anuncio ${p}.`);const L=t?e.mobileSizes:e.desktopSizes,{maxWidth:B,maxHeight:H}=g(L,e),V=document.createElement("div");V.id=`wrapper_${p}`,V.className="ad-slot-wrapper",V.style.maxWidth=B,V.style.maxHeight=H,V.style.overflow="hidden",V.style.margin="0 auto 24px",V.style.display="flex",V.style.justifyContent="center",V.style.alignItems="center";const M=document.createElement("div");switch(M.id=p,M.className="ad-slot",M.style.minHeight="1px",n(M,p),V.appendChild(M),o){case"INSERT_BEFORE":z.insertAdjacentElement("beforebegin",V);break;case"INSERT_AFTER":z.insertAdjacentElement("afterend",V);break;default:z.appendChild(V)}}}catch(P){l(`Error procesando el anuncio ${p}:`,P)}}}catch(j){a("Error rendering adunit for product",e.tagId,j)}var i}function w(){try{m.map(e=>{E(e)}),b.cmd.push(function(){const e=m.filter(e=>"HIGH_IMPACT"===e.type||"FOOTER_INTOP"===e.type||"DISPLAY_VIDEO_STICKY"===e.type);e.length>0&&(r("🎯 Loading overlay ads immediately..."),e.forEach(e=>{try{r(` - Displaying ${e.type} ad: ${e.tagId}`),b.display(e.tagId)}catch(t){l(`Error displaying ${e.type} ad ${e.tagId}:`,t)}}))}),setTimeout(()=>{r("🔄 Initializing fast refresh system (GPT-only)..."),I.initialize()},o.loadDelay)}catch(e){l("Error in mainInitialization:",e)}finally{r("✅ EMBI ad system initialized successfully (GPT-only)")}}b.cmd.push(function(){if(m.filter(e=>"TABOOLA_INTEGRATION"!==e.type).forEach(e=>{try{const n=t?e.mobileSizes:e.desktopSizes;e.adSlot=b.defineSlot(e.slot,n,e.tagId).setForceSafeFrame(!1).addService(b.pubads()),"DOUBLE_BOX"===e.type&&(e.adSlotB=b.defineSlot(e.slot2,n,e.tagId2).setForceSafeFrame(!1).addService(b.pubads())),r(`GPT slot defined: ${e.tagId}`)}catch(t){l("Error creating GPT slot for product",e.tagId,t)}}),o.enabled){m.some(e=>e.loadImmediately)&&(b.pubads().enableSingleRequest(),r("Single Request enabled for priority ads"))}b.pubads().enableLazyLoad(d),b.pubads().collapseEmptyDivs(!0),b.pubads().setCentering(!0),b.pubads().addEventListener("slotRenderEnded",function(e){try{const t=e.slot.getSlotElementId();if(!u().find(e=>e===t))return;const n=e.isEmpty;r(`📺 Ad render event: ${t}, isEmpty: ${n}`),void 0!==I&&(I.lastRefreshTime.set(t,Date.now()),n?r(` ⚠️ Ad slot ${t} rendered empty - will retry on next refresh cycle`):I.markDisplayed(t))}catch(e){l("Error in slotRenderEnded event:",e)}const t=e.slot.getSlotElementId();m.forEach(n=>{try{t===n.tagId&&("DISPLAY_VIDEO_STICKY"!==n.type||e.isEmpty||(i=c)&&(i.style.display="block",h()))}catch(e){l("Error rendering slot for product",n.tagId,e)}var i})}),b.enableServices(),r("GPT configuration complete")}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",w):w()})();