"use strict";(globalThis.webpackChunkblocksy_companion=globalThis.webpackChunkblocksy_companion||[]).push([[985,806],{806:function(e,t,n){n.d(t,{Q:function(){return i},R:function(){return s}});var r=n(942);function o(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var i=function(){var e=JSON.parse(localStorage.getItem("blocksyPastPopups")),t={};return Array.isArray(e)?e.forEach((function(e){t[e]={closed:{reason:"cancel",timestamp:(new Date).getTime()},pages:[]}})):t=e,(t=Object.keys(t||{}).reduce((function(e,n){var c=t[n],i=c.isExpired,s=o(c,["isExpired"]);return a(a({},e),{},(0,r.Z)({},n,a(a({},s),s.closed?{}:{closed:i?{reason:"cancel",timestamp:(new Date).getTime()}:null})))}),{}))||{}},s=function(e){var t=e.id.replace("ct-popup-",""),n=i()[t];if(e.dataset.popupRelaunch){if("always"===e.dataset.popupRelaunch)return!1;if(e.dataset.popupRelaunch.indexOf("custom")>-1&&n){var r=e.dataset.popupRelaunch.split(":"),o=0,c=0;r.length>1&&(c=o=parseInt(r[1])),r.length>2&&(c=parseInt(r[2]));var a=n.closed;if(!a||!a.timestamp)return!1;var s="cancel"===a.reason?o:c;return!((new Date-new Date(a.timestamp))/864e5>s)}}return n&&n.closed}},985:function(e,t,n){n.r(t),n.d(t,{handleScrollModePopups:function(){return a}});var r=n(433),o=n(12),c=n(806),a=function(){(0,r.Z)(document.querySelectorAll('[data-popup-mode*="scroll"]')).filter((function(e){return!(0,c.R)(e)})).map((function(e){var t=e.dataset.popupMode.indexOf("up")>-1,n=scrollY;window.addEventListener("scroll",(function r(){var c=e.dataset.popupMode.split(":")[1];if(c.indexOf("px")>-1&&(c=parseFloat(c)),c.toString().indexOf("%")>-1){var a=document.body,i=document.documentElement,s=Math.max(a.scrollHeight,a.offsetHeight,i.clientHeight,i.scrollHeight,i.offsetHeight);c=parseFloat(c)/100*s}c.toString().indexOf("vh")>-1&&(c=parseFloat(c)/100*innerHeight),t&&(scrollY>n?n=scrollY:Math.abs(n-scrollY)>c?(e.classList.contains("active")||((0,o.openMicroPopup)(e),e.unmount=function(){window.removeEventListener("scroll",r,!0)}),-1===e.dataset.popupMode.indexOf("close-back")&&window.removeEventListener("scroll",r,!0)):e.classList.contains("active")&&(0,o.closeMicroPopup)(e,{unmount:!1})),t||(c<=scrollY?(e.classList.contains("active")||((0,o.openMicroPopup)(e),e.unmount=function(){window.removeEventListener("scroll",r,!0)}),-1===e.dataset.popupMode.indexOf("close-back")&&window.removeEventListener("scroll",r,!0)):e.classList.contains("active")&&(0,o.closeMicroPopup)(e,{unmount:!1}))}),!0)}))}},942:function(e,t,n){function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{Z:function(){return r}})}}]);