"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[5262],{87001:(e,n,t)=>{t.d(n,{q:()=>r});var i=t(45992),o=t(17588);const r=e=>{let{url:n,config:t,view:r}=e;const l=(0,o.useRef)(null),d=(0,o.useRef)(!1),c=function(e){var n,t;const i={type:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"config",data:JSON.parse(JSON.stringify(e))};null===(t=null===(n=l.current)||void 0===n?void 0:n.contentWindow)||void 0===t||t.postMessage(i,"*")};return(0,o.useEffect)((()=>{c(t)}),[t]),(0,o.useEffect)((()=>{if(!l.current||d.current)return()=>{};const e=e=>{var n,i,o,s;if(e.source===(null===(n=l.current)||void 0===n?void 0:n.contentWindow))if("ready"===e.data.type)c(t,"init"),d.current=!0;else if("interactivity"===e.data.type){const n=e.data.data;"object"===typeof n?null===(i=null===r||void 0===r?void 0:r.runAction)||void 0===i||i.call(r,n):"string"===typeof n&&(null===(s=null===(o=null===r||void 0===r?void 0:r.getAction)||void 0===o?void 0:o.call(r,n))||void 0===s||s.run())}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}})),(0,i.jsx)("iframe",{ref:l,src:n,style:{pointerEvents:r?"auto":"none",width:"100%",height:"100%"},title:"Genially App"})}},15262:(e,n,t)=>{t.r(n),t.d(n,{geniallyCodeEditorScript:()=>l});var i=t(45992),o=t(57277),r=t(87001);const l=e=>{let{script:n,editor:t}=e;const l=n.item;l&&(0,o.x)({getTargetNodeItem:()=>n.item,renderApp:()=>{const e=n.getConfig();return(0,i.jsx)(r.q,{config:e,url:`https://plugins.genially.com/${l.scriptId}/1.0.0/index.html`})},nodePrefix:"geniallyCode"})({script:n,editor:t})}},57277:(e,n,t)=>{t.d(n,{x:()=>o});var i=t(70377);function o(e){let{getTargetNodeItem:n,renderApp:t,renderThumbnailApp:o,nodePrefix:r}=e;return e=>{let{script:l,editor:d}=e,c=null,s=[];function u(e){c&&(i.unmountComponentAtNode(c),c=null),e&&"innerHtml"in e&&(e.innerHtml='<div class="card-iframe"><div style="width: 100%; height: 100%; background: #FF0000; color: #FFFFFF;">Deleted</div><script><\/script></div>')}function a(){c&&i.render(t(),c)}function f(){const e=n(l.getConfig());if(!e)return;const t=`${r}-${e.id}`;"innerHtml"in e&&(e.innerHtml=`<div class="card-iframe"><div id="${t}" class="genially-widget-app" style="width: 100%; height: 100%;"></div></div>`),requestAnimationFrame((()=>{c="idOfFreeNode"in e?document.getElementById(e.idOfFreeNode)||null:document.getElementById(t)||null,a()}))}function m(){o&&s.length&&s.forEach((e=>{i.render(o(),e)}))}function g(){const e=n(l.getConfig());e&&"idOfThumbnailFreeNode"in e&&requestAnimationFrame((()=>{const n=document.getElementsByClassName(e.idOfThumbnailFreeNode);s=Array.from(n),m()}))}l.on("configChange",(e=>{let{config:t,prevConfig:i}=e;const o=n(t),r=i?n(i):void 0;r&&r!==o&&u(r),o&&(o!==r?(f(),g()):(a(),m()))})),l.on("dispose",(()=>{u(n(l.getConfig()))})),d.on("itemMount",(e=>{let{item:n}=e;n===l.item&&f()})),d.on("slideChange",(()=>{a()})),d.on("itemUnmount",(e=>{let{item:n}=e;n===l.item&&u()})),d.on("itemThumbnailMount",(e=>{let{item:n}=e;n===l.item&&g()}))}}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/5262.0188f6e5.chunk.js.map