diff options
author | Justin Velluppillai <justin@innocraft.com> | 2022-03-24 13:53:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-24 13:53:44 +0300 |
commit | b2a17cb2e59043b2978286e97cdec584e3e2393f (patch) | |
tree | 584d5724f0c471405a62c1c569425b87d151f113 | |
parent | 738333d186a5587413a388ecca7d8aafff1d570f (diff) |
Don't create cookies when disabled (#18935)
* Rebuilding
* Empty commit
* rebuilt piwik.js
* Need to track a pageview before checking cookie
* more fixes for tests where not setting visitorId cookie until tracking request first sent
* a few more test fixes
* allow a little longer for beforeUnloadHandler now it does more by default...
* bump it a little higher
* track a page view so the referer tests work
* undo last
* testing
* give more info
* removed test code
* undo test changes, set a variable to store initial visitor id while the cookie isn't set
* one more test removal
* Track a pageview to create cookie before testing matching visitorIds
* rebuilt piwik.js
* trackpageview so some more visitorid tests pass
* one more tracking request now
* allow more time for beforeUnloadHandler
* Instead of storing a temporary variable we just create the cookie when getVisitorId is called, if it is not existing
* rebuilt piwik.js
* Removed unnecessary changes
* rebuilt piwik.js
* minor fixes
* different approach
* rebuilt piwik.js
* set visitor id cookie in getVisitorInfo also
* rebuilt piwik.js
* remove unnecessary configCookiesDisabled check
* rebuilt piwik.js
Co-authored-by: justinvelluppillai <justinvelluppillai@users.noreply.github.com>
-rw-r--r-- | js/piwik.js | 32 | ||||
-rw-r--r-- | js/piwik.min.js | 28 | ||||
-rw-r--r-- | matomo.js | 28 | ||||
-rw-r--r-- | piwik.js | 28 | ||||
-rw-r--r-- | tests/javascript/index.php | 2 |
5 files changed, 65 insertions, 53 deletions
diff --git a/js/piwik.js b/js/piwik.js index 41dd1af52e..7b1ba0e56b 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -4896,7 +4896,6 @@ if (typeof window.Matomo !== 'object') { * initialize tracker */ updateDomainHash(); - setVisitorIdCookie(); /*<DEBUG>*/ /* @@ -5000,26 +4999,30 @@ if (typeof window.Matomo !== 'object') { }; /** - * Get visitor ID (from first party cookie) - * - * @return string Visitor ID in hexits (or empty string, if not yet known) - */ - this.getVisitorId = function () { - return getValuesFromVisitorIdCookie().uuid; - }; - - /** * Get the visitor information (from first party cookie) * * @return array */ this.getVisitorInfo = function () { + if (!getCookie(getCookieName('id'))) { + setVisitorIdCookie(); + } + // Note: in a new method, we could return also return getValuesFromVisitorIdCookie() // which returns named parameters rather than returning integer indexed array return loadVisitorIdCookie(); }; /** + * Get visitor ID (from first party cookie) + * + * @return string Visitor ID in hexits (or empty string, if not yet known) + */ + this.getVisitorId = function () { + return this.getVisitorInfo()[1]; + }; + + /** * Get the Attribution information, which is an array that contains * the Referrer used to reach the site as well as the campaign name and keyword * It is useful only when used in conjunction with Tracker API function setAttributionInfo() @@ -7071,6 +7074,15 @@ if (typeof window.Matomo !== 'object') { }); Matomo.trigger('TrackerSetup', [this]); + + Matomo.addPlugin('TrackerVisitorIdCookie' + uniqueTrackerId, { + // if no tracking request was sent we refresh the visitor id cookie on page unload + unload: function () { + if (!hasSentTrackingRequestYet) { + setVisitorIdCookie(); + } + } + }); } function TrackerProxy() { diff --git a/js/piwik.min.js b/js/piwik.min.js index ea636ad0cc..ec048226eb 100644 --- a/js/piwik.min.js +++ b/js/piwik.min.js @@ -50,20 +50,20 @@ var dw=new RegExp("^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mai var du=cB(dv,"click",dw);if(du){dy+="&"+du}var dx=cy(dy,dA,"link");bM(dx,bQ,dz)}function b0(du,dt){if(du!==""){return du+dt.charAt(0).toUpperCase()+dt.slice(1)}return dt}function cm(dy){var dx,dt,dw=["","webkit","ms","moz"],dv;if(!bk){for(dt=0;dt<dw.length;dt++){dv=dw[dt];if(Object.prototype.hasOwnProperty.call(J,b0(dv,"hidden"))){if(J[b0(dv,"visibilityState")]==="prerender"){dx=true}break}}}if(dx){ar(J,dv+"visibilitychange",function du(){J.removeEventListener(dv+"visibilitychange",du,false);dy()});return}dy()}function by(){var du=bP.getVisitorId();var dt=aO();return du+dt}function cp(dt){if(!dt){return}if(!ai.hasNodeAttribute(dt,"href")){return}var du=ai.getAttributeValueFromNode(dt,"href");if(!du||aZ(du)){return}if(!bP.getVisitorId()){return}du=j(du,az);var dv=by();du=I(du,az,dv);ai.setAnyAttribute(dt,"href",du)}function br(dw){var dx=ai.getAttributeValueFromNode(dw,"href");if(!dx){return false}dx=String(dx);var du=dx.indexOf("//")===0||dx.indexOf("http://")===0||dx.indexOf("https://")===0; if(!du){return false}var dt=dw.pathname||cr(dw.href);var dv=(dw.hostname||d(dw.href)).toLowerCase();if(aw(dv,dt)){if(!cP(c2,O(dv))){return true}return false}return false}function cO(dt){var du=dl(dt);if(du&&du.type){du.href=p(du.href);db(du.href,du.type,undefined,null,dt);return}if(cV){dt=ay(dt);if(br(dt)){cp(dt)}}}function cD(){return J.all&&!J.addEventListener}function c3(dt){var dv=dt.which;var du=(typeof dt.button);if(!dv&&du!=="undefined"){if(cD()){if(dt.button&1){dv=1}else{if(dt.button&2){dv=3}else{if(dt.button&4){dv=2}}}}else{if(dt.button===0||dt.button==="0"){dv=1}else{if(dt.button&1){dv=2}else{if(dt.button&2){dv=3}}}}}return dv}function bZ(dt){switch(c3(dt)){case 1:return"left";case 2:return"middle";case 3:return"right"}}function a7(dt){return dt.target||dt.srcElement}function c4(dt){return dt==="A"||dt==="AREA"}function aG(dt){function du(dw){var dx=a7(dw);var dy=dx.nodeName;var dv=a6(bG,"ignore");while(!c4(dy)&&dx&&dx.parentNode){dx=dx.parentNode;dy=dx.nodeName}if(dx&&c4(dy)&&!dv.test(dx.className)){return dx }}return function(dx){dx=dx||W.event;var dy=du(dx);if(!dy){return}var dw=bZ(dx);if(dx.type==="click"){var dv=false;if(dt&&dw==="middle"){dv=true}if(dy&&!dv){cO(dy)}}else{if(dx.type==="mousedown"){if(dw==="middle"&&dy){aW=dw;bI=dy}else{aW=bI=null}}else{if(dx.type==="mouseup"){if(dw===aW&&dy===bI){cO(dy)}aW=bI=null}else{if(dx.type==="contextmenu"){cO(dy)}}}}}}function av(dw,dv,dt){var du=typeof dv;if(du==="undefined"){dv=true}ar(dw,"click",aG(dv),dt);if(dv){ar(dw,"mouseup",aG(dv),dt);ar(dw,"mousedown",aG(dv),dt);ar(dw,"contextmenu",aG(dv),dt)}}function aX(du,dx,dy){if(ck){return true}ck=true;var dz=false;var dw,dv;function dt(){dz=true}n(function(){function dA(dC){setTimeout(function(){if(!ck){return}dz=false;dy.trackVisibleContentImpressions();dA(dC)},dC)}function dB(dC){setTimeout(function(){if(!ck){return}if(dz){dz=false;dy.trackVisibleContentImpressions()}dB(dC)},dC)}if(du){dw=["scroll","resize"];for(dv=0;dv<dw.length;dv++){if(J.addEventListener){J.addEventListener(dw[dv],dt,false)}else{W.attachEvent("on"+dw[dv],dt) -}}dB(100)}if(dx&&dx>0){dx=parseInt(dx,10);dA(dx)}})}var bK={enabled:true,requests:[],timeout:null,interval:2500,sendRequests:function(){var dt=this.requests;this.requests=[];if(dt.length===1){bM(dt[0],bQ)}else{dp(dt,bQ)}},canQueue:function(){return !m&&this.enabled},pushMultiple:function(du){if(!this.canQueue()){dp(du,bQ);return}var dt;for(dt=0;dt<du.length;dt++){this.push(du[dt])}},push:function(dt){if(!dt){return}if(!this.canQueue()){bM(dt,bQ);return}bK.requests.push(dt);if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.timeout=setTimeout(function(){bK.timeout=null;bK.sendRequests()},bK.interval);var du="RequestQueue"+aB;if(!Object.prototype.hasOwnProperty.call(b,du)){b[du]={unload:function(){if(bK.timeout){clearTimeout(bK.timeout)}bK.sendRequests()}}}}};bo();aR();this.hasConsent=function(){return bJ};this.getVisitorId=function(){return a4().uuid};this.getVisitorInfo=function(){return cW()};this.getAttributionInfo=function(){return bS()};this.getAttributionCampaignName=function(){return bS()[0] -};this.getAttributionCampaignKeyword=function(){return bS()[1]};this.getAttributionReferrerTimestamp=function(){return bS()[2]};this.getAttributionReferrerUrl=function(){return bS()[3]};this.setTrackerUrl=function(dt){aI=dt};this.getTrackerUrl=function(){return aI};this.getMatomoUrl=function(){return aa(this.getTrackerUrl(),bO)};this.getPiwikUrl=function(){return this.getMatomoUrl()};this.addTracker=function(dv,du){if(!M(dv)||null===dv){dv=this.getTrackerUrl()}var dt=new T(dv,du);L.push(dt);u.trigger("TrackerAdded",[this]);return dt};this.getSiteId=function(){return cc};this.setSiteId=function(dt){b9(dt)};this.resetUserId=function(){bF=""};this.setUserId=function(dt){if(ac(dt)){bF=dt}};this.setVisitorId=function(du){var dt=/[0-9A-Fa-f]{16}/g;if(x(du)&&dt.test(du)){bU=du}else{ao("Invalid visitorId set"+du)}};this.getUserId=function(){return bF};this.setCustomData=function(dt,du){if(Z(dt)){at=dt}else{if(!at){at={}}at[dt]=du}};this.getCustomData=function(){return at};this.setCustomRequestProcessing=function(dt){ch=dt -};this.appendToTrackingUrl=function(dt){c9=dt};this.getRequest=function(dt){return cy(dt)};this.addPlugin=function(dt,du){b[dt]=du};this.setCustomDimension=function(dt,du){dt=parseInt(dt,10);if(dt>0){if(!M(du)){du=""}if(!x(du)){du=String(du)}bt[dt]=du}};this.getCustomDimension=function(dt){dt=parseInt(dt,10);if(dt>0&&Object.prototype.hasOwnProperty.call(bt,dt)){return bt[dt]}};this.deleteCustomDimension=function(dt){dt=parseInt(dt,10);if(dt>0){delete bt[dt]}};this.setCustomVariable=function(du,dt,dx,dv){var dw;if(!M(dv)){dv="visit"}if(!M(dt)){return}if(!M(dx)){dx=""}if(du>0){dt=!x(dt)?String(dt):dt;dx=!x(dx)?String(dx):dx;dw=[dt.slice(0,bA),dx.slice(0,bA)];if(dv==="visit"||dv===2){cN();aV[du]=dw}else{if(dv==="page"||dv===3){b2[du]=dw}else{if(dv==="event"){cs[du]=dw}}}}};this.getCustomVariable=function(du,dv){var dt;if(!M(dv)){dv="visit"}if(dv==="page"||dv===3){dt=b2[du]}else{if(dv==="event"){dt=cs[du]}else{if(dv==="visit"||dv===2){cN();dt=aV[du]}}}if(!M(dt)||(dt&&dt[0]==="")){return false -}return dt};this.deleteCustomVariable=function(dt,du){if(this.getCustomVariable(dt,du)){this.setCustomVariable(dt,"","",du)}};this.deleteCustomVariables=function(dt){if(dt==="page"||dt===3){b2={}}else{if(dt==="event"){cs={}}else{if(dt==="visit"||dt===2){aV={}}}}};this.storeCustomVariablesInCookie=function(){bW=true};this.setLinkTrackingTimer=function(dt){bQ=dt};this.getLinkTrackingTimer=function(){return bQ};this.setDownloadExtensions=function(dt){if(x(dt)){dt=dt.split("|")}dg=dt};this.addDownloadExtensions=function(du){var dt;if(x(du)){du=du.split("|")}for(dt=0;dt<du.length;dt++){dg.push(du[dt])}};this.removeDownloadExtensions=function(dv){var du,dt=[];if(x(dv)){dv=dv.split("|")}for(du=0;du<dg.length;du++){if(P(dv,dg[du])===-1){dt.push(dg[du])}}dg=dt};this.setDomains=function(dt){aC=x(dt)?[dt]:dt;var dx=false,dv=0,du;for(dv;dv<aC.length;dv++){du=String(aC[dv]);if(cP(c2,O(du))){dx=true;break}var dw=cr(du);if(dw&&dw!=="/"&&dw!=="/*"){dx=true;break}}if(!dx){aC.push(c2)}};this.enableCrossDomainLinking=function(){cV=true -};this.disableCrossDomainLinking=function(){cV=false};this.isCrossDomainLinkingEnabled=function(){return cV};this.setCrossDomainLinkingTimeout=function(dt){a5=dt};this.getCrossDomainLinkingUrlParameter=function(){return t(az)+"="+t(by())};this.setIgnoreClasses=function(dt){bG=x(dt)?[dt]:dt};this.setRequestMethod=function(dt){if(dt){dj=String(dt).toUpperCase()}else{dj=cn}if(dj==="GET"){this.disableAlwaysUseSendBeacon()}};this.setRequestContentType=function(dt){cE=dt||aM};this.setGenerationTimeMs=function(dt){ao("setGenerationTimeMs is no longer supported since Matomo 4. The call will be ignored. The replacement is setPagePerformanceTiming.")};this.setPagePerformanceTiming=function(dx,dz,dy,du,dA,dv){var dw={pf_net:dx,pf_srv:dz,pf_tfr:dy,pf_dm1:du,pf_dm2:dA,pf_onl:dv};try{dw=Q(dw,M);dw=B(dw);ct=l(dw);if(ct===""){ao("setPagePerformanceTiming() called without parameters. This function needs to be called with at least one performance parameter.");return}bn=false;bL=true}catch(dt){ao("setPagePerformanceTiming: "+dt.toString()) -}};this.setReferrerUrl=function(dt){bu=dt};this.setCustomUrl=function(dt){ba=b1(bT,dt)};this.getCurrentUrl=function(){return ba||bT};this.setDocumentTitle=function(dt){bp=dt};this.setPageViewId=function(dt){aQ=dt;bH=true};this.setAPIUrl=function(dt){bO=dt};this.setDownloadClasses=function(dt){bR=x(dt)?[dt]:dt};this.setLinkClasses=function(dt){be=x(dt)?[dt]:dt};this.setCampaignNameKey=function(dt){cw=x(dt)?[dt]:dt};this.setCampaignKeywordKey=function(dt){bN=x(dt)?[dt]:dt};this.discardHashTag=function(dt){bV=dt};this.setCookieNamePrefix=function(dt){bq=dt;if(aV){aV=b3()}};this.setCookieDomain=function(dt){var du=O(dt);if(!bs&&!bD(du)){ao("Can't write cookie on domain "+dt)}else{c7=du;bo()}};this.setExcludedQueryParams=function(dt){co=x(dt)?[dt]:dt};this.getCookieDomain=function(){return c7};this.hasCookies=function(){return"1"===cb()};this.setSessionCookie=function(dv,du,dt){if(!dv){throw new Error("Missing cookie name")}if(!M(dt)){dt=cu}bB.push(dv);dn(aY(dv),du,dt,bw,c7,bY,aN)};this.getCookie=function(du){var dt=aH(aY(du)); -if(dt===0){return null}return dt};this.setCookiePath=function(dt){bw=dt;bo()};this.getCookiePath=function(dt){return bw};this.setVisitorCookieTimeout=function(dt){cS=dt*1000};this.setSessionCookieTimeout=function(dt){cu=dt*1000};this.getSessionCookieTimeout=function(){return cu};this.setReferralCookieTimeout=function(dt){df=dt*1000};this.setConversionAttributionFirstReferrer=function(dt){bC=dt};this.setSecureCookie=function(dt){if(dt&&location.protocol!=="https:"){ao("Error in setSecureCookie: You cannot use `Secure` on http.");return}bY=dt};this.setCookieSameSite=function(dt){dt=String(dt);dt=dt.charAt(0).toUpperCase()+dt.toLowerCase().slice(1);if(dt!=="None"&&dt!=="Lax"&&dt!=="Strict"){ao("Ignored value for sameSite. Please use either Lax, None, or Strict.");return}if(dt==="None"){if(location.protocol==="https:"){this.setSecureCookie(true)}else{ao("sameSite=None cannot be used on http, reverted to sameSite=Lax.");dt="Lax"}}aN=dt};this.disableCookies=function(){bs=true;if(cc){aJ()}};this.areCookiesEnabled=function(){return !bs -};this.setCookieConsentGiven=function(){if(bs&&!cY){bs=false;c6=true;if(cc&&aA){aR();var dt=cy("ping=1",null,"ping");bM(dt,bQ)}}};this.requireCookieConsent=function(){if(this.getRememberedCookieConsent()){return false}this.disableCookies();return true};this.getRememberedCookieConsent=function(){return aH(cL)};this.forgetCookieConsentGiven=function(){b5(cL,bw,c7);this.disableCookies()};this.rememberCookieConsentGiven=function(du){if(du){du=du*60*60*1000}else{du=30*365*24*60*60*1000}this.setCookieConsentGiven();var dt=new Date().getTime();dn(cL,dt,du,bw,c7,bY,aN)};this.deleteCookies=function(){aJ()};this.setDoNotTrack=function(du){var dt=g.doNotTrack||g.msDoNotTrack;cY=du&&(dt==="yes"||dt==="1");if(cY){this.disableCookies()}};this.alwaysUseSendBeacon=function(){c5=true};this.disableAlwaysUseSendBeacon=function(){c5=false};this.addListener=function(du,dt){av(du,dt,false)};this.enableLinkTracking=function(du){if(di){return}di=true;var dt=this;q(function(){au=true;var dv=J.body;av(dv,du,true) -})};this.enableJSErrorTracking=function(){if(c0){return}c0=true;var dt=W.onerror;W.onerror=function(dy,dw,dv,dx,du){cm(function(){var dz="JavaScript Errors";var dA=dw+":"+dv;if(dx){dA+=":"+dx}if(P(cz,dz+dA+dy)===-1){cz.push(dz+dA+dy);ax(dz,dA,dy)}});if(dt){return dt(dy,dw,dv,dx,du)}return false}};this.disablePerformanceTracking=function(){a8=false};this.enableHeartBeatTimer=function(dt){dt=Math.max(dt||15,5);bb=dt*1000;if(c8!==null){dq()}};this.disableHeartBeatTimer=function(){if(bb||aS){if(W.removeEventListener){W.removeEventListener("focus",bg);W.removeEventListener("blur",aD);W.removeEventListener("visibilitychange",a0)}else{if(W.detachEvent){W.detachEvent("onfocus",bg);W.detachEvent("onblur",aD);W.detachEvent("visibilitychange",a0)}}}bb=null;aS=false};this.killFrame=function(){if(W.location!==W.top.location){W.top.location=W.location}};this.redirectFile=function(dt){if(W.location.protocol==="file:"){W.location=dt}};this.setCountPreRendered=function(dt){bk=dt};this.trackGoal=function(dt,dw,dv,du){cm(function(){c1(dt,dw,dv,du) -})};this.trackLink=function(du,dt,dw,dv){cm(function(){db(du,dt,dw,dv)})};this.getNumTrackedPageViews=function(){return cx};this.trackPageView=function(dt,dv,du){cg=[];cT=[];cz=[];if(R(cc)){cm(function(){ad(aI,bO,cc)})}else{cm(function(){cx++;b6(dt,dv,du)})}};this.disableBrowserFeatureDetection=function(){c6=false};this.enableBrowserFeatureDetection=function(){c6=true};this.trackAllContentImpressions=function(){if(R(cc)){return}cm(function(){q(function(){var dt=w.findContentNodes();var du=cH(dt);bK.pushMultiple(du)})})};this.trackVisibleContentImpressions=function(dt,du){if(R(cc)){return}if(!M(dt)){dt=true}if(!M(du)){du=750}aX(dt,du,this);cm(function(){n(function(){var dv=w.findContentNodes();var dw=bf(dv);bK.pushMultiple(dw)})})};this.trackContentImpression=function(dv,dt,du){if(R(cc)){return}dv=a(dv);dt=a(dt);du=a(du);if(!dv){return}dt=dt||"Unknown";cm(function(){var dw=aK(dv,dt,du);bK.push(dw)})};this.trackContentImpressionsWithinNode=function(dt){if(R(cc)||!dt){return}cm(function(){if(ck){n(function(){var du=w.findContentNodesWithinNode(dt); -var dv=bf(du);bK.pushMultiple(dv)})}else{q(function(){var du=w.findContentNodesWithinNode(dt);var dv=cH(du);bK.pushMultiple(dv)})}})};this.trackContentInteraction=function(dv,dw,dt,du){if(R(cc)){return}dv=a(dv);dw=a(dw);dt=a(dt);du=a(du);if(!dv||!dw){return}dt=dt||"Unknown";cm(function(){var dx=aU(dv,dw,dt,du);if(dx){bK.push(dx)}})};this.trackContentInteractionNode=function(dv,du){if(R(cc)||!dv){return}var dt=null;cm(function(){dt=dk(dv,du);if(dt){bK.push(dt)}});return dt};this.logAllContentBlocksOnPage=function(){var dv=w.findContentNodes();var dt=w.collectContent(dv);var du=typeof console;if(du!=="undefined"&&console&&console.log){console.log(dt)}};this.trackEvent=function(du,dw,dt,dv,dy,dx){cm(function(){ax(du,dw,dt,dv,dy,dx)})};this.trackSiteSearch=function(dt,dv,du,dw){cg=[];cm(function(){ce(dt,dv,du,dw)})};this.setEcommerceView=function(dx,dt,dv,du){cA={};if(ac(dv)){dv=String(dv)}if(!M(dv)||dv===null||dv===false||!dv.length){dv=""}else{if(dv instanceof Array){dv=W.JSON.stringify(dv) -}}var dw="_pkc";cA[dw]=dv;if(M(du)&&du!==null&&du!==false&&String(du).length){dw="_pkp";cA[dw]=du}if(!ac(dx)&&!ac(dt)){return}if(ac(dx)){dw="_pks";cA[dw]=dx}if(!ac(dt)){dt=""}dw="_pkn";cA[dw]=dt};this.getEcommerceItems=function(){return JSON.parse(JSON.stringify(da))};this.addEcommerceItem=function(dx,dt,dv,du,dw){if(ac(dx)){da[dx]=[String(dx),dt,dv,du,dw]}};this.removeEcommerceItem=function(dt){if(ac(dt)){dt=String(dt);delete da[dt]}};this.clearEcommerceCart=function(){da={}};this.trackEcommerceOrder=function(dt,dx,dw,dv,du,dy){b4(dt,dx,dw,dv,du,dy)};this.trackEcommerceCartUpdate=function(dt){bz(dt)};this.trackRequest=function(du,dw,dv,dt){cm(function(){var dx=cy(du,dw,dt);bM(dx,bQ,dv)})};this.ping=function(){this.trackRequest("ping=1",null,null,"ping")};this.disableQueueRequest=function(){bK.enabled=false};this.setRequestQueueInterval=function(dt){if(dt<1000){throw new Error("Request queue interval needs to be at least 1000ms")}bK.interval=dt};this.queueRequest=function(dt){cm(function(){var du=cy(dt); -bK.push(du)})};this.isConsentRequired=function(){return cI};this.getRememberedConsent=function(){var dt=aH(bj);if(aH(cU)){if(dt){b5(bj,bw,c7)}return null}if(!dt||dt===0){return null}return dt};this.hasRememberedConsent=function(){return !!this.getRememberedConsent()};this.requireConsent=function(){cI=true;bJ=this.hasRememberedConsent();if(!bJ){bs=true}y++;b["CoreConsent"+y]={unload:function(){if(!bJ){aJ()}}}};this.setConsentGiven=function(du){bJ=true;c6=true;b5(cU,bw,c7);var dv,dt;for(dv=0;dv<cT.length;dv++){dt=typeof cT[dv];if(dt==="string"){bM(cT[dv],bQ)}else{if(dt==="object"){dp(cT[dv],bQ)}}}cT=[];if(!M(du)||du){this.setCookieConsentGiven()}};this.rememberConsentGiven=function(dv){if(dv){dv=dv*60*60*1000}else{dv=30*365*24*60*60*1000}var dt=true;this.setConsentGiven(dt);var du=new Date().getTime();dn(bj,du,dv,bw,c7,bY,aN)};this.forgetConsentGiven=function(){var dt=30*365*24*60*60*1000;b5(bj,bw,c7);dn(cU,new Date().getTime(),dt,bw,c7,bY,aN);this.forgetCookieConsentGiven();this.requireConsent() -};this.isUserOptedOut=function(){return !bJ};this.optUserOut=this.forgetConsentGiven;this.forgetUserOptOut=function(){this.setConsentGiven(false)};n(function(){setTimeout(function(){bL=true},0)});u.trigger("TrackerSetup",[this])}function K(){return{push:aj}}function c(ay,ax){var az={};var av,aw;for(av=0;av<ax.length;av++){var at=ax[av];az[at]=1;for(aw=0;aw<ay.length;aw++){if(ay[aw]&&ay[aw][0]){var au=ay[aw][0];if(at===au){aj(ay[aw]);delete ay[aw];if(az[au]>1&&au!=="addTracker"&&au!=="enableLinkTracking"){ao("The method "+au+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Matomo trackers documentation: https://developer.matomo.org/guides/tracking-javascript-guide#multiple-piwik-trackers')}az[au]++}}}}return ay}var E=["addTracker","forgetCookieConsentGiven","requireCookieConsent","disableBrowserFeatureDetection","disableCookies","setTrackerUrl","setAPIUrl","enableCrossDomainLinking","setCrossDomainLinkingTimeout","setSessionCookieTimeout","setVisitorCookieTimeout","setCookieNamePrefix","setCookieSameSite","setSecureCookie","setCookiePath","setCookieDomain","setDomains","setUserId","setVisitorId","setSiteId","alwaysUseSendBeacon","disableAlwaysUseSendBeacon","enableLinkTracking","setCookieConsentGiven","requireConsent","setConsentGiven","disablePerformanceTracking","setPagePerformanceTiming","setExcludedQueryParams"]; +}}dB(100)}if(dx&&dx>0){dx=parseInt(dx,10);dA(dx)}})}var bK={enabled:true,requests:[],timeout:null,interval:2500,sendRequests:function(){var dt=this.requests;this.requests=[];if(dt.length===1){bM(dt[0],bQ)}else{dp(dt,bQ)}},canQueue:function(){return !m&&this.enabled},pushMultiple:function(du){if(!this.canQueue()){dp(du,bQ);return}var dt;for(dt=0;dt<du.length;dt++){this.push(du[dt])}},push:function(dt){if(!dt){return}if(!this.canQueue()){bM(dt,bQ);return}bK.requests.push(dt);if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.timeout=setTimeout(function(){bK.timeout=null;bK.sendRequests()},bK.interval);var du="RequestQueue"+aB;if(!Object.prototype.hasOwnProperty.call(b,du)){b[du]={unload:function(){if(bK.timeout){clearTimeout(bK.timeout)}bK.sendRequests()}}}}};bo();this.hasConsent=function(){return bJ};this.getVisitorInfo=function(){if(!aH(aY("id"))){aR()}return cW()};this.getVisitorId=function(){return this.getVisitorInfo()[1]};this.getAttributionInfo=function(){return bS() +};this.getAttributionCampaignName=function(){return bS()[0]};this.getAttributionCampaignKeyword=function(){return bS()[1]};this.getAttributionReferrerTimestamp=function(){return bS()[2]};this.getAttributionReferrerUrl=function(){return bS()[3]};this.setTrackerUrl=function(dt){aI=dt};this.getTrackerUrl=function(){return aI};this.getMatomoUrl=function(){return aa(this.getTrackerUrl(),bO)};this.getPiwikUrl=function(){return this.getMatomoUrl()};this.addTracker=function(dv,du){if(!M(dv)||null===dv){dv=this.getTrackerUrl()}var dt=new T(dv,du);L.push(dt);u.trigger("TrackerAdded",[this]);return dt};this.getSiteId=function(){return cc};this.setSiteId=function(dt){b9(dt)};this.resetUserId=function(){bF=""};this.setUserId=function(dt){if(ac(dt)){bF=dt}};this.setVisitorId=function(du){var dt=/[0-9A-Fa-f]{16}/g;if(x(du)&&dt.test(du)){bU=du}else{ao("Invalid visitorId set"+du)}};this.getUserId=function(){return bF};this.setCustomData=function(dt,du){if(Z(dt)){at=dt}else{if(!at){at={}}at[dt]=du}};this.getCustomData=function(){return at +};this.setCustomRequestProcessing=function(dt){ch=dt};this.appendToTrackingUrl=function(dt){c9=dt};this.getRequest=function(dt){return cy(dt)};this.addPlugin=function(dt,du){b[dt]=du};this.setCustomDimension=function(dt,du){dt=parseInt(dt,10);if(dt>0){if(!M(du)){du=""}if(!x(du)){du=String(du)}bt[dt]=du}};this.getCustomDimension=function(dt){dt=parseInt(dt,10);if(dt>0&&Object.prototype.hasOwnProperty.call(bt,dt)){return bt[dt]}};this.deleteCustomDimension=function(dt){dt=parseInt(dt,10);if(dt>0){delete bt[dt]}};this.setCustomVariable=function(du,dt,dx,dv){var dw;if(!M(dv)){dv="visit"}if(!M(dt)){return}if(!M(dx)){dx=""}if(du>0){dt=!x(dt)?String(dt):dt;dx=!x(dx)?String(dx):dx;dw=[dt.slice(0,bA),dx.slice(0,bA)];if(dv==="visit"||dv===2){cN();aV[du]=dw}else{if(dv==="page"||dv===3){b2[du]=dw}else{if(dv==="event"){cs[du]=dw}}}}};this.getCustomVariable=function(du,dv){var dt;if(!M(dv)){dv="visit"}if(dv==="page"||dv===3){dt=b2[du]}else{if(dv==="event"){dt=cs[du]}else{if(dv==="visit"||dv===2){cN(); +dt=aV[du]}}}if(!M(dt)||(dt&&dt[0]==="")){return false}return dt};this.deleteCustomVariable=function(dt,du){if(this.getCustomVariable(dt,du)){this.setCustomVariable(dt,"","",du)}};this.deleteCustomVariables=function(dt){if(dt==="page"||dt===3){b2={}}else{if(dt==="event"){cs={}}else{if(dt==="visit"||dt===2){aV={}}}}};this.storeCustomVariablesInCookie=function(){bW=true};this.setLinkTrackingTimer=function(dt){bQ=dt};this.getLinkTrackingTimer=function(){return bQ};this.setDownloadExtensions=function(dt){if(x(dt)){dt=dt.split("|")}dg=dt};this.addDownloadExtensions=function(du){var dt;if(x(du)){du=du.split("|")}for(dt=0;dt<du.length;dt++){dg.push(du[dt])}};this.removeDownloadExtensions=function(dv){var du,dt=[];if(x(dv)){dv=dv.split("|")}for(du=0;du<dg.length;du++){if(P(dv,dg[du])===-1){dt.push(dg[du])}}dg=dt};this.setDomains=function(dt){aC=x(dt)?[dt]:dt;var dx=false,dv=0,du;for(dv;dv<aC.length;dv++){du=String(aC[dv]);if(cP(c2,O(du))){dx=true;break}var dw=cr(du);if(dw&&dw!=="/"&&dw!=="/*"){dx=true; +break}}if(!dx){aC.push(c2)}};this.enableCrossDomainLinking=function(){cV=true};this.disableCrossDomainLinking=function(){cV=false};this.isCrossDomainLinkingEnabled=function(){return cV};this.setCrossDomainLinkingTimeout=function(dt){a5=dt};this.getCrossDomainLinkingUrlParameter=function(){return t(az)+"="+t(by())};this.setIgnoreClasses=function(dt){bG=x(dt)?[dt]:dt};this.setRequestMethod=function(dt){if(dt){dj=String(dt).toUpperCase()}else{dj=cn}if(dj==="GET"){this.disableAlwaysUseSendBeacon()}};this.setRequestContentType=function(dt){cE=dt||aM};this.setGenerationTimeMs=function(dt){ao("setGenerationTimeMs is no longer supported since Matomo 4. The call will be ignored. The replacement is setPagePerformanceTiming.")};this.setPagePerformanceTiming=function(dx,dz,dy,du,dA,dv){var dw={pf_net:dx,pf_srv:dz,pf_tfr:dy,pf_dm1:du,pf_dm2:dA,pf_onl:dv};try{dw=Q(dw,M);dw=B(dw);ct=l(dw);if(ct===""){ao("setPagePerformanceTiming() called without parameters. This function needs to be called with at least one performance parameter."); +return}bn=false;bL=true}catch(dt){ao("setPagePerformanceTiming: "+dt.toString())}};this.setReferrerUrl=function(dt){bu=dt};this.setCustomUrl=function(dt){ba=b1(bT,dt)};this.getCurrentUrl=function(){return ba||bT};this.setDocumentTitle=function(dt){bp=dt};this.setPageViewId=function(dt){aQ=dt;bH=true};this.setAPIUrl=function(dt){bO=dt};this.setDownloadClasses=function(dt){bR=x(dt)?[dt]:dt};this.setLinkClasses=function(dt){be=x(dt)?[dt]:dt};this.setCampaignNameKey=function(dt){cw=x(dt)?[dt]:dt};this.setCampaignKeywordKey=function(dt){bN=x(dt)?[dt]:dt};this.discardHashTag=function(dt){bV=dt};this.setCookieNamePrefix=function(dt){bq=dt;if(aV){aV=b3()}};this.setCookieDomain=function(dt){var du=O(dt);if(!bs&&!bD(du)){ao("Can't write cookie on domain "+dt)}else{c7=du;bo()}};this.setExcludedQueryParams=function(dt){co=x(dt)?[dt]:dt};this.getCookieDomain=function(){return c7};this.hasCookies=function(){return"1"===cb()};this.setSessionCookie=function(dv,du,dt){if(!dv){throw new Error("Missing cookie name") +}if(!M(dt)){dt=cu}bB.push(dv);dn(aY(dv),du,dt,bw,c7,bY,aN)};this.getCookie=function(du){var dt=aH(aY(du));if(dt===0){return null}return dt};this.setCookiePath=function(dt){bw=dt;bo()};this.getCookiePath=function(dt){return bw};this.setVisitorCookieTimeout=function(dt){cS=dt*1000};this.setSessionCookieTimeout=function(dt){cu=dt*1000};this.getSessionCookieTimeout=function(){return cu};this.setReferralCookieTimeout=function(dt){df=dt*1000};this.setConversionAttributionFirstReferrer=function(dt){bC=dt};this.setSecureCookie=function(dt){if(dt&&location.protocol!=="https:"){ao("Error in setSecureCookie: You cannot use `Secure` on http.");return}bY=dt};this.setCookieSameSite=function(dt){dt=String(dt);dt=dt.charAt(0).toUpperCase()+dt.toLowerCase().slice(1);if(dt!=="None"&&dt!=="Lax"&&dt!=="Strict"){ao("Ignored value for sameSite. Please use either Lax, None, or Strict.");return}if(dt==="None"){if(location.protocol==="https:"){this.setSecureCookie(true)}else{ao("sameSite=None cannot be used on http, reverted to sameSite=Lax."); +dt="Lax"}}aN=dt};this.disableCookies=function(){bs=true;if(cc){aJ()}};this.areCookiesEnabled=function(){return !bs};this.setCookieConsentGiven=function(){if(bs&&!cY){bs=false;c6=true;if(cc&&aA){aR();var dt=cy("ping=1",null,"ping");bM(dt,bQ)}}};this.requireCookieConsent=function(){if(this.getRememberedCookieConsent()){return false}this.disableCookies();return true};this.getRememberedCookieConsent=function(){return aH(cL)};this.forgetCookieConsentGiven=function(){b5(cL,bw,c7);this.disableCookies()};this.rememberCookieConsentGiven=function(du){if(du){du=du*60*60*1000}else{du=30*365*24*60*60*1000}this.setCookieConsentGiven();var dt=new Date().getTime();dn(cL,dt,du,bw,c7,bY,aN)};this.deleteCookies=function(){aJ()};this.setDoNotTrack=function(du){var dt=g.doNotTrack||g.msDoNotTrack;cY=du&&(dt==="yes"||dt==="1");if(cY){this.disableCookies()}};this.alwaysUseSendBeacon=function(){c5=true};this.disableAlwaysUseSendBeacon=function(){c5=false};this.addListener=function(du,dt){av(du,dt,false)};this.enableLinkTracking=function(du){if(di){return +}di=true;var dt=this;q(function(){au=true;var dv=J.body;av(dv,du,true)})};this.enableJSErrorTracking=function(){if(c0){return}c0=true;var dt=W.onerror;W.onerror=function(dy,dw,dv,dx,du){cm(function(){var dz="JavaScript Errors";var dA=dw+":"+dv;if(dx){dA+=":"+dx}if(P(cz,dz+dA+dy)===-1){cz.push(dz+dA+dy);ax(dz,dA,dy)}});if(dt){return dt(dy,dw,dv,dx,du)}return false}};this.disablePerformanceTracking=function(){a8=false};this.enableHeartBeatTimer=function(dt){dt=Math.max(dt||15,5);bb=dt*1000;if(c8!==null){dq()}};this.disableHeartBeatTimer=function(){if(bb||aS){if(W.removeEventListener){W.removeEventListener("focus",bg);W.removeEventListener("blur",aD);W.removeEventListener("visibilitychange",a0)}else{if(W.detachEvent){W.detachEvent("onfocus",bg);W.detachEvent("onblur",aD);W.detachEvent("visibilitychange",a0)}}}bb=null;aS=false};this.killFrame=function(){if(W.location!==W.top.location){W.top.location=W.location}};this.redirectFile=function(dt){if(W.location.protocol==="file:"){W.location=dt}}; +this.setCountPreRendered=function(dt){bk=dt};this.trackGoal=function(dt,dw,dv,du){cm(function(){c1(dt,dw,dv,du)})};this.trackLink=function(du,dt,dw,dv){cm(function(){db(du,dt,dw,dv)})};this.getNumTrackedPageViews=function(){return cx};this.trackPageView=function(dt,dv,du){cg=[];cT=[];cz=[];if(R(cc)){cm(function(){ad(aI,bO,cc)})}else{cm(function(){cx++;b6(dt,dv,du)})}};this.disableBrowserFeatureDetection=function(){c6=false};this.enableBrowserFeatureDetection=function(){c6=true};this.trackAllContentImpressions=function(){if(R(cc)){return}cm(function(){q(function(){var dt=w.findContentNodes();var du=cH(dt);bK.pushMultiple(du)})})};this.trackVisibleContentImpressions=function(dt,du){if(R(cc)){return}if(!M(dt)){dt=true}if(!M(du)){du=750}aX(dt,du,this);cm(function(){n(function(){var dv=w.findContentNodes();var dw=bf(dv);bK.pushMultiple(dw)})})};this.trackContentImpression=function(dv,dt,du){if(R(cc)){return}dv=a(dv);dt=a(dt);du=a(du);if(!dv){return}dt=dt||"Unknown";cm(function(){var dw=aK(dv,dt,du); +bK.push(dw)})};this.trackContentImpressionsWithinNode=function(dt){if(R(cc)||!dt){return}cm(function(){if(ck){n(function(){var du=w.findContentNodesWithinNode(dt);var dv=bf(du);bK.pushMultiple(dv)})}else{q(function(){var du=w.findContentNodesWithinNode(dt);var dv=cH(du);bK.pushMultiple(dv)})}})};this.trackContentInteraction=function(dv,dw,dt,du){if(R(cc)){return}dv=a(dv);dw=a(dw);dt=a(dt);du=a(du);if(!dv||!dw){return}dt=dt||"Unknown";cm(function(){var dx=aU(dv,dw,dt,du);if(dx){bK.push(dx)}})};this.trackContentInteractionNode=function(dv,du){if(R(cc)||!dv){return}var dt=null;cm(function(){dt=dk(dv,du);if(dt){bK.push(dt)}});return dt};this.logAllContentBlocksOnPage=function(){var dv=w.findContentNodes();var dt=w.collectContent(dv);var du=typeof console;if(du!=="undefined"&&console&&console.log){console.log(dt)}};this.trackEvent=function(du,dw,dt,dv,dy,dx){cm(function(){ax(du,dw,dt,dv,dy,dx)})};this.trackSiteSearch=function(dt,dv,du,dw){cg=[];cm(function(){ce(dt,dv,du,dw)})};this.setEcommerceView=function(dx,dt,dv,du){cA={}; +if(ac(dv)){dv=String(dv)}if(!M(dv)||dv===null||dv===false||!dv.length){dv=""}else{if(dv instanceof Array){dv=W.JSON.stringify(dv)}}var dw="_pkc";cA[dw]=dv;if(M(du)&&du!==null&&du!==false&&String(du).length){dw="_pkp";cA[dw]=du}if(!ac(dx)&&!ac(dt)){return}if(ac(dx)){dw="_pks";cA[dw]=dx}if(!ac(dt)){dt=""}dw="_pkn";cA[dw]=dt};this.getEcommerceItems=function(){return JSON.parse(JSON.stringify(da))};this.addEcommerceItem=function(dx,dt,dv,du,dw){if(ac(dx)){da[dx]=[String(dx),dt,dv,du,dw]}};this.removeEcommerceItem=function(dt){if(ac(dt)){dt=String(dt);delete da[dt]}};this.clearEcommerceCart=function(){da={}};this.trackEcommerceOrder=function(dt,dx,dw,dv,du,dy){b4(dt,dx,dw,dv,du,dy)};this.trackEcommerceCartUpdate=function(dt){bz(dt)};this.trackRequest=function(du,dw,dv,dt){cm(function(){var dx=cy(du,dw,dt);bM(dx,bQ,dv)})};this.ping=function(){this.trackRequest("ping=1",null,null,"ping")};this.disableQueueRequest=function(){bK.enabled=false};this.setRequestQueueInterval=function(dt){if(dt<1000){throw new Error("Request queue interval needs to be at least 1000ms") +}bK.interval=dt};this.queueRequest=function(dt){cm(function(){var du=cy(dt);bK.push(du)})};this.isConsentRequired=function(){return cI};this.getRememberedConsent=function(){var dt=aH(bj);if(aH(cU)){if(dt){b5(bj,bw,c7)}return null}if(!dt||dt===0){return null}return dt};this.hasRememberedConsent=function(){return !!this.getRememberedConsent()};this.requireConsent=function(){cI=true;bJ=this.hasRememberedConsent();if(!bJ){bs=true}y++;b["CoreConsent"+y]={unload:function(){if(!bJ){aJ()}}}};this.setConsentGiven=function(du){bJ=true;c6=true;b5(cU,bw,c7);var dv,dt;for(dv=0;dv<cT.length;dv++){dt=typeof cT[dv];if(dt==="string"){bM(cT[dv],bQ)}else{if(dt==="object"){dp(cT[dv],bQ)}}}cT=[];if(!M(du)||du){this.setCookieConsentGiven()}};this.rememberConsentGiven=function(dv){if(dv){dv=dv*60*60*1000}else{dv=30*365*24*60*60*1000}var dt=true;this.setConsentGiven(dt);var du=new Date().getTime();dn(bj,du,dv,bw,c7,bY,aN)};this.forgetConsentGiven=function(){var dt=30*365*24*60*60*1000;b5(bj,bw,c7);dn(cU,new Date().getTime(),dt,bw,c7,bY,aN); +this.forgetCookieConsentGiven();this.requireConsent()};this.isUserOptedOut=function(){return !bJ};this.optUserOut=this.forgetConsentGiven;this.forgetUserOptOut=function(){this.setConsentGiven(false)};n(function(){setTimeout(function(){bL=true},0)});u.trigger("TrackerSetup",[this]);u.addPlugin("TrackerVisitorIdCookie"+aB,{unload:function(){if(!aA){aR()}}})}function K(){return{push:aj}}function c(ay,ax){var az={};var av,aw;for(av=0;av<ax.length;av++){var at=ax[av];az[at]=1;for(aw=0;aw<ay.length;aw++){if(ay[aw]&&ay[aw][0]){var au=ay[aw][0];if(at===au){aj(ay[aw]);delete ay[aw];if(az[au]>1&&au!=="addTracker"&&au!=="enableLinkTracking"){ao("The method "+au+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Matomo trackers documentation: https://developer.matomo.org/guides/tracking-javascript-guide#multiple-piwik-trackers')}az[au]++}}}}return ay}var E=["addTracker","forgetCookieConsentGiven","requireCookieConsent","disableBrowserFeatureDetection","disableCookies","setTrackerUrl","setAPIUrl","enableCrossDomainLinking","setCrossDomainLinkingTimeout","setSessionCookieTimeout","setVisitorCookieTimeout","setCookieNamePrefix","setCookieSameSite","setSecureCookie","setCookiePath","setCookieDomain","setDomains","setUserId","setVisitorId","setSiteId","alwaysUseSendBeacon","disableAlwaysUseSendBeacon","enableLinkTracking","setCookieConsentGiven","requireConsent","setConsentGiven","disablePerformanceTracking","setPagePerformanceTiming","setExcludedQueryParams"]; function ah(av,au){var at=new T(av,au);L.push(at);_paq=c(_paq,E);for(H=0;H<_paq.length;H++){if(_paq[H]){aj(_paq[H])}}_paq=new K();u.trigger("TrackerAdded",[at]);return at}ar(W,"beforeunload",am,false);ar(W,"online",function(){if(M(g.serviceWorker)){g.serviceWorker.ready.then(function(at){if(at&&at.sync){return at.sync.register("matomoSync")}},function(){})}},false);ar(W,"message",function(ay){if(!ay||!ay.origin){return}var aA,aw,au;var aB=d(ay.origin);var ax=u.getAsyncTrackers();for(aw=0;aw<ax.length;aw++){au=d(ax[aw].getMatomoUrl());if(au===aB){aA=ax[aw];break}}if(!aA){return}var av=null;try{av=JSON.parse(ay.data)}catch(az){return}if(!av){return}function at(aE){var aG=J.getElementsByTagName("iframe");for(aw=0;aw<aG.length;aw++){var aF=aG[aw];var aC=d(aF.src);if(aF.contentWindow&&M(aF.contentWindow.postMessage)&&aC===aB){var aD=JSON.stringify(aE);aF.contentWindow.postMessage(aD,"*")}}}if(M(av.maq_initial_value)){at({maq_opted_in:av.maq_initial_value&&aA.hasConsent(),maq_url:aA.getMatomoUrl(),maq_optout_by_default:aA.isConsentRequired()}) }else{if(M(av.maq_opted_in)){ax=u.getAsyncTrackers();for(aw=0;aw<ax.length;aw++){aA=ax[aw];if(av.maq_opted_in){aA.rememberConsentGiven()}else{aA.forgetConsentGiven()}}at({maq_confirm_opted_in:aA.hasConsent(),maq_url:aA.getMatomoUrl(),maq_optout_by_default:aA.isConsentRequired()})}}},false);Date.prototype.getTimeAlias=Date.prototype.getTime;u={initialized:false,JSON:W.JSON,DOM:{addEventListener:function(aw,av,au,at){var ax=typeof at;if(ax==="undefined"){at=false}ar(aw,av,au,at)},onLoad:n,onReady:q,isNodeVisible:i,isOrWasNodeVisible:w.isNodeVisible},on:function(au,at){if(!z[au]){z[au]=[]}z[au].push(at)},off:function(av,au){if(!z[av]){return}var at=0;for(at;at<z[av].length;at++){if(z[av][at]===au){z[av].splice(at,1)}}},trigger:function(av,aw,au){if(!z[av]){return}var at=0;for(at;at<z[av].length;at++){z[av][at].apply(au||W,aw)}},addPlugin:function(at,au){b[at]=au},getTracker:function(au,at){if(!M(at)){at=this.getAsyncTracker().getSiteId()}if(!M(au)){au=this.getAsyncTracker().getTrackerUrl() }return new T(au,at)},getAsyncTrackers:function(){return L},addTracker:function(av,au){var at;if(!L.length){at=ah(av,au)}else{at=L[0].addTracker(av,au)}return at},getAsyncTracker:function(ax,aw){var av;if(L&&L.length&&L[0]){av=L[0]}else{return ah(ax,aw)}if(!aw&&!ax){return av}if((!M(aw)||null===aw)&&av){aw=av.getSiteId()}if((!M(ax)||null===ax)&&av){ax=av.getTrackerUrl()}var au,at=0;for(at;at<L.length;at++){au=L[at];if(au&&String(au.getSiteId())===String(aw)&&au.getTrackerUrl()===ax){return au}}},retryMissedPluginCalls:function(){var au=al;al=[];var at=0;for(at;at<au.length;at++){aj(au[at])}}};if(typeof define==="function"&&define.amd){define("piwik",[],function(){return u});define("matomo",[],function(){return u})}return u}())} @@ -50,20 +50,20 @@ var dw=new RegExp("^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mai var du=cB(dv,"click",dw);if(du){dy+="&"+du}var dx=cy(dy,dA,"link");bM(dx,bQ,dz)}function b0(du,dt){if(du!==""){return du+dt.charAt(0).toUpperCase()+dt.slice(1)}return dt}function cm(dy){var dx,dt,dw=["","webkit","ms","moz"],dv;if(!bk){for(dt=0;dt<dw.length;dt++){dv=dw[dt];if(Object.prototype.hasOwnProperty.call(J,b0(dv,"hidden"))){if(J[b0(dv,"visibilityState")]==="prerender"){dx=true}break}}}if(dx){ar(J,dv+"visibilitychange",function du(){J.removeEventListener(dv+"visibilitychange",du,false);dy()});return}dy()}function by(){var du=bP.getVisitorId();var dt=aO();return du+dt}function cp(dt){if(!dt){return}if(!ai.hasNodeAttribute(dt,"href")){return}var du=ai.getAttributeValueFromNode(dt,"href");if(!du||aZ(du)){return}if(!bP.getVisitorId()){return}du=j(du,az);var dv=by();du=I(du,az,dv);ai.setAnyAttribute(dt,"href",du)}function br(dw){var dx=ai.getAttributeValueFromNode(dw,"href");if(!dx){return false}dx=String(dx);var du=dx.indexOf("//")===0||dx.indexOf("http://")===0||dx.indexOf("https://")===0; if(!du){return false}var dt=dw.pathname||cr(dw.href);var dv=(dw.hostname||d(dw.href)).toLowerCase();if(aw(dv,dt)){if(!cP(c2,O(dv))){return true}return false}return false}function cO(dt){var du=dl(dt);if(du&&du.type){du.href=p(du.href);db(du.href,du.type,undefined,null,dt);return}if(cV){dt=ay(dt);if(br(dt)){cp(dt)}}}function cD(){return J.all&&!J.addEventListener}function c3(dt){var dv=dt.which;var du=(typeof dt.button);if(!dv&&du!=="undefined"){if(cD()){if(dt.button&1){dv=1}else{if(dt.button&2){dv=3}else{if(dt.button&4){dv=2}}}}else{if(dt.button===0||dt.button==="0"){dv=1}else{if(dt.button&1){dv=2}else{if(dt.button&2){dv=3}}}}}return dv}function bZ(dt){switch(c3(dt)){case 1:return"left";case 2:return"middle";case 3:return"right"}}function a7(dt){return dt.target||dt.srcElement}function c4(dt){return dt==="A"||dt==="AREA"}function aG(dt){function du(dw){var dx=a7(dw);var dy=dx.nodeName;var dv=a6(bG,"ignore");while(!c4(dy)&&dx&&dx.parentNode){dx=dx.parentNode;dy=dx.nodeName}if(dx&&c4(dy)&&!dv.test(dx.className)){return dx }}return function(dx){dx=dx||W.event;var dy=du(dx);if(!dy){return}var dw=bZ(dx);if(dx.type==="click"){var dv=false;if(dt&&dw==="middle"){dv=true}if(dy&&!dv){cO(dy)}}else{if(dx.type==="mousedown"){if(dw==="middle"&&dy){aW=dw;bI=dy}else{aW=bI=null}}else{if(dx.type==="mouseup"){if(dw===aW&&dy===bI){cO(dy)}aW=bI=null}else{if(dx.type==="contextmenu"){cO(dy)}}}}}}function av(dw,dv,dt){var du=typeof dv;if(du==="undefined"){dv=true}ar(dw,"click",aG(dv),dt);if(dv){ar(dw,"mouseup",aG(dv),dt);ar(dw,"mousedown",aG(dv),dt);ar(dw,"contextmenu",aG(dv),dt)}}function aX(du,dx,dy){if(ck){return true}ck=true;var dz=false;var dw,dv;function dt(){dz=true}n(function(){function dA(dC){setTimeout(function(){if(!ck){return}dz=false;dy.trackVisibleContentImpressions();dA(dC)},dC)}function dB(dC){setTimeout(function(){if(!ck){return}if(dz){dz=false;dy.trackVisibleContentImpressions()}dB(dC)},dC)}if(du){dw=["scroll","resize"];for(dv=0;dv<dw.length;dv++){if(J.addEventListener){J.addEventListener(dw[dv],dt,false)}else{W.attachEvent("on"+dw[dv],dt) -}}dB(100)}if(dx&&dx>0){dx=parseInt(dx,10);dA(dx)}})}var bK={enabled:true,requests:[],timeout:null,interval:2500,sendRequests:function(){var dt=this.requests;this.requests=[];if(dt.length===1){bM(dt[0],bQ)}else{dp(dt,bQ)}},canQueue:function(){return !m&&this.enabled},pushMultiple:function(du){if(!this.canQueue()){dp(du,bQ);return}var dt;for(dt=0;dt<du.length;dt++){this.push(du[dt])}},push:function(dt){if(!dt){return}if(!this.canQueue()){bM(dt,bQ);return}bK.requests.push(dt);if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.timeout=setTimeout(function(){bK.timeout=null;bK.sendRequests()},bK.interval);var du="RequestQueue"+aB;if(!Object.prototype.hasOwnProperty.call(b,du)){b[du]={unload:function(){if(bK.timeout){clearTimeout(bK.timeout)}bK.sendRequests()}}}}};bo();aR();this.hasConsent=function(){return bJ};this.getVisitorId=function(){return a4().uuid};this.getVisitorInfo=function(){return cW()};this.getAttributionInfo=function(){return bS()};this.getAttributionCampaignName=function(){return bS()[0] -};this.getAttributionCampaignKeyword=function(){return bS()[1]};this.getAttributionReferrerTimestamp=function(){return bS()[2]};this.getAttributionReferrerUrl=function(){return bS()[3]};this.setTrackerUrl=function(dt){aI=dt};this.getTrackerUrl=function(){return aI};this.getMatomoUrl=function(){return aa(this.getTrackerUrl(),bO)};this.getPiwikUrl=function(){return this.getMatomoUrl()};this.addTracker=function(dv,du){if(!M(dv)||null===dv){dv=this.getTrackerUrl()}var dt=new T(dv,du);L.push(dt);u.trigger("TrackerAdded",[this]);return dt};this.getSiteId=function(){return cc};this.setSiteId=function(dt){b9(dt)};this.resetUserId=function(){bF=""};this.setUserId=function(dt){if(ac(dt)){bF=dt}};this.setVisitorId=function(du){var dt=/[0-9A-Fa-f]{16}/g;if(x(du)&&dt.test(du)){bU=du}else{ao("Invalid visitorId set"+du)}};this.getUserId=function(){return bF};this.setCustomData=function(dt,du){if(Z(dt)){at=dt}else{if(!at){at={}}at[dt]=du}};this.getCustomData=function(){return at};this.setCustomRequestProcessing=function(dt){ch=dt -};this.appendToTrackingUrl=function(dt){c9=dt};this.getRequest=function(dt){return cy(dt)};this.addPlugin=function(dt,du){b[dt]=du};this.setCustomDimension=function(dt,du){dt=parseInt(dt,10);if(dt>0){if(!M(du)){du=""}if(!x(du)){du=String(du)}bt[dt]=du}};this.getCustomDimension=function(dt){dt=parseInt(dt,10);if(dt>0&&Object.prototype.hasOwnProperty.call(bt,dt)){return bt[dt]}};this.deleteCustomDimension=function(dt){dt=parseInt(dt,10);if(dt>0){delete bt[dt]}};this.setCustomVariable=function(du,dt,dx,dv){var dw;if(!M(dv)){dv="visit"}if(!M(dt)){return}if(!M(dx)){dx=""}if(du>0){dt=!x(dt)?String(dt):dt;dx=!x(dx)?String(dx):dx;dw=[dt.slice(0,bA),dx.slice(0,bA)];if(dv==="visit"||dv===2){cN();aV[du]=dw}else{if(dv==="page"||dv===3){b2[du]=dw}else{if(dv==="event"){cs[du]=dw}}}}};this.getCustomVariable=function(du,dv){var dt;if(!M(dv)){dv="visit"}if(dv==="page"||dv===3){dt=b2[du]}else{if(dv==="event"){dt=cs[du]}else{if(dv==="visit"||dv===2){cN();dt=aV[du]}}}if(!M(dt)||(dt&&dt[0]==="")){return false -}return dt};this.deleteCustomVariable=function(dt,du){if(this.getCustomVariable(dt,du)){this.setCustomVariable(dt,"","",du)}};this.deleteCustomVariables=function(dt){if(dt==="page"||dt===3){b2={}}else{if(dt==="event"){cs={}}else{if(dt==="visit"||dt===2){aV={}}}}};this.storeCustomVariablesInCookie=function(){bW=true};this.setLinkTrackingTimer=function(dt){bQ=dt};this.getLinkTrackingTimer=function(){return bQ};this.setDownloadExtensions=function(dt){if(x(dt)){dt=dt.split("|")}dg=dt};this.addDownloadExtensions=function(du){var dt;if(x(du)){du=du.split("|")}for(dt=0;dt<du.length;dt++){dg.push(du[dt])}};this.removeDownloadExtensions=function(dv){var du,dt=[];if(x(dv)){dv=dv.split("|")}for(du=0;du<dg.length;du++){if(P(dv,dg[du])===-1){dt.push(dg[du])}}dg=dt};this.setDomains=function(dt){aC=x(dt)?[dt]:dt;var dx=false,dv=0,du;for(dv;dv<aC.length;dv++){du=String(aC[dv]);if(cP(c2,O(du))){dx=true;break}var dw=cr(du);if(dw&&dw!=="/"&&dw!=="/*"){dx=true;break}}if(!dx){aC.push(c2)}};this.enableCrossDomainLinking=function(){cV=true -};this.disableCrossDomainLinking=function(){cV=false};this.isCrossDomainLinkingEnabled=function(){return cV};this.setCrossDomainLinkingTimeout=function(dt){a5=dt};this.getCrossDomainLinkingUrlParameter=function(){return t(az)+"="+t(by())};this.setIgnoreClasses=function(dt){bG=x(dt)?[dt]:dt};this.setRequestMethod=function(dt){if(dt){dj=String(dt).toUpperCase()}else{dj=cn}if(dj==="GET"){this.disableAlwaysUseSendBeacon()}};this.setRequestContentType=function(dt){cE=dt||aM};this.setGenerationTimeMs=function(dt){ao("setGenerationTimeMs is no longer supported since Matomo 4. The call will be ignored. The replacement is setPagePerformanceTiming.")};this.setPagePerformanceTiming=function(dx,dz,dy,du,dA,dv){var dw={pf_net:dx,pf_srv:dz,pf_tfr:dy,pf_dm1:du,pf_dm2:dA,pf_onl:dv};try{dw=Q(dw,M);dw=B(dw);ct=l(dw);if(ct===""){ao("setPagePerformanceTiming() called without parameters. This function needs to be called with at least one performance parameter.");return}bn=false;bL=true}catch(dt){ao("setPagePerformanceTiming: "+dt.toString()) -}};this.setReferrerUrl=function(dt){bu=dt};this.setCustomUrl=function(dt){ba=b1(bT,dt)};this.getCurrentUrl=function(){return ba||bT};this.setDocumentTitle=function(dt){bp=dt};this.setPageViewId=function(dt){aQ=dt;bH=true};this.setAPIUrl=function(dt){bO=dt};this.setDownloadClasses=function(dt){bR=x(dt)?[dt]:dt};this.setLinkClasses=function(dt){be=x(dt)?[dt]:dt};this.setCampaignNameKey=function(dt){cw=x(dt)?[dt]:dt};this.setCampaignKeywordKey=function(dt){bN=x(dt)?[dt]:dt};this.discardHashTag=function(dt){bV=dt};this.setCookieNamePrefix=function(dt){bq=dt;if(aV){aV=b3()}};this.setCookieDomain=function(dt){var du=O(dt);if(!bs&&!bD(du)){ao("Can't write cookie on domain "+dt)}else{c7=du;bo()}};this.setExcludedQueryParams=function(dt){co=x(dt)?[dt]:dt};this.getCookieDomain=function(){return c7};this.hasCookies=function(){return"1"===cb()};this.setSessionCookie=function(dv,du,dt){if(!dv){throw new Error("Missing cookie name")}if(!M(dt)){dt=cu}bB.push(dv);dn(aY(dv),du,dt,bw,c7,bY,aN)};this.getCookie=function(du){var dt=aH(aY(du)); -if(dt===0){return null}return dt};this.setCookiePath=function(dt){bw=dt;bo()};this.getCookiePath=function(dt){return bw};this.setVisitorCookieTimeout=function(dt){cS=dt*1000};this.setSessionCookieTimeout=function(dt){cu=dt*1000};this.getSessionCookieTimeout=function(){return cu};this.setReferralCookieTimeout=function(dt){df=dt*1000};this.setConversionAttributionFirstReferrer=function(dt){bC=dt};this.setSecureCookie=function(dt){if(dt&&location.protocol!=="https:"){ao("Error in setSecureCookie: You cannot use `Secure` on http.");return}bY=dt};this.setCookieSameSite=function(dt){dt=String(dt);dt=dt.charAt(0).toUpperCase()+dt.toLowerCase().slice(1);if(dt!=="None"&&dt!=="Lax"&&dt!=="Strict"){ao("Ignored value for sameSite. Please use either Lax, None, or Strict.");return}if(dt==="None"){if(location.protocol==="https:"){this.setSecureCookie(true)}else{ao("sameSite=None cannot be used on http, reverted to sameSite=Lax.");dt="Lax"}}aN=dt};this.disableCookies=function(){bs=true;if(cc){aJ()}};this.areCookiesEnabled=function(){return !bs -};this.setCookieConsentGiven=function(){if(bs&&!cY){bs=false;c6=true;if(cc&&aA){aR();var dt=cy("ping=1",null,"ping");bM(dt,bQ)}}};this.requireCookieConsent=function(){if(this.getRememberedCookieConsent()){return false}this.disableCookies();return true};this.getRememberedCookieConsent=function(){return aH(cL)};this.forgetCookieConsentGiven=function(){b5(cL,bw,c7);this.disableCookies()};this.rememberCookieConsentGiven=function(du){if(du){du=du*60*60*1000}else{du=30*365*24*60*60*1000}this.setCookieConsentGiven();var dt=new Date().getTime();dn(cL,dt,du,bw,c7,bY,aN)};this.deleteCookies=function(){aJ()};this.setDoNotTrack=function(du){var dt=g.doNotTrack||g.msDoNotTrack;cY=du&&(dt==="yes"||dt==="1");if(cY){this.disableCookies()}};this.alwaysUseSendBeacon=function(){c5=true};this.disableAlwaysUseSendBeacon=function(){c5=false};this.addListener=function(du,dt){av(du,dt,false)};this.enableLinkTracking=function(du){if(di){return}di=true;var dt=this;q(function(){au=true;var dv=J.body;av(dv,du,true) -})};this.enableJSErrorTracking=function(){if(c0){return}c0=true;var dt=W.onerror;W.onerror=function(dy,dw,dv,dx,du){cm(function(){var dz="JavaScript Errors";var dA=dw+":"+dv;if(dx){dA+=":"+dx}if(P(cz,dz+dA+dy)===-1){cz.push(dz+dA+dy);ax(dz,dA,dy)}});if(dt){return dt(dy,dw,dv,dx,du)}return false}};this.disablePerformanceTracking=function(){a8=false};this.enableHeartBeatTimer=function(dt){dt=Math.max(dt||15,5);bb=dt*1000;if(c8!==null){dq()}};this.disableHeartBeatTimer=function(){if(bb||aS){if(W.removeEventListener){W.removeEventListener("focus",bg);W.removeEventListener("blur",aD);W.removeEventListener("visibilitychange",a0)}else{if(W.detachEvent){W.detachEvent("onfocus",bg);W.detachEvent("onblur",aD);W.detachEvent("visibilitychange",a0)}}}bb=null;aS=false};this.killFrame=function(){if(W.location!==W.top.location){W.top.location=W.location}};this.redirectFile=function(dt){if(W.location.protocol==="file:"){W.location=dt}};this.setCountPreRendered=function(dt){bk=dt};this.trackGoal=function(dt,dw,dv,du){cm(function(){c1(dt,dw,dv,du) -})};this.trackLink=function(du,dt,dw,dv){cm(function(){db(du,dt,dw,dv)})};this.getNumTrackedPageViews=function(){return cx};this.trackPageView=function(dt,dv,du){cg=[];cT=[];cz=[];if(R(cc)){cm(function(){ad(aI,bO,cc)})}else{cm(function(){cx++;b6(dt,dv,du)})}};this.disableBrowserFeatureDetection=function(){c6=false};this.enableBrowserFeatureDetection=function(){c6=true};this.trackAllContentImpressions=function(){if(R(cc)){return}cm(function(){q(function(){var dt=w.findContentNodes();var du=cH(dt);bK.pushMultiple(du)})})};this.trackVisibleContentImpressions=function(dt,du){if(R(cc)){return}if(!M(dt)){dt=true}if(!M(du)){du=750}aX(dt,du,this);cm(function(){n(function(){var dv=w.findContentNodes();var dw=bf(dv);bK.pushMultiple(dw)})})};this.trackContentImpression=function(dv,dt,du){if(R(cc)){return}dv=a(dv);dt=a(dt);du=a(du);if(!dv){return}dt=dt||"Unknown";cm(function(){var dw=aK(dv,dt,du);bK.push(dw)})};this.trackContentImpressionsWithinNode=function(dt){if(R(cc)||!dt){return}cm(function(){if(ck){n(function(){var du=w.findContentNodesWithinNode(dt); -var dv=bf(du);bK.pushMultiple(dv)})}else{q(function(){var du=w.findContentNodesWithinNode(dt);var dv=cH(du);bK.pushMultiple(dv)})}})};this.trackContentInteraction=function(dv,dw,dt,du){if(R(cc)){return}dv=a(dv);dw=a(dw);dt=a(dt);du=a(du);if(!dv||!dw){return}dt=dt||"Unknown";cm(function(){var dx=aU(dv,dw,dt,du);if(dx){bK.push(dx)}})};this.trackContentInteractionNode=function(dv,du){if(R(cc)||!dv){return}var dt=null;cm(function(){dt=dk(dv,du);if(dt){bK.push(dt)}});return dt};this.logAllContentBlocksOnPage=function(){var dv=w.findContentNodes();var dt=w.collectContent(dv);var du=typeof console;if(du!=="undefined"&&console&&console.log){console.log(dt)}};this.trackEvent=function(du,dw,dt,dv,dy,dx){cm(function(){ax(du,dw,dt,dv,dy,dx)})};this.trackSiteSearch=function(dt,dv,du,dw){cg=[];cm(function(){ce(dt,dv,du,dw)})};this.setEcommerceView=function(dx,dt,dv,du){cA={};if(ac(dv)){dv=String(dv)}if(!M(dv)||dv===null||dv===false||!dv.length){dv=""}else{if(dv instanceof Array){dv=W.JSON.stringify(dv) -}}var dw="_pkc";cA[dw]=dv;if(M(du)&&du!==null&&du!==false&&String(du).length){dw="_pkp";cA[dw]=du}if(!ac(dx)&&!ac(dt)){return}if(ac(dx)){dw="_pks";cA[dw]=dx}if(!ac(dt)){dt=""}dw="_pkn";cA[dw]=dt};this.getEcommerceItems=function(){return JSON.parse(JSON.stringify(da))};this.addEcommerceItem=function(dx,dt,dv,du,dw){if(ac(dx)){da[dx]=[String(dx),dt,dv,du,dw]}};this.removeEcommerceItem=function(dt){if(ac(dt)){dt=String(dt);delete da[dt]}};this.clearEcommerceCart=function(){da={}};this.trackEcommerceOrder=function(dt,dx,dw,dv,du,dy){b4(dt,dx,dw,dv,du,dy)};this.trackEcommerceCartUpdate=function(dt){bz(dt)};this.trackRequest=function(du,dw,dv,dt){cm(function(){var dx=cy(du,dw,dt);bM(dx,bQ,dv)})};this.ping=function(){this.trackRequest("ping=1",null,null,"ping")};this.disableQueueRequest=function(){bK.enabled=false};this.setRequestQueueInterval=function(dt){if(dt<1000){throw new Error("Request queue interval needs to be at least 1000ms")}bK.interval=dt};this.queueRequest=function(dt){cm(function(){var du=cy(dt); -bK.push(du)})};this.isConsentRequired=function(){return cI};this.getRememberedConsent=function(){var dt=aH(bj);if(aH(cU)){if(dt){b5(bj,bw,c7)}return null}if(!dt||dt===0){return null}return dt};this.hasRememberedConsent=function(){return !!this.getRememberedConsent()};this.requireConsent=function(){cI=true;bJ=this.hasRememberedConsent();if(!bJ){bs=true}y++;b["CoreConsent"+y]={unload:function(){if(!bJ){aJ()}}}};this.setConsentGiven=function(du){bJ=true;c6=true;b5(cU,bw,c7);var dv,dt;for(dv=0;dv<cT.length;dv++){dt=typeof cT[dv];if(dt==="string"){bM(cT[dv],bQ)}else{if(dt==="object"){dp(cT[dv],bQ)}}}cT=[];if(!M(du)||du){this.setCookieConsentGiven()}};this.rememberConsentGiven=function(dv){if(dv){dv=dv*60*60*1000}else{dv=30*365*24*60*60*1000}var dt=true;this.setConsentGiven(dt);var du=new Date().getTime();dn(bj,du,dv,bw,c7,bY,aN)};this.forgetConsentGiven=function(){var dt=30*365*24*60*60*1000;b5(bj,bw,c7);dn(cU,new Date().getTime(),dt,bw,c7,bY,aN);this.forgetCookieConsentGiven();this.requireConsent() -};this.isUserOptedOut=function(){return !bJ};this.optUserOut=this.forgetConsentGiven;this.forgetUserOptOut=function(){this.setConsentGiven(false)};n(function(){setTimeout(function(){bL=true},0)});u.trigger("TrackerSetup",[this])}function K(){return{push:aj}}function c(ay,ax){var az={};var av,aw;for(av=0;av<ax.length;av++){var at=ax[av];az[at]=1;for(aw=0;aw<ay.length;aw++){if(ay[aw]&&ay[aw][0]){var au=ay[aw][0];if(at===au){aj(ay[aw]);delete ay[aw];if(az[au]>1&&au!=="addTracker"&&au!=="enableLinkTracking"){ao("The method "+au+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Matomo trackers documentation: https://developer.matomo.org/guides/tracking-javascript-guide#multiple-piwik-trackers')}az[au]++}}}}return ay}var E=["addTracker","forgetCookieConsentGiven","requireCookieConsent","disableBrowserFeatureDetection","disableCookies","setTrackerUrl","setAPIUrl","enableCrossDomainLinking","setCrossDomainLinkingTimeout","setSessionCookieTimeout","setVisitorCookieTimeout","setCookieNamePrefix","setCookieSameSite","setSecureCookie","setCookiePath","setCookieDomain","setDomains","setUserId","setVisitorId","setSiteId","alwaysUseSendBeacon","disableAlwaysUseSendBeacon","enableLinkTracking","setCookieConsentGiven","requireConsent","setConsentGiven","disablePerformanceTracking","setPagePerformanceTiming","setExcludedQueryParams"]; +}}dB(100)}if(dx&&dx>0){dx=parseInt(dx,10);dA(dx)}})}var bK={enabled:true,requests:[],timeout:null,interval:2500,sendRequests:function(){var dt=this.requests;this.requests=[];if(dt.length===1){bM(dt[0],bQ)}else{dp(dt,bQ)}},canQueue:function(){return !m&&this.enabled},pushMultiple:function(du){if(!this.canQueue()){dp(du,bQ);return}var dt;for(dt=0;dt<du.length;dt++){this.push(du[dt])}},push:function(dt){if(!dt){return}if(!this.canQueue()){bM(dt,bQ);return}bK.requests.push(dt);if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.timeout=setTimeout(function(){bK.timeout=null;bK.sendRequests()},bK.interval);var du="RequestQueue"+aB;if(!Object.prototype.hasOwnProperty.call(b,du)){b[du]={unload:function(){if(bK.timeout){clearTimeout(bK.timeout)}bK.sendRequests()}}}}};bo();this.hasConsent=function(){return bJ};this.getVisitorInfo=function(){if(!aH(aY("id"))){aR()}return cW()};this.getVisitorId=function(){return this.getVisitorInfo()[1]};this.getAttributionInfo=function(){return bS() +};this.getAttributionCampaignName=function(){return bS()[0]};this.getAttributionCampaignKeyword=function(){return bS()[1]};this.getAttributionReferrerTimestamp=function(){return bS()[2]};this.getAttributionReferrerUrl=function(){return bS()[3]};this.setTrackerUrl=function(dt){aI=dt};this.getTrackerUrl=function(){return aI};this.getMatomoUrl=function(){return aa(this.getTrackerUrl(),bO)};this.getPiwikUrl=function(){return this.getMatomoUrl()};this.addTracker=function(dv,du){if(!M(dv)||null===dv){dv=this.getTrackerUrl()}var dt=new T(dv,du);L.push(dt);u.trigger("TrackerAdded",[this]);return dt};this.getSiteId=function(){return cc};this.setSiteId=function(dt){b9(dt)};this.resetUserId=function(){bF=""};this.setUserId=function(dt){if(ac(dt)){bF=dt}};this.setVisitorId=function(du){var dt=/[0-9A-Fa-f]{16}/g;if(x(du)&&dt.test(du)){bU=du}else{ao("Invalid visitorId set"+du)}};this.getUserId=function(){return bF};this.setCustomData=function(dt,du){if(Z(dt)){at=dt}else{if(!at){at={}}at[dt]=du}};this.getCustomData=function(){return at +};this.setCustomRequestProcessing=function(dt){ch=dt};this.appendToTrackingUrl=function(dt){c9=dt};this.getRequest=function(dt){return cy(dt)};this.addPlugin=function(dt,du){b[dt]=du};this.setCustomDimension=function(dt,du){dt=parseInt(dt,10);if(dt>0){if(!M(du)){du=""}if(!x(du)){du=String(du)}bt[dt]=du}};this.getCustomDimension=function(dt){dt=parseInt(dt,10);if(dt>0&&Object.prototype.hasOwnProperty.call(bt,dt)){return bt[dt]}};this.deleteCustomDimension=function(dt){dt=parseInt(dt,10);if(dt>0){delete bt[dt]}};this.setCustomVariable=function(du,dt,dx,dv){var dw;if(!M(dv)){dv="visit"}if(!M(dt)){return}if(!M(dx)){dx=""}if(du>0){dt=!x(dt)?String(dt):dt;dx=!x(dx)?String(dx):dx;dw=[dt.slice(0,bA),dx.slice(0,bA)];if(dv==="visit"||dv===2){cN();aV[du]=dw}else{if(dv==="page"||dv===3){b2[du]=dw}else{if(dv==="event"){cs[du]=dw}}}}};this.getCustomVariable=function(du,dv){var dt;if(!M(dv)){dv="visit"}if(dv==="page"||dv===3){dt=b2[du]}else{if(dv==="event"){dt=cs[du]}else{if(dv==="visit"||dv===2){cN(); +dt=aV[du]}}}if(!M(dt)||(dt&&dt[0]==="")){return false}return dt};this.deleteCustomVariable=function(dt,du){if(this.getCustomVariable(dt,du)){this.setCustomVariable(dt,"","",du)}};this.deleteCustomVariables=function(dt){if(dt==="page"||dt===3){b2={}}else{if(dt==="event"){cs={}}else{if(dt==="visit"||dt===2){aV={}}}}};this.storeCustomVariablesInCookie=function(){bW=true};this.setLinkTrackingTimer=function(dt){bQ=dt};this.getLinkTrackingTimer=function(){return bQ};this.setDownloadExtensions=function(dt){if(x(dt)){dt=dt.split("|")}dg=dt};this.addDownloadExtensions=function(du){var dt;if(x(du)){du=du.split("|")}for(dt=0;dt<du.length;dt++){dg.push(du[dt])}};this.removeDownloadExtensions=function(dv){var du,dt=[];if(x(dv)){dv=dv.split("|")}for(du=0;du<dg.length;du++){if(P(dv,dg[du])===-1){dt.push(dg[du])}}dg=dt};this.setDomains=function(dt){aC=x(dt)?[dt]:dt;var dx=false,dv=0,du;for(dv;dv<aC.length;dv++){du=String(aC[dv]);if(cP(c2,O(du))){dx=true;break}var dw=cr(du);if(dw&&dw!=="/"&&dw!=="/*"){dx=true; +break}}if(!dx){aC.push(c2)}};this.enableCrossDomainLinking=function(){cV=true};this.disableCrossDomainLinking=function(){cV=false};this.isCrossDomainLinkingEnabled=function(){return cV};this.setCrossDomainLinkingTimeout=function(dt){a5=dt};this.getCrossDomainLinkingUrlParameter=function(){return t(az)+"="+t(by())};this.setIgnoreClasses=function(dt){bG=x(dt)?[dt]:dt};this.setRequestMethod=function(dt){if(dt){dj=String(dt).toUpperCase()}else{dj=cn}if(dj==="GET"){this.disableAlwaysUseSendBeacon()}};this.setRequestContentType=function(dt){cE=dt||aM};this.setGenerationTimeMs=function(dt){ao("setGenerationTimeMs is no longer supported since Matomo 4. The call will be ignored. The replacement is setPagePerformanceTiming.")};this.setPagePerformanceTiming=function(dx,dz,dy,du,dA,dv){var dw={pf_net:dx,pf_srv:dz,pf_tfr:dy,pf_dm1:du,pf_dm2:dA,pf_onl:dv};try{dw=Q(dw,M);dw=B(dw);ct=l(dw);if(ct===""){ao("setPagePerformanceTiming() called without parameters. This function needs to be called with at least one performance parameter."); +return}bn=false;bL=true}catch(dt){ao("setPagePerformanceTiming: "+dt.toString())}};this.setReferrerUrl=function(dt){bu=dt};this.setCustomUrl=function(dt){ba=b1(bT,dt)};this.getCurrentUrl=function(){return ba||bT};this.setDocumentTitle=function(dt){bp=dt};this.setPageViewId=function(dt){aQ=dt;bH=true};this.setAPIUrl=function(dt){bO=dt};this.setDownloadClasses=function(dt){bR=x(dt)?[dt]:dt};this.setLinkClasses=function(dt){be=x(dt)?[dt]:dt};this.setCampaignNameKey=function(dt){cw=x(dt)?[dt]:dt};this.setCampaignKeywordKey=function(dt){bN=x(dt)?[dt]:dt};this.discardHashTag=function(dt){bV=dt};this.setCookieNamePrefix=function(dt){bq=dt;if(aV){aV=b3()}};this.setCookieDomain=function(dt){var du=O(dt);if(!bs&&!bD(du)){ao("Can't write cookie on domain "+dt)}else{c7=du;bo()}};this.setExcludedQueryParams=function(dt){co=x(dt)?[dt]:dt};this.getCookieDomain=function(){return c7};this.hasCookies=function(){return"1"===cb()};this.setSessionCookie=function(dv,du,dt){if(!dv){throw new Error("Missing cookie name") +}if(!M(dt)){dt=cu}bB.push(dv);dn(aY(dv),du,dt,bw,c7,bY,aN)};this.getCookie=function(du){var dt=aH(aY(du));if(dt===0){return null}return dt};this.setCookiePath=function(dt){bw=dt;bo()};this.getCookiePath=function(dt){return bw};this.setVisitorCookieTimeout=function(dt){cS=dt*1000};this.setSessionCookieTimeout=function(dt){cu=dt*1000};this.getSessionCookieTimeout=function(){return cu};this.setReferralCookieTimeout=function(dt){df=dt*1000};this.setConversionAttributionFirstReferrer=function(dt){bC=dt};this.setSecureCookie=function(dt){if(dt&&location.protocol!=="https:"){ao("Error in setSecureCookie: You cannot use `Secure` on http.");return}bY=dt};this.setCookieSameSite=function(dt){dt=String(dt);dt=dt.charAt(0).toUpperCase()+dt.toLowerCase().slice(1);if(dt!=="None"&&dt!=="Lax"&&dt!=="Strict"){ao("Ignored value for sameSite. Please use either Lax, None, or Strict.");return}if(dt==="None"){if(location.protocol==="https:"){this.setSecureCookie(true)}else{ao("sameSite=None cannot be used on http, reverted to sameSite=Lax."); +dt="Lax"}}aN=dt};this.disableCookies=function(){bs=true;if(cc){aJ()}};this.areCookiesEnabled=function(){return !bs};this.setCookieConsentGiven=function(){if(bs&&!cY){bs=false;c6=true;if(cc&&aA){aR();var dt=cy("ping=1",null,"ping");bM(dt,bQ)}}};this.requireCookieConsent=function(){if(this.getRememberedCookieConsent()){return false}this.disableCookies();return true};this.getRememberedCookieConsent=function(){return aH(cL)};this.forgetCookieConsentGiven=function(){b5(cL,bw,c7);this.disableCookies()};this.rememberCookieConsentGiven=function(du){if(du){du=du*60*60*1000}else{du=30*365*24*60*60*1000}this.setCookieConsentGiven();var dt=new Date().getTime();dn(cL,dt,du,bw,c7,bY,aN)};this.deleteCookies=function(){aJ()};this.setDoNotTrack=function(du){var dt=g.doNotTrack||g.msDoNotTrack;cY=du&&(dt==="yes"||dt==="1");if(cY){this.disableCookies()}};this.alwaysUseSendBeacon=function(){c5=true};this.disableAlwaysUseSendBeacon=function(){c5=false};this.addListener=function(du,dt){av(du,dt,false)};this.enableLinkTracking=function(du){if(di){return +}di=true;var dt=this;q(function(){au=true;var dv=J.body;av(dv,du,true)})};this.enableJSErrorTracking=function(){if(c0){return}c0=true;var dt=W.onerror;W.onerror=function(dy,dw,dv,dx,du){cm(function(){var dz="JavaScript Errors";var dA=dw+":"+dv;if(dx){dA+=":"+dx}if(P(cz,dz+dA+dy)===-1){cz.push(dz+dA+dy);ax(dz,dA,dy)}});if(dt){return dt(dy,dw,dv,dx,du)}return false}};this.disablePerformanceTracking=function(){a8=false};this.enableHeartBeatTimer=function(dt){dt=Math.max(dt||15,5);bb=dt*1000;if(c8!==null){dq()}};this.disableHeartBeatTimer=function(){if(bb||aS){if(W.removeEventListener){W.removeEventListener("focus",bg);W.removeEventListener("blur",aD);W.removeEventListener("visibilitychange",a0)}else{if(W.detachEvent){W.detachEvent("onfocus",bg);W.detachEvent("onblur",aD);W.detachEvent("visibilitychange",a0)}}}bb=null;aS=false};this.killFrame=function(){if(W.location!==W.top.location){W.top.location=W.location}};this.redirectFile=function(dt){if(W.location.protocol==="file:"){W.location=dt}}; +this.setCountPreRendered=function(dt){bk=dt};this.trackGoal=function(dt,dw,dv,du){cm(function(){c1(dt,dw,dv,du)})};this.trackLink=function(du,dt,dw,dv){cm(function(){db(du,dt,dw,dv)})};this.getNumTrackedPageViews=function(){return cx};this.trackPageView=function(dt,dv,du){cg=[];cT=[];cz=[];if(R(cc)){cm(function(){ad(aI,bO,cc)})}else{cm(function(){cx++;b6(dt,dv,du)})}};this.disableBrowserFeatureDetection=function(){c6=false};this.enableBrowserFeatureDetection=function(){c6=true};this.trackAllContentImpressions=function(){if(R(cc)){return}cm(function(){q(function(){var dt=w.findContentNodes();var du=cH(dt);bK.pushMultiple(du)})})};this.trackVisibleContentImpressions=function(dt,du){if(R(cc)){return}if(!M(dt)){dt=true}if(!M(du)){du=750}aX(dt,du,this);cm(function(){n(function(){var dv=w.findContentNodes();var dw=bf(dv);bK.pushMultiple(dw)})})};this.trackContentImpression=function(dv,dt,du){if(R(cc)){return}dv=a(dv);dt=a(dt);du=a(du);if(!dv){return}dt=dt||"Unknown";cm(function(){var dw=aK(dv,dt,du); +bK.push(dw)})};this.trackContentImpressionsWithinNode=function(dt){if(R(cc)||!dt){return}cm(function(){if(ck){n(function(){var du=w.findContentNodesWithinNode(dt);var dv=bf(du);bK.pushMultiple(dv)})}else{q(function(){var du=w.findContentNodesWithinNode(dt);var dv=cH(du);bK.pushMultiple(dv)})}})};this.trackContentInteraction=function(dv,dw,dt,du){if(R(cc)){return}dv=a(dv);dw=a(dw);dt=a(dt);du=a(du);if(!dv||!dw){return}dt=dt||"Unknown";cm(function(){var dx=aU(dv,dw,dt,du);if(dx){bK.push(dx)}})};this.trackContentInteractionNode=function(dv,du){if(R(cc)||!dv){return}var dt=null;cm(function(){dt=dk(dv,du);if(dt){bK.push(dt)}});return dt};this.logAllContentBlocksOnPage=function(){var dv=w.findContentNodes();var dt=w.collectContent(dv);var du=typeof console;if(du!=="undefined"&&console&&console.log){console.log(dt)}};this.trackEvent=function(du,dw,dt,dv,dy,dx){cm(function(){ax(du,dw,dt,dv,dy,dx)})};this.trackSiteSearch=function(dt,dv,du,dw){cg=[];cm(function(){ce(dt,dv,du,dw)})};this.setEcommerceView=function(dx,dt,dv,du){cA={}; +if(ac(dv)){dv=String(dv)}if(!M(dv)||dv===null||dv===false||!dv.length){dv=""}else{if(dv instanceof Array){dv=W.JSON.stringify(dv)}}var dw="_pkc";cA[dw]=dv;if(M(du)&&du!==null&&du!==false&&String(du).length){dw="_pkp";cA[dw]=du}if(!ac(dx)&&!ac(dt)){return}if(ac(dx)){dw="_pks";cA[dw]=dx}if(!ac(dt)){dt=""}dw="_pkn";cA[dw]=dt};this.getEcommerceItems=function(){return JSON.parse(JSON.stringify(da))};this.addEcommerceItem=function(dx,dt,dv,du,dw){if(ac(dx)){da[dx]=[String(dx),dt,dv,du,dw]}};this.removeEcommerceItem=function(dt){if(ac(dt)){dt=String(dt);delete da[dt]}};this.clearEcommerceCart=function(){da={}};this.trackEcommerceOrder=function(dt,dx,dw,dv,du,dy){b4(dt,dx,dw,dv,du,dy)};this.trackEcommerceCartUpdate=function(dt){bz(dt)};this.trackRequest=function(du,dw,dv,dt){cm(function(){var dx=cy(du,dw,dt);bM(dx,bQ,dv)})};this.ping=function(){this.trackRequest("ping=1",null,null,"ping")};this.disableQueueRequest=function(){bK.enabled=false};this.setRequestQueueInterval=function(dt){if(dt<1000){throw new Error("Request queue interval needs to be at least 1000ms") +}bK.interval=dt};this.queueRequest=function(dt){cm(function(){var du=cy(dt);bK.push(du)})};this.isConsentRequired=function(){return cI};this.getRememberedConsent=function(){var dt=aH(bj);if(aH(cU)){if(dt){b5(bj,bw,c7)}return null}if(!dt||dt===0){return null}return dt};this.hasRememberedConsent=function(){return !!this.getRememberedConsent()};this.requireConsent=function(){cI=true;bJ=this.hasRememberedConsent();if(!bJ){bs=true}y++;b["CoreConsent"+y]={unload:function(){if(!bJ){aJ()}}}};this.setConsentGiven=function(du){bJ=true;c6=true;b5(cU,bw,c7);var dv,dt;for(dv=0;dv<cT.length;dv++){dt=typeof cT[dv];if(dt==="string"){bM(cT[dv],bQ)}else{if(dt==="object"){dp(cT[dv],bQ)}}}cT=[];if(!M(du)||du){this.setCookieConsentGiven()}};this.rememberConsentGiven=function(dv){if(dv){dv=dv*60*60*1000}else{dv=30*365*24*60*60*1000}var dt=true;this.setConsentGiven(dt);var du=new Date().getTime();dn(bj,du,dv,bw,c7,bY,aN)};this.forgetConsentGiven=function(){var dt=30*365*24*60*60*1000;b5(bj,bw,c7);dn(cU,new Date().getTime(),dt,bw,c7,bY,aN); +this.forgetCookieConsentGiven();this.requireConsent()};this.isUserOptedOut=function(){return !bJ};this.optUserOut=this.forgetConsentGiven;this.forgetUserOptOut=function(){this.setConsentGiven(false)};n(function(){setTimeout(function(){bL=true},0)});u.trigger("TrackerSetup",[this]);u.addPlugin("TrackerVisitorIdCookie"+aB,{unload:function(){if(!aA){aR()}}})}function K(){return{push:aj}}function c(ay,ax){var az={};var av,aw;for(av=0;av<ax.length;av++){var at=ax[av];az[at]=1;for(aw=0;aw<ay.length;aw++){if(ay[aw]&&ay[aw][0]){var au=ay[aw][0];if(at===au){aj(ay[aw]);delete ay[aw];if(az[au]>1&&au!=="addTracker"&&au!=="enableLinkTracking"){ao("The method "+au+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Matomo trackers documentation: https://developer.matomo.org/guides/tracking-javascript-guide#multiple-piwik-trackers')}az[au]++}}}}return ay}var E=["addTracker","forgetCookieConsentGiven","requireCookieConsent","disableBrowserFeatureDetection","disableCookies","setTrackerUrl","setAPIUrl","enableCrossDomainLinking","setCrossDomainLinkingTimeout","setSessionCookieTimeout","setVisitorCookieTimeout","setCookieNamePrefix","setCookieSameSite","setSecureCookie","setCookiePath","setCookieDomain","setDomains","setUserId","setVisitorId","setSiteId","alwaysUseSendBeacon","disableAlwaysUseSendBeacon","enableLinkTracking","setCookieConsentGiven","requireConsent","setConsentGiven","disablePerformanceTracking","setPagePerformanceTiming","setExcludedQueryParams"]; function ah(av,au){var at=new T(av,au);L.push(at);_paq=c(_paq,E);for(H=0;H<_paq.length;H++){if(_paq[H]){aj(_paq[H])}}_paq=new K();u.trigger("TrackerAdded",[at]);return at}ar(W,"beforeunload",am,false);ar(W,"online",function(){if(M(g.serviceWorker)){g.serviceWorker.ready.then(function(at){if(at&&at.sync){return at.sync.register("matomoSync")}},function(){})}},false);ar(W,"message",function(ay){if(!ay||!ay.origin){return}var aA,aw,au;var aB=d(ay.origin);var ax=u.getAsyncTrackers();for(aw=0;aw<ax.length;aw++){au=d(ax[aw].getMatomoUrl());if(au===aB){aA=ax[aw];break}}if(!aA){return}var av=null;try{av=JSON.parse(ay.data)}catch(az){return}if(!av){return}function at(aE){var aG=J.getElementsByTagName("iframe");for(aw=0;aw<aG.length;aw++){var aF=aG[aw];var aC=d(aF.src);if(aF.contentWindow&&M(aF.contentWindow.postMessage)&&aC===aB){var aD=JSON.stringify(aE);aF.contentWindow.postMessage(aD,"*")}}}if(M(av.maq_initial_value)){at({maq_opted_in:av.maq_initial_value&&aA.hasConsent(),maq_url:aA.getMatomoUrl(),maq_optout_by_default:aA.isConsentRequired()}) }else{if(M(av.maq_opted_in)){ax=u.getAsyncTrackers();for(aw=0;aw<ax.length;aw++){aA=ax[aw];if(av.maq_opted_in){aA.rememberConsentGiven()}else{aA.forgetConsentGiven()}}at({maq_confirm_opted_in:aA.hasConsent(),maq_url:aA.getMatomoUrl(),maq_optout_by_default:aA.isConsentRequired()})}}},false);Date.prototype.getTimeAlias=Date.prototype.getTime;u={initialized:false,JSON:W.JSON,DOM:{addEventListener:function(aw,av,au,at){var ax=typeof at;if(ax==="undefined"){at=false}ar(aw,av,au,at)},onLoad:n,onReady:q,isNodeVisible:i,isOrWasNodeVisible:w.isNodeVisible},on:function(au,at){if(!z[au]){z[au]=[]}z[au].push(at)},off:function(av,au){if(!z[av]){return}var at=0;for(at;at<z[av].length;at++){if(z[av][at]===au){z[av].splice(at,1)}}},trigger:function(av,aw,au){if(!z[av]){return}var at=0;for(at;at<z[av].length;at++){z[av][at].apply(au||W,aw)}},addPlugin:function(at,au){b[at]=au},getTracker:function(au,at){if(!M(at)){at=this.getAsyncTracker().getSiteId()}if(!M(au)){au=this.getAsyncTracker().getTrackerUrl() }return new T(au,at)},getAsyncTrackers:function(){return L},addTracker:function(av,au){var at;if(!L.length){at=ah(av,au)}else{at=L[0].addTracker(av,au)}return at},getAsyncTracker:function(ax,aw){var av;if(L&&L.length&&L[0]){av=L[0]}else{return ah(ax,aw)}if(!aw&&!ax){return av}if((!M(aw)||null===aw)&&av){aw=av.getSiteId()}if((!M(ax)||null===ax)&&av){ax=av.getTrackerUrl()}var au,at=0;for(at;at<L.length;at++){au=L[at];if(au&&String(au.getSiteId())===String(aw)&&au.getTrackerUrl()===ax){return au}}},retryMissedPluginCalls:function(){var au=al;al=[];var at=0;for(at;at<au.length;at++){aj(au[at])}}};if(typeof define==="function"&&define.amd){define("piwik",[],function(){return u});define("matomo",[],function(){return u})}return u}())} @@ -50,20 +50,20 @@ var dw=new RegExp("^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mai var du=cB(dv,"click",dw);if(du){dy+="&"+du}var dx=cy(dy,dA,"link");bM(dx,bQ,dz)}function b0(du,dt){if(du!==""){return du+dt.charAt(0).toUpperCase()+dt.slice(1)}return dt}function cm(dy){var dx,dt,dw=["","webkit","ms","moz"],dv;if(!bk){for(dt=0;dt<dw.length;dt++){dv=dw[dt];if(Object.prototype.hasOwnProperty.call(J,b0(dv,"hidden"))){if(J[b0(dv,"visibilityState")]==="prerender"){dx=true}break}}}if(dx){ar(J,dv+"visibilitychange",function du(){J.removeEventListener(dv+"visibilitychange",du,false);dy()});return}dy()}function by(){var du=bP.getVisitorId();var dt=aO();return du+dt}function cp(dt){if(!dt){return}if(!ai.hasNodeAttribute(dt,"href")){return}var du=ai.getAttributeValueFromNode(dt,"href");if(!du||aZ(du)){return}if(!bP.getVisitorId()){return}du=j(du,az);var dv=by();du=I(du,az,dv);ai.setAnyAttribute(dt,"href",du)}function br(dw){var dx=ai.getAttributeValueFromNode(dw,"href");if(!dx){return false}dx=String(dx);var du=dx.indexOf("//")===0||dx.indexOf("http://")===0||dx.indexOf("https://")===0; if(!du){return false}var dt=dw.pathname||cr(dw.href);var dv=(dw.hostname||d(dw.href)).toLowerCase();if(aw(dv,dt)){if(!cP(c2,O(dv))){return true}return false}return false}function cO(dt){var du=dl(dt);if(du&&du.type){du.href=p(du.href);db(du.href,du.type,undefined,null,dt);return}if(cV){dt=ay(dt);if(br(dt)){cp(dt)}}}function cD(){return J.all&&!J.addEventListener}function c3(dt){var dv=dt.which;var du=(typeof dt.button);if(!dv&&du!=="undefined"){if(cD()){if(dt.button&1){dv=1}else{if(dt.button&2){dv=3}else{if(dt.button&4){dv=2}}}}else{if(dt.button===0||dt.button==="0"){dv=1}else{if(dt.button&1){dv=2}else{if(dt.button&2){dv=3}}}}}return dv}function bZ(dt){switch(c3(dt)){case 1:return"left";case 2:return"middle";case 3:return"right"}}function a7(dt){return dt.target||dt.srcElement}function c4(dt){return dt==="A"||dt==="AREA"}function aG(dt){function du(dw){var dx=a7(dw);var dy=dx.nodeName;var dv=a6(bG,"ignore");while(!c4(dy)&&dx&&dx.parentNode){dx=dx.parentNode;dy=dx.nodeName}if(dx&&c4(dy)&&!dv.test(dx.className)){return dx }}return function(dx){dx=dx||W.event;var dy=du(dx);if(!dy){return}var dw=bZ(dx);if(dx.type==="click"){var dv=false;if(dt&&dw==="middle"){dv=true}if(dy&&!dv){cO(dy)}}else{if(dx.type==="mousedown"){if(dw==="middle"&&dy){aW=dw;bI=dy}else{aW=bI=null}}else{if(dx.type==="mouseup"){if(dw===aW&&dy===bI){cO(dy)}aW=bI=null}else{if(dx.type==="contextmenu"){cO(dy)}}}}}}function av(dw,dv,dt){var du=typeof dv;if(du==="undefined"){dv=true}ar(dw,"click",aG(dv),dt);if(dv){ar(dw,"mouseup",aG(dv),dt);ar(dw,"mousedown",aG(dv),dt);ar(dw,"contextmenu",aG(dv),dt)}}function aX(du,dx,dy){if(ck){return true}ck=true;var dz=false;var dw,dv;function dt(){dz=true}n(function(){function dA(dC){setTimeout(function(){if(!ck){return}dz=false;dy.trackVisibleContentImpressions();dA(dC)},dC)}function dB(dC){setTimeout(function(){if(!ck){return}if(dz){dz=false;dy.trackVisibleContentImpressions()}dB(dC)},dC)}if(du){dw=["scroll","resize"];for(dv=0;dv<dw.length;dv++){if(J.addEventListener){J.addEventListener(dw[dv],dt,false)}else{W.attachEvent("on"+dw[dv],dt) -}}dB(100)}if(dx&&dx>0){dx=parseInt(dx,10);dA(dx)}})}var bK={enabled:true,requests:[],timeout:null,interval:2500,sendRequests:function(){var dt=this.requests;this.requests=[];if(dt.length===1){bM(dt[0],bQ)}else{dp(dt,bQ)}},canQueue:function(){return !m&&this.enabled},pushMultiple:function(du){if(!this.canQueue()){dp(du,bQ);return}var dt;for(dt=0;dt<du.length;dt++){this.push(du[dt])}},push:function(dt){if(!dt){return}if(!this.canQueue()){bM(dt,bQ);return}bK.requests.push(dt);if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.timeout=setTimeout(function(){bK.timeout=null;bK.sendRequests()},bK.interval);var du="RequestQueue"+aB;if(!Object.prototype.hasOwnProperty.call(b,du)){b[du]={unload:function(){if(bK.timeout){clearTimeout(bK.timeout)}bK.sendRequests()}}}}};bo();aR();this.hasConsent=function(){return bJ};this.getVisitorId=function(){return a4().uuid};this.getVisitorInfo=function(){return cW()};this.getAttributionInfo=function(){return bS()};this.getAttributionCampaignName=function(){return bS()[0] -};this.getAttributionCampaignKeyword=function(){return bS()[1]};this.getAttributionReferrerTimestamp=function(){return bS()[2]};this.getAttributionReferrerUrl=function(){return bS()[3]};this.setTrackerUrl=function(dt){aI=dt};this.getTrackerUrl=function(){return aI};this.getMatomoUrl=function(){return aa(this.getTrackerUrl(),bO)};this.getPiwikUrl=function(){return this.getMatomoUrl()};this.addTracker=function(dv,du){if(!M(dv)||null===dv){dv=this.getTrackerUrl()}var dt=new T(dv,du);L.push(dt);u.trigger("TrackerAdded",[this]);return dt};this.getSiteId=function(){return cc};this.setSiteId=function(dt){b9(dt)};this.resetUserId=function(){bF=""};this.setUserId=function(dt){if(ac(dt)){bF=dt}};this.setVisitorId=function(du){var dt=/[0-9A-Fa-f]{16}/g;if(x(du)&&dt.test(du)){bU=du}else{ao("Invalid visitorId set"+du)}};this.getUserId=function(){return bF};this.setCustomData=function(dt,du){if(Z(dt)){at=dt}else{if(!at){at={}}at[dt]=du}};this.getCustomData=function(){return at};this.setCustomRequestProcessing=function(dt){ch=dt -};this.appendToTrackingUrl=function(dt){c9=dt};this.getRequest=function(dt){return cy(dt)};this.addPlugin=function(dt,du){b[dt]=du};this.setCustomDimension=function(dt,du){dt=parseInt(dt,10);if(dt>0){if(!M(du)){du=""}if(!x(du)){du=String(du)}bt[dt]=du}};this.getCustomDimension=function(dt){dt=parseInt(dt,10);if(dt>0&&Object.prototype.hasOwnProperty.call(bt,dt)){return bt[dt]}};this.deleteCustomDimension=function(dt){dt=parseInt(dt,10);if(dt>0){delete bt[dt]}};this.setCustomVariable=function(du,dt,dx,dv){var dw;if(!M(dv)){dv="visit"}if(!M(dt)){return}if(!M(dx)){dx=""}if(du>0){dt=!x(dt)?String(dt):dt;dx=!x(dx)?String(dx):dx;dw=[dt.slice(0,bA),dx.slice(0,bA)];if(dv==="visit"||dv===2){cN();aV[du]=dw}else{if(dv==="page"||dv===3){b2[du]=dw}else{if(dv==="event"){cs[du]=dw}}}}};this.getCustomVariable=function(du,dv){var dt;if(!M(dv)){dv="visit"}if(dv==="page"||dv===3){dt=b2[du]}else{if(dv==="event"){dt=cs[du]}else{if(dv==="visit"||dv===2){cN();dt=aV[du]}}}if(!M(dt)||(dt&&dt[0]==="")){return false -}return dt};this.deleteCustomVariable=function(dt,du){if(this.getCustomVariable(dt,du)){this.setCustomVariable(dt,"","",du)}};this.deleteCustomVariables=function(dt){if(dt==="page"||dt===3){b2={}}else{if(dt==="event"){cs={}}else{if(dt==="visit"||dt===2){aV={}}}}};this.storeCustomVariablesInCookie=function(){bW=true};this.setLinkTrackingTimer=function(dt){bQ=dt};this.getLinkTrackingTimer=function(){return bQ};this.setDownloadExtensions=function(dt){if(x(dt)){dt=dt.split("|")}dg=dt};this.addDownloadExtensions=function(du){var dt;if(x(du)){du=du.split("|")}for(dt=0;dt<du.length;dt++){dg.push(du[dt])}};this.removeDownloadExtensions=function(dv){var du,dt=[];if(x(dv)){dv=dv.split("|")}for(du=0;du<dg.length;du++){if(P(dv,dg[du])===-1){dt.push(dg[du])}}dg=dt};this.setDomains=function(dt){aC=x(dt)?[dt]:dt;var dx=false,dv=0,du;for(dv;dv<aC.length;dv++){du=String(aC[dv]);if(cP(c2,O(du))){dx=true;break}var dw=cr(du);if(dw&&dw!=="/"&&dw!=="/*"){dx=true;break}}if(!dx){aC.push(c2)}};this.enableCrossDomainLinking=function(){cV=true -};this.disableCrossDomainLinking=function(){cV=false};this.isCrossDomainLinkingEnabled=function(){return cV};this.setCrossDomainLinkingTimeout=function(dt){a5=dt};this.getCrossDomainLinkingUrlParameter=function(){return t(az)+"="+t(by())};this.setIgnoreClasses=function(dt){bG=x(dt)?[dt]:dt};this.setRequestMethod=function(dt){if(dt){dj=String(dt).toUpperCase()}else{dj=cn}if(dj==="GET"){this.disableAlwaysUseSendBeacon()}};this.setRequestContentType=function(dt){cE=dt||aM};this.setGenerationTimeMs=function(dt){ao("setGenerationTimeMs is no longer supported since Matomo 4. The call will be ignored. The replacement is setPagePerformanceTiming.")};this.setPagePerformanceTiming=function(dx,dz,dy,du,dA,dv){var dw={pf_net:dx,pf_srv:dz,pf_tfr:dy,pf_dm1:du,pf_dm2:dA,pf_onl:dv};try{dw=Q(dw,M);dw=B(dw);ct=l(dw);if(ct===""){ao("setPagePerformanceTiming() called without parameters. This function needs to be called with at least one performance parameter.");return}bn=false;bL=true}catch(dt){ao("setPagePerformanceTiming: "+dt.toString()) -}};this.setReferrerUrl=function(dt){bu=dt};this.setCustomUrl=function(dt){ba=b1(bT,dt)};this.getCurrentUrl=function(){return ba||bT};this.setDocumentTitle=function(dt){bp=dt};this.setPageViewId=function(dt){aQ=dt;bH=true};this.setAPIUrl=function(dt){bO=dt};this.setDownloadClasses=function(dt){bR=x(dt)?[dt]:dt};this.setLinkClasses=function(dt){be=x(dt)?[dt]:dt};this.setCampaignNameKey=function(dt){cw=x(dt)?[dt]:dt};this.setCampaignKeywordKey=function(dt){bN=x(dt)?[dt]:dt};this.discardHashTag=function(dt){bV=dt};this.setCookieNamePrefix=function(dt){bq=dt;if(aV){aV=b3()}};this.setCookieDomain=function(dt){var du=O(dt);if(!bs&&!bD(du)){ao("Can't write cookie on domain "+dt)}else{c7=du;bo()}};this.setExcludedQueryParams=function(dt){co=x(dt)?[dt]:dt};this.getCookieDomain=function(){return c7};this.hasCookies=function(){return"1"===cb()};this.setSessionCookie=function(dv,du,dt){if(!dv){throw new Error("Missing cookie name")}if(!M(dt)){dt=cu}bB.push(dv);dn(aY(dv),du,dt,bw,c7,bY,aN)};this.getCookie=function(du){var dt=aH(aY(du)); -if(dt===0){return null}return dt};this.setCookiePath=function(dt){bw=dt;bo()};this.getCookiePath=function(dt){return bw};this.setVisitorCookieTimeout=function(dt){cS=dt*1000};this.setSessionCookieTimeout=function(dt){cu=dt*1000};this.getSessionCookieTimeout=function(){return cu};this.setReferralCookieTimeout=function(dt){df=dt*1000};this.setConversionAttributionFirstReferrer=function(dt){bC=dt};this.setSecureCookie=function(dt){if(dt&&location.protocol!=="https:"){ao("Error in setSecureCookie: You cannot use `Secure` on http.");return}bY=dt};this.setCookieSameSite=function(dt){dt=String(dt);dt=dt.charAt(0).toUpperCase()+dt.toLowerCase().slice(1);if(dt!=="None"&&dt!=="Lax"&&dt!=="Strict"){ao("Ignored value for sameSite. Please use either Lax, None, or Strict.");return}if(dt==="None"){if(location.protocol==="https:"){this.setSecureCookie(true)}else{ao("sameSite=None cannot be used on http, reverted to sameSite=Lax.");dt="Lax"}}aN=dt};this.disableCookies=function(){bs=true;if(cc){aJ()}};this.areCookiesEnabled=function(){return !bs -};this.setCookieConsentGiven=function(){if(bs&&!cY){bs=false;c6=true;if(cc&&aA){aR();var dt=cy("ping=1",null,"ping");bM(dt,bQ)}}};this.requireCookieConsent=function(){if(this.getRememberedCookieConsent()){return false}this.disableCookies();return true};this.getRememberedCookieConsent=function(){return aH(cL)};this.forgetCookieConsentGiven=function(){b5(cL,bw,c7);this.disableCookies()};this.rememberCookieConsentGiven=function(du){if(du){du=du*60*60*1000}else{du=30*365*24*60*60*1000}this.setCookieConsentGiven();var dt=new Date().getTime();dn(cL,dt,du,bw,c7,bY,aN)};this.deleteCookies=function(){aJ()};this.setDoNotTrack=function(du){var dt=g.doNotTrack||g.msDoNotTrack;cY=du&&(dt==="yes"||dt==="1");if(cY){this.disableCookies()}};this.alwaysUseSendBeacon=function(){c5=true};this.disableAlwaysUseSendBeacon=function(){c5=false};this.addListener=function(du,dt){av(du,dt,false)};this.enableLinkTracking=function(du){if(di){return}di=true;var dt=this;q(function(){au=true;var dv=J.body;av(dv,du,true) -})};this.enableJSErrorTracking=function(){if(c0){return}c0=true;var dt=W.onerror;W.onerror=function(dy,dw,dv,dx,du){cm(function(){var dz="JavaScript Errors";var dA=dw+":"+dv;if(dx){dA+=":"+dx}if(P(cz,dz+dA+dy)===-1){cz.push(dz+dA+dy);ax(dz,dA,dy)}});if(dt){return dt(dy,dw,dv,dx,du)}return false}};this.disablePerformanceTracking=function(){a8=false};this.enableHeartBeatTimer=function(dt){dt=Math.max(dt||15,5);bb=dt*1000;if(c8!==null){dq()}};this.disableHeartBeatTimer=function(){if(bb||aS){if(W.removeEventListener){W.removeEventListener("focus",bg);W.removeEventListener("blur",aD);W.removeEventListener("visibilitychange",a0)}else{if(W.detachEvent){W.detachEvent("onfocus",bg);W.detachEvent("onblur",aD);W.detachEvent("visibilitychange",a0)}}}bb=null;aS=false};this.killFrame=function(){if(W.location!==W.top.location){W.top.location=W.location}};this.redirectFile=function(dt){if(W.location.protocol==="file:"){W.location=dt}};this.setCountPreRendered=function(dt){bk=dt};this.trackGoal=function(dt,dw,dv,du){cm(function(){c1(dt,dw,dv,du) -})};this.trackLink=function(du,dt,dw,dv){cm(function(){db(du,dt,dw,dv)})};this.getNumTrackedPageViews=function(){return cx};this.trackPageView=function(dt,dv,du){cg=[];cT=[];cz=[];if(R(cc)){cm(function(){ad(aI,bO,cc)})}else{cm(function(){cx++;b6(dt,dv,du)})}};this.disableBrowserFeatureDetection=function(){c6=false};this.enableBrowserFeatureDetection=function(){c6=true};this.trackAllContentImpressions=function(){if(R(cc)){return}cm(function(){q(function(){var dt=w.findContentNodes();var du=cH(dt);bK.pushMultiple(du)})})};this.trackVisibleContentImpressions=function(dt,du){if(R(cc)){return}if(!M(dt)){dt=true}if(!M(du)){du=750}aX(dt,du,this);cm(function(){n(function(){var dv=w.findContentNodes();var dw=bf(dv);bK.pushMultiple(dw)})})};this.trackContentImpression=function(dv,dt,du){if(R(cc)){return}dv=a(dv);dt=a(dt);du=a(du);if(!dv){return}dt=dt||"Unknown";cm(function(){var dw=aK(dv,dt,du);bK.push(dw)})};this.trackContentImpressionsWithinNode=function(dt){if(R(cc)||!dt){return}cm(function(){if(ck){n(function(){var du=w.findContentNodesWithinNode(dt); -var dv=bf(du);bK.pushMultiple(dv)})}else{q(function(){var du=w.findContentNodesWithinNode(dt);var dv=cH(du);bK.pushMultiple(dv)})}})};this.trackContentInteraction=function(dv,dw,dt,du){if(R(cc)){return}dv=a(dv);dw=a(dw);dt=a(dt);du=a(du);if(!dv||!dw){return}dt=dt||"Unknown";cm(function(){var dx=aU(dv,dw,dt,du);if(dx){bK.push(dx)}})};this.trackContentInteractionNode=function(dv,du){if(R(cc)||!dv){return}var dt=null;cm(function(){dt=dk(dv,du);if(dt){bK.push(dt)}});return dt};this.logAllContentBlocksOnPage=function(){var dv=w.findContentNodes();var dt=w.collectContent(dv);var du=typeof console;if(du!=="undefined"&&console&&console.log){console.log(dt)}};this.trackEvent=function(du,dw,dt,dv,dy,dx){cm(function(){ax(du,dw,dt,dv,dy,dx)})};this.trackSiteSearch=function(dt,dv,du,dw){cg=[];cm(function(){ce(dt,dv,du,dw)})};this.setEcommerceView=function(dx,dt,dv,du){cA={};if(ac(dv)){dv=String(dv)}if(!M(dv)||dv===null||dv===false||!dv.length){dv=""}else{if(dv instanceof Array){dv=W.JSON.stringify(dv) -}}var dw="_pkc";cA[dw]=dv;if(M(du)&&du!==null&&du!==false&&String(du).length){dw="_pkp";cA[dw]=du}if(!ac(dx)&&!ac(dt)){return}if(ac(dx)){dw="_pks";cA[dw]=dx}if(!ac(dt)){dt=""}dw="_pkn";cA[dw]=dt};this.getEcommerceItems=function(){return JSON.parse(JSON.stringify(da))};this.addEcommerceItem=function(dx,dt,dv,du,dw){if(ac(dx)){da[dx]=[String(dx),dt,dv,du,dw]}};this.removeEcommerceItem=function(dt){if(ac(dt)){dt=String(dt);delete da[dt]}};this.clearEcommerceCart=function(){da={}};this.trackEcommerceOrder=function(dt,dx,dw,dv,du,dy){b4(dt,dx,dw,dv,du,dy)};this.trackEcommerceCartUpdate=function(dt){bz(dt)};this.trackRequest=function(du,dw,dv,dt){cm(function(){var dx=cy(du,dw,dt);bM(dx,bQ,dv)})};this.ping=function(){this.trackRequest("ping=1",null,null,"ping")};this.disableQueueRequest=function(){bK.enabled=false};this.setRequestQueueInterval=function(dt){if(dt<1000){throw new Error("Request queue interval needs to be at least 1000ms")}bK.interval=dt};this.queueRequest=function(dt){cm(function(){var du=cy(dt); -bK.push(du)})};this.isConsentRequired=function(){return cI};this.getRememberedConsent=function(){var dt=aH(bj);if(aH(cU)){if(dt){b5(bj,bw,c7)}return null}if(!dt||dt===0){return null}return dt};this.hasRememberedConsent=function(){return !!this.getRememberedConsent()};this.requireConsent=function(){cI=true;bJ=this.hasRememberedConsent();if(!bJ){bs=true}y++;b["CoreConsent"+y]={unload:function(){if(!bJ){aJ()}}}};this.setConsentGiven=function(du){bJ=true;c6=true;b5(cU,bw,c7);var dv,dt;for(dv=0;dv<cT.length;dv++){dt=typeof cT[dv];if(dt==="string"){bM(cT[dv],bQ)}else{if(dt==="object"){dp(cT[dv],bQ)}}}cT=[];if(!M(du)||du){this.setCookieConsentGiven()}};this.rememberConsentGiven=function(dv){if(dv){dv=dv*60*60*1000}else{dv=30*365*24*60*60*1000}var dt=true;this.setConsentGiven(dt);var du=new Date().getTime();dn(bj,du,dv,bw,c7,bY,aN)};this.forgetConsentGiven=function(){var dt=30*365*24*60*60*1000;b5(bj,bw,c7);dn(cU,new Date().getTime(),dt,bw,c7,bY,aN);this.forgetCookieConsentGiven();this.requireConsent() -};this.isUserOptedOut=function(){return !bJ};this.optUserOut=this.forgetConsentGiven;this.forgetUserOptOut=function(){this.setConsentGiven(false)};n(function(){setTimeout(function(){bL=true},0)});u.trigger("TrackerSetup",[this])}function K(){return{push:aj}}function c(ay,ax){var az={};var av,aw;for(av=0;av<ax.length;av++){var at=ax[av];az[at]=1;for(aw=0;aw<ay.length;aw++){if(ay[aw]&&ay[aw][0]){var au=ay[aw][0];if(at===au){aj(ay[aw]);delete ay[aw];if(az[au]>1&&au!=="addTracker"&&au!=="enableLinkTracking"){ao("The method "+au+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Matomo trackers documentation: https://developer.matomo.org/guides/tracking-javascript-guide#multiple-piwik-trackers')}az[au]++}}}}return ay}var E=["addTracker","forgetCookieConsentGiven","requireCookieConsent","disableBrowserFeatureDetection","disableCookies","setTrackerUrl","setAPIUrl","enableCrossDomainLinking","setCrossDomainLinkingTimeout","setSessionCookieTimeout","setVisitorCookieTimeout","setCookieNamePrefix","setCookieSameSite","setSecureCookie","setCookiePath","setCookieDomain","setDomains","setUserId","setVisitorId","setSiteId","alwaysUseSendBeacon","disableAlwaysUseSendBeacon","enableLinkTracking","setCookieConsentGiven","requireConsent","setConsentGiven","disablePerformanceTracking","setPagePerformanceTiming","setExcludedQueryParams"]; +}}dB(100)}if(dx&&dx>0){dx=parseInt(dx,10);dA(dx)}})}var bK={enabled:true,requests:[],timeout:null,interval:2500,sendRequests:function(){var dt=this.requests;this.requests=[];if(dt.length===1){bM(dt[0],bQ)}else{dp(dt,bQ)}},canQueue:function(){return !m&&this.enabled},pushMultiple:function(du){if(!this.canQueue()){dp(du,bQ);return}var dt;for(dt=0;dt<du.length;dt++){this.push(du[dt])}},push:function(dt){if(!dt){return}if(!this.canQueue()){bM(dt,bQ);return}bK.requests.push(dt);if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.timeout=setTimeout(function(){bK.timeout=null;bK.sendRequests()},bK.interval);var du="RequestQueue"+aB;if(!Object.prototype.hasOwnProperty.call(b,du)){b[du]={unload:function(){if(bK.timeout){clearTimeout(bK.timeout)}bK.sendRequests()}}}}};bo();this.hasConsent=function(){return bJ};this.getVisitorInfo=function(){if(!aH(aY("id"))){aR()}return cW()};this.getVisitorId=function(){return this.getVisitorInfo()[1]};this.getAttributionInfo=function(){return bS() +};this.getAttributionCampaignName=function(){return bS()[0]};this.getAttributionCampaignKeyword=function(){return bS()[1]};this.getAttributionReferrerTimestamp=function(){return bS()[2]};this.getAttributionReferrerUrl=function(){return bS()[3]};this.setTrackerUrl=function(dt){aI=dt};this.getTrackerUrl=function(){return aI};this.getMatomoUrl=function(){return aa(this.getTrackerUrl(),bO)};this.getPiwikUrl=function(){return this.getMatomoUrl()};this.addTracker=function(dv,du){if(!M(dv)||null===dv){dv=this.getTrackerUrl()}var dt=new T(dv,du);L.push(dt);u.trigger("TrackerAdded",[this]);return dt};this.getSiteId=function(){return cc};this.setSiteId=function(dt){b9(dt)};this.resetUserId=function(){bF=""};this.setUserId=function(dt){if(ac(dt)){bF=dt}};this.setVisitorId=function(du){var dt=/[0-9A-Fa-f]{16}/g;if(x(du)&&dt.test(du)){bU=du}else{ao("Invalid visitorId set"+du)}};this.getUserId=function(){return bF};this.setCustomData=function(dt,du){if(Z(dt)){at=dt}else{if(!at){at={}}at[dt]=du}};this.getCustomData=function(){return at +};this.setCustomRequestProcessing=function(dt){ch=dt};this.appendToTrackingUrl=function(dt){c9=dt};this.getRequest=function(dt){return cy(dt)};this.addPlugin=function(dt,du){b[dt]=du};this.setCustomDimension=function(dt,du){dt=parseInt(dt,10);if(dt>0){if(!M(du)){du=""}if(!x(du)){du=String(du)}bt[dt]=du}};this.getCustomDimension=function(dt){dt=parseInt(dt,10);if(dt>0&&Object.prototype.hasOwnProperty.call(bt,dt)){return bt[dt]}};this.deleteCustomDimension=function(dt){dt=parseInt(dt,10);if(dt>0){delete bt[dt]}};this.setCustomVariable=function(du,dt,dx,dv){var dw;if(!M(dv)){dv="visit"}if(!M(dt)){return}if(!M(dx)){dx=""}if(du>0){dt=!x(dt)?String(dt):dt;dx=!x(dx)?String(dx):dx;dw=[dt.slice(0,bA),dx.slice(0,bA)];if(dv==="visit"||dv===2){cN();aV[du]=dw}else{if(dv==="page"||dv===3){b2[du]=dw}else{if(dv==="event"){cs[du]=dw}}}}};this.getCustomVariable=function(du,dv){var dt;if(!M(dv)){dv="visit"}if(dv==="page"||dv===3){dt=b2[du]}else{if(dv==="event"){dt=cs[du]}else{if(dv==="visit"||dv===2){cN(); +dt=aV[du]}}}if(!M(dt)||(dt&&dt[0]==="")){return false}return dt};this.deleteCustomVariable=function(dt,du){if(this.getCustomVariable(dt,du)){this.setCustomVariable(dt,"","",du)}};this.deleteCustomVariables=function(dt){if(dt==="page"||dt===3){b2={}}else{if(dt==="event"){cs={}}else{if(dt==="visit"||dt===2){aV={}}}}};this.storeCustomVariablesInCookie=function(){bW=true};this.setLinkTrackingTimer=function(dt){bQ=dt};this.getLinkTrackingTimer=function(){return bQ};this.setDownloadExtensions=function(dt){if(x(dt)){dt=dt.split("|")}dg=dt};this.addDownloadExtensions=function(du){var dt;if(x(du)){du=du.split("|")}for(dt=0;dt<du.length;dt++){dg.push(du[dt])}};this.removeDownloadExtensions=function(dv){var du,dt=[];if(x(dv)){dv=dv.split("|")}for(du=0;du<dg.length;du++){if(P(dv,dg[du])===-1){dt.push(dg[du])}}dg=dt};this.setDomains=function(dt){aC=x(dt)?[dt]:dt;var dx=false,dv=0,du;for(dv;dv<aC.length;dv++){du=String(aC[dv]);if(cP(c2,O(du))){dx=true;break}var dw=cr(du);if(dw&&dw!=="/"&&dw!=="/*"){dx=true; +break}}if(!dx){aC.push(c2)}};this.enableCrossDomainLinking=function(){cV=true};this.disableCrossDomainLinking=function(){cV=false};this.isCrossDomainLinkingEnabled=function(){return cV};this.setCrossDomainLinkingTimeout=function(dt){a5=dt};this.getCrossDomainLinkingUrlParameter=function(){return t(az)+"="+t(by())};this.setIgnoreClasses=function(dt){bG=x(dt)?[dt]:dt};this.setRequestMethod=function(dt){if(dt){dj=String(dt).toUpperCase()}else{dj=cn}if(dj==="GET"){this.disableAlwaysUseSendBeacon()}};this.setRequestContentType=function(dt){cE=dt||aM};this.setGenerationTimeMs=function(dt){ao("setGenerationTimeMs is no longer supported since Matomo 4. The call will be ignored. The replacement is setPagePerformanceTiming.")};this.setPagePerformanceTiming=function(dx,dz,dy,du,dA,dv){var dw={pf_net:dx,pf_srv:dz,pf_tfr:dy,pf_dm1:du,pf_dm2:dA,pf_onl:dv};try{dw=Q(dw,M);dw=B(dw);ct=l(dw);if(ct===""){ao("setPagePerformanceTiming() called without parameters. This function needs to be called with at least one performance parameter."); +return}bn=false;bL=true}catch(dt){ao("setPagePerformanceTiming: "+dt.toString())}};this.setReferrerUrl=function(dt){bu=dt};this.setCustomUrl=function(dt){ba=b1(bT,dt)};this.getCurrentUrl=function(){return ba||bT};this.setDocumentTitle=function(dt){bp=dt};this.setPageViewId=function(dt){aQ=dt;bH=true};this.setAPIUrl=function(dt){bO=dt};this.setDownloadClasses=function(dt){bR=x(dt)?[dt]:dt};this.setLinkClasses=function(dt){be=x(dt)?[dt]:dt};this.setCampaignNameKey=function(dt){cw=x(dt)?[dt]:dt};this.setCampaignKeywordKey=function(dt){bN=x(dt)?[dt]:dt};this.discardHashTag=function(dt){bV=dt};this.setCookieNamePrefix=function(dt){bq=dt;if(aV){aV=b3()}};this.setCookieDomain=function(dt){var du=O(dt);if(!bs&&!bD(du)){ao("Can't write cookie on domain "+dt)}else{c7=du;bo()}};this.setExcludedQueryParams=function(dt){co=x(dt)?[dt]:dt};this.getCookieDomain=function(){return c7};this.hasCookies=function(){return"1"===cb()};this.setSessionCookie=function(dv,du,dt){if(!dv){throw new Error("Missing cookie name") +}if(!M(dt)){dt=cu}bB.push(dv);dn(aY(dv),du,dt,bw,c7,bY,aN)};this.getCookie=function(du){var dt=aH(aY(du));if(dt===0){return null}return dt};this.setCookiePath=function(dt){bw=dt;bo()};this.getCookiePath=function(dt){return bw};this.setVisitorCookieTimeout=function(dt){cS=dt*1000};this.setSessionCookieTimeout=function(dt){cu=dt*1000};this.getSessionCookieTimeout=function(){return cu};this.setReferralCookieTimeout=function(dt){df=dt*1000};this.setConversionAttributionFirstReferrer=function(dt){bC=dt};this.setSecureCookie=function(dt){if(dt&&location.protocol!=="https:"){ao("Error in setSecureCookie: You cannot use `Secure` on http.");return}bY=dt};this.setCookieSameSite=function(dt){dt=String(dt);dt=dt.charAt(0).toUpperCase()+dt.toLowerCase().slice(1);if(dt!=="None"&&dt!=="Lax"&&dt!=="Strict"){ao("Ignored value for sameSite. Please use either Lax, None, or Strict.");return}if(dt==="None"){if(location.protocol==="https:"){this.setSecureCookie(true)}else{ao("sameSite=None cannot be used on http, reverted to sameSite=Lax."); +dt="Lax"}}aN=dt};this.disableCookies=function(){bs=true;if(cc){aJ()}};this.areCookiesEnabled=function(){return !bs};this.setCookieConsentGiven=function(){if(bs&&!cY){bs=false;c6=true;if(cc&&aA){aR();var dt=cy("ping=1",null,"ping");bM(dt,bQ)}}};this.requireCookieConsent=function(){if(this.getRememberedCookieConsent()){return false}this.disableCookies();return true};this.getRememberedCookieConsent=function(){return aH(cL)};this.forgetCookieConsentGiven=function(){b5(cL,bw,c7);this.disableCookies()};this.rememberCookieConsentGiven=function(du){if(du){du=du*60*60*1000}else{du=30*365*24*60*60*1000}this.setCookieConsentGiven();var dt=new Date().getTime();dn(cL,dt,du,bw,c7,bY,aN)};this.deleteCookies=function(){aJ()};this.setDoNotTrack=function(du){var dt=g.doNotTrack||g.msDoNotTrack;cY=du&&(dt==="yes"||dt==="1");if(cY){this.disableCookies()}};this.alwaysUseSendBeacon=function(){c5=true};this.disableAlwaysUseSendBeacon=function(){c5=false};this.addListener=function(du,dt){av(du,dt,false)};this.enableLinkTracking=function(du){if(di){return +}di=true;var dt=this;q(function(){au=true;var dv=J.body;av(dv,du,true)})};this.enableJSErrorTracking=function(){if(c0){return}c0=true;var dt=W.onerror;W.onerror=function(dy,dw,dv,dx,du){cm(function(){var dz="JavaScript Errors";var dA=dw+":"+dv;if(dx){dA+=":"+dx}if(P(cz,dz+dA+dy)===-1){cz.push(dz+dA+dy);ax(dz,dA,dy)}});if(dt){return dt(dy,dw,dv,dx,du)}return false}};this.disablePerformanceTracking=function(){a8=false};this.enableHeartBeatTimer=function(dt){dt=Math.max(dt||15,5);bb=dt*1000;if(c8!==null){dq()}};this.disableHeartBeatTimer=function(){if(bb||aS){if(W.removeEventListener){W.removeEventListener("focus",bg);W.removeEventListener("blur",aD);W.removeEventListener("visibilitychange",a0)}else{if(W.detachEvent){W.detachEvent("onfocus",bg);W.detachEvent("onblur",aD);W.detachEvent("visibilitychange",a0)}}}bb=null;aS=false};this.killFrame=function(){if(W.location!==W.top.location){W.top.location=W.location}};this.redirectFile=function(dt){if(W.location.protocol==="file:"){W.location=dt}}; +this.setCountPreRendered=function(dt){bk=dt};this.trackGoal=function(dt,dw,dv,du){cm(function(){c1(dt,dw,dv,du)})};this.trackLink=function(du,dt,dw,dv){cm(function(){db(du,dt,dw,dv)})};this.getNumTrackedPageViews=function(){return cx};this.trackPageView=function(dt,dv,du){cg=[];cT=[];cz=[];if(R(cc)){cm(function(){ad(aI,bO,cc)})}else{cm(function(){cx++;b6(dt,dv,du)})}};this.disableBrowserFeatureDetection=function(){c6=false};this.enableBrowserFeatureDetection=function(){c6=true};this.trackAllContentImpressions=function(){if(R(cc)){return}cm(function(){q(function(){var dt=w.findContentNodes();var du=cH(dt);bK.pushMultiple(du)})})};this.trackVisibleContentImpressions=function(dt,du){if(R(cc)){return}if(!M(dt)){dt=true}if(!M(du)){du=750}aX(dt,du,this);cm(function(){n(function(){var dv=w.findContentNodes();var dw=bf(dv);bK.pushMultiple(dw)})})};this.trackContentImpression=function(dv,dt,du){if(R(cc)){return}dv=a(dv);dt=a(dt);du=a(du);if(!dv){return}dt=dt||"Unknown";cm(function(){var dw=aK(dv,dt,du); +bK.push(dw)})};this.trackContentImpressionsWithinNode=function(dt){if(R(cc)||!dt){return}cm(function(){if(ck){n(function(){var du=w.findContentNodesWithinNode(dt);var dv=bf(du);bK.pushMultiple(dv)})}else{q(function(){var du=w.findContentNodesWithinNode(dt);var dv=cH(du);bK.pushMultiple(dv)})}})};this.trackContentInteraction=function(dv,dw,dt,du){if(R(cc)){return}dv=a(dv);dw=a(dw);dt=a(dt);du=a(du);if(!dv||!dw){return}dt=dt||"Unknown";cm(function(){var dx=aU(dv,dw,dt,du);if(dx){bK.push(dx)}})};this.trackContentInteractionNode=function(dv,du){if(R(cc)||!dv){return}var dt=null;cm(function(){dt=dk(dv,du);if(dt){bK.push(dt)}});return dt};this.logAllContentBlocksOnPage=function(){var dv=w.findContentNodes();var dt=w.collectContent(dv);var du=typeof console;if(du!=="undefined"&&console&&console.log){console.log(dt)}};this.trackEvent=function(du,dw,dt,dv,dy,dx){cm(function(){ax(du,dw,dt,dv,dy,dx)})};this.trackSiteSearch=function(dt,dv,du,dw){cg=[];cm(function(){ce(dt,dv,du,dw)})};this.setEcommerceView=function(dx,dt,dv,du){cA={}; +if(ac(dv)){dv=String(dv)}if(!M(dv)||dv===null||dv===false||!dv.length){dv=""}else{if(dv instanceof Array){dv=W.JSON.stringify(dv)}}var dw="_pkc";cA[dw]=dv;if(M(du)&&du!==null&&du!==false&&String(du).length){dw="_pkp";cA[dw]=du}if(!ac(dx)&&!ac(dt)){return}if(ac(dx)){dw="_pks";cA[dw]=dx}if(!ac(dt)){dt=""}dw="_pkn";cA[dw]=dt};this.getEcommerceItems=function(){return JSON.parse(JSON.stringify(da))};this.addEcommerceItem=function(dx,dt,dv,du,dw){if(ac(dx)){da[dx]=[String(dx),dt,dv,du,dw]}};this.removeEcommerceItem=function(dt){if(ac(dt)){dt=String(dt);delete da[dt]}};this.clearEcommerceCart=function(){da={}};this.trackEcommerceOrder=function(dt,dx,dw,dv,du,dy){b4(dt,dx,dw,dv,du,dy)};this.trackEcommerceCartUpdate=function(dt){bz(dt)};this.trackRequest=function(du,dw,dv,dt){cm(function(){var dx=cy(du,dw,dt);bM(dx,bQ,dv)})};this.ping=function(){this.trackRequest("ping=1",null,null,"ping")};this.disableQueueRequest=function(){bK.enabled=false};this.setRequestQueueInterval=function(dt){if(dt<1000){throw new Error("Request queue interval needs to be at least 1000ms") +}bK.interval=dt};this.queueRequest=function(dt){cm(function(){var du=cy(dt);bK.push(du)})};this.isConsentRequired=function(){return cI};this.getRememberedConsent=function(){var dt=aH(bj);if(aH(cU)){if(dt){b5(bj,bw,c7)}return null}if(!dt||dt===0){return null}return dt};this.hasRememberedConsent=function(){return !!this.getRememberedConsent()};this.requireConsent=function(){cI=true;bJ=this.hasRememberedConsent();if(!bJ){bs=true}y++;b["CoreConsent"+y]={unload:function(){if(!bJ){aJ()}}}};this.setConsentGiven=function(du){bJ=true;c6=true;b5(cU,bw,c7);var dv,dt;for(dv=0;dv<cT.length;dv++){dt=typeof cT[dv];if(dt==="string"){bM(cT[dv],bQ)}else{if(dt==="object"){dp(cT[dv],bQ)}}}cT=[];if(!M(du)||du){this.setCookieConsentGiven()}};this.rememberConsentGiven=function(dv){if(dv){dv=dv*60*60*1000}else{dv=30*365*24*60*60*1000}var dt=true;this.setConsentGiven(dt);var du=new Date().getTime();dn(bj,du,dv,bw,c7,bY,aN)};this.forgetConsentGiven=function(){var dt=30*365*24*60*60*1000;b5(bj,bw,c7);dn(cU,new Date().getTime(),dt,bw,c7,bY,aN); +this.forgetCookieConsentGiven();this.requireConsent()};this.isUserOptedOut=function(){return !bJ};this.optUserOut=this.forgetConsentGiven;this.forgetUserOptOut=function(){this.setConsentGiven(false)};n(function(){setTimeout(function(){bL=true},0)});u.trigger("TrackerSetup",[this]);u.addPlugin("TrackerVisitorIdCookie"+aB,{unload:function(){if(!aA){aR()}}})}function K(){return{push:aj}}function c(ay,ax){var az={};var av,aw;for(av=0;av<ax.length;av++){var at=ax[av];az[at]=1;for(aw=0;aw<ay.length;aw++){if(ay[aw]&&ay[aw][0]){var au=ay[aw][0];if(at===au){aj(ay[aw]);delete ay[aw];if(az[au]>1&&au!=="addTracker"&&au!=="enableLinkTracking"){ao("The method "+au+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Matomo trackers documentation: https://developer.matomo.org/guides/tracking-javascript-guide#multiple-piwik-trackers')}az[au]++}}}}return ay}var E=["addTracker","forgetCookieConsentGiven","requireCookieConsent","disableBrowserFeatureDetection","disableCookies","setTrackerUrl","setAPIUrl","enableCrossDomainLinking","setCrossDomainLinkingTimeout","setSessionCookieTimeout","setVisitorCookieTimeout","setCookieNamePrefix","setCookieSameSite","setSecureCookie","setCookiePath","setCookieDomain","setDomains","setUserId","setVisitorId","setSiteId","alwaysUseSendBeacon","disableAlwaysUseSendBeacon","enableLinkTracking","setCookieConsentGiven","requireConsent","setConsentGiven","disablePerformanceTracking","setPagePerformanceTiming","setExcludedQueryParams"]; function ah(av,au){var at=new T(av,au);L.push(at);_paq=c(_paq,E);for(H=0;H<_paq.length;H++){if(_paq[H]){aj(_paq[H])}}_paq=new K();u.trigger("TrackerAdded",[at]);return at}ar(W,"beforeunload",am,false);ar(W,"online",function(){if(M(g.serviceWorker)){g.serviceWorker.ready.then(function(at){if(at&&at.sync){return at.sync.register("matomoSync")}},function(){})}},false);ar(W,"message",function(ay){if(!ay||!ay.origin){return}var aA,aw,au;var aB=d(ay.origin);var ax=u.getAsyncTrackers();for(aw=0;aw<ax.length;aw++){au=d(ax[aw].getMatomoUrl());if(au===aB){aA=ax[aw];break}}if(!aA){return}var av=null;try{av=JSON.parse(ay.data)}catch(az){return}if(!av){return}function at(aE){var aG=J.getElementsByTagName("iframe");for(aw=0;aw<aG.length;aw++){var aF=aG[aw];var aC=d(aF.src);if(aF.contentWindow&&M(aF.contentWindow.postMessage)&&aC===aB){var aD=JSON.stringify(aE);aF.contentWindow.postMessage(aD,"*")}}}if(M(av.maq_initial_value)){at({maq_opted_in:av.maq_initial_value&&aA.hasConsent(),maq_url:aA.getMatomoUrl(),maq_optout_by_default:aA.isConsentRequired()}) }else{if(M(av.maq_opted_in)){ax=u.getAsyncTrackers();for(aw=0;aw<ax.length;aw++){aA=ax[aw];if(av.maq_opted_in){aA.rememberConsentGiven()}else{aA.forgetConsentGiven()}}at({maq_confirm_opted_in:aA.hasConsent(),maq_url:aA.getMatomoUrl(),maq_optout_by_default:aA.isConsentRequired()})}}},false);Date.prototype.getTimeAlias=Date.prototype.getTime;u={initialized:false,JSON:W.JSON,DOM:{addEventListener:function(aw,av,au,at){var ax=typeof at;if(ax==="undefined"){at=false}ar(aw,av,au,at)},onLoad:n,onReady:q,isNodeVisible:i,isOrWasNodeVisible:w.isNodeVisible},on:function(au,at){if(!z[au]){z[au]=[]}z[au].push(at)},off:function(av,au){if(!z[av]){return}var at=0;for(at;at<z[av].length;at++){if(z[av][at]===au){z[av].splice(at,1)}}},trigger:function(av,aw,au){if(!z[av]){return}var at=0;for(at;at<z[av].length;at++){z[av][at].apply(au||W,aw)}},addPlugin:function(at,au){b[at]=au},getTracker:function(au,at){if(!M(at)){at=this.getAsyncTracker().getSiteId()}if(!M(au)){au=this.getAsyncTracker().getTrackerUrl() }return new T(au,at)},getAsyncTrackers:function(){return L},addTracker:function(av,au){var at;if(!L.length){at=ah(av,au)}else{at=L[0].addTracker(av,au)}return at},getAsyncTracker:function(ax,aw){var av;if(L&&L.length&&L[0]){av=L[0]}else{return ah(ax,aw)}if(!aw&&!ax){return av}if((!M(aw)||null===aw)&&av){aw=av.getSiteId()}if((!M(ax)||null===ax)&&av){ax=av.getTrackerUrl()}var au,at=0;for(at;at<L.length;at++){au=L[at];if(au&&String(au.getSiteId())===String(aw)&&au.getTrackerUrl()===ax){return au}}},retryMissedPluginCalls:function(){var au=al;al=[];var at=0;for(at;at<au.length;at++){aj(au[at])}}};if(typeof define==="function"&&define.amd){define("piwik",[],function(){return u});define("matomo",[],function(){return u})}return u}())} diff --git a/tests/javascript/index.php b/tests/javascript/index.php index 0d77932c0f..5a8c081c66 100644 --- a/tests/javascript/index.php +++ b/tests/javascript/index.php @@ -5208,7 +5208,7 @@ if ($mysql) { tracker.hook.test._beforeUnloadHandler(); stopTime = new Date(); var msSinceStarted = (stopTime.getTime() - startTime.getTime()); - ok( msSinceStarted < 510, 'beforeUnloadHandler(): ' + msSinceStarted + ' was greater than 510 ' ); + ok( msSinceStarted < 520, 'beforeUnloadHandler(): ' + msSinceStarted + ' was greater than 520 ' ); tracker.disableAlwaysUseSendBeacon(); tracker.setLinkTrackingTimer(2000); |