"use strict";(globalThis.webpackChunkblocksy_companion=globalThis.webpackChunkblocksy_companion||[]).push([[407,541],{407:function(e,t,n){n.d(t,{u:function(){return s},O:function(){return l}});var o=n(705);const r=["isExpired"];function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function i(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,o.A)(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}const s=function(){const e=JSON.parse(localStorage.getItem("blocksyPastPopups"));let 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){const o=t[n],{isExpired:c}=o,s=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)n=c[o],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(o,r);return i(i({},e),{},{[n]:i(i({},s),s.closed?{}:{closed:c?{reason:"cancel",timestamp:(new Date).getTime()}:null})})},{}),t||{}},l=function(e){let t=e.id.replace("ct-popup-","");const n=s()[t];if(e.dataset.popupRelaunch){if("always"===e.dataset.popupRelaunch)return!1;if(e.dataset.popupRelaunch.indexOf("custom")>-1&&n){const t=e.dataset.popupRelaunch.split(":");let o=0,r=0;t.length>1&&(o=parseInt(t[1]),r=o),t.length>2&&(r=parseInt(t[2]));const{closed:c}=n;if(!c||!c.timestamp)return!1;const i=("cancel"===c.reason?o:r)/60/24;return!((new Date-new Date(c.timestamp))/864e5>i)}}return n&&n.closed}},541:function(e,t,n){n.d(t,{handleScrollModePopups:function(){return c}});var o=n(460),r=n(407);const c=function(){[...document.querySelectorAll('[data-popup-mode*="scroll"]')].filter(function(e){return!(0,r.O)(e)}).map(function(e){let t=e.dataset.popupMode.indexOf("up")>-1,n=scrollY;const r=function(){let c=e.dataset.popupMode.split(":")[1];if(c.indexOf("px")>-1&&(c=parseFloat(c)),c.toString().indexOf("%")>-1){let e=document.body,t=document.documentElement,n=Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight);c=parseFloat(c)/100*n}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.L)(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.L)(e,{unmount:!1}))};window.addEventListener("scroll",r,!0)})}},705:function(e,t,n){function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function r(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function c(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{A:function(){return c}})}}]);