"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[426],{43190:(e,n,t)=>{t.d(n,{q:()=>s});var o=t(45992),i=t(17588),l=t(66264),u=t(60708),r=t(34895),d=t(25e3);const s=e=>{let{getItems:n,item:t,menuType:s,theme:a,shouldCloseWhenClickOutside:m=!1,itemSize:c,menuTheme:v,styles:h}=e;const[g,f]=(0,i.useState)(n()),[p,T]=(0,i.useState)(!1),y=(0,i.useCallback)((()=>{T((e=>!e))}),[]);null===t||void 0===t||t.on(l.q.Message,(e=>{e===u.m.Entering&&(f(n()),T(!1))}));const w=function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const t=(0,i.useRef)(null);return(0,i.useEffect)((()=>{const o=n=>{t.current&&!t.current.contains(n.target)&&e(n)};return document.addEventListener("mouseup",o,n),document.addEventListener("touchend",o,n),()=>{document.removeEventListener("mouseup",o,n),document.removeEventListener("touchend",o,n)}}),[t,e,n]),t}((0,i.useCallback)((()=>{m&&p&&T(!1)}),[p,m]),!0);(0,i.useEffect)((()=>{f(n())}),[n]);const C=(0,r.CO)(s);return(0,d.T)({theme:a,children:(0,o.jsx)(C,{items:g,onToggleClick:y,opened:p,ref:w,theme:a,itemSize:c,menuTheme:v,styles:h})})}},933:(e,n,t)=>{t.d(n,{N:()=>l,e:()=>r});var o=t(48237);const i=(e,n)=>""===e?n("__new.view.widget.menu.sidebar.emptyTitlePlaceholder"):e,l=(e,n)=>e.map(((e,t)=>{var l;const u=(null===(l=e.menuItemAction.action)||void 0===l?void 0:l.type)===o.L.GoToSlide;return{text:i(e.menuItemName,n),key:t,onClick:()=>{},isLink:u,isActive:!1,isAllowed:u,altText:e.altText,backgroundColor:e.backgroundColor}})),u={active:!1,allowed:!1},r=(e,n)=>e.map(((e,t)=>{var l,r;const d=!!(null===(l=e.menuItemAction)||void 0===l?void 0:l.data)&&(null===(s=e.menuItemAction.data)||void 0===s?void 0:s.type)===o.L.GoToSlide;var s;const{active:a,allowed:m}=d&&(null===(r=e.menuItemAction)||void 0===r?void 0:r.data)?n.getGoToSlideState(e.menuItemAction.data):u;return{text:i(e.menuItemName,n.t),key:t,onClick:()=>{var n;return null===(n=e.menuItemAction)||void 0===n?void 0:n.run()},isLink:d,isActive:a,isAllowed:m,altText:e.altText}}))},70426:(e,n,t)=>{t.r(n),t.d(n,{geniallyMenuViewScript:()=>d});var o=t(45992),i=t(41381),l=t(42511),u=t(43190),r=t(933);const d=(e,n)=>{(0,i.p)({getTargetNodeItem:()=>e.item,initialState:void 0,renderApp:()=>{var t,i;const{config:d,item:s}=e,{menuItems:a,menuType:m,menuTheme:c,backgroundColor:v}=d,h=()=>(0,r.e)(a,n),g={width:null!==(t=null===s||void 0===s?void 0:s.width)&&void 0!==t?t:0,height:null!==(i=null===s||void 0===s?void 0:s.height)&&void 0!==i?i:0};return()=>(0,o.jsx)(l.W,{children:(0,o.jsx)(u.q,{getItems:h,item:s,menuType:m,theme:n.theme,itemSize:g,shouldCloseWhenClickOutside:!0,menuTheme:c,styles:{backgroundColor:v}})})}})(e,n)}},41381:(e,n,t)=>{t.d(n,{p:()=>u});var o=t(70377),i=t(66264),l=t(60708);function u(e){let{getTargetNodeItem:n,renderApp:t,renderThumbnailApp:u,initialState:r}=e,d=!1;const s=[],a=e=>{s.push(e)};return e=>{const m=n(e.config),c=null===m||void 0===m?void 0:m.parentSlide;function v(){if(!m)return;let e=null;if("idOfFreeNode"in m)e=document.getElementById(m.idOfFreeNode);else{const n=document.createElement("div");n.innerHTML=m.source;let t=n.getElementsByClassName("genially-widget-app");t.length||(t=n.getElementsByClassName("genially-widget-gallery"));const{id:o}=t[0];if(!o)return;e=document.getElementById(o)}if(e){const n=i=>{if(d){const l=t({setState:n,onUnmount:a});o.render(l(i),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"?')};d=!0,n(r),s.push((()=>{o.unmountComponentAtNode(e)}))}}function h(){d=!1,s.forEach((e=>{e()})),s.length=0}null===m||void 0===m||m.on(i.q.Mount,(()=>{v()})),null===m||void 0===m||m.on(i.q.Unmount,(()=>{h()})),m&&"isTransversal"in m&&m.isTransversal?v():null===c||void 0===c||c.on(l.m.Entering,(()=>{d||v()})),null===c||void 0===c||c.on(l.m.Exited,(()=>{m&&"isTransversal"in m&&m.isTransversal||d&&h()})),null===c||void 0===c||c.on(l.m.ThumbnailMount,(()=>{!function(){if(!u||!m||!("idOfThumbnailFreeNode"in m))return;const e=document.getElementsByClassName(m.idOfThumbnailFreeNode);Array.from(e).forEach((e=>{o.unmountComponentAtNode(e)}))}(),function(){if(!u||!m||!("idOfThumbnailFreeNode"in m))return;const e=document.getElementsByClassName(m.idOfThumbnailFreeNode);Array.from(e).forEach((e=>{o.render(u(),e)}))}()}))}}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/426.f9ca9ead.chunk.js.map