"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[8938],{68124:(e,t,n)=>{n.d(t,{q:()=>g});var i=n(45992),o=n(37577),l=n(17588),s=n(66264),a=n(60708);var r=n(29973),d=n(88138);const u=e=>{let{isInEditor:t,slides:n,showControls:o,showPagination:l,autoplay:s,options:a,fit:r,onClickSelectedImage:u,onZoomedOut:c,galleryType:g,viewId:m}=e;if(!g)return null;const p=(0,d.BR)(g);return(0,i.jsx)(p,{isInEditor:t,slides:n,showControls:o,showPagination:l,autoplay:s,options:a,fit:r,onClickSelectedImage:u,onZoomedOut:c,viewId:m})},c=o.Ay.div({display:"flex",alignItems:"center",height:"100%",cursor:"default",".is-dragging":{cursor:"grabbing","& *":{cursor:"grabbing !important"}}}),g=e=>{let{isInEditor:t=!1,fit:n,autoplay:d,widgetItem:g,slides:m,showControls:p,showPagination:h=!0,galleryType:y,viewId:f,theme:w,onZoomed:v}=e;const I=Object.assign({loop:!0,skipSnaps:!0,watchResize:!0},r.Z),C=((e,t)=>{const[n,i]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{if(!e||!t)return;const n=[t.parentSlide.on(a.m.Entered,(()=>{t.visible&&i(!0)})),t.on(s.q.Visible,(()=>{i(!0)})),t.on(s.q.Hidden,(()=>{i(!1)}))];return()=>{n.forEach((e=>e())),i(!1)}}),[e,t]),n})(d,g);return(0,i.jsx)(o.NP,{theme:w,children:(0,i.jsx)(c,{style:{display:"flex",alignItems:"center",height:"100%"},children:(0,i.jsx)(u,{isInEditor:t,slides:m,showControls:p,showPagination:h,options:I,autoplay:C,onClickSelectedImage:e=>{null===v||void 0===v||v(void 0!==e)},onZoomedOut:()=>{null===v||void 0===v||v(!1)},fit:n,galleryType:y,viewId:f})})})}},38938:(e,t,n)=>{n.r(t),n.d(t,{geniallyGalleryViewScript:()=>r});var i=n(45992),o=n(54072),l=n(41381),s=n(68124),a=n(88138);const r=(e,t)=>{const n=e.config.nodeRichContent,{slideList:r,showControls:d,autoplay:u,fit:c,galleryType:g}=e.config,m=e.item;n&&(n.markAsInteractive=!0,n.thumbnail=(0,a.mJ)(g));const{viewId:p}=t,h=e=>{t.setIsExternalModalOpen(e)},y=r.map((e=>({image:e.image.source,title:e.title,id:(0,o.Ak)(),altText:e.image.altText})));(0,l.p)({getTargetNodeItem:e=>e.nodeRichContent,initialState:void 0,renderApp:()=>()=>(0,i.jsx)(s.q,{autoplay:u,slides:y,showControls:d,fit:c,galleryType:g,onZoomed:h,viewId:p,widgetItem:m,theme:t.theme})})(e,t)}},41381:(e,t,n)=>{n.d(t,{p:()=>s});var i=n(70377),o=n(66264),l=n(60708);function s(e){let{getTargetNodeItem:t,renderApp:n,initialState:s}=e,a=!1;const r=[],d=e=>{r.push(e)};return e=>{const u=t(e.config),c=null===u||void 0===u?void 0:u.parentSlide;function g(){if(!u)return;let e=null;if("idOfFreeNode"in u)e=document.getElementById(u.idOfFreeNode);else{const t=document.createElement("div");t.innerHTML=u.source;let n=t.getElementsByClassName("genially-widget-app");n.length||(n=t.getElementsByClassName("genially-widget-gallery"));const{id:i}=n[0];if(!i)return;e=document.getElementById(i)}if(e){const t=o=>{if(a){const l=n({setState:t,onUnmount:d});i.render(l(o),e)}else console.warn('"rerender" was called when the widget was already unmounted. This is a no-op. Did you forget to dispose of an event handler with "onUnmount"?')};a=!0,t(s),r.push((()=>{i.unmountComponentAtNode(e)}))}}function m(){a=!1,r.forEach((e=>{e()})),r.length=0}null===u||void 0===u||u.on(o.q.Mount,(()=>{g()})),null===u||void 0===u||u.on(o.q.Unmount,(()=>{m()})),u&&"isTransversal"in u&&u.isTransversal?g():null===c||void 0===c||c.on(l.m.Entering,(()=>{a||g()})),null===c||void 0===c||c.on(l.m.Exited,(()=>{u&&"isTransversal"in u&&u.isTransversal||a&&m()}))}}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/8938.8921a5ec.chunk.js.map