"use strict";(globalThis.webpackChunkblocksy_companion=globalThis.webpackChunkblocksy_companion||[]).push([[985,806],{806:function(e,t,n){n.d(t,{Q:function(){return c},R:function(){return a}});var r=n(572);function o(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 i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var c=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 o=t[n],c=o.isExpired,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(o,["isExpired"]);return i(i({},e),{},(0,r.Z)({},n,i(i({},a),a.closed?{}:{closed:c?{reason:"cancel",timestamp:(new Date).getTime()}:null})))}),{}))||{}},a=function(e){var t=e.id.replace("ct-popup-",""),n=c()[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,i=0;r.length>1&&(i=o=parseInt(r[1])),r.length>2&&(i=parseInt(r[2]));var a=n.closed;if(!a||!a.timestamp)return!1;var u=("cancel"===a.reason?o:i)/60/24;return!((new Date-new Date(a.timestamp))/864e5>u)}}return n&&n.closed}},985:function(e,t,n){n.r(t),n.d(t,{handleScrollModePopups:function(){return c}});var r=n(785),o=n(696),i=n(806),c=function(){(0,r.Z)(document.querySelectorAll('[data-popup-mode*="scroll"]')).filter((function(e){return!(0,i.R)(e)})).map((function(e){var t=e.dataset.popupMode.indexOf("up")>-1,n=scrollY;window.addEventListener("scroll",(function r(){var i=e.dataset.popupMode.split(":")[1];if(i.indexOf("px")>-1&&(i=parseFloat(i)),i.toString().indexOf("%")>-1){var c=document.body,a=document.documentElement,u=Math.max(c.scrollHeight,c.offsetHeight,a.clientHeight,a.scrollHeight,a.offsetHeight);i=parseFloat(i)/100*u}i.toString().indexOf("vh")>-1&&(i=parseFloat(i)/100*innerHeight),t&&(scrollY>n?n=scrollY:Math.abs(n-scrollY)>i?(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||(i<=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)}))}},572:function(e,t,n){function r(e){return r="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},r(e)}function o(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t,n){return(t=o(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 i}})}}]);