import{i as _,C as w}from"./countdown.Cgcjk_tU.js";import{e as y}from"./extractGAExtraParams.CC5kY18g.js";import{g as l}from"./getCookieValue.FmDZvggo.js";import{g as m}from"./getSectionInfo.D5UdhNIq.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3a72d1f6-1c80-4e24-bada-d1e9d71e42bf",e._sentryDebugIdIdentifier="sentry-dbid-3a72d1f6-1c80-4e24-bada-d1e9d71e42bf")}catch{}})();const b={sm:640,md:768,lg:992,xl:1200},p="consent",D=b,C=()=>{const e=l(w),t=_(e);return e?{countdown:t?"active":"inactive",...t&&{countdown_remaining:Number(e)-Date.now()}}:{}},v=()=>{const e=l(p);if(!e)return{};const[t]=e.split(",");return{consent_status:t}},E=()=>{const e=document.querySelectorAll('[role="tab"][aria-selected="true"]'),t=[];return e.forEach(n=>{const{plansLoaded:r="N/A"}=y(n);t.push(r)}),t.length?{plans_loaded:t.join(",")}:{}},O=e=>{const{event:t}=e,n=C(),r=v(),g=E(),o=document.querySelector("html[data-currency]")?.getAttribute("data-currency"),f=()=>{if(t==="page_view")return{...o&&{currency:o},...r,...n,...g,...e};if(t==="scroll"){const{sectionName:s,sectionId:c,...a}=e;return{section_id:c,section_name:s,...a}}if(t==="click"){const{extra:s,element:c,...a}=e,{name:i,index:u}=m(c);return{...o&&{currency:o},...u&&{section_id:u},...i&&{section_name:i},...r,...n,...a,...s}}if(t==="show")return{...o&&{currency:o},...r,...n,...e};if(t==="hover"){const{element:s,...c}=e,{name:a,index:i}=m(s);return{...i&&{section_id:i},...a&&{section_name:a},element_name:s.getAttribute("data-ga-slug"),...c}}return e},d={...{send_to:"GA4",product:"nordvpn",version:document.querySelector('meta[name="appVersion"]')?.content,page_lang:document.documentElement.lang?.toUpperCase()},...f()};delete d.event,window.gtag&&window.gtag("event",t,d)};export{D as B,O as s}; //# sourceMappingURL=sendEvent.DTgjAu1e.js.map