"use strict";(globalThis.webpackChunkblocksy_companion=globalThis.webpackChunkblocksy_companion||[]).push([[208,608],{208(e,t,n){n.d(t,{O:function(){return r},u:function(){return o}});const o=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{isExpired:o,...r}=t[n];return{...e,[n]:{...r,...r.closed?{}:{closed:o?{reason:"cancel",timestamp:(new Date).getTime()}:null}}}},{}),t||{}},r=function(e){let t=e.id.replace("ct-popup-","");const n=o()[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:i}=n;if(!i||!i.timestamp)return!1;const u=("cancel"===i.reason?o:r)/60/24;return!((new Date-new Date(i.timestamp))/864e5>u)}}return n&&n.closed}},608(e,t,n){n.d(t,{handleTriggers:function(){return i}});var o=n(208);const r=function(...e){n.e(65).then(n.bind(n,65)).then(function({openMicroPopup:t}){return t(...e)})},i=function(){if([...document.querySelectorAll('[data-popup-mode*="page_load"]')].filter(function(e){return!(0,o.O)(e)}).map(function(e){return r(e)}),[...document.querySelectorAll('[data-popup-mode*="after_x_time"]')].filter(function(e){return!(0,o.O)(e)}).map(function(e){let t=e.dataset.popupMode.split(":")[1];setTimeout(function(){r(e)},1e3*parseInt(t,10))}),document.querySelector('[data-popup-mode*="after_x_pages"]')){let e=[...document.querySelectorAll('[data-popup-mode*="after_x_pages"]')].filter(function(e){return!(0,o.O)(e)});if(e.length>0){let t=(0,o.u)();e.map(function(e){const n=e.id.replace("ct-popup-",""),o=parseFloat(e.dataset.popupMode.split(":")[1])+1,i={...t[n]??{},pages:Array.from(new Set([...(t[n]??{}).pages||[],location.href]))};t[n]=i,i.pages.length>=o&&r(e)}),localStorage.setItem("blocksyPastPopups",JSON.stringify(t))}}if(document.querySelector('[data-popup-mode*="exit_intent"]')){if([...document.querySelectorAll('[data-popup-mode*="exit_intent"]')].filter(function(e){return!(0,o.O)(e)}).length>0){const e=function(t){(t.clientY<=0||t.clientX<=0||t.clientX>=window.innerWidth||t.clientY>=window.innerHeight)&&[...document.querySelectorAll('[data-popup-mode*="exit_intent"]')].map(function(t){t.classList.contains("active")||(r(t),document.removeEventListener("mouseout",e))})};document.addEventListener("mouseout",e)}}document.querySelector('[data-popup-mode*="element_reveal"]')&&[...document.querySelectorAll('[data-popup-mode*="element_reveal"]')].filter(function(e){return!(0,o.O)(e)}).map(function(e){let t=e.dataset.popupMode.split(":")[1];if(!document.querySelector(t))return;let n=new IntersectionObserver(function(t){0!==t.filter(function({isIntersecting:e}){return e}).map(function({target:e}){return e}).length&&(r(e),n.disconnect())});[...document.querySelectorAll(t)].map(function(e){n.observe(e)})}),document.querySelector('[data-popup-mode*="element_click"]')&&[...document.querySelectorAll('[data-popup-mode*="element_click"]')].filter(function(e){return!(0,o.O)(e)}).map(function(e){let t=e.dataset.popupMode.split(":")[1];document.querySelector(t)&&[...document.querySelectorAll(t)].map(function(t){t.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation(),r(e)})})}),document.querySelector('[data-popup-mode*="after_inactivity"]')&&[...document.querySelectorAll('[data-popup-mode*="after_inactivity"]')].filter(function(e){return!(0,o.O)(e)}).map(function(e){var t;function n(){r(e),t&&clearTimeout(t),window.removeEventListener("load",o),window.removeEventListener("mousemove",o),window.removeEventListener("mousedown",o),window.removeEventListener("touchstart",o),window.removeEventListener("click",o),window.removeEventListener("keydown",o),window.removeEventListener("scroll",o,!0)}function o(){let o=e.dataset.popupMode.split(":")[1];clearTimeout(t),t=setTimeout(n,1e3*parseInt(o,10))}window.addEventListener("load",o),window.addEventListener("mousemove",o),window.addEventListener("mousedown",o),window.addEventListener("touchstart",o),window.addEventListener("click",o),window.addEventListener("keydown",o),window.addEventListener("scroll",o,!0)})}}}]);