Este resumen es generado por inteligencia artificial y revisado por la redacción.
`; document.body.appendChild(modalWrapper); let figcaption = modalWrapper.querySelector(«figcaption»); if(figcaption) figcaption.style.display=»none»; modalWrapper.querySelector(«.s-multimedia__close-modal»).addEventListener(«click»,()=>{modalWrapper.remove(); e.style.display=»flex»; if(caption) caption.style.display=»block»;});})})});});
La segunda edición de los Premios Teatro en el Perú 2026 se realizará el próximo 25 de marzo en el Teatro Auditorio Mario Vargas Llosa de la Biblioteca Nacional del Perú. El evento es organizado por la Asociación Cultural Teatro en el Perú con el auspicio del Ministerio de Cultura del Perú y busca reconocer lo mejor de la escena teatral nacional.
La segunda edición de los Premios Teatro en el Perú 2026 se realizará el próximo 25 de marzo en el Teatro Auditorio Mario Vargas Llosa de la Biblioteca Nacional del Perú. El evento es organizado por la Asociación Cultural Teatro en el Perú con el auspicio del Ministerio de Cultura del Perú y busca reconocer lo mejor de la escena teatral nacional.
La ceremonia se llevará a cabo en el marco del Día Mundial del Teatro y reunirá a destacados representantes del sector cultural. Durante la gala se presentarán números artísticos en vivo y se entregarán premios en distintas categorías, en una jornada dedicada a celebrar el crecimiento del teatro peruano.
LEE: “Mirada en silencio”: una obra hecha desde el gesto sobre vivir en un mundo que no escucha
La conducción del evento estará a cargo de los actores María Victoria Santana y Cristhian Palomino, quienes guiarán la premiación con presentaciones especiales y momentos destacados para la comunidad escénica.
La jornada comenzará desde las 6 p.m. con la tradicional alfombra roja, donde participarán actores, directores, dramaturgos, productores y gestores culturales. La actividad busca destacar el trabajo colectivo que sostiene la industria teatral en el país.
Premios Teatro en el Perú 2026 regresa con su segunda edición. (Foto: Instagram)
`; document.body.appendChild(modalWrapper); let figcaption = modalWrapper.querySelector(«figcaption»); if(figcaption) figcaption.style.display=»none»; modalWrapper.querySelector(«.s-multimedia__close-modal»).addEventListener(«click»,()=>{modalWrapper.remove(); e.style.display=»flex»; if(caption) caption.style.display=»block»;});})})});});
El público también podrá participar en la elección de los ganadores a través de la votación online disponible en el portal oficial de Teatro en el Perú. El proceso estará abierto hasta el 15 de marzo, permitiendo que los espectadores respalden a sus artistas y producciones favoritas.
MÁS INFORMACIÓN: “Estampida humana”, la obra chilena que llega por el FAE Lima 2026
Estos son los nominados a las categorías principales:
GÉNERO DRAMA – MEJOR OBRA
- “Un Espejo” de Sam Holcroft
- “Cyrano de Bergerac” de Edmond Rostand
- “Dr. Jekyll & Mr. Hyde” de Robert Louis Stevenson
- “Niños caen de los Árboles” de Mariana De Althaus
- “Hielo en la Sangre” de Claudia Sacha
- “Cariño Malo” de Alejandro Clavier
- “Maybe Baby” de Cinthia Delgado Ramos
- “Dos Siglos de Sobremesa” de Eduardo Adrianzén
- “Ana contra la Muerte” de Gabriel Calderón
- “Buenas Personas” de David Lindsay-Abaire
GÉNERO DRAMA – MEJOR DIRECCIÓN
- Wendy Vásquez por “Un Espejo”
- Jean Pierre Gamarra por “Cyrano de Bergerac”
- Francisco Cabrera por “Dr. Jekyll & Mr. Hyde”
- Mariana De Althaus por “Niños caen de los Árboles”
- David Carrillo por “Hielo en la Sangre”
- Alejandro Clavier por “Cariño Malo”
- Norma Martínez por “Maybe Baby”
- Adrián Galarcep por “Actos Consentidos”
- Juan Carlos Fisher por “Buenas Personas”
- Laura Silva por “Hamlet y Ofelia”
GÉNERO DRAMA – MEJOR ACTOR
- Renato Rueda por “Un Espejo”
- Alonso Cano por “Cyrano de Bergerac”
- Johan Escalante por “Los Amantes del Imperio”
- Óscar López Arias por “Actos Consentidos”
- David Carrillo por “Hielo en la Sangre”
- Gonzalo Molina por “Dos siglos de sobremesa”
- Carlos Victoria por “Las veces que no (te) dije te quiero”
- Sebastian Stimmann por “Cariño malo”
GÉNERO DRAMA – MEJOR ACTRIZ
- Érika Villalobos por “Actos Consentidos”
- Maria Grazia Gamarra por “Cyrano de Bergerac”
- Alejandra Guerra por “Ana contra la muerte”
- Karen Spano por “Niños caen de los Árboles”
- Celine Aguirre por “Hielo en la Sangre”
- Natalia Torres Vilar por “Clorinda”
- Jimena Lindo por “Buenas Personas”
- Fiorella Pennano por “Maybe Baby”
- Yaremís Rebaza por “Naranjas”
LEE TAMBIÉN: “Escenas de la vida conyugal”: Ricardo Darín regresa a Lima con tres funciones exclusivas
GÉNERO DRAMA – MEJOR ACTOR DE REPARTO
- Rodrigo Palacios por “Un espejo”
- Stefano Salvini por “Cyrano de Bergerac”
- Gonzalo Revoredo por “Actos Consentidos”
- Lucho Cáceres por “Niños caen de los Árboles”
- Jorge Guerra por “Buenas Personas”
- Diego Salinas por “Cariño Malo”
- Sergio Armasgo por “Las veces que no (te) dije te quiero”
- Alaín Salinas por “Dos siglos de sobremesa”
- Augusto Casafranca por “Niños caen de los Árboles”
GÉNERO DRAMA – MEJOR ACTRIZ DE REPARTO
- Grapa Paola por “Ana contra la muerte”
- Alexandra Graña por “El cuarto de Verónica”
- Guadalupe Farfán por “Dos siglos de sobremesa”
- Magdyl Ugaz por “Laponia”
- Paulina Bazán por “Dos siglos de sobremesa”
- Eliana Fry García-Pacheco por “Hay que llenar la noche”
- Claudia Pascal por “Maybe Baby”
- Milene Vásquez por “Buenas Personas”
GÉNERO COMEDIA – MEJOR OBRA
- “Como te gusta” de William Shakespeare
- “Peter Pan Hasta las Patas” de Henry Lewis, Jonathan Sayer y Henry Shields
- “El barbero de Sevilla” de Beaumarchais
- “Reality Shock” de Carlos Gonzales Villanueva
- “La Ópera de Tres Centavos” de Bertolt Brecht
- “Un Robo hasta las Patas” de Henry Lewis, Jonathan Sayer y Henry Shields
- “Y ahora… ¿Qué hacemos con Jacinto?” de Alejandro Melero
- “Tragafortuna” de Ángelo Condemarín
- “Una Semana Nada Más” de Clément Michel
- “Crónica del Amor” de Fernando Castro
- “Monólogos de la Vagina” de Eve Ensler
GÉNERO COMEDIA – MEJOR DIRECCIÓN
- Fernando Castro por “Como te Gusta”
- Paloma Reyes de Sá por “Peter Pan Hasta las Patas”
- Alfonso Santistevan por “La Ternura”
- Joamoc por “Reality Shock”
- Jean Pierre Gamarra por “La Ópera de tres centavos”
- Juan Carlos Fisher por “Un Robo Hasta las Patas”
- Sergio Galliani por “Monólogos de la Vagina”
GÉNERO COMEDIA – MEJOR ACTOR
- Diego Sakuray por “Como te gusta”
- Emmanuel Soriano por “Peter Pan Hasta las Patas”
- Stefano Salvini por “El Barbero de Sevilla”
- Emanuel Caffo por “Reality Shock”
- André Silva por “La Ópera de tres centavos”
- Miguel Iza por “Coteras”
- Cristhian Palomino por “Y ahora… ¿Qué hacemos con Jacinto?”
- Manuel Gold por “Peter Pan Hasta las Patas”
- Armando Machuca por “Una Semana Nada Más”
- Juan Carlos Díaz por “Toma y Daca”
- Miguel Soriano por “La Estúpida Escopeta”
GÉNERO COMEDIA – MEJOR ACTRIZ
- Gisela Ponce de León por “Peter Pan Hasta las Patas”
- Maria Grazia Gamarra por “La Ópera de tres centavos”
- Alexandra Garcés por “Reality Shock”
- Carolina Cano por “Como te gusta”
- María del Carmen “Sirvas por Terapia Amorosa”
- Patricia Barreto por “Un Robo Hasta las Patas”
- Claudia Berninzon por “Tragafortuna”
- Sandra Bernasconi por “Secretos”
- Macla Yamada por “Crónica del Amor”
- Luciana Arispe por “¿Y Giulia?”
GÉNERO COMEDIA – MEJOR ACTOR DE REPARTO
- Cesar García por “Peter Pan Hasta las Patas”
- Christian Ysla por “Peter Pan Hasta las Patas”
- Roni Ramírez por “Reality Shock”
- Leonardo Torres Vilar por “Ópera de tres Centavos”
- Sebastián Ramos por “Un robo hasta las patas”
- Oscar Yepez por “Ópera de tres Centavos”
- Claudio Calmet por “Negocio Familiar”
- Nicolás Fantinato por “SER I.A. Comedia”
GÉNERO COMEDIA – MEJOR ACTRIZ DE REPARTO
- Stephany Orúe por “Temis”
- Lucía Brozovich por “Un día como Cualquier Otro”
- Amaranta Kun por “Ópera de tres Centavos”
- Anaí Padilla por “Tragafortuna”
- Sonia Oquendo por “Y ahora… ¿Qué hacemos con Jacinto?”
- Magdyel Ugaz por “Una Semana Nada Más”
- Ximena Palomino por “Cómo Olvidar a tu Ex”
Conforme a los criterios de
Tipo de trabajo:
‘+sanitizeHTML(modalConfig.message)+’
‘;}function closeSources(){isSourcesExiting=true;const sourcesEl=document.getElementById(‘merlin-sources-overlay’);if(sourcesEl){sourcesEl.className=CLS.sourcesOverlay+’ ‘+CLS.sourcesOverlayExiting;}setTimeout(function(){showSources=false;isSourcesExiting=false;sourcesButtonRect=null;sourcesData=[];nonNoticiaUrlsData=[];document.body.style.overflow=»;if(sourcesEl&&sourcesEl.parentNode){sourcesEl.parentNode.removeChild(sourcesEl);}},200);}function getDisplayTitle(source){if(source.title)return source.title;try{const url=new URL(source.url.replace(/[?&]merlin=true/,»));const pathname=url.pathname;const lastSegment=pathname.split(«https://elcomercio.pe/»).filter(Boolean).pop()||»;return lastSegment .replace(/-/g,’ ‘).replace(/bw/g,function(char){return char.toUpperCase();});}catch{return ‘Ver artículo’;}}function getNonNoticiaDisplayTitle(urlItem,index){if(urlItem.title)return urlItem.title;try{var clean=urlItem.url.split(‘?’)[0];var urlObj=new URL(clean);var path=urlObj.pathname.replace(/^/+/,»).replace(//$/,»);if(!path)return index!==undefined?’Ver enlace ‘+(index+1):’Ver enlace’;return ‘Ver ‘+path;}catch(e){return index!==undefined?’Ver enlace ‘+(index+1):’Ver enlace’;}}function escapeHTML(str){if(!str)return »;const div=document.createElement(‘div’);div.textContent=str;return div.innerHTML;}function sanitizeURL(url){if(!url)return »;try{const parsed=new URL(url);if(parsed.protocol!==’http:’&&parsed.protocol!==’https:’){return »;}return parsed.href;}catch{return »;}}function renderSources(){if(!showSources||(sourcesData.length===0&&nonNoticiaUrlsData.length===0))return »;const totalSources=sourcesData.length+nonNoticiaUrlsData.length;const isSingleSource=totalSources===1;return »;}const root=document.createElement(‘div’);root.id=’merlin-widget-root’;document.body.appendChild(root);function render(){root.innerHTML=’
‘+(isLoggedIn()?renderModal():»)+renderWarningModal()+renderSources()+’
‘;setupModalEventDelegation();bindEvents();}function setupModalEventDelegation(){document.removeEventListener(‘click’,handleGlobalOverlayClicks,true);document.addEventListener(‘click’,handleGlobalOverlayClicks,true);setTimeout(function(){const warningCloseBtn=document.getElementById(‘merlin-warning-modal-close’);const warningModal=document.getElementById(‘merlin-warning-modal’);const sourcesCloseBtn=document.getElementById(‘merlin-sources-close’);const sourcesOverlay=document.getElementById(‘merlin-sources-overlay’);},0);}function handleGlobalOverlayClicks(e){const target=e.target;if(!target||!target.closest)return;if(target.closest(‘#merlin-warning-modal-close’)){e.preventDefault();e.stopPropagation();closeModal();return;}if(target.closest(‘#merlin-sources-close’)){e.preventDefault();e.stopPropagation();closeSources();return;}const warningModal=document.getElementById(‘merlin-warning-modal’);if(warningModal&&target===warningModal){closeModal();return;}const sourcesOverlay=document.getElementById(‘merlin-sources-overlay’);if(sourcesOverlay&&target===sourcesOverlay){closeSources();return;}const showSourcesBtn=target.closest(‘[data-show-sources]’);if(showSourcesBtn){e.preventDefault();e.stopPropagation();const messageId=showSourcesBtn.getAttribute(‘data-show-sources’);sourcesButtonRect=showSourcesBtn.getBoundingClientRect();const msg=messages.find(function(m){return m.id===messageId;});if(!msg)return;if(msg.enrichedSources){sourcesData=msg.enrichedSources.noticiaSources||[];nonNoticiaUrlsData=msg.enrichedSources.nonNoticiaSources||[];showSources=true;isSourcesExiting=false;document.body.style.overflow=’hidden’;const totalSources=sourcesData.length+nonNoticiaUrlsData.length;const isSingleSource=totalSources===1;const finalHTML=»;const widgetDiv=root.querySelector(‘.’+CLS.widget);if(widgetDiv){const existingSources=document.getElementById(‘merlin-sources-overlay’);if(existingSources&&existingSources.parentNode){existingSources.parentNode.removeChild(existingSources);}widgetDiv.insertAdjacentHTML(‘beforeend’,finalHTML);setupModalEventDelegation();}return;}const urls=msg.urls&&msg.urls.length>0?msg.urls:extractUrlsFromMessage(msg.text);if(urls&&urls.length>0){if(!msg.urls){msg.urls=urls;}let noticiaUrls=urls.filter(function(u){return isNoticiaUrl(u.url);});const nonNoticiaUrls=urls.filter(function(u){return!isNoticiaUrl(u.url);});if(noticiaUrls.length>5){noticiaUrls=noticiaUrls.slice(noticiaUrls.length-5);}nonNoticiaUrlsData=nonNoticiaUrls;showSources=true;isSourcesExiting=false;document.body.style.overflow=’hidden’;const skeletonCount=noticiaUrls.length;const isSingleSource=skeletonCount===1;let skeletonItems=»»;for(let i=0;i‘;}const skeletonHTML=»;const widgetDiv=root.querySelector(‘.’+CLS.widget);if(widgetDiv){const existingSources=document.getElementById(‘merlin-sources-overlay’);if(existingSources&&existingSources.parentNode){existingSources.parentNode.removeChild(existingSources);}widgetDiv.insertAdjacentHTML(‘beforeend’,skeletonHTML);setupModalEventDelegation();}enrichSources(noticiaUrls).then(function(enrichedSources){sourcesData=enrichedSources;msg.enrichedSources={noticiaSources:enrichedSources,nonNoticiaSources:nonNoticiaUrls};const sourcesList=document.querySelector(‘.’+CLS.sourcesList);if(sourcesList&&showSources){let html=sourcesData.map(function(source){const safeUrl=sanitizeURL(source.url);if(!safeUrl)return »;const urlWithMerlin=safeUrl.includes(‘?’)?safeUrl+’&chatbotmerlin=true’:safeUrl+’?chatbotmerlin=true’;const safeCategory=escapeHTML(source.category);const safeAuthor=escapeHTML(source.author);const safeTimestamp=escapeHTML(source.timestamp);const safeTitle=escapeHTML(getDisplayTitle(source));const safeImage=sanitizeURL(source.image);const safeAlt=escapeHTML(source.title||’Imagen de la fuente’);return ‘
‘+safeCategory+’
‘:»)+’
‘+safeTitle+’
‘)+(safeImage?’
‘:»)+’
‘+»+’
‘;}).join(»);html+=nonNoticiaUrlsData.map(function(urlItem,index){const safeUrl=sanitizeURL(urlItem.url);if(!safeUrl)return »;const urlWithMerlin=safeUrl.includes(‘?’)?safeUrl+’&chatbotmerlin=true’:safeUrl+’?chatbotmerlin=true’;const safeTitle=escapeHTML(getNonNoticiaDisplayTitle(urlItem,index));return ‘
‘+safeTitle+’
‘+»+’
‘;}).join(»);sourcesList.innerHTML=html;}}).catch(function(err){console.error(‘[Merlin Widget]Error enriching sources:’,err);});}}}function renderModal(){return »;}function renderChat(){let messagesHTML=»;if(messages.length>0){messagesHTML=messages.map(function(msg){return renderMessage(msg);}).join(»);}else{messagesHTML=’
‘;}return ‘
‘+messagesHTML+(isBotTyping?renderTypingIndicator():»)+’
‘+_0x3m4n+’
‘;}function isMobileDevice(){return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||(‘ontouchstart’ in window)||(navigator.maxTouchPoints>0);}function updateChatDOM(){const modalBody=document.querySelector(‘.’+CLS.body);if(!modalBody)return;chatEventsBound=false;modalBody.innerHTML=renderChat();const container=document.querySelector(‘.’+CLS.chatMessages);if(container){container.style.overflowY=’auto’;container.style.overflowX=’hidden’;container.style.flex=’1′;container.style.display=’flex’;container.style.flexDirection=’column’;const targetBottom=container.scrollHeight;const startPosition=Math.max(0,targetBottom-container.clientHeight-150);container.scrollTop=startPosition;requestAnimationFrame(function(){container.scrollTo({top:container.scrollHeight,behavior:’smooth’,});});}setupChatEvents();if(pendingInputRestore){const input=document.getElementById(‘merlin-input’);if(input&&pendingInputRestore){input.value=pendingInputRestore;pendingInputRestore=null;if(!isMobileDevice()){input.focus();}}}else if(!isBotTyping&&isLoggedIn()&&!showModal&&!showSources){setTimeout(function(){const input=document.getElementById(‘merlin-input’);if(input&&!input.disabled&&!isMobileDevice()){input.focus();}},100);}const warningModal=root.querySelector(‘.’+CLS.warningModal);if(warningModal){warningModal.outerHTML=renderWarningModal();}else if(showModal){const widgetDiv=root.querySelector(‘.’+CLS.widget);if(widgetDiv){widgetDiv.insertAdjacentHTML(‘beforeend’,renderWarningModal());}}const sourcesOverlay=root.querySelector(‘.’+CLS.sourcesOverlay);if(sourcesOverlay){sourcesOverlay.outerHTML=renderSources();}else if(showSources){const widgetDiv=root.querySelector(‘.’+CLS.widget);if(widgetDiv){widgetDiv.insertAdjacentHTML(‘beforeend’,renderSources());}}}function renderMessage(msg){const bubbleClass=msg.type===’sent’?CLS.bubbleContainer+’ ‘+CLS.bubbleContainerSent:CLS.bubbleContainer+’ ‘+CLS.bubbleContainerReceived;const bubbleTypeClass=msg.type===’sent’?CLS.bubble+’ ‘+CLS.bubbleSent:CLS.bubble;if(msg.type===’received’){const formattedText=formatTextToHTML(msg.text);const sanitizedHTML=sanitizeHTML(formattedText);const urls=msg.urls&&msg.urls.length>0?msg.urls:extractUrlsFromMessage(msg.text);const hasUrls=urls&&urls.length>0;if(hasUrls&&!msg.urls){msg.urls=urls;}const showSourcesButton=msg.hasValidSources===true||(msg.enrichedSources&&(msg.enrichedSources.noticiaSources.length>0||msg.enrichedSources.nonNoticiaSources.length>0));return ‘
‘+sanitizedHTML+’
‘+(showSourcesButton?’
‘+ICONS.sourceIcon+’
Fuentes‘:»)+’
‘;}else{const div=document.createElement(‘div’);div.textContent=msg.text;const escapedText=div.innerHTML;return »;}}function renderTypingIndicator(){return ‘
‘+ICONS.merlinThinkingIcon+’
‘;}function renderScrollButton(){return »;}function renderInput(){const placeholder=isLoggedIn()?’Pregúntale a Merlín’:’Por favor inicia sesión’;const disabledAttr=!isLoggedIn()?’ disabled’:»;return ‘
‘;}function renderTooltip(){return »;}let chatEventsBound=false;function setupChatEvents(){if(chatEventsBound)return;chatEventsBound=true;const input=document.getElementById(‘merlin-input’);const sendBtn=document.getElementById(‘merlin-send’);const messagesContainer=document.querySelector(‘.’+CLS.chatMessages);const scrollBtn=document.getElementById(‘merlin-scroll-down’);if(input){input.addEventListener(‘keydown’,function(e){if(e.key===’Enter’&&!e.shiftKey&&!isBotTyping){e.preventDefault();handleSend();}});input.addEventListener(‘input’,function(e){if(!isBotTyping){const cursorPos=input.selectionStart;const originalValue=e.target.value;const sanitized=sanitizeInput(originalValue);if(sanitized!==originalValue){const diff=originalValue.length-sanitized.length;input.value=sanitized;const newPos=Math.max(0,cursorPos-diff);input.setSelectionRange(newPos,newPos);}}});input.addEventListener(‘touchstart’,function(e){if(!input.disabled){input.readOnly=false;}},{passive:true});input.addEventListener(‘focus’,function(){if(!input.disabled){input.readOnly=false;}});}if(sendBtn){sendBtn.addEventListener(‘click’,handleSend);sendBtn.addEventListener(‘touchend’,function(e){e.preventDefault();handleSend();});}if(messagesContainer){messagesContainer.addEventListener(‘scroll’,checkScrollPosition,{passive:true});}if(scrollBtn){scrollBtn.addEventListener(‘click’,function(){scrollToBottom(true);});scrollBtn.addEventListener(‘touchend’,function(e){e.preventDefault();scrollToBottom(true);});}}async function handleSend(){const input=document.getElementById(‘merlin-input’);if(!input||!isLoggedIn()||isBotTyping)return;const messageToSend=input.value.trim();if(messageToSend){const validation=validateMessage(messageToSend);if(!validation.valid){errorMessage=validation.error||’Mensaje no válido.’;showModal=true;isModalExiting=false;insertWarningModal();input.focus();return;}try{window.dataLayer=window.dataLayer||[];window.dataLayer.push({event:’merlin_search_query’,search_term:messageToSend,query_type:’manual’,query_location:’widget’});}catch(e){console.error(‘Error pushing to dataLayer:’,e);}if(showModal){closeModal();}input.value=»»;await handleSendMessage(messageToSend);}}let mainEventsBound=false;function bindEvents(){const widgetBtn=document.getElementById(‘merlin-widget-button’);const closeBtn=document.getElementById(‘merlin-close’);const expandBtn=document.getElementById(‘merlin-expand’);const tooltipBtn=document.getElementById(‘merlin-tooltip-btn’);const tooltipMenu=document.getElementById(‘merlin-tooltip-menu’);const aboutBtn=document.getElementById(‘merlin-about’);const clearBtn=document.getElementById(‘merlin-clear’);if(widgetBtn){widgetBtn.onclick=function(){if(!isLoggedIn())return;toggle();};}if(closeBtn){closeBtn.onclick=toggle;closeBtn.ontouchend=function(e){e.preventDefault();toggle();};}if(expandBtn){expandBtn.onclick=expand;expandBtn.ontouchend=function(e){e.preventDefault();expand();};}if(tooltipBtn){const toggleTooltip=function(e){e.stopPropagation();tooltipOpen=!tooltipOpen;const menu=document.getElementById(‘merlin-tooltip-menu’);if(menu){if(tooltipOpen){menu.classList.remove(‘merlin-hidden’);}else{menu.classList.add(‘merlin-hidden’);}}};tooltipBtn.onclick=toggleTooltip;tooltipBtn.ontouchend=function(e){e.preventDefault();toggleTooltip(e);};}if(aboutBtn){aboutBtn.onclick=function(){window.open(«https://elcomercio.pe/»+LANDING_REDIRECT,’_blank’,’noopener,noreferrer’);tooltipOpen=false;const menu=document.getElementById(‘merlin-tooltip-menu’);if(menu)menu.classList.add(‘merlin-hidden’);};}if(clearBtn){clearBtn.onclick=function(){clearChat();tooltipOpen=false;const menu=document.getElementById(‘merlin-tooltip-menu’);if(menu)menu.classList.add(‘merlin-hidden’);};}if(!mainEventsBound){mainEventsBound=true;document.addEventListener(‘click’,function(e){const menu=document.getElementById(‘merlin-tooltip-menu’);const btn=document.getElementById(‘merlin-tooltip-btn’);if(menu&&btn&&tooltipOpen&&!menu.contains(e.target)&&!btn.contains(e.target)){tooltipOpen=false;menu.classList.add(‘merlin-hidden’);}});document.addEventListener(‘keydown’,handleEscKey);}}function handleEscKey(e){if(e.key===’Escape’){if(showSources){closeSources();}else if(showModal){closeModal();}}}function toggle(){if(isOpen){chatEventsBound=false;if(showModal){showModal=false;errorMessage=null;responseMessage=null;responseCode=null;remainingQuestions=null;isModalExiting=false;const modalEl=document.getElementById(‘merlin-warning-modal’);if(modalEl&&modalEl.parentNode){modalEl.parentNode.removeChild(modalEl);}}if(showSources){showSources=false;isSourcesExiting=false;document.body.style.overflow=»;const sourcesEl=document.getElementById(‘merlin-sources-overlay’);if(sourcesEl&&sourcesEl.parentNode){sourcesEl.parentNode.removeChild(sourcesEl);}}}const wasOpen=isOpen;isOpen=!isOpen;const existingModal=document.querySelector(‘.’+CLS.modal);if(existingModal){if(isOpen){existingModal.classList.add(CLS.modalOpen);}else{existingModal.classList.remove(CLS.modalOpen);}}else{render();}if(isOpen&&!wasOpen){chatEventsBound=false;if(!historyLoaded){const modalBody=document.querySelector(‘.’+CLS.body);if(modalBody){modalBody.innerHTML=»;}retrieveHistory().then(function(){historyLoaded=true;updateChatDOM();setTimeout(function(){scrollToBottom(false);checkScrollPosition();},100);}).catch(function(error){console.error(‘Error loading chat history:’,error);historyLoaded=true;updateChatDOM();setTimeout(function(){scrollToBottom(false);checkScrollPosition();},100);});}else{updateChatDOM();setTimeout(function(){scrollToBottom(false);checkScrollPosition();},100);}}else if(isOpen){updateChatDOM();setTimeout(function(){scrollToBottom(false);checkScrollPosition();},100);}}function expand(){try{localStorage.setItem(‘merlin-expand-to-chat’,’true’);localStorage.setItem(‘merlin-origin-url’,window.location.href);}catch(error){console.error(‘Error al guardar estado:’,error);}window.location.href=window.location.origin+»https://elcomercio.pe/»+REDIRECT_PATH;}(function setupStorageListener(){window.addEventListener(‘storage’,function(e){if(e.key===_0x1k2l&&e.newValue!==e.oldValue){if(isOpen&&isLoggedIn()){messages=[];showScrollButton=false;updateChatDOM();tooltipOpen=false;const scrollBtnContainer=document.querySelector(‘.’+CLS.chatScrollDownButtonContainer);if(scrollBtnContainer){scrollBtnContainer.classList.add(‘merlin-hidden’);}}}else if(e.key===_0x9i0j&&e.newValue!==e.oldValue){if(isOpen&&isLoggedIn()){setTimeout(function(){retrieveHistory().then(function(){responseCode=null;responseMessage=null;errorMessage=null;updateChatDOM();setTimeout(function(){scrollToBottom(false);checkScrollPosition();},100);}).catch(function(error){console.error(‘Error reloading messages after sync:’,error);});},500);}}});})();function startWidget(){(async function init(){try{await waitForCryptoHelpers();}catch(error){console.error(‘Failed to load cryptoHelpers:’,error);}messages=[];render();})();}if(document.readyState===’loading’){document.addEventListener(‘DOMContentLoaded’,startWidget);}else{startWidget();}})();




