@convivainc/conviva-js-appanalytics
Version:
Conviva ECO Sensor library
103 lines (102 loc) • 159 kB
JavaScript
/*!
* Browser tracker for Conviva v1.1.6 (http://bit.ly/sp-js)
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
* Licensed under BSD-3-Clause
*/
'use strict';!function(va,ka){"object"==typeof exports&&"undefined"!=typeof module?ka(exports):"function"==typeof define&&define.amd?define(["exports"],ka):ka((va="undefined"!=typeof globalThis?globalThis:va||self).convivaBrowserTracking={})}(this,function(va){function ka(a){return ka="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},ka(a)}function Ba(a,
c,b){if(b||2===arguments.length)for(var d,e=0,h=c.length;e<h;e++)!d&&e in c||(d||(d=Array.prototype.slice.call(c,0,e)),d[e]=c[e]);return a.concat(d||Array.prototype.slice.call(c))}function Bg(a){if(!a)return a;switch(4-a.length%4){case 2:a+="==";break;case 3:a+="="}return function(c){var b,d,e,h=0,f=0,k="",n=[];if(!c)return c;c+="";do{var m=(b=Za.indexOf(c.charAt(h++))<<18|Za.indexOf(c.charAt(h++))<<12|(d=Za.indexOf(c.charAt(h++)))<<6|(e=Za.indexOf(c.charAt(h++))))>>16&255;var v=b>>8&255;b&=255;n[f++]=
64===d?String.fromCharCode(m):64===e?String.fromCharCode(m,v):String.fromCharCode(m,v,b)}while(h<c.length);return k=n.join(""),function(p){return decodeURIComponent(p.split("").map(function(l){return"%"+("00"+l.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(k.replace(/\0+$/,""))}(a.replace(/-/g,"+").replace(/_/g,"/"))}function Kd(){var a,c={},b=[],d=[],e=[],h=function(f,k){null!=k&&""!==k&&(c[f]=k)};return{add:h,addDict:function(f){for(var k in f)Object.prototype.hasOwnProperty.call(f,k)&&h(k,
f[k])},addJson:function(f,k,n){n&&Ie(n)&&(f={keyIfEncoded:f,keyIfNotEncoded:k,json:n},d.push(f),b.push(f))},addContextEntity:function(f){e.push(f)},getPayload:function(){return c},getJson:function(){return b},withJsonProcessor:function(f){a=f},build:function(){return null==a||a(this,d,e),c}}}function Cg(a){return function(c,b,d){for(var e=function(m,v,p){m=JSON.stringify(m);if(a){p=c.add;if(m){var l,A=0,C=0,x=[];if(m){m=unescape(encodeURIComponent(m));do{var y=(l=m.charCodeAt(A++)<<16|m.charCodeAt(A++)<<
8|m.charCodeAt(A++))>>18&63;var w=l>>12&63;var t=l>>6&63;l&=63;x[C++]=Za.charAt(y)+Za.charAt(w)+Za.charAt(t)+Za.charAt(l)}while(A<m.length);y=x.join("");m=m.length%3;m=(m?y.slice(0,m-3):y)+"===".slice(m||3)}m=m.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}p.call(c,v,m)}else c.add(p,m)},h=function(m,v){m||(m=c.getPayload(),m=(a?m.cx:m.co)?JSON.parse(a?Bg(m.cx):m.co):void 0);return m?m.dt=m.dt.concat(v.dt):m=v,m},f=void 0,k=0;k<b.length;k++){var n=b[k];"cx"===n.keyIfEncoded?f=h(f,n.json):
e(n.json,n.keyIfEncoded,n.keyIfNotEncoded)}(b.length=0,d.length)&&(f=h(f,{sc:"sp/ctx/1-0-0",dt:Ba([],d,!0)}),d.length=0);f&&e(f,"cx","co")}}function Ie(a){if(!Je(a))return!1;for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c))return!0;return!1}function Je(a){return null!=a&&(a.constructor==={}.constructor||a.constructor===[].constructor)}function Dg(){var a=[],c=[],b=function(d){var e=function(n){var m=0;for(n=n.getJson();m<n.length;m++){var v=n[m];if("ue_px"===v.keyIfEncoded&&"object"===
ka(v.json.data)&&(v=v.json.data.schema,"string"==typeof v))return v}return""}(d),h=function(n){n=n.getPayload().e;return"string"==typeof n?n:""}(d),f=[],k=Ld(a,d,h,e);f.push.apply(f,k);d=function(n,m,v,p){var l;n=Ke(n).map(function(A){if((A=function(C,x,y,w){if(Le(C)){var t=C[0],q=!1;try{q=t({event:x.getPayload(),eventType:y,eventSchema:w})}catch(N){q=!1}if(!0===q)return Ld(C[1],x,y,w)}else if(Me(C)&&function(N,K){var S=0,E=0,L=N.accept;Array.isArray(L)?N.accept.some(function(O){return $c(O,K)})&&
E++:"string"==typeof L&&$c(L,K)&&E++;L=N.reject;Array.isArray(L)?N.reject.some(function(O){return $c(O,K)})&&S++:"string"==typeof L&&$c(L,K)&&S++;return 0<E&&0===S?!0:!1}(C[0],w))return Ld(C[1],x,y,w);return[]}(A,m,v,p))&&0!==A.length)return A});return(l=[]).concat.apply(l,n.filter(function(A){return null!=A&&A.filter(Boolean)}))}(c,d,h,e);return f.push.apply(f,d),f};return{getGlobalPrimitives:function(){return a},getConditionalProviders:function(){return c},addGlobalContexts:function(d){for(var e=
[],h=[],f=0;f<d.length;f++){var k=d[f];Ne(k)?e.push(k):gc(k)&&h.push(k)}a=a.concat(h);c=c.concat(e)},clearGlobalContexts:function(){c=[];a=[]},removeGlobalContexts:function(d){for(var e=function(f){Ne(f)?c=c.filter(function(k){return JSON.stringify(k)!==JSON.stringify(f)}):gc(f)&&(a=a.filter(function(k){return JSON.stringify(k)!==JSON.stringify(f)}))},h=0;h<d.length;h++)e(d[h])},getApplicableContexts:function(d){return b(d)}}}function Oe(a){for(var c,b=[],d=1;d<arguments.length;d++)b[d-1]=arguments[d];
return null!==(c=null==a?void 0:a.map(function(e){if("function"!=typeof e)return e;try{return e.apply(void 0,b)}catch(h){}}).filter(Boolean))&&void 0!==c?c:[]}function Pe(a){a=a.split(".");return!!(a&&1<a.length)&&function(c){if("*"===c[0]||"*"===c[1])return!1;if(0<c.slice(2).length){var b=!1,d=0;for(c=c.slice(2);d<c.length;d++)if("*"===c[d])b=!0;else if(b)return!1;return!0}return 2==c.length}(a)}function Qe(a){a=/^iglu:((?:(?:[a-zA-Z0-9-_]+|\*).)+(?:[a-zA-Z0-9-_]+|\*))\/([a-zA-Z0-9-_.]+|\*)\/jsonschema\/([1-9][0-9]*|\*)-(0|[1-9][0-9]*|\*)-(0|[1-9][0-9]*|\*)$/.exec(a);
if(null!==a&&Pe(a[1]))return a.slice(1,6)}function Md(a){if(a=Qe(a)){var c=a[0];return 5===a.length&&Pe(c)}return!1}function Re(a){return function(c){return Array.isArray(c)&&c.every(function(b){return"string"==typeof b})}(a)?a.every(function(c){return Md(c)}):"string"==typeof a&&Md(a)}function zc(a){return!!(Ie(a)&&"sc"in a&&"dt"in a)&&"string"==typeof a.sc&&"object"===ka(a.dt)}function ad(a){return"function"==typeof a&&1>=a.length}function gc(a){return ad(a)||zc(a)}function Le(a){return!(!Array.isArray(a)||
2!==a.length)&&(Array.isArray(a[1])?ad(a[0])&&a[1].every(gc):ad(a[0])&&gc(a[1]))}function Me(a){return!(!Array.isArray(a)||2!==a.length)&&!!function(c){var b=0;if(null!=c&&"object"===ka(c)&&!Array.isArray(c)){if(Object.prototype.hasOwnProperty.call(c,"accept")){if(!Re(c.accept))return!1;b+=1}if(Object.prototype.hasOwnProperty.call(c,"reject")){if(!Re(c.reject))return!1;b+=1}return 0<b&&2>=b}return!1}(a[0])&&(Array.isArray(a[1])?a[1].every(gc):gc(a[1]))}function Ne(a){return Le(a)||Me(a)}function $c(a,
c){if(!Md(a))return!1;a=Qe(a);c=function(d){d=/^iglu:([a-zA-Z0-9-_.]+)\/([a-zA-Z0-9-_]+)\/jsonschema\/([1-9][0-9]*)-(0|[1-9][0-9]*)-(0|[1-9][0-9]*)$/.exec(d);if(null!==d)return d.slice(1,6)}(c);if(a&&c){if(!function(d,e){e=e.split(".");d=d.split(".");if(e&&d){if(e.length!==d.length)return!1;for(var h=0;h<d.length;h++)if(!Se(e[h],d[h]))return!1;return!0}return!1}(a[0],c[0]))return!1;for(var b=1;5>b;b++)if(!Se(a[b],c[b]))return!1;return!0}return!1}function Se(a,c){return a&&c&&"*"===a||a===c}function Ke(a){return Array.isArray(a)?
a:[a]}function Ld(a,c,b,d){var e;a=Ke(a).map(function(h){a:if(zc(h))h=[h];else{if(ad(h)){b:{var f=void 0;try{var k=(f=h({event:c.getPayload(),eventType:b,eventSchema:d}),Array.isArray(f)&&f.every(zc)||zc(f)?f:void 0);break b}catch(n){}k=void 0}if(zc(k)){h=[k];break a}if(Array.isArray(k)){h=k;break a}}h=void 0}if(h&&0!==h.length)return h});return(e=[]).concat.apply(e,a.filter(function(h){return null!=h&&h.filter(Boolean)}))}function Eg(a){void 0===a&&(a={});var c=a.base64,b=a.corePlugins,d=null!=b?
b:[];c=function(h,f,k){var n=function(l){return{addPluginContexts:function(A){var C=A?Ba([],A,!0):[];return l.forEach(function(x){try{x.contexts&&C.push.apply(C,x.contexts())}catch(y){aa.error("Error adding plugin contexts",y)}}),C}}}(f),m=Dg(),v=h,p={};return{track:function(l,A,C){l.withJsonProcessor(Cg(v));l.add("eid",Eb.v4());l.addDict(p);C=function(y){return null==y?{type:"dtm",value:(new Date).getTime()}:"number"==typeof y?{type:"dtm",value:y}:"ttm"===y.type?{type:"ttm",value:y.value}:{type:"dtm",
value:y.value||(new Date).getTime()}}(C);l.add(C.type,C.value.toString());A=function(y,w){y=m.getApplicableContexts(y);var t=[];return w&&w.length&&t.push.apply(t,w),y&&y.length&&t.push.apply(t,y),t}(l,n.addPluginContexts(A));A=A&&A.length?{sc:"sp/ctx/1-0-0",dt:A}:void 0;void 0!==A&&l.addJson("cx","co",A);f.forEach(function(y){try{y.beforeTrack&&y.beforeTrack(l)}catch(w){aa.error("Plugin beforeTrack",w)}});"function"==typeof k&&k(l);var x=l.build();return f.forEach(function(y){try{y.afterTrack&&y.afterTrack(x)}catch(w){aa.error("Plugin afterTrack",
w)}}),x},addPayloadPair:function(l,A){p[l]=A},configuration:a,getConfig:function(){return a},setConfig:function(l){l&&(void 0!==l.base64&&(a.base64=l.base64,v=l.base64),void 0!==l.lifecycleAutotracking&&(a.lifecycleAutotracking=l.lifecycleAutotracking),void 0!==l.cacheRefreshInterval&&(a.cacheRefreshInterval=l.cacheRefreshInterval),void 0!==l.exceptionAutotracking&&(a.exceptionAutotracking=l.exceptionAutotracking),void 0!==l.enablePeriodicHeartbeat&&(a.enablePeriodicHeartbeat=l.enablePeriodicHeartbeat),
void 0!==l.periodicHeartbeatInterval&&(a.periodicHeartbeatInterval=l.periodicHeartbeatInterval),void 0!==l.enc&&(a.enc=l.enc),void 0!==l.mend&&(a.mend=l.mend),void 0!==l.maxLocalStorageQueueSize&&(a.maxLocalStorageQueueSize=l.maxLocalStorageQueueSize),void 0!==l.maxGetBytes&&(a.maxGetBytes=l.maxGetBytes),void 0!==l.bufferSize&&(a.bufferSize=l.bufferSize),void 0!==l.customEventTrackingConfiguration&&(a.customEventTrackingConfiguration=l.customEventTrackingConfiguration),void 0!==l.networkRequestTrackingConfiguration&&
(a.networkRequestTrackingConfiguration=l.networkRequestTrackingConfiguration),void 0!==l.traceparentconfig&&(a.traceparentconfig=l.traceparentconfig),void 0!==l.metaTagsTrackingConfiguration&&(a.metaTagsTrackingConfiguration=l.metaTagsTrackingConfiguration),void 0!==l.performanceContextConfig&&(a.performanceContextConfig=l.performanceContextConfig),void 0!==l.configurationVersion&&(a.configurationVersion=l.configurationVersion),void 0!==l.catRcLastUpdatedTs&&(a.catRcLastUpdatedTs=l.catRcLastUpdatedTs),
void 0!==l.endpoint&&(a.endpoint=l.endpoint),void 0!==l.controlIngestConfig&&(a.controlIngestConfig=l.controlIngestConfig),void 0!==l.applicationContext&&(a.applicationContext=l.applicationContext),void 0!==l.emitterConfiguration&&(a.emitterConfiguration=l.emitterConfiguration),void 0!==l.di&&(a.di=l.di),void 0!==l.clickcc&&(a.clickcc=l.clickcc))},getBase64Encoding:function(){return v},setBase64Encoding:function(l){v=l},addPayloadDict:function(l){for(var A in l)Object.prototype.hasOwnProperty.call(l,
A)&&(p[A]=l[A])},resetPayloadPairs:function(l){p=Je(l)?l:{}},setTrackerVersion:function(l){p.tv=l},setTrackerNamespace:function(l){p.tna=l},setAppId:function(l){p.aid=l},setPlatform:function(l){p.p=l},setUserId:function(l){p.uid=l},setScreenResolution:function(l,A){p.res=l+"x"+A},setViewport:function(l,A){p.vp=l+"x"+A},setColorDepth:function(l){p.cd=l},setTimezone:function(l){p.tz=l},setLang:function(l){p.lang=l},setIpAddress:function(l){p.ip=l},setUseragent:function(l){p.ua=l},addGlobalContexts:function(l){m.addGlobalContexts(l)},
clearGlobalContexts:function(){m.clearGlobalContexts()},removeGlobalContexts:function(l){m.removeGlobalContexts(l)}}}(null==c||c,d,a.callback);var e=da(da({},c),{addPlugin:function(h){var f,k;h=h.plugin;d.push(h);null===(f=h.logger)||void 0===f||f.call(h,aa);null===(k=h.activateCorePlugin)||void 0===k||k.call(h,e)}});return null==d||d.forEach(function(h){var f,k;null===(f=h.logger)||void 0===f||f.call(h,aa);null===(k=h.activateCorePlugin)||void 0===k||k.call(h,e)}),e}function Rb(a){var c=a.event;
a=c.sc;var b=c.dt;c=Kd();a={sc:"sp/ue/1-0-0",dt:{sc:a,dt:b}};return c.add("e","ue"),c.addJson("ue_px","ue_pr",a),c}function bd(a){return Rb({event:{sc:"cv/re/1-0-1",dt:hc({name:a.name,data:a.data})}})}function hc(a,c){void 0===c&&(c={});var b={},d;for(d in a)(c[d]||null!==a[d]&&void 0!==a[d])&&(b[d]=a[d]);return b}function ic(a){for(var c=a.length;0<=--c;)a[c]=0}function Nd(a,c,b,d,e){this.static_tree=a;this.extra_bits=c;this.extra_base=b;this.elems=d;this.max_length=e;this.has_stree=a&&a.length}
function Od(a,c){this.dyn_tree=a;this.max_code=0;this.stat_desc=c}function jb(a,c,b,d,e){this.good_length=a;this.max_lazy=c;this.nice_length=b;this.max_chain=d;this.func=e}function Fg(){this.strm=null;this.status=0;this.pending_buf=null;this.wrap=this.pending=this.pending_out=this.pending_buf_size=0;this.gzhead=null;this.gzindex=0;this.method=cd;this.last_flush=-1;this.w_mask=this.w_bits=this.w_size=0;this.window=null;this.window_size=0;this.head=this.prev=null;this.nice_match=this.good_match=this.strategy=
this.level=this.max_lazy_match=this.max_chain_length=this.prev_length=this.lookahead=this.match_start=this.strstart=this.match_available=this.prev_match=this.match_length=this.block_start=this.hash_shift=this.hash_mask=this.hash_bits=this.hash_size=this.ins_h=0;this.dyn_ltree=new Uint16Array(1146);this.dyn_dtree=new Uint16Array(122);this.bl_tree=new Uint16Array(78);Fb(this.dyn_ltree);Fb(this.dyn_dtree);Fb(this.bl_tree);this.bl_desc=this.d_desc=this.l_desc=null;this.bl_count=new Uint16Array(16);this.heap=
new Uint16Array(573);Fb(this.heap);this.heap_max=this.heap_len=0;this.depth=new Uint16Array(573);Fb(this.depth);this.bi_valid=this.bi_buf=this.insert=this.matches=this.static_len=this.opt_len=this.sym_end=this.sym_next=this.lit_bufsize=this.sym_buf=0}function Ac(a){a=this.options=Te({level:Gg,method:Hg,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ig},a||{});a.raw&&0<a.windowBits?a.windowBits=-a.windowBits:a.gzip&&0<a.windowBits&&16>a.windowBits&&(a.windowBits+=16);this.err=0;this.msg="";this.ended=
!1;this.chunks=[];this.strm=new Ue;this.strm.avail_out=0;var c=Bc.deflateInit2(this.strm,a.level,a.method,a.windowBits,a.memLevel,a.strategy);if(c!==dd)throw Error(Sb[c]);if(a.header&&Bc.deflateSetHeader(this.strm,a.header),a.dictionary){var b;if(b="string"==typeof a.dictionary?Pd(a.dictionary):"[object ArrayBuffer]"===Ve.call(a.dictionary)?new Uint8Array(a.dictionary):a.dictionary,(c=Bc.deflateSetDictionary(this.strm,b))!==dd)throw Error(Sb[c]);this._dict_set=!0}}function Qd(a,c){c=new Ac(c);if(c.push(a,
!0),c.err)throw c.msg||Sb[c.err];return c.result}function Jg(){this.strm=null;this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new Uint16Array(320);this.work=new Uint16Array(288);this.distdyn=
this.lendyn=null;this.was=this.back=this.sane=0}function Cc(a){var c=this.options=Te({chunkSize:65536,windowBits:15,to:""},a||{});c.raw&&0<=c.windowBits&&16>c.windowBits&&(c.windowBits=-c.windowBits,0===c.windowBits&&(c.windowBits=-15));!(0<=c.windowBits&&16>c.windowBits)||a&&a.windowBits||(c.windowBits+=32);15<c.windowBits&&48>c.windowBits&&0==(15&c.windowBits)&&(c.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new Ue;this.strm.avail_out=0;a=sb.inflateInit2(this.strm,
c.windowBits);if(a!==Dc)throw Error(Sb[a]);if(this.header=new Kg,sb.inflateGetHeader(this.strm,this.header),c.dictionary&&("string"==typeof c.dictionary?c.dictionary=Pd(c.dictionary):"[object ArrayBuffer]"===We.call(c.dictionary)&&(c.dictionary=new Uint8Array(c.dictionary)),c.raw&&(a=sb.inflateSetDictionary(this.strm,c.dictionary))!==Dc))throw Error(Sb[a]);}function Rd(a,c){c=new Cc(c);if(c.push(a),c.err)throw c.msg||Sb[c.err];return c.result}function Sd(a){return!(!a||"string"!=typeof a.valueOf())}
function Ec(a){return Number.isInteger&&Number.isInteger(a)||"number"==typeof a&&isFinite(a)&&Math.floor(a)===a}function Td(a){if(!Sd(a)){a=a.text||"";var c=document.getElementsByTagName("title");c&&null!=c[0]&&(a=c[0].text)}return a}function ed(a){var c=/^(?:(?:https?|ftp):)\/*(?:[^@]+@)?([^:/#]+)/.exec(a);return c?c[1]:a}function Xe(a){var c=a.length;return"."===a.charAt(--c)&&(a=a.slice(0,c)),"*."===a.slice(0,2)&&(a=a.slice(1)),a}function Ud(a){var c=window,b=Fc("referrer",c.location.href)||Fc("referer",
c.location.href);if(b)return b;if(a)return a;try{if(c.top)return c.top.document.referrer;if(c.parent)return c.parent.document.referrer}catch(d){}return document.referrer}function fb(a,c,b,d){return void 0!==a&&(a.addEventListener?(a.addEventListener(c,b,d),!0):a.attachEvent?a.attachEvent("on"+c,b):void(a["on"+c]=b))}function Fc(a,c){return(a=(new RegExp("^[^#]*[?&]"+a+"=([^&#]*)")).exec(c))?decodeURIComponent(a[1].replace(/\+/g," ")):null}function fd(a,c,b){void 0===b&&(b=63072E3);try{var d=window.localStorage,
e=Date.now()+1E3*b;return d.setItem("".concat(a,".expires"),e.toString()),d.setItem(a,c),!0}catch(h){return!1}}function Ye(a){try{var c=window.localStorage;return c.removeItem(a),c.removeItem(a+".expires"),!0}catch(b){return!1}}function kb(a,c,b,d,e,h,f){return 1<arguments.length?document.cookie=a+"="+encodeURIComponent(null!=c?c:"")+(b?"; Expires="+(new Date(+new Date+1E3*b)).toUTCString():"")+(d?"; Path="+d:"")+(e?"; Domain="+e:"")+(h?"; SameSite="+h:"")+(f?"; Secure":""):decodeURIComponent((("; "+
document.cookie).split("; "+a+"=")[1]||"").split(";")[0])}function Ze(a){try{var c=null===window||void 0===window?void 0:window.localStorage;return!!c&&(c.removeItem(a),!0)}catch(b){return!1}}function gd(){"undefined"!=typeof window&&void 0!==window.localStorage&&localStorage.removeItem(F.SAMPLING_STORAGE_RANDOM_NUMBER_KEY)}function Vd(a,c){return void 0!==a.act&&void 0!==a.act[c]&&(a=a.act[c],void 0!==a)?a:F.DEFAULT_SAMPLING_ACTION[c]}function Pa(a,c){return a.length<=c?a:a.slice(0,c-3)+"..."}function Lg(a,
c,b){try{if("string"==typeof b&&"string"==typeof a&&"*"===b.trim())return!0;switch(c){case "==":case "equal":return a===b;case "!=":return a!==b;case ">":return a>b;case "<":return a<b;case ">=":return a>=b;case "<=":return a<=b;case "contains":return""!==b&&"string"==typeof a&&"string"==typeof b&&-1!==a.toLowerCase().indexOf(b.toLowerCase());default:return!1}}catch(d){return console.warn("Conviva App Tracker: Error in Compare values nwreq ".concat(d)),!1}}function Mg(a,c,b){var d={};try{for(var e=
0;e<c.length;e++){var h=c[e],f=a,k=d;b&&(h=h.toLowerCase(),f=f&&Object.entries(f).reduce(function(p,l){var A=l[1];return p[l[0].toLowerCase()]=A,p},{}));for(var n=h.split("."),m=0;m<n.length;m++){var v=n[m];if(null==f||!f.hasOwnProperty(v))break;m===n.length-1?k[v]=f[v]:(k[v]=k[v]||{},f=f[v],k=k[v])}}}catch(p){console.warn("Conviva App Tracker: Error in filtering schema object nwreq ".concat(p))}return d}function $e(a,c,b){var d,e,h;return"translate.googleusercontent.com"===a?(""===b&&(b=c),a=ed(c=
null!==(e=c,d=(h=/^(?:https?|ftp)(?::\/*(?:[^?]+))([?][^#]+)/.exec(e))&&1<(null==h?void 0:h.length)?Fc("u",h[1]):null)&&void 0!==d?d:"")):"cc.bingj.com"!==a&&"webcache.googleusercontent.com"!==a||(a=ed(c=document.links[0].href)),[a,c,b]}function Gc(a,c){void 0===c&&(c=1);"0"===a[0]?(a[7]=a[6],a[5]=a[4],a[3]++):a[3]=c;c=Eb.v4();return a[6]=c,a[8]="",a[9]=void 0,c}function Wd(a){a[4]=Math.round((new Date).getTime()/1E3)}function hd(a){return{activateLCPObserver:function(){try{PerformanceObserver&&(new PerformanceObserver(function(c){try{c.getEntries().forEach(function(b){var d;
if("largest-contentful-paint"===b.entryType){var e=null===performance||void 0===performance?void 0:performance.getEntriesByType("navigation"),h=void 0;e&&0<(null==e?void 0:e.length)&&(h=null===(d=e[0])||void 0===d?void 0:d.activationStart);qa=da(da({},b.toJSON()),{performanceNavigationActivationStart:null!=h?h:0})}})}catch(b){console.warn("convivaAppTracker error in conviva lcp observer "+b)}})).observe({type:"largest-contentful-paint",buffered:!0})}catch(c){console.warn("convivaAppTracker conviva_lcp failed "+
c)}},contexts:function(){try{switch(a){case F.PERFORMANCE_CONTEXT.DISABLED:return[];case F.PERFORMANCE_CONTEXT.PERFORMANCE_NAVIGATION_TIMING:return function(){var c,b,d;try{var e=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{};if(e.getEntriesByType){var h=e.getEntriesByType("navigation")[0],f=null!==(c=null==e?void 0:e.timeOrigin)&&void 0!==c?c:0;if(!h)return[];var k={st:Math.floor(f+h.startTime),dls:Math.floor(f+h.domainLookupStart),dle:Math.floor(f+
h.domainLookupEnd),rss:Math.floor(f+h.responseStart),rse:Math.floor(f+h.responseEnd),le:Math.floor(f+h.loadEventEnd),dur:Math.floor(f+h.duration),as:Math.floor(f+h.activationStart)};return(null==qa?void 0:qa.startTime)&&(k.lcp={rt:Math.floor(f+qa.startTime),url:128<(null===(b=null==qa?void 0:qa.url)||void 0===b?void 0:b.length)?null===(d=null==qa?void 0:qa.url)||void 0===d?void 0:d.substring(0,128):qa.url,sz:qa.size}),[{sc:"cv/pc/1-0-1",dt:k}]}return[]}catch(n){return console.warn("ConvivaAppTracker: issue will getting performance Navigation timing context"),
[]}}();default:return Ba(Ba([],function(){var c=window;c=c.performance||c.mozPerformance||c.msPerformance||c.webkitPerformance;var b=c.timing;return c?[{sc:"w3/pt/1-0-0",dt:{navigationStart:b.navigationStart,domainLookupStart:b.domainLookupStart,domainLookupEnd:b.domainLookupEnd,responseStart:b.responseStart,responseEnd:b.responseEnd,loadEventEnd:b.loadEventEnd}}]:[]}(),!0),function(){var c,b,d;try{if(void 0!==(null==qa?void 0:qa.startTime)&&"number"==typeof(null==qa?void 0:qa.startTime))return[{sc:"cv/lcp/1-0-0",
dt:{lcp:Math.round(qa.startTime)-(null!==(c=qa.performanceNavigationActivationStart)&&void 0!==c?c:0),url:128<(null===(b=null==qa?void 0:qa.url)||void 0===b?void 0:b.length)?null===(d=null==qa?void 0:qa.url)||void 0===d?void 0:d.substring(0,128):qa.url}}]}catch(e){}return[]}(),!0)}}catch(c){return console.warn("convivaAppTracker problem in perfromance context "+c),[]}}}}function id(a,c,b,d,e,h){var f;try{var k,n=null,m=null!==(f=h.url)&&void 0!==f?f:"";if(!m)return!0;if(Ng.some(function(A){return m.includes(A)}))return!1;
var v=(k=new URL(m)).protocol.replace(":","");f=function(A,C){var x;a:{var y={scheme:v,host:k.hostname,path:decodeURIComponent(k.pathname)},w=Tb.NETWORK_REQUEST;try{for(var t=0;t<A.length;t++){var q=A[t],N=q.opt;if(jc(q.req,y,w)){var K=!0;var S=N||null;break a}}K=!1;S=null}catch(E){K=!1,S=null}}return K?S?jc(S,{responseStatusCode:null!==(x=null==e?void 0:e.status)&&void 0!==x?x:0,duration:Date.now()-h.requestTimestamp},Tb.NETWORK_REQUEST)===C:C:null};if(a&&null===n&&(n=f(a,!0)),c&&null===n&&(n=f(c,
!1)),null===n){var p=(null==b?void 0:b.includes("*"))||(null==b?void 0:b.some(function(A){return!(!A||""===A)&&m.includes(A)})),l=null==d?void 0:d.some(function(A){return!(!A||""===A)&&m.includes(A)});n=!p||l}return!0===n}catch(A){return!0}}function jc(a,c,b){try{if(!a)return!1;if("and"===a.type){for(var d=0,e=a.cond;d<e.length;d++)if(!jc(e[d],c,b))return!1;return!0}if("or"===a.type){e=0;for(d=a.cond;e<d.length;e++)if(jc(d[e],c,b))return!0;return!1}return b===Tb.NETWORK_REQUEST?function(h,f){var k=
h.key,n=h.op;h=h.val;if(!k||!n)return!1;switch(k){case "sch":return!!f.scheme&&jd(f.scheme,n,h);case "host":return!!f.host&&jd(f.host,n,h);case "path":return!!f.path&&jd(f.path,n,h);case "dur":return!!f.duration&&Xd(f.duration,n,h);case "rsc":return void 0!==f.responseStatusCode&&0<=f.responseStatusCode&&Xd(f.responseStatusCode,n,h);default:return!1}}(a,c):b===Tb.CUSTOM_EVENT&&function(h,f){var k=h.key,n=h.op;h=h.val;if(!k||!n)return!1;if(void 0!==f[k]){if(Sd(f[k]))return jd(f[k],n,h);if("boolean"==
typeof f[k])switch(f=f[k],n){case "!=":return f!==h;case "==":return f===h;default:return!1}if(Number.isInteger(f[k]))return Xd(f[k],n,h)}return!1}(a,c)}catch(h){return!1}}function jd(a,c,b){var d;return"=="===c&&Array.isArray(b)?!!(d=b).includes("*")||d.some(function(e){return!(!e||""===e)&&a===e}):"contains"===c&&Array.isArray(b)?!!(d=b).includes("*")||d.some(function(e){return!(!e||""===e)&&a.includes(e)}):"sw"===c&&Array.isArray(b)?!!(d=b).includes("*")||d.some(function(e){return!(!e||""===e)&&
a.startsWith(e)}):!("ew"!==c||!Array.isArray(b))&&(!!(d=b).includes("*")||d.some(function(e){return!(!e||""===e)&&a.endsWith(e)}))}function Xd(a,c,b){if("in"===c.toLowerCase()&&Array.isArray(b))return b.includes(a);if("range"===c.toLowerCase()&&"object"===ka(b)){c=b.min;var d=b.max,e=b.minExclusive;b=b.maxExclusive;return void 0!==c&&void 0!==d?a>=c&&a<=d:void 0!==e&&void 0!==b&&a>e&&a<b}if(Ec(b))switch(c){case "!=":return a!==b;case ">":return a>b;case ">=":return a>=b;case "<":return a<b;case "<=":return a<=
b;case "==":return a===b}return!1}function af(a,c,b){var d=null;a:{for(var e=0;e<a.length;e++){var h=a[e];var f=h.opt;if(jc(h.req,c,b)){a=!0;f=f||null;break a}}a=!1;f=null}a&&(d=!f||!!jc(f,c,b));return d}function bf(a,c){var b;return function(){for(var d=this,e=[],h=0;h<arguments.length;h++)e[h]=arguments[h];clearTimeout(b);b=setTimeout(function(){return a.apply(d,e)},c)}}function cf(a){var c,b,d,e,h;try{var f=function(C){var x,y,w;try{if(!Ka||!Ka.core)return null;var t=Ka.core.getConfig();if(!0!==
(null===(x=null==t?void 0:t.clickcc)||void 0===x?void 0:x.en))return null;var q=null===(y=null==t?void 0:t.clickcc)||void 0===y?void 0:y.uiMode,N=null===(w=null==t?void 0:t.clickcc)||void 0===w?void 0:w.cssSelectorList,K=(null==N?void 0:N.replace(/\s+/g,""))||"";return q===Hc.RAW?C:q===Hc.BOTH?C.closest(K)||C:C.closest(K)}catch(S){return aa.warn("Conviva App Tracker caused Exception in getTrackedElement method of user click tracking module",S),null}}(a.target);if(f){a={};var k=F.CLICK_KEY_MAX_LENGTH;
(null==f?0:f.id)&&(a.id=Pa(f.id,k));(null==f?0:f.className)&&(a.class=Pa(f.className,k));(null==f?0:f.tagName)&&(a.elementName=Pa(f.tagName.toLowerCase(),k));(null===(c=null==f?void 0:f.innerText)||void 0===c?0:c.trim())&&(a.text=Pa(f.innerText.trim(),k));(null==f?0:f.getAttribute("name"))&&(a.name=Pa(f.getAttribute("name")||"",k));(null==f?0:f.getAttribute("type"))&&(a.elementType=Pa((null===(b=f.getAttribute("type"))||void 0===b?void 0:b.toLowerCase())||"",k));(null==f?0:f.placeholder)&&(a.placeholder=
Pa(f.placeholder,k));(null==f?0:f.getAttribute("type"))&&"password"!==(null==f?void 0:f.getAttribute("type"))&&f.value&&(a.value=Pa(f.value,k));try{if("A"===f.tagName.toUpperCase()||"AREA"===f.tagName.toUpperCase()){if(null!=f.href){var n=f.hostname||ed(f.href),m=n.toLowerCase(),v=f.href.replace(n,m);/^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto):/i.test(v)||(a.targetUrl=Pa(decodeURIComponent(v),k))}f.target&&(a.target=Pa(f.target,k))}}catch(C){aa.warn("Conviva App Tracker caused Exception in handleClick href setting",
C)}var p=null===(d=null==Ka?void 0:Ka.core)||void 0===d?void 0:d.getConfig(),l=null!==(e=null==p?void 0:p.clickcc)&&void 0!==e?e:{},A=function(C,x,y){var w=C.collect,t=C.block;C=null;if(w&&(C=af(w,x,y)),t&&null===C)x=af(t,x,y),"boolean"==typeof x&&(C=!x);return null===C||C}({collect:l.collect,block:l.block},a,Tb.CUSTOM_EVENT);if("boolean"!=typeof A||!1!==A)null===(h=null==Ka?void 0:Ka.core)||void 0===h||h.track(bd({name:"conviva_click",data:JSON.stringify(a)}))}}catch(C){return void aa.warn("Conviva App Tracker caused Exception in handleClick method of user click tracking module",
C)}}function df(){try{Ic&&"undefined"!=typeof document&&document.body&&(Ub&&(document.body.removeEventListener("click",Ub),Ub=null),Ic=!1)}catch(a){aa.warn("Conviva App Tracker caused Exception in disableUserClickTracking method of user click tracking module",a)}}function Da(a,c,b){var d,e;try{if(a&&c){var h=null==a?void 0:a.getConfig(),f=function(k,n,m){var v,p,l,A={message:""};try{var C=m.message,x=m.error,y=m.className,w=m.extraData;if(C)A.message=C;else if("string"==typeof x){if(!(0<x.trim().length))return aa.warn("Conviva Eco Sensor:: Mandatory field message is missing"),
null;A.message=x}else"object"===ka(x)&&("string"==typeof x.message&&0<x.message.trim().length&&(A.message=Pa(x.message,F.DIAGNOSTIC_INFO_MAX_LENGTH.MAX_MESSAGE_LENGTH)),"string"==typeof x.name&&0<x.name.trim().length&&(A.exceptionName=Pa(x.name,F.DIAGNOSTIC_INFO_MAX_LENGTH.MAX_EXCEPTION_NAME_LENGTH)),"string"==typeof x.stack&&0<x.stack.trim().length&&(A.stackTrace=Pa(x.stack,F.DIAGNOSTIC_INFO_MAX_LENGTH.MAX_STACK_LENGTH)));if(0===A.message.trim().length)return aa.warn("Conviva Eco Sensor:: Mandatory field message is missing"),
null;"string"==typeof y&&0<y.trim().length&&(A.className=Pa(y,F.DIAGNOSTIC_INFO_MAX_LENGTH.MAX_CLASSNAME_LENGTH));null!=w&&(A.extraData=w);var t=null==k?void 0:k.getConfig();if((null==t?void 0:t.configurationVersion)&&(A.remoteConfigVersion=t.configurationVersion),(null==m?void 0:m.configAppliedTime)&&(A.configAppliedTime=null==m?void 0:m.configAppliedTime),(null==t?void 0:t.cacheRefreshInterval)&&(A.cacheRefreshInterval=t.cacheRefreshInterval),(null==m?void 0:m.configAppliedSrc)&&(A.configAppliedSrc=
null==m?void 0:m.configAppliedSrc),localStorage){var q=localStorage.getItem(F.SAMPLING_STORAGE_RANDOM_NUMBER_KEY);null!=q&&(A.samplingRandomNumber=parseFloat(q))}"number"==typeof(null===(p=null===(v=null==t?void 0:t.controlIngestConfig)||void 0===v?void 0:v.sel)||void 0===p?void 0:p.pct)?(A.samplingPercentage=t.controlIngestConfig.sel.pct,A.samplingDecision=F.SAMPLING_STATUS.DERIVED,null!=ka(null===(l=null==t?void 0:t.controlIngestConfig)||void 0===l?void 0:l.act)&&(A.extraData=da(da({},A.extraData),
{samplingActionConfig:t.controlIngestConfig.act}))):A.samplingDecision=F.SAMPLING_STATUS.DEFAULT;"function"==typeof(null==n?void 0:n.getSamplingMode)&&"string"==typeof(null==n?void 0:n.getSamplingMode())&&(A.samplingStatus=(null==n?void 0:n.getSamplingMode())==F.SAMPLING_MODES.RCFG)}catch(N){return aa.warn("Error occurred while generating diagnostic object",N),null}return A}(a,c,b);f&&function(k){var n;try{var m=null==k?void 0:k.getConfig(),v=(null===(n=null==m?void 0:m.di)||void 0===n?void 0:n.lim)||
10,p=Date.now();return 6E4<=p-ef&&(ff=0,ef=p),!(++ff>v)}catch(l){return aa.warn("Conviva Eco Sensor:: Error occured while checking diagnostic event is allowed",l),!1}}(a)&&("boolean"!=typeof(null===(d=null==h?void 0:h.di)||void 0===d?void 0:d.en)||!0!==(null===(e=null==h?void 0:h.di)||void 0===e?void 0:e.en)||null!=a&&a.track(Rb({event:{sc:"iglu:com.conviva/di/jsonschema/1-0-4",dt:hc({msg:f.message,cn:f.className,st:f.stackTrace,en:f.exceptionName,ed:f.extraData,rcv:f.remoteConfigVersion,cat:f.configAppliedTime,
cri:f.cacheRefreshInterval,csrc:f.configAppliedSrc,srn:f.samplingRandomNumber,spr:f.samplingPercentage,ss:f.samplingStatus,sd:f.samplingDecision})}})))}}catch(k){aa.warn("Conviva Eco Sensor:: Error occurred while sending reportDiagnosticError",k)}}function Og(){try{var a=!!window.localStorage}catch(b){a=!0}if(!a)return!1;try{var c=window.localStorage;return c.setItem("modernizr","modernizr"),c.removeItem("modernizr"),!0}catch(b){return!1}}function Pg(a,c,b,d,e,h,f,k,n,m,v,p,l,A,C,x,y,w,t){function q(J){var P=
Object.keys(J).map(function(U){return[U,J[U]]}).reduce(function(U,ba){return U[ba[0]]=ba[1].toString(),U},{});return{evt:P,bytes:N(JSON.stringify(P))}}function N(J){for(var P=0,U=0;U<J.length;U++){var ba=J.charCodeAt(U);127>=ba?P+=1:2047>=ba?P+=2:55296<=ba&&57343>=ba?(P+=4,U++):P+=65535>ba?3:4}return P}function K(J,P){P=L(P,!0,!1);J=O(T([J.evt]));try{C().toLowerCase()!==tb.NONE&&(J=gf.gzip(J,{level:6}),P.setRequestHeader("Content-Encoding",tb.GZIP))}catch(U){}t()!==F.SAMPLING_MODES.NONE&&P.send(J)}
function S(J){try{if("undefined"!=typeof window&&void 0!==window.__CONVIVA_VISUAL_ACTIVATION_EXTENSION__&&"function"==typeof window.__CONVIVA_VISUAL_ACTIVATION_EXTENSION__.postMessage){var P=O(T(J));window.__CONVIVA_VISUAL_ACTIVATION_EXTENSION__.postMessage(P)}}catch(U){aa.warn("Error occured while sending message to Visual Labelling Extension",U)}}function E(J){for(void 0===J&&(J=!1);X.length&&"string"!=typeof X[0]&&"object"!==ka(X[0]);)X.shift();if(1>X.length)ma=!1;else{if(!Sd(ra))throw"No collector configured";
if(ma=!0,window.clearTimeout(Ma),Ma=-1,na){var P,U=void 0,ba=void 0;"object"===ka(X[0])?(P=L(U=ra,!0,J),ba=function(oa){for(var wa=0,ub=0;wa<oa.length&&!((ub+=oa[wa].bytes)>=y());)wa+=1;return wa}(X)):(U=Z(X[0]),P=L(U,!1,J),ba=1);var Qa=setTimeout(function(){P.abort();ma=!1},m);if(P.onreadystatechange=function(){4===P.readyState&&(clearTimeout(Qa),200<=P.status&&300>P.status?E():(aa.error("Status ".concat(P.status,", will not retry.")),ma=!1))},"object"===ka(X[0])){var $a=X.slice(0,ba);if(0<$a.length){J=
!1;$a=$a.map(function(oa){return oa.evt});if(Ra){var vb=new Blob([O(T($a))],{type:"application/json"});try{J=navigator.sendBeacon(U,vb)}catch(oa){J=!1}}if(!0===J)E();else{U=O(T($a));try{C().toLowerCase()!==tb.NONE&&(U=gf.gzip(U,{level:6}),P.setRequestHeader("Content-Encoding",tb.GZIP))}catch(oa){}try{t()!==F.SAMPLING_MODES.NONE&&P.send(U)}catch(oa){}}}}else P.send();!function(oa){for(var wa=0;wa<oa;wa++)X.shift();b&&fd(ab,JSON.stringify(X.slice(-1*n())))}(ba)}else if(v||"object"===ka(X[0]))ma=!1;
else{ba=new Image(1,1);var Wa=!0;ba.onload=function(){Wa&&(Wa=!1,X.shift(),b&&fd(ab,JSON.stringify(X.slice(-1*n()))),E())};ba.onerror=function(){Wa&&(Wa=!1,ma=!1)};ba.src=Z(X[0]);setTimeout(function(){Wa&&ma&&(Wa=!1,E())},m)}}}function L(J,P,U){var ba=new XMLHttpRequest,Qa;for(Qa in P?(ba.open("POST",J,!U),ba.setRequestHeader("Content-Type","application/json; charset=UTF-8")):ba.open("GET",J,!U),ba.withCredentials=l,v&&ba.setRequestHeader("SP-Anonymous","*"),p)Object.prototype.hasOwnProperty.call(p,
Qa)&&ba.setRequestHeader(Qa,p[Qa]);return ba}function O(J){return JSON.stringify({sc:"sp/pd/1-0-4",dt:J})}function T(J){for(var P=(new Date).getTime().toString(),U=0;U<J.length;U++)J[U].stm=P;return J}function Z(J){return k?ra+J.replace("?","?stm="+(new Date).getTime()+"&"):ra+J}(null===window||void 0===window?0:window.addEventListener)&&window.addEventListener("ConvivaExecuteQueue",function(){E()},{signal:lb});var ra,V,ma=!1,X=[],Ma=-1,xa=!0===(d="string"==typeof d?d.toLowerCase():d)||"beacon"===
d||"true"===d,Ra=!(!(xa&&window.navigator&&window.navigator.sendBeacon)||function(J,P){P=P.match(/\(iP.+; CPU .*OS (\d+)[_\d]*.*\) AppleWebKit\//);return!(!P||!P.length)&&parseInt(P[0])<=J}(13,V=window.navigator.userAgent)||function(J,P,U){U=U.match("(Macintosh;.*Mac OS X (\\d+)_(\\d+)[_\\d]*.*) AppleWebKit/");return!(!U||!U.length)&&(parseInt(U[2])<=J||parseInt(U[2])===J&&parseInt(U[3])<=P)}(10,15,V)&&function(J){return/^(?!.*Chrome)(?!.*Chromium)(?!.*Edg)(?!.*OPR)(?=.*Safari)/.test(J)&&!/(Chrome|Chromium|Edg|OPR)/.test(J)}(V))&&
xa,na=!!(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),Y="get"!==d&&na&&("post"===d||xa),fa=Y?e:"/i";d="convivaOutQueue_".concat(a,"_").concat(Y?"post2":"get");var ab="convivaOutQueue_".concat(a,"_").concat(Y?"post2":"get");if(Ze(d),Ze("".concat(d,".expires")),xa&&(p={}),h=b&&Og()&&Y&&h||1,b)try{var kd=window.localStorage.getItem(ab);X=kd?JSON.parse(kd):[]}catch(J){}Array.isArray(X)||(X=[]);c.outQueues.push(X);na&&1<h&&c.bufferFlushers.push(function(J){ma||E(J)});return{enqueueRequest:function(J,
P,U){if(t()!=F.SAMPLING_MODES.NONE){ra=P+fa;if(Y){S([(J=q(J)).evt]);P=y();if(J.bytes>=P)return ma||E(),aa.warn("Event ("+J.bytes+"B) too big, max is "+P),void K(J,ra);X.push(J)}else{var ba=function(oa){var wa="?",ub={co:!0,cx:!0},kc=!0,wb;for(wb in oa)oa.hasOwnProperty(wb)&&!ub.hasOwnProperty(wb)&&(kc?kc=!1:wa+="&",wa+=encodeURIComponent(wb)+"="+encodeURIComponent(oa[wb]));for(var Gb in ub)oa.hasOwnProperty(Gb)&&ub.hasOwnProperty(Gb)&&(wa+="&"+Gb+"="+encodeURIComponent(oa[Gb]));return wa}(J),Qa=f();
if(0<Qa){var $a=N(Z(ba));if($a>=Qa){if(aa.warn("Event ("+$a+"B) too big, max is "+Qa),na)S([(J=q(J)).evt]),K(J,P+e);return}}X.push(ba)}P=!1;b&&(P=fd(ab,JSON.stringify(X.slice(-1*n()))));!ma&&-1===Ma&&P&&(Ma=window.setTimeout(E,w()+(Wa=A,Math.floor(Math.random()*Wa))));ma||!(!P||!x()||Y&&(vb=0,vb=Y?X.reduce(function(oa,wa){return oa+wa.bytes},0):X.reduce(function(oa,wa){return oa+wa.length},0),vb>y())||X.length>h||U)||E()}var vb,Wa},executeQueue:function(){ma||E()},setUseLocalStorage:function(J){b=
J},setAnonymousTracking:function(J){v=J},setCollectorUrl:function(J){ra=J+fa},setBufferSize:function(J){h=J},setCustomHeaders:function(J){p=J}}}function hf(a){try{Yd({message:a.message,filename:a.filename,lineno:a.lineno,colno:a.colno,error:a.error})}catch(c){console.warn("Conviva App Tracker caused Exception in captureError method of error tracking module",c)}}function jf(a){try{Yd({message:a.reason})}catch(c){console.warn("Conviva App Tracker caused Exception in captureRejection method of error tracking module",
c)}}function Yd(a){var c,b,d=a.message,e=a.filename,h=a.lineno,f=a.colno,k=a.error,n=a.context;a=a.timestamp;k=k&&k.stack?k.stack:void 0;if(!(void 0===d||null===d&&void 0===k||null===k&&void 0===h||null===h&&void 0===f||null===f&&void 0===e||null===e)){var m=null===(c=null==lc?void 0:lc.core)||void 0===c?void 0:c.getConfig();(null==m?0:m.exceptionAutotracking)&&(null===(b=null==lc?void 0:lc.core)||void 0===b||b.track(Rb({event:{sc:"sp/ae/1-0-1",dt:{programmingLanguage:"JAVASCRIPT",message:d?kf(d,
2048):"JS Exception.",stackTrace:k?kf(k,8192):"",lineNumber:h,lineColumn:f,fileName:e}}}),n,a))}}function Qg(a){var c;try{var b=0,d=0;if("complete"===document.readyState){var e=null===(c=null==a?void 0:a.core)||void 0===c?void 0:c.getConfig();null==a||a.trackCustomEvent({name:"conviva_window_loaded",data:"{}",context:hd(null==e?void 0:e.performanceContextConfig).contexts()})}else null===window||void 0===window||window.addEventListener("load",function(){var h;try{var f=null===(h=null==a?void 0:a.core)||
void 0===h?void 0:h.getConfig();null==a||a.trackCustomEvent({name:"conviva_window_loaded",data:"{}",context:hd(null==f?void 0:f.performanceContextConfig).contexts()})}catch(k){console.warn("ConvivaAppTracker : issue while registering window loaded event",k)}},{signal:lb});null===document||void 0===document||document.addEventListener("visibilitychange",function(){var h,f;try{if((null==a?void 0:a.getSamplingMode())!==F.SAMPLING_MODES.NONE)if("hidden"===document.visibilityState)setTimeout(function(){var n,
m;try{var v=null===(n=null==a?void 0:a.core)||void 0===n?void 0:n.getConfig();d++;(null==v?0:v.lifecycleAutotracking)&&(null===(m=null==a?void 0:a.core)||void 0===m||m.track(Rb({event:{sc:"sp/abg/1-0-0",dt:hc({backgroundIndex:d})}})));"hidden"!==document.visibilityState||(null==a?0:a.getPageViewSent())||null==a||a.trackCustomEvent({name:"conviva_app_backgrnd_before_page_view",data:"{}"})}catch(p){console.warn("ConvivaAppTracker : issue while tracking visibility change",p)}},0);else{var k=null===(h=
null==a?void 0:a.core)||void 0===h?void 0:h.getConfig();b++;(null==k?0:k.lifecycleAutotracking)&&(null===(f=null==a?void 0:a.core)||void 0===f||f.track(Rb({event:{sc:"sp/afg/1-0-0",dt:hc({foregroundIndex:b})}})))}}catch(n){console.warn("convivaAppTracker visibilitychange failed "+n)}},{signal:lb});"undefined"!=typeof document&&document&&document.addEventListener&&document.addEventListener("convivaVideoEvent",function(h){h&&a&&(null==a?void 0:a.getSamplingMode())!==F.SAMPLING_MODES.NONE&&(null==a||
a.trackVideoEvent(h))},{signal:lb})}catch(h){console.warn("convivaAppTracker error in page load metrics"+h)}}function Rg(a,c,b,d,e){void 0===e&&(e={});var h=[];a=function(k,n,m,v,p){function l(){(mc=$e(window.location.hostname,window.location.href,Ud()))[1]!==Hb&&(Jc=Ud(Hb));lf=Xe(mc[0]);Hb=mc[1]}function A(g){try{var r=(new Date).getTime(),u=g.currentTarget;if(null==u?0:u.href){g="_cnv="+(ld+"."+r);var z=u.href.split("#"),D=z[0].split("?"),G=D.shift(),H=D.join("?");if(H){D=!0;var I=H.split("&");
for(r=0;r<I.length;r++)if("_cnv="===I[r].substr(0,5)){D=!1;I[r]=g;H=I.join("&");break}D&&(H=g+"&"+H)}else H=g;var B=(z[0]=G+"?"+H,z.join("#"));u.href=B}}catch(M){console.warn("Conviva App Tracker:: Error in linkDecorationHandler of decorateLinks ".concat(M))}}function C(g){if("undefined"!=typeof document&&document.links&&0<document.links.length)for(var r=0;r<document.links.length;r++){var u=document.links[r];!u.spDecorationEnabled&&g(u)&&(fb(u,"click",A,!0),fb(u,"mousedown",A,!0),u.spDecorationEnabled=
!0)}}function x(g){var r;return mf&&(r=/#.*/,g=g.replace(r,"")),nf&&(r=/[{}]/g,g=g.replace(r,"")),g}function y(g){return(g=/^([a-z]+):/.exec(g))?g[1]:null}function w(g){g=nc+g+"."+Vb;if("localStorage"==Ga)try{var r=window.localStorage,u=r.getItem(g+".expires");var z=null===u||+u>Date.now()?r.getItem(g):(r.removeItem(g),void r.removeItem(g+".expires"))}catch(D){z=void 0}else z="cookie"==Ga||"cookieAndLocalStorage"==Ga?kb(g):void 0;return z}function t(){l();Vb=Sg((Kc||lf)+(Zd||"/")).slice(0,4)}function q(){$d=
(new Date).getTime()}function N(){var g=K(),r=g[0];r<md?md=r:r>nd&&(nd=r);g=g[1];g<od?od=g:g>pd&&(pd=g);!0;q()}function K(){var g="undefined"!=typeof document?null===document||void 0===document?void 0:document.documentElement:void 0;return g?[g.scrollLeft||window.pageXOffset,g.scrollTop||window.pageYOffset]:[0,0]}function S(){var g=K(),r=g[0];nd=md=r;pd=od=g=g[1]}function E(){O(nc+"ses."+Vb,"*",of)}function L(g){var r=nc+"id."+Vb;g=(g.shift(),g.join("."));O(r,g,pf)}function O(g,r,u){Lc&&!qd||("localStorage"==
Ga?fd(g,r,u):"cookie"!=Ga&&"cookieAndLocalStorage"!=Ga||kb(g,r,u,Zd,Kc,rd,sd))}function T(g){var r=nc+"id."+Vb,u=nc+"ses."+Vb;Ye(r);Ye(u);kb(r,"",-1,"/",Kc,rd,sd);kb(u,"",-1,"/",Kc,rd,sd);(null==g?0:g.preserveSession)||(Wb=Eb.v4(),mb=1);(null==g?0:g.preserveUser)||(ld=Eb.v4(),Xb=null)}function Z(g){g&&g.stateStorageStrategy&&(p.stateStorageStrategy=g.stateStorageStrategy,Ga=qf(p));Lc=!!p.anonymousTracking;qd=rf(p);ae=sf(p);xb.setUseLocalStorage("localStorage"==Ga||"cookieAndLocalStorage"==Ga);xb.setAnonymousTracking(ae)}
function ra(){if(function(){try{var u=window.localStorage.getItem("Conviva.sdkConfig"),z=JSON.parse(u||"{}");"{}"===z||void 0===z?(Mc=xa(),td=Ra()):(Mc=z.clId||xa(),2147483648<=ud?ud=-1:ud++,td=Ra());a:{var D=da(da({},z),{clId:Mc,iid:td});try{var G=window.localStorage;u=null;try{u=JSON.stringify(D)}catch(H){break a}G.setItem("Conviva.sdkConfig",u)}catch(H){}}}catch(H){return void aa.warn("getEventIndexByClid",H)}}(),!Lc||qd){var g="none"!=Ga&&!!w("ses"),r=V();ld=function(u,z){var D;return u[1]?D=
u[1]:z?(D="",u[1]=D):(D=Eb.v4(),u[1]=D),D}(r,Lc);Wb=g?r[6]:Gc(r);mb=r[3];"none"!=Ga&&(E(),Wd(r),L(r))}}function V(){return"none"==Ga?["1","",0,0,0,void 0,"","","",void 0]:function(g,r,u,z){var D,G=Math.round((new Date).getTime()/1E3);g?(D=g.split(".")).unshift("0"):D=["1",r,G,z,G,"",u];D[6]&&"undefined"!==D[6]||(D[6]=Eb.v4());D[7]&&"undefined"!==D[7]||(D[7]="");D[8]&&"undefined"!==D[8]||(D[8]="");D[9]&&"undefined"!==D[9]||(D[9]="");D[10]&&"undefined"!==D[10]||(D[10]=-1);var H=function(I,B){I=parseInt(I);
return isNaN(I)?B:I};g=function(I){return I?H(I,void 0):void 0};return[D[0],D[1],H(D[2],G),H(D[3],z),H(D[4],G),g(D[5]),D[6],D[7],D[8],g(D[9])]}(w("id")||void 0,ld,Wb,mb)}function ma(g,r){var u,z,D,G,H=!0,I=Ib.getConfig();return void 0!==I.mend?H=I.mend:void 0!==(null===(z=null===(u=null==p?void 0:p.configs)||void 0===u?void 0:u.network)||void 0===z?void 0:z.mergeEndpoint)&&(H=null===(G=null===(D=null==p?void 0:p.configs)||void 0===D?void 0:D.network)||void 0===G?void 0:G.mergeEndpoint),0===g.indexOf("http")?
(r&&H&&(g=g.replace(/^(https?:\/\/)(.*)$/,"$1"+r+".$2")),g):r&&H?("https:"===document.location.protocol?"https":"http")+"://"+r+"."+g:("https:"===document.location.protocol?"https":"http")+"://"+g}function X(){tf&&null!=v.pageViewId||(v.pageViewId=Eb.v4())}function Ma(){return null==v.pageViewId&&(v.pageViewId=Eb.v4()),v.pageViewId}function xa(){try{return Y({"First Launch":"Yes"}),Math.floor(2147483647*Math.random()).toString()+"."+Math.floor(2147483647*Math.random()).toString()+"."+Math.floor(2147483647*
Math.random()).toString()+"."+Math.floor(2147483647*Math.random()).toString()}catch(g){return void console.warn(g)}}function Ra(){try{return Math.floor(2147483647*Math.random())}catch(g){return console.warn(g),-1}}function na(g){try{return"object"===ka(JSON.parse(g))}catch(r){return!1}}function Y(g){try{var r=Object.keys(g);na(JSON.stringify(g))?r.forEach(function(u){if(""!==u.trim()){var z=g[u];z&&""!==z&&(z="object"===ka(z)?JSON.stringify(z):""+z,Object.defineProperty(be,u,{value:z,writable:!0,
enumerable:!0,configurable:!0}))}}):console.warn("Conviva AppTracker:: Invalid JSON Format")}catch(u){console.warn("Conviva AppTracker:: Invalid JSON Format: Error Message=",u)}}function fa(g){var r=g.title,u=g.context,z=g.timestamp;g=g.contextCallback;l();ce&&X();ce=!0;Jb=document.title;r=Td((Nc=r)||Jb);oc()!==F.SAMPLING_MODES.NONE&&Ib.track(function(H){var I=H.pageUrl,B=H.pageTitle;H=H.referrer;var M=Kd();return M.add("e","pv"),M.add("url",I),M.add("page",B),M.add("refr",H),M}({pageUrl:x(vd||Hb),
pageTitle:r,referrer:x(wd||Jc)}),(u||[]).concat(g?g():[]),z);z=new Date;r=!1;if(Na.enabled&&!Na.installed){r=Na.installed=!0;var D={update:function(){if("undefined"!=typeof window&&"function"==typeof window.addEventListener){var H=!1,I=Object.defineProperty({},"passive",{get:function(){H=!0},set:function(){}}),B=function(){};window.addEventListener("testPassiveEventSupport",B,I);window.removeEventListener("testPassiveEventSupport",B,I);D.hasSupport=H}}};D.update();var G="onwheel"in document.createElement("div")?
"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";Object.prototype.hasOwnProperty.call(D,"hasSupport")?fb(document,G,q,{passive:!0}):fb(document,G,q);S();G=function(H,I){return void 0===I&&(I=q),function(B){return fb(document,B,I)}};"click mouseup mousedown mousemove keypress keydown keyup".split(" ").forEach(G(document));["resize","focus","blur"].forEach(G(window));G(window,N)("scroll")}if(Na.enabled&&(Tg||r))for(z in $d=z.getTime(),z=void 0,Na.configurations)(r=Na.configurations[z])&&
(window.clearInterval(r.activityInterval),kd(r,u,g))}function ab(){var g,r,u,z,D,G,H,I,B,M,ha,Ha,Ca,Sa,W,ca,ja,La,Ta,yb,zb,gb,Yb,Zb,$b,pc,ac,qc,nb,Ab,Bb,pa,Oc;try{var Q=null===(g=null==f?void 0:f.core)||void 0===g?void 0:g.getConfig();g=void 0;de={};var sa=rc.MERGE;switch(void 0!==(null===(u=null===(r=null==p?void 0:p.configs)||void 0===r?void 0:r.metaTagsTracking)||void 0===u?void 0:u.preference)?sa=null===(D=null===(z=null==p?void 0:p.configs)||void 0===z?void 0:z.metaTagsTracking)||void 0===D?
void 0:D.preference:!0===(null===(H=null===(G=null==p?void 0:p.configs)||void 0===G?void 0:G.metaTagsTracking)||void 0===H?void 0:H.force)?sa=rc.APP:void 0!==(null===(I=null==Q?void 0:Q.metaTagsTrackingConfiguration)||void 0===I?void 0:I.pref)&&(sa=null===(B=null==Q?void 0:Q.metaTagsTrackingConfiguration)||void 0===B?void 0:B.pref),sa){case rc.APP:if(!1===(null===(ha=null===(M=null==p?void 0:p.configs)||void 0===M?void 0:M.metaTagsTracking)||void 0===ha?void 0:ha.enabled))return;0<(null===(Sa=null===
(Ca=null===(Ha=null==p?void 0:p.configs)||void 0===Ha?void 0:Ha.metaTagsTracking)||void 0===Ca?void 0:Ca.tags)||void 0===Sa?void 0:Sa.length)&&(g=Ba([],null===(ca=null===(W=null==p?void 0:p.configs)||void 0===W?void 0:W.metaTagsTracking)||void 0===ca?void 0:ca.tags,!0));break;case rc.REMOTE:if(!1===(null===(ja=null==Q?void 0:Q.metaTagsTrackingConfiguration)||void 0===ja?void 0:ja.enabled))return;void 0!==(null==Q?void 0:Q.metaTagsTrackingConfiguration)&&0<(null===(Ta=null===(La=null==Q?void 0:Q.metaTagsTrackingConfiguration)||
void 0===La?void 0:La.tags)||void 0===Ta?void 0:Ta.length)&&(g=Ba([],null===(yb=null==Q?void 0:Q.metaTagsTrackingConfiguration)||void 0===yb?void 0:yb.tags,!0));break;default:if(void 0===(null==Q?void 0:Q.metaTagsTrackingConfiguration)&&!1===(null===(gb=null===(zb=null==p?void 0:p.configs)||void 0===zb?void 0:zb.metaTagsTracking)||void 0===gb?void 0:gb.enabled)||void 0===(null===(Yb=null==p?void 0:p.configs)||void 0===Yb?void 0:Yb.metaTagsTracking)&&!1===(null===(Zb=null==Q?void 0:Q.metaTagsTrackingConfiguration)||
void 0===Zb?void 0:Zb.enabled))return;var Kb=null===(pc=null===($b=null==p?void 0:p.configs)||void 0===$b?void 0:$b.metaTagsTracking)||void 0===pc?void 0:pc.tags,bb=null===(ac=null==Q?void 0:Q.metaTagsTrackingConfiguration)||void 0===ac?void 0:ac.tags;!1===(null===(nb=null===(qc=null==p?void 0:p.configs)||void 0===qc?void 0:qc.metaTagsTracking)||void 0===nb?void 0:nb.enabled)&&(Kb=[]);!1===(null===(Ab=null==Q?void 0:Q.metaTagsTrackingConfiguration)||void 0===Ab?void 0:Ab.enabled)&&(bb=[]);g=Ba([],
(Oc=bb||[],Ba(Ba([],Kb||[],!0),Oc,!0).reduce(function(Ua,Oa){var sc=Ua.find(function(xd){return xd.key===Oa.key});return sc?Oa.condition&&(sc.condition=Ba(Ba([],sc.condition||[],!0),Oa.condition,!0)):Ua.push(da({},Oa)),Ua},[])),!0)}if(void 0!==g&&0<(null==g?void 0:g.length)){r={};var ob=null===document||void 0===document?void 0:document.head,ya=null==ob?void 0:ob.getElementsByTagName("meta");if(void 0!==ya&&0<(null==ya?void 0:ya.length))for(ob=0;ob<ya.length;ob++){var Pc=ya[ob];for(u=0;u<g.length;u++){var za=
Pc.getAttribute(g[u].key),cb=Pc.getAttribute(g[u].value);z=void 0;(null===(Bb=g[u])||void 0===Bb?0:Bb.condition)&&(z=null===(pa=g[u])||void 0===pa?void 0:pa.condition);za&&(z&&z.includes(za)?r[za]=cb:z&&0!==z.length||(r[za]=cb))}}f.setMetaCustomTags(r)}}catch(Ua){console.warn("Conviva App Tracker:: setPageMetaTagsAsCustomTags",Ua)}}function kd(g,r,u){var z=function(G,H){var I;l();var B=null===(I=null==f?void 0:f.core)||void 0===I?void 0:I.getConfig();B.enablePeriodicHeartbeat?(null!=B.periodicHeartbeatInterval&&
(I=1E3*B.periodicHeartbeatInterval,I!=g.configHeartBeatTimer&&(g.configHeartBeatTimer=I,window.clearInterval(g.activityInterval),g.activityInterval=window.setInterval(D,I))),G({context:H,pageViewId:Ma(),minXOffset:md,minYOffset:od,maxXOffset:nd,maxYOffset:pd})):window.clearInterval(g.activityInterval);S()};window.setTimeout(function(){z(g.callback,(r||[]).concat(u?u():[]))},2E3);var D=function(){var G=new Date;(!1===(null===document||void 0===document?void 0:document.hidden)||"visible"==(null===document||
void 0===document?void 0:document.visibilityState)||(null===document||void 0===document?0:document.pictureInPictureElement)||$d+g.configHeartBeatTimer>G.getTime()||!0===uf)&&z(g.callback,(r||[]).concat(u?u():[]))};g.activi