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
77
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 4.0.4 to 4.1.0

6

dist/index.module.d.ts

@@ -169,2 +169,8 @@ /*

/**
* Version of the application tracked as a context entity with all events.
* Can be a semver-like structure (e.g 1.1.0) or a Git commit SHA hash.
* Entity schema: iglu:com.snowplowanalytics.snowplow/application/jsonschema/1-0-0
*/
appVersion?: string;
/**
* The platform the event is being sent from

@@ -171,0 +177,0 @@ * @defaultValue web

@@ -169,2 +169,8 @@ /*

/**
* Version of the application tracked as a context entity with all events.
* Can be a semver-like structure (e.g 1.1.0) or a Git commit SHA hash.
* Entity schema: iglu:com.snowplowanalytics.snowplow/application/jsonschema/1-0-0
*/
appVersion?: string;
/**
* The platform the event is being sent from

@@ -171,0 +177,0 @@ * @defaultValue web

@@ -169,2 +169,8 @@ /*

/**
* Version of the application tracked as a context entity with all events.
* Can be a semver-like structure (e.g 1.1.0) or a Git commit SHA hash.
* Entity schema: iglu:com.snowplowanalytics.snowplow/application/jsonschema/1-0-0
*/
appVersion?: string;
/**
* The platform the event is being sent from

@@ -171,0 +177,0 @@ * @defaultValue web

4

dist/index.umd.min.js
/*!
* Core functionality for Snowplow Browser trackers v4.0.4 (http://bit.ly/sp-js)
* Core functionality for Snowplow Browser trackers v4.1.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,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).snowplowBrowserTrackerCore={})}(this,(function(e){function t(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,u)}c((r=r.apply(e,t||[])).next())}))}function n(e,t){function n(n){return function(c){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,n[0]&&(a=0)),a;)try{if(r=1,o&&(i=2&n[0]?o.return:n[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,n[1])).done)return i;switch(o=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,o=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=0<i.length&&i[i.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3]))a.label=n[1];else if(6===n[0]&&a.label<i[1])a.label=i[1],i=n;else{if(!(i&&a.label<i[2])){i[2]&&a.ops.pop(),a.trys.pop();continue}a.label=i[2],a.ops.push(n)}}n=t.call(e,a)}catch(e){n=[6,e],o=0}finally{r=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,c])}}var r,o,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=n(0),u.throw=n(1),u.return=n(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u}function r(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function o(){if(!we&&!(we="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return we(ke)}function i(e,t,n){if(Te.randomUUID&&!t&&!e)return Te.randomUUID();if((e=(e=e||{}).random||(e.rng||o)())[6]=15&e[6]|64,e[8]=63&e[8]|128,t){n=n||0;for(var r=0;16>r;++r)t[n+r]=e[r];return t}return function(e,t=0){return(me[e[t+0]]+me[e[t+1]]+me[e[t+2]]+me[e[t+3]]+"-"+me[e[t+4]]+me[e[t+5]]+"-"+me[e[t+6]]+me[e[t+7]]+"-"+me[e[t+8]]+me[e[t+9]]+"-"+me[e[t+10]]+me[e[t+11]]+me[e[t+12]]+me[e[t+13]]+me[e[t+14]]+me[e[t+15]]).toLowerCase()}(e)}function a(){var e,t={},n=[],r=[],o=[],i=function(e,n){null!=n&&""!==n&&(t[e]=n)};return{add:i,addDict:function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&i(t,e[t])},addJson:function(e,t,o){o&&c(o)&&(e={keyIfEncoded:e,keyIfNotEncoded:t,json:o},r.push(e),n.push(e))},addContextEntity:function(e){o.push(e)},getPayload:function(){return t},getJson:function(){return n},withJsonProcessor:function(t){e=t},build:function(){return null==e||e(this,r,o),t}}}function u(e){return function(t,n,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++]=xe.charAt(c)+xe.charAt(s)+xe.charAt(l)+xe.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 t,n=0,r=0,o="",i=[];if(!e)return e;e+="";do{var a=xe.indexOf(e.charAt(n++)),u=xe.indexOf(e.charAt(n++));o=xe.indexOf(e.charAt(n++));var c=xe.indexOf(e.charAt(n++)),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(n<e.length);return o=i.join(""),t=o.replace(/\0+$/,""),decodeURIComponent(t.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<n.length;c++){var s=n[c];"cx"===s.keyIfEncoded?u=a(u,s.json):i(s.json,s.keyIfEncoded,s.keyIfNotEncoded)}n.length=0,o.length&&(u=a(u,n={schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:r([],o,!0)}),o.length=0),u&&i(u,"cx","co")}}function c(e){if(!s(e))return!1;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function s(e){return null!=e&&(e.constructor==={}.constructor||e.constructor===[].constructor)}function l(){var e=[],t=[],n={},r={};return{getGlobalPrimitives:function(){return e.concat(Object.values(n))},getConditionalProviders:function(){return t.concat(Object.values(r))},addGlobalContexts:function(o){if(Array.isArray(o)){for(var i=[],a=[],u=0;u<o.length;u++){var c=o[u];b(c)?i.push(c):m(c)&&a.push(c)}e=e.concat(a),t=t.concat(i)}else for(i=0,o=Object.entries(o);i<o.length;i++)a=(c=o[i])[0],b(c=c[1])?r[a]=c:m(c)&&(n[a]=c)},clearGlobalContexts:function(){t=[],e=[],r={},n={}},removeGlobalContexts:function(o){for(var i=function(o){"string"==typeof o?(delete r[o],delete n[o]):b(o)?t=t.filter((function(e){return!C(o,e)})):m(o)&&(e=e.filter((function(e){return!C(o,e)})))},a=0;a<o.length;a++)i(o[a])},getApplicableContexts:function(o){e:{for(var i=0,a=o.getJson();i<a.length;i++){var u=a[i];if("ue_px"===u.keyIfEncoded&&"object"==typeof u.json.data&&"string"==typeof(u=u.json.data.schema)){i=u;break e}}i=""}u="string"==typeof(a=o.getPayload().e)?a:"",a=[];var c=x(e.concat(Object.values(n)),o,u,i);return a.push.apply(a,c),o=function(e,t,n,r){var o;return e=T(e).map((function(e){e:{if(y(e)){var o=e[0],i=!1;try{i=o({event:t.getPayload(),eventType:n,eventSchema:r})}catch(e){i=!1}if(!0===i){e=x(e[1],t,n,r);break e}}else if(w(e)&&function(e,t){var n=0,r=0,o=e.accept;return Array.isArray(o)?e.accept.some((function(e){return S(e,t)}))&&r++:"string"==typeof o&&S(o,t)&&r++,o=e.reject,Array.isArray(o)?e.reject.some((function(e){return S(e,t)}))&&n++:"string"==typeof o&&S(o,t)&&n++,0<r&&0===n}(e[0],r)){e=x(e[1],t,n,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)})))}(t.concat(Object.values(r)),o,u,i),a.push.apply(a,o),a}}}function f(e){return!!((e=e.split("."))&&1<e.length)&&function(e){if("*"===e[0]||"*"===e[1])return!1;if(0<e.slice(2).length){var t=!1,n=0;for(e=e.slice(2);n<e.length;n++)if("*"===e[n])t=!0;else if(t)return!1;return!0}return 2==e.length}(e)}function d(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))&&f(e[1]))return e.slice(1,6)}function v(e){if(e=d(e)){var t=e[0];return 5===e.length&&f(t)}return!1}function g(e){return function(e){return Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))}(e)?e.every((function(e){return v(e)})):"string"==typeof e&&v(e)}function p(e){return!!(c(e)&&"schema"in e&&"data"in e)&&("string"==typeof e.schema&&"object"==typeof e.data)}function h(e){return"function"==typeof e&&1>=e.length}function m(e){return h(e)||p(e)}function y(e){return!(!Array.isArray(e)||2!==e.length)&&(Array.isArray(e[1])?h(e[0])&&e[1].every(m):h(e[0])&&m(e[1]))}function w(e){return!(!Array.isArray(e)||2!==e.length)&&(!!function(e){var t=0;if(null!=e&&"object"==typeof e&&!Array.isArray(e)){if(Object.prototype.hasOwnProperty.call(e,"accept")){if(!g(e.accept))return!1;t+=1}if(Object.prototype.hasOwnProperty.call(e,"reject")){if(!g(e.reject))return!1;t+=1}return 0<t&&2>=t}return!1}(e[0])&&(Array.isArray(e[1])?e[1].every(m):m(e[1])))}function b(e){return y(e)||w(e)}function S(e,t){if(!v(e))return!1;if(e=d(e),t=null!==(t=/^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(t))?t.slice(1,6):void 0,e&&t){if(!function(e,t){if(t=t.split("."),e=e.split("."),t&&e){if(t.length!==e.length)return!1;for(var n=0;n<e.length;n++)if(!k(t[n],e[n]))return!1;return!0}return!1}(e[0],t[0]))return!1;for(var n=1;5>n;n++)if(!k(e[n],t[n]))return!1;return!0}return!1}function k(e,t){return e&&t&&"*"===e||e===t}function T(e){return Array.isArray(e)?e:[e]}function x(e,t,n,r){var o;return e=T(e).map((function(e){e:if(p(e))e=[e];else{if(h(e)){t:{var o=void 0;try{if(o=e({event:t.getPayload(),eventType:n,eventSchema:r}),Array.isArray(o)&&o.every(p)||p(o)){var i=o;break t}i=void 0;break t}catch(e){}i=void 0}if(p(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 A(e,t){return"function"==typeof e?e===t:JSON.stringify(e)===JSON.stringify(t)}function C(e,t){if(b(e)){if(!b(t))return!1;var n=e[1],r=t[1];return!!A(e[0],t[0])&&(Array.isArray(n)?!(!Array.isArray(r)||n.length!==r.length)&&n.reduce((function(e,t,n){return e&&A(t,r[n])}),!0):!Array.isArray(r)&&A(n,r))}return!!m(e)&&(!!m(t)&&A(e,t))}function P(e){void 0===e&&(e={});var t,n,o,a,c,f,d,v=e.base64,g=e.corePlugins,p=null!=g?g:[];t=null==v||v,n=p,o=e.callback,a=function(e){return{addPluginContexts:function(t){var n=t?r([],t,!0):[];return e.forEach((function(e){try{e.contexts&&n.push.apply(n,e.contexts())}catch(e){Ae.error("Error adding plugin contexts",e)}})),n}}}(n),c=l(),f=t,d={};var h=he(he({},e={track:function(e,t,r){if(e.withJsonProcessor(u(f)),e.add("eid",i()),e.addDict(d),r=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()}}(r),e.add(r.type,r.value.toString()),t=function(e,t){e=c.getApplicableContexts(e);var n=[];return t&&t.length&&n.push.apply(n,t),e&&e.length&&n.push.apply(n,e),n}(e,a.addPluginContexts(t)),void 0!==(t=t&&t.length?{schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:t}:void 0)&&e.addJson("cx","co",t),n.forEach((function(t){try{t.beforeTrack&&t.beforeTrack(e)}catch(e){Ae.error("Plugin beforeTrack",e)}})),!n.find((function(t){try{return t.filter&&!1===t.filter(e.build())}catch(e){return Ae.error("Plugin filter",e),!1}}))){"function"==typeof o&&o(e);var s=e.build();return n.forEach((function(e){try{e.afterTrack&&e.afterTrack(s)}catch(e){Ae.error("Plugin afterTrack",e)}})),s}},addPayloadPair:function(e,t){d[e]=t},getBase64Encoding:function(){return f},setBase64Encoding:function(e){f=e},addPayloadDict:function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(d[t]=e[t])},resetPayloadPairs:function(e){d=s(e)?e:{}},setTrackerVersion:function(e){d.tv=e},setTrackerNamespace:function(e){d.tna=e},setAppId:function(e){d.aid=e},setPlatform:function(e){d.p=e},setUserId:function(e){d.uid=e},setScreenResolution:function(e,t){d.res=e+"x"+t},setViewport:function(e,t){d.vp=e+"x"+t},setColorDepth:function(e){d.cd=e},setTimezone:function(e){d.tz=e},setLang:function(e){d.lang=e},setIpAddress:function(e){d.ip=e},setUseragent:function(e){d.ua=e},addGlobalContexts:function(e){c.addGlobalContexts(e)},clearGlobalContexts:function(){c.clearGlobalContexts()},removeGlobalContexts:function(e){c.removeGlobalContexts(e)}}),{addPlugin:function(e){var t,n;e=e.plugin,p.push(e),null===(t=e.logger)||void 0===t||t.call(e,Ae),null===(n=e.activateCorePlugin)||void 0===n||n.call(e,h)}});return null==p||p.forEach((function(e){var t,n;null===(t=e.logger)||void 0===t||t.call(e,Ae),null===(n=e.activateCorePlugin)||void 0===n||n.call(e,h)})),h}function I(e){var t=e.maxSize,n=void 0===t?1e3:t,o=r([],void 0===(e=e.events)?[]:e,!0),i=function(){return Promise.resolve(o.length)};return{count:i,add:function(e){for(o.push(e);o.length>n;)o.shift();return i()},removeHead:function(e){for(var t=0;t<e;t++)o.shift();return Promise.resolve()},iterator:function(){var e=0,t=r([],o,!0);return{next:function(){return e<t.length?Promise.resolve({value:t[e++],done:!1}):Promise.resolve({value:void 0,done:!0})}}},getAll:function(){return Promise.resolve(r([],o,!0))},getAllPayloads:function(){return Promise.resolve(o.map((function(e){return e.payload})))}}}function E(e){function t(){var e=S.reduce((function(e,t){return e+(k?t.getPOSTRequestBytesCount():t.getGETRequestBytesCount())}),0);return k&&(e+=88),e}function n(){var e=new Headers;return k&&e.append("Content-Type","application/json; charset=UTF-8"),v&&Object.keys(v).forEach((function(t){e.append(t,v[t])})),0<S.length&&S[0].getServerAnonymization()&&e.append("SP-Anonymous","*"),e}function r(){var e=u;return u.includes("://")||(e="".concat(s,"://").concat(u)),l&&(e="".concat(e,":").concat(l)),e+(k?m:"/i")}function o(e,t){return a(!1),d=new AbortController,f=setTimeout((function(){console.error("Request timed out"),f=void 0,a(!1,"Request timed out")}),null!=g?g:5e3),t=he({headers:n(),signal:d.signal,keepalive:h,credentials:b},t),new Request(e,t)}function i(){var e=function(e){for(var t=(new Date).getTime().toString(),n=0;n<e.length;n++)e[n].stm=t;return e}(S.map((function(e){return e.getPOSTRequestBody()})));return o(r(),{method:"POST",body:JSON.stringify({schema:"iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",data:e})})}function a(e,t){if(void 0!==f&&(clearTimeout(f),f=void 0),void 0!==d){var n=d;d=void 0,e||n.abort(t)}}var u=e.endpoint,c=e.protocol,s=void 0===c?"https":c,l=e.port;c=e.eventMethod;var f,d,v=e.customHeaders,g=e.connectionTimeout,p=e.keepalive,h=void 0!==p&&p,m=void 0===(p=e.postPath)?"/com.snowplowanalytics.snowplow/tp2":p,y=void 0===(p=e.useStm)||p,w=void 0===(p=e.maxPostBytes)?4e4:p,b=void 0===(e=e.credentials)?"include":e,S=[],k="post"===(void 0===c?"post":c).toLowerCase();return{addEvent:function(e){return!(0<S.length&&(0<S.length?S[0].getServerAnonymization():void 0)!==e.getServerAnonymization())&&(S.push(e),!0)},getEvents:function(){return S},toRequest:function(){if(0!==S.length){if(k)return i();if(1!==S.length)throw Error("Only one event can be sent in a GET request");return o(S[0].getGETRequestURL(r(),y),{method:"GET"})}},countBytes:t,countEvents:function(){return S.length},isFull:function(){return k?t()>=w:1<=S.length},closeRequest:a}}function O(e){for(var t=0,n=0;n<e.length;n++){var r=e.charCodeAt(n);127>=r?t+=1:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,n++):t=65535>r?t+3:t+4}return t}function L(e){function t(){return e.payload}function n(e){if(null===o){var t,n={co:!0,cx:!0},r=[];for(t in e)e.hasOwnProperty(t)&&!n[t]&&r.push(t+"="+encodeURIComponent(e[t]));for(var i in n)e.hasOwnProperty(i)&&n[i]&&r.push(i+"="+encodeURIComponent(e[i]));o="?"+r.join("&")}return o}function r(){return null===i&&(i=function(e){return Object.keys(e).map((function(t){return[t,e[t]]})).reduce((function(e,t){return e[t[0]]=t[1].toString(),e}),{})}(t())),i}var o=null,i=null,a=null,u=null;return{getPayload:t,getServerAnonymization:function(){var t;return null!==(t=e.svrAnon)&&void 0!==t&&t},getGETRequestURL:function(e,r){var o=n(t());return r?e+o.replace("?","?stm="+(new Date).getTime()+"&"):e+o},getGETRequestBytesCount:function(){if(null===a){var e=n(t());a=O(e)}return a},getPOSTRequestBody:r,getPOSTRequestBytesCount:function(){return null===u&&(u=O(JSON.stringify(r()))),u}}}function D(e){function r(e,t){void 0!==C&&setTimeout((function(){try{null==C||C(e,t)}catch(e){Ae.error("Error in onRequestFailure",e)}}),0)}function o(e){return t(this,void 0,void 0,(function(){var t,o,i,a,u,c;return n(this,(function(n){switch(n.label){case 0:if(void 0===(t=e.toRequest()))throw Error("Empty batch");o=e.getEvents().map((function(e){return e.getPayload()})),n.label=1;case 1:return n.trys.push([1,4,,5]),[4,O(t)];case 2:return[4,(i=n.sent()).text()];case 3:return n.sent(),e.closeRequest(!0),i.ok?(function(e,t){void 0!==P&&setTimeout((function(){try{null==P||P(e,t)}catch(e){Ae.error("Error in onRequestSuccess",e)}}),0)}(o,i),[2,{success:!0,retry:!1,status:i.status}]):(a=function(e){return!(200<=e&&300>e||!A||!x.includes(e)&&T.includes(e))}(i.status),r({events:o,status:i.status,message:i.statusText,willRetry:a},i),[2,{success:!1,retry:a,status:i.status}]);case 4:return u=n.sent(),e.closeRequest(!1),c="string"==typeof u?u:u?u.message:"Unknown error",r({events:o,message:c,willRetry:!0}),[2,{success:!1,retry:!0}];case 5:return[2]}}))}))}function i(){return E({endpoint:s,protocol:v,port:g,eventMethod:f,customHeaders:y,connectionTimeout:b,keepalive:S,maxPostBytes:p,useStm:D,credentials:j,postPath:d})}function a(){return t(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return!k||R?[3,2]:(R=!0,e=new Request(k,{method:"GET"}),[4,O(e)]);case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}function u(){return t(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:if(B)return[3,5];B=!0,t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,c()];case 2:return t.sent(),[3,5];case 3:return e=t.sent(),Ae.error("Error sending events",e),[3,5];case 4:return B=!1,[7];case 5:return[2]}}))}))}function c(){return t(this,void 0,void 0,(function(){var e,t,r,u,s,l,f,d,v;return n(this,(function(n){switch(n.label){case 0:return[4,a()];case 1:n.sent(),e=i(),t=U.iterator(),n.label=2;case 2:return e.isFull()?[3,4]:[4,t.next()];case 3:return r=n.sent(),u=r.value,r.done||void 0===u?[3,4]:(s=L(u),e.addEvent(s)?[3,2]:[3,4]);case 4:return 0===e.countEvents()?[2]:[4,o(e)];case 5:return l=n.sent(),f=l.success,d=l.retry,v=l.status,!f&&d?[3,7]:(f||Ae.error("Status ".concat(v,", will not retry.")),[4,U.removeHead(e.countEvents())]);case 6:n.sent(),n.label=7;case 7:return f?[4,c()]:[3,9];case 8:n.sent(),n.label=9;case 9:return[2]}}))}))}var s=e.endpoint,l=e.eventMethod,f=void 0===l?"post":l,d=e.postPath,v=e.protocol,g=e.port,p=void 0===(l=e.maxPostBytes)?4e4:l,h=e.maxGetBytes,m=void 0===(l=e.bufferSize)?1:l,y=e.customHeaders,w=e.serverAnonymization,b=e.connectionTimeout,S=e.keepalive,k=e.idService,T=void 0===(l=e.dontRetryStatusCodes)?[]:l,x=void 0===(l=e.retryStatusCodes)?[]:l,A=void 0===(l=e.retryFailedRequests)||l,C=e.onRequestFailure,P=e.onRequestSuccess,O=void 0===(l=e.customFetch)?fetch:l,D=e.useStm,U=void 0===(l=e.eventStore)?I({}):l,j=e.credentials,R=!1,B=!1,N="post"===f.toLowerCase();return T=T.concat([400,401,403,410,422]),{flush:u,input:function(e){return t(this,void 0,void 0,(function(){var t,r,a;return n(this,(function(n){switch(n.label){case 0:e:{if(n=r=L(t={payload:e,svrAnon:void 0!==(n=w)&&n}),N){var c=(n=n.getPOSTRequestBytesCount()+88)>p;c&&Ae.warn("Event ("+n+"B) too big, max is "+p)}else{if(void 0===h){n=!1;break e}(c=(n=n.getGETRequestBytesCount())>h)&&Ae.warn("Event ("+n+"B) too big, max is "+h)}n=c}return n?((a=i()).addEvent(r),[4,o(a)]):[3,2];case 1:return n.sent(),[3,5];case 2:return[4,U.add(t)];case 3:return n.sent()>=m?[4,u()]:[3,5];case 4:n.sent(),n.label=5;case 5:return[2]}}))}))},setCollectorUrl:function(e){s=e},setAnonymousTracking:function(e){w=e},setBufferSize:function(e){m=e}}}function U(e){try{var t=window.localStorage,n=t.getItem(e+".expires");if(null===n||+n>Date.now())return t.getItem(e);t.removeItem(e),t.removeItem(e+".expires")}catch(e){}}function j(e,t,n){void 0===n&&(n=63072e3);try{var r=window.localStorage,o=Date.now()+1e3*n;return r.setItem("".concat(e,".expires"),o.toString()),r.setItem(e,t),!0}catch(e){return!1}}function R(e){try{var t=window.localStorage;return t.removeItem(e),t.removeItem(e+".expires"),!0}catch(e){return!1}}function B(e){try{return window.sessionStorage.getItem(e)}catch(e){}}function N(e,t){try{return window.sessionStorage.setItem(e,t),!0}catch(e){return!1}}function V(e,t,n){var r,o=(new Date).getTime();t=he(he({},De),t);var i=n.domainUserId,a=n.userId,u=n.sessionId,c=n.sourceId,s=n.sourcePlatform,l=n.event,f=l.currentTarget;return l="function"==typeof t.reason?t.reason(l):null===(r=null==f?void 0:f.textContent)||void 0===r?void 0:r.trim(),e?[i,o,t.sessionId&&u,t.userId&&_(a||""),t.sourceId&&_(c||""),t.sourcePlatform&&s,t.reason&&_(l||"")].map((function(e){return e||""})).join(".").replace(/([.]*$)/,""):n.domainUserId+"."+o}function _(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function z(e){return!(!e||"string"!=typeof e.valueOf())}function M(e){return Number.isInteger&&Number.isInteger(e)||"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function q(){if("object"==typeof Intl&&"function"==typeof Intl.DateTimeFormat)return(new Intl.DateTimeFormat).resolvedOptions().timeZone}function F(e){if(!z(e)){e=e.text||"";var t=document.getElementsByTagName("title");t&&null!=t[0]&&(e=t[0].text)}return e}function H(e){var t=/^(?:(?:https?|ftp):)\/*(?:[^@]+@)?([^:/#]+)/.exec(e);return t?t[1]:e}function G(e){var t=e.length;return"."===e.charAt(--t)&&(e=e.slice(0,t)),"*."===e.slice(0,2)&&(e=e.slice(1)),e}function J(e){var t=window,n=Z("referrer",t.location.href)||Z("referer",t.location.href);if(n)return n;if(e)return e;try{if(t.top)return t.top.document.referrer;if(t.parent)return t.parent.document.referrer}catch(e){}return document.referrer}function W(e,t,n,r){return e.addEventListener?(e.addEventListener(t,n,r),!0):e.attachEvent?e.attachEvent("on"+t,n):void(e["on"+t]=n)}function Z(e,t){return(e=new RegExp("^[^#]*[?&]"+e+"=([^&#]*)").exec(t))?decodeURIComponent(e[1].replace(/\+/g," ")):null}function Q(e,t,n){n=t+"="+n;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,t.length+1)===t+"="){i=!1,a[u]=n,r=a.join("&");break}i&&(r=n+"&"+r)}else r=n;return e[0]=o+"?"+r,e.join("#")}function X(e,t){for(var n=window.location.hostname,r="_sp_root_domain_test_"+(new Date).getTime(),o="_test_value_"+(new Date).getTime(),i=n.split("."),a=i.length-2;0<=a;a--){var u=i.slice(a).join(".");if($(r,o,0,"/",u,e,t),$(r)===o){for(Y(r,"/",u,e,t),n=K("_sp_root_domain_test_"),r=0;r<n.length;r++)Y(n[r],"/",u,e,t);return u}}return n}function Y(e,t,n,r,o){$(e,"",-1,t,n,r,o)}function K(e){for(var t=document.cookie.split("; "),n=[],r=0;r<t.length;r++)t[r].substring(0,e.length)===e&&n.push(t[r]);return n}function $(e,t,n,r,o,i,a){return 1<arguments.length?document.cookie=e+"="+encodeURIComponent(null!=t?t:"")+(n?"; Expires="+new Date(+new Date+1e3*n).toUTCString():"")+(r?"; Path="+r:"")+(o?"; Domain="+o:"")+(i?"; SameSite="+i:"")+(a?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}function ee(e){return e.className.match(/\S+/g)||[]}function te(e,t){return e.hasOwnProperty("filter")&&e.filter?e.filter:t}function ne(e){var t={};if(e=e.allowlist||e.denylist){Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++)t[e[n]]=!0}return t}function re(e,t){var n,r=null!==(n=e.eventStore)&&void 0!==n?n:function(e){function t(){return o?a().then((function(e){window.localStorage.setItem(i,JSON.stringify(e))})):Promise.resolve()}var n=e.maxLocalStorageQueueSize,r=void 0===n?1e3:n,o=void 0===(n=e.useLocalStorage)||n,i="snowplowOutQueue_".concat(e.trackerId),a=(e=function(){if(o){var e=window.localStorage.getItem(i);return e=e?JSON.parse(e):[],I({maxSize:r,events:e})}return I({maxSize:r})}()).getAll,u=e.add,c=e.count,s=e.removeHead;return{count:c,add:function(e){return u(e),t().then(c)},removeHead:function(e){return s(e),t()},iterator:e.iterator,getAll:a,getAllPayloads:e.getAllPayloads,setUseLocalStorage:function(e){o=e}}}(e);return e.eventStore=r,e=D(e),t.bufferFlushers.push(e.flush),{enqueueRequest:e.input,executeQueue:e.flush,setAnonymousTracking:e.setAnonymousTracking,setCollectorUrl:e.setCollectorUrl,setBufferSize:e.setBufferSize,setUseLocalStorage:function(e){r.hasOwnProperty("setUseLocalStorage")&&r.setUseLocalStorage(e)}}}function oe(e,t,n){return"translate.googleusercontent.com"===e?(""===n&&(n=t),e=H(t=null!=(e=(e=/^(?:https?|ftp)(?::\/*(?:[^?]+))([?][^#]+)/.exec(t))&&1<(null==e?void 0:e.length)?Z("u",e[1]):null)?e:"")):"cc.bingj.com"!==e&&"webcache.googleusercontent.com"!==e||(e=H(t=document.links[0].href)),[e,t,n]}function ie(e,t){return void 0===t&&(t={memorizedVisitCount:1}),t=t.memorizedVisitCount,"0"===e[0]?(e[7]=e[6],e[5]=e[4],e[3]++):e[3]=t,t=i(),e[6]=t,e[10]=0,e[8]="",e[9]=void 0,t}function ae(e){e[4]=Math.round((new Date).getTime()/1e3)}function ue(e,t,n){var r=e[9];return{userId:n?"00000000-0000-0000-0000-000000000000":e[1],sessionId:e[6],eventIndex:e[10],sessionIndex:e[3],previousSessionId:n?null:e[7]||null,storageMechanism:"localStorage"==t?"LOCAL_STORAGE":"COOKIE_1",firstEventId:e[8]||null,firstEventTimestamp:r?new Date(r).toISOString():null}}function ce(){return"ResizeObserver"in window?(Oe||(Oe=se()),function(){if(!Ue&&document&&document.body&&document.documentElement){Ue=!0;var e=new ResizeObserver((function(e){for(var t=0;t<e.length;t++){var n=e[t];n.target!==document.body&&n.target!==document.documentElement||(Oe=se())}}));e.observe(document.body),e.observe(document.documentElement)}}(),Oe):se()}function se(){var e=le;if("innerWidth"in window)var t=window.innerWidth,n=window.innerHeight;else t=(n=document.documentElement||document.body).clientWidth,n=n.clientHeight;e=e(Math.max(0,t)+je+Math.max(0,n)),t=le;var r=document.documentElement,o=document.body;return n=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:t(n=isNaN(n)||isNaN(r)?"":n+je+r),resolution:le(screen.width+je+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 le(e){return e&&e.split(je).map((function(e){return Math.floor(Number(e))})).join(je)}function fe(e,t,n,o,u,c){void 0===c&&(c={});var s=[];e=function(e,t,n,o,u,c){function l(){(tt=oe(window.location.hostname,window.location.href,J()))[1]!==rt&&(ot=J(rt)),nt=G(tt[0]),rt=tt[1]}function f(e){for(var t=function(e){return function(t){var n=t.currentTarget;t=V(e,Bt,{domainUserId:Ze,userId:Xe||void 0,sessionId:Qe,sourceId:at,sourcePlatform:it,event:t}),null!=n&&n.href&&(n.href=Q(n.href,"_sp",t))}}(Rt),n=0;n<document.links.length;n++){var r=document.links[n];!r.spDecorationEnabled&&e(r)&&(r.addEventListener("click",t,!0),r.addEventListener("mousedown",t,!0),r.spDecorationEnabled=!0)}}function d(e){if(_e){var t=/#.*/;e=e.replace(t,"")}return ze&&(t=/[{}]/g,e=e.replace(t,"")),e}function v(e){return(e=/^([a-z]+):/.exec(e))?e[1]:null}function g(e){return e=lt+e+"."+We,"localStorage"==Tt?U(e):"cookie"==Tt||"cookieAndLocalStorage"==Tt?Ue.getCookie(e):void 0}function p(){l(),We=Le((ft||nt)+(vt||"/")).slice(0,4)}function h(){qe=(new Date).getTime()}function m(){var e=y(),t=e[0];t<Fe?Fe=t:t>He&&(He=t),(e=e[1])<Ge?Ge=e:e>Je&&(Je=e),h()}function y(){var e=document.documentElement;return e?[e.scrollLeft||window.pageXOffset,e.scrollTop||window.pageYOffset]:[0,0]}function w(){var e=y(),t=e[0];He=Fe=t,Je=Ge=e=e[1]}function b(){return k(lt+"ses."+We,"*",wt)}function S(e){var t=lt+"id."+We,n=kt;return e=r([],e,!0),n&&(e[1]="",e[7]=""),e.shift(),k(t,n=e.join("."),yt)}function k(e,t,n){return!(kt&&!bt)&&("localStorage"==Tt?j(e,t,n):("cookie"==Tt||"cookieAndLocalStorage"==Tt)&&Ue.setCookie(e,t,n,vt,ft,gt,pt))}function T(e){var t=lt+"id."+We,n=lt+"ses."+We;R(t),R(n),Ue.deleteCookie(t,vt,ft,gt,pt),Ue.deleteCookie(n,vt,ft,gt,pt),null!=e&&e.preserveSession||(Qe=i(),At=1),null!=e&&e.preserveUser||(Ze=kt?"":i(),Xe=null)}function x(e){e&&e.stateStorageStrategy&&(c.stateStorageStrategy=e.stateStorageStrategy,Tt=Pe(c)),kt=!!c.anonymousTracking,bt=Ie(c),St=Ee(c),Ct.setUseLocalStorage("localStorage"==Tt||"cookieAndLocalStorage"==Tt),Ct.setAnonymousTracking(St)}function A(){if(!kt||bt){var e="none"!=Tt&&!!g("ses"),t=C();if(t[1])var n=t[1];else n=kt?"":i(),t[1]=n;Ze=n,Qe=e?t[6]:ie(t),At=t[3],"none"!=Tt&&(b(),ae(t),S(t),t[10]||Ue.flush())}}function C(){return"none"==Tt?["1","",0,0,0,void 0,"","","",void 0,0]:function(e,t,n,r){var o=Math.round((new Date).getTime()/1e3);e?(e=e.split(".")).unshift("0"):e=["1",t,o,r,o,"",n],e[6]&&"undefined"!==e[6]||(e[6]=i()),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 a=function(e,t){return e=parseInt(e),isNaN(e)?t:e};return t=function(e){return e?a(e,void 0):void 0},[e[0],e[1],a(e[2],o),a(e[3],r),a(e[4],o),t(e[5]),e[6],e[7],e[8],t(e[9]),a(e[10],0)]}(g("id")||void 0,Ze,Qe,At)}function I(e){return 0===e.indexOf("http")?e:("https:"===document.location.protocol?"https":"http")+"://"+e}function E(){Pt&&null!=u.pageViewId||(u.pageViewId=i(),u.pageViewUrl=Ne||rt)}function O(){return function(){if(null==u.pageViewId)return!0;if(Pt||!It)return!1;if(void 0===u.pageViewUrl)return!0;var e=Ne||rt;if(!0===It||"full"==It||!("URL"in window))return u.pageViewUrl!=e;e=new URL(e);var t=new URL(u.pageViewUrl);return"pathname"==It?e.pathname!=t.pathname:"pathnameAndSearch"==It&&(e.pathname!=t.pathname||e.search!=t.search)}()&&(u.pageViewId=i(),u.pageViewUrl=Ne||rt),u.pageViewId}function L(){if("none"===Tt||kt||!De)return null;var e=B("_sp_tab_id");return e||(N("_sp_tab_id",i()),e=B("_sp_tab_id")),e||null}function D(e){var t=e.title,n=e.context,r=e.timestamp;if(e=e.contextCallback,l(),Et&&Et==O()&&E(),Et=O(),ut=document.title,t?(Ve=t,ct=!0):ct&&(Ve=null),t=F(Ve||ut),$e.track(function(e){var t=e.pageUrl,n=e.pageTitle;e=e.referrer;var r=a();return r.add("e","pv"),r.add("url",t),r.add("page",n),r.add("refr",e),r}({pageUrl:d(Ne||rt),pageTitle:t,referrer:d(je||ot)}),(n||[]).concat(e?e():[]),r),r=new Date,t=!1,Ot.enabled&&!Ot.installed){t=Ot.installed=!0;var o={update:function(){if("undefined"!=typeof window&&"function"==typeof window.addEventListener){var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0},set:function(){}}),n=function(){};window.addEventListener("testPassiveEventSupport",n,t),window.removeEventListener("testPassiveEventSupport",n,t),o.hasSupport=e}}};o.update();var i="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";Object.prototype.hasOwnProperty.call(o,"hasSupport")?W(document,i,h,{passive:!0}):W(document,i,h),w(),i=function(e,t){return void 0===t&&(t=h),function(e){return W(document,e,t)}},"click mouseup mousedown mousemove keypress keydown keyup touchend touchstart".split(" ").forEach(i(document)),["resize","focus","blur"].forEach(i(window)),i(window,m)("scroll")}if(Ot.enabled&&(st||t))for(r in qe=r.getTime(),r=void 0,Ot.configurations)(t=Ot.configurations[r])&&(window.clearInterval(t.activityInterval),_(t,n,e))}function _(e,t,n){var r=function(e,t){l(),e({context:t,pageViewId:O(),minXOffset:Fe,minYOffset:Ge,maxXOffset:He,maxYOffset:Je}),w()},o=function(){qe+e.configHeartBeatTimer>(new Date).getTime()&&r(e.callback,(t||[]).concat(n?n():[]))};e.activityInterval=0===e.configMinimumVisitLength?window.setInterval(o,e.configHeartBeatTimer):window.setTimeout((function(){qe+e.configMinimumVisitLength>(new Date).getTime()&&r(e.callback,(t||[]).concat(n?n():[])),e.activityInterval=window.setInterval(o,e.configHeartBeatTimer)}),e.configMinimumVisitLength)}function z(e){var t=e.minimumVisitLength,n=e.heartbeatDelay;if(e=e.callback,M(t)&&M(n))return{configMinimumVisitLength:1e3*t,configHeartBeatTimer:1e3*n,callback:e};Ae.error("Activity tracking minimumVisitLength & heartbeatDelay must be integers")}function Y(e){var t=e.context,n=e.minXOffset,r=e.minYOffset,o=e.maxXOffset,i=e.maxYOffset;(e=document.title)!==ut&&(ut=e,Ve=void 0);var u=(e=$e).track,c=d(Ne||rt),s=F(Ve||ut),l=d(je||ot);n=Math.round(n),o=Math.round(o),r=Math.round(r),i=Math.round(i);var f=a();f.add("e","pp"),f.add("url",c),f.add("page",s),f.add("refr",l),n&&!isNaN(Number(n))&&f.add("pp_mix",n.toString()),o&&!isNaN(Number(o))&&f.add("pp_max",o.toString()),r&&!isNaN(Number(r))&&f.add("pp_miy",r.toString()),i&&!isNaN(Number(i))&&f.add("pp_may",i.toString()),u.call(e,f,t)}function K(e){var t=Ot.configurations[e];0===(null==t?void 0:t.configMinimumVisitLength)?window.clearTimeout(null==t?void 0:t.activityInterval):window.clearInterval(null==t?void 0:t.activityInterval),Ot.configurations[e]=void 0}var $,ee,te,ne,se,le,fe,de,ve,ge,pe,me,ye,we,be,Se,ke,Te,xe,Ce;c.eventMethod=null!==($=c.eventMethod)&&void 0!==$?$:"post";var Pe=function(e){var t;return null!==(t=e.stateStorageStrategy)&&void 0!==t?t:"cookieAndLocalStorage"},Ie=function(e){var t,n;return"boolean"!=typeof e.anonymousTracking&&(null!==(n=!0===(null===(t=e.anonymousTracking)||void 0===t?void 0:t.withSessionTracking))&&void 0!==n&&n)},Ee=function(e){var t,n;return"boolean"!=typeof e.anonymousTracking&&(null!==(n=!0===(null===(t=e.anonymousTracking)||void 0===t?void 0:t.withServerAnonymisation))&&void 0!==n&&n)},Oe=null!==(te=null===(ee=null==c?void 0:c.contexts)||void 0===ee?void 0:ee.browser)&&void 0!==te&&te,De=null===(se=null===(ne=null==c?void 0:c.contexts)||void 0===ne?void 0:ne.webPage)||void 0===se||se,Ue=c.synchronousCookieWrite?Be:Re;s.push({beforeTrack:function(e){var t=g("ses"),n=C(),r=0===n[10];if(Ye=!!Me&&!!Ue.getCookie(Me),mt||Ye)T();else{if("0"===n[0]?(Qe=t||"none"==Tt?n[6]:ie(n),At=n[3]):(new Date).getTime()-xt>1e3*wt&&(At++,Qe=ie(n,{memorizedVisitCount:At})),ae(n),0===n[10]){var o=e.build();n[8]=o.eid,o=o.dtm||o.ttm,n[9]=o?parseInt(o):void 0}n[10]+=1;var i=(o=ce()).documentSize;e.add("vp",o.viewport),e.add("ds",i),e.add("vid",bt?At:kt?null:At),e.add("sid",bt?Qe:kt?null:Qe),e.add("duid",kt?null:n[1]),e.add("uid",kt?null:Xe),l(),e.add("refr",d(je||ot)),e.add("url",d(Ne||rt)),o=ue(n,Tt,kt),!Lt||kt&&!bt||e.addContextEntity({schema:"iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2",data:o}),"none"!=Tt&&(S(n),e=b(),t&&!r||!e||!Dt||Ut||(Ue.flush(),Dt(o),Ut=!1)),xt=(new Date).getTime()}}}),De&&s.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",data:{id:O()}}]}}),Oe&&s.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/browser_context/jsonschema/2-0-0",data:he(he({},ce()),{tabId:L()})}]}}),s.push.apply(s,null!==(le=c.plugins)&&void 0!==le?le:[]);var je,Ne,Ve,_e,ze,Me,qe,Fe,He,Ge,Je,We,Ze,Qe,Xe,Ye,Ke,$e=P({base64:null!==(fe=c.encodeBase64)&&void 0!==fe?fe:"post"!==c.eventMethod,corePlugins:s,callback:function(e){mt||Ye||Ct.enqueueRequest(e.build())}}),et=document.characterSet||document.charset,tt=oe(window.location.hostname,window.location.href,J()),nt=G(tt[0]),rt=tt[1],ot=tt[2],it=null!==(de=c.platform)&&void 0!==de?de:"web",at=null!==(ve=c.appId)&&void 0!==ve?ve:"",ut=document.title,ct=!1,st=null===(ge=c.resetActivityTrackingOnPageView)||void 0===ge||ge,lt=null!==(pe=c.cookieName)&&void 0!==pe?pe:"_sp_",ft=null!==(me=c.cookieDomain)&&void 0!==me?me:void 0,dt=null!==(ye=c.discoverRootDomain)&&void 0!==ye?ye:void 0===ft,vt="/",gt=null!==(we=c.cookieSameSite)&&void 0!==we?we:"Lax",pt=null===(be=c.cookieSecure)||void 0===be||be,ht=window.navigator.doNotTrack||window.navigator.msDoNotTrack||window.doNotTrack,mt=void 0!==c.respectDoNotTrack&&(c.respectDoNotTrack&&("yes"===ht||"1"===ht)),yt=null!==(Se=c.cookieLifetime)&&void 0!==Se?Se:63072e3,wt=null!==(ke=c.sessionCookieTimeout)&&void 0!==ke?ke:1800,bt=Ie(c),St=Ee(c),kt=!!c.anonymousTracking,Tt=Pe(c),xt=(new Date).getTime(),At=1,Ct=re(he({trackerId:e,endpoint:I(o),serverAnonymization:St,useLocalStorage:"localStorage"==Tt||"cookieAndLocalStorage"==Tt},c),u),Pt=!1,It=null!==(Te=c.preservePageViewIdForUrl)&&void 0!==Te&&Te,Et=void 0,Ot={enabled:!1,installed:!1,configurations:{}},Lt=null!==(Ce=null===(xe=c.contexts)||void 0===xe?void 0:xe.session)&&void 0!==Ce&&Ce,Dt=c.onSessionUpdateCallback,Ut=!1,jt="boolean"==typeof(Ke=c.useExtendedCrossDomainLinker||!1)?{useExtendedCrossDomainLinker:Ke}:{useExtendedCrossDomainLinker:!0,collectCrossDomainAttributes:Ke},Rt=jt.useExtendedCrossDomainLinker,Bt=jt.collectCrossDomainAttributes;dt&&!ft&&(ft=X(gt,pt));var Nt=ce(),Vt=Nt.browserLanguage,_t=Nt.resolution,zt=Nt.colorDepth,Mt=Nt.cookiesEnabled,qt=q();return $e.setTrackerVersion(n),$e.setTrackerNamespace(t),$e.setAppId(at),$e.setPlatform(it),$e.addPayloadPair("cookie",Mt?"1":"0"),$e.addPayloadPair("cs",et),$e.addPayloadPair("lang",Vt),$e.addPayloadPair("res",_t),$e.addPayloadPair("cd",zt),qt&&$e.addPayloadPair("tz",qt),p(),A(),c.crossDomainLinker&&f(c.crossDomainLinker),he(he({},{getDomainSessionIndex:function(){return At},getPageViewId:O,getTabId:L,newSession:function(){var e=C();if("0"===e[0]?(Qe="none"!=Tt?ie(e):e[6],At=e[3]):(At++,Qe=ie(e,{memorizedVisitCount:At})),ae(e),"none"!=Tt){var t=ue(e,Tt,kt);S(e),e=b(),Ue.flush(),e&&Dt&&(Ut=!0,Dt(t))}xt=(new Date).getTime()},getCookieName:function(e){return lt+e+"."+We},getUserId:function(){return Xe},getDomainUserId:function(){return C()[1]},getDomainUserInfo:function(){return C()},setReferrerUrl:function(e){je=e},setCustomUrl:function(e){l();var t,n=rt;v(e)?Ne=e:"/"===e.slice(0,1)?Ne=v(n)+"://"+H(n)+e:(0<=(t=(n=d(n)).indexOf("?"))&&(n=n.slice(0,t)),(t=n.lastIndexOf("/"))!==n.length-1&&(n=n.slice(0,t+1)),Ne=n+e)},setDocumentTitle:function(e){ut=document.title,Ve=e,ct=!1},discardHashTag:function(e){_e=e},discardBrace:function(e){ze=e},setCookiePath:function(e){vt=e,p()},setVisitorCookieTimeout:function(e){yt=e},crossDomainLinker:function(e){f(e)},enableActivityTracking:function(e){Ot.configurations.pagePing||(Ot.enabled=!0,Ot.configurations.pagePing=z(he(he({},e),{callback:Y})))},enableActivityTrackingCallback:function(e){Ot.configurations.callback||(Ot.enabled=!0,Ot.configurations.callback=z(e))},disableActivityTracking:function(){K("pagePing")},disableActivityTrackingCallback:function(){K("callback")},updatePageActivity:function(){h()},setOptOutCookie:function(e){Me=e},setUserId:function(e){Xe=e},setUserIdFromLocation:function(e){l(),Xe=Z(e,rt)},setUserIdFromReferrer:function(e){l(),Xe=Z(e,ot)},setUserIdFromCookie:function(e){Xe=Ue.getCookie(e)},setCollectorUrl:function(e){Ct.setCollectorUrl(I(e))},setBufferSize:function(e){Ct.setBufferSize(e)},flushBuffer:function(e){void 0===e&&(e={}),Ct.executeQueue(),e.newBufferSize&&Ct.setBufferSize(e.newBufferSize)},trackPageView:function(e){void 0===e&&(e={}),D(e)},preservePageViewId:function(){Pt=!0},preservePageViewIdForUrl:function(e){It=e},disableAnonymousTracking:function(e){c.anonymousTracking=!1,x(e),A(),Ct.executeQueue()},enableAnonymousTracking:function(e){var t;c.anonymousTracking=null===(t=e&&(null==e?void 0:e.options))||void 0===t||t,x(e),bt||E()},clearUserData:T}),{id:e,namespace:t,core:$e,sharedState:u})}(e,t,n,o,u,c);var l=he(he({},e),{addPlugin:function(e){var t,n;l.core.addPlugin(e),null===(n=(t=e.plugin).activateBrowserPlugin)||void 0===n||n.call(t,l)}});return s.forEach((function(e){var t;null===(t=e.activateBrowserPlugin)||void 0===t||t.call(e,l)})),l}function de(e){return ge(e,Ne)}function ve(){return Object.keys(Ne)}function ge(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];t.hasOwnProperty(o)?n.push(t[o]):Ae.warn(o+" not configured")}return n}function pe(){try{return!!window.localStorage}catch(e){return!0}}var he=function(){return he=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},he.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;for(var me=[],ye=0;256>ye;++ye)me.push((ye+256).toString(16).slice(1));var we,be,Se,ke=new Uint8Array(16),Te={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";(Se=be||(be={}))[Se.none=0]="none",Se[Se.error=1]="error",Se[Se.warn=2]="warn",Se[Se.debug=3]="debug",Se[Se.info=4]="info";var Ae=function(e){return void 0===e&&(e=be.warn),{setLogLevel:function(t){e=be[t]?t:be.warn},warn:function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=be.warn&&"undefined"!=typeof console&&(i="Snowplow: "+t,n?console.warn.apply(console,r([i+"\n",n],o,!1)):console.warn.apply(console,r([i],o,!1)))},error:function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=be.error&&"undefined"!=typeof console&&(i="Snowplow: "+t+"\n",n?console.error.apply(console,r([i+"\n",n],o,!1)):console.error.apply(console,r([i],o,!1)))},debug:function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];e>=be.debug&&"undefined"!=typeof console&&console.debug.apply(console,r(["Snowplow: "+t],n,!1))},info:function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];e>=be.info&&"undefined"!=typeof console&&console.info.apply(console,r(["Snowplow: "+t],n,!1))}}}(),Ce={},Pe={};!function(){var e={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(t){if(t.constructor==Number)return 16711935&e.rotl(t,8)|4278255360&e.rotl(t,24);for(var n=0;n<t.length;n++)t[n]=e.endian(t[n]);return t},randomBytes:function(e){for(var t=[];0<e;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],o=0;4>o;o++)8*n+6*o<=8*e.length?t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n<e.length;r=++n%4)0!=r&&t.push(("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(n))>>>6-2*r);return t}};Pe=e}();var Ie={utf8:{stringToBytes:function(e){return Ie.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(Ie.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},Ee=Ie;!function(){var e=Pe,t=Ee.utf8,n=Ee.bin,r=function(r,o){var i=e.wordsToBytes,a=r;a.constructor==String?a=t.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,h=f,m=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+=h,d+=m}return i=i.call(e,[c,s,l,f,d]),o&&o.asBytes?i:o&&o.asString?n.bytesToString(i):e.bytesToHex(i)};r._blocksize=16,r._digestsize=20,Ce=r}();var Oe,Le=Ce,De={sessionId:!0,sourceId:!0,sourcePlatform:!1,userId:!1,reason:!1},Ue=!1,je="x",Re=function(){function e(e){return t[e]||(t[e]=function(e){function t(){void 0!==n&&(clearTimeout(n),n=void 0),i||(i=!0,void 0!==r&&$(e,r[0],r[1],r[2],r[3],r[4],r[5]))}var n,r,o,i=!0;return{getValue:function(){var t;return r&&(!o||o>new Date)&&null!==(t=r[0])&&void 0!==t?t:$(e)},setValue:function(e,a,u,c,s,l){return r=[e,a,u,c,s,l],i=!1,void 0===n&&(n=setTimeout((function(){n=void 0,t()}),10)),o=new Date(Date.now()+1e3*Math.min(.05,null!=a?a:.05)),!0},deleteValue:function(t,o,a,u){r=void 0,i=!0,void 0!==n&&(clearTimeout(n),n=void 0),Y(e,t,o,a,u)},flush:t}}(e)),t[e]}var t={};return{getCookie:function(t){return e(t).getValue()},setCookie:function(t,n,r,o,i,a,u){return e(t).setValue(n,r,o,i,a,u)},deleteCookie:function(t,n,r,o,i){e(t).deleteValue(n,r,o,i)},clearCache:function(){t={}},flush:function(){for(var e=0,n=Object.values(t);e<n.length;e++)n[e].flush()}}}(),Be={getCookie:$,setCookie:function(e,t,n,r,o,i,a){return $(e,t,n,r,o,i,a),-1!==document.cookie.indexOf("".concat(e,"="))},deleteCookie:Y,flush:function(){}},Ne={},Ve=function(){this.bufferFlushers=[],this.hasLoaded=!1,this.registeredOnLoadHandlers=[]};e.SharedState=Ve,e.addEventListener=W,e.addTracker=function(e,t,n,r,o,i){return Ne.hasOwnProperty(e)?null:(Ne[e]=fe(e,t,n,r,o,i),Ne[e])},e.allTrackerNames=ve,e.allTrackers=function(){return Ne},e.attemptDeleteLocalStorage=R,e.attemptGetLocalStorage=U,e.attemptGetSessionStorage=B,e.attemptWriteLocalStorage=j,e.attemptWriteSessionStorage=N,e.cookie=$,e.createCrossDomainParameterValue=V,e.createSharedState=function(){function e(){var e;if(!t.hasLoaded)for(t.hasLoaded=!0,e=0;e<t.registeredOnLoadHandlers.length;e++)t.registeredOnLoadHandlers[e]();return!0}var t=new Ve,n=document,r=window;return n.visibilityState&&W(n,"visibilitychange",(function(){"hidden"==n.visibilityState&&t.bufferFlushers.forEach((function(e){e(!1)}))}),!1),W(r,"beforeunload",(function(){t.bufferFlushers.forEach((function(e){e(!1)}))}),!1),"loading"===document.readyState?(n.addEventListener?n.addEventListener("DOMContentLoaded",(function t(){n.removeEventListener("DOMContentLoaded",t,!1),e()})):n.attachEvent&&n.attachEvent("onreadystatechange",(function t(){"complete"===n.readyState&&(n.detachEvent("onreadystatechange",t),e())})),W(r,"load",e,!1)):e(),t},e.decorateQuerystring=Q,e.deleteCookie=Y,e.dispatchToTrackers=function(e,t){try{de(null!=e?e:ve()).forEach(t)}catch(e){Ae.error("Function failed",e)}},e.dispatchToTrackersInCollection=function(e,t,n){try{ge(null!=e?e:Object.keys(t),t).forEach(n)}catch(e){Ae.error("Function failed",e)}},e.findRootDomain=X,e.fixupDomain=G,e.fixupTitle=F,e.fixupUrl=oe,e.flushPendingCookies=function(){Re.flush()},e.fromQuerystring=Z,e.getCookiesWithPrefix=K,e.getCssClasses=ee,e.getFilterByClass=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var t=Object.prototype.hasOwnProperty.call(e,"allowlist"),n=ne(e);return te(e,(function(e){e:{var r=0;for(e=ee(e);r<e.length;r++)if(n[e[r]]){r=!0;break e}r=!1}return r===t}))},e.getFilterByName=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var t=e.hasOwnProperty("allowlist"),n=ne(e);return te(e,(function(e){return e.name in n===t}))},e.getHostName=H,e.getReferrer=J,e.getTimeZone=q,e.getTracker=function(e){return Ne.hasOwnProperty(e)?Ne[e]:(Ae.warn(e+" not configured"),null)},e.getTrackers=de,e.hasLocalStorage=pe,e.hasSessionStorage=function(){try{return!!window.sessionStorage}catch(e){return!0}},e.isFunction=function(e){return!(!e||"function"!=typeof e)},e.isInteger=M,e.isString=z,e.isValueInArray=function(e,t){for(var n=0;n<t.length;n++)if(t[n]===e)return!0;return!1},e.localStorageAccessible=function(){if(!pe())return!1;try{var e=window.localStorage;return e.setItem("modernizr","modernizr"),e.removeItem("modernizr"),!0}catch(e){return!1}},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 Ne.hasOwnProperty(e)},e.urlSafeBase64Encode=_,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,r){return new(t||(t=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):function(e){return e instanceof t?e:new t((function(n){n(e)}))}(e.value).then(a,u)}c((r=r.apply(e,n||[])).next())}))}function t(e,n){function t(t){return function(c){return function(t){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,t[0]&&(a=0)),a;)try{if(r=1,o&&(i=2&t[0]?o.return:t[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,t[1])).done)return i;switch(o=0,i&&(t=[2&t[0],i.value]),t[0]){case 0:case 1:i=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,o=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=0<i.length&&i[i.length-1])||6!==t[0]&&2!==t[0])){a=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&t[1]<i[3]))a.label=t[1];else if(6===t[0]&&a.label<i[1])a.label=i[1],i=t;else{if(!(i&&a.label<i[2])){i[2]&&a.ops.pop(),a.trys.pop();continue}a.label=i[2],a.ops.push(t)}}t=n.call(e,a)}catch(e){t=[6,e],o=0}finally{r=i=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,c])}}var r,o,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=t(0),u.throw=t(1),u.return=t(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u}function r(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 o(){if(!we&&!(we="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return we(ke)}function i(e,n,t){if(Te.randomUUID&&!n&&!e)return Te.randomUUID();if((e=(e=e||{}).random||(e.rng||o)())[6]=15&e[6]|64,e[8]=63&e[8]|128,n){t=t||0;for(var r=0;16>r;++r)n[t+r]=e[r];return n}return function(e,n=0){return(me[e[n+0]]+me[e[n+1]]+me[e[n+2]]+me[e[n+3]]+"-"+me[e[n+4]]+me[e[n+5]]+"-"+me[e[n+6]]+me[e[n+7]]+"-"+me[e[n+8]]+me[e[n+9]]+"-"+me[e[n+10]]+me[e[n+11]]+me[e[n+12]]+me[e[n+13]]+me[e[n+14]]+me[e[n+15]]).toLowerCase()}(e)}function a(){var e,n={},t=[],r=[],o=[],i=function(e,t){null!=t&&""!==t&&(n[e]=t)};return{add:i,addDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i(n,e[n])},addJson:function(e,n,o){o&&c(o)&&(e={keyIfEncoded:e,keyIfNotEncoded:n,json:o},r.push(e),t.push(e))},addContextEntity:function(e){o.push(e)},getPayload:function(){return n},getJson:function(){return t},withJsonProcessor:function(n){e=n},build:function(){return null==e||e(this,r,o),n}}}function u(e){return function(n,t,o){for(var i=function(t,r,o){if(t=JSON.stringify(t),e){if(o=n.add,t){var i=0,a=0,u=[];if(t){t=unescape(encodeURIComponent(t));do{var c=t.charCodeAt(i++),s=t.charCodeAt(i++),l=t.charCodeAt(i++),f=c<<16|s<<8|l;c=f>>18&63,s=f>>12&63,l=f>>6&63,f&=63,u[a++]=xe.charAt(c)+xe.charAt(s)+xe.charAt(l)+xe.charAt(f)}while(i<t.length);i=u.join(""),t=((t=t.length%3)?i.slice(0,t-3):i)+"===".slice(t||3)}t=t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o.call(n,r,t)}else n.add(o,t)},a=function(t,r){if(!t){var o=n.getPayload();if(e?o.cx:o.co){var i=(t=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=xe.indexOf(e.charAt(t++)),u=xe.indexOf(e.charAt(t++));o=xe.indexOf(e.charAt(t++));var c=xe.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;t=i.call(t,o)}else t=void 0}return t?t.data=t.data.concat(r.data):t=r,t},u=void 0,c=0;c<t.length;c++){var s=t[c];"cx"===s.keyIfEncoded?u=a(u,s.json):i(s.json,s.keyIfEncoded,s.keyIfNotEncoded)}t.length=0,o.length&&(u=a(u,t={schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:r([],o,!0)}),o.length=0),u&&i(u,"cx","co")}}function c(e){if(!s(e))return!1;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))return!0;return!1}function s(e){return null!=e&&(e.constructor==={}.constructor||e.constructor===[].constructor)}function l(){var e=[],n=[],t={},r={};return{getGlobalPrimitives:function(){return e.concat(Object.values(t))},getConditionalProviders:function(){return n.concat(Object.values(r))},addGlobalContexts:function(o){if(Array.isArray(o)){for(var i=[],a=[],u=0;u<o.length;u++){var c=o[u];b(c)?i.push(c):m(c)&&a.push(c)}e=e.concat(a),n=n.concat(i)}else for(i=0,o=Object.entries(o);i<o.length;i++)a=(c=o[i])[0],b(c=c[1])?r[a]=c:m(c)&&(t[a]=c)},clearGlobalContexts:function(){n=[],e=[],r={},t={}},removeGlobalContexts:function(o){for(var i=function(o){"string"==typeof o?(delete r[o],delete t[o]):b(o)?n=n.filter((function(e){return!C(o,e)})):m(o)&&(e=e.filter((function(e){return!C(o,e)})))},a=0;a<o.length;a++)i(o[a])},getApplicableContexts:function(o){e:{for(var i=0,a=o.getJson();i<a.length;i++){var u=a[i];if("ue_px"===u.keyIfEncoded&&"object"==typeof u.json.data&&"string"==typeof(u=u.json.data.schema)){i=u;break e}}i=""}u="string"==typeof(a=o.getPayload().e)?a:"",a=[];var c=x(e.concat(Object.values(t)),o,u,i);return a.push.apply(a,c),o=function(e,n,t,r){var o;return e=T(e).map((function(e){e:{if(y(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=x(e[1],n,t,r);break e}}else if(w(e)&&function(e,n){var t=0,r=0,o=e.accept;return Array.isArray(o)?e.accept.some((function(e){return S(e,n)}))&&r++:"string"==typeof o&&S(o,n)&&r++,o=e.reject,Array.isArray(o)?e.reject.some((function(e){return S(e,n)}))&&t++:"string"==typeof o&&S(o,n)&&t++,0<r&&0===t}(e[0],r)){e=x(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.concat(Object.values(r)),o,u,i),a.push.apply(a,o),a}}}function f(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 d(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))&&f(e[1]))return e.slice(1,6)}function v(e){if(e=d(e)){var n=e[0];return 5===e.length&&f(n)}return!1}function p(e){return function(e){return Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))}(e)?e.every((function(e){return v(e)})):"string"==typeof e&&v(e)}function g(e){return!!(c(e)&&"schema"in e&&"data"in e)&&("string"==typeof e.schema&&"object"==typeof e.data)}function h(e){return"function"==typeof e&&1>=e.length}function m(e){return h(e)||g(e)}function y(e){return!(!Array.isArray(e)||2!==e.length)&&(Array.isArray(e[1])?h(e[0])&&e[1].every(m):h(e[0])&&m(e[1]))}function w(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(!p(e.accept))return!1;n+=1}if(Object.prototype.hasOwnProperty.call(e,"reject")){if(!p(e.reject))return!1;n+=1}return 0<n&&2>=n}return!1}(e[0])&&(Array.isArray(e[1])?e[1].every(m):m(e[1])))}function b(e){return y(e)||w(e)}function S(e,n){if(!v(e))return!1;if(e=d(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(!k(n[t],e[t]))return!1;return!0}return!1}(e[0],n[0]))return!1;for(var t=1;5>t;t++)if(!k(e[t],n[t]))return!1;return!0}return!1}function k(e,n){return e&&n&&"*"===e||e===n}function T(e){return Array.isArray(e)?e:[e]}function x(e,n,t,r){var o;return e=T(e).map((function(e){e:if(g(e))e=[e];else{if(h(e)){n:{var o=void 0;try{if(o=e({event:n.getPayload(),eventType:t,eventSchema:r}),Array.isArray(o)&&o.every(g)||g(o)){var i=o;break n}i=void 0;break n}catch(e){}i=void 0}if(g(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 A(e,n){return"function"==typeof e?e===n:JSON.stringify(e)===JSON.stringify(n)}function C(e,n){if(b(e)){if(!b(n))return!1;var t=e[1],r=n[1];return!!A(e[0],n[0])&&(Array.isArray(t)?!(!Array.isArray(r)||t.length!==r.length)&&t.reduce((function(e,n,t){return e&&A(n,r[t])}),!0):!Array.isArray(r)&&A(t,r))}return!!m(e)&&(!!m(n)&&A(e,n))}function P(e){void 0===e&&(e={});var n,t,o,a,c,f,d,v=e.base64,p=e.corePlugins,g=null!=p?p:[];n=null==v||v,t=g,o=e.callback,a=function(e){return{addPluginContexts:function(n){var t=n?r([],n,!0):[];return e.forEach((function(e){try{e.contexts&&t.push.apply(t,e.contexts())}catch(e){Ae.error("Error adding plugin contexts",e)}})),t}}}(t),c=l(),f=n,d={};var h=he(he({},e={track:function(e,n,r){if(e.withJsonProcessor(u(f)),e.add("eid",i()),e.addDict(d),r=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()}}(r),e.add(r.type,r.value.toString()),n=function(e,n){e=c.getApplicableContexts(e);var t=[];return n&&n.length&&t.push.apply(t,n),e&&e.length&&t.push.apply(t,e),t}(e,a.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),t.forEach((function(n){try{n.beforeTrack&&n.beforeTrack(e)}catch(e){Ae.error("Plugin beforeTrack",e)}})),!t.find((function(n){try{return n.filter&&!1===n.filter(e.build())}catch(e){return Ae.error("Plugin filter",e),!1}}))){"function"==typeof o&&o(e);var s=e.build();return t.forEach((function(e){try{e.afterTrack&&e.afterTrack(s)}catch(e){Ae.error("Plugin afterTrack",e)}})),s}},addPayloadPair:function(e,n){d[e]=n},getBase64Encoding:function(){return f},setBase64Encoding:function(e){f=e},addPayloadDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(d[n]=e[n])},resetPayloadPairs:function(e){d=s(e)?e:{}},setTrackerVersion:function(e){d.tv=e},setTrackerNamespace:function(e){d.tna=e},setAppId:function(e){d.aid=e},setPlatform:function(e){d.p=e},setUserId:function(e){d.uid=e},setScreenResolution:function(e,n){d.res=e+"x"+n},setViewport:function(e,n){d.vp=e+"x"+n},setColorDepth:function(e){d.cd=e},setTimezone:function(e){d.tz=e},setLang:function(e){d.lang=e},setIpAddress:function(e){d.ip=e},setUseragent:function(e){d.ua=e},addGlobalContexts:function(e){c.addGlobalContexts(e)},clearGlobalContexts:function(){c.clearGlobalContexts()},removeGlobalContexts:function(e){c.removeGlobalContexts(e)}}),{addPlugin:function(e){var n,t;e=e.plugin,g.push(e),null===(n=e.logger)||void 0===n||n.call(e,Ae),null===(t=e.activateCorePlugin)||void 0===t||t.call(e,h)}});return null==g||g.forEach((function(e){var n,t;null===(n=e.logger)||void 0===n||n.call(e,Ae),null===(t=e.activateCorePlugin)||void 0===t||t.call(e,h)})),h}function I(e){var n=e.maxSize,t=void 0===n?1e3:n,o=r([],void 0===(e=e.events)?[]:e,!0),i=function(){return Promise.resolve(o.length)};return{count:i,add:function(e){for(o.push(e);o.length>t;)o.shift();return i()},removeHead:function(e){for(var n=0;n<e;n++)o.shift();return Promise.resolve()},iterator:function(){var e=0,n=r([],o,!0);return{next:function(){return e<n.length?Promise.resolve({value:n[e++],done:!1}):Promise.resolve({value:void 0,done:!0})}}},getAll:function(){return Promise.resolve(r([],o,!0))},getAllPayloads:function(){return Promise.resolve(o.map((function(e){return e.payload})))}}}function E(e){function n(){var e=S.reduce((function(e,n){return e+(k?n.getPOSTRequestBytesCount():n.getGETRequestBytesCount())}),0);return k&&(e+=88),e}function t(){var e=new Headers;return k&&e.append("Content-Type","application/json; charset=UTF-8"),v&&Object.keys(v).forEach((function(n){e.append(n,v[n])})),0<S.length&&S[0].getServerAnonymization()&&e.append("SP-Anonymous","*"),e}function r(){var e=u;return u.includes("://")||(e="".concat(s,"://").concat(u)),l&&(e="".concat(e,":").concat(l)),e+(k?m:"/i")}function o(e,n){return a(!1),d=new AbortController,f=setTimeout((function(){console.error("Request timed out"),f=void 0,a(!1,"Request timed out")}),null!=p?p:5e3),n=he({headers:t(),signal:d.signal,keepalive:h,credentials:b},n),new Request(e,n)}function i(){var e=function(e){for(var n=(new Date).getTime().toString(),t=0;t<e.length;t++)e[t].stm=n;return e}(S.map((function(e){return e.getPOSTRequestBody()})));return o(r(),{method:"POST",body:JSON.stringify({schema:"iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",data:e})})}function a(e,n){if(void 0!==f&&(clearTimeout(f),f=void 0),void 0!==d){var t=d;d=void 0,e||t.abort(n)}}var u=e.endpoint,c=e.protocol,s=void 0===c?"https":c,l=e.port;c=e.eventMethod;var f,d,v=e.customHeaders,p=e.connectionTimeout,g=e.keepalive,h=void 0!==g&&g,m=void 0===(g=e.postPath)?"/com.snowplowanalytics.snowplow/tp2":g,y=void 0===(g=e.useStm)||g,w=void 0===(g=e.maxPostBytes)?4e4:g,b=void 0===(e=e.credentials)?"include":e,S=[],k="post"===(void 0===c?"post":c).toLowerCase();return{addEvent:function(e){return!(0<S.length&&(0<S.length?S[0].getServerAnonymization():void 0)!==e.getServerAnonymization())&&(S.push(e),!0)},getEvents:function(){return S},toRequest:function(){if(0!==S.length){if(k)return i();if(1!==S.length)throw Error("Only one event can be sent in a GET request");return o(S[0].getGETRequestURL(r(),y),{method:"GET"})}},countBytes:n,countEvents:function(){return S.length},isFull:function(){return k?n()>=w:1<=S.length},closeRequest:a}}function O(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 L(e){function n(){return e.payload}function t(e){if(null===o){var n,t={co:!0,cx:!0},r=[];for(n in e)e.hasOwnProperty(n)&&!t[n]&&r.push(n+"="+encodeURIComponent(e[n]));for(var i in t)e.hasOwnProperty(i)&&t[i]&&r.push(i+"="+encodeURIComponent(e[i]));o="?"+r.join("&")}return o}function r(){return null===i&&(i=function(e){return Object.keys(e).map((function(n){return[n,e[n]]})).reduce((function(e,n){return e[n[0]]=n[1].toString(),e}),{})}(n())),i}var o=null,i=null,a=null,u=null;return{getPayload:n,getServerAnonymization:function(){var n;return null!==(n=e.svrAnon)&&void 0!==n&&n},getGETRequestURL:function(e,r){var o=t(n());return r?e+o.replace("?","?stm="+(new Date).getTime()+"&"):e+o},getGETRequestBytesCount:function(){if(null===a){var e=t(n());a=O(e)}return a},getPOSTRequestBody:r,getPOSTRequestBytesCount:function(){return null===u&&(u=O(JSON.stringify(r()))),u}}}function D(e){function r(e,n){void 0!==C&&setTimeout((function(){try{null==C||C(e,n)}catch(e){Ae.error("Error in onRequestFailure",e)}}),0)}function o(e){return n(this,void 0,void 0,(function(){var n,o,i,a,u,c;return t(this,(function(t){switch(t.label){case 0:if(void 0===(n=e.toRequest()))throw Error("Empty batch");o=e.getEvents().map((function(e){return e.getPayload()})),t.label=1;case 1:return t.trys.push([1,4,,5]),[4,O(n)];case 2:return[4,(i=t.sent()).text()];case 3:return t.sent(),e.closeRequest(!0),i.ok?(function(e,n){void 0!==P&&setTimeout((function(){try{null==P||P(e,n)}catch(e){Ae.error("Error in onRequestSuccess",e)}}),0)}(o,i),[2,{success:!0,retry:!1,status:i.status}]):(a=function(e){return!(200<=e&&300>e||!A||!x.includes(e)&&T.includes(e))}(i.status),r({events:o,status:i.status,message:i.statusText,willRetry:a},i),[2,{success:!1,retry:a,status:i.status}]);case 4:return u=t.sent(),e.closeRequest(!1),c="string"==typeof u?u:u?u.message:"Unknown error",r({events:o,message:c,willRetry:!0}),[2,{success:!1,retry:!0}];case 5:return[2]}}))}))}function i(){return E({endpoint:s,protocol:v,port:p,eventMethod:f,customHeaders:y,connectionTimeout:b,keepalive:S,maxPostBytes:g,useStm:D,credentials:U,postPath:d})}function a(){return n(this,void 0,void 0,(function(){var e;return t(this,(function(n){switch(n.label){case 0:return!k||R?[3,2]:(R=!0,e=new Request(k,{method:"GET"}),[4,O(e)]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}function u(){return n(this,void 0,void 0,(function(){var e;return t(this,(function(n){switch(n.label){case 0:if(B)return[3,5];B=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,c()];case 2:return n.sent(),[3,5];case 3:return e=n.sent(),Ae.error("Error sending events",e),[3,5];case 4:return B=!1,[7];case 5:return[2]}}))}))}function c(){return n(this,void 0,void 0,(function(){var e,n,r,u,s,l,f,d,v;return t(this,(function(t){switch(t.label){case 0:return[4,a()];case 1:t.sent(),e=i(),n=j.iterator(),t.label=2;case 2:return e.isFull()?[3,4]:[4,n.next()];case 3:return r=t.sent(),u=r.value,r.done||void 0===u?[3,4]:(s=L(u),e.addEvent(s)?[3,2]:[3,4]);case 4:return 0===e.countEvents()?[2]:[4,o(e)];case 5:return l=t.sent(),f=l.success,d=l.retry,v=l.status,!f&&d?[3,7]:(f||Ae.error("Status ".concat(v,", will not retry.")),[4,j.removeHead(e.countEvents())]);case 6:t.sent(),t.label=7;case 7:return f?[4,c()]:[3,9];case 8:t.sent(),t.label=9;case 9:return[2]}}))}))}var s=e.endpoint,l=e.eventMethod,f=void 0===l?"post":l,d=e.postPath,v=e.protocol,p=e.port,g=void 0===(l=e.maxPostBytes)?4e4:l,h=e.maxGetBytes,m=void 0===(l=e.bufferSize)?1:l,y=e.customHeaders,w=e.serverAnonymization,b=e.connectionTimeout,S=e.keepalive,k=e.idService,T=void 0===(l=e.dontRetryStatusCodes)?[]:l,x=void 0===(l=e.retryStatusCodes)?[]:l,A=void 0===(l=e.retryFailedRequests)||l,C=e.onRequestFailure,P=e.onRequestSuccess,O=void 0===(l=e.customFetch)?fetch:l,D=e.useStm,j=void 0===(l=e.eventStore)?I({}):l,U=e.credentials,R=!1,B=!1,N="post"===f.toLowerCase();return T=T.concat([400,401,403,410,422]),{flush:u,input:function(e){return n(this,void 0,void 0,(function(){var n,r,a;return t(this,(function(t){switch(t.label){case 0:e:{if(t=r=L(n={payload:e,svrAnon:void 0!==(t=w)&&t}),N){var c=(t=t.getPOSTRequestBytesCount()+88)>g;c&&Ae.warn("Event ("+t+"B) too big, max is "+g)}else{if(void 0===h){t=!1;break e}(c=(t=t.getGETRequestBytesCount())>h)&&Ae.warn("Event ("+t+"B) too big, max is "+h)}t=c}return t?((a=i()).addEvent(r),[4,o(a)]):[3,2];case 1:return t.sent(),[3,5];case 2:return[4,j.add(n)];case 3:return t.sent()>=m?[4,u()]:[3,5];case 4:t.sent(),t.label=5;case 5:return[2]}}))}))},setCollectorUrl:function(e){s=e},setAnonymousTracking:function(e){w=e},setBufferSize:function(e){m=e}}}function j(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 U(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 R(e){try{var n=window.localStorage;return n.removeItem(e),n.removeItem(e+".expires"),!0}catch(e){return!1}}function B(e){try{return window.sessionStorage.getItem(e)}catch(e){}}function N(e,n){try{return window.sessionStorage.setItem(e,n),!0}catch(e){return!1}}function V(e,n,t){var r,o=(new Date).getTime();n=he(he({},De),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&&_(a||""),n.sourceId&&_(c||""),n.sourcePlatform&&s,n.reason&&_(l||"")].map((function(e){return e||""})).join(".").replace(/([.]*$)/,""):t.domainUserId+"."+o}function _(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function z(e){return!(!e||"string"!=typeof e.valueOf())}function M(e){return Number.isInteger&&Number.isInteger(e)||"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function q(){if("object"==typeof Intl&&"function"==typeof Intl.DateTimeFormat)return(new Intl.DateTimeFormat).resolvedOptions().timeZone}function F(e){if(!z(e)){e=e.text||"";var n=document.getElementsByTagName("title");n&&null!=n[0]&&(e=n[0].text)}return e}function H(e){var n=/^(?:(?:https?|ftp):)\/*(?:[^@]+@)?([^:/#]+)/.exec(e);return n?n[1]:e}function G(e){var n=e.length;return"."===e.charAt(--n)&&(e=e.slice(0,n)),"*."===e.slice(0,2)&&(e=e.slice(1)),e}function J(e){var n=window,t=Z("referrer",n.location.href)||Z("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 W(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 Z(e,n){return(e=new RegExp("^[^#]*[?&]"+e+"=([^&#]*)").exec(n))?decodeURIComponent(e[1].replace(/\+/g," ")):null}function Q(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 X(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($(r,o,0,"/",u,e,n),$(r)===o){for(Y(r,"/",u,e,n),t=K("_sp_root_domain_test_"),r=0;r<t.length;r++)Y(t[r],"/",u,e,n);return u}}return t}function Y(e,n,t,r,o){$(e,"",-1,n,t,r,o)}function K(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 $(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 ee(e){return e.className.match(/\S+/g)||[]}function ne(e,n){return e.hasOwnProperty("filter")&&e.filter?e.filter:n}function te(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 re(e,n){var t,r=null!==(t=e.eventStore)&&void 0!==t?t:function(e){function n(){return o?a().then((function(e){window.localStorage.setItem(i,JSON.stringify(e))})):Promise.resolve()}var t=e.maxLocalStorageQueueSize,r=void 0===t?1e3:t,o=void 0===(t=e.useLocalStorage)||t,i="snowplowOutQueue_".concat(e.trackerId),a=(e=function(){if(o){var e=window.localStorage.getItem(i);return e=e?JSON.parse(e):[],I({maxSize:r,events:e})}return I({maxSize:r})}()).getAll,u=e.add,c=e.count,s=e.removeHead;return{count:c,add:function(e){return u(e),n().then(c)},removeHead:function(e){return s(e),n()},iterator:e.iterator,getAll:a,getAllPayloads:e.getAllPayloads,setUseLocalStorage:function(e){o=e}}}(e);return e.eventStore=r,e=D(e),n.bufferFlushers.push(e.flush),{enqueueRequest:e.input,executeQueue:e.flush,setAnonymousTracking:e.setAnonymousTracking,setCollectorUrl:e.setCollectorUrl,setBufferSize:e.setBufferSize,setUseLocalStorage:function(e){r.hasOwnProperty("setUseLocalStorage")&&r.setUseLocalStorage(e)}}}function oe(e,n,t){return"translate.googleusercontent.com"===e?(""===t&&(t=n),e=H(n=null!=(e=(e=/^(?:https?|ftp)(?::\/*(?:[^?]+))([?][^#]+)/.exec(n))&&1<(null==e?void 0:e.length)?Z("u",e[1]):null)?e:"")):"cc.bingj.com"!==e&&"webcache.googleusercontent.com"!==e||(e=H(n=document.links[0].href)),[e,n,t]}function ie(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=i(),e[6]=n,e[10]=0,e[8]="",e[9]=void 0,n}function ae(e){e[4]=Math.round((new Date).getTime()/1e3)}function ue(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 ce(){return"ResizeObserver"in window?(Oe||(Oe=se()),function(){if(!je&&document&&document.body&&document.documentElement){je=!0;var e=new ResizeObserver((function(e){for(var n=0;n<e.length;n++){var t=e[n];t.target!==document.body&&t.target!==document.documentElement||(Oe=se())}}));e.observe(document.body),e.observe(document.documentElement)}}(),Oe):se()}function se(){var e=le;if("innerWidth"in window)var n=window.innerWidth,t=window.innerHeight;else n=(t=document.documentElement||document.body).clientWidth,t=t.clientHeight;e=e(Math.max(0,n)+Ue+Math.max(0,t)),n=le;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+Ue+r),resolution:le(screen.width+Ue+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 le(e){return e&&e.split(Ue).map((function(e){return Math.floor(Number(e))})).join(Ue)}function fe(e,n,t,o,u,c){void 0===c&&(c={});var s=[];e=function(e,n,t,o,u,c){function l(){(nn=oe(window.location.hostname,window.location.href,J()))[1]!==rn&&(on=J(rn)),tn=G(nn[0]),rn=nn[1]}function f(e){for(var n=function(e){return function(n){var t=n.currentTarget;n=V(e,Vn,{domainUserId:Ze,userId:Xe||void 0,sessionId:Qe,sourceId:un,sourcePlatform:an,event:n}),null!=t&&t.href&&(t.href=Q(t.href,"_sp",n))}}(Nn),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 d(e){if(_e){var n=/#.*/;e=e.replace(n,"")}return ze&&(n=/[{}]/g,e=e.replace(n,"")),e}function v(e){return(e=/^([a-z]+):/.exec(e))?e[1]:null}function p(e){return e=dn+e+"."+We,"localStorage"==An?j(e):"cookie"==An||"cookieAndLocalStorage"==An?je.getCookie(e):void 0}function g(){l(),We=Le((vn||tn)+(gn||"/")).slice(0,4)}function h(){qe=(new Date).getTime()}function m(){var e=y(),n=e[0];n<Fe?Fe=n:n>He&&(He=n),(e=e[1])<Ge?Ge=e:e>Je&&(Je=e),h()}function y(){var e=document.documentElement;return e?[e.scrollLeft||window.pageXOffset,e.scrollTop||window.pageYOffset]:[0,0]}function w(){var e=y(),n=e[0];He=Fe=n,Je=Ge=e=e[1]}function b(){return k(dn+"ses."+We,"*",Sn)}function S(e){var n=dn+"id."+We,t=xn;return e=r([],e,!0),t&&(e[1]="",e[7]=""),e.shift(),k(n,t=e.join("."),bn)}function k(e,n,t){return!(xn&&!kn)&&("localStorage"==An?U(e,n,t):("cookie"==An||"cookieAndLocalStorage"==An)&&je.setCookie(e,n,t,gn,vn,hn,mn))}function T(e){var n=dn+"id."+We,t=dn+"ses."+We;R(n),R(t),je.deleteCookie(n,gn,vn,hn,mn),je.deleteCookie(t,gn,vn,hn,mn),null!=e&&e.preserveSession||(Qe=i(),Pn=1),null!=e&&e.preserveUser||(Ze=xn?"":i(),Xe=null)}function x(e){e&&e.stateStorageStrategy&&(c.stateStorageStrategy=e.stateStorageStrategy,An=Pe(c)),xn=!!c.anonymousTracking,kn=Ie(c),Tn=Ee(c),In.setUseLocalStorage("localStorage"==An||"cookieAndLocalStorage"==An),In.setAnonymousTracking(Tn)}function A(){if(!xn||kn){var e="none"!=An&&!!p("ses"),n=C();if(n[1])var t=n[1];else t=xn?"":i(),n[1]=t;Ze=t,Qe=e?n[6]:ie(n),Pn=n[3],"none"!=An&&(b(),ae(n),S(n),n[10]||je.flush())}}function C(){return"none"==An?["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]=i()),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 a=function(e,n){return e=parseInt(e),isNaN(e)?n:e};return n=function(e){return e?a(e,void 0):void 0},[e[0],e[1],a(e[2],o),a(e[3],r),a(e[4],o),n(e[5]),e[6],e[7],e[8],n(e[9]),a(e[10],0)]}(p("id")||void 0,Ze,Qe,Pn)}function I(e){return 0===e.indexOf("http")?e:("https:"===document.location.protocol?"https":"http")+"://"+e}function E(){En&&null!=u.pageViewId||(u.pageViewId=i(),u.pageViewUrl=Ne||rn)}function O(){return function(){if(null==u.pageViewId)return!0;if(En||!On)return!1;if(void 0===u.pageViewUrl)return!0;var e=Ne||rn;if(!0===On||"full"==On||!("URL"in window))return u.pageViewUrl!=e;e=new URL(e);var n=new URL(u.pageViewUrl);return"pathname"==On?e.pathname!=n.pathname:"pathnameAndSearch"==On&&(e.pathname!=n.pathname||e.search!=n.search)}()&&(u.pageViewId=i(),u.pageViewUrl=Ne||rn),u.pageViewId}function L(){if("none"===An||xn||!De)return null;var e=B("_sp_tab_id");return e||(N("_sp_tab_id",i()),e=B("_sp_tab_id")),e||null}function D(e){var n=e.title,t=e.context,r=e.timestamp;if(e=e.contextCallback,l(),Ln&&Ln==O()&&E(),Ln=O(),sn=document.title,n?(Ve=n,ln=!0):ln&&(Ve=null),n=F(Ve||sn),$e.track(function(e){var n=e.pageUrl,t=e.pageTitle;e=e.referrer;var r=a();return r.add("e","pv"),r.add("url",n),r.add("page",t),r.add("refr",e),r}({pageUrl:d(Ne||rn),pageTitle:n,referrer:d(Ue||on)}),(t||[]).concat(e?e():[]),r),r=new Date,n=!1,Dn.enabled&&!Dn.installed){n=Dn.installed=!0;var o={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),o.hasSupport=e}}};o.update();var i="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";Object.prototype.hasOwnProperty.call(o,"hasSupport")?W(document,i,h,{passive:!0}):W(document,i,h),w(),i=function(e,n){return void 0===n&&(n=h),function(e){return W(document,e,n)}},"click mouseup mousedown mousemove keypress keydown keyup touchend touchstart".split(" ").forEach(i(document)),["resize","focus","blur"].forEach(i(window)),i(window,m)("scroll")}if(Dn.enabled&&(fn||n))for(r in qe=r.getTime(),r=void 0,Dn.configurations)(n=Dn.configurations[r])&&(window.clearInterval(n.activityInterval),_(n,t,e))}function _(e,n,t){var r=function(e,n){l(),e({context:n,pageViewId:O(),minXOffset:Fe,minYOffset:Ge,maxXOffset:He,maxYOffset:Je}),w()},o=function(){qe+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(){qe+e.configMinimumVisitLength>(new Date).getTime()&&r(e.callback,(n||[]).concat(t?t():[])),e.activityInterval=window.setInterval(o,e.configHeartBeatTimer)}),e.configMinimumVisitLength)}function z(e){var n=e.minimumVisitLength,t=e.heartbeatDelay;if(e=e.callback,M(n)&&M(t))return{configMinimumVisitLength:1e3*n,configHeartBeatTimer:1e3*t,callback:e};Ae.error("Activity tracking minimumVisitLength & heartbeatDelay must be integers")}function Y(e){var n=e.context,t=e.minXOffset,r=e.minYOffset,o=e.maxXOffset,i=e.maxYOffset;(e=document.title)!==sn&&(sn=e,Ve=void 0);var u=(e=$e).track,c=d(Ne||rn),s=F(Ve||sn),l=d(Ue||on);t=Math.round(t),o=Math.round(o),r=Math.round(r),i=Math.round(i);var f=a();f.add("e","pp"),f.add("url",c),f.add("page",s),f.add("refr",l),t&&!isNaN(Number(t))&&f.add("pp_mix",t.toString()),o&&!isNaN(Number(o))&&f.add("pp_max",o.toString()),r&&!isNaN(Number(r))&&f.add("pp_miy",r.toString()),i&&!isNaN(Number(i))&&f.add("pp_may",i.toString()),u.call(e,f,n)}function K(e){var n=Dn.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),Dn.configurations[e]=void 0}var $,ee,ne,te,se,le,fe,de,ve,pe,ge,me,ye,we,be,Se,ke,Te,xe,Ce;c.eventMethod=null!==($=c.eventMethod)&&void 0!==$?$:"post";var Pe=function(e){var n;return null!==(n=e.stateStorageStrategy)&&void 0!==n?n:"cookieAndLocalStorage"},Ie=function(e){var n;return"boolean"!=typeof e.anonymousTracking&&!0===(null===(n=e.anonymousTracking)||void 0===n?void 0:n.withSessionTracking)},Ee=function(e){var n;return"boolean"!=typeof e.anonymousTracking&&!0===(null===(n=e.anonymousTracking)||void 0===n?void 0:n.withServerAnonymisation)},Oe=null!==(ne=null===(ee=null==c?void 0:c.contexts)||void 0===ee?void 0:ee.browser)&&void 0!==ne&&ne,De=null===(se=null===(te=null==c?void 0:c.contexts)||void 0===te?void 0:te.webPage)||void 0===se||se,je=c.synchronousCookieWrite?Be:Re;s.push({beforeTrack:function(e){var n=p("ses"),t=C(),r=0===t[10];if(Ye=!!Me&&!!je.getCookie(Me),wn||Ye)T();else{if("0"===t[0]?(Qe=n||"none"==An?t[6]:ie(t),Pn=t[3]):(new Date).getTime()-Cn>1e3*Sn&&(Pn++,Qe=ie(t,{memorizedVisitCount:Pn})),ae(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=ce()).documentSize;e.add("vp",o.viewport),e.add("ds",i),e.add("vid",kn?Pn:xn?null:Pn),e.add("sid",kn?Qe:xn?null:Qe),e.add("duid",xn?null:t[1]),e.add("uid",xn?null:Xe),l(),e.add("refr",d(Ue||on)),e.add("url",d(Ne||rn)),o=ue(t,An,xn),!jn||xn&&!kn||e.addContextEntity({schema:"iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2",data:o}),"none"!=An&&(S(t),e=b(),n&&!r||!e||!Un||Rn||(je.flush(),Un(o),Rn=!1)),Cn=(new Date).getTime()}}}),De&&s.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",data:{id:O()}}]}}),Oe&&s.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/browser_context/jsonschema/2-0-0",data:he(he({},ce()),{tabId:L()})}]}}),s.push.apply(s,null!==(le=c.plugins)&&void 0!==le?le:[]);var Ue,Ne,Ve,_e,ze,Me,qe,Fe,He,Ge,Je,We,Ze,Qe,Xe,Ye,Ke,$e=P({base64:null!==(fe=c.encodeBase64)&&void 0!==fe?fe:"post"!==c.eventMethod,corePlugins:s,callback:function(e){wn||Ye||In.enqueueRequest(e.build())}}),en=document.characterSet||document.charset,nn=oe(window.location.hostname,window.location.href,J()),tn=G(nn[0]),rn=nn[1],on=nn[2],an=null!==(de=c.platform)&&void 0!==de?de:"web",un=null!==(ve=c.appId)&&void 0!==ve?ve:"",cn=c.appVersion,sn=document.title,ln=!1,fn=null===(pe=c.resetActivityTrackingOnPageView)||void 0===pe||pe,dn=null!==(ge=c.cookieName)&&void 0!==ge?ge:"_sp_",vn=null!==(me=c.cookieDomain)&&void 0!==me?me:void 0,pn=null!==(ye=c.discoverRootDomain)&&void 0!==ye?ye:void 0===vn,gn="/",hn=null!==(we=c.cookieSameSite)&&void 0!==we?we:"Lax",mn=null===(be=c.cookieSecure)||void 0===be||be,yn=window.navigator.doNotTrack||window.navigator.msDoNotTrack||window.doNotTrack,wn=void 0!==c.respectDoNotTrack&&(c.respectDoNotTrack&&("yes"===yn||"1"===yn)),bn=null!==(Se=c.cookieLifetime)&&void 0!==Se?Se:63072e3,Sn=null!==(ke=c.sessionCookieTimeout)&&void 0!==ke?ke:1800,kn=Ie(c),Tn=Ee(c),xn=!!c.anonymousTracking,An=Pe(c),Cn=(new Date).getTime(),Pn=1,In=re(he({trackerId:e,endpoint:I(o),serverAnonymization:Tn,useLocalStorage:"localStorage"==An||"cookieAndLocalStorage"==An},c),u),En=!1,On=null!==(Te=c.preservePageViewIdForUrl)&&void 0!==Te&&Te,Ln=void 0,Dn={enabled:!1,installed:!1,configurations:{}},jn=null!==(Ce=null===(xe=c.contexts)||void 0===xe?void 0:xe.session)&&void 0!==Ce&&Ce,Un=c.onSessionUpdateCallback,Rn=!1,Bn="boolean"==typeof(Ke=c.useExtendedCrossDomainLinker||!1)?{useExtendedCrossDomainLinker:Ke}:{useExtendedCrossDomainLinker:!0,collectCrossDomainAttributes:Ke},Nn=Bn.useExtendedCrossDomainLinker,Vn=Bn.collectCrossDomainAttributes;pn&&!vn&&(vn=X(hn,mn));var _n=ce(),zn=_n.browserLanguage,Mn=_n.resolution,qn=_n.colorDepth,Fn=_n.cookiesEnabled,Hn=q();return $e.setTrackerVersion(t),$e.setTrackerNamespace(n),$e.setAppId(un),$e.setPlatform(an),$e.addPayloadPair("cookie",Fn?"1":"0"),$e.addPayloadPair("cs",en),$e.addPayloadPair("lang",zn),$e.addPayloadPair("res",Mn),$e.addPayloadPair("cd",qn),Hn&&$e.addPayloadPair("tz",Hn),cn&&$e.addPlugin({plugin:{contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/application/jsonschema/1-0-0",data:{version:cn}}]}}}),g(),A(),c.crossDomainLinker&&f(c.crossDomainLinker),he(he({},{getDomainSessionIndex:function(){return Pn},getPageViewId:O,getTabId:L,newSession:function(){var e=C();if("0"===e[0]?(Qe="none"!=An?ie(e):e[6],Pn=e[3]):(Pn++,Qe=ie(e,{memorizedVisitCount:Pn})),ae(e),"none"!=An){var n=ue(e,An,xn);S(e),e=b(),je.flush(),e&&Un&&(Rn=!0,Un(n))}Cn=(new Date).getTime()},getCookieName:function(e){return dn+e+"."+We},getUserId:function(){return Xe},getDomainUserId:function(){return C()[1]},getDomainUserInfo:function(){return C()},setReferrerUrl:function(e){Ue=e},setCustomUrl:function(e){l();var n,t=rn;v(e)?Ne=e:"/"===e.slice(0,1)?Ne=v(t)+"://"+H(t)+e:(0<=(n=(t=d(t)).indexOf("?"))&&(t=t.slice(0,n)),(n=t.lastIndexOf("/"))!==t.length-1&&(t=t.slice(0,n+1)),Ne=t+e)},setDocumentTitle:function(e){sn=document.title,Ve=e,ln=!1},discardHashTag:function(e){_e=e},discardBrace:function(e){ze=e},setCookiePath:function(e){gn=e,g()},setVisitorCookieTimeout:function(e){bn=e},crossDomainLinker:function(e){f(e)},enableActivityTracking:function(e){Dn.configurations.pagePing||(Dn.enabled=!0,Dn.configurations.pagePing=z(he(he({},e),{callback:Y})))},enableActivityTrackingCallback:function(e){Dn.configurations.callback||(Dn.enabled=!0,Dn.configurations.callback=z(e))},disableActivityTracking:function(){K("pagePing")},disableActivityTrackingCallback:function(){K("callback")},updatePageActivity:function(){h()},setOptOutCookie:function(e){Me=e},setUserId:function(e){Xe=e},setUserIdFromLocation:function(e){l(),Xe=Z(e,rn)},setUserIdFromReferrer:function(e){l(),Xe=Z(e,on)},setUserIdFromCookie:function(e){Xe=je.getCookie(e)},setCollectorUrl:function(e){In.setCollectorUrl(I(e))},setBufferSize:function(e){In.setBufferSize(e)},flushBuffer:function(e){void 0===e&&(e={}),In.executeQueue(),e.newBufferSize&&In.setBufferSize(e.newBufferSize)},trackPageView:function(e){void 0===e&&(e={}),D(e)},preservePageViewId:function(){En=!0},preservePageViewIdForUrl:function(e){On=e},disableAnonymousTracking:function(e){c.anonymousTracking=!1,x(e),A(),In.executeQueue()},enableAnonymousTracking:function(e){var n;c.anonymousTracking=null===(n=e&&(null==e?void 0:e.options))||void 0===n||n,x(e),kn||E()},clearUserData:T}),{id:e,namespace:n,core:$e,sharedState:u})}(e,n,t,o,u,c);var l=he(he({},e),{addPlugin:function(e){var n,t;l.core.addPlugin(e),null===(t=(n=e.plugin).activateBrowserPlugin)||void 0===t||t.call(n,l)}});return s.forEach((function(e){var n;null===(n=e.activateBrowserPlugin)||void 0===n||n.call(e,l)})),l}function de(e){return pe(e,Ne)}function ve(){return Object.keys(Ne)}function pe(e,n){for(var t=[],r=0;r<e.length;r++){var o=e[r];n.hasOwnProperty(o)?t.push(n[o]):Ae.warn(o+" not configured")}return t}function ge(){try{return!!window.localStorage}catch(e){return!0}}var he=function(){return he=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},he.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;for(var me=[],ye=0;256>ye;++ye)me.push((ye+256).toString(16).slice(1));var we,be,Se,ke=new Uint8Array(16),Te={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";(Se=be||(be={}))[Se.none=0]="none",Se[Se.error=1]="error",Se[Se.warn=2]="warn",Se[Se.debug=3]="debug",Se[Se.info=4]="info";var Ae=function(e){return void 0===e&&(e=be.warn),{setLogLevel:function(n){e=be[n]?n:be.warn},warn:function(n,t){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=be.warn&&"undefined"!=typeof console&&(i="Snowplow: "+n,t?console.warn.apply(console,r([i+"\n",t],o,!1)):console.warn.apply(console,r([i],o,!1)))},error:function(n,t){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=be.error&&"undefined"!=typeof console&&(i="Snowplow: "+n+"\n",t?console.error.apply(console,r([i+"\n",t],o,!1)):console.error.apply(console,r([i],o,!1)))},debug:function(n){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];e>=be.debug&&"undefined"!=typeof console&&console.debug.apply(console,r(["Snowplow: "+n],t,!1))},info:function(n){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];e>=be.info&&"undefined"!=typeof console&&console.info.apply(console,r(["Snowplow: "+n],t,!1))}}}(),Ce={},Pe={};!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}};Pe=e}();var Ie={utf8:{stringToBytes:function(e){return Ie.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(Ie.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("")}}},Ee=Ie;!function(){var e=Pe,n=Ee.utf8,t=Ee.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,p=s,g=l,h=f,m=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+=p,l+=g,f+=h,d+=m}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,Ce=r}();var Oe,Le=Ce,De={sessionId:!0,sourceId:!0,sourcePlatform:!1,userId:!1,reason:!1},je=!1,Ue="x",Re=function(){function e(e){return n[e]||(n[e]=function(e){function n(){void 0!==t&&(clearTimeout(t),t=void 0),i||(i=!0,void 0!==r&&$(e,r[0],r[1],r[2],r[3],r[4],r[5]))}var t,r,o,i=!0;return{getValue:function(){var n;return r&&(!o||o>new Date)&&null!==(n=r[0])&&void 0!==n?n:$(e)},setValue:function(e,a,u,c,s,l){return r=[e,a,u,c,s,l],i=!1,void 0===t&&(t=setTimeout((function(){t=void 0,n()}),10)),o=new Date(Date.now()+1e3*Math.min(.05,null!=a?a:.05)),!0},deleteValue:function(n,o,a,u){r=void 0,i=!0,void 0!==t&&(clearTimeout(t),t=void 0),Y(e,n,o,a,u)},flush:n}}(e)),n[e]}var n={};return{getCookie:function(n){return e(n).getValue()},setCookie:function(n,t,r,o,i,a,u){return e(n).setValue(t,r,o,i,a,u)},deleteCookie:function(n,t,r,o,i){e(n).deleteValue(t,r,o,i)},clearCache:function(){n={}},flush:function(){for(var e=0,t=Object.values(n);e<t.length;e++)t[e].flush()}}}(),Be={getCookie:$,setCookie:function(e,n,t,r,o,i,a){return $(e,n,t,r,o,i,a),-1!==document.cookie.indexOf("".concat(e,"="))},deleteCookie:Y,flush:function(){}},Ne={},Ve=function(){this.bufferFlushers=[],this.hasLoaded=!1,this.registeredOnLoadHandlers=[]};e.SharedState=Ve,e.addEventListener=W,e.addTracker=function(e,n,t,r,o,i){return Ne.hasOwnProperty(e)?null:(Ne[e]=fe(e,n,t,r,o,i),Ne[e])},e.allTrackerNames=ve,e.allTrackers=function(){return Ne},e.attemptDeleteLocalStorage=R,e.attemptGetLocalStorage=j,e.attemptGetSessionStorage=B,e.attemptWriteLocalStorage=U,e.attemptWriteSessionStorage=N,e.cookie=$,e.createCrossDomainParameterValue=V,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 Ve,t=document,r=window;return t.visibilityState&&W(t,"visibilitychange",(function(){"hidden"==t.visibilityState&&n.bufferFlushers.forEach((function(e){e(!1)}))}),!1),W(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())})),W(r,"load",e,!1)):e(),n},e.decorateQuerystring=Q,e.deleteCookie=Y,e.dispatchToTrackers=function(e,n){try{de(null!=e?e:ve()).forEach(n)}catch(e){Ae.error("Function failed",e)}},e.dispatchToTrackersInCollection=function(e,n,t){try{pe(null!=e?e:Object.keys(n),n).forEach(t)}catch(e){Ae.error("Function failed",e)}},e.findRootDomain=X,e.fixupDomain=G,e.fixupTitle=F,e.fixupUrl=oe,e.flushPendingCookies=function(){Re.flush()},e.fromQuerystring=Z,e.getCookiesWithPrefix=K,e.getCssClasses=ee,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=te(e);return ne(e,(function(e){e:{var r=0;for(e=ee(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=te(e);return ne(e,(function(e){return e.name in t===n}))},e.getHostName=H,e.getReferrer=J,e.getTimeZone=q,e.getTracker=function(e){return Ne.hasOwnProperty(e)?Ne[e]:(Ae.warn(e+" not configured"),null)},e.getTrackers=de,e.hasLocalStorage=ge,e.hasSessionStorage=function(){try{return!!window.sessionStorage}catch(e){return!0}},e.isFunction=function(e){return!(!e||"function"!=typeof e)},e.isInteger=M,e.isString=z,e.isValueInArray=function(e,n){for(var t=0;t<n.length;t++)if(n[t]===e)return!0;return!1},e.localStorageAccessible=function(){if(!ge())return!1;try{var e=window.localStorage;return e.setItem("modernizr","modernizr"),e.removeItem("modernizr"),!0}catch(e){return!1}},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 Ne.hasOwnProperty(e)},e.urlSafeBase64Encode=_,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map
{
"name": "@snowplow/browser-tracker-core",
"version": "4.0.4",
"version": "4.1.0",
"description": "Core functionality for Snowplow Browser trackers",

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

"uuid": "^10.0.0",
"@snowplow/tracker-core": "4.0.4"
"@snowplow/tracker-core": "4.1.0"
},

@@ -27,0 +27,0 @@ "devDependencies": {

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