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