Logic

Understanding someone’s feelings can help you respond without letting those feelings determine who is responsible.

'; template.replaceWith(frame);return; } const fragment=document.createElement('template');fragment.innerHTML=template.content.textContent; const scripts=Array.from(fragment.content.querySelectorAll('script')),pending=[]; scripts.forEach(old=>{const marker=document.createComment('ad-script');old.replaceWith(marker);pending.push([old,marker]);}); mount.append(fragment.content);template.remove(); for(const [old,marker] of pending){ const type=(old.getAttribute('type')||'').toLowerCase(); if(type&&!['module','text/javascript','application/javascript'].includes(type)){marker.replaceWith(old);continue;} const script=document.createElement('script');for(const attr of old.attributes)script.setAttribute(attr.name,attr.value); if(old.hasAttribute('src')&&!old.hasAttribute('async')&&!old.hasAttribute('defer'))script.setAttribute('defer',''); if(!old.hasAttribute('async'))script.async=false; script.textContent=old.textContent; const done=old.hasAttribute('src')||type==='module'?new Promise(resolve=>{script.onload=script.onerror=resolve;}):null; marker.replaceWith(script); if(done&&!old.hasAttribute('async'))await done; } } window.addEventListener('tnlconsent',()=>ready()); function ready(root=document){if(!permitted())return;if(root.matches?.('template[data-tnl-ad-code]'))mount(root);root.querySelectorAll?.('template[data-tnl-ad-code]').forEach(template=>mount(template));} function boot(){ready();new MutationObserver(changes=>changes.forEach(change=>change.addedNodes.forEach(node=>{if(node.nodeType===1)ready(node);}))).observe(document.body,{childList:true,subtree:true});} if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',boot,{once:true});else boot(); })();