(function() { if(typeof window.__widgetTotalFoundCountfPlur0nofP4BYca8m80J === 'undefined') window.__widgetTotalFoundCountfPlur0nofP4BYca8m80J = 0; var getEmbeddingScriptTag = function() { var scriptSet = document.getElementsByTagName('script'); var foundCount = 0; for(var i=0; i < scriptSet.length; i++) { if(scriptSet[i].getAttribute('src') == 'https://www.coachaccountable.com/loginWidget/fPlur0nofP4BYca8m80J') { foundCount++; if(foundCount > __widgetTotalFoundCountfPlur0nofP4BYca8m80J) { __widgetTotalFoundCountfPlur0nofP4BYca8m80J++; return scriptSet[i]; } } } } var scriptTag = getEmbeddingScriptTag(); if(!scriptTag) return; var iframe = document.createElement('iframe'); iframe.style.width = "100%"; iframe.sandbox = 'allow-storage-access-by-user-activation allow-scripts allow-same-origin allow-top-navigation allow-forms'; iframe.style.border = "none"; iframe.src = "https://www.coachaccountable.com/loginWidget/w-fPlur0nofP4BYca8m80J"; scriptTag.parentNode.insertBefore(iframe, scriptTag); window.addEventListener('message', function(event) { if(event.origin == 'https://www.coachaccountable.com' && event.data.a == 'tellHeight') { // console.log('setting height to ' + event.data.h + '!'); iframe.style.height = event.data.h + "px"; } }, false); window.addEventListener('resize', function() { iframe.contentWindow.postMessage({ a: 'tellHeight' }, 'https://www.coachaccountable.com'); }, false); })();