!function(){if(!globalThis.postMessage||!globalThis.addEventListener||globalThis.h5pResizerInitialized)return null;globalThis.h5pResizerInitialized=!0;var e={hello:function(e,t,i){e.style.width="100%",e.getBoundingClientRect();var resize=function(){e.contentWindow?i("resize"):globalThis.removeEventListener("resize",resize)};globalThis.addEventListener("resize",resize,!1),i("hello")},prepareResize:function(e,t,i){e.clientHeight===t.scrollHeight&&t.scrollHeight===t.clientHeight||(e.style.height=t.clientHeight+"px",i("resizePrepared"))},resize:function(e,t){e.style.height=t.scrollHeight+"px"}};globalThis.addEventListener("message",(function receiveMessage(t){for(var i,n=globalThis.document.getElementsByTagName("iframe"),o=0;o<n.length;o++)if(n[o].contentWindow===t.source){i=n[o];break}i&&(e[t.data.action]&&e[t.data.action](i,t.data,(function respond(e,i){void 0===i&&(i={}),i.action=e,i.context="h5p",t.source.postMessage(i,t.origin)})),"entityIframe.resize"===t.data.subject&&(t.data.scrollHeight=t.data.height,e.resize(i,t.data,(function respond(e,i){void 0===i&&(i={}),i.scrollHeight=height,i.action=e,i.context="h5p",t.source.postMessage(i,t.origin)}))))}),!1);for(var t=globalThis.document.getElementsByTagName("iframe"),i={context:"h5p",action:"ready"},n=0;n<t.length;n++)-1!==t[n].src.indexOf("h5p")&&t[n].contentWindow.postMessage(i,"*")}();