Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@snowplow/browser-tracker-core

Package Overview
Dependencies
Maintainers
3
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snowplow/browser-tracker-core - npm Package Compare versions

Comparing version 3.20.0 to 3.21.0

4

dist/index.umd.min.js
/*!
* Core functionality for Snowplow Browser trackers v3.20.0 (http://bit.ly/sp-js)
* Core functionality for Snowplow Browser trackers v3.21.0 (http://bit.ly/sp-js)
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang

@@ -7,3 +7,3 @@ * Licensed under BSD-3-Clause

"use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).snowplowBrowserTrackerCore={})}(this,(function(e){function n(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}function t(){var e,n={},t=[],r=[],i=[],a=function(e,t){null!=t&&""!==t&&(n[e]=t)};return{add:a,addDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&a(n,e[n])},addJson:function(e,n,i){i&&o(i)&&(e={keyIfEncoded:e,keyIfNotEncoded:n,json:i},r.push(e),t.push(e))},addContextEntity:function(e){i.push(e)},getPayload:function(){return n},getJson:function(){return t},withJsonProcessor:function(n){e=n},build:function(){return null==e||e(this,r,i),n}}}function r(e){return function(t,r,o){for(var i=function(n,r,o){if(n=JSON.stringify(n),e){if(o=t.add,n){var i=0,a=0,u=[];if(n){n=unescape(encodeURIComponent(n));do{var c=n.charCodeAt(i++),s=n.charCodeAt(i++),l=n.charCodeAt(i++),f=c<<16|s<<8|l;c=f>>18&63,s=f>>12&63,l=f>>6&63,f&=63,u[a++]=be.charAt(c)+be.charAt(s)+be.charAt(l)+be.charAt(f)}while(i<n.length);i=u.join(""),n=((n=n.length%3)?i.slice(0,n-3):i)+"===".slice(n||3)}n=n.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o.call(t,r,n)}else t.add(o,n)},a=function(n,r){if(!n){var o=t.getPayload();if(e?o.cx:o.co){var i=(n=JSON).parse;if(e){if(o=o.cx){switch(4-o.length%4){case 2:o+="==";break;case 3:o+="="}o=function(e){var n,t=0,r=0,o="",i=[];if(!e)return e;e+="";do{var a=be.indexOf(e.charAt(t++)),u=be.indexOf(e.charAt(t++));o=be.indexOf(e.charAt(t++));var c=be.indexOf(e.charAt(t++)),s=a<<18|u<<12|o<<6|c;a=s>>16&255,u=s>>8&255,s&=255,i[r++]=64===o?String.fromCharCode(a):64===c?String.fromCharCode(a,u):String.fromCharCode(a,u,s)}while(t<e.length);return o=i.join(""),n=o.replace(/\0+$/,""),decodeURIComponent(n.split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}(o=o.replace(/-/g,"+").replace(/_/g,"/"))}}else o=o.co;n=i.call(n,o)}else n=void 0}return n?n.data=n.data.concat(r.data):n=r,n},u=void 0,c=0;c<r.length;c++){var s=r[c];"cx"===s.keyIfEncoded?u=a(u,s.json):i(s.json,s.keyIfEncoded,s.keyIfNotEncoded)}r.length=0,o.length&&(u=a(u,r={schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:n([],o,!0)}),o.length=0),u&&i(u,"cx","co")}}function o(e){if(!i(e))return!1;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))return!0;return!1}function i(e){return null!=e&&(e.constructor==={}.constructor||e.constructor===[].constructor)}function a(){var e=[],n=[];return{getGlobalPrimitives:function(){return e},getConditionalProviders:function(){return n},addGlobalContexts:function(t){for(var r=[],o=[],i=0;i<t.length;i++){var a=t[i];m(a)?r.push(a):v(a)&&o.push(a)}e=e.concat(o),n=n.concat(r)},clearGlobalContexts:function(){n=[],e=[]},removeGlobalContexts:function(t){for(var r=function(t){m(t)?n=n.filter((function(e){return JSON.stringify(e)!==JSON.stringify(t)})):v(t)&&(e=e.filter((function(e){return JSON.stringify(e)!==JSON.stringify(t)})))},o=0;o<t.length;o++)r(t[o])},getApplicableContexts:function(t){e:{for(var r=0,o=t.getJson();r<o.length;r++){var i=o[r];if("ue_px"===i.keyIfEncoded&&"object"==typeof i.json.data&&"string"==typeof(i=i.json.data.schema)){r=i;break e}}r=""}i="string"==typeof(o=t.getPayload().e)?o:"",o=[];var a=b(e,t,i,r);return o.push.apply(o,a),t=function(e,n,t,r){var o;return e=w(e).map((function(e){e:{if(g(e)){var o=e[0],i=!1;try{i=o({event:n.getPayload(),eventType:t,eventSchema:r})}catch(e){i=!1}if(!0===i){e=b(e[1],n,t,r);break e}}else if(p(e)&&function(e,n){var t=0,r=0,o=e.accept;return Array.isArray(o)?e.accept.some((function(e){return h(e,n)}))&&r++:"string"==typeof o&&h(o,n)&&r++,o=e.reject,Array.isArray(o)?e.reject.some((function(e){return h(e,n)}))&&t++:"string"==typeof o&&h(o,n)&&t++,0<r&&0===t}(e[0],r)){e=b(e[1],n,t,r);break e}e=[]}if(e&&0!==e.length)return e})),(o=[]).concat.apply(o,e.filter((function(e){return null!=e&&e.filter(Boolean)})))}(n,t,i,r),o.push.apply(o,t),o}}}function u(e){return!!((e=e.split("."))&&1<e.length)&&function(e){if("*"===e[0]||"*"===e[1])return!1;if(0<e.slice(2).length){var n=!1,t=0;for(e=e.slice(2);t<e.length;t++)if("*"===e[t])n=!0;else if(n)return!1;return!0}return 2==e.length}(e)}function c(e){if(null!==(e=/^iglu:((?:(?:[a-zA-Z0-9-_]+|\*).)+(?:[a-zA-Z0-9-_]+|\*))\/([a-zA-Z0-9-_.]+|\*)\/jsonschema\/([1-9][0-9]*|\*)-(0|[1-9][0-9]*|\*)-(0|[1-9][0-9]*|\*)$/.exec(e))&&u(e[1]))return e.slice(1,6)}function s(e){if(e=c(e)){var n=e[0];return 5===e.length&&u(n)}return!1}function l(e){return function(e){return Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))}(e)?e.every((function(e){return s(e)})):"string"==typeof e&&s(e)}function f(e){return!!(o(e)&&"schema"in e&&"data"in e)&&("string"==typeof e.schema&&"object"==typeof e.data)}function d(e){return"function"==typeof e&&1>=e.length}function v(e){return d(e)||f(e)}function g(e){return!(!Array.isArray(e)||2!==e.length)&&(Array.isArray(e[1])?d(e[0])&&e[1].every(v):d(e[0])&&v(e[1]))}function p(e){return!(!Array.isArray(e)||2!==e.length)&&(!!function(e){var n=0;if(null!=e&&"object"==typeof e&&!Array.isArray(e)){if(Object.prototype.hasOwnProperty.call(e,"accept")){if(!l(e.accept))return!1;n+=1}if(Object.prototype.hasOwnProperty.call(e,"reject")){if(!l(e.reject))return!1;n+=1}return 0<n&&2>=n}return!1}(e[0])&&(Array.isArray(e[1])?e[1].every(v):v(e[1])))}function m(e){return g(e)||p(e)}function h(e,n){if(!s(e))return!1;if(e=c(e),n=null!==(n=/^iglu:([a-zA-Z0-9-_.]+)\/([a-zA-Z0-9-_]+)\/jsonschema\/([1-9][0-9]*)-(0|[1-9][0-9]*)-(0|[1-9][0-9]*)$/.exec(n))?n.slice(1,6):void 0,e&&n){if(!function(e,n){if(n=n.split("."),e=e.split("."),n&&e){if(n.length!==e.length)return!1;for(var t=0;t<e.length;t++)if(!y(n[t],e[t]))return!1;return!0}return!1}(e[0],n[0]))return!1;for(var t=1;5>t;t++)if(!y(e[t],n[t]))return!1;return!0}return!1}function y(e,n){return e&&n&&"*"===e||e===n}function w(e){return Array.isArray(e)?e:[e]}function b(e,n,t,r){var o;return e=w(e).map((function(e){e:if(f(e))e=[e];else{if(d(e)){n:{var o=void 0;try{if(o=e({event:n.getPayload(),eventType:t,eventSchema:r}),Array.isArray(o)&&o.every(f)||f(o)){var i=o;break n}i=void 0;break n}catch(e){}i=void 0}if(f(i)){e=[i];break e}if(Array.isArray(i)){e=i;break e}}e=void 0}if(e&&0!==e.length)return e})),(o=[]).concat.apply(o,e.filter((function(e){return null!=e&&e.filter(Boolean)})))}function S(e){void 0===e&&(e={});var t,o,u,c,s,l,f,d=e.base64,v=e.corePlugins,g=null!=v?v:[];t=null==d||d,o=g,u=e.callback,c=function(e){return{addPluginContexts:function(t){var r=t?n([],t,!0):[];return e.forEach((function(e){try{e.contexts&&r.push.apply(r,e.contexts())}catch(e){Se.error("Error adding plugin contexts",e)}})),r}}}(o),s=a(),l=t,f={};var p=re(re({},e={track:function(e,n,t){e.withJsonProcessor(r(l)),e.add("eid",we.v4()),e.addDict(f),t=function(e){return null==e?{type:"dtm",value:(new Date).getTime()}:"number"==typeof e?{type:"dtm",value:e}:"ttm"===e.type?{type:"ttm",value:e.value}:{type:"dtm",value:e.value||(new Date).getTime()}}(t),e.add(t.type,t.value.toString()),n=function(e,n){e=s.getApplicableContexts(e);var t=[];return n&&n.length&&t.push.apply(t,n),e&&e.length&&t.push.apply(t,e),t}(e,c.addPluginContexts(n)),void 0!==(n=n&&n.length?{schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:n}:void 0)&&e.addJson("cx","co",n),o.forEach((function(n){try{n.beforeTrack&&n.beforeTrack(e)}catch(e){Se.error("Plugin beforeTrack",e)}})),"function"==typeof u&&u(e);var i=e.build();return o.forEach((function(e){try{e.afterTrack&&e.afterTrack(i)}catch(e){Se.error("Plugin afterTrack",e)}})),i},addPayloadPair:function(e,n){f[e]=n},getBase64Encoding:function(){return l},setBase64Encoding:function(e){l=e},addPayloadDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(f[n]=e[n])},resetPayloadPairs:function(e){f=i(e)?e:{}},setTrackerVersion:function(e){f.tv=e},setTrackerNamespace:function(e){f.tna=e},setAppId:function(e){f.aid=e},setPlatform:function(e){f.p=e},setUserId:function(e){f.uid=e},setScreenResolution:function(e,n){f.res=e+"x"+n},setViewport:function(e,n){f.vp=e+"x"+n},setColorDepth:function(e){f.cd=e},setTimezone:function(e){f.tz=e},setLang:function(e){f.lang=e},setIpAddress:function(e){f.ip=e},setUseragent:function(e){f.ua=e},addGlobalContexts:function(e){s.addGlobalContexts(e)},clearGlobalContexts:function(){s.clearGlobalContexts()},removeGlobalContexts:function(e){s.removeGlobalContexts(e)}}),{addPlugin:function(e){var n,t;e=e.plugin,g.push(e),null===(n=e.logger)||void 0===n||n.call(e,Se),null===(t=e.activateCorePlugin)||void 0===t||t.call(e,p)}});return null==g||g.forEach((function(e){var n,t;null===(n=e.logger)||void 0===n||n.call(e,Se),null===(t=e.activateCorePlugin)||void 0===t||t.call(e,p)})),p}function k(e){try{var n=window.localStorage,t=n.getItem(e+".expires");if(null===t||+t>Date.now())return n.getItem(e);n.removeItem(e),n.removeItem(e+".expires")}catch(e){}}function T(e,n,t){void 0===t&&(t=63072e3);try{var r=window.localStorage,o=Date.now()+1e3*t;return r.setItem("".concat(e,".expires"),o.toString()),r.setItem(e,n),!0}catch(e){return!1}}function x(e){try{var n=window.localStorage;return n.removeItem(e),n.removeItem(e+".expires"),!0}catch(e){return!1}}function I(e){try{return window.sessionStorage.getItem(e)}catch(e){}}function C(e,n){try{return window.sessionStorage.setItem(e,n),!0}catch(e){return!1}}function A(e,n,t){var r,o=(new Date).getTime();n=re(re({},Ae),n);var i=t.domainUserId,a=t.userId,u=t.sessionId,c=t.sourceId,s=t.sourcePlatform,l=t.event,f=l.currentTarget;return l="function"==typeof n.reason?n.reason(l):null===(r=null==f?void 0:f.textContent)||void 0===r?void 0:r.trim(),e?[i,o,n.sessionId&&u,n.userId&&P(a||""),n.sourceId&&P(c||""),n.sourcePlatform&&s,n.reason&&P(l||"")].map((function(e){return e||""})).join(".").replace(/([.]*$)/,""):t.domainUserId+"."+o}function P(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function O(e){return!(!e||"string"!=typeof e.valueOf())}function E(e){return Number.isInteger&&Number.isInteger(e)||"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function D(e){if(!O(e)){e=e.text||"";var n=document.getElementsByTagName("title");n&&null!=n[0]&&(e=n[0].text)}return e}function L(e){var n=/^(?:(?:https?|ftp):)\/*(?:[^@]+@)?([^:/#]+)/.exec(e);return n?n[1]:e}function j(e){var n=e.length;return"."===e.charAt(--n)&&(e=e.slice(0,n)),"*."===e.slice(0,2)&&(e=e.slice(1)),e}function N(e){var n=window,t=B("referrer",n.location.href)||B("referer",n.location.href);if(t)return t;if(e)return e;try{if(n.top)return n.top.document.referrer;if(n.parent)return n.parent.document.referrer}catch(e){}return document.referrer}function _(e,n,t,r){return e.addEventListener?(e.addEventListener(n,t,r),!0):e.attachEvent?e.attachEvent("on"+n,t):void(e["on"+n]=t)}function B(e,n){return(e=new RegExp("^[^#]*[?&]"+e+"=([^&#]*)").exec(n))?decodeURIComponent(e[1].replace(/\+/g," ")):null}function R(e,n,t){t=n+"="+t;var r=(e=e.split("#"))[0].split("?"),o=r.shift();if(r=r.join("?")){for(var i=!0,a=r.split("&"),u=0;u<a.length;u++)if(a[u].substr(0,n.length+1)===n+"="){i=!1,a[u]=t,r=a.join("&");break}i&&(r=t+"&"+r)}else r=t;return e[0]=o+"?"+r,e.join("#")}function U(e,n){for(var t=window.location.hostname,r="_sp_root_domain_test_"+(new Date).getTime(),o="_test_value_"+(new Date).getTime(),i=t.split("."),a=i.length-2;0<=a;a--){var u=i.slice(a).join(".");if(z(r,o,0,"/",u,e,n),z(r)===o){for(M(r,u,e,n),t=V("_sp_root_domain_test_"),r=0;r<t.length;r++)M(t[r],u,e,n);return u}}return t}function M(e,n,t,r){z(e,"",-1,"/",n,t,r)}function V(e){for(var n=document.cookie.split("; "),t=[],r=0;r<n.length;r++)n[r].substring(0,e.length)===e&&t.push(n[r]);return t}function z(e,n,t,r,o,i,a){return 1<arguments.length?document.cookie=e+"="+encodeURIComponent(null!=n?n:"")+(t?"; Expires="+new Date(+new Date+1e3*t).toUTCString():"")+(r?"; Path="+r:"")+(o?"; Domain="+o:"")+(i?"; SameSite="+i:"")+(a?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}function H(e){return e.className.match(/\S+/g)||[]}function F(e,n){return e.hasOwnProperty("filter")&&e.filter?e.filter:n}function J(e){var n={};if(e=e.allowlist||e.denylist){Array.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++)n[e[t]]=!0}return n}function q(){try{return!!window.localStorage}catch(e){return!0}}function G(){if(!q())return!1;try{var e=window.localStorage;return e.setItem("modernizr","modernizr"),e.removeItem("modernizr"),!0}catch(e){return!1}}function W(e,n,t){return"translate.googleusercontent.com"===e?(""===t&&(t=n),e=L(n=null!=(e=(e=/^(?:https?|ftp)(?::\/*(?:[^?]+))([?][^#]+)/.exec(n))&&1<(null==e?void 0:e.length)?B("u",e[1]):null)?e:"")):"cc.bingj.com"!==e&&"webcache.googleusercontent.com"!==e||(e=L(n=document.links[0].href)),[e,n,t]}function Q(e,n){return void 0===n&&(n={memorizedVisitCount:1}),n=n.memorizedVisitCount,"0"===e[0]?(e[7]=e[6],e[5]=e[4],e[3]++):e[3]=n,n=we.v4(),e[6]=n,e[10]=0,e[8]="",e[9]=void 0,n}function X(e){e[4]=Math.round((new Date).getTime()/1e3)}function Z(e,n,t){var r=e[9];return{userId:t?"00000000-0000-0000-0000-000000000000":e[1],sessionId:e[6],eventIndex:e[10],sessionIndex:e[3],previousSessionId:t?null:e[7]||null,storageMechanism:"localStorage"==n?"LOCAL_STORAGE":"COOKIE_1",firstEventId:e[8]||null,firstEventTimestamp:r?new Date(r).toISOString():null}}function Y(){var e=K;if("innerWidth"in window)var n=window.innerWidth,t=window.innerHeight;else n=(t=document.documentElement||document.body).clientWidth,t=t.clientHeight;e=e(0<=n&&0<=t?n+"x"+t:null),n=K;var r=document.documentElement,o=document.body;return t=Math.max(r.clientWidth,r.offsetWidth,r.scrollWidth),r=Math.max(r.clientHeight,r.offsetHeight,r.scrollHeight,o?Math.max(o.offsetHeight,o.scrollHeight):0),{viewport:e,documentSize:n(t=isNaN(t)||isNaN(r)?"":t+"x"+r),resolution:K(screen.width+"x"+screen.height),colorDepth:screen.colorDepth,devicePixelRatio:window.devicePixelRatio,cookiesEnabled:window.navigator.cookieEnabled,online:window.navigator.onLine,browserLanguage:navigator.language||navigator.userLanguage,documentLanguage:document.documentElement.lang,webdriver:window.navigator.webdriver,deviceMemory:window.navigator.deviceMemory,hardwareConcurrency:window.navigator.hardwareConcurrency}}function K(e){return e&&e.split("x").map((function(e){return Math.floor(Number(e))})).join("x")}function $(e,r,o,i,a,u){void 0===u&&(u={});var c=[];e=function(e,r,o,i,a,u){function s(){(sn=W(window.location.hostname,window.location.href,N()))[1]!==fn&&(dn=N(fn)),ln=j(sn[0]),fn=sn[1]}function l(e){for(var n=function(e){return function(n){var t=n.currentTarget;n=A(e,Fn,{domainUserId:nn,userId:rn||void 0,sessionId:tn,sourceId:mn,sourcePlatform:vn,event:n}),null!=t&&t.href&&(t.href=R(t.href,"_sp",n))}}(Hn),t=0;t<document.links.length;t++){var r=document.links[t];!r.spDecorationEnabled&&e(r)&&(r.addEventListener("click",n,!0),r.addEventListener("mousedown",n,!0),r.spDecorationEnabled=!0)}}function f(e){if(Ge){var n=/#.*/;e=e.replace(n,"")}return We&&(n=/[{}]/g,e=e.replace(n,"")),e}function d(e){return(e=/^([a-z]+):/.exec(e))?e[1]:null}function v(e){return e=wn+e+"."+en,"localStorage"==Dn?k(e):"cookie"==Dn||"cookieAndLocalStorage"==Dn?z(e):void 0}function g(){s(),en=Ce((bn||ln)+(Sn||"/")).slice(0,4)}function p(){Xe=(new Date).getTime()}function m(){var e=h(),n=e[0];n<Ze?Ze=n:n>Ye&&(Ye=n),(e=e[1])<Ke?Ke=e:e>$e&&($e=e),p()}function h(){var e=document.documentElement;return e?[e.scrollLeft||window.pageXOffset,e.scrollTop||window.pageYOffset]:[0,0]}function y(){var e=h(),n=e[0];Ye=Ze=n,$e=Ke=e=e[1]}function w(){return P(wn+"ses."+en,"*",An)}function b(e){var t=wn+"id."+en,r=En;return e=n([],e,!0),r&&(e[1]="",e[7]=""),e.shift(),P(t,r=e.join("."),Cn)}function P(e,n,t){return!(En&&!Pn)&&("localStorage"==Dn?T(e,n,t):("cookie"==Dn||"cookieAndLocalStorage"==Dn)&&(z(e,n,t,Sn,bn,kn,Tn),-1!==document.cookie.indexOf("".concat(e,"="))))}function V(e){var n=wn+"id."+en,t=wn+"ses."+en;x(n),x(t),M(n,bn,kn,Tn),M(t,bn,kn,Tn),null!=e&&e.preserveSession||(tn=we.v4(),jn=1),null!=e&&e.preserveUser||(nn=En?"":we.v4(),rn=null)}function H(e){e&&e.stateStorageStrategy&&(u.stateStorageStrategy=e.stateStorageStrategy,Dn=Ue(u)),En=!!u.anonymousTracking,Pn=Me(u),On=Ve(u),Nn.setUseLocalStorage("localStorage"==Dn||"cookieAndLocalStorage"==Dn),Nn.setAnonymousTracking(On)}function F(){if(!En||Pn){var e="none"!=Dn&&!!v("ses"),n=J();if(n[1])var t=n[1];else t=En?"":we.v4(),n[1]=t;nn=t,tn=e?n[6]:Q(n),jn=n[3],"none"!=Dn&&(w(),X(n),b(n))}}function J(){return"none"==Dn?["1","",0,0,0,void 0,"","","",void 0,0]:function(e,n,t,r){var o=Math.round((new Date).getTime()/1e3);e?(e=e.split(".")).unshift("0"):e=["1",n,o,r,o,"",t],e[6]&&"undefined"!==e[6]||(e[6]=we.v4()),e[7]&&"undefined"!==e[7]||(e[7]=""),e[8]&&"undefined"!==e[8]||(e[8]=""),e[9]&&"undefined"!==e[9]||(e[9]=""),e[10]&&"undefined"!==e[10]||(e[10]=0);var i=function(e,n){return e=parseInt(e),isNaN(e)?n:e};return n=function(e){return e?i(e,void 0):void 0},[e[0],e[1],i(e[2],o),i(e[3],r),i(e[4],o),n(e[5]),e[6],e[7],e[8],n(e[9]),i(e[10],0)]}(v("id")||void 0,nn,tn,jn)}function q(e){return 0===e.indexOf("http")?e:("https:"===document.location.protocol?"https":"http")+"://"+e}function K(){_n&&null!=a.pageViewId||(a.pageViewId=we.v4())}function $(){return null==a.pageViewId&&(a.pageViewId=we.v4()),a.pageViewId}function ee(){if("none"===Dn||En||!He)return null;var e=I("_sp_tab_id");return e||(C("_sp_tab_id",we.v4()),e=I("_sp_tab_id")),e||null}function ne(e){var n=e.title,r=e.context,o=e.timestamp;if(e=e.contextCallback,s(),Bn&&K(),Bn=!0,hn=document.title,n=D((qe=n)||hn),un.track(function(e){var n=e.pageUrl,r=e.pageTitle;e=e.referrer;var o=t();return o.add("e","pv"),o.add("url",n),o.add("page",r),o.add("refr",e),o}({pageUrl:f(Je||fn),pageTitle:n,referrer:f(Fe||dn)}),(r||[]).concat(e?e():[]),o),o=new Date,n=!1,Rn.enabled&&!Rn.installed){n=Rn.installed=!0;var i={update:function(){if("undefined"!=typeof window&&"function"==typeof window.addEventListener){var e=!1,n=Object.defineProperty({},"passive",{get:function(){e=!0},set:function(){}}),t=function(){};window.addEventListener("testPassiveEventSupport",t,n),window.removeEventListener("testPassiveEventSupport",t,n),i.hasSupport=e}}};i.update();var a="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";Object.prototype.hasOwnProperty.call(i,"hasSupport")?_(document,a,p,{passive:!0}):_(document,a,p),y(),a=function(e,n){return void 0===n&&(n=p),function(e){return _(document,e,n)}},"click mouseup mousedown mousemove keypress keydown keyup touchend touchstart".split(" ").forEach(a(document)),["resize","focus","blur"].forEach(a(window)),a(window,m)("scroll")}if(Rn.enabled&&(yn||n))for(o in Xe=o.getTime(),o=void 0,Rn.configurations)(n=Rn.configurations[o])&&(window.clearInterval(n.activityInterval),te(n,r,e))}function te(e,n,t){var r=function(e,n){s(),e({context:n,pageViewId:$(),minXOffset:Ze,minYOffset:Ke,maxXOffset:Ye,maxYOffset:$e}),y()},o=function(){Xe+e.configHeartBeatTimer>(new Date).getTime()&&r(e.callback,(n||[]).concat(t?t():[]))};e.activityInterval=0===e.configMinimumVisitLength?window.setInterval(o,e.configHeartBeatTimer):window.setTimeout((function(){Xe+e.configMinimumVisitLength>(new Date).getTime()&&r(e.callback,(n||[]).concat(t?t():[])),e.activityInterval=window.setInterval(o,e.configHeartBeatTimer)}),e.configMinimumVisitLength)}function oe(e){var n=e.minimumVisitLength,t=e.heartbeatDelay;if(e=e.callback,E(n)&&E(t))return{configMinimumVisitLength:1e3*n,configHeartBeatTimer:1e3*t,callback:e};Se.error("Activity tracking minimumVisitLength & heartbeatDelay must be integers")}function ie(e){var n=e.context,r=e.minXOffset,o=e.minYOffset,i=e.maxXOffset,a=e.maxYOffset;(e=document.title)!==hn&&(hn=e,qe=void 0);var u=(e=un).track,c=f(Je||fn),s=D(qe||hn),l=f(Fe||dn);r=Math.round(r),i=Math.round(i),o=Math.round(o),a=Math.round(a);var d=t();d.add("e","pp"),d.add("url",c),d.add("page",s),d.add("refr",l),r&&!isNaN(Number(r))&&d.add("pp_mix",r.toString()),i&&!isNaN(Number(i))&&d.add("pp_max",i.toString()),o&&!isNaN(Number(o))&&d.add("pp_miy",o.toString()),a&&!isNaN(Number(a))&&d.add("pp_may",a.toString()),u.call(e,d,n)}function ae(e){var n=Rn.configurations[e];0===(null==n?void 0:n.configMinimumVisitLength)?window.clearTimeout(null==n?void 0:n.activityInterval):window.clearInterval(null==n?void 0:n.activityInterval),Rn.configurations[e]=void 0}var ue,ce,se,le,fe,de,ve,ge,pe,me,he,ye,be,ke,Te,xe,Ie,Ae,Pe,Oe,Ee,De,Le,je,Ne,_e,Be,Re;u.eventMethod=null!==(ue=u.eventMethod)&&void 0!==ue?ue:"post";var Ue=function(e){var n;return null!==(n=e.stateStorageStrategy)&&void 0!==n?n:"cookieAndLocalStorage"},Me=function(e){var n,t;return"boolean"!=typeof e.anonymousTracking&&(null!==(t=!0===(null===(n=e.anonymousTracking)||void 0===n?void 0:n.withSessionTracking))&&void 0!==t&&t)},Ve=function(e){var n,t;return"boolean"!=typeof e.anonymousTracking&&(null!==(t=!0===(null===(n=e.anonymousTracking)||void 0===n?void 0:n.withServerAnonymisation))&&void 0!==t&&t)},ze=null!==(se=null===(ce=null==u?void 0:u.contexts)||void 0===ce?void 0:ce.browser)&&void 0!==se&&se,He=null===(fe=null===(le=null==u?void 0:u.contexts)||void 0===le?void 0:le.webPage)||void 0===fe||fe;c.push({beforeTrack:function(e){var n=v("ses"),t=J(),r=0===t[10];if(on=!!Qe&&!!z(Qe),In||on)V();else{if("0"===t[0]?(tn=n||"none"==Dn?t[6]:Q(t),jn=t[3]):(new Date).getTime()-Ln>1e3*An&&(jn++,tn=Q(t,{memorizedVisitCount:jn})),X(t),0===t[10]){var o=e.build();t[8]=o.eid,o=o.dtm||o.ttm,t[9]=o?parseInt(o):void 0}t[10]+=1;var i=(o=Y()).documentSize;e.add("vp",o.viewport),e.add("ds",i),e.add("vid",Pn?jn:En?null:jn),e.add("sid",Pn?tn:En?null:tn),e.add("duid",En?null:t[1]),e.add("uid",En?null:rn),s(),e.add("refr",f(Fe||dn)),e.add("url",f(Je||fn)),o=Z(t,Dn,En),!Un||En&&!Pn||e.addContextEntity({schema:"iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2",data:o}),"none"!=Dn&&(b(t),e=w(),n&&!r||!e||!Mn||Vn||(Mn(o),Vn=!1)),Ln=(new Date).getTime()}}}),He&&c.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",data:{id:$()}}]}}),ze&&c.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/browser_context/jsonschema/2-0-0",data:re(re({},Y()),{tabId:ee()})}]}}),c.push.apply(c,null!==(de=u.plugins)&&void 0!==de?de:[]);var Fe,Je,qe,Ge,We,Qe,Xe,Ze,Ye,Ke,$e,en,nn,tn,rn,on,an,un=S({base64:u.encodeBase64,corePlugins:c,callback:function(e){In||on||Nn.enqueueRequest(e.build(),gn)}}),cn=document.characterSet||document.charset,sn=W(window.location.hostname,window.location.href,N()),ln=j(sn[0]),fn=sn[1],dn=sn[2],vn=null!==(ve=u.platform)&&void 0!==ve?ve:"web",gn=q(i),pn=null!==(ge=u.postPath)&&void 0!==ge?ge:"/com.snowplowanalytics.snowplow/tp2",mn=null!==(pe=u.appId)&&void 0!==pe?pe:"",hn=document.title,yn=null===(me=u.resetActivityTrackingOnPageView)||void 0===me||me,wn=null!==(he=u.cookieName)&&void 0!==he?he:"_sp_",bn=null!==(ye=u.cookieDomain)&&void 0!==ye?ye:void 0,Sn="/",kn=null!==(be=u.cookieSameSite)&&void 0!==be?be:"None",Tn=null===(ke=u.cookieSecure)||void 0===ke||ke,xn=navigator.doNotTrack||navigator.msDoNotTrack||window.doNotTrack,In=void 0!==u.respectDoNotTrack&&(u.respectDoNotTrack&&("yes"===xn||"1"===xn)),Cn=null!==(Te=u.cookieLifetime)&&void 0!==Te?Te:63072e3,An=null!==(xe=u.sessionCookieTimeout)&&void 0!==xe?xe:1800,Pn=Me(u),On=Ve(u),En=!!u.anonymousTracking,Dn=Ue(u),Ln=(new Date).getTime(),jn=1,Nn=function(e,n,t,r,o,i,a,u,c,s,l,f,d,v,g,p,m,h,y,w){function b(e){var n=Object.keys(e).map((function(n){return[n,e[n]]})).reduce((function(e,n){return e[n[0]]=n[1].toString(),e}),{});return{evt:n,bytes:S(JSON.stringify(n))}}function S(e){for(var n=0,t=0;t<e.length;t++){var r=e.charCodeAt(t);127>=r?n+=1:2047>=r?n+=2:55296<=r&&57343>=r?(n+=4,t++):n=65535>r?n+3:n+4}return n}function k(e,n){var t=P(n,!0,!1),r=D([e.evt]);t.onreadystatechange=function(){4===t.readyState&&(A(t.status)?null==y||y(r):null==w||w({status:t.status,message:t.statusText,events:r,willRetry:!1}))},t.send(E(r))}function x(e){for(var n=0;n<e;n++)U.shift();t&&T(q,JSON.stringify(U.slice(0,s)))}function I(e,n,t){e.onreadystatechange=function(){if(4===e.readyState)if(clearTimeout(r),A(e.status))x(n),null==y||y(t),C();else{var o=e.status;(o=!(A(o)||!h||!g.includes(o)&&p.includes(o)))||(Se.error("Status ".concat(e.status,", will not retry.")),x(n)),null==w||w({status:e.status,message:e.statusText,events:t,willRetry:o}),R=!1}};var r=setTimeout((function(){e.abort(),h||x(n),null==w||w({status:0,message:"timeout",events:t,willRetry:h}),R=!1}),l)}function C(e){for(void 0===e&&(e=!1);U.length&&"string"!=typeof U[0]&&"object"!=typeof U[0];)U.shift();if(U.length){if(!O(j))throw"No collector configured";if(R=!0,m&&!M){var n=P(m,!1,e);M=!0,n.timeout=l,n.onreadystatechange=function(){4===n.readyState&&C()},n.send()}else if(H){var r=function(e){for(var n=0,t=0;n<e.length&&!((t+=e[n].bytes)>=a);)n+=1;return n},o=void 0,i=void 0,u=void 0;if(Q(U)?(i=P(o=j,!0,e),u=r(U)):(i=P(o=L(U[0]),!1,e),u=1),Q(U)){if(0<(e=U.slice(0,u)).length){r=!1;var c=e.map((function(e){return e.evt}));if(z){var d=new Blob([E(D(c))],{type:"application/json"});try{r=navigator.sendBeacon(o,d)}catch(e){r=!1}}!0===r?(x(u),null==y||y(e),C()):(I(i,u,o=D(c)),i.send(E(o)))}}else I(i,u,[o]),i.send()}else if(f||Q(U))R=!1;else{i=new Image(1,1);var v=!0;i.onload=function(){v&&(v=!1,U.shift(),t&&T(q,JSON.stringify(U.slice(0,s))),C())},i.onerror=function(){v&&(R=v=!1)},i.src=L(U[0]),setTimeout((function(){v&&R&&(v=!1,C())}),l)}}else R=!1}function A(e){return 200<=e&&300>e}function P(e,n,t){var r=new XMLHttpRequest;for(var o in n?(r.open("POST",e,!t),r.setRequestHeader("Content-Type","application/json; charset=UTF-8")):r.open("GET",e,!t),r.withCredentials=v,f&&r.setRequestHeader("SP-Anonymous","*"),d)Object.prototype.hasOwnProperty.call(d,o)&&r.setRequestHeader(o,d[o]);return r}function E(e){return JSON.stringify({schema:"iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",data:e})}function D(e){for(var n=(new Date).getTime().toString(),t=0;t<e.length;t++)e[t].stm=n;return e}function L(e){return c?j+e.replace("?","?stm="+(new Date).getTime()+"&"):j+e}void 0===h&&(h=!0);var j,N,_,B,R=!1,U=[],M=!1,V=!0===(r="string"==typeof r?r.toLowerCase():r)||"beacon"===r||"true"===r,z=!(!(V&&window.navigator&&window.navigator.sendBeacon)||(N=window.navigator.userAgent,(B=(B=N).match("(iP.+; CPU .*OS (d+)[_d]*.*) AppleWebKit/"))&&B.length&&parseInt(B[0])<=13||function(e,n,t){return!(!(t=t.match("(Macintosh;.*Mac OS X (d+)_(d+)[_d]*.*) AppleWebKit/"))||!t.length)&&(parseInt(t[0])<=e||parseInt(t[0])===e&&parseInt(t[1])<=n)}(10,15,N)&&(_=N).match("Version/.* Safari/")&&!_.match("Chrom(e|ium)")))&&V,H=!(!window.XMLHttpRequest||!("withCredentials"in new XMLHttpRequest)),F="get"!==r&&H&&("post"===r||V),J=F?o:"/i",q="snowplowOutQueue_".concat(e,"_").concat(F?"post2":"get");if(V&&(d={}),i=t&&G()&&F&&i||1,t)try{var W=window.localStorage.getItem(q);U=W?JSON.parse(W):[]}catch(N){}Array.isArray(U)||(U=[]),n.outQueues.push(U),H&&1<i&&n.bufferFlushers.push((function(e){R||C(e)}));var Q=function(e){return"object"==typeof e[0]&&"evt"in e[0]};return{enqueueRequest:function(e,n){if(j=n+J,F){if((e=b(e)).bytes>=a)return Se.warn("Event ("+e.bytes+"B) too big, max is "+a),void k(e,j);U.push(e)}else{var r,c="?",l={co:!0,cx:!0},f=!0;for(r in e)e.hasOwnProperty(r)&&!l.hasOwnProperty(r)&&(f?f=!1:c+="&",c+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));for(var d in l)e.hasOwnProperty(d)&&l.hasOwnProperty(d)&&(c+="&"+d+"="+encodeURIComponent(e[d]));if(0<u&&(l=S(l=L(c)))>=u)return Se.warn("Event ("+l+"B) too big, max is "+u),void(H&&(e=b(e),k(e,n+o)));U.push(c)}n=!1,t&&(n=T(q,JSON.stringify(U.slice(0,s)))),R||n&&!(U.length>=i)||C()},executeQueue:function(){R||C()},setUseLocalStorage:function(e){t=e},setAnonymousTracking:function(e){f=e},setCollectorUrl:function(e){j=e+J},setBufferSize:function(e){i=e}}}(e,a,"localStorage"==Dn||"cookieAndLocalStorage"==Dn,u.eventMethod,pn,null!==(Ie=u.bufferSize)&&void 0!==Ie?Ie:1,null!==(Ae=u.maxPostBytes)&&void 0!==Ae?Ae:4e4,null!==(Pe=u.maxGetBytes)&&void 0!==Pe?Pe:0,null===(Oe=u.useStm)||void 0===Oe||Oe,null!==(Ee=u.maxLocalStorageQueueSize)&&void 0!==Ee?Ee:1e3,null!==(De=u.connectionTimeout)&&void 0!==De?De:5e3,On,null!==(Le=u.customHeaders)&&void 0!==Le?Le:{},null===(je=u.withCredentials)||void 0===je||je,null!==(Ne=u.retryStatusCodes)&&void 0!==Ne?Ne:[],(null!==(_e=u.dontRetryStatusCodes)&&void 0!==_e?_e:[]).concat([400,401,403,410,422]),u.idService,u.retryFailedRequests,u.onRequestSuccess,u.onRequestFailure),_n=!1,Bn=!1,Rn={enabled:!1,installed:!1,configurations:{}},Un=null!==(Re=null===(Be=u.contexts)||void 0===Be?void 0:Be.session)&&void 0!==Re&&Re,Mn=u.onSessionUpdateCallback,Vn=!1,zn="boolean"==typeof(an=u.useExtendedCrossDomainLinker||!1)?{useExtendedCrossDomainLinker:an}:{useExtendedCrossDomainLinker:!0,collectCrossDomainAttributes:an},Hn=zn.useExtendedCrossDomainLinker,Fn=zn.collectCrossDomainAttributes;u.hasOwnProperty("discoverRootDomain")&&u.discoverRootDomain&&(bn=U(kn,Tn));var Jn=Y(),qn=Jn.browserLanguage,Gn=Jn.resolution,Wn=Jn.colorDepth,Qn=Jn.cookiesEnabled;return un.setTrackerVersion(o),un.setTrackerNamespace(r),un.setAppId(mn),un.setPlatform(vn),un.addPayloadPair("cookie",Qn?"1":"0"),un.addPayloadPair("cs",cn),un.addPayloadPair("lang",qn),un.addPayloadPair("res",Gn),un.addPayloadPair("cd",Wn),g(),F(),u.crossDomainLinker&&l(u.crossDomainLinker),re(re({},{getDomainSessionIndex:function(){return jn},getPageViewId:$,getTabId:ee,newSession:function(){var e=J();if("0"===e[0]?(tn="none"!=Dn?Q(e):e[6],jn=e[3]):(jn++,tn=Q(e,{memorizedVisitCount:jn})),X(e),"none"!=Dn){var n=Z(e,Dn,En);b(e),w()&&Mn&&(Vn=!0,Mn(n))}Ln=(new Date).getTime()},getCookieName:function(e){return wn+e+"."+en},getUserId:function(){return rn},getDomainUserId:function(){return J()[1]},getDomainUserInfo:function(){return J()},setReferrerUrl:function(e){Fe=e},setCustomUrl:function(e){s();var n,t=fn;d(e)?Je=e:"/"===e.slice(0,1)?Je=d(t)+"://"+L(t)+e:(0<=(n=(t=f(t)).indexOf("?"))&&(t=t.slice(0,n)),(n=t.lastIndexOf("/"))!==t.length-1&&(t=t.slice(0,n+1)),Je=t+e)},setDocumentTitle:function(e){hn=document.title,qe=e},discardHashTag:function(e){Ge=e},discardBrace:function(e){We=e},setCookiePath:function(e){Sn=e,g()},setVisitorCookieTimeout:function(e){Cn=e},crossDomainLinker:function(e){l(e)},enableActivityTracking:function(e){Rn.configurations.pagePing||(Rn.enabled=!0,Rn.configurations.pagePing=oe(re(re({},e),{callback:ie})))},enableActivityTrackingCallback:function(e){Rn.configurations.callback||(Rn.enabled=!0,Rn.configurations.callback=oe(e))},disableActivityTracking:function(){ae("pagePing")},disableActivityTrackingCallback:function(){ae("callback")},updatePageActivity:function(){p()},setOptOutCookie:function(e){Qe=e},setUserId:function(e){rn=e},setUserIdFromLocation:function(e){s(),rn=B(e,fn)},setUserIdFromReferrer:function(e){s(),rn=B(e,dn)},setUserIdFromCookie:function(e){rn=z(e)},setCollectorUrl:function(e){gn=q(e),Nn.setCollectorUrl(gn)},setBufferSize:function(e){Nn.setBufferSize(e)},flushBuffer:function(e){void 0===e&&(e={}),Nn.executeQueue(),e.newBufferSize&&Nn.setBufferSize(e.newBufferSize)},trackPageView:function(e){void 0===e&&(e={}),ne(e)},preservePageViewId:function(){_n=!0},disableAnonymousTracking:function(e){u.anonymousTracking=!1,H(e),F(),Nn.executeQueue()},enableAnonymousTracking:function(e){var n;u.anonymousTracking=null===(n=e&&(null==e?void 0:e.options))||void 0===n||n,H(e),Pn||K()},clearUserData:V}),{id:e,namespace:r,core:un,sharedState:a})}(e,r,o,i,a,u);var s=re(re({},e),{addPlugin:function(e){var n,t;s.core.addPlugin(e),null===(t=(n=e.plugin).activateBrowserPlugin)||void 0===t||t.call(n,s)}});return c.forEach((function(e){var n;null===(n=e.activateBrowserPlugin)||void 0===n||n.call(e,s)})),s}function ee(e){return te(e,Pe)}function ne(){return Object.keys(Pe)}function te(e,n){for(var t=[],r=0;r<e.length;r++){var o=e[r];n.hasOwnProperty(o)?t.push(n[o]):Se.warn(o+" not configured")}return t}var re=function(){return re=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},re.apply(this,arguments)},oe={},ie="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(ie){var ae=new Uint8Array(16);oe=function(){return ie(ae),ae}}else{var ue=Array(16);oe=function(){for(var e,n=0;16>n;n++)0==(3&n)&&(e=4294967296*Math.random()),ue[n]=e>>>((3&n)<<3)&255;return ue}}for(var ce=[],se=0;256>se;++se)ce[se]=(se+256).toString(16).substr(1);var le,fe,de=function(e,n){return n=n||0,[ce[e[n++]],ce[e[n++]],ce[e[n++]],ce[e[n++]],"-",ce[e[n++]],ce[e[n++]],"-",ce[e[n++]],ce[e[n++]],"-",ce[e[n++]],ce[e[n++]],"-",ce[e[n++]],ce[e[n++]],ce[e[n++]],ce[e[n++]],ce[e[n++]],ce[e[n++]]].join("")},ve=oe,ge=0,pe=0,me=oe;oe=function(e,n,t){if(t=n&&t||0,"string"==typeof e&&(n="binary"===e?Array(16):null,e=null),(e=(e=e||{}).random||(e.rng||me)())[6]=15&e[6]|64,e[8]=63&e[8]|128,n)for(var r=0;16>r;++r)n[t+r]=e[r];return n||de(e)},oe.v1=function(e,n,t){t=n&&t||0;var r=n||[],o=(e=e||{}).node||le,i=void 0!==e.clockseq?e.clockseq:fe;if(null==o||null==i){var a=ve();null==o&&(o=le=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==i&&(i=fe=16383&(a[6]<<8|a[7]))}a=void 0!==e.msecs?e.msecs:(new Date).getTime();var u=void 0!==e.nsecs?e.nsecs:pe+1,c=a-ge+(u-pe)/1e4;if(0>c&&void 0===e.clockseq&&(i=i+1&16383),(0>c||a>ge)&&void 0===e.nsecs&&(u=0),1e4<=u)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");for(ge=a,pe=u,fe=i,e=(1e4*(268435455&(a+=122192928e5))+u)%4294967296,r[t++]=e>>>24&255,r[t++]=e>>>16&255,r[t++]=e>>>8&255,r[t++]=255&e,e=a/4294967296*1e4&268435455,r[t++]=e>>>8&255,r[t++]=255&e,r[t++]=e>>>24&15|16,r[t++]=e>>>16&255,r[t++]=i>>>8|128,r[t++]=255&i,i=0;6>i;++i)r[t+i]=o[i];return n||de(r)};var he,ye,we=oe.v4=oe,be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";(ye=he||(he={}))[ye.none=0]="none",ye[ye.error=1]="error",ye[ye.warn=2]="warn",ye[ye.debug=3]="debug",ye[ye.info=4]="info";var Se=function(e){return void 0===e&&(e=he.warn),{setLogLevel:function(n){e=he[n]?n:he.warn},warn:function(t,r){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=he.warn&&"undefined"!=typeof console&&(i="Snowplow: "+t,r?console.warn.apply(console,n([i+"\n",r],o,!1)):console.warn.apply(console,n([i],o,!1)))},error:function(t,r){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=he.error&&"undefined"!=typeof console&&(i="Snowplow: "+t+"\n",r?console.error.apply(console,n([i+"\n",r],o,!1)):console.error.apply(console,n([i],o,!1)))},debug:function(t){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];e>=he.debug&&"undefined"!=typeof console&&console.debug.apply(console,n(["Snowplow: "+t],r,!1))},info:function(t){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];e>=he.info&&"undefined"!=typeof console&&console.info.apply(console,n(["Snowplow: "+t],r,!1))}}}(),ke={},Te={};!function(){var e={rotl:function(e,n){return e<<n|e>>>32-n},rotr:function(e,n){return e<<32-n|e>>>n},endian:function(n){if(n.constructor==Number)return 16711935&e.rotl(n,8)|4278255360&e.rotl(n,24);for(var t=0;t<n.length;t++)n[t]=e.endian(n[t]);return n},randomBytes:function(e){for(var n=[];0<e;e--)n.push(Math.floor(256*Math.random()));return n},bytesToWords:function(e){for(var n=[],t=0,r=0;t<e.length;t++,r+=8)n[r>>>5]|=e[t]<<24-r%32;return n},wordsToBytes:function(e){for(var n=[],t=0;t<32*e.length;t+=8)n.push(e[t>>>5]>>>24-t%32&255);return n},bytesToHex:function(e){for(var n=[],t=0;t<e.length;t++)n.push((e[t]>>>4).toString(16)),n.push((15&e[t]).toString(16));return n.join("")},hexToBytes:function(e){for(var n=[],t=0;t<e.length;t+=2)n.push(parseInt(e.substr(t,2),16));return n},bytesToBase64:function(e){for(var n=[],t=0;t<e.length;t+=3)for(var r=e[t]<<16|e[t+1]<<8|e[t+2],o=0;4>o;o++)8*t+6*o<=8*e.length?n.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],t=0,r=0;t<e.length;r=++t%4)0!=r&&n.push(("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(t-1))&Math.pow(2,-2*r+8)-1)<<2*r|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(t))>>>6-2*r);return n}};Te=e}();var xe={utf8:{stringToBytes:function(e){return xe.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(xe.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var n=[],t=0;t<e.length;t++)n.push(255&e.charCodeAt(t));return n},bytesToString:function(e){for(var n=[],t=0;t<e.length;t++)n.push(String.fromCharCode(e[t]));return n.join("")}}},Ie=xe;!function(){var e=Te,n=Ie.utf8,t=Ie.bin,r=function(r,o){var i=e.wordsToBytes,a=r;a.constructor==String?a=n.stringToBytes(a):"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(a)?a=Array.prototype.slice.call(a,0):Array.isArray(a)||(a=a.toString()),r=e.bytesToWords(a);var u=8*a.length;a=[];var c=1732584193,s=-271733879,l=-1732584194,f=271733878,d=-1009589776;for(r[u>>5]|=128<<24-u%32,r[15+(u+64>>>9<<4)]=u,u=0;u<r.length;u+=16){for(var v=c,g=s,p=l,m=f,h=d,y=0;80>y;y++){if(16>y)a[y]=r[u+y];else{var w=a[y-3]^a[y-8]^a[y-14]^a[y-16];a[y]=w<<1|w>>>31}w=(c<<5|c>>>27)+d+(a[y]>>>0)+(20>y?1518500249+(s&l|~s&f):40>y?1859775393+(s^l^f):60>y?(s&l|s&f|l&f)-1894007588:(s^l^f)-899497514),d=f,f=l,l=s<<30|s>>>2,s=c,c=w}c+=v,s+=g,l+=p,f+=m,d+=h}return i=i.call(e,[c,s,l,f,d]),o&&o.asBytes?i:o&&o.asString?t.bytesToString(i):e.bytesToHex(i)};r._blocksize=16,r._digestsize=20,ke=r}();var Ce=ke,Ae={sessionId:!0,sourceId:!0,sourcePlatform:!1,userId:!1,reason:!1},Pe={},Oe=function(){this.outQueues=[],this.bufferFlushers=[],this.hasLoaded=!1,this.registeredOnLoadHandlers=[]};e.SharedState=Oe,e.addEventListener=_,e.addTracker=function(e,n,t,r,o,i){return Pe.hasOwnProperty(e)?null:(Pe[e]=$(e,n,t,r,o,i),Pe[e])},e.allTrackerNames=ne,e.allTrackers=function(){return Pe},e.attemptDeleteLocalStorage=x,e.attemptGetLocalStorage=k,e.attemptGetSessionStorage=I,e.attemptWriteLocalStorage=T,e.attemptWriteSessionStorage=C,e.cookie=z,e.createCrossDomainParameterValue=A,e.createSharedState=function(){function e(){var e;if(!n.hasLoaded)for(n.hasLoaded=!0,e=0;e<n.registeredOnLoadHandlers.length;e++)n.registeredOnLoadHandlers[e]();return!0}var n=new Oe,t=document,r=window;return t.visibilityState&&_(t,"visibilitychange",(function(){"hidden"==t.visibilityState&&n.bufferFlushers.forEach((function(e){e(!1)}))}),!1),_(r,"beforeunload",(function(){n.bufferFlushers.forEach((function(e){e(!1)}))}),!1),"loading"===document.readyState?(t.addEventListener?t.addEventListener("DOMContentLoaded",(function n(){t.removeEventListener("DOMContentLoaded",n,!1),e()})):t.attachEvent&&t.attachEvent("onreadystatechange",(function n(){"complete"===t.readyState&&(t.detachEvent("onreadystatechange",n),e())})),_(r,"load",e,!1)):e(),n},e.decorateQuerystring=R,e.deleteCookie=M,e.dispatchToTrackers=function(e,n){try{ee(null!=e?e:ne()).forEach(n)}catch(e){Se.error("Function failed",e)}},e.dispatchToTrackersInCollection=function(e,n,t){try{te(null!=e?e:Object.keys(n),n).forEach(t)}catch(e){Se.error("Function failed",e)}},e.findRootDomain=U,e.fixupDomain=j,e.fixupTitle=D,e.fixupUrl=W,e.fromQuerystring=B,e.getCookiesWithPrefix=V,e.getCssClasses=H,e.getFilterByClass=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var n=Object.prototype.hasOwnProperty.call(e,"allowlist"),t=J(e);return F(e,(function(e){e:{var r=0;for(e=H(e);r<e.length;r++)if(t[e[r]]){r=!0;break e}r=!1}return r===n}))},e.getFilterByName=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var n=e.hasOwnProperty("allowlist"),t=J(e);return F(e,(function(e){return e.name in t===n}))},e.getHostName=L,e.getReferrer=N,e.getTracker=function(e){return Pe.hasOwnProperty(e)?Pe[e]:(Se.warn(e+" not configured"),null)},e.getTrackers=ee,e.hasLocalStorage=q,e.hasSessionStorage=function(){try{return!!window.sessionStorage}catch(e){return!0}},e.isFunction=function(e){return!(!e||"function"!=typeof e)},e.isInteger=E,e.isString=O,e.isValueInArray=function(e,n){for(var t=0;t<n.length;t++)if(n[t]===e)return!0;return!1},e.localStorageAccessible=G,e.parseAndValidateFloat=function(e){return e=parseFloat(e),isNaN(e)?void 0:e},e.parseAndValidateInt=function(e){return e=parseInt(e),isNaN(e)?void 0:e},e.trackerExists=function(e){return Pe.hasOwnProperty(e)},e.urlSafeBase64Encode=P,Object.defineProperty(e,"__esModule",{value:!0})}));
"use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).snowplowBrowserTrackerCore={})}(this,(function(e){function n(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}function t(){var e,n={},t=[],r=[],i=[],a=function(e,t){null!=t&&""!==t&&(n[e]=t)};return{add:a,addDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&a(n,e[n])},addJson:function(e,n,i){i&&o(i)&&(e={keyIfEncoded:e,keyIfNotEncoded:n,json:i},r.push(e),t.push(e))},addContextEntity:function(e){i.push(e)},getPayload:function(){return n},getJson:function(){return t},withJsonProcessor:function(n){e=n},build:function(){return null==e||e(this,r,i),n}}}function r(e){return function(t,r,o){for(var i=function(n,r,o){if(n=JSON.stringify(n),e){if(o=t.add,n){var i=0,a=0,u=[];if(n){n=unescape(encodeURIComponent(n));do{var c=n.charCodeAt(i++),s=n.charCodeAt(i++),l=n.charCodeAt(i++),f=c<<16|s<<8|l;c=f>>18&63,s=f>>12&63,l=f>>6&63,f&=63,u[a++]=be.charAt(c)+be.charAt(s)+be.charAt(l)+be.charAt(f)}while(i<n.length);i=u.join(""),n=((n=n.length%3)?i.slice(0,n-3):i)+"===".slice(n||3)}n=n.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o.call(t,r,n)}else t.add(o,n)},a=function(n,r){if(!n){var o=t.getPayload();if(e?o.cx:o.co){var i=(n=JSON).parse;if(e){if(o=o.cx){switch(4-o.length%4){case 2:o+="==";break;case 3:o+="="}o=function(e){var n,t=0,r=0,o="",i=[];if(!e)return e;e+="";do{var a=be.indexOf(e.charAt(t++)),u=be.indexOf(e.charAt(t++));o=be.indexOf(e.charAt(t++));var c=be.indexOf(e.charAt(t++)),s=a<<18|u<<12|o<<6|c;a=s>>16&255,u=s>>8&255,s&=255,i[r++]=64===o?String.fromCharCode(a):64===c?String.fromCharCode(a,u):String.fromCharCode(a,u,s)}while(t<e.length);return o=i.join(""),n=o.replace(/\0+$/,""),decodeURIComponent(n.split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}(o=o.replace(/-/g,"+").replace(/_/g,"/"))}}else o=o.co;n=i.call(n,o)}else n=void 0}return n?n.data=n.data.concat(r.data):n=r,n},u=void 0,c=0;c<r.length;c++){var s=r[c];"cx"===s.keyIfEncoded?u=a(u,s.json):i(s.json,s.keyIfEncoded,s.keyIfNotEncoded)}r.length=0,o.length&&(u=a(u,r={schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:n([],o,!0)}),o.length=0),u&&i(u,"cx","co")}}function o(e){if(!i(e))return!1;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))return!0;return!1}function i(e){return null!=e&&(e.constructor==={}.constructor||e.constructor===[].constructor)}function a(){var e=[],n=[];return{getGlobalPrimitives:function(){return e},getConditionalProviders:function(){return n},addGlobalContexts:function(t){for(var r=[],o=[],i=0;i<t.length;i++){var a=t[i];m(a)?r.push(a):v(a)&&o.push(a)}e=e.concat(o),n=n.concat(r)},clearGlobalContexts:function(){n=[],e=[]},removeGlobalContexts:function(t){for(var r=function(t){m(t)?n=n.filter((function(e){return JSON.stringify(e)!==JSON.stringify(t)})):v(t)&&(e=e.filter((function(e){return JSON.stringify(e)!==JSON.stringify(t)})))},o=0;o<t.length;o++)r(t[o])},getApplicableContexts:function(t){e:{for(var r=0,o=t.getJson();r<o.length;r++){var i=o[r];if("ue_px"===i.keyIfEncoded&&"object"==typeof i.json.data&&"string"==typeof(i=i.json.data.schema)){r=i;break e}}r=""}i="string"==typeof(o=t.getPayload().e)?o:"",o=[];var a=b(e,t,i,r);return o.push.apply(o,a),t=function(e,n,t,r){var o;return e=w(e).map((function(e){e:{if(g(e)){var o=e[0],i=!1;try{i=o({event:n.getPayload(),eventType:t,eventSchema:r})}catch(e){i=!1}if(!0===i){e=b(e[1],n,t,r);break e}}else if(p(e)&&function(e,n){var t=0,r=0,o=e.accept;return Array.isArray(o)?e.accept.some((function(e){return h(e,n)}))&&r++:"string"==typeof o&&h(o,n)&&r++,o=e.reject,Array.isArray(o)?e.reject.some((function(e){return h(e,n)}))&&t++:"string"==typeof o&&h(o,n)&&t++,0<r&&0===t}(e[0],r)){e=b(e[1],n,t,r);break e}e=[]}if(e&&0!==e.length)return e})),(o=[]).concat.apply(o,e.filter((function(e){return null!=e&&e.filter(Boolean)})))}(n,t,i,r),o.push.apply(o,t),o}}}function u(e){return!!((e=e.split("."))&&1<e.length)&&function(e){if("*"===e[0]||"*"===e[1])return!1;if(0<e.slice(2).length){var n=!1,t=0;for(e=e.slice(2);t<e.length;t++)if("*"===e[t])n=!0;else if(n)return!1;return!0}return 2==e.length}(e)}function c(e){if(null!==(e=/^iglu:((?:(?:[a-zA-Z0-9-_]+|\*).)+(?:[a-zA-Z0-9-_]+|\*))\/([a-zA-Z0-9-_.]+|\*)\/jsonschema\/([1-9][0-9]*|\*)-(0|[1-9][0-9]*|\*)-(0|[1-9][0-9]*|\*)$/.exec(e))&&u(e[1]))return e.slice(1,6)}function s(e){if(e=c(e)){var n=e[0];return 5===e.length&&u(n)}return!1}function l(e){return function(e){return Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))}(e)?e.every((function(e){return s(e)})):"string"==typeof e&&s(e)}function f(e){return!!(o(e)&&"schema"in e&&"data"in e)&&("string"==typeof e.schema&&"object"==typeof e.data)}function d(e){return"function"==typeof e&&1>=e.length}function v(e){return d(e)||f(e)}function g(e){return!(!Array.isArray(e)||2!==e.length)&&(Array.isArray(e[1])?d(e[0])&&e[1].every(v):d(e[0])&&v(e[1]))}function p(e){return!(!Array.isArray(e)||2!==e.length)&&(!!function(e){var n=0;if(null!=e&&"object"==typeof e&&!Array.isArray(e)){if(Object.prototype.hasOwnProperty.call(e,"accept")){if(!l(e.accept))return!1;n+=1}if(Object.prototype.hasOwnProperty.call(e,"reject")){if(!l(e.reject))return!1;n+=1}return 0<n&&2>=n}return!1}(e[0])&&(Array.isArray(e[1])?e[1].every(v):v(e[1])))}function m(e){return g(e)||p(e)}function h(e,n){if(!s(e))return!1;if(e=c(e),n=null!==(n=/^iglu:([a-zA-Z0-9-_.]+)\/([a-zA-Z0-9-_]+)\/jsonschema\/([1-9][0-9]*)-(0|[1-9][0-9]*)-(0|[1-9][0-9]*)$/.exec(n))?n.slice(1,6):void 0,e&&n){if(!function(e,n){if(n=n.split("."),e=e.split("."),n&&e){if(n.length!==e.length)return!1;for(var t=0;t<e.length;t++)if(!y(n[t],e[t]))return!1;return!0}return!1}(e[0],n[0]))return!1;for(var t=1;5>t;t++)if(!y(e[t],n[t]))return!1;return!0}return!1}function y(e,n){return e&&n&&"*"===e||e===n}function w(e){return Array.isArray(e)?e:[e]}function b(e,n,t,r){var o;return e=w(e).map((function(e){e:if(f(e))e=[e];else{if(d(e)){n:{var o=void 0;try{if(o=e({event:n.getPayload(),eventType:t,eventSchema:r}),Array.isArray(o)&&o.every(f)||f(o)){var i=o;break n}i=void 0;break n}catch(e){}i=void 0}if(f(i)){e=[i];break e}if(Array.isArray(i)){e=i;break e}}e=void 0}if(e&&0!==e.length)return e})),(o=[]).concat.apply(o,e.filter((function(e){return null!=e&&e.filter(Boolean)})))}function S(e){void 0===e&&(e={});var t,o,u,c,s,l,f,d=e.base64,v=e.corePlugins,g=null!=v?v:[];t=null==d||d,o=g,u=e.callback,c=function(e){return{addPluginContexts:function(t){var r=t?n([],t,!0):[];return e.forEach((function(e){try{e.contexts&&r.push.apply(r,e.contexts())}catch(e){Se.error("Error adding plugin contexts",e)}})),r}}}(o),s=a(),l=t,f={};var p=re(re({},e={track:function(e,n,t){e.withJsonProcessor(r(l)),e.add("eid",we.v4()),e.addDict(f),t=function(e){return null==e?{type:"dtm",value:(new Date).getTime()}:"number"==typeof e?{type:"dtm",value:e}:"ttm"===e.type?{type:"ttm",value:e.value}:{type:"dtm",value:e.value||(new Date).getTime()}}(t),e.add(t.type,t.value.toString()),n=function(e,n){e=s.getApplicableContexts(e);var t=[];return n&&n.length&&t.push.apply(t,n),e&&e.length&&t.push.apply(t,e),t}(e,c.addPluginContexts(n)),void 0!==(n=n&&n.length?{schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:n}:void 0)&&e.addJson("cx","co",n),o.forEach((function(n){try{n.beforeTrack&&n.beforeTrack(e)}catch(e){Se.error("Plugin beforeTrack",e)}})),"function"==typeof u&&u(e);var i=e.build();return o.forEach((function(e){try{e.afterTrack&&e.afterTrack(i)}catch(e){Se.error("Plugin afterTrack",e)}})),i},addPayloadPair:function(e,n){f[e]=n},getBase64Encoding:function(){return l},setBase64Encoding:function(e){l=e},addPayloadDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(f[n]=e[n])},resetPayloadPairs:function(e){f=i(e)?e:{}},setTrackerVersion:function(e){f.tv=e},setTrackerNamespace:function(e){f.tna=e},setAppId:function(e){f.aid=e},setPlatform:function(e){f.p=e},setUserId:function(e){f.uid=e},setScreenResolution:function(e,n){f.res=e+"x"+n},setViewport:function(e,n){f.vp=e+"x"+n},setColorDepth:function(e){f.cd=e},setTimezone:function(e){f.tz=e},setLang:function(e){f.lang=e},setIpAddress:function(e){f.ip=e},setUseragent:function(e){f.ua=e},addGlobalContexts:function(e){s.addGlobalContexts(e)},clearGlobalContexts:function(){s.clearGlobalContexts()},removeGlobalContexts:function(e){s.removeGlobalContexts(e)}}),{addPlugin:function(e){var n,t;e=e.plugin,g.push(e),null===(n=e.logger)||void 0===n||n.call(e,Se),null===(t=e.activateCorePlugin)||void 0===t||t.call(e,p)}});return null==g||g.forEach((function(e){var n,t;null===(n=e.logger)||void 0===n||n.call(e,Se),null===(t=e.activateCorePlugin)||void 0===t||t.call(e,p)})),p}function k(e){try{var n=window.localStorage,t=n.getItem(e+".expires");if(null===t||+t>Date.now())return n.getItem(e);n.removeItem(e),n.removeItem(e+".expires")}catch(e){}}function T(e,n,t){void 0===t&&(t=63072e3);try{var r=window.localStorage,o=Date.now()+1e3*t;return r.setItem("".concat(e,".expires"),o.toString()),r.setItem(e,n),!0}catch(e){return!1}}function x(e){try{var n=window.localStorage;return n.removeItem(e),n.removeItem(e+".expires"),!0}catch(e){return!1}}function I(e){try{return window.sessionStorage.getItem(e)}catch(e){}}function C(e,n){try{return window.sessionStorage.setItem(e,n),!0}catch(e){return!1}}function A(e,n,t){var r,o=(new Date).getTime();n=re(re({},Ae),n);var i=t.domainUserId,a=t.userId,u=t.sessionId,c=t.sourceId,s=t.sourcePlatform,l=t.event,f=l.currentTarget;return l="function"==typeof n.reason?n.reason(l):null===(r=null==f?void 0:f.textContent)||void 0===r?void 0:r.trim(),e?[i,o,n.sessionId&&u,n.userId&&P(a||""),n.sourceId&&P(c||""),n.sourcePlatform&&s,n.reason&&P(l||"")].map((function(e){return e||""})).join(".").replace(/([.]*$)/,""):t.domainUserId+"."+o}function P(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function O(e){return!(!e||"string"!=typeof e.valueOf())}function E(e){return Number.isInteger&&Number.isInteger(e)||"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function D(e){if(!O(e)){e=e.text||"";var n=document.getElementsByTagName("title");n&&null!=n[0]&&(e=n[0].text)}return e}function L(e){var n=/^(?:(?:https?|ftp):)\/*(?:[^@]+@)?([^:/#]+)/.exec(e);return n?n[1]:e}function j(e){var n=e.length;return"."===e.charAt(--n)&&(e=e.slice(0,n)),"*."===e.slice(0,2)&&(e=e.slice(1)),e}function N(e){var n=window,t=B("referrer",n.location.href)||B("referer",n.location.href);if(t)return t;if(e)return e;try{if(n.top)return n.top.document.referrer;if(n.parent)return n.parent.document.referrer}catch(e){}return document.referrer}function _(e,n,t,r){return e.addEventListener?(e.addEventListener(n,t,r),!0):e.attachEvent?e.attachEvent("on"+n,t):void(e["on"+n]=t)}function B(e,n){return(e=new RegExp("^[^#]*[?&]"+e+"=([^&#]*)").exec(n))?decodeURIComponent(e[1].replace(/\+/g," ")):null}function R(e,n,t){t=n+"="+t;var r=(e=e.split("#"))[0].split("?"),o=r.shift();if(r=r.join("?")){for(var i=!0,a=r.split("&"),u=0;u<a.length;u++)if(a[u].substr(0,n.length+1)===n+"="){i=!1,a[u]=t,r=a.join("&");break}i&&(r=t+"&"+r)}else r=t;return e[0]=o+"?"+r,e.join("#")}function U(e,n){for(var t=window.location.hostname,r="_sp_root_domain_test_"+(new Date).getTime(),o="_test_value_"+(new Date).getTime(),i=t.split("."),a=i.length-2;0<=a;a--){var u=i.slice(a).join(".");if(z(r,o,0,"/",u,e,n),z(r)===o){for(M(r,u,e,n),t=V("_sp_root_domain_test_"),r=0;r<t.length;r++)M(t[r],u,e,n);return u}}return t}function M(e,n,t,r){z(e,"",-1,"/",n,t,r)}function V(e){for(var n=document.cookie.split("; "),t=[],r=0;r<n.length;r++)n[r].substring(0,e.length)===e&&t.push(n[r]);return t}function z(e,n,t,r,o,i,a){return 1<arguments.length?document.cookie=e+"="+encodeURIComponent(null!=n?n:"")+(t?"; Expires="+new Date(+new Date+1e3*t).toUTCString():"")+(r?"; Path="+r:"")+(o?"; Domain="+o:"")+(i?"; SameSite="+i:"")+(a?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}function H(e){return e.className.match(/\S+/g)||[]}function F(e,n){return e.hasOwnProperty("filter")&&e.filter?e.filter:n}function J(e){var n={};if(e=e.allowlist||e.denylist){Array.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++)n[e[t]]=!0}return n}function q(){try{return!!window.localStorage}catch(e){return!0}}function G(){if(!q())return!1;try{var e=window.localStorage;return e.setItem("modernizr","modernizr"),e.removeItem("modernizr"),!0}catch(e){return!1}}function W(e,n,t){return"translate.googleusercontent.com"===e?(""===t&&(t=n),e=L(n=null!=(e=(e=/^(?:https?|ftp)(?::\/*(?:[^?]+))([?][^#]+)/.exec(n))&&1<(null==e?void 0:e.length)?B("u",e[1]):null)?e:"")):"cc.bingj.com"!==e&&"webcache.googleusercontent.com"!==e||(e=L(n=document.links[0].href)),[e,n,t]}function Q(e,n){return void 0===n&&(n={memorizedVisitCount:1}),n=n.memorizedVisitCount,"0"===e[0]?(e[7]=e[6],e[5]=e[4],e[3]++):e[3]=n,n=we.v4(),e[6]=n,e[10]=0,e[8]="",e[9]=void 0,n}function X(e){e[4]=Math.round((new Date).getTime()/1e3)}function Z(e,n,t){var r=e[9];return{userId:t?"00000000-0000-0000-0000-000000000000":e[1],sessionId:e[6],eventIndex:e[10],sessionIndex:e[3],previousSessionId:t?null:e[7]||null,storageMechanism:"localStorage"==n?"LOCAL_STORAGE":"COOKIE_1",firstEventId:e[8]||null,firstEventTimestamp:r?new Date(r).toISOString():null}}function Y(){var e=K;if("innerWidth"in window)var n=window.innerWidth,t=window.innerHeight;else n=(t=document.documentElement||document.body).clientWidth,t=t.clientHeight;e=e(0<=n&&0<=t?n+"x"+t:null),n=K;var r=document.documentElement,o=document.body;return t=Math.max(r.clientWidth,r.offsetWidth,r.scrollWidth),r=Math.max(r.clientHeight,r.offsetHeight,r.scrollHeight,o?Math.max(o.offsetHeight,o.scrollHeight):0),{viewport:e,documentSize:n(t=isNaN(t)||isNaN(r)?"":t+"x"+r),resolution:K(screen.width+"x"+screen.height),colorDepth:screen.colorDepth,devicePixelRatio:window.devicePixelRatio,cookiesEnabled:window.navigator.cookieEnabled,online:window.navigator.onLine,browserLanguage:window.navigator.language||window.navigator.userLanguage,documentLanguage:document.documentElement.lang,webdriver:window.navigator.webdriver,deviceMemory:window.navigator.deviceMemory,hardwareConcurrency:window.navigator.hardwareConcurrency}}function K(e){return e&&e.split("x").map((function(e){return Math.floor(Number(e))})).join("x")}function $(e,r,o,i,a,u){void 0===u&&(u={});var c=[];e=function(e,r,o,i,a,u){function s(){(sn=W(window.location.hostname,window.location.href,N()))[1]!==fn&&(dn=N(fn)),ln=j(sn[0]),fn=sn[1]}function l(e){for(var n=function(e){return function(n){var t=n.currentTarget;n=A(e,Fn,{domainUserId:nn,userId:rn||void 0,sessionId:tn,sourceId:mn,sourcePlatform:vn,event:n}),null!=t&&t.href&&(t.href=R(t.href,"_sp",n))}}(Hn),t=0;t<document.links.length;t++){var r=document.links[t];!r.spDecorationEnabled&&e(r)&&(r.addEventListener("click",n,!0),r.addEventListener("mousedown",n,!0),r.spDecorationEnabled=!0)}}function f(e){if(Ge){var n=/#.*/;e=e.replace(n,"")}return We&&(n=/[{}]/g,e=e.replace(n,"")),e}function d(e){return(e=/^([a-z]+):/.exec(e))?e[1]:null}function v(e){return e=wn+e+"."+en,"localStorage"==Dn?k(e):"cookie"==Dn||"cookieAndLocalStorage"==Dn?z(e):void 0}function g(){s(),en=Ce((bn||ln)+(Sn||"/")).slice(0,4)}function p(){Xe=(new Date).getTime()}function m(){var e=h(),n=e[0];n<Ze?Ze=n:n>Ye&&(Ye=n),(e=e[1])<Ke?Ke=e:e>$e&&($e=e),p()}function h(){var e=document.documentElement;return e?[e.scrollLeft||window.pageXOffset,e.scrollTop||window.pageYOffset]:[0,0]}function y(){var e=h(),n=e[0];Ye=Ze=n,$e=Ke=e=e[1]}function w(){return P(wn+"ses."+en,"*",An)}function b(e){var t=wn+"id."+en,r=En;return e=n([],e,!0),r&&(e[1]="",e[7]=""),e.shift(),P(t,r=e.join("."),Cn)}function P(e,n,t){return!(En&&!Pn)&&("localStorage"==Dn?T(e,n,t):("cookie"==Dn||"cookieAndLocalStorage"==Dn)&&(z(e,n,t,Sn,bn,kn,Tn),-1!==document.cookie.indexOf("".concat(e,"="))))}function V(e){var n=wn+"id."+en,t=wn+"ses."+en;x(n),x(t),M(n,bn,kn,Tn),M(t,bn,kn,Tn),null!=e&&e.preserveSession||(tn=we.v4(),jn=1),null!=e&&e.preserveUser||(nn=En?"":we.v4(),rn=null)}function H(e){e&&e.stateStorageStrategy&&(u.stateStorageStrategy=e.stateStorageStrategy,Dn=Ue(u)),En=!!u.anonymousTracking,Pn=Me(u),On=Ve(u),Nn.setUseLocalStorage("localStorage"==Dn||"cookieAndLocalStorage"==Dn),Nn.setAnonymousTracking(On)}function F(){if(!En||Pn){var e="none"!=Dn&&!!v("ses"),n=J();if(n[1])var t=n[1];else t=En?"":we.v4(),n[1]=t;nn=t,tn=e?n[6]:Q(n),jn=n[3],"none"!=Dn&&(w(),X(n),b(n))}}function J(){return"none"==Dn?["1","",0,0,0,void 0,"","","",void 0,0]:function(e,n,t,r){var o=Math.round((new Date).getTime()/1e3);e?(e=e.split(".")).unshift("0"):e=["1",n,o,r,o,"",t],e[6]&&"undefined"!==e[6]||(e[6]=we.v4()),e[7]&&"undefined"!==e[7]||(e[7]=""),e[8]&&"undefined"!==e[8]||(e[8]=""),e[9]&&"undefined"!==e[9]||(e[9]=""),e[10]&&"undefined"!==e[10]||(e[10]=0);var i=function(e,n){return e=parseInt(e),isNaN(e)?n:e};return n=function(e){return e?i(e,void 0):void 0},[e[0],e[1],i(e[2],o),i(e[3],r),i(e[4],o),n(e[5]),e[6],e[7],e[8],n(e[9]),i(e[10],0)]}(v("id")||void 0,nn,tn,jn)}function q(e){return 0===e.indexOf("http")?e:("https:"===document.location.protocol?"https":"http")+"://"+e}function K(){_n&&null!=a.pageViewId||(a.pageViewId=we.v4())}function $(){return null==a.pageViewId&&(a.pageViewId=we.v4()),a.pageViewId}function ee(){if("none"===Dn||En||!He)return null;var e=I("_sp_tab_id");return e||(C("_sp_tab_id",we.v4()),e=I("_sp_tab_id")),e||null}function ne(e){var n=e.title,r=e.context,o=e.timestamp;if(e=e.contextCallback,s(),Bn&&K(),Bn=!0,hn=document.title,n=D((qe=n)||hn),un.track(function(e){var n=e.pageUrl,r=e.pageTitle;e=e.referrer;var o=t();return o.add("e","pv"),o.add("url",n),o.add("page",r),o.add("refr",e),o}({pageUrl:f(Je||fn),pageTitle:n,referrer:f(Fe||dn)}),(r||[]).concat(e?e():[]),o),o=new Date,n=!1,Rn.enabled&&!Rn.installed){n=Rn.installed=!0;var i={update:function(){if("undefined"!=typeof window&&"function"==typeof window.addEventListener){var e=!1,n=Object.defineProperty({},"passive",{get:function(){e=!0},set:function(){}}),t=function(){};window.addEventListener("testPassiveEventSupport",t,n),window.removeEventListener("testPassiveEventSupport",t,n),i.hasSupport=e}}};i.update();var a="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";Object.prototype.hasOwnProperty.call(i,"hasSupport")?_(document,a,p,{passive:!0}):_(document,a,p),y(),a=function(e,n){return void 0===n&&(n=p),function(e){return _(document,e,n)}},"click mouseup mousedown mousemove keypress keydown keyup touchend touchstart".split(" ").forEach(a(document)),["resize","focus","blur"].forEach(a(window)),a(window,m)("scroll")}if(Rn.enabled&&(yn||n))for(o in Xe=o.getTime(),o=void 0,Rn.configurations)(n=Rn.configurations[o])&&(window.clearInterval(n.activityInterval),te(n,r,e))}function te(e,n,t){var r=function(e,n){s(),e({context:n,pageViewId:$(),minXOffset:Ze,minYOffset:Ke,maxXOffset:Ye,maxYOffset:$e}),y()},o=function(){Xe+e.configHeartBeatTimer>(new Date).getTime()&&r(e.callback,(n||[]).concat(t?t():[]))};e.activityInterval=0===e.configMinimumVisitLength?window.setInterval(o,e.configHeartBeatTimer):window.setTimeout((function(){Xe+e.configMinimumVisitLength>(new Date).getTime()&&r(e.callback,(n||[]).concat(t?t():[])),e.activityInterval=window.setInterval(o,e.configHeartBeatTimer)}),e.configMinimumVisitLength)}function oe(e){var n=e.minimumVisitLength,t=e.heartbeatDelay;if(e=e.callback,E(n)&&E(t))return{configMinimumVisitLength:1e3*n,configHeartBeatTimer:1e3*t,callback:e};Se.error("Activity tracking minimumVisitLength & heartbeatDelay must be integers")}function ie(e){var n=e.context,r=e.minXOffset,o=e.minYOffset,i=e.maxXOffset,a=e.maxYOffset;(e=document.title)!==hn&&(hn=e,qe=void 0);var u=(e=un).track,c=f(Je||fn),s=D(qe||hn),l=f(Fe||dn);r=Math.round(r),i=Math.round(i),o=Math.round(o),a=Math.round(a);var d=t();d.add("e","pp"),d.add("url",c),d.add("page",s),d.add("refr",l),r&&!isNaN(Number(r))&&d.add("pp_mix",r.toString()),i&&!isNaN(Number(i))&&d.add("pp_max",i.toString()),o&&!isNaN(Number(o))&&d.add("pp_miy",o.toString()),a&&!isNaN(Number(a))&&d.add("pp_may",a.toString()),u.call(e,d,n)}function ae(e){var n=Rn.configurations[e];0===(null==n?void 0:n.configMinimumVisitLength)?window.clearTimeout(null==n?void 0:n.activityInterval):window.clearInterval(null==n?void 0:n.activityInterval),Rn.configurations[e]=void 0}var ue,ce,se,le,fe,de,ve,ge,pe,me,he,ye,be,ke,Te,xe,Ie,Ae,Pe,Oe,Ee,De,Le,je,Ne,_e,Be,Re;u.eventMethod=null!==(ue=u.eventMethod)&&void 0!==ue?ue:"post";var Ue=function(e){var n;return null!==(n=e.stateStorageStrategy)&&void 0!==n?n:"cookieAndLocalStorage"},Me=function(e){var n,t;return"boolean"!=typeof e.anonymousTracking&&(null!==(t=!0===(null===(n=e.anonymousTracking)||void 0===n?void 0:n.withSessionTracking))&&void 0!==t&&t)},Ve=function(e){var n,t;return"boolean"!=typeof e.anonymousTracking&&(null!==(t=!0===(null===(n=e.anonymousTracking)||void 0===n?void 0:n.withServerAnonymisation))&&void 0!==t&&t)},ze=null!==(se=null===(ce=null==u?void 0:u.contexts)||void 0===ce?void 0:ce.browser)&&void 0!==se&&se,He=null===(fe=null===(le=null==u?void 0:u.contexts)||void 0===le?void 0:le.webPage)||void 0===fe||fe;c.push({beforeTrack:function(e){var n=v("ses"),t=J(),r=0===t[10];if(on=!!Qe&&!!z(Qe),In||on)V();else{if("0"===t[0]?(tn=n||"none"==Dn?t[6]:Q(t),jn=t[3]):(new Date).getTime()-Ln>1e3*An&&(jn++,tn=Q(t,{memorizedVisitCount:jn})),X(t),0===t[10]){var o=e.build();t[8]=o.eid,o=o.dtm||o.ttm,t[9]=o?parseInt(o):void 0}t[10]+=1;var i=(o=Y()).documentSize;e.add("vp",o.viewport),e.add("ds",i),e.add("vid",Pn?jn:En?null:jn),e.add("sid",Pn?tn:En?null:tn),e.add("duid",En?null:t[1]),e.add("uid",En?null:rn),s(),e.add("refr",f(Fe||dn)),e.add("url",f(Je||fn)),o=Z(t,Dn,En),!Un||En&&!Pn||e.addContextEntity({schema:"iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2",data:o}),"none"!=Dn&&(b(t),e=w(),n&&!r||!e||!Mn||Vn||(Mn(o),Vn=!1)),Ln=(new Date).getTime()}}}),He&&c.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",data:{id:$()}}]}}),ze&&c.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/browser_context/jsonschema/2-0-0",data:re(re({},Y()),{tabId:ee()})}]}}),c.push.apply(c,null!==(de=u.plugins)&&void 0!==de?de:[]);var Fe,Je,qe,Ge,We,Qe,Xe,Ze,Ye,Ke,$e,en,nn,tn,rn,on,an,un=S({base64:u.encodeBase64,corePlugins:c,callback:function(e){In||on||Nn.enqueueRequest(e.build(),gn)}}),cn=document.characterSet||document.charset,sn=W(window.location.hostname,window.location.href,N()),ln=j(sn[0]),fn=sn[1],dn=sn[2],vn=null!==(ve=u.platform)&&void 0!==ve?ve:"web",gn=q(i),pn=null!==(ge=u.postPath)&&void 0!==ge?ge:"/com.snowplowanalytics.snowplow/tp2",mn=null!==(pe=u.appId)&&void 0!==pe?pe:"",hn=document.title,yn=null===(me=u.resetActivityTrackingOnPageView)||void 0===me||me,wn=null!==(he=u.cookieName)&&void 0!==he?he:"_sp_",bn=null!==(ye=u.cookieDomain)&&void 0!==ye?ye:void 0,Sn="/",kn=null!==(be=u.cookieSameSite)&&void 0!==be?be:"None",Tn=null===(ke=u.cookieSecure)||void 0===ke||ke,xn=window.navigator.doNotTrack||window.navigator.msDoNotTrack||window.doNotTrack,In=void 0!==u.respectDoNotTrack&&(u.respectDoNotTrack&&("yes"===xn||"1"===xn)),Cn=null!==(Te=u.cookieLifetime)&&void 0!==Te?Te:63072e3,An=null!==(xe=u.sessionCookieTimeout)&&void 0!==xe?xe:1800,Pn=Me(u),On=Ve(u),En=!!u.anonymousTracking,Dn=Ue(u),Ln=(new Date).getTime(),jn=1,Nn=function(e,n,t,r,o,i,a,u,c,s,l,f,d,v,g,p,m,h,y,w){function b(e){var n=Object.keys(e).map((function(n){return[n,e[n]]})).reduce((function(e,n){return e[n[0]]=n[1].toString(),e}),{});return{evt:n,bytes:S(JSON.stringify(n))}}function S(e){for(var n=0,t=0;t<e.length;t++){var r=e.charCodeAt(t);127>=r?n+=1:2047>=r?n+=2:55296<=r&&57343>=r?(n+=4,t++):n=65535>r?n+3:n+4}return n}function k(e,n){var t=P(n,!0,!1),r=D([e.evt]);t.onreadystatechange=function(){4===t.readyState&&(A(t.status)?null==y||y(r):null==w||w({status:t.status,message:t.statusText,events:r,willRetry:!1}))},t.send(E(r))}function x(e){for(var n=0;n<e;n++)U.shift();t&&T(q,JSON.stringify(U.slice(0,s)))}function I(e,n,t){e.onreadystatechange=function(){if(4===e.readyState)if(clearTimeout(r),A(e.status))x(n),null==y||y(t),C();else{var o=e.status;(o=!(A(o)||!h||!g.includes(o)&&p.includes(o)))||(Se.error("Status ".concat(e.status,", will not retry.")),x(n)),null==w||w({status:e.status,message:e.statusText,events:t,willRetry:o}),R=!1}};var r=setTimeout((function(){e.abort(),h||x(n),null==w||w({status:0,message:"timeout",events:t,willRetry:h}),R=!1}),l)}function C(e){for(void 0===e&&(e=!1);U.length&&"string"!=typeof U[0]&&"object"!=typeof U[0];)U.shift();if(U.length){if(!O(j))throw"No collector configured";if(R=!0,m&&!M){var n=P(m,!1,e);M=!0,n.timeout=l,n.onreadystatechange=function(){4===n.readyState&&C()},n.send()}else if(H){var r=function(e){for(var n=0,t=0;n<e.length&&!((t+=e[n].bytes)>=a);)n+=1;return n},o=void 0,i=void 0,u=void 0;if(Q(U)?(i=P(o=j,!0,e),u=r(U)):(i=P(o=L(U[0]),!1,e),u=1),Q(U)){if(0<(e=U.slice(0,u)).length){r=!1;var c=e.map((function(e){return e.evt}));if(z){var d=new Blob([E(D(c))],{type:"application/json"});try{r=window.navigator.sendBeacon(o,d)}catch(e){r=!1}}!0===r?(x(u),null==y||y(e),C()):(I(i,u,o=D(c)),i.send(E(o)))}}else I(i,u,[o]),i.send()}else if(f||Q(U))R=!1;else{i=new Image(1,1);var v=!0;i.onload=function(){v&&(v=!1,U.shift(),t&&T(q,JSON.stringify(U.slice(0,s))),C())},i.onerror=function(){v&&(R=v=!1)},i.src=L(U[0]),setTimeout((function(){v&&R&&(v=!1,C())}),l)}}else R=!1}function A(e){return 200<=e&&300>e}function P(e,n,t){var r=new XMLHttpRequest;for(var o in n?(r.open("POST",e,!t),r.setRequestHeader("Content-Type","application/json; charset=UTF-8")):r.open("GET",e,!t),r.withCredentials=v,f&&r.setRequestHeader("SP-Anonymous","*"),d)Object.prototype.hasOwnProperty.call(d,o)&&r.setRequestHeader(o,d[o]);return r}function E(e){return JSON.stringify({schema:"iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",data:e})}function D(e){for(var n=(new Date).getTime().toString(),t=0;t<e.length;t++)e[t].stm=n;return e}function L(e){return c?j+e.replace("?","?stm="+(new Date).getTime()+"&"):j+e}void 0===h&&(h=!0);var j,N,_,B,R=!1,U=[],M=!1,V=!0===(r="string"==typeof r?r.toLowerCase():r)||"beacon"===r||"true"===r,z=!(!V||!window.navigator||"function"!=typeof window.navigator.sendBeacon||(N=window.navigator.userAgent,(B=(B=N).match("(iP.+; CPU .*OS (d+)[_d]*.*) AppleWebKit/"))&&B.length&&parseInt(B[0])<=13||function(e,n,t){return!(!(t=t.match("(Macintosh;.*Mac OS X (d+)_(d+)[_d]*.*) AppleWebKit/"))||!t.length)&&(parseInt(t[0])<=e||parseInt(t[0])===e&&parseInt(t[1])<=n)}(10,15,N)&&(_=N).match("Version/.* Safari/")&&!_.match("Chrom(e|ium)")))&&V,H=!(!window.XMLHttpRequest||!("withCredentials"in new XMLHttpRequest)),F="get"!==r&&H&&("post"===r||V),J=F?o:"/i",q="snowplowOutQueue_".concat(e,"_").concat(F?"post2":"get");if(V&&(d={}),i=t&&G()&&F&&i||1,t)try{var W=window.localStorage.getItem(q);U=W?JSON.parse(W):[]}catch(N){}Array.isArray(U)||(U=[]),n.outQueues.push(U),H&&1<i&&n.bufferFlushers.push((function(e){R||C(e)}));var Q=function(e){return"object"==typeof e[0]&&"evt"in e[0]};return{enqueueRequest:function(e,n){if(j=n+J,F){if((e=b(e)).bytes>=a)return Se.warn("Event ("+e.bytes+"B) too big, max is "+a),void k(e,j);U.push(e)}else{var r,c="?",l={co:!0,cx:!0},f=!0;for(r in e)e.hasOwnProperty(r)&&!l.hasOwnProperty(r)&&(f?f=!1:c+="&",c+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));for(var d in l)e.hasOwnProperty(d)&&l.hasOwnProperty(d)&&(c+="&"+d+"="+encodeURIComponent(e[d]));if(0<u&&(l=S(l=L(c)))>=u)return Se.warn("Event ("+l+"B) too big, max is "+u),void(H&&(e=b(e),k(e,n+o)));U.push(c)}n=!1,t&&(n=T(q,JSON.stringify(U.slice(0,s)))),R||n&&!(U.length>=i)||C()},executeQueue:function(){R||C()},setUseLocalStorage:function(e){t=e},setAnonymousTracking:function(e){f=e},setCollectorUrl:function(e){j=e+J},setBufferSize:function(e){i=e}}}(e,a,"localStorage"==Dn||"cookieAndLocalStorage"==Dn,u.eventMethod,pn,null!==(Ie=u.bufferSize)&&void 0!==Ie?Ie:1,null!==(Ae=u.maxPostBytes)&&void 0!==Ae?Ae:4e4,null!==(Pe=u.maxGetBytes)&&void 0!==Pe?Pe:0,null===(Oe=u.useStm)||void 0===Oe||Oe,null!==(Ee=u.maxLocalStorageQueueSize)&&void 0!==Ee?Ee:1e3,null!==(De=u.connectionTimeout)&&void 0!==De?De:5e3,On,null!==(Le=u.customHeaders)&&void 0!==Le?Le:{},null===(je=u.withCredentials)||void 0===je||je,null!==(Ne=u.retryStatusCodes)&&void 0!==Ne?Ne:[],(null!==(_e=u.dontRetryStatusCodes)&&void 0!==_e?_e:[]).concat([400,401,403,410,422]),u.idService,u.retryFailedRequests,u.onRequestSuccess,u.onRequestFailure),_n=!1,Bn=!1,Rn={enabled:!1,installed:!1,configurations:{}},Un=null!==(Re=null===(Be=u.contexts)||void 0===Be?void 0:Be.session)&&void 0!==Re&&Re,Mn=u.onSessionUpdateCallback,Vn=!1,zn="boolean"==typeof(an=u.useExtendedCrossDomainLinker||!1)?{useExtendedCrossDomainLinker:an}:{useExtendedCrossDomainLinker:!0,collectCrossDomainAttributes:an},Hn=zn.useExtendedCrossDomainLinker,Fn=zn.collectCrossDomainAttributes;u.hasOwnProperty("discoverRootDomain")&&u.discoverRootDomain&&(bn=U(kn,Tn));var Jn=Y(),qn=Jn.browserLanguage,Gn=Jn.resolution,Wn=Jn.colorDepth,Qn=Jn.cookiesEnabled;return un.setTrackerVersion(o),un.setTrackerNamespace(r),un.setAppId(mn),un.setPlatform(vn),un.addPayloadPair("cookie",Qn?"1":"0"),un.addPayloadPair("cs",cn),un.addPayloadPair("lang",qn),un.addPayloadPair("res",Gn),un.addPayloadPair("cd",Wn),g(),F(),u.crossDomainLinker&&l(u.crossDomainLinker),re(re({},{getDomainSessionIndex:function(){return jn},getPageViewId:$,getTabId:ee,newSession:function(){var e=J();if("0"===e[0]?(tn="none"!=Dn?Q(e):e[6],jn=e[3]):(jn++,tn=Q(e,{memorizedVisitCount:jn})),X(e),"none"!=Dn){var n=Z(e,Dn,En);b(e),w()&&Mn&&(Vn=!0,Mn(n))}Ln=(new Date).getTime()},getCookieName:function(e){return wn+e+"."+en},getUserId:function(){return rn},getDomainUserId:function(){return J()[1]},getDomainUserInfo:function(){return J()},setReferrerUrl:function(e){Fe=e},setCustomUrl:function(e){s();var n,t=fn;d(e)?Je=e:"/"===e.slice(0,1)?Je=d(t)+"://"+L(t)+e:(0<=(n=(t=f(t)).indexOf("?"))&&(t=t.slice(0,n)),(n=t.lastIndexOf("/"))!==t.length-1&&(t=t.slice(0,n+1)),Je=t+e)},setDocumentTitle:function(e){hn=document.title,qe=e},discardHashTag:function(e){Ge=e},discardBrace:function(e){We=e},setCookiePath:function(e){Sn=e,g()},setVisitorCookieTimeout:function(e){Cn=e},crossDomainLinker:function(e){l(e)},enableActivityTracking:function(e){Rn.configurations.pagePing||(Rn.enabled=!0,Rn.configurations.pagePing=oe(re(re({},e),{callback:ie})))},enableActivityTrackingCallback:function(e){Rn.configurations.callback||(Rn.enabled=!0,Rn.configurations.callback=oe(e))},disableActivityTracking:function(){ae("pagePing")},disableActivityTrackingCallback:function(){ae("callback")},updatePageActivity:function(){p()},setOptOutCookie:function(e){Qe=e},setUserId:function(e){rn=e},setUserIdFromLocation:function(e){s(),rn=B(e,fn)},setUserIdFromReferrer:function(e){s(),rn=B(e,dn)},setUserIdFromCookie:function(e){rn=z(e)},setCollectorUrl:function(e){gn=q(e),Nn.setCollectorUrl(gn)},setBufferSize:function(e){Nn.setBufferSize(e)},flushBuffer:function(e){void 0===e&&(e={}),Nn.executeQueue(),e.newBufferSize&&Nn.setBufferSize(e.newBufferSize)},trackPageView:function(e){void 0===e&&(e={}),ne(e)},preservePageViewId:function(){_n=!0},disableAnonymousTracking:function(e){u.anonymousTracking=!1,H(e),F(),Nn.executeQueue()},enableAnonymousTracking:function(e){var n;u.anonymousTracking=null===(n=e&&(null==e?void 0:e.options))||void 0===n||n,H(e),Pn||K()},clearUserData:V}),{id:e,namespace:r,core:un,sharedState:a})}(e,r,o,i,a,u);var s=re(re({},e),{addPlugin:function(e){var n,t;s.core.addPlugin(e),null===(t=(n=e.plugin).activateBrowserPlugin)||void 0===t||t.call(n,s)}});return c.forEach((function(e){var n;null===(n=e.activateBrowserPlugin)||void 0===n||n.call(e,s)})),s}function ee(e){return te(e,Pe)}function ne(){return Object.keys(Pe)}function te(e,n){for(var t=[],r=0;r<e.length;r++){var o=e[r];n.hasOwnProperty(o)?t.push(n[o]):Se.warn(o+" not configured")}return t}var re=function(){return re=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},re.apply(this,arguments)},oe={},ie="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(ie){var ae=new Uint8Array(16);oe=function(){return ie(ae),ae}}else{var ue=Array(16);oe=function(){for(var e,n=0;16>n;n++)0==(3&n)&&(e=4294967296*Math.random()),ue[n]=e>>>((3&n)<<3)&255;return ue}}for(var ce=[],se=0;256>se;++se)ce[se]=(se+256).toString(16).substr(1);var le,fe,de=function(e,n){return n=n||0,[ce[e[n++]],ce[e[n++]],ce[e[n++]],ce[e[n++]],"-",ce[e[n++]],ce[e[n++]],"-",ce[e[n++]],ce[e[n++]],"-",ce[e[n++]],ce[e[n++]],"-",ce[e[n++]],ce[e[n++]],ce[e[n++]],ce[e[n++]],ce[e[n++]],ce[e[n++]]].join("")},ve=oe,ge=0,pe=0,me=oe;oe=function(e,n,t){if(t=n&&t||0,"string"==typeof e&&(n="binary"===e?Array(16):null,e=null),(e=(e=e||{}).random||(e.rng||me)())[6]=15&e[6]|64,e[8]=63&e[8]|128,n)for(var r=0;16>r;++r)n[t+r]=e[r];return n||de(e)},oe.v1=function(e,n,t){t=n&&t||0;var r=n||[],o=(e=e||{}).node||le,i=void 0!==e.clockseq?e.clockseq:fe;if(null==o||null==i){var a=ve();null==o&&(o=le=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==i&&(i=fe=16383&(a[6]<<8|a[7]))}a=void 0!==e.msecs?e.msecs:(new Date).getTime();var u=void 0!==e.nsecs?e.nsecs:pe+1,c=a-ge+(u-pe)/1e4;if(0>c&&void 0===e.clockseq&&(i=i+1&16383),(0>c||a>ge)&&void 0===e.nsecs&&(u=0),1e4<=u)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");for(ge=a,pe=u,fe=i,e=(1e4*(268435455&(a+=122192928e5))+u)%4294967296,r[t++]=e>>>24&255,r[t++]=e>>>16&255,r[t++]=e>>>8&255,r[t++]=255&e,e=a/4294967296*1e4&268435455,r[t++]=e>>>8&255,r[t++]=255&e,r[t++]=e>>>24&15|16,r[t++]=e>>>16&255,r[t++]=i>>>8|128,r[t++]=255&i,i=0;6>i;++i)r[t+i]=o[i];return n||de(r)};var he,ye,we=oe.v4=oe,be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";(ye=he||(he={}))[ye.none=0]="none",ye[ye.error=1]="error",ye[ye.warn=2]="warn",ye[ye.debug=3]="debug",ye[ye.info=4]="info";var Se=function(e){return void 0===e&&(e=he.warn),{setLogLevel:function(n){e=he[n]?n:he.warn},warn:function(t,r){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=he.warn&&"undefined"!=typeof console&&(i="Snowplow: "+t,r?console.warn.apply(console,n([i+"\n",r],o,!1)):console.warn.apply(console,n([i],o,!1)))},error:function(t,r){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=he.error&&"undefined"!=typeof console&&(i="Snowplow: "+t+"\n",r?console.error.apply(console,n([i+"\n",r],o,!1)):console.error.apply(console,n([i],o,!1)))},debug:function(t){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];e>=he.debug&&"undefined"!=typeof console&&console.debug.apply(console,n(["Snowplow: "+t],r,!1))},info:function(t){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];e>=he.info&&"undefined"!=typeof console&&console.info.apply(console,n(["Snowplow: "+t],r,!1))}}}(),ke={},Te={};!function(){var e={rotl:function(e,n){return e<<n|e>>>32-n},rotr:function(e,n){return e<<32-n|e>>>n},endian:function(n){if(n.constructor==Number)return 16711935&e.rotl(n,8)|4278255360&e.rotl(n,24);for(var t=0;t<n.length;t++)n[t]=e.endian(n[t]);return n},randomBytes:function(e){for(var n=[];0<e;e--)n.push(Math.floor(256*Math.random()));return n},bytesToWords:function(e){for(var n=[],t=0,r=0;t<e.length;t++,r+=8)n[r>>>5]|=e[t]<<24-r%32;return n},wordsToBytes:function(e){for(var n=[],t=0;t<32*e.length;t+=8)n.push(e[t>>>5]>>>24-t%32&255);return n},bytesToHex:function(e){for(var n=[],t=0;t<e.length;t++)n.push((e[t]>>>4).toString(16)),n.push((15&e[t]).toString(16));return n.join("")},hexToBytes:function(e){for(var n=[],t=0;t<e.length;t+=2)n.push(parseInt(e.substr(t,2),16));return n},bytesToBase64:function(e){for(var n=[],t=0;t<e.length;t+=3)for(var r=e[t]<<16|e[t+1]<<8|e[t+2],o=0;4>o;o++)8*t+6*o<=8*e.length?n.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],t=0,r=0;t<e.length;r=++t%4)0!=r&&n.push(("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(t-1))&Math.pow(2,-2*r+8)-1)<<2*r|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(t))>>>6-2*r);return n}};Te=e}();var xe={utf8:{stringToBytes:function(e){return xe.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(xe.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var n=[],t=0;t<e.length;t++)n.push(255&e.charCodeAt(t));return n},bytesToString:function(e){for(var n=[],t=0;t<e.length;t++)n.push(String.fromCharCode(e[t]));return n.join("")}}},Ie=xe;!function(){var e=Te,n=Ie.utf8,t=Ie.bin,r=function(r,o){var i=e.wordsToBytes,a=r;a.constructor==String?a=n.stringToBytes(a):"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(a)?a=Array.prototype.slice.call(a,0):Array.isArray(a)||(a=a.toString()),r=e.bytesToWords(a);var u=8*a.length;a=[];var c=1732584193,s=-271733879,l=-1732584194,f=271733878,d=-1009589776;for(r[u>>5]|=128<<24-u%32,r[15+(u+64>>>9<<4)]=u,u=0;u<r.length;u+=16){for(var v=c,g=s,p=l,m=f,h=d,y=0;80>y;y++){if(16>y)a[y]=r[u+y];else{var w=a[y-3]^a[y-8]^a[y-14]^a[y-16];a[y]=w<<1|w>>>31}w=(c<<5|c>>>27)+d+(a[y]>>>0)+(20>y?1518500249+(s&l|~s&f):40>y?1859775393+(s^l^f):60>y?(s&l|s&f|l&f)-1894007588:(s^l^f)-899497514),d=f,f=l,l=s<<30|s>>>2,s=c,c=w}c+=v,s+=g,l+=p,f+=m,d+=h}return i=i.call(e,[c,s,l,f,d]),o&&o.asBytes?i:o&&o.asString?t.bytesToString(i):e.bytesToHex(i)};r._blocksize=16,r._digestsize=20,ke=r}();var Ce=ke,Ae={sessionId:!0,sourceId:!0,sourcePlatform:!1,userId:!1,reason:!1},Pe={},Oe=function(){this.outQueues=[],this.bufferFlushers=[],this.hasLoaded=!1,this.registeredOnLoadHandlers=[]};e.SharedState=Oe,e.addEventListener=_,e.addTracker=function(e,n,t,r,o,i){return Pe.hasOwnProperty(e)?null:(Pe[e]=$(e,n,t,r,o,i),Pe[e])},e.allTrackerNames=ne,e.allTrackers=function(){return Pe},e.attemptDeleteLocalStorage=x,e.attemptGetLocalStorage=k,e.attemptGetSessionStorage=I,e.attemptWriteLocalStorage=T,e.attemptWriteSessionStorage=C,e.cookie=z,e.createCrossDomainParameterValue=A,e.createSharedState=function(){function e(){var e;if(!n.hasLoaded)for(n.hasLoaded=!0,e=0;e<n.registeredOnLoadHandlers.length;e++)n.registeredOnLoadHandlers[e]();return!0}var n=new Oe,t=document,r=window;return t.visibilityState&&_(t,"visibilitychange",(function(){"hidden"==t.visibilityState&&n.bufferFlushers.forEach((function(e){e(!1)}))}),!1),_(r,"beforeunload",(function(){n.bufferFlushers.forEach((function(e){e(!1)}))}),!1),"loading"===document.readyState?(t.addEventListener?t.addEventListener("DOMContentLoaded",(function n(){t.removeEventListener("DOMContentLoaded",n,!1),e()})):t.attachEvent&&t.attachEvent("onreadystatechange",(function n(){"complete"===t.readyState&&(t.detachEvent("onreadystatechange",n),e())})),_(r,"load",e,!1)):e(),n},e.decorateQuerystring=R,e.deleteCookie=M,e.dispatchToTrackers=function(e,n){try{ee(null!=e?e:ne()).forEach(n)}catch(e){Se.error("Function failed",e)}},e.dispatchToTrackersInCollection=function(e,n,t){try{te(null!=e?e:Object.keys(n),n).forEach(t)}catch(e){Se.error("Function failed",e)}},e.findRootDomain=U,e.fixupDomain=j,e.fixupTitle=D,e.fixupUrl=W,e.fromQuerystring=B,e.getCookiesWithPrefix=V,e.getCssClasses=H,e.getFilterByClass=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var n=Object.prototype.hasOwnProperty.call(e,"allowlist"),t=J(e);return F(e,(function(e){e:{var r=0;for(e=H(e);r<e.length;r++)if(t[e[r]]){r=!0;break e}r=!1}return r===n}))},e.getFilterByName=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var n=e.hasOwnProperty("allowlist"),t=J(e);return F(e,(function(e){return e.name in t===n}))},e.getHostName=L,e.getReferrer=N,e.getTracker=function(e){return Pe.hasOwnProperty(e)?Pe[e]:(Se.warn(e+" not configured"),null)},e.getTrackers=ee,e.hasLocalStorage=q,e.hasSessionStorage=function(){try{return!!window.sessionStorage}catch(e){return!0}},e.isFunction=function(e){return!(!e||"function"!=typeof e)},e.isInteger=E,e.isString=O,e.isValueInArray=function(e,n){for(var t=0;t<n.length;t++)if(n[t]===e)return!0;return!1},e.localStorageAccessible=G,e.parseAndValidateFloat=function(e){return e=parseFloat(e),isNaN(e)?void 0:e},e.parseAndValidateInt=function(e){return e=parseInt(e),isNaN(e)?void 0:e},e.trackerExists=function(e){return Pe.hasOwnProperty(e)},e.urlSafeBase64Encode=P,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map
{
"name": "@snowplow/browser-tracker-core",
"version": "3.20.0",
"version": "3.21.0",
"description": "Core functionality for Snowplow Browser trackers",

@@ -21,3 +21,3 @@ "homepage": "http://bit.ly/sp-js",

"dependencies": {
"@snowplow/tracker-core": "3.20.0",
"@snowplow/tracker-core": "3.21.0",
"sha1": "^1.1.1",

@@ -24,0 +24,0 @@ "tslib": "^2.3.1",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc