!function(){"use strict";function e(){return e=Object.assign||function(e){for(var t=1;t0},e.prototype.connect_=function(){d&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),p?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){d&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;l.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),f=function(e,t){for(var n=0,o=Object.keys(t);n0},e}(),O="undefined"!=typeof WeakMap?new WeakMap:new s,S=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=h.getInstance(),o=new x(t,n,this);O.set(this,o)};["observe","unobserve","disconnect"].forEach((function(e){S.prototype[e]=function(){var t;return(t=O.get(this))[e].apply(t,arguments)}}));var L=void 0!==c.ResizeObserver?c.ResizeObserver:S;const A=e=>"function"==typeof e;!function(){if("function"==typeof window.CustomEvent)return!1;window.CustomEvent=(e,t)=>{t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}}();const P=(e,t,n)=>{e&&e.postMessage&&A(e.postMessage)&&e.postMessage({event:t,payload:n||{}},"*")},T=(e,t)=>{window.parent!==window&&P(window.parent,e,t)},I=(e,t,n)=>{t=t||window;const o=((e,t)=>new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:t||null}))(e,n);t.dispatchEvent(o)};var R=!1;if("undefined"!=typeof window){var N={get passive(){R=!0}};window.addEventListener("testPassive",null,N),window.removeEventListener("testPassive",null,N)}var j="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),q=[],z=!1,$=-1,D=void 0,U=void 0,k=function(e){return q.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},H=function(e){var t=e||window.event;return!!k(t.target)||(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))},B=function(){void 0!==U&&(document.body.style.paddingRight=U,U=void 0),void 0!==D&&(document.body.style.overflow=D,D=void 0)},V=function(e,t){if(e){if(!q.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};q=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0||function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?H(e):e.stopPropagation())}(t,e)},z||(document.addEventListener("touchmove",H,R?{passive:!1}:void 0),z=!0)):function(e){if(void 0===U){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;t&&n>0&&(U=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===D&&(D=document.body.style.overflow,document.body.style.overflow="hidden")}(t)}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")};const W=()=>{const e=window.MC&&window.MC.Loader&&window.MC.Loader.resize&&window.MC.Loader.resize.selector&&document.querySelector(window.MC.Loader.resize.selector)||document.querySelector(".wx-widget-container")||document.body,t=e.children.length;let n=e.offsetHeight;t>1&&e!==document.body&&(n=e.children[t-1].offsetHeight+e.children[t-1].offsetTop),window.MC&&window.MC.Loader&&window.MC.Loader.resize&&window.MC.Loader.resize.factor&&(n+=window.MC.Loader.resize.factor);const o=getComputedStyle(e);return n+=parseInt(o.marginTop)+parseInt(o.marginBottom)+parseInt(o.paddingTop)+parseInt(o.paddingBottom),n},G=()=>{T("usrc:data-loaded",{id:window.MC.USrc.Parent.cpmId,height:W()})},F=e=>{const t=document.querySelector(`div[data-mc-lightbox="${e.cpmId}"] iframe`);var n;t?((n=t.parentElement)?(q=q.filter((function(e){return e.targetElement!==n})),j?(n.ontouchstart=null,n.ontouchmove=null,z&&0===q.length&&(document.removeEventListener("touchmove",H,R?{passive:!1}:void 0),z=!1)):q.length||B()):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices."),t.parentNode.style.opacity="0",t.parentNode.style.display="none"):(j?(q.forEach((function(e){e.targetElement.ontouchstart=null,e.targetElement.ontouchmove=null})),z&&(document.removeEventListener("touchmove",H,R?{passive:!1}:void 0),z=!1),$=-1):B(),q=[])},Y=({appendLightbox:e=(()=>{})})=>{window.addEventListener("message",(t=>{const n=t.data;switch(n.event){case"resize":(e=>{const t=document.querySelector(`div[data-mc-cmp-id="${e.id}"]`);if(t&&e.height&&!t.getAttribute("data-mc-manual-resizing")){let n=e.height;window.MC.Loader&&window.MC.Loader.resize&&Number(window.MC.Loader.resize.scale)&&(n*=Number(window.MC.Loader.resize.scale)),t.style.height=`${n}px`,"external-iframe"===t.getAttribute("data-mc-type")&&t.parentNode&&"ARTICLE"===t.parentNode.tagName&&(t.parentNode.style.height=`${n}px`)}})(n.payload);break;case"open-lightbox-child":o=n.payload,window.MC.USrc.Lightbox||(window.MC.USrc.Lightbox={}),window.MC.USrc.Lightbox.open||I("open-lightbox",window,o),window.MC.USrc.Lightbox.open=!0;break;case"open-lightbox-parent":(e=>{const t=document.querySelector(`div[data-mc-lightbox="lightbox-${e.cpmId}"] iframe`);t&&(V(t.parentElement),P(t.contentWindow,"open-lightbox-child",e.params),t.parentNode.style.display="unset",setTimeout((()=>{t.parentNode.style.opacity=1}),500))})(n.payload);break;case"close-lightbox-parent":F(n.payload);break;case"append-lightbox":e(n.payload)}var o})),window.addEventListener("data-loaded",G),window.addEventListener("open-lightbox",(e=>{T("open-lightbox-parent",{params:e.detail,cpmId:window.MC.USrc.Parent.cpmId})})),window.addEventListener("close-lightbox",((e,t)=>{window.MC.USrc.Lightbox||(window.MC.USrc.Lightbox={}),window.MC.USrc.Lightbox.open=!1,T("close-lightbox-parent",{cpmId:window.MC.USrc.Parent.cpmId})}));const t=document.querySelector("div[data-page-container]");if(t){new L((e=>{for(let t of e){t.contentRect.height>0&&T("resize",{id:window.MC.USrc.Parent.cpmId,height:W()})}})).observe(t)}},J=e=>e.includes("widgets.woxo.tech")||e.startsWith("http://127.0.0.1");var K="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var Q,X,Z,ee=(Q=function(e,t){var n,o;n="object"==typeof window&&window||K,o={},n.PubSub=o,function(e){var t={},n=-1,o="*";function i(e){var t;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function r(e){return function(){throw e}}function a(e,t,n){try{e(t,n)}catch(e){setTimeout(r(e),0)}}function s(e,t,n){e(t,n)}function d(e,n,o,i){var r,d=t[n],c=i?s:a;if(Object.prototype.hasOwnProperty.call(t,n))for(r in d)Object.prototype.hasOwnProperty.call(d,r)&&c(d[r],e,o)}function c(e,t,n){return function(){var i=String(e),r=i.lastIndexOf(".");for(d(e,e,t,n);-1!==r;)r=(i=i.substr(0,r)).lastIndexOf("."),d(e,i,t,n);d(e,o,t,n)}}function u(e){var n=String(e);return Boolean(Object.prototype.hasOwnProperty.call(t,n)&&i(t[n]))}function l(e){for(var t=String(e),n=u(t)||u(o),i=t.lastIndexOf(".");!n&&-1!==i;)i=(t=t.substr(0,i)).lastIndexOf("."),n=u(t);return n}function p(e,t,n,o){var i=c(e="symbol"==typeof e?e.toString():e,t,o);return!!l(e)&&(!0===n?i():setTimeout(i,0),!0)}e.publish=function(t,n){return p(t,n,!1,e.immediateExceptions)},e.publishSync=function(t,n){return p(t,n,!0,e.immediateExceptions)},e.subscribe=function(e,o){if("function"!=typeof o)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(t,e)||(t[e]={});var i="uid_"+String(++n);return t[e][i]=o,i},e.subscribeAll=function(t){return e.subscribe(o,t)},e.subscribeOnce=function(t,n){var o=e.subscribe(t,(function(){e.unsubscribe(o),n.apply(this,arguments)}));return e},e.clearAllSubscriptions=function(){t={}},e.clearSubscriptions=function(e){var n;for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&0===n.indexOf(e)&&delete t[n]},e.countSubscriptions=function(e){var n,o=0;for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&0===n.indexOf(e)&&o++;return o},e.getSubscriptions=function(e){var n,o=[];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&0===n.indexOf(e)&&o.push(n);return o},e.unsubscribe=function(n){var o,i,r,a=function(e){var n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&0===n.indexOf(e))return!0;return!1},s="string"==typeof n&&(Object.prototype.hasOwnProperty.call(t,n)||a(n)),d=!s&&"string"==typeof n,c="function"==typeof n,u=!1;if(!s){for(o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(i=t[o],d&&i[n]){delete i[n],u=n;break}if(c)for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&i[r]===n&&(delete i[r],u=!0)}return u}e.clearSubscriptions(n)}}(o),void 0!==e&&e.exports&&(t=e.exports=o),t.PubSub=o,e.exports=t=o},Q(Z={path:X,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&Z.path)}},Z.exports),Z.exports);const te=5e4,ne=e=>{const t=document.createElement("div");t.setAttribute("data-mc-lightbox",`lightbox-${e.cmpId}`),t.innerHTML=``,t.setAttribute("style","position:fixed;top:0;left:0;height:100vh;width:100vw;display:none;opacity:0;transition:0.5s;z-index:22222222222"),document.body.appendChild(t)};(()=>{var t;if(null!=(t=window.MC)&&t.Loader)return;window.MC=window.MC||{},window.MC.Loader=window.MC.Loader||{},window.MC.Pages=window.MC.Pages||{},window.MC.Pages.Components=window.MC.Pages.Components||[],window.MC.Pages.LoadedComponents=window.MC.Pages.LoadedComponents||[],window.MC.Pages.Definitions=window.MC.Pages.Definitions||{},window.MC.Pages.__fcRuntime=window.MC.Pages.__fcRuntime||{},window.MC.Pages.__fcRuntime.bundles=window.MC.Pages.__fcRuntime.bundles||{},window.MC.Pages.__fcRuntime.styles=window.MC.Pages.__fcRuntime.styles||{},window.MC.USrc=window.MC.USrc||{},window.MC.USrc.Parent=window.MC.USrc.Parent||{},window.MC.Vendors=window.MC.Vendors||{},window.MC.Vendors.PubSub=ee,window.EM=window.EM||{},window.EM.___fcRuntime=window.EM.___fcRuntime||{},window.EM.___fcRuntime.vendors=window.EM.___fcRuntime.vendors||{},Y({appendLightbox:ne});const n={},o=(e,t)=>{const n=document.querySelector("[data-mc-cmp-id="+e+"]");return n&&t&&n.getAttribute("data-mc-loaded")?null:n||null},i=({url:e,style:t,onLoad:o,title:i,cmpId:r})=>{const a=document.createElement("iframe");a.setAttribute("src",`${e}#${r}`),a.style=t,a.setAttribute("title",i),a.setAttribute("data-hj-allow-iframe",!0);return window.addEventListener("message",(e=>{const{data:t}=e;"usrc:data-loaded"===t.event&&t.payload&&t.payload.id===r&&o(t.payload&&t.payload.height||"auto")})),n[a.cmpId]=(new Date).getTime(),setTimeout((()=>{if(document.querySelector(`[data-cmp-id="${r}"]`)){const e=(e=>{const t=document.querySelector("[data-mc-cmp-id="+e+"]");return t&&t.parentNode&&t.parentNode.parentNode?t.parentNode.parentNode:null})(r);e&&e.parentNode.removeChild(e)}}),te),a},r=e=>{const t=o(e.cmpId);if(t){e.settings&&e.settings.initialHeight&&(t.style.height=`${e.settings.initialHeight}px`),t.style.position="relative",t.style.overflow="hidden",t.style["flex-basis"]="100%",t.style.width="100%";const n=e.settings&&e.settings.src||null;J(n)&&t.setAttribute("data-mc-manual-resizing",!0),e.settings&&!1!==e.settings.loaderCls&&t.appendChild((({cmpId:e,className:t})=>{if(!document.querySelector("[woxo-loader-style]")){const e=document.createElement("style");e.innerText="@keyframes mc-iframe-loader{0%{transform:scale(0,0);opacity:1;}100%{transform:scale(2,2);opacity:0;}},",e.setAttribute("woxo-loader-style",!0),document.head.appendChild(e)}const n=document.createElement("div");return n.innerHTML=`
\n
\n
\n
\n
\n
\n
\n
`,n})({cmpId:e.cmpId,className:e.settings.loaderCls})),t.appendChild(i({url:n,style:`width:100%;height:100%;border:none;overflow:hidden;opacity:${J(n)?0:null};transition:${J(n)?"0.5s":null};`,title:e.title,onLoad:n=>{const o=t.querySelector("iframe");o&&(o.style.opacity=100),n&&(t.style.height=`${n}px`),t.removeAttribute("data-mc-manual-resizing");const i=t.querySelector(`[data-cmp-id="${e.cmpId}"]`);i&&i.parentNode.removeChild(i)},cmpId:e.cmpId})),t.setAttribute("data-mc-loaded",!0),I("mc-rendered-component")}},s=()=>{if(window.MC.Pages.Components.length){if(o(window.MC.Pages.Components[0].cmpId,!0)){const t=window.MC.Pages.Components.shift();window.MC.Pages.LoadedComponents.push(t),(e=>{"iframe"===e.type&&r(e)})(e({},t))}}else window.removeEventListener("scroll",s),window.removeEventListener("mc-rendered-component",s)},d=new MutationObserver((e=>{e.forEach((({type:e,addedNodes:t,removedNodes:n})=>{try{if("childList"===e)if(t.length){const e=t[0];let n=null;if(e.nodeType===Node.ELEMENT_NODE){const t=e;n=t.hasAttribute("data-mc-src")?t:t.querySelector("div[data-mc-src]")}n&&A(n.hasAttribute)&&!n.hasAttribute("data-mc-observed")&&n.setAttribute("data-mc-observed",!0),window.MC.Loader.init()}else n.forEach((e=>{let t=null;if(e.nodeType===Node.ELEMENT_NODE){const n=e;t=n.hasAttribute("data-cmp-container-id")?n:n.querySelector("div[data-cmp-container-id]")}if(t){const e=window.MC.Pages.LoadedComponents.indexOf(window.MC.Pages.LoadedComponents.find((e=>e.cmpId===t.getAttribute("data-cmp-container-id"))));-1!==e&&window.MC.Pages.LoadedComponents.splice(e,1)}}))}catch(e){}}))}));window.MC.Loader.init=()=>{(()=>{const e=document.querySelector("[data-usrc]"),t=e.getAttribute("src");let n=e.getAttribute("data-usrc");n||(n=t.split("#")[1]);window.MC.Pages.Team&&window.MC.Pages.Team._id||(window.MC.Pages.Team=window.MC.Pages.Team||{},window.MC.Pages.Team._id=n)})(),window.MC&&window.MC.Pages&&Array.isArray(window.MC.Pages.Components)&&([...window.MC.Pages.LoadedComponents].forEach((e=>{document.querySelector(`div[data-mc-cmp-id="${e.cmpId}"]`)||(window.MC.Pages.Components.includes((t=>t.cmpId===e.cmpId))||window.MC.Pages.Components.push(e),window.MC.Pages.LoadedComponents.splice(0,1))})),document.querySelectorAll("div[data-mc-src]").forEach((e=>{const t=e.getAttribute("data-mc-src").split("#"),n=t[1]||"woxo";let o=t[0];o.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i)&&(o=`https://widgets.woxo.tech/${o}`);const i={type:"iframe",cmpId:`mission-control-component-${a()}`,settings:{loaderCls:"false"!==e.getAttribute("data-mc-loader")&&(e.getAttribute("data-mc-loader")||!0),initialHeight:e.getAttribute("data-mc-height")||200,src:o}};if(i.element=e,i.title=`${n.charAt(0).toUpperCase()}${n.substring(1)} widgets for website`,e.hasAttributes())for(var r in e.attributes)e.attributes[r]&&e.attributes[r].name&&e.attributes[r].name.startsWith("data-mc")&&e.removeAttribute(e.attributes[r].name);window.MC.Pages.Components.push(i)})),window.MC.Pages.Components.forEach((e=>{(e=>{if(!document.querySelector("div[data-mc-cmp-id='"+e.cmpId+"']")){let t=e.element||document.querySelector("[data-page-container]");t||(t=document.body);const n=document.createElement("article"),o=document.createElement("div");o.setAttribute("data-mc-cmp-id",e.cmpId),e.name&&o.setAttribute("data-mc-cmp",e.name),e.version&&o.setAttribute("data-mc-version",e.version),n.appendChild(o),t.setAttribute("data-cmp-container-id",e.cmpId),t.appendChild(n)}})(e)})),window.addEventListener("scroll",s,!1),window.addEventListener("mc-rendered-component",s,!1),I("mc-rendered-component"))};const c=()=>{const e=document.querySelector("div[data-mc-src]");if(null!=e){if("lazy"===e.getAttribute("loading")&&null!=window.IntersectionObserver){new IntersectionObserver(((e,t)=>{e.forEach((e=>{e.isIntersecting&&(t.disconnect(),window.MC.Loader.init())}))})).observe(e)}else window.MC.Loader.init()}d.observe(document.body,{childList:!0,subtree:!0})};"loading"!==document.readyState?c():document.addEventListener("DOMContentLoaded",(()=>{c()}))})()}(); //# sourceMappingURL=a.js.map