function AkaHTML5MediaAnalytics(e){var t="3.15.2",a=document.currentScript,n=null,r=null,s=!0,o=null,l=null,d=!1,c=null,u=!1,m="http://media-analytics.akamaized.net",h=null,f=(new Date).getTime(),p=[];p.push({api:"originUrl",value:location.protocol+"//"+location.hostname});var g=!1,v=this;function y(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function S(){return y()+y()+"-"+y()+"-"+y()+"-"+y()+"-"+y()+y()+y()}e&&(e.loaderName&&(o=e.loaderName),e.loaderVersion&&(l=e.loaderVersion)),a?n=a.src:st("Should be Internet Explorer");var T,b,k,A,L,I=I||function(e,t){var a={},i=a.lib={},n=i.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var a=new e;return t&&a.mixIn(t),a.$super=this,a},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.$super.extend(this)}}}(),r=i.WordArray=n.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||o).stringify(this)},concat:function(e){var t=this.words,a=e.words,i=this.sigBytes;e=e.sigBytes;if(this.clamp(),i%4)for(var n=0;n<e;n++)t[i+n>>>2]|=(a[n>>>2]>>>24-n%4*8&255)<<24-(i+n)%4*8;else if(65535<a.length)for(n=0;n<e;n+=4)t[i+n>>>2]=a[n>>>2];else t.push.apply(t,a);return this.sigBytes+=e,this},clamp:function(){var t=this.words,a=this.sigBytes;t[a>>>2]&=4294967295<<32-a%4*8,t.length=e.ceil(a/4)},clone:function(){var e=n.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var a=[],i=0;i<t;i+=4)a.push(4294967296*e.random()|0);return r.create(a,t)}}),s=a.enc={},o=s.Hex={stringify:function(e){for(var t=e.words,a=(e=e.sigBytes,[]),i=0;i<e;i++){var n=t[i>>>2]>>>24-i%4*8&255;a.push((n>>>4).toString(16)),a.push((15&n).toString(16))}return a.join("")},parse:function(e){for(var t=e.length,a=[],i=0;i<t;i+=2)a[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return r.create(a,t/2)}},l=s.Latin1={stringify:function(e){for(var t=e.words,a=(e=e.sigBytes,[]),i=0;i<e;i++)a.push(String.fromCharCode(t[i>>>2]>>>24-i%4*8&255));return a.join("")},parse:function(e){for(var t=e.length,a=[],i=0;i<t;i++)a[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return r.create(a,t)}},d=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},c=i.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=r.create(),this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var a=this._data,i=a.words,n=a.sigBytes,s=this.blockSize,o=n/(4*s);t=(o=t?e.ceil(o):e.max((0|o)-this._minBufferSize,0))*s,n=e.min(4*t,n);if(t){for(var l=0;l<t;l+=s)this._doProcessBlock(i,l);l=i.splice(0,t),a.sigBytes-=n}return r.create(l,n)},clone:function(){var e=n.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});i.Hasher=c.extend({init:function(){this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize(),this._hash},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:16,_createHelper:function(e){return function(t,a){return e.create(a).finalize(t)}},_createHmacHelper:function(e){return function(t,a){return u.HMAC.create(e,a).finalize(t)}}});var u=a.algo={};return a}(Math);function E(e,t){if(null!=e&&""!=e){try{var a=/^(\w+?:)?\/\/([^\/:]+):?([^\/]+)?(\/[^#?]*)#?([^?]+)?\??(.+)?/.exec(e);void 0===a[1]?t.protocol=location.protocol:t.protocol=a[1],t.hostName=a[2],t.port=a[3]?a[3]:"80",t.path=a[4];var i=t.path.split("/"),n=i.length;t.streamName=i[n-1];var r=t.streamName.toLowerCase();-1==r.indexOf(".m3u")&&-1==r.indexOf("manifest")&&-1==r.indexOf(".f4m")&&-1==r.indexOf(".mpd")||n>=3&&(t.streamName=i[n-2]+"/"+i[n-1]),t.hash=a[5]?a[5]:"",t.search=a[6]?a[6]:"",t.host=t.hostName+":"+t.port}catch(e){st("Exception,  parseStreamUrl :"+e)}}}function C(e,t){return null!=e?e:(new Date).getTime()}function w(e){return C(e)-f}b=(k=(T=I).lib).WordArray,k=k.Hasher,A=[],L=T.algo.SHA1=k.extend({_doReset:function(){this._hash=b.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var a=this._hash.words,i=a[0],n=a[1],r=a[2],s=a[3],o=a[4],l=0;80>l;l++){if(16>l)A[l]=0|e[t+l];else{var d=A[l-3]^A[l-8]^A[l-14]^A[l-16];A[l]=d<<1|d>>>31}d=(i<<5|i>>>27)+o+A[l],d=20>l?d+(1518500249+(n&r|~n&s)):40>l?d+(1859775393+(n^r^s)):60>l?d+((n&r|n&s|r&s)-1894007588):d+((n^r^s)-899497514),o=s,s=r,r=n<<30|n>>>2,n=i,i=d}a[0]=a[0]+i|0,a[1]=a[1]+n|0,a[2]=a[2]+r|0,a[3]=a[3]+s|0,a[4]=a[4]+o|0},_doFinalize:function(){var e=this._data,t=e.words,a=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32,t[15+(i+64>>>9<<4)]=a,e.sigBytes=4*t.length,this._process()}}),T.SHA1=k._createHelper(L),T.HmacSHA1=k._createHmacHelper(L),function(){var e=I,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,a){e=this._hasher=e.create(),"string"==typeof a&&(a=t.parse(a));var i=e.blockSize,n=4*i;a.sigBytes>n&&(a=e.finalize(a));for(var r=this._oKey=a.clone(),s=this._iKey=a.clone(),o=r.words,l=s.words,d=0;d<i;d++)o[d]^=1549556828,l[d]^=909522486;r.sigBytes=s.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher;e=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(e))}})}(),function(){var e,t=I,a=(e=t.lib).Base,i=e.WordArray,n=(e=t.algo).HMAC,r=e.PBKDF2=a.extend({cfg:a.extend({keySize:4,hasher:e.SHA1,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){var a=this.cfg,r=n.create(a.hasher,e),s=i.create(),o=i.create([1]),l=s.words,d=o.words,c=a.keySize;for(a=a.iterations;l.length<c;){var u=r.update(t).finalize(o);r.reset();for(var m=u.words,h=m.length,f=u,p=1;p<a;p++){f=r.finalize(f),r.reset();for(var g=f.words,v=0;v<h;v++)m[v]^=g[v]}s.concat(u),d[0]++}return s.sigBytes=4*c,s}});t.PBKDF2=function(e,t,a){return r.create(a).compute(e,t)}}();var P=!1;if(window)try{P=!!window.XDomainRequest}catch(e){P=!1}var R={},x={},M=null,B={eventCode:"",beaconId:"",sequenceId:"",logType:"",endOfStream:"",logVersion:"",formatVersion:"",visitId:"",errorCode:"",partNumber:"",totalParts:"",hostName:"",streamName:"",port:"",protocol:"",userAgent:"",playerType:"",os:"",format:"",connectTime:"",bufferingTime:"",startupTime:"",streamLength:"",bytesTotal:"",browser:"",browserSize:"",videoSize:"",streamUrl:"",deliveryType:"",pluginVersion:"",beaconVersion:"",serverIp:"",playerFormat:"",outlierStartupTime:"",isFirstTitle:"",rebufferSessionH:"",sequenceIdH:"",isSessionWithRebufferH:"",playerState:"",currentStreamTime:"",currentClockTime:"",playClockTime:"",playStreamTime:"",rebufferCount:"",rebufferTime:"",pauseCount:"",pauseDuration:"",pauseIntervalsAsString:"",seekCount:"",seekTime:"",seekIntervalsAsString:"",pauseSeekSession:"",resumeBufferCount:"",resumeBufferTime:"",isView:"",isSessionWithRebuffer:"",logInterval:"",rebufferSession:"",socialSharing:"",endReasonCode:"",totalPlayClockTime:"",totalPlayStreamTime:"",totalRebufferCount:"",totalRebufferTime:"",totalAdPlayClockTime:"",totalAdStartCount:"",totalAdAbandonCount:"",lastHTime:"",isVisitStart:"",isVisitEnd:"",visitAttempts:"",visitPlays:"",visitViews:"",visitErrors:"",visitInterval:"",visitPlayClockTime:"",visitPlayStreamTime:"",visitRebufferCount:"",visitRebufferTime:"",visitStartupErrors:"",visitAdPlayClockTime:"",visitAdStartCount:"",visitAdAbandonCount:"",visitUniqueTitles:"",adAbandonCount:"",adPauseTime:"",adStartupTime:"",adPlayClockTime:"",adCount:"",adSession:"",sessionId:"",attemptId:"",playerReferrer:"",ais_idpId:"",ais_idpName:"",ais_idpDisplayName:"",ais_idpUrl:"",ais_queryToken:"",ais_aisuid:"",qualityOfExperience:"",transitionStreamTimeSession:"",transitionUpSwitchCount:"",transitionDownSwitchCount:"",averagedBitRate:"",fullOs:"",longitude:"",latitude:"",connectivity:""},D={title:!1,category:!1,subCategory:!1,show:!1,contentLength:!1,contentType:!1,device:!1,deliveryType:!1,playerId:!1,eventName:!1},N={},O={};N.isBrightcoveVideo=!1,N.objectBased=!1,N.videoPassed=!1;var U=!1,H={},V={},_=!1,F=[],j={timer:null,queue:[],browserClose:!1,enabled:!0,time:250},q={},W=[],z={},X={},K={seekThreshold:2e3,visitTimeout:36e5},G={},Q={},J={},Y={},$=100,Z={},ee=!1,te=!1,ae={fastTCPFailed:!1,fastTCPEnabled:!1},ie=[],ne={dataSent:{}},re=1,se=-1,oe={},le=[],de={pageURLCsmaDebug:0,configURLCsmaDebug:0,configDebug:0,windowOpened:!1,logStoredMsg:!0,printException:!1};function ce(){this.aisRetries=0,this.aisRequestLimit=3,this.aisRequestInterval=3e4,this.requestFailed=!1}var ue=new ce,me={setDataArr:["adId","adDuration","adTitle","adCategory","adPartnerId","adServer","adDaypart","adIndustryCategory","adEvent"],clearAdAnalytics:function(){this.isAdLoaded=!1,this.isAdStarted=!1,this.id="",this.type="0",this.startPos="0",this.playBucket="-1",this.endStatus="2",this.adLoadTime=null,this.adStartTime=null,this.adStartupTime="0";for(var e=0;e<this.setDataArr.length;e++)this[this.setDataArr[e]]=""}},he={bitRateArr:[],currentBitRate:"-",currentStartPos:0,bitRateCount:{},bitRatePlayTime:{},bitRateBucketMap:{},clearBitRate:function(){this.bitRateArr=[],this.currentBitRate="-",this.bitRateCount={},this.bitRatePlayTime={}},updateBitRateArr:function(e){if(this.bitRateArr.length>0){var t=this.bitRateArr.length,a=he.bitRateArr[t-1];this.currentBitRate==a.bitRate?a.playTime+=e:this.pushInBitRateArr(e,this.currentBitRate,this.currentStartPos)}else this.pushInBitRateArr(e,this.currentBitRate,this.currentStartPos)},pushInBitRateArr:function(e,t,a){this.bitRateArr.push({bitRate:t,playTime:e,startPos:a})},populateBitRateBucketMap:function(e,t){var a,i=!1,n=Y.bitRateBucketTimes;for(var r in"-"!=e&&""!==e&&(e=parseInt(e/1e3)),n)if(i=!1,a=n[r],"-"==e||""===e||e<0){if(!a.max&&!a.min){i=!0;break}}else if(a.max&&a.min){if(e>=a.min&&e<a.max){i=!0;break}}else if(a.max){if(e<a.max){i=!0;break}}else if(a.min&&e>=a.min){i=!0;break}i&&(this.bitRateBucketMap[r]+=t)},findMaxPersistentBitRate:function(){try{if(this.bitRatePlayTime){var e=0,t=-1;for(var a in this.bitRatePlayTime)this.bitRatePlayTime[a]>t&&(t=this.bitRatePlayTime[a],e=a);if(0!==e)return e}}catch(e){st("Exception, find max persistent bit rate")}},getTransitionSession:function(e){try{var t,a,i,n=null,r="",s=0,o=0,l=0,d=!0;for(a in this.bitRateArr.length>0&&"-"==(t=this.bitRateArr[0]).bitRate&&(d=!1,this.bitRateArr[1]&&"-"!=this.bitRateArr[1].bitRate&&(d=!0,this.bitRateArr[1].startPos=this.bitRateArr[0].startPos,this.bitRateArr[1].playTime+=this.bitRateArr[0].playTime,this.bitRateArr.shift())),this.bitRateBucketMap)this.bitRateBucketMap[a]=0;for(s=0;s<this.bitRateArr.length;s++){(t=this.bitRateArr[s]).bitRate in this.bitRateCount?0!=s&&this.bitRateCount[t.bitRate]++:this.bitRateCount[t.bitRate]=1,""!=t.bitRate&&"-"!=t.bitRate&&(t.bitRate in this.bitRatePlayTime?this.bitRatePlayTime[t.bitRate]+=t.playTime:this.bitRatePlayTime[t.bitRate]=t.playTime),i=this.bitRateCount[t.bitRate],n?n+=","+t.bitRate+":"+t.startPos+":"+t.playTime+"::"+i:n=t.bitRate+":"+t.startPos+":"+t.playTime+"::"+i,this.populateBitRateBucketMap(t.bitRate,t.playTime);try{d&&(o+=t.bitRate*t.playTime,l+=t.playTime)}catch(e){}}for(a in e.maxPersistentBitRate=this.findMaxPersistentBitRate(),e.transitionStreamTimeSession=n,this.bitRateBucketMap)r?r+=","+a+":"+this.bitRateBucketMap[a]:r=a+":"+this.bitRateBucketMap[a];e.bitRateBucketTimes=r;try{e.averagedBitRate=d&&l&&0!=l?o+":"+l:null}catch(e){}}catch(e){st("Exception, get transition Session :"+e)}}};amaURLUtility=function(){},amaURLUtility.isURL=function(e){return!!new RegExp("((http|https)(://))?([a-zA-Z0-9]+[.]{1}){2}[a-zA-z0-9]+(/{1}[a-zA-Z0-9]+)*/?","i").test(e)},amaURLUtility.parseURLComponents=function(e){var t={};try{var a=/^(\w+?:)?\/\/([^\/:]+):?([^\/]+)?(\/[^#?]*)#?([^?]+)?\??(.+)?/.exec(e);void 0===a[1]?t.protocol=location.protocol:t.protocol=a[1],t.hostName=a[2],t.port=a[3]?a[3]:"80",t.path=a[4];var i=this.path.split("/"),n=i.length;t.name=i[n-1];var r=t.name.toLowerCase();-1==r.indexOf(".m3u")&&-1==r.indexOf("manifest")&&-1==r.indexOf(".f4m")&&-1==r.indexOf(".mpd")||n>=3&&(t.name=i[n-2]+"/"+i[n-1]),t.hash=a[5]?a[5]:"",t.search=a[6]?a[6]:"",t.host=t.hostName+":"+t.port}catch(e){st("Exception,  parseStreamUrl :"+e)}return t},streamError={InvalidURL:"URL is not valid",ParsingFailed:"Failed to parse stream URL",Invalid_Manifest:"Invalid manifest received",Invalid_Stream:"Stream is not valid",NoError:"success"},streamInfoBase=function(e,t){this.url=e,this.name=null,this.length=0,this.format=null,this.deliveryType="O",this.isValid=!1,this.streamType=null,this.callback=t},streamInfoBase.prototype.getStreamURL=function(){return this.url},streamInfoBase.prototype.getStreamName=function(){return this.name},streamInfoBase.prototype.getStreamLength=function(){return this.length},streamInfoBase.prototype.getStreamFormat=function(){return this.format},streamInfoBase.prototype.getDeliveryType=function(){return this.deliveryType},streamInfoBase.prototype.getStreamType=function(){return this.streamType},streamInfoBase.prototype.getCallback=function(){return this.callback},streamInfoBase.prototype.parseURL=function(){try{var e=/^(\w+?:)?\/\/([^\/:]+):?([^\/]+)?(\/[^#?]*)#?([^?]+)?\??(.+)?/.exec(this.url);void 0===e[1]?this.protocol=location.protocol:this.protocol=e[1],this.hostName=e[2],this.port=e[3]?e[3]:"80",this.path=e[4];var t=this.path.split("/"),a=t.length;this.name=t[a-1];var i=this.name.toLowerCase();-1==i.indexOf(".m3u")&&-1==i.indexOf("manifest")&&-1==i.indexOf(".f4m")&&-1==i.indexOf(".mpd")||a>=3&&(this.name=t[a-2]+"/"+t[a-1]),this.hash=e[5]?e[5]:"",this.search=e[6]?e[6]:"",this.host=this.hostName+":"+this.port}catch(e){st("Exception,  parseStreamUrl :"+e)}};var fe=function(e,t,a,i){try{e.prototype=Object.create(t.prototype,{url:{value:a,enumerable:!1},callback:{value:i,enumerable:!1}})}catch(e){st("Exception thrown from InheritObject"+e)}};hlsStreamInfo=function(e,t){return this.recursiveDownload=!1,this.isParsed=!1,this.parse=function(e){try{if(!e)return streamError.InvalidURL;if(-1===e.search("#EXTM3U"))return streamError.ParsingFailed;this.streamType="hls",this.format="L",this.parseURL();var t,a,i=e.split("\n"),n="",r=/PROGRAM-ID=(\d+)/;if(i){for(a=0;a<i.length;a++)if(t=r.exec(i[a])){if(t[1]==n)break;n=t[1]}a!=i.length&&(this.format="L")}var s,o,l=this.getStreamURL();if(l){var d=/^(\w+?:)?\/\/([^\/:]+):?([^\/]+)?(\/[^#?]*)#?([^?]+)?\??(.+)?/.exec(l);s=void 0===d[1]?location.protocol:d[1],o=d[2],d[3]?d[3]:"80",d[4]}if(r=/^#EXT((INF)|(-X-STREAM-INF))[^\n]*\n([^\n]*)\n/m,st("Checking"),t=r.exec(e))if(st("Checking done "+t[4]),new RegExp(".m3u8").exec(t[4])&&s&&o)try{this.recursiveDownload=!0;var c,u=new XMLHttpRequest;st("Requesting URL = "+(c=amaURLUtility.isURL(t[4])?t[4]:s+"//"+o+t[4])),u.open("GET",c,!0),u.onreadystatechange=(m=this,function(){st("current content type from stream url is = "+this.getResponseHeader("content-type")),4===this.readyState&&(200===this.status&&this.responseText&&(/^#EXT-X-ENDLIST/m.exec(this.responseText)?m.deliveryType="O":(m.deliveryType="L",m.length="-1")),m.getCallback()&&m.getCallback()(m))}),u.overrideMimeType&&u.overrideMimeType("text/plain")}catch(e){st("parse, Exception,  parsing play list, "+e)}else/^#EXT-X-ENDLIST/m.exec(e)&&(this.deliveryType="O")}catch(e){st("Exception,  parse : "+e)}var m;return this.isParsed=!0,streamError.NoError},this.parse(e)===streamError.NoError?(!1===this.recursiveDownload&&this.getCallback()(this),this.streamType="hls",this.deliveryType="O",this):t?(this.streamType="hls",this.format="L",this.deliveryType="O",this.length=0,this.parseURL(),this.getCallback()(this),this):void 0},dashStreamInfo=function(e,t){this.isParsed=!1;try{this.parse=function(e){if(!e)return streamError.InvalidURL;this.parseURL(),this.format="Dash",this.streamType="dash";var t=(new DOMParser).parseFromString(e,"text/xml");if(!t)return streamError.ParsingFailed;var a=t.getElementsByTagName("MPD");if(!a||!a[0])return streamError.ParsingFailed;if("dynamic"===a[0].getAttribute("type"))this.deliveryType="L",this.length=0;else{this.deliveryType="O";var i=a[0].getAttribute("mediaPresentationDuration").replace("PT",""),n=i.search("H"),r=0;if(this.length=0,-1!==n){var s=Number(i.substring(0,n));isNaN(s)||(this.length+=60*s*60*1e3,r=n+1)}var o=i.search("M");if(-1!==o){var l=Number(i.substring(r,o));isNaN(l)||(this.length+=60*l*1e3,r=o+1)}var d=i.search("S");if(-1!==d){var c=Number(i.substring(r,d));isNaN(c)||(this.length+=1e3*c)}st("Current stream length = "+this.length)}return this.getCallback()(this),this.isParsed=!0,streamError.NoError}}catch(e){st("Exception thrown from dashStreamInfo "+e)}return this.parse(e)===streamError.NoError?this:t?(this.format="Dash",this.streamType="dash",this.deliveryType="O",this.length=0,this.parseURL(),this.getCallback()(this),this):void 0},nonAdaptiveStream=function(e,t){try{return this.format="P",this.deliveryType="O",this.streamType="nonAdaptiveStream",this.length=0,this.parseURL(),this.getCallback()(this),this}catch(e){st("Exception thrown from nonAdaptiveStream"+e)}};var pe={FactoryWithURL:function(e,t,a){try{var i=new XMLHttpRequest;i.open("GET",t,!0),i.onreadystatechange=function(){4===this.readyState&&200===this.status&&this.responseText&&pe.FactoryWithContent(e,t,this.responseText,a,!1)},i.send(null)}catch(e){st("Exception thrown from streamFactory.FactoryWithURL"+e)}},FactoryWithContent:function(e,t,a,i,n){var r;try{"hls"===e?(fe(hlsStreamInfo,streamInfoBase,t,i),r=new hlsStreamInfo(a,n)):"dash"===e?(fe(dashStreamInfo,streamInfoBase,t,i),r=new dashStreamInfo(a,n)):(fe(nonAdaptiveStream,streamInfoBase,t,i),r=new nonAdaptiveStream(a,n))}catch(e){st("Exception thrown from streamFactory.FactoryWithContent "+e)}return r}};StreamTypeDetector=function(e,t,a,i){function n(e,t,a){st("Mime type method didn't work. Lets apply parsers one after another - Brute force");var i=pe.FactoryWithContent("hls",e,t,a,!1);i.isParsed||(st("not a HLS stream"),(i=pe.FactoryWithContent("dash",e,t,a,!1)).isParsed||(st("not Dash either... Assuming Progressive download"),i=pe.FactoryWithContent("nonAdaptive",e,t,a,!1)))}try{if(!e||""===e)return streamError.Invalid_Stream;var r=RegExp(".m3u8"),s=RegExp(".mpd");if(a){if(r.exec(e))return st("Found m3u8 as an extension"),void pe.FactoryWithURL("hls",e,i);if(s.exec(e))return st("Found mpd as an extension"),void pe.FactoryWithURL("dash",e,i);st("Couldn't find either m3u8 or Dash will try mime type");var o=new XMLHttpRequest;st("To get mime type trying HEAD request"),o.open("HEAD",o,!0),o.overrideMimeType&&o.overrideMimeType("text/xml"),o.onreadystatechange=function(){if(this.readyState===this.DONE){var t=this.getResponseHeader("content-type");"application/x-mpegURL"===t||"vnd.apple.mpegURL"===t?(st("Rceived mime type is m3u8"),pe.FactoryWithContent("hls",e,this.responseText,i)):"application/dash+xml"===t?(st("Rceived mime type is dash"),pe.FactoryWithContent("dash",e,this.responseText,i)):n(e,this.responseText,i)}},o.send(null)}else r.exec(e)?(st("Found m3u8 as an extension"),streamObj=pe.FactoryWithContent("hls",e,t,i,!0)):s.exec(e)?(st("Found mpd as an extension"),streamObj=pe.FactoryWithContent("dash",e,t,i,!0)):n(e,t,i);return streamError.NoError}catch(e){st("Exception thrown from StreamTypeDetector "+e)}},fragmentState={Invalid:"Invalid",InPorgress:"InProgress",Completed:"Completed"},fragment=function(e,t){this.id=e,this.bitrate=t,this.timeStamp=(new Date).getTime(),this.state=fragmentState.InPorgress,this.downloadTime=0,this.bytesDownloaded=0},streamFragments=function(){this.fragments={},this.fragmentId=0,this.downloadStarted=function(e){var t=new fragment(this.fragmentId,e);this.fragments[this.fragmentId.toString()]=t},this.cleanup=function(){for(var e in this.fragments)delete this.fragments[e]},this.downloadCompleted=function(e,t){if(this.fragments[this.fragmentId.toString()]&&this.fragments[this.fragmentId.toString()].state!==fragmentState.Completed){var a=this.fragments[this.fragmentId.toString()],i=(new Date).getTime();a.downloadTime=i-a.timeStamp,a.state=fragmentState.Completed,t?(a.bytesDownloaded=t,st("bytesDownloaded reported = "+t)):(a.bytesDownloaded=e*a.downloadTime,st("bytesDownloaded not reported and calculated one is = "+a.bytesDownloaded)),this.fragmentId++}}},hlsStream=function(){var e=new streamFragments;this.streamFragmentDownloadStarted=function(t){e.downloadStarted(t),0!==t&&Rt(t)},this.streamFragmentDownloadCompleted=function(t){e.downloadCompleted(t,0)},this.cleanupFragments=function(){e.cleanup()},this.getBandwidthFromFragments=function(){var t=0,a=0;for(index in e.fragments){var i=e.fragments[index];i.state===fragmentState.Completed&&i.bytesDownloaded&&(t+=i.bytesDownloaded,a+=i.downloadTime)}return 0===a?0:t/a}};!function(){if("undefined"!=typeof akamaiBCVideoObject)try{var t=document.getElementsByTagName("script"),a=0,i="";if(t.length)for(a=0;a<t.length;a++)null==t[a].src||-1==t[a].src.indexOf("79423.analytics.edgesuite.net")&&-1==t[a].src.indexOf("79423.analytics.edgekey.net")||(t[a].src,""!=(i=Be("configPath",t[a].src))&&(H.url=i))}catch(e){}else e&&e.configPath?(H.url=e.configPath,N.objectBased=!0):H.url=AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH;try{if(window){var n=null;ge()?(n=Be("AkamaiAnalytics_configPath",window.parent.location))&&(H.url=n):(n=Be("AkamaiAnalytics_configPath",window.location))&&(H.url=n)}}catch(e){}H.url&&(1==parseInt(Be("enableGenericAPI",H.url))&&(N.objectBased=!0),H.beaconSent=parseInt(Be("beaconSentNotify",H.url)),1==parseInt(Be("setVideoObject",H.url))&&(N.videoPassed=!0),1==parseInt(Be("subscribeVideo",H.url))&&(N.videoPassed=!0),1==parseInt(Be("exception",H.url))&&(de.printException=!0),de.configURLCsmaDebug=parseInt(Be("debug",H.url)))}();function ge(){var e=!1;try{if(window!==window.parent){var t={},a={},i=document.URL,n=null;document&&document.referrer&&(n=document.referrer),null!=i&&E(i,t),null!=n&&E(n,a),t.port===a.port&&t.protocol===a.protocol&&t.hostName===a.hostName&&(e=!0)}else e=!0}catch(e){}return e}try{window&&(ge()?de.pageURLCsmaDebug=parseInt(Be("AkamaiAnalytics_debug",window.parent.location)):de.pageURLCsmaDebug=parseInt(Be("AkamaiAnalytics_debug",window.location)))}catch(e){}try{"undefined"!=typeof akamaiBCVideoObject&&"undefined"!=typeof brightcovePerforceVersion&&_t("std:pluginVersion","Brightcove-"+brightcovePerforceVersion)}catch(e){st("Exception,  pluginVersion: "+e)}function ve(){de.windowOpened||1!=de.pageURLCsmaDebug&&1!=de.configURLCsmaDebug&&1!=de.configDebug||(u=!0,h=window.open("http://media-analytics.akamaized.net/library/debug/index.html","","status=0,toolbar=0,location=0,menubar=0,directories=0,height=680,width=1200"),function(){if(!n){var e=document.getElementsByTagName("script");if(e.length)for(i=0;i<e.length;i++)if(null!=e[i].src){var t=e[i].src;if(-1!=t.indexOf("akamaihtml5-min.js")||-1!=t.indexOf("csma.js")){n=t;break}}}}())}function ye(e,t,a,i){(function(e,t,a,i){e&&st("XML Request: isXDomainRequest = "+P+":::funcCallback =  :url: "+t);var n;if(null==t||"undefined"==t||""==t)return;try{if(P){n=new XDomainRequest,e&&(n.onprogress=function(){},n.ontimeout=function(){},n.onload=function(){if(st("XML Request : xmlClient.onload"),window.DOMParser){var t=(new DOMParser).parseFromString(n.responseText,"text/xml");(a={status:"200",readyState:"4"}).responseXML=t,a.responseText=n.responseText,e(a)}else{var a;(t=new ActiveXObject("Microsoft.XMLDOM")).async=!1,t.loadXML(n.responseText),(a={status:"200",readyState:"4"}).responseXML=t,e(a)}},n.onerror=function(e){st("XML Request : Error, loading xml. url = :"+t),-1!=t.indexOf("serverIp")&&(ee=!0),-1!=t.indexOf("protocol-info")&&(ae.fastTCPFailed=!0)}),n.open("GET",t,!a);try{i?setTimeout((function(){n.send()}),100):n.send(null)}catch(e){try{n.send(null)}catch(e){}}}else(n=new XMLHttpRequest).open("GET",t,!a),e&&(n.overrideMimeType&&n.overrideMimeType("text/xml"),n.onreadystatechange=function(){st("XML Request : xmlClient.onreadystatechange"),e(n)}),n.send(null)}catch(e){st("Exception,  XML Request for url :"+t+",Exception:"+e)}})(e,t,a,i)}function Se(e){var t=q.common;if(null!=t){var a={};a.name=e,a.key=e,t.push(a)}}function Te(e){if(R.cdn)return R.cdn;try{for(key in Y.cdn){var t=Y.cdn[key];if(t&&t.name&&t.value)for(var a=e[t.name],i=t.value.split(","),n=0;n<i.length;n++)if(a&&-1!=a.indexOf(i[n].trim()))return key}}catch(e){st("Exception Get CDN"+e.message)}}function be(e){var t="";if(-1!=e.indexOf("://")&&(i=e.indexOf("://"),e=e.substring(i+3)),-1!=e.indexOf("/")){if(i=e.indexOf("/"),-1!=e.indexOf("?")){var a=e.indexOf("?");i=i<a?i:a}t=e.substring(0,i)}else if(-1!=e.indexOf("?")){var i=e.indexOf("?");t=e.substring(0,i)}else t=e;return t}function ke(e,t,a,i){var n=e.currentState,r=e.seekObject;"S"==i&&-1==r.seekStartStreamTime?(r.seekStartEpochTime=n.timeUpdateClockTime,r.seekEndEpochTime=t,r.seekStartStreamTime=n.timeUpdateStreamTime,r.seekEndStreamTime=a):"S"==i&&r.seekEndStreamTime==n.timeUpdateStreamTime?(r.seekEndEpochTime=t,r.seekEndStreamTime=a):-1!=r.seekStartStreamTime&&(e.seekTime+=r.seekEndEpochTime-r.seekStartEpochTime,"-"!=e.seekIntervalsAsString?e.seekIntervalsAsString+=","+r.seekStartStreamTime+":"+r.seekEndStreamTime:e.seekIntervalsAsString=r.seekStartStreamTime+":"+r.seekEndStreamTime,"-"!=e.pauseSeekSession?e.pauseSeekSession+=",S("+r.seekStartStreamTime+":"+(r.seekStartEpochTime-e.startTimer)+"-"+r.seekEndStreamTime+":"+(r.seekEndEpochTime-e.startTimer)+")":e.pauseSeekSession="S("+r.seekStartStreamTime+":"+(r.seekStartEpochTime-e.startTimer)+"-"+r.seekEndStreamTime+":"+(r.seekEndEpochTime-e.startTimer)+")",++e.seekCount,e.seekObject={seekStartEpochTime:-1,seekEndEpochTime:-1,seekStartStreamTime:-1,seekEndStreamTime:-1})}function Ae(e,t){st("set RebufferSession : curTime = "+t);try{var a=Math.round(t-e.lastLogTime-e.curRebufferTime),i=Math.round(e.curRebufferTime);e.currRebufferEndEpoch=Math.round(t),e.currRebufferStartEpoch=Math.round(t-i),i>K.isSessionWithRebufferLimit&&(e.isSessionWithRebuffer=1),e.rebufferSession?e.rebufferSession=e.rebufferSession+";"+a+":"+i:e.rebufferSession=a+":"+i}catch(e){st("Error, set RebufferSession"+e.message)}}function Le(e,t){var a=1;if(e.rebufferSessionH=null,e.rebufferSessionArrayHLine&&(!e.rebufferSessionArrayHLine||0!==e.rebufferSessionArrayHLine.length)){for(;e.rebufferSessionArrayHLine[a]&&t-e.rebufferSessionArrayHLine[a]>2*K.heartBeatInterval;)e.rebufferSessionArrayHLine.shift(),e.rebufferSessionArrayHLine.shift(),1==e.isSessionWithRebufferH&&(e.sendIsSessionWithRebufferH=0,e.isSessionWithRebufferH=null);for(;e.rebufferSessionArrayHLine[a];){var i=t-e.rebufferSessionArrayHLine[a-1],n=e.rebufferSessionArrayHLine[a]-e.rebufferSessionArrayHLine[a-1];1==e.sendIsSessionWithRebufferH&&n>K.isSessionWithRebufferLimit&&(e.isSessionWithRebufferH=1),e.rebufferSessionH?e.rebufferSessionH=e.rebufferSessionH+";"+i+":"+n:e.rebufferSessionH=i+":"+n,a+=2}if(a-=1,e.rebufferSessionArrayHLine[a]){i=t-e.rebufferSessionArrayHLine[a];1==e.sendIsSessionWithRebufferH&&i>K.isSessionWithRebufferLimit&&(e.isSessionWithRebufferH=1),e.rebufferSessionH?e.rebufferSessionH=e.rebufferSessionH+";"+i+":"+i:e.rebufferSessionH=i+":"+i}}}function Ie(e){var t=e.readyState,a=e.status;if(4!==parseInt(a/100)&&0!==a||(st("readServerIp: serverIpFailed request falied as status is ,in 400 series"),ee=!0),4==t&&200==a){var i,n=e.responseXML;if(n)i=n.documentElement?n.documentElement:n,Z.serverip=te?i.getElementsByTagName("ip")[0].childNodes[0].nodeValue:i.getElementsByTagName("serverip")[0].childNodes[0].nodeValue,st("readServerIp : diagnostics.serverip =  "+Z.serverip)}}function Ee(e){var t="",a=e.readyState,i=e.status;4!==parseInt(i/100)&&0!==i||(st("read fast tcp: fast tcp Failed request falied as status is 400 series"),ae.fastTCPFailed=!0);try{if(4==a&&200==i){var n,r=e.responseXML;if(r)if(st("populating fast tcp"),(n=r.documentElement?r.documentElement:r)&&n.firstElementChild){var s=n.firstElementChild,o="",l="";if(s)for(s.hasAttribute("key")&&(t=(l=s.getAttribute("key"))+":"+(o=s.childNodes[0].nodeValue));s.nextElementSibling;)(s=s.nextElementSibling).hasAttribute("key")&&(l=s.getAttribute("key"),o=s.childNodes[0].nodeValue,t?t+=","+l+":"+o:t=l+":"+o)}}t&&(ae.ftcp=t)}catch(e){st("Exception,  read fast tcp"+e)}}function Ce(e,t){try{var a=e.akamai;K&&K.logInterval&&!t&&(a.fastTCPServerIpTimer=Ne(Ce,K.logInterval,[e])),ee||function(e){var t=e.akamai;if(ee)st("getting ServerIp : serverIp request failed");else if(t.hostName)try{var a=null;t.protocol&&(-1!=t.protocol.indexOf("rtmp")?(a="http://"+t.hostName+"/fcs/ident",te=!0):a=t.protocol+"//"+t.hostName+"/serverip",st("getting ServerIp : serverIpPath = "+a),ye(Ie,a,!1,!0))}catch(e){ee=!0,st("getting ServerIp: error, xmphttprequest")}}(e),!ae.fastTCPFailed&&ae.fastTCPEnabled&&function(e){var t=e.akamai;if(ae.fastTCPFailed)st("getting fast tcp: request failed");else if(t.hostName)try{var a=t.protocol+"//"+t.hostName+"/protocol-info";st("getting fast tcp : fastTCPPath = "+a),ye(Ee,a,!1,!0)}catch(e){ae.fastTCPFailed=!0,st("getting ServerIp: error, xmphttprequest")}}(e),ee&&ae.fastTCPFailed&&Oe(a.fastTCPServerIpTimer)}catch(e){st("Exception get fast tcp server ip")}}function we(e){return e.objectBased?e.errorReason?e.errorReason:It[0]:e.externalError?e.externalError:e.error&&e.error.code?It[e.error.code]:It[0]}function Pe(e){var t="Play.End.Detected";return e.objectBased&&e.endReason&&(t=e.endReason),t}function Re(){oe.viewerId=R.viewerId?R.viewerId:null,oe.viewerDiagnosticsId=R.viewerDiagnosticsId?R.viewerDiagnosticsId:R.viewerId?R.viewerId:null}function xe(e,t){var a=null;oe&&oe.viewerDiagnosticsId&&(a=oe.viewerDiagnosticsId);var i="",n=50,r=32;if(a&&"-"!=a&&(!t||!e.xViewerId)){!function(e){var t=null;G&&G.viewerDiagnostics&&G.viewerDiagnostics.salt&&G.viewerDiagnostics.salt.version&&(t=G.viewerDiagnostics.salt.version);e.xViewerIdVersion=t,oe.xViewerIdVersion=t}(e),st("get Viewer DiagnosticsID"),a=encodeURIComponent(a),G&&G.viewerDiagnostics&&G.viewerDiagnostics.salt&&G.viewerDiagnostics.salt.value&&(i=G.viewerDiagnostics.salt.value),G&&G.viewerDiagnostics&&G.viewerDiagnostics.salt&&G.viewerDiagnostics.salt.iterations&&(n=G.viewerDiagnostics.salt.iterations),G&&G.viewerDiagnostics&&G.viewerDiagnostics.salt&&G.viewerDiagnostics.salt.bytes&&(r=G.viewerDiagnostics.salt.bytes);var s=I.PBKDF2(a,i,{keySize:r/8,iterations:n});e.xViewerId=s,oe.xViewerId=s}}function Me(e,t,a){var i;"viewerId"!=t&&"clientId"!=t&&"viewerDiagnosticsId"!=t&&(a&&(R[a]?i=R[a]:e[a]&&(i=e[a])),e[t]=i)}function Be(e,t,a){null==a&&(a="");try{if(""==t||null==t)return;e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null==i?a:i[1]}catch(e){return st("Exception,  getValueFromQueryString :"+e),a}}function De(e){Oe(e.akamai.fastTCPServerIpTimer),s&&Ce(e)}function Ne(e,t,a){try{var i=null;return i=setTimeout((function(){e.apply(void 0,a)}),t)}catch(n){st("Exception, set window timeout:"+n);try{i=window.setTimeout((function(){e.apply(void 0,a)}),t)}catch(e){return null}return i}}function Oe(e){try{clearTimeout(e)}catch(t){st("Exception clear window timeout:"+t);try{window.clearTimeout(e)}catch(e){}}}function Ue(e){st("startBeaconTImer");var t=e.akamai;t.areTimerStarted||(st("startBeaconTimer: starting beacon timer"),t.firstPLineTimer=Ne(Fe,K.secondaryLogTime,[e]),t.hLineTimer=Ne(je,K.heartBeatInterval,[e]),t.fastTCPServerIpTimer=Ne(De,K.logInterval-5e3,[e]),e.objectBased&&($=500),t.pollingTimer=Ne(Xt,$,[e]),t.areTimerStarted=!0)}function He(e){var t=e.akamai;t&&(t.hLineTimer&&Oe(t.hLineTimer),t.pollingTimer&&Oe(t.pollingTimer),t.fastTCPServerIpTimer&&Oe(t.fastTCPServerIpTimer),t.firstPLineTimer&&Oe(t.firstPLineTimer),ue&&ue.retryTimer&&Oe(ue.retryTimer))}function Ve(e){var t=e.akamai;ne.akamai={},ne.dataSent={},t.areTimerStarted=!1,t.isCLineSent=!1,t.isELineSent=!1,t.lastRebufferEndEpoch=0,t.connectTime=0,j.browserClose=!1,t.totalPlayClockTime=t.totalStreamTime=t.totalRebufferCount=t.totalRebufferTime=0,t.isVisitEnd=0,t.sequenceId="0",t.wasPutToSleep=!1,t.chasingSleep=null,t.continuousRebufferDuration=0,Yt(e),t.attemptId=t.sessionId=S(),Re(),t.clientId=t.viewerId=function(e){var t=oe.viewerId;if("-"!=t){if(!t)try{if(window&&window.localStorage&&window.localStorage.getItem("akamai_clientId"))t=window.localStorage.getItem("akamai_clientId");else try{t=S(),window&&window.localStorage&&window.localStorage.setItem("akamai_clientId",t)}catch(e){st("window.localStorage Exception :"+e)}}catch(e){st("Exception,  getting viewerId"+e),t=S()}return t}}(),G.viewerDiagnosticsEnabled&&xe(t),t.lastPLineSentTime=t.hLineSentCount=t.lastSLineSentTime=t.lastHLineSentTime=0,t.lastHTime=0,da("HTML_LastCLineTime"),St=[0,0,0,0,0,0,0,0,0,0,0,0];var a=parseInt(la("HTML_VisitCountCookie"));a&&""!=a||(t.isVisitStart=1,ca("HTML_VisitCountCookie",a=0));var i=parseInt(la("HTML_isPlayingCount"));i&&""!=i||ca("HTML_isPlayingCount",i=0);var n=la("HTML_VisitValueCookie");n&&""!=n||ca("HTML_VisitValueCookie","0|0|0|0|0|0|0|0|0|0|0|0|0");var r=la("HTML_BitRateBucketCsv");r&&""!=r||ca("HTML_BitRateBucketCsv","0,0,0,0,0,0,0,0");var s=la(lt);s&&""!=s?t.browserSessionId=t.visitId=la(lt):(t.browserSessionId=t.visitId=S(),ca(lt,t.visitId))}function _e(e,t){var a=e.akamai;if(a.isILineSent=!0,++a.iLineCount,a.lastSLineSentTime=t,1==a.iLineCount){var i=parseInt(la("HTML_VisitCountCookie"));ca("HTML_VisitCountCookie",++i),yt=t}var n=parseInt(la("HTML_VisitIntervalStartTime"));n&&" "!=n||ca("HTML_VisitIntervalStartTime",n=t),St[0]=1,a.sendVLine=!0}function Fe(e){var t=C();e.akamai.lastPLineSentTime=t,nt(e,"playing",!1,t)}function je(e){var t=e.akamai;t.hLineTimer=Ne(je,K.heartBeatInterval,[e]);var a=C();nt(e,"heartBeat",!1,a),t.lastHLineSentTime=a,t.hLineSentCount++,t.hLineSentCount%(K.logInterval/K.heartBeatInterval)==0&&(nt(e,"playing",!1,a),t.lastPLineSentTime=a,t.continuousRebufferDuration>=K.rebufferDurationOutlier&&(N.objectBased?(N.errorReason="Error.Continous.Rebuffer",Dt(N)):akamaiHandleError("Error.Continous.Rebuffer")))}function qe(e,t,a,i){try{st("sendBeaconCLine : endReasonCode = "+t);var n=e.akamai;n.endReasonCode=t,nt(e,"complete",a,i);var r=parseInt(la("HTML_isPlayingCount"));ca("HTML_isPlayingCount",r-=1),n.isVisitStart=null,n.isCLineSent=!0,n.firstTimePlay=!0,He(e),ca("HTML_LastCLineTime",i)}catch(e){st("Exception, send beacon C Line:"+e)}}function We(e,t,a,i){try{var n=e.akamai;if(n.errorCode=t||"UNKNOWN",st("sendBeaconELine : errorCode = "+n.errorCode),St[3]=1,1==n.sequenceId&&(St[11]=1,Re(),G.viewerDiagnosticsEnabled&&xe(n,!0)),n.playerState="E",nt(e,"error",a,i),n.isSLineSent){var r=parseInt(la("HTML_isPlayingCount"));ca("HTML_isPlayingCount",r-=1)}n.isELineSent=!0,n.isVisitStart=null,n.firstTimePlay=!0,He(e);var s=i;Ze(n),ca("HTML_LastCLineTime",s)}catch(e){st("Exception, send beacon E line:"+e)}}function ze(e,t){try{st("sendBeaconVLine");var a=e.akamai;a.isVisitEnd=1,function(e){try{var t=la("HTML_VisitValueCookie").split("|"),a=!0;""!=t&&null!=t||(a=!1);var i=[];i=a?t:Tt;for(var n=["visitAttempts","visitPlays","visitViews","visitErrors","visitPlayClockTime","visitPlayStreamTime","visitRebufferCount","visitRebufferTime","visitAdPlayClockTime","visitAdStartCount","visitAdAbandonCount","visitStartupErrors"],r=0;r<n.length;r++)e[n[r]]=i[r]}catch(e){st("Exception get visit value  cookie : "+e)}}(a);var i=parseInt(la("HTML_VisitIntervalStartTime"));a.visitMaxPersistentBitRateBucket=function(){try{var e=la("HTML_BitRateBucketCsv").split(","),t=!1;null!=e&&""!=e||(e=bt.split(",")),e[0]=parseInt(e[0]);for(var a="00",i=e[0],n=0;n<e.length;n++)e[n]=parseInt(e[n]),e[n]>0&&(t=!0),i<e[n]&&(i=e[n],a="0"+n);if(t)return a}catch(e){st("Exception, get visit max bit rate bucket"+e)}}(),a.visitInterval=t-i,(""==i||null==i||isNaN(i))&&(a.visitInterval=t-yt),a.sessionId=null,a.attemptId=null,a.sequenceId=null,da("HTML_BitRateBucketCsv"),da("HTML_VisitValueCookie"),da("HTML_VisitIntervalStartTime"),da("HTML_LastCLineTime"),da("HTML_VisitCountCookie"),da("HTML_isPlayingCount"),da(lt),nt(e,"visit",!0,t),ne.akamai={},ne.dataSent={},st("sendBeaconVLine: beacon sent"),a.sendVLine=!1,a.iLineCount=0,Oe(e.akamai.clearVisitTimeoutId);var n=a.isPlaylist;e.akamai=new kt(N),"undefined"!=typeof akamaiBCVideoObject&&(e.akamai.isPlaylist=n)}catch(e){st("Exception, send beacon V line:"+e)}}function Xe(e){st("entered setVisitValueParameters"),St[4]=e.totalPlayClockTime,St[5]=e.totalPlayStreamTime,St[6]=e.totalRebufferCount,St[7]=e.totalRebufferTime,St[8]=e.totalAdPlayClockTime,St[9]=e.totalAdStartCount,St[10]=e.totalAdAbandonCount,e.totalPlayClockTime>5e3&&(St[2]=1),function(){try{var e=la("HTML_BitRateBucketCsv"),t=bt.split(","),a=e.split(","),i=0;for(var n in he.bitRatePlayTime)n=parseInt(n),(i=parseInt((n-1)/5e5))>7&&(i=7),a[i]=parseInt(a[i])+he.bitRatePlayTime[n],t[i]=parseInt(t[i])+he.bitRatePlayTime[n];ca("HTML_BitRateBucketCsv",e=a.join(",")),bt=t.join(",")}catch(e){st("Exception set bit rate bucketcsv"+e)}}(),function(){for(var e=la("HTML_VisitValueCookie").split("|"),t=0;t<St.length;t++)Tt[t]+=St[t];st("setVisitValueCookie :: visit values saved"+Tt);for(var a=0;a<e.length;a++)e[a]=parseInt(e[a])+St[a];ca("HTML_VisitValueCookie",e.join("|"))}()}function Ke(e){try{var t=encodeURI(e);return t=t.replace(/#/g,"%23")}catch(t){return st("Exception,  encoding beacon"),e}}function Ge(){try{if(st("send delayed beacon"),j.queue&&j.queue.length>0){var e=j.queue.shift();j.timer=Ne(Ge,j.time,[]),st("Beacon ::"+e.url,"Beacon"),ye(null,e.url,e.isSync),u&&v.processLogs({api:"reportBeaconData",value:e.url})}else st("send delayed beacon : clear the timer"),Oe(j.timer),j.timer=null}catch(e){st(e)}}function Qe(e,t,a){if(0!=re){var i=K.beaconUrl+"?"+e;try{if(j.enabled){var n={};if(j.browserClose){if(j.timer&&Oe(j.timer),j.queue&&j.queue.length>0)for(;j.queue.length>0;)st("put beacon on wire, send beacon from queue::"+(n=j.queue.shift()).url,"BEACON"),st("Beacon ::"+n.url,"Beacon"),a.wasPutToSleep||(u&&v.processLogs({api:"reportBeaconData",value:n.url}),ye(null,n.url,n.isSync));st("put beacon on wire browser close::"+i,"BEACON"),st("Beacon ::"+i,"Beacon"),a.wasPutToSleep||(u&&v.processLogs({api:"reportBeaconData",value:i}),ye(null,i,t))}else st("put beacon on wire pushing beacon in queue::"+i),n.url=i,n.isSync=t,j.queue.push(n),j.timer?st("put beacon on wire: timer is running"):(st("put beacon on wire: call send delayed beacon"),a.wasPutToSleep||Ge())}else st("put beacon on wire"+i,"BEACON"),a.wasPutToSleep||ye(null,i,t)}catch(e){st("failed to send beacon"),st(e)}}else st("put beacon On Wire, dont send beacon isACtive is zero")}function Je(e,t,a,i){try{for(var n,r=0;r<t.length;r++){t[r].expiryDuration&&ua(e,t[r]),n=t[r].name;var s=null;n in e&&(s=e[n]),t[r].value&&(s=t[r].value),(s||0==s)&&(t[r].sendOnce?!1===t[r].isSent&&(0!=s&&(t[r].isSent=!0),Ye(s,t,n,r,i,a)):Ye(s,t,n,r,i,a))}}catch(e){st("Exception, assemble logs:"+e)}}function Ye(e,t,a,i,n,r){try{if(t[i].regExpJS){var s=new RegExp(t[i].regExpJS).exec(e);s&&(e=s[s.length-1])}}catch(e){st("Exception,  evaluating regExpJS attribute for metric : "+a)}e=String(e).replace(/~/g,K.encodedParamSeparator),t[i].size&&(e=function(e,t){try{return e.substring(0,t)}catch(t){return st("Exception,  getTruncatedMetric"+t),e}}(e,t[i].size)),t[i].key in n||(n[t[i].key]=t[i].key,r.push((K.useKey?t[i].key:a)+"="+e))}function $e(e,t,a){try{st("getBeaconStrings : eventCode =  "+t);var i=q.common,n=[],r=q[t];if(null==r||"undefined"==r)return void st("getbeaconstrings, return as eventmetrics undefined");var s=[],o={};if(e.eventCode||(e.eventCode=J[t]),Je(e,i,n,o),"error"==t&&(e.updateTerminateMetrics(),Xe(e)),"complete"==t){e.updateTerminateMetrics();var l=q.playing;Xe(e),Je(e,l,s,o)}Je(e,r,s,o);var d=n.join(K.urlParamSeparator);d=Ke(d);var c=0;try{for(var u in X)K.useKey?c+=X[u].length+3+K.urlParamSeparator.length:c+=u.length+3+K.urlParamSeparator.length}catch(e){c=12}c--;var m=K.maxLogLineLength-c-d.length-3-K.beaconUrl.length;m<=0&&(m=4780-c-d.length-3-K.beaconUrl.length);var h=[],f="";if(m>0){if(s.length>0){var p,g="",v="";for(p=0;p<s.length;p++)(v=Ke(s[p])).length>=m?h.push(v):g.length+v.length<=m?g?g+=K.urlParamSeparator+v:g=v:(h.push(g),g="");""!=g&&h.push(g)}var y=h.length;if(y>1)for(var S=1;S<=y;++S)f=d+K.urlParamSeparator,f+=(K.useKey?X.partNumber:"partNumber")+"="+S+K.urlParamSeparator,f+=(K.useKey?X.totalParts:"totalParts")+"="+y+K.urlParamSeparator,f+=h[S-1],f+=K.urlParamSeparator,q[t]&&Qe(f,a,e);else Qe(f=d+K.urlParamSeparator+h[0]+K.urlParamSeparator,a,e)}else{var T=s.join(K.urlParamSeparator);T=Ke(T),f=d+K.urlParamSeparator+T+K.urlParamSeparator,q[t]&&Qe(f,a,e)}}catch(e){st("Exception, get beacon Strings:"+e)}}function Ze(e){ne.fLineCount=0;var t=rt(e);ne.akamai=t,ne.akamai.customDataPopulated=!1}function et(e){try{for(var t in q)if(q[t])for(var a=0;a<q[t].length;a++)q[t][a].fallback&&!R[q[t][a].name]&&Me(e,q[t][a].name,q[t][a].fallback)}catch(e){}}function tt(t,a,i,n){st("updating metrics for playing and end events");var r=t.akamai,s=0,o=r.playerState,l=!0;switch(r.currentStreamTime=parseInt(Gt(t)),r.currentState.state){case gt.playing:r.playerState="PL",a-r.seekTime>0&&r.updatePlayClockTime(a-r.seekTime,r.currentState.lastEventClockTime,i),r.playClockTime<0&&(r.playClockTime=0),r.updatePlayed(r.currentStreamTime);break;case gt.pause:r.pauseDuration+=a,r.playerState="PS";break;case gt.rebuffering:if(!r.wasPutToSleep){r.rebufferTime+=a,r.curRebufferTime+=a,Ae(r,i),r.playerState="B",s=i-r.curRebufferTime;break}case gt.resumeBuffering:r.playerState="RB",r.resumeBufferTime+=a;break;case gt.ended:r.updatePlayed(r.currentStreamTime);break;case gt.seek:i-r.currentState.timeUpdateClockTime>0&&ke(r,i,r.currentStreamTime,"S"),r.currentState.timeUpdateClockTime=i,r.playerState="SK";break;default:l=!1}if("B"===r.playerState?r.continuousRebufferDuration+=r.curRebufferTime:r.continuousRebufferDuration=0,he.getTransitionSession(r),ke(r),r.rebufferSession&&(!function(e,t){var a,i;if("B"==t){var n="";if(e.rebufferSession){for(var r=e.rebufferSession.split(";"),s=0;s<r.length;s++){var o=r[s].split(":");n+=0==s?"0:"+o[1]:r[s],s!=r.length-1&&(n+=";")}st("newRebufferSession = "+n),e.rebufferSession=n}i=1,a=0}else i=0,a=e.lastRebufferEndEpoch>0?e.firstRebufferStartEpoch-e.lastRebufferEndEpoch:-1;e.rebufferSession=i+":"+a+";"+e.rebufferSession,e.lastRebufferEndEpoch=e.currRebufferEndEpoch}(r,o),r.firstRebufferStartEpoch=s),r.playClockTime>5e3&&(r.isView=1),l&&(r.currentState.lastEventClockTime=i),r.bytesLoaded=function(t){var a=0,i=0;try{t&&t.objectBased&&e&&e.bytesLoaded&&(i=(a=parseInt(e.bytesLoaded()))-t.akamai.lastBytesLoaded)}catch(e){}if(t.akamai.lastBytesLoaded=a,i>0)return i}(t),r.played){var d=r.played;r.playStreamTime=0;for(var c=0;c<d.length;c++)r.playStreamTime+=parseInt(d[c][1]-d[c][0]);"R"==r.logType&&(r.playStreamTime-=r.lastPlayStreamTime,r.lastPlayStreamTime+=r.playStreamTime)}n&&"Browser.Close"!=r.endReasonCode&&!r.streamTitleSwitchReason&&(r.playerState="E")}function at(e){try{var a;for(a in x)"viewerId"!=a&&"clientId"!=a&&"viewerDiagnosticsId"!=a&&"pluginVersion"!=a&&(e[a]=x[a]);"pluginVersion"in x&&(e.pluginVersion=t+":"+x.pluginVersion)}catch(e){}}function it(e,t){st("populate custom data, eventCode = "+t);try{if(function(e){try{var t="-";if(document&&document.referrer){var a=document.referrer;(a=a.split("/",3))&&a[2]&&(t=a[2])}window==window.top?(e.pageUrl=R.pageUrl?R.pageUrl:document.URL,e.pageHost=R.pageUrl&&be(R.pageUrl)?be(R.pageUrl):document.location.hostname,e.pageReferrer=R.pageReferrer?R.pageReferrer:document.referrer?document.referrer:"-",e.pageReferrerHost=R.pageReferrer&&be(R.pageReferrer)?be(R.pageReferrer):document.referrer?t:"-"):(e.pageUrl=R.pageUrl?R.pageUrl:document.referrer?document.referrer:"-",e.pageHost=R.pageUrl&&be(R.pageUrl)?be(R.pageUrl):document.referrer?t:"-",e.pageReferrer=R.pageReferrer?R.pageReferrer:"NA",e.pageReferrerHost=R.pageReferrer&&be(R.pageReferrer)?be(R.pageReferrer):"NA")}catch(e){}}(e),e.deliveryType=function(e){return R.deliveryType?R.deliveryType:e.deliveryType}(e),e.device=R.device?R.device:ft,!("playing"!=t&&"complete"!=t&&"feedback"!=t&&"error"!=t||(function(e){try{var t=null;if(null!=ne.socialSharingObj)for(var a in ne.socialSharingObj)null==t?t=a+":"+ne.socialSharingObj[a]+",":t+=a+":"+ne.socialSharingObj[a]+",";null!=t&&(e.socialSharing=t.substring(0,t.length-1))}catch(t){st("Exception,  getFeedbackData"+t),e.socialSharing=null}ne.socialSharingObj={}}(e),null!=e.socialSharing&&""!=e.socialSharing||"feedback"!=t||e.customDataChanged)))return void--ne.fLineCount;var a;for(a in R)"viewerId"!=a&&"clientId"!=a&&"viewerDiagnosticsId"!=a&&(a in B||(e[a]=R[a]));if(ue&&ue.akamai)for(var i in ue.akamai)e[i]=ue.akamai[i];!function(e){try{var t=x.streamName?x.streamName:e.streamName}catch(e){}try{R.title?e.title=R.title:e.title=R.eventName?R.eventName:t,R.eventName?e.eventName=R.eventName:e.eventName=R.title?R.title:t}catch(e){st("Exception,  getting title and eventName, "+e)}}(e),e.cdn=Te(e)}catch(e){st("Exception,  populate Custom Data , "+e)}}function nt(e,t,a,i){try{st("sendBeacon: eventCode = "+t+", clocktime = "+i);var n=e.akamai,r=i-n.currentState.lastEventClockTime;if(n.logInterval="init"!=t?n.lastLogTime<=0?"0":(i-n.lastLogTime)/1e3:"0",n.customDataPopulated||it(n,t),n.serverIp=Z.serverip?Z.serverip:"-",n.fastTCP=ae.ftcp?ae.ftcp:"-",n.eventCode=J[t],n.hLineSentCount>0?n.lastHTime=(i-n.lastHLineSentTime)/1e3:n.lastHTime=(i-n.lastSLineSentTime)/1e3,"heartBeat"==t){var s=n.logInterval;n.logInterval=(i-n.lastPLineSentTime)/1e3,Le(n,i)}n.logInterval<0&&(n.logInterval="0");var o=!1;if("complete"==t&&(t="playing",o=!0),n.endOfStream=o?"1":"0",n.currentClockTime=i-n.startTimer,n.currentStreamTime=parseInt(Gt(e)),"playing"!=t||n.playEndMetricsUpdated||(o&&Le(n,i),st("send Beacon, updating play and end metrics"),tt(e,r,i,o),Yt(e)),n.customDataPopulated||et(n),at(n),!_){var l={element:rt(n),code:o?"complete":t,synch:a};return F.push(l),"playing"!=t&&"playStart"!=t||n.clearRelativeMetrics(),void("heartBeat"!=t?(st("send beacon :configurationPopulated false sequenceId = "+n.sequenceId),++n.sequenceId,n.lastLogTime=i):n.logInterval=s)}if("playStart"==t&&function(){try{var e="";for(var t in D)D[t]&&(t in R||(e?e+=", "+t:e=t));e&&(e="Following dimensons have not being set : "+e,e+="<ul style='list-style-type:circle;margin:0'>",st(e+="<li>Please refer 'Set Custom Data' section in Integration guide for more details.</li></ul>","INTEGRATION"))}catch(e){}}(),n.populateMetricsFromConfiguration(),n.xViewerId=oe.xViewerId,n.xViewerIdVersion=oe.xViewerIdVersion,"undefined"!=typeof akaMediaAnalytics&&null!=akaMediaAnalytics){var d=akaMediaAnalytics.getStream();d&&(n.bandwidth=d.getBandwidthFromFragments(),st("reporting bandwidth = "+n.bandwidth),d.cleanupFragments())}$e(n,o?"complete":t,a),n.qualityOfExperience=null,o=!1,"playing"!=t&&"playStart"!=t||n.clearRelativeMetrics(),"heartBeat"!=t?(++n.sequenceId,n.lastLogTime=i):n.logInterval=s}catch(e){st("Exception, send beacon:"+e)}}function rt(e,t){t=t||{};try{for(var a in e)"object"==typeof e[a]&&e[a]?(t[a]=e[a].constructor===Array?[]:{},rt(e[a],t[a])):t[a]=e[a];return t}catch(e){}}function st(e,t){try{if(1==de.configURLCsmaDebug||1==de.pageURLCsmaDebug||1==de.configDebug){try{de.printException&&-1!=e.indexOf("Exception")&&(t="ERROR")}catch(e){}var a=[];a[0]={message:e,type:t,time:w()};var i={logMessage:a,type:"log"};try{void 0!==v?v.processLogs({api:"reportLogs",value:i}):p.push({api:"reportLogs",value:i})}catch(e){p.push({api:"reportLogs",value:i})}try{console.log(e)}catch(e){}}else if(!_){var n={message:e,msgType:t};le.push(n)}}catch(e){}}function ot(){try{if((1==de.configURLCsmaDebug||1==de.pageURLCsmaDebug||1==de.configDebug)&&de.logStoredMsg)if("function"==typeof AkamaiAnalytics_debugWindow_available&&"1"==AkamaiAnalytics_debugWindow_available()){if(de.logTimer&&Oe(de.logTimer),de.logStoredMsg=!1,le.length){for(var e=0;e<le.length;e++)st(le[e].message,le[e].msgType);le=[]}}else de.logTimer=Ne(ot,1e3,[])}catch(e){}}ve(),ye((function(e){var t=e.readyState,a=e.status;st("readConfig: readyState = "+t+":::status = "+a);try{if(4==t&&200==a){!function(){try{st("deleteExpiredDataFromLocalStorage");for(var e=C(),t=window.localStorage.length-1;t>=0;t--){var a=window.localStorage.getItem(window.localStorage.key(t));if(null!=a&&-1!==a.indexOf("expiryDate")){var i=JSON.parse(a);null!=i&&void 0!==i.expiryDate&&null!==i.expiryDate&&Date.parse(i.expiryDate)<=e&&window.localStorage.removeItem(window.localStorage.key(t))}}}catch(e){}}();var i=e.responseXML;if(i){for(var n,r=(n=i.documentElement?i.documentElement:i).getElementsByTagName("dataMetrics"),s=0;s<r.length;++s){var o=r[s],l=o.parentNode,d=l.nodeName;W[s]=d;var c=q[d]=[],u=l.getAttribute("eventCode");u&&(J[d]=u);for(var m=o.getElementsByTagName("data"),h=0;h<m.length;++h){var f=m[h];d=f.getAttribute("name");var p=f.getAttribute("key");u=f.getAttribute("value");var g=f.getAttribute("sendOnce"),v=f.getAttribute("fallback"),y=f.getAttribute("size"),S=f.getAttribute("regExpJS"),T=f.getAttribute("expiry"),b={};b.name=d,b.key=p,(d in D||-1!=p.indexOf("_cd_"))&&(D[d]=!0),u&&(b.value=u),g&&(b.isSent=!1,b.sendOnce=g),v&&(b.fallback=v),y&&(b.size=y),S&&(b.regExpJS=S),T&&(b.expiryDuration=parseInt(parseInt(T)/1440)),c.push(b)}}de.configDebug=parseInt(n.getAttribute("debug")),1!=de.configDebug&&(de.configDebug=0),1==de.configDebug&&ve(),n.getElementsByTagName("isActive")[0]&&n.getElementsByTagName("isActive")[0].childNodes[0]&&(re=n.getElementsByTagName("isActive")[0].childNodes[0].nodeValue),z.beaconId=n.getElementsByTagName("beaconId")[0].childNodes[0].nodeValue,z.beaconVersion=n.getElementsByTagName("beaconVersion")[0].childNodes[0].nodeValue;var k=n.getElementsByTagName("logTo")[0];K.logType=k.getAttribute("logType"),K.logType||(K.logType="relative"),K.logInterval=1e3*k.getAttribute("logInterval"),K.logInterval||(K.loginterval=3e5),K.heartBeatInterval=1e3*k.getAttribute("heartBeatInterval"),K.heartBeatInterval||(K.heartBeatInterval=6e4),K.secondaryLogTime=1e3*k.getAttribute("secondaryLogTime"),K.secondaryLogTime||(K.secondaryLogTime=15e3),K.rebufferDurationOutlier=1e3*k.getAttribute("rebufferDurationOutlier"),K.rebufferDurationOutlier||(K.rebufferDurationOutlier=6e5),K.isSessionWithRebufferLimit=k.getAttribute("isSessionWithRebufferLimit"),K.isSessionWithRebufferLimit||(K.isSessionWithRebufferLimit=500),K.fastTCPEnabled=k.getAttribute("fastTCPEnabled"),K.fastTCPEnabled||(K.fastTCPEnabled=0),1==K.fastTCPEnabled&&(ae.fastTCPEnabled=!0),K.aisRequestLimit=k.getAttribute("aisRequestLimit"),K.aisRequestLimit||(K.aisRequestLimit=3),ue&&(ue.aisRequestLimit=K.aisRequestLimit),K.aisRequestInterval=1e3*k.getAttribute("aisRequestInterval"),K.aisRequestInterval||(K.aisRequestInterval=3e4),ue&&(ue.aisRequestInterval=K.aisRequestInterval),K.startupTimeOutlierLimit=1e3*k.getAttribute("startupTimeOutlierLimit"),K.startupTimeOutlierLimit||(K.startupTimeOutlierLimit=6e5),K.visitTimeout=60*k.getAttribute("visitTimeout")*1e3,K.visitTimeout||(K.visitTimeout=36e5),K.urlParamSeparator=k.getAttribute("urlParamSeparator"),K.urlParamSeparator||(K.urlParamSeparator="~"),K.encodedParamSeparator=k.getAttribute("encodedParamSeparator"),K.encodedParamSeparator||(K.encodedParamSeparator="*@*"),K.initBrowserCloseTime=k.getAttribute("initBrowserCloseTime"),K.initBrowserCloseTime||(K.initBrowserCloseTime=9e5),K.seekThreshold=1e3*k.getAttribute("seekThreshold"),K.seekThreshold||(K.seekThreshold=2e3);var A=k.getAttribute("delayTimer");A&&(j.time=A),1==k.getAttribute("disableDelay")&&(j.enabled=!1);var L=k.getElementsByTagName("host")[0].childNodes;if(L.length>1){K.beaconUrl="";for(h=0;h<L.length;h++)K.beaconUrl+=L[h].nodeValue}else K.beaconUrl=k.getElementsByTagName("host")[0].childNodes[0].nodeValue;-1==K.beaconUrl.indexOf("http://")&&-1==K.beaconUrl.indexOf("https://")&&(K.beaconUrl="http://"+K.beaconUrl),K.beaconUrl+=k.getElementsByTagName("path")[0].childNodes[0].nodeValue,K.maxLogLineLength=k.getAttribute("maxLogLineLength"),K.maxLogLineLength||(K.maxLogLineLength=2048),K.maxLogLineLength-=K.beaconUrl.length,K.logVersion="2.0",K.formatVersion="1.1",k.getElementsByTagName("formatVersion")&&k.getElementsByTagName("formatVersion")[0]&&k.getElementsByTagName("formatVersion")[0].childNodes[0]&&(K.formatVersion=k.getElementsByTagName("formatVersion")[0].childNodes[0].nodeValue),K.useKey=parseInt(n.getElementsByTagName("statistics")[0].getAttribute("useKey"));var I=n.getElementsByTagName("feedback")[0];null!=I&&""!==I&&(ne.shouldSendFLine=!0,ne.limit=I.getAttribute("limit"),ne.limit||(ne.limit=3),ne.socialShareLimit=I.getAttribute("socialShareLimit"),ne.socialShareLimit||(ne.socialShareLimit=1));var E=n.getElementsByTagName("security")[0];if(null!=E&&""!==E){var w=E.getElementsByTagName("ViewerDiagnostics")[0];if(null!=w&&""!==w){G.viewerDiagnostics={};var P=w.getElementsByTagName("salt")[0];if(null!=P&&""!==P){G.viewerDiagnostics.salt={};var x=P.getAttribute("value"),M=P.getAttribute("version");null!=x&&""!==x?(G.viewerDiagnostics.salt.value=x,G.viewerDiagnosticsEnabled=!0,null!=M&&""!==M&&(G.viewerDiagnostics.salt.version=M),G.viewerDiagnostics.salt.bytes=2*P.getAttribute("bytes"),G.viewerDiagnostics.salt.bytes||(G.viewerDiagnostics.salt.bytes=32),G.viewerDiagnostics.salt.iterations=P.getAttribute("iterations"),G.viewerDiagnostics.salt.iterations||(G.viewerDiagnostics.salt.iterations=50)):G.viewerDiagnosticsEnabled=!1}}}var B=n.getElementsByTagName("bucketInfo")[0];for(var O in Q.bucketLength=B.getElementsByTagName("bucketLength")[0].childNodes[0].nodeValue,Q.bucketCount=B.getElementsByTagName("bucketCount")[0].childNodes[0].nodeValue,_=!0,R)try{"_cd_"==O.substring(0,4)&&Se(O)}catch(e){}!function(){try{for(var e=q.split,t=0;t<e.length;t++)X[e[t].name]=e[t].key}catch(e){}}(),ot(),function(){try{var e=K.beaconUrl.toLowerCase(),t="";-1==e.indexOf(".edgesuite.net/")&&-1==e.indexOf(".edgekey.net/")&&(t="Beacons sent to incorrect domain : "+e,t+="<ul style='list-style-type:circle;margin:0'>",t+="<li>We have identified that the beacons are not sent to an Akamai Domain.</li>",st(t+="<li>Kindly use the proper Beacon XML path that is provided in SOLA Anlaytics UI while provisioning.</li></ul>","ERROR"))}catch(e){}}();var U=n.getElementsByTagName("match");for(h=0;h<U.length;h++){match=U[h];try{parentKey=match.parentNode.parentNode.getAttribute("name"),Y[parentKey]||(Y[parentKey]={}),Y[parentKey][match.getAttribute("key")]={type:match.getAttribute("type"),name:match.getAttribute("name"),value:match.getAttribute("value")}}catch(e){st(e)}}!function(){var e={};try{var t,a;if(Y.bitRateBucketTimes){for(a in Y.bitRateBucketTimes)if(e=Y.bitRateBucketTimes[a])if(e.key=a,e.value){t=e.value.split(";");for(var i=0;i<t.length;i++)-1!=t[i].indexOf("min:")?e.min=parseInt(t[i].split(":")[1]):-1!=t[i].indexOf("max:")&&(e.max=parseInt(t[i].split(":")[1]))}else e.category="first"}else Y.bitRateBucketTimes={},(e=Y.bitRateBucketTimes).U={key:"U",type:"range"},e.S={key:"S",max:1500,value:"max:1500",type:"range"},e.Q={key:"Q",min:1500,max:2500,value:"min:1500;max:2500",type:"range"},e.D={key:"D",min:2500,value:"min:2500",type:"range"};for(var n in he.bitRateBucketMap={},Y.bitRateBucketTimes)he.bitRateBucketMap[n]=0}catch(e){st("Exception, find bit rate match rules :"+e)}}(),function(){if(st("fillVideoWithConfig function"),N&&N.akamai){var e=N.akamai;e.populateMetricsFromConfiguration(),e.isSLineSent&&Ue(N),G.viewerDiagnosticsEnabled&&xe(e),e.cdn=Te(e)}}(),function(){st("sendStoredBeacons: number of beacons to be sent = "+F.length);try{for(N.akamai;F.length>0;){var e=F.shift();st("readConfig: sending beacon event code = "+e.code),e.element.populateMetricsFromConfiguration(),e.element.xViewerId=oe.xViewerId,e.element.xViewerIdVersion=oe.xViewerIdVersion,e.element.cdn=Te(e.element),$e(e.element,e.code,e.synch)}}catch(e){st("Exception,  sendStoredBeacons"+e)}}()}}}catch(e){st("Exception,  readConfig :"+e)}}),H.url,!1,!0),this.getValueFromQueryString=function(){return Be(key,searchURL)},this.logMessage=function(e,t){st(e,t)};var lt="AkamaiAnalytics_BrowserSessionId",dt=null,ct=null,ut=null,mt=null,ht=null,ft=null,pt=null;navigator&&navigator.userAgent&&(pt=navigator.userAgent),function(){if(navigator&&navigator.userAgent){try{var e=navigator.userAgent,t=/\((\w+)/,a=t.exec(e);ct=a[1].toLowerCase(),ct=-1!=e.indexOf("Xbox")?"Xbox":-1!=ct.indexOf("compatible")||-1!=ct.indexOf("windows")||-1!=ct.indexOf("mobile")?"Windows":-1!=ct.indexOf("x11")?"Linux":-1!=ct.indexOf("macintosh")||-1!=ct.indexOf("mac os")||-1!=ct.indexOf("macos")?"Mac OS":-1!=ct.indexOf("ipad")?"iPad":-1!=ct.indexOf("iphone")?"iPhone":-1!=ct.indexOf("ipod")?"iOS":-1!=e.indexOf("Android")?"Android":-1!=e.indexOf("PlayStation 4")?"PlayStation 4":-1!=e.indexOf("PLAYSTATION 3")?"PlayStation 3":"Others"}catch(e){st("Exception,  finding Osname"),ct="Others"}ut=ct;try{if((a=(t=/(NT|Phone|OS X|Linux|CPU.*?OS) ([0-9\._]+)/).exec(e))&&a.length>2){(ht=a[2]?a[2]:"")&&(ut+=" "+ht);var i=null;"Windows"==ct&&(i=function(e){var t=null;if(e)if("6.3"==e||"6.2"==e)t="8";else if("6.1"==e)t="7";else if("6.0"==e)t="Vista";else if("5.2"==e||"5.1"==e)t="XP";else{var a=e.split(".");t=parseInt(a[0])>=8?a[0]:"Other"}return t}(ht),ct=ct+" "+i)}}catch(e){st("Exception,  OSVersion"+e)}}}(),function(){if(navigator&&navigator.userAgent){var e=navigator.userAgent,t=/(MSIE|Chrome|Version|Firefox)[ \/]([0-9]+)/;try{var a=t.exec(e);if(dt=a[1],"Version"==a[1]){var i=(t=/(Opera|Safari)/).exec(e);dt=i[1]}}catch(e){st("Exception,  browserName"+e)}try{st("browser version = "+a[2]);var n=e.indexOf("Edge");if(-1!=n){uagentLength=e.length;var r=e.substr(n,uagentLength-n).split("/");dt=r[0],mt=r[1]}else mt=a[2];dt&&mt&&(dt=dt+" "+mt)}catch(e){st("Exception,  browserVersion"+e)}}}(),function(){if(navigator&&navigator.userAgent)try{var e=navigator.userAgent;e=e.toLowerCase(),ft=-1!=e.indexOf("ipad")?"iPad":-1!=e.indexOf("ipod")?"iPod":-1!=e.indexOf("iphone")?"iPhone":-1!=e.indexOf("android")?"Android Device":-1!=e.indexOf("xbox")?"Xbox":-1!=e.indexOf("macintosh")||-1!=e.indexOf("windows")||-1!=e.indexOf("compatible")?"Desktop":-1!=e.indexOf("playstation 4")?"PlayStation 4":-1!=e.indexOf("playstation 3")?"PlayStation 3":"Others"}catch(e){st("Exception,  getitng device name : "+e),ft="Others"}}();var gt={ended:0,init:1,playing:2,pause:3,seek:4,rebuffering:5,resumeBuffering:6};function vt(e){try{switch(e){case gt.ended:return"ended";case gt.init:return"init";case gt.playing:return"playing";case gt.pause:return"pause";case gt.seek:return"seek";case gt.rebuffering:return"rebuffering";case gt.resumeBuffering:return"resumeBuffering";default:return"undefined"}}catch(e){}}var yt,St=[0,0,0,0,0,0,0,0,0,0,0,0],Tt=[0,0,0,0,0,0,0,0,0,0,0,0],bt="0,0,0,0,0,0,0,0";function kt(e){if(e&&e.customMetrics)for(var a in e.customMetrics)a in B||(this[a]=e.customMetrics[a]);this.userAgent=pt,this.playerType="HTML5",null!=o&&null!=l?this.pluginVersion="JS-3.15.2:"+o+"-"+l:N.objectBased?this.pluginVersion="JS-"+t:this.pluginVersion="HTML5-"+t,this.os=ct,this.fullOs=ut,this.osVersion=ht,this.browser=dt,this.browserVersion=mt,this.browserSize=window.innerWidth+"x"+window.innerHeight,this.rebufferCount=0,this.bytesLoadedCallback=0,this.lastBytesLoaded=0,this.currRebufferEndEpoch=0,this.totalPlayClockTime=0,this.totalPlayStreamTime=0,this.totalRebufferCount=0,this.totalRebufferTime=0,this.totalPauseCount=0,this.totalPauseDuration=0,this.totalSeekCount=0,this.totalSeekTime=0,this.totalResumeBufferCount=0,this.totalResumeBufferTime=0,this.totalAdPlayClockTime=0,this.totalAdStartCount=0,this.totalAdAbandonCount=0,this.updateTerminateMetrics=function(){try{this.playClockTime&&(this.totalPlayClockTime+=parseInt(this.playClockTime)),this.playStreamTime&&(this.totalPlayStreamTime+=parseInt(this.playStreamTime)),this.rebufferCount&&(this.totalRebufferCount+=parseInt(this.rebufferCount)),this.rebufferTime&&(this.totalRebufferTime+=parseInt(this.rebufferTime)),this.pauseCount&&(this.totalPauseCount+=parseInt(this.pauseCount)),this.pauseDuration&&(this.totalPauseDuration+=parseInt(this.pauseDuration)),this.seekCount&&(this.totalSeekCount+=parseInt(this.seekCount)),this.seekTime&&(this.totalSeekTime+=parseInt(this.seekTime)),this.resumeBufferCount&&(this.totalResumeBufferCount+=parseInt(this.resumeBufferCount)),this.resumeBufferTime&&(this.totalResumeBufferTime+=parseInt(this.resumeBufferTime)),this.adPlayClockTime&&(this.totalAdPlayClockTime+=parseInt(this.adPlayClockTime)),this.adCount&&(this.totalAdStartCount+=parseInt(this.adCount)),this.adAbandonCount&&(this.totalAdAbandonCount+=parseInt(this.adAbandonCount));var e=C();this.startupAbondonWaitTime=e,this.playInterval=e}catch(e){st("Unable to update cumulative metrics")}},this.clearRelativeMetrics=function(){var e=["rebufferCount","rebufferTime","playClockTime","playStreamTime","seekCount","seekTime","pauseCount","pauseDuration","resumeBufferCount","resumeBufferTime","averagedBitRate","transitionUpSwitchCount","transitionDownSwitchCount","rebufferSession","curRebufferTime","adCount","adPlayClockTime","adStartupTime","adAbandonCount","adPauseTime"];this.updateTerminateMetrics();for(var t=0;t<e.length;++t)this[e[t]]=0;this.pauseIntervalsAsString="-",this.seekIntervalsAsString="-",this.pauseSeekSession="-",this.transitionStreamTimeSession="-",this.socialSharing=null,this.adSession=null,ne.socialSharing=null,ne.socialSharingObj={},he.bitRateArr=[],delete this.rebufferSession},this.populateMetricsFromConfiguration=function(){for(var e in this.beaconId=z.beaconId,this.beaconVersion=z.beaconVersion,this.logType="relative"==K.logType?"R":"C",this.logVersion=K.logVersion,this.startupTimeOutlierLimit=K.startupTimeOutlierLimit,this.formatVersion=K.formatVersion,this.bucketCount=Q.bucketCount,this.bucketLength=Q.bucketLength,q)if(q[e])for(var t=0;t<q[e].length;t++)q[e][t].value&&(this[q[e][t].name]=q[e][t].value)},this.initPlayed=function(e){this.played.push([e,e]),this.playingIndex=0},this.updatePlayClockTime=function(e,t,a){this.playClockTime+=e,he.updateBitRateArr(e)},this.updatePlayed=function(e,t){var a=this.played;if(a){for(var i=0;i<a.length;i++);for(i=this.playingIndex;i<a.length&&e>a[i][0];i++);if(i!=this.playingIndex?(a[this.playingIndex][1]=Math.max(e,a[i-1][1]),a.splice(this.playingIndex+1,i-this.playingIndex-1)):a[this.playingIndex][1]=Math.max(e,a[this.playingIndex][1]),null!=t){for(i=0;i<a.length;i++){if(a[i][0]<=t&&a[i][1]>=t)return void(this.playingIndex=i);if(i+1<a.length&&a[i][1]<t&&a[i+1][0]>t)return i++,this.playingIndex=i,void a.splice(i,0,[t,t])}i==a.length&&(a.push([t,t]),this.playingIndex=i)}}},this.isVisitEnd=0,this.sequenceId="0",this.isSLineSent=!1,this.sendVLine=!1,this.played=[],this.iLineCount=0,this.isPlaylist=!1,this.isFirstTitle=1,this.currentState={state:gt.ended,lastEventClockTime:0,pauseStartStreamTime:0,pauseStartClockTime:0,timeUpdateStreamTime:0,timeUpdateClockTime:0,pollingTimerStreamTime:0,seekStartStreamPos:0},this.seekObject={seekStartEpochTime:-1,seekEndEpochTime:-1,seekStartStreamTime:-1,seekEndStreamTime:-1},this.clearRelativeMetrics(),st("value of configurationPopulated"+_),_&&this.populateMetricsFromConfiguration(),this.loadStartILine=!1,this.canPlayUpdated=!1,this.canPlayEventAutoPlay=!0,this.format="P",this.playerFormat=this.playerType+":"+this.format,this.deliveryType="O",this.firstTimeProgress=!0,this.firstTimePlay=!0,this.isILineSent=!1,this.seekFrom=0,this.lastPlayStreamTime=0,this.lastPlayLogTime=0,this.lastLogTime=0,this.curRebufferTime=0,this.sendIsSessionWithRebufferH=1}function At(){try{var e,t;for(e in q)if(q[e])for(t=0;t<q[e].length;t++)q[e][t].isSent&&!0===q[e][t].isSent&&(q[e][t].isSent=!1)}catch(e){}}function Lt(e){st("endOfTheSession");var t=e.akamai,a=t.isPlaylist,i=t.visitId,n=t.viewerId,r=t.streamName,s=t.cdn,o=t.sendVLine,l=t.iLineCount;e.akamai=null,At(),(t=e.akamai=new kt(e)).visitId=t.browserSessionId=i,t.viewerId=t.clientId=n,t.cdn=s,se=-1,t.streamName=r,t.iLineCount=l,e.akamai.clearVisitTimeoutId=Ne(na,K.visitTimeout,[e,1]),t.sendVLine=o,t.isPlaylist=a,e.played&&(e.played.length=0),he.clearBitRate()}N.akamai=new kt(N);var It=["UNKNOWN","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"];function Et(e){return!!(O&&O.dataset&&O.dataset.isad&&"true"==O.dataset.isad)}function Ct(e,t,a,i){"playing"==t&&(ie=[]);var n={};if(n.eventType=t,n.eventTime=i,a&&(n.streamUrl=a),"error"==t&&(n.errorCode=we(e)),ie&&ie.length>0){var r=ie[ie.length-1];r.eventType==n.eventType&&r.streamUrl==n.streamUrl?("error"==t&&(r.errorCode=n.errorCode),r.eventTime=n.eventTime):ie.push(n)}else ie.push(n)}function wt(e,t,a,i){try{var n=!1;if(ie.length>0){var r=ie[ie.length-1];if(st("check error events array, previous event is : "+r.eventType),"error"==r.eventType&&a==r.streamUrl)if("error"==t){var s=we(e);n=r.errorCode==s,r.eventTime=i,r.errorCode=s}else"play"==t&&r.eventTime&&i-r.eventTime<=2e3&&(n=!0)}}catch(e){st("Exception,  checkErrorEventsArray"+e),n=!1}return n}function Pt(e,t){if(Et())st("handlePauseEvent : video tag is of type AD, return");else try{st("entered function handle Pause Event");var a=C(t),i=parseInt(Gt(e)),n=e.akamai,r=n.currentState,s=Qt(e);if(n.firstTimePlay||r.state==gt.pause)return;if(s&&0!=s&&i&&0!=i&&Math.abs(s-i)<1e3)return;var o=a-r.lastEventClockTime,l=a-n.startTimer;switch(r.state){case gt.playing:n.updatePlayClockTime(o,r.lastEventClockTime,a),++n.pauseCount,ke(n,a,i,"P"),"-"!=n.pauseSeekSession?n.pauseSeekSession+=",P("+i+":"+l+")":n.pauseSeekSession="P("+i+":"+l+")",n.updatePlayed(i);break;case gt.rebuffering:if(!n.chasingSleep){++n.pauseCount,ke(n,a,i,"P"),"-"!=n.pauseSeekSession?n.pauseSeekSession+=",P("+i+":"+l+")":n.pauseSeekSession="P("+i+":"+l+")",n.rebufferTime+=o,n.curRebufferTime+=o,n.rebufferSessionArrayHLine&&(st("handlePauseEvent : pushing, rebufferSessionArrayHLine"),n.rebufferSessionArrayHLine.push(a));try{Ae(n,a),n.curRebufferTime=0}catch(e){st("Error...Pause"+e.message)}}}r.state=gt.pause,r.pauseStartStreamTime=i,r.pauseStartClockTime=a,r.lastEventClockTime=a}catch(e){st("Exception,  handlePauseEvent : "+e)}}function Rt(e,t){try{if(N&&N.akamai){st("handle bit rate switch");try{e=parseInt(e)}catch(e){return void st("Exception,bit rate to int :"+e)}isNaN(e)&&st("handle bitrate swtich, bite rate isNaN");var a=N.akamai,i=a.currentState,n=Gt(N);"-"!=he.currentBitRate&&(e>he.currentBitRate?a.transitionUpSwitchCount++:e<he.currentBitRate&&a.transitionDownSwitchCount++),i&&i.state==gt.playing&&Mt(N,t),he.currentBitRate=e,he.currentStartPos=n}}catch(e){st("Exception, handle bit rate switch:"+e)}}function xt(e,t){if(Et())st("handle Play Event : video tag is of type AD, return");else try{var a=C(t),i=Jt(e);if(e.akamai&&e.akamai.postRollTimer&&(st("handle play event: send the C line without changing set data"),Oe(e.akamai.postRollTimer),delete e.akamai.postRollTimer,Ot(e,a)),wt(e,"play",i,a))return void st("handle play Event: play is thrown after error, return, curTime = "+a);Ct(e,"play",i,a);var n=e.akamai,r=parseInt(Gt(e)),o=n.currentState,l=a-o.lastEventClockTime,u=a-n.startTimer,m=o.state;switch(st("entered function handle Play Event, current state = "+vt(o.state)),m){case gt.ended:E(i,n),n.streamUrl=i,n.startTimer=a,n.streamLength=parseInt(Qt(e)),null!=i&&-1!=i.indexOf("?")&&(i=i.substring(0,i.indexOf("?"))),null!=i&&""!=i&&/.m3u8$/.exec(i)&&(n.format="L",n.playerFormat=n.playerType+":"+n.format,n.deliveryType="L"),se=-1,function(e,t,a){try{st("send beacon I line");var i=e.akamai;i.cdn=Te(i),s&&Ce(e,!0),i.iLineSentTime||(i.iLineSentTime=a),e.videoWidth&&e.videoHeight&&(i.videoSize=e.videoWidth+"x"+e.videoHeight),i.isILineSent||(Ve(e),nt(e,"init",t,a),_e(e,a),i.clearVisitTimeoutId&&Oe(i.clearVisitTimeoutId))}catch(e){st("Exception send I line:"+e)}}(e,!1,a),n.currentState.state=gt.init,st(a+": handlePlayBackEvent : Setting state to init"),n.currentState.timeUpdateClockTime=a,n.currentState.timeUpdateStreamTime=0,n.currentState.lastEventClockTime=a,n.isPlaylist=!0;var h=Jt(e);StreamTypeDetector(h,c,d,(function(e){e&&(st("detected stream type = "+e.getStreamType()),st("Received steam type = "+e.getStreamType()+"\n Stream URL = "+e.getStreamURL()+"\n Stream Name = "+e.getStreamName()+"\n Stream Length = "+e.getStreamLength()+"\n Stream Format = "+e.getStreamFormat()+"\n Stream Delivery Type = "+e.getDeliveryType()),n.streamUrl=e.getStreamURL(),n.format=e.getStreamFormat(),n.deliveryType=e.getDeliveryType(),e.getStreamLength()&&(n.streamLength=e.getStreamLength()),n.streamName=e.getStreamName())}))!==streamError.NoError&&st("failed to detect stream. May be we do not have sufficient information");break;case gt.pause:n.pauseDuration+=l,"-"!=n.pauseIntervalsAsString?n.pauseIntervalsAsString+=","+o.pauseStartStreamTime+":"+(a-o.pauseStartClockTime):n.pauseIntervalsAsString=o.pauseStartStreamTime+":"+(a-o.pauseStartClockTime),"-"!=n.pauseSeekSession?n.pauseSeekSession+=",R("+o.pauseStartStreamTime+":"+u+")":n.pauseSeekSession="R("+o.pauseStartStreamTime+":"+u+")",n.updatePlayed(o.pauseStartStreamTime,r),n.currentState.lastEventClockTime=a,++n.resumeBufferCount,o.state=gt.resumeBuffering;break;case gt.init:n.iLineSentTime||(n.iLineSentTime=a),!n.loadStartILine||n.canPlayEventAutoPlay||n.canPlayUpdated||(n.iLineSentTime=a,n.canPlayUpdated=!0)}}catch(e){st("Exception,  handle Play Event:"+e)}}function Mt(e,t){if(Et())st("handle Playing Event : video tag is of type AD, return");else try{var a=C(t);Ct(e,"playing",Jt(N),a);var i=parseInt(Gt(e)),n=e.akamai,r=n.currentState,s=a-r.lastEventClockTime,o=(n.startTimer,r.state);switch(st("entered function handle Playing Event, current State = "+vt(r.state)),o){case gt.rebuffering:if(!n.wasPutToSleep){n.rebufferTime+=s,n.curRebufferTime+=s,n.continuousRebufferDuration=0,n.rebufferSessionArrayHLine&&n.rebufferSessionArrayHLine.push(a);try{Ae(n,a),n.curRebufferTime=0}catch(e){st("Error...Play"+e.message)}}break;case gt.pause:case gt.resumeBuffering:n.resumeBufferTime+=s,0==s&&n.resumeBufferCount>0&&--n.resumeBufferCount;break;case gt.init:!function(e,t,a,i){try{st("start of the session function");var n=e.akamai;if(!n||!n.firstTimePlay)return;n.adLoadTime&&n.adLoadTime>n.iLineSentTime?(n.startupTime=n.adLoadTime-n.iLineSentTime,n.adEndTime&&(n.startupTime+=a-n.adEndTime)):n.startupTime=a-n.iLineSentTime,n.startupTime>K.startupTimeOutlierLimit&&(n.outlierStartupTime=n.startupTime,n.startupTime=0),n.bufferingTime=n.startupTime,n.startupTime,Yt(e);var r=Jt(e);E(r,n),n.streamUrl=r,null!=r&&""!=r&&(/.m3u8$/.exec(r)?(n.format="L",n.playerFormat=n.playerType+":"+n.format):(n.format="P",n.playerFormat=n.playerType+":"+n.format,n.deliveryType="O"),st("Creating hls stream"),n.stream=new hlsStream),StreamTypeDetector(r,c,d,(function(e){e&&(st("detected stream type = "+e.getStreamType()),st("Received steam type = "+e.getStreamType()+"\n Stream URL = "+e.getStreamURL()+"\n Stream Name = "+e.getStreamName()+"\n Stream Length = "+e.getStreamLength()+"\n Stream Format = "+e.getStreamFormat()+"\n Stream Delivery Type = "+e.getDeliveryType()),n.streamUrl=e.getStreamURL(),n.format=e.getStreamFormat(),n.deliveryType=e.getDeliveryType(),e.getStreamLength()&&(n.streamLength=e.getStreamLength()),n.streamName=e.getStreamName())}))!==streamError.NoError&&st("failed to detect stream. May be we do not have sufficient information"),n.streamLength=parseInt(Qt(e)),n.played=[];var s=parseInt(la("HTML_isPlayingCount"));ca("HTML_isPlayingCount",s+=1),Re(),G.viewerDiagnosticsEnabled&&xe(n,!0),n.lastSLineSentTime=a,nt(e,"playStart",!1,a),n.rebufferSessionArrayHLine=[],n.isSLineSent=!0,_&&Ue(e),St[1]=1,n.isFirstTitle=null,n.isVisitStart=null,n.firstTimePlay=!1,n.initPlayed(i)}catch(e){st("Exception, send S line:"+e)}}(e,0,a,i),he.currentStartPos=i;break;case gt.ended:st("handle Playing Event : dispatch play and playing event"),xt(e,a),Mt(e,a);break;case gt.playing:n.updatePlayClockTime(s,r.lastEventClockTime,a);break;case gt.seek:a-r.timeUpdateClockTime>0&&(ke(n,a,i,"S"),n.updatePlayed(r.seekStartStreamPos,i))}r.state=gt.playing,r.lastEventClockTime=a}catch(e){st("Exception,  handle Playing Event:"+e)}}function Bt(e,t){if(Et())st("handleWaitingEvent : video tag is of type AD, return");else try{var a=e.akamai;if(a.currentState.state==gt.rebuffering)return void st("already inside handleWaiting Event");var i=C(t),n=parseInt(Gt(e)),r=a.currentState,s=i-r.lastEventClockTime,o=(a.startTimer,r.state);switch(st("entered function handle Waiting Event, current state = "+vt(r.state)),o){case gt.playing:a.updatePlayClockTime(s,r.lastEventClockTime,i),++a.rebufferCount,1==a.rebufferCount&&"B"!=a.playerState&&(a.firstRebufferStartEpoch=Math.round(i)),a.rebufferSessionArrayHLine&&(st("handleWaitingEvent : pushing, rebufferSessionArrayHLine"+i),a.rebufferSessionArrayHLine.push(i)),a.updatePlayed(n),r.state=gt.rebuffering;break;case gt.pause:++a.resumeBufferCount,r.state=gt.resumeBuffering;break;case gt.init:}r.lastEventClockTime=i,st("handle waiting event, if seek starts, stream pos = "+n),r.seekStartStreamPos=n}catch(e){st("Exception,  handleWaitingEvent:"+e)}}function Dt(e){if(Et())st("handle Error Event : video tag is of type AD, return");else try{var t=C(),a=Jt(e),i=we(e);if(wt(e,"error",a,t))return void st("handle Error Event: consecutive error events thrown, return, curTime = "+t);e&&e.akamai&&!e.akamai.isILineSent&&(st("handle Error Event: calling handle Play Event"),xt(e,t)),Ct(e,"error",a,t);parseInt(Gt(e));var n=e.akamai,r=n.currentState,s=t-r.lastEventClockTime;n.startTimer,r.state;if(st("entered function handle Error Event, current state = "+vt(r.state)),r.state==gt.playing&&n.updatePlayClockTime(s,r.lastEventClockTime,t),n.isELineSent||n.isCLineSent)return;We(e,i,t),r.state=gt.ended;parseInt(la("HTML_LastCLineTime"));Lt(e),r.lastEventClockTime=t}catch(e){st("Exception,  handleErrorEvent:"+e)}}function Nt(e,t){if(Et())st("handle Ended Event WithDelay : video tag is of type AD, return");else try{var a=e.akamai,i=a.currentState;st("entered function handle Ended Event WithDelay, current state"+vt(i.state));var n=C(t),r=(Pe(e),n-i.lastEventClockTime);if(a.pollingTimer&&Oe(a.pollingTimer),ue&&ue.retryTimer&&Oe(ue.retryTimer),a.hLineTimer&&Oe(a.hLineTimer),a.fastTCPServerIpTimer&&Oe(a.fastTCPServerIpTimer),a.firstPLineTimer&&Oe(a.firstPLineTimer),ue&&ue.retryTimer&&Oe(ue.retryTimer),a.postRollTimer)return void st("handle Ended Event WithDelay: postRollTimer already started return");it(a,"complete"),at(a),et(a),a.postRollTimer=Ne(Ot,1e3,[e]),Ze(a),a.customDataPopulated=!0,Le(a,n),tt(e,r,n,!0),a.playEndMetricsUpdated=!0}catch(t){st("Exception,  handle Ended Event WithDelay"+t),Ot(e,n)}}function Ot(e,t){try{var a=e.akamai;if(a.postRollTimer&&(Oe(a.postRollTimer),delete a.postRollTimer),a.isELineSent||a.isCLineSent)return void st("handle Ended Event : already sent C line, return");var i=C(t),n=(parseInt(Gt(e)),a.currentState),r=i-n.lastEventClockTime;a.startTimer,n.state;st("entered function handle Ended Event, current state"+vt(n.state)),a.playEndMetricsUpdated||(tt(e,r,i,!0),a.playEndMetricsUpdated=!0),n.state=gt.ended;var s=Pe(e);null!=a.streamTitleSwitchReason&&""!=a.streamTitleSwitchReason&&(s=a.streamTitleSwitchReason),qe(e,s,!1,i);parseInt(la("HTML_LastCLineTime"));Lt(e),n.lastEventClockTime=i}catch(e){st("Exception,  handle Ended Event :"+e)}}function Ut(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;e&&e.type&&(N.akamai.connectivity=e.type)}function Ht(e){e&&e.coords&&(N.akamai.latitude=e.coords.latitude,N.akamai.longitude=e.coords.longitude)}function Vt(e){var t="";switch(e.code){case e.PERMISSION_DENIED:t="User denied the request for Geolocation.";break;case e.POSITION_UNAVAILABLE:t="Location information is unavailable.";break;case e.TIMEOUT:t="The request to get user location timed out.";break;case e.UNKNOWN_ERROR:t="An unknown error occurred."}st("Location Error : ",t)}function _t(e,t){try{if(N&&N.akamai&&N.akamai.isSLineSent?st("setData() API called after 'Start Of Play' for dimension -> "+e+"|All custom dimensions should be set before the play is initiated.","WARN"):st("setData("+e+":"+t+")","API"),"customDataObject"==e)Ft(t);else if("customDataFunction"==e)M=t;else{try{null!=t&&(t=t.trim())}catch(e){}"viewerId"!=e&&"viewerDiagnosticsId"!=e||null!=t&&""!=t||(t="-");try{_&&"_cd_"==e.substring(0,4)&&Se(e)}catch(e){}try{-1!=e.indexOf("std:")?x[e.substring(4)]=t:R[e]=t}catch(a){R[e]=t}-1==e.indexOf("socialShare:")&&-1==e.indexOf("feedback:")||jt()}}catch(e){st("Exception, Set Data :"+e)}}function Ft(e){try{if("object"==typeof e)for(var t in e)_t(t,e[t])}catch(e){st("Exception set custom data object"+e)}}function jt(){try{var e="feedback:",t=e.length,a=!1,i=C();for(var n in R)if(-1!=n.indexOf(e)){var r=n.substring(t);R[r]=R[n],delete R[n],a=!0}!function(){try{var e="socialShare:",t=e.length,a=ne.socialSharingObj;for(var i in R)-1!=i.indexOf(e)&&(i in ne.dataSent?ne.dataSent[i].count<ne.socialShareLimit&&(++ne.dataSent[i].count,null==a?a[i.substring(t)]=R[i]:i.substring(t)in a?a[i.substring(t)]=parseInt(a[i.substring(t)])+parseInt(R[i]):a[i.substring(t)]=R[i]):(ne.dataSent[i]={},ne.dataSent[i].value=R[i],ne.dataSent[i].count=1,a[i.substring(t)]=R[i]),delete R[i]);ne.socialSharingObj=a}catch(e){st("Exception,  getFeedbackObj"+e),ne.socialSharing=null}}(),st("handleFeedbackEvent"),ne&&ne.shouldSendFLine&&ne.akamai&&(ne.akamai.isCLineSent||ne.akamai.postRollTimer)&&(a&&(ne.akamai.customDataChanged=!0),ne.fLineCount<ne.limit&&nt(ne,"feedback",!1,i),++ne.fLineCount,ne.akamai.customDataChanged=!1,ne.akamai.socialSharing=null)}catch(e){st("Exception, handle feed back event :"+e)}}function qt(e){if(!Et())try{if(U)return void st("handle time update event, return as inside background state for idevice");var t=C(null),a=parseInt(Gt(e)),i=e.akamai;if(!i)return;if(i.postRollTimer)return;var n=i.currentState,r=(n.lastEventClockTime,i.startTimer,n.state,a-n.timeUpdateStreamTime);0!=n.timeUpdateStreamTime&&(Math.abs(r)>=K.seekThreshold&&i.isSLineSent?(st("stream diff in time update is "+r),function(e,t,a){if(Et())st("handle Seeked Event : video tag is of type AD, return");else try{t||(t=C()),a||(a=parseInt(Gt(e)));var i=e.akamai,n=i.currentState,r=t-n.lastEventClockTime,s=(i.startTimer,n.state);if(st("entered function handle Seeked Event, currentstate = "+vt(n.state)),s==gt.pause||s==gt.playing||s==gt.rebuffering||n.state==gt.seek)switch(t-n.timeUpdateClockTime>0&&ke(i,t,a,"S"),s){case gt.playing:i.updatePlayed(n.timeUpdateStreamTime,a),n.lastEventClockTime=t,i.updatePlayClockTime(r,n.lastEventClockTime,t),n.state=gt.seek,n.seekStartStreamPos=a;break;case gt.rebuffering:if(i.wasPutToSleep)st("Rejecting this event, because rebuffer was caused by system sleep");else{st("handle seeked event, previous state is rebuffering"),i.rebufferTime+=r,i.curRebufferTime+=r,i.rebufferSessionArrayHLine&&i.rebufferSessionArrayHLine.push(t);try{Ae(i,t),i.curRebufferTime=0}catch(e){st("Error...Play"+e.message)}n.lastEventClockTime=t,n.state=gt.seek}}}catch(e){st("Exception,  handle Seeked Event :"+e)}}(e,t,a)):r>0&&r<=750&&(e.objectBased?n.state==gt.seek&&Mt(e):i.isSLineSent&&n.state!=gt.seek&&n.state!=gt.rebuffering||(st("handle time update event,  dispatching playing event,  current Video state is : "+vt(n.state)),Mt(e)))),n.timeUpdateClockTime=t,n.timeUpdateStreamTime=a}catch(e){st("Exception,  handleTimeupddate :"+e)}}function Wt(e,t){try{var a=document.createElement("script");a.setAttribute("src",e),a.id=t,document.getElementsByTagName("head")[0].appendChild(a)}catch(t){st("Exception,  loading JavaScript File "+e)}}function zt(e){try{var t=document.getElementById(e);t.parentNode.removeChild(t)}catch(t){st("Exception,  removing script with id "+e)}}function Xt(e){var t;(t=e.akamai).pollingTimer=Ne(Xt,$,[e]);var a=Date.now();t.chasingSleep>0&&a>t.chasingSleep+5e3&&(!function(e){At(),he.clearBitRate(),akamai=e.akamai,!e.objectBased&&akamai.pollingTimer&&Oe(akamai.pollingTimer);ue&&ue.retryTimer&&Oe(ue.retryTimer);akamai.hLineTimer&&Oe(akamai.hLineTimer);akamai.fastTCPServerIpTimer&&Oe(akamai.fastTCPServerIpTimer);akamai.firstPLineTimer&&Oe(akamai.firstPLineTimer);ue&&ue.retryTimer&&Oe(ue.retryTimer);akamai.postRollTimer&&(Oe(akamai.postRollTimer),delete akamai.postRollTimer);akamai.currentState.state=gt.ended,akamai.isILineSent=!1,akamai.isSLineSent=!1,akamai.firstTimePlay=!0,akamai.iLineSentTime=0,akamai.lastPlayStreamTime=0}(e),t.wasPutToSleep=!0),t.chasingSleep=a,e&&(e.isBrightcoveVideo?akamaiBCVideoModule.getVideoPosition(!1,Kt):Kt(0,e))}function Kt(e,t){var a,i;C(null);if(null!=N&&N.isBrightcoveVideo?(N.currentTime=parseInt(e),i=parseInt(1e3*e),t=N):i=parseInt(Gt(t)),"undefined"!=i&&!isNaN(i)&&""!=i){var n=(a=t.akamai).currentState;if(n.state!=gt.ended)if(t.objectBased&&!0===a.wasPutToSleep&&i===n.pollingTimerStreamTime)a.pollingTimer&&Oe(a.pollingTimer),xt(N),Mt(N);else if(t.objectBased)qt(t);else{if(n.state==gt.pause||n.state==gt.seek)return;0!=i&&i===n.pollingTimerStreamTime&&n.state!=gt.rebuffering?(st("check stream head position, call handle waiting event"),Bt(t)):n.pollingTimerStreamTime=i}}}function Gt(t){var a=0;try{t.objectBased?e&&e.streamHeadPosition&&(a=e.streamHeadPosition(),t.currentTime=a):O.currentTime&&(a=O.currentTime,t.currentTime=a)}catch(e){}return 0==a&&-1!=se&&(a=se),0!=a&&(se=a),1e3*a}function Qt(t){var a=0;try{t&&(t.objectBased?e&&e.streamLength&&(a=e.streamLength(),t.duration=a):(a=O.duration,t.duration=a))}catch(e){}return 1e3*a}function Jt(t){var a="";try{t&&(t.objectBased?e&&e.streamURL&&(a=e.streamURL(),t.currentSrc=a):R.streamURL?a=R.streamURL:-1===(a=O.currentSrc).indexOf("blob:")?t.currentSrc=a:(a="",st("Call akamaiSetStreamURL() to set streamUrl","Error")))}catch(e){}return a}function Yt(e){try{null!=M&&Ft(M())}catch(e){}}function $t(e,t){try{st("handle Ad loaded"),me.isAdLoaded&&st("handleAdLoaded API is called multiple times.|We have identified that 2 successive handleAdLoaded APIs are called.|Kindly ensure that sequence of Ad calls -- handleAdLoaded->handleAdStarted->handleAdComplete is maintained.","WARN");var a=N.akamai;if(!a.isILineSent)(new Date).getTime();var i=C(t);me.clearAdAnalytics(),me.isAdLoaded=!0,me.adLoadTime=i,me.adCount=1,me.adAbandoned=!0,a.postRollTimer?(He(N),Oe(a.postRollTimer),a.postRollAd=!0,a.customDataPopulated=!1,me.type=2):a.isILineSent&&(a.isSLineSent?(Pt(N,i),me.type=1):a.isSLineSent||a.adLoadTime||(a.adLoadTime=i)),Zt(e),a.isILineSent||function(e,t){try{var a=N.akamai;if(a.clearVisitTimeoutId&&Oe(a.clearVisitTimeoutId),Ve(N),a.logInterval="0",_)$e(a,"init",e);else{var i={element:rt(a),code:"init",synch:e};F.push(i)}a.lastLogTime=t,++a.sequenceId,_e(N,t),a.currentState.state=gt.init,st(": sendBeaconILineAd : Setting state to init"),a.currentState.timeUpdateClockTime=t,a.startTimer=t}catch(e){st("Exception, send I line AD:"+e)}}(!1,i)}catch(e){st("Exception,handle ad loaded:"+e)}}function Zt(e){try{var t=me.setDataArr;st("populate ad metric");for(var a=0;a<t.length;a++)t[a]in e&&(me[t[a]]=e[t[a]])}catch(e){}}function ea(e,t){try{var a=C(t),i=N.akamai;me.endStatus=e,"0"!=e&&(me.adAbandonCount=1),me.isAdLoaded&&me.isAdStarted&&(me.adPlayClockTime=a-me.adStartTime),me.adSession=function(){var e="",t=["adId","type","startPos","adStartupTime","adPlayClockTime","playBucket","endStatus","adDuration","adTitle","adCategory","adPartnerId","adServer","adDaypart","adIndustryCategory","adEvent"];try{for(var a=0;a<t.length;a++)0==me[t[a]]||null!=me[t[a]]&&""!=me[t[a]]?e+=me[t[a]]+":":e+=":";e=e.substring(0,e.length-1)}catch(e){}return e}();for(var n=["adStartupTime","adCount","adPlayClockTime","adAbandonCount"],r=0;r<n.length;r++)i[n[r]]+=me[n[r]];i.adSession?i.adSession+=","+me.adSession:i.adSession=me.adSession,me.isAdStarted=!1,me.isAdLoaded=!1,"2"!=e&&(me.adAbandoned=!1,i&&(i.postRollAd?(i.postRollAd=null,Ot(N,a)):i.isSLineSent?(xt(N,a),Mt(N,a)):i.isSLineSent||(i.adEndTime=a)))}catch(e){st("Exception,populate ad end:"+e)}}function ta(e){st("subscribeToEvents : video = "+e);O=e;try{e.addEventListener("play",V.play=function(){xt(N)},!1),e.addEventListener("pause",V.pause=function(){Pt(N)},!1),e.addEventListener("error",V.error=function(){Dt(N)},!1),e.addEventListener("ended",V.ended=function(){Nt(N)},!1),e.addEventListener("playing",V.playing=function(){Mt(N)},!1),e.addEventListener("waiting",V.waiting=function(){Bt(N)},!1),e.addEventListener("timeupdate",V.timeupdate=function(){qt(N)},!1),e.addEventListener("load",V.load=function(){!function(e){try{if(Et())return;e.akamai.firstTimeProgress}catch(e){}}(N)},!1),e.addEventListener("progress",V.progress=function(){!function(e){try{if(Et())return;var a=e.akamai;a.firstTimeProgress&&(a.firstTimeProgress=!1,akaMediaAnalytics.getShouldAnalyze()&&setTimeout((function(e){e.setDiagnoserWindowLoaded(!0),e.processLogs({api:"setConfigXML",value:AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH});var a="";a+=!0===N.objectBased?"JS-":"HTML5-",a+=t,e.processLogs({api:"setCurrentVersion",value:a}),e.processLogs({api:"setCustomDimension",value:x}),e.processLogs({api:"reportSetupParams",value:AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH}),e.processLogs({api:"reportSetupParams",value:K.beaconUrl.toLowerCase()}),e.processLogs({api:"reportSetupParams",value:n})}),3e3,akaMediaAnalytics)),a.logType}catch(e){}}(N)},!1),e.addEventListener("durationchange",V.durationchange=function(){!function(e){try{if(Et())return;e.akamai.streamLength=parseInt(Qt(e))}catch(e){}}(N)},!1),e.addEventListener("canplay",V.canplay=function(){!function(e){try{if(Et())return;var t=e.akamai;O.autoplay?t.canPlayEventAutoPlay=!0:t.canPlayEventAutoPlay=!1}catch(e){}}(N)},!1),e.addEventListener("loadstart",V.loadstart=function(){!function(e){try{if(Et())return;var t=e.akamai;O.autoplay&&(xt(e),t.loadStartILine=!0)}catch(e){}}(N)},!1),st("subscribed to events completed")}catch(e){st("Exception,  subscribeToEvents,unable to add listeners to video tag :"+e)}}function aa(e){try{if("undefined"!=typeof akamaiBCVideoObject)O=akamaiBCVideoObject,N.isBrightcoveVideo=!0,initBrightcove();else if(N.objectBased||N.videoPassed);else if(document){var t=document.getElementsByTagName("video");st("add MediaEvent Listeners : videos.length "+t.length),t&&0==t.length&&(t=document.getElementsByTagName("audio"));for(var a=0;a<t.length;++a)ta(t[a]);document.addEventListener("DOMNodeInserted",ia,!1),document.addEventListener("DOMNodeRemoved",ia,!1),document.addEventListener("DOMAttrModified",ia,!1)}e&&("DOMContentLoaded"==e.type||"load"==e.type&&t&&t.length>0)&&document.removeEventListener("load",aa,!0)}catch(e){st("Exception,  add MediaEvent Listeners :"+e)}}function ia(e){var t=e.target;if(t.nodeType!=t.COMMENT_NODE&&null!=t.tagName&&("video"==t.tagName.toLowerCase()||"audio"==t.tagName.toLowerCase()))switch(e.type){case"DOMNodeRemoved":t.dataset&&t.dataset.isad&&"true"==t.dataset.isad||na(N,0);break;case"DOMNodeInserted":ta(t)}}function na(e,t){st("handle Video Unload");var a=C(),i=e.akamai,n=parseInt(la("HTML_VisitCountCookie"));j.browserClose=!0;try{if(i&&i.currentState.state>=gt.init&&0==t){if(i.isELineSent||i.isCLineSent)return;if(me&&me.adAbandoned){var r="Ad.Abandon";i.postRollTimer&&(Oe(i.postRollTimer),delete i.postRollTimer),qe(e,r,!0,a)}else if(i.firstTimePlay){var s="Browser.Refresh.NoStart";a-i.startTimer>K.initBrowserCloseTime&&(s="Browser.Refresh.NoStart.Late"),We(e,s,!0,a)}else{r="Browser.Close";i.postRollTimer&&(Oe(i.postRollTimer),delete i.postRollTimer),qe(e,r,!0,a)}}}catch(e){}try{var o=parseInt(la("HTML_LastCLineTime"))+K.visitTimeout-a,l=parseInt(la("HTML_isPlayingCount"));if(st("handle Video Unload: playing cookie =  "+l+", visit cookie :"+n),n>=1&&1==t){if(o>0)return Oe(i.clearVisitTimeoutId),void(e.akamai.clearVisitTimeoutId=Ne(na,o,[e,1]));if(o<=0&&n>1&&l>0)return Oe(i.clearVisitTimeoutId),void(e.akamai.clearVisitTimeoutId=Ne(na,K.visitTimeout,[e,1]))}st("handle Video Unload: decrementing HTML_VisitCountCookie"),ca("HTML_VisitCountCookie",n-=1),(0===(n=parseInt(la("HTML_VisitCountCookie")))||isNaN(n))&&i.sendVLine&&ze(e,a)}catch(e){}}function ra(){try{me.isAdLoaded&&ea("2")}catch(e){}na(N,0)}function sa(e){st("handlePagehide"),U=!0,ra()}function oa(e){st("handlePageshow:");try{N&&N.tagName&&(st("handlePageShow: media tag is :"+N.tagName),N.akamai&&U&&(st("handlePageshow: send play and playing on timeupdate"),!0))}catch(e){st("Exception,  handlePagehsow : "+e)}U=!1}function la(e){var t=e+"=",a="";try{document.cookie.length>0&&(offset=document.cookie.indexOf(t),-1!=offset&&(offset+=t.length,end=document.cookie.indexOf(";",offset),-1==end&&(end=document.cookie.length),a=document.cookie.substring(offset,end)))}catch(e){}return a}function da(e){try{var t=location.pathname.split("/"),a=" path=";document.cookie=e+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT;";for(var i=0;i<t.length;i++)a+=("/"!=a.substr(-1)?"/":"")+t[i],document.cookie=e+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT;"+a+";"}catch(e){}}function ca(e,t,a){try{var i=e+"="+t+";Path=/;";if(a&&parseInt(a)>0){var n=new Date;n.setDate(n.getDate()+parseInt(a)),null!=n&&(i+="expires="+n.toUTCString()+";")}document&&(document.cookie=i)}catch(e){}}function ua(e,t){try{if(null!=e&&null!=t){var a=e[function(e){dimension="","viewerInterval"===e?dimension="viewerId":"viewerTitleInterval"===e&&(dimension="title");return dimension}(t.name)],i=I.SHA1(a).toString(),n=function(e){try{var t=window.localStorage.getItem(e);if(null!=t)return JSON.parse(t).value}catch(e){}}(i),r=0,s=C();n&&(r=(r=(r=s-parseFloat(n))/1e3/60)>0?r.toFixed(2):0),function(e,t,a){try{var i={value:t};if(null!=a){var n=new Date;parseInt(a)>0?n.setDate(n.getDate()+parseInt(a)):n.setDate(n.getDate()+parseInt(90)),i.expiryDate=n.toDateString()}window.localStorage.setItem(e,JSON.stringify(i))}catch(e){}}(i,s,t.expiryDuration),e[t.name]=r.toString()}}catch(e){st("Exception,  calculateUniqueDimension :"+e)}}this.getViewerId=function(){try{var e=N.akamai;return e&&e.viewerId?e.viewerId:null}catch(e){return null}},this.setData=function(e,t){if(_t(e,t),u&&N.objectBased){var a={methodName:"setData"};a[e]=t,this.processLogs({api:"reportAPI",value:a})}},this.handleStreamSwitch=function(){if(function(e){N.akamai.streamTitleSwitchReason="Stream.Switched",Ot(N,e)}(),u&&N.objectBased){st("handleStreamSwitch()","API");this.processLogs({api:"reportAPI",value:{methodName:"handleStreamSwitch"}})}},this.handleTitleSwitch=function(e){if(function(e,t){N.akamai.streamTitleSwitchReason="Title.Switched";var a=N.akamai.isFirstTitle;Ot(N,t);try{if(null!=e&&""!=e)for(var i in e)_t(i,e[i])}catch(e){st("Exception, handle title switch:"+e)}N.akamai.isFirstTitle=a,xt(N,t),Mt(N,t);try{N.akamai.currentState.timeUpdateStreamTime=parseInt(Gt(N))}catch(e){st("Exception,  handleTitleSwitch"+e)}}(e),u&&N.objectBased){st("handleTitleSwitch()","API");var t={methodName:"handleTitleSwitch",customData:e};this.processLogs({api:"reportAPI",value:t},m)}},this.handleFeedbackEvent=function(){jt()},this.handleApplicationExit=function(){if(function(){try{N.objectBased||(st("application exit, unsubscribe video events"),function(e){try{e.removeEventListener("play",V.play,!1),e.removeEventListener("pause",V.pause,!1),e.removeEventListener("error",V.error,!1),e.removeEventListener("ended",V.ended,!1),e.removeEventListener("playing",V.playing,!1),e.removeEventListener("waiting",V.waiting,!1),e.removeEventListener("timeupdate",V.timeupdate,!1),e.removeEventListener("load",V.load,!1),e.removeEventListener("progress",V.progress,!1),e.removeEventListener("durationchange",V.durationchange,!1),e.removeEventListener("canplay",V.canplay,!1),e.removeEventListener("loadstart",V.loadstart,!1)}catch(e){st("Exception, unSubscribeFrom Events:"+e)}}(N))}catch(e){}ra()}(),u&&N.objectBased){st("handleApplicationExit()","API");this.processLogs({api:"reportAPI",value:{methodName:"handleApplicationExit"}})}},this.enableServerIpLookUp=function(){if(s=!0,u&&N.objectBased){st("enableServerIpLookUp()","API");this.processLogs({api:"reportAPI",value:{methodName:"enableServerIpLookUp"}})}},this.disableServerIpLookUp=function(){if(s=!1,u&&N.objectBased){st("disableServerIpLookUp()","API");this.processLogs({api:"reportAPI",value:{methodName:"disableServerIpLookUp"}},m)}},this.enableLocation=function(e){if(function(e){if(e){if(navigator.geolocation&&null==r){r=navigator.geolocation.watchPosition(Ht,Vt);var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection;t&&t.type&&(N.akamai.connectivity=t.type,t.addEventListener("typechange",Ut))}}else navigator.geolocation&&null!=r&&(navigator.geolocation.clearWatch(r),r=null,t.removeEventListener("typechange",Ut))}(e),u&&N.objectBased){st("enableLocation("+e+")","API");var t={methodName:"enableLocation",enable:e};this.processLogs({api:"reportAPI",value:t})}},this.enableManifestRequest=function(e){d=e},this.setURLManifest=function(e){c=e},this.handleSessionInit=function(a,i){try{if(a&&("object"!=typeof e&&(e={}),a.streamHeadPosition&&(e.streamHeadPosition=a.streamHeadPosition),a.streamLength&&(e.streamLength=a.streamLength),a.streamURL&&(e.streamURL=a.streamURL),a.bytesLoaded&&(e.bytesLoaded=a.bytesLoaded),a.customDataFunction&&(e.customDataFunction=a.customDataFunction),e.customDataFunction&&(M=e.customDataFunction),a.firstBitRate&&(e.firstBitRate=a.firstBitRate),e.firstBitRate&&Rt(e.firstBitRate,i)),u&&N.objectBased){setTimeout((function(e){e.setDiagnoserWindowLoaded(!0),e.processLogs({api:"setConfigXML",value:AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH});var a="";a+=!0===N.objectBased?"JS-":"HTML5-",a+=t,0!=o.length&&0!=l.length&&(a+=":",a+=o,a+="-",a+=l),e.processLogs({api:"setCurrentVersion",value:a}),e.processLogs({api:"setCustomDimension",value:x}),e.processLogs({api:"reportSetupParams",value:AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH}),e.processLogs({api:"reportSetupParams",value:K.beaconUrl.toLowerCase()}),e.processLogs({api:"reportSetupParams",value:n})}),3e3,this),st("handleSessionInit()","API");var r={methodName:"handleSessionInit",callback:a};void 0!==i&&(r.epochTime=i),self.processLogs({api:"reportAPI",value:r},m)}xt(N,i)}catch(e){}},this.handleBitRateSwitch=function(e,t){if(Rt(e,t),u&&N.objectBased){st("handleBitRateSwitch("+e+")","API");var a={methodName:"handleBitRateSwitch",bitRate:e};void 0!==t&&(a.epochTime=t),this.processLogs({api:"reportAPI",value:a})}},this.handlePlaying=function(e){if(xt(N,e),Mt(N,e),u&&N.objectBased){st("handlePlaying()","API");var t={methodName:"handlePlaying"};void 0!==e&&(t.epochTime=e),this.processLogs({api:"reportAPI",value:t},m)}},this.handlePlayEnd=function(e,t){if(N.objectBased&&(N.endReason=e),Nt(N,t),u&&N.objectBased){st("handlePlayEnd("+e+")","API");var a={methodName:"handlePlayEnd",endReasonCode:e};"undefined"!=typeof bitRateSwitchEpochTime&&(a.epochTime=t),this.processLogs({api:"reportAPI",value:a})}},this.handleMediaChangedEvent=function(){Ot(N)},this.handlePause=function(e){if(Pt(N,e),u&&N.objectBased){st("handlePause()","API");var t={methodName:"handlePause"};void 0!==e&&(t.epochTime=e),this.processLogs({api:"reportAPI",value:t},m)}},this.handleResume=function(e){if(xt(N,e),Mt(N,e),u&&N.objectBased){st("handleResume()","API");var t={methodName:"handleResume"};void 0!==e&&(t.epochTime=e),this.processLogs({api:"reportAPI",value:t})}},this.handleBufferStart=function(e){if(Bt(N,e),u&&N.objectBased){st("handleBufferStart()","API");var t={methodName:"handleBufferStart"};void 0!==e&&(t.epochTime=e),this.processLogs({api:"reportAPI",value:t},m)}},this.handleBufferEnd=function(e){if(xt(N,e),Mt(N,e),u&&N.objectBased){st("handleBufferEnd()","API");var t={methodName:"handleBufferEnd"};void 0!==e&&(t.epochTime=e),this.processLogs({api:"reportAPI",value:t})}},this.handleError=function(e){try{if(N.objectBased?N.errorReason=e:N.externalError=e,Dt(N),u&&N.objectBased){st("handleError("+e+")","API");var t={methodName:"handleError",errorReason:e};this.processLogs({api:"reportAPI",value:t},m)}}catch(e){}},this.handleTimeupdateEvent=function(){qt(N)},this.updateAdObject=function(e){Zt(e)},this.handleAdLoaded=function(e,t){try{if($t(e,t),u&&N.objectBased){st("handleAdLoaded()","API");var a={methodName:"handleAdLoaded",adSetDataObj:e};void 0!==t&&(a.epochTime=t),this.processLogs({api:"reportAPI",value:a})}}catch(e){}},this.handleAdStarted=function(e,t){if(function(e,t){try{st("handle Ad Started");var a=C(t);me.isAdStarted=!0,me.isAdLoaded||(st("handleAdLoaded API is missing.|We have identified that handleAdStarted API is called without handleAdLoaded.|Kindly ensure that handleAdLoaded API is called for every Ad and relevant adObject is passed as an argument.","WARN"),$t(e,a)),me.playBucket="0",me.adStartTime=a,me.adStartupTime=a-me.adLoadTime,me.startPos=Gt(N),Zt(e)}catch(e){st("Exception,handle ad started:"+e)}}(e,t),u&&N.objectBased){st("handleAdStarted()","API");var a={methodName:"handleAdStarted",adSetDataObj:e};void 0!==t&&(a.epochTime=t),this.processLogs({api:"reportAPI",value:a},m)}},this.handleAdCompleted=function(e){if(function(e){try{st("handleAdEnded"),"0"==me.playBucket&&st("Ad Progress related APIs not called.|We have identified that handleAdFirstQuartile,handleAdMidPoint & handleAdThirdQuartile APIs have not been called.|It will be good if these APIs are called in order to capture more accurate Ad information","WARN"),me.playBucket="4",ea("0",e)}catch(e){st("Exception,handle ad completed:"+e)}}(e),u&&N.objectBased){st("handleAdCompleted()","API");var t={methodName:"handleAdCompleted"};void 0!==e&&(t.epochTime=e),this.processLogs({api:"reportAPI",value:t})}},this.handleAdFirstQuartile=function(){if(function(){me.isAdStarted||st("handleAdStarted API is missing.|We have identified that handleAdFirstQuartile API is called without handleAdStarted.|Kindly ensure that handleAdStarted API is called for every Ad that starts successfully.","ERROR");me.playBucket="1"}(),u&&N.objectBased){st("handleAdFirstQuartile()","API");this.processLogs({api:"reportAPI",value:{methodName:"handleAdFirstQuartile"}},m)}},this.handleAdMidPoint=function(){if(me.playBucket="2",u&&N.objectBased){st("handleAdMidPoint()","API");this.processLogs({api:"reportAPI",value:{methodName:"handleAdMidPoint"}})}},this.handleAdThirdQuartile=function(){if(me.playBucket="3",u&&N.objectBased){st("handleAdThirdQuartile()","API");this.processLogs({api:"reportAPI",value:{methodName:"handleAdThirdQuartile"}},m)}},this.handleAdStopped=function(e){if(function(e){ea("1",e)}(e),u&&N.objectBased){st("handleAdStopped()","API");var t={methodName:"handleAdStopped"};void 0!==e&&(t.epochTime=e),this.processLogs({api:"reportAPI",value:t})}},this.handleAdError=function(e){if(function(e){ea("3",e)}(e),u&&N.objectBased){st("handleAdError()","API");var t={methodName:"handleAdError"};void 0!==e&&(t.epochTime=e),this.processLogs({api:"reportAPI",value:t},m)}},this.handleSetupAISEvent=function(e,t,a){!function(e,t,a){try{var i=ue.aisRequestLimit,n=ue.aisRequestInterval;if((ue=new ce).aisRequestInterval=n,ue.aisRequestLimit=i,!e)return void st("return from ais, platform is null");ue.platform=e,ue.version=t||"1.0",a&&(ue.aisCustomDataObj=a),ue.requestUrl="http://idp.securetve.com/rest/",ue.initUrl=ue.requestUrl+ue.version+"/"+ue.platform+"/init/?format=jsonp&responsefield=akaMediaAnalytics.receiveAISInitRequest",ue.identityUrl=ue.requestUrl+ue.version+"/"+ue.platform+"/identity/?format=jsonp&responsefield=akaMediaAnalytics.receiveAISIdentityRequest",ue.initUrlId="AkamaiAISInitUrl",ue.identityUrlId="AkamaiAISIdentityUrl",Wt(ue.initUrl,ue.initUrlId)}catch(e){ue.requestFailed=!0}}(e,t,a)},this.getStream=function(){return N.akamai.stream},this.getChildWindow=function(){return h},this.setDiagnoserWindowLoaded=function(e){g=e},this.isDiagnoserWindowLoaded=function(){return g},this.getHostedUrl=function(){return m},this.pushToMessageStore=function(e){p.push(e)},this.getMessageStoreLength=function(){return p.length},this.flushMessageStore=function(){p=[]},this.getStoredMessageAt=function(e){return p[e]},this.getShouldAnalyze=function(){return u},this.processLogs=function(e){try{if(this.isDiagnoserWindowLoaded()){var t=this.getMessageStoreLength(),a=this.getChildWindow();if(a){if(t>0){for(i=0;i<t;i++)a.postMessage(this.getStoredMessageAt(i),this.getHostedUrl());this.flushMessageStore()}a.postMessage(e,this.getHostedUrl())}}else this.pushToMessageStore(e)}catch(e){}},this.receiveAISInitRequest=function(e){try{if(ue.initObj=e,zt(ue.initUrlId),""==ue.initObj||null==ue.initObj)return void(ue.requestFailed=!0);if(ue.requestFailed)return;if(ue.initObj.authenticated){if(ue.akamai={},ue.akamai.ais_queryToken=ue.initObj.querytoken,ue.initObj.idps){var t=ue.initObj.idps;for(var a in t)ue.akamai.ais_idpId=a,ue.akamai.ais_idpName=t[a].name,ue.akamai.ais_idpDisplayName=t[a].display_name,ue.akamai.ais_idpUrl=t[a].url}Wt(ue.identityUrl,ue.identityUrlId)}else ue.requestFailed||(st("receiveAISInitRequest, retrying the request"),++ue.aisRetries,ue.aisRetries<ue.aisRequestLimit&&(ue.retryTimer=Ne(Wt,ue.aisRequestInterval,[ue.initUrl,ue.initUrlId])))}catch(e){ue.requestFailed=!0}},this.receiveAISIdentityRequest=function(e){try{if(ue.identityObj=e,zt(ue.identityUrlId),null==e||""==e)return;ue.akamai||(ue.akamai={}),e.indentity&&e.identity.aisuid&&(ue.akamai.ais_aisuid=e.identity.aisuid),function(){var e,t,a={};try{if(ue&&ue.aisCustomDataObj)for(var i in ue.akamai||(ue.akamai={}),ue.aisCustomDataObj)if("INIT"==(e=ue.aisCustomDataObj[i].split("/"))[0]&&ue.initObj?a=ue.initObj:"IDENTITY"==e[0]&&ue.identityObj&&(a=ue.identityObj),a){for(t=1;t<e.length;t++)e[t]&&a[e[t]]&&(a=a[e[t]]);"object"!=typeof a&&(ue.akamai[i]=a)}}catch(e){st("Exception,  populateAISCustomData"+e)}}()}catch(e){ue.requestFailed=!0}},this.subscribeVideoObject=function(e){try{e&&ta(e)}catch(e){}},function(){try{N.objectBased||N.videoPassed?aa():(st("adding MediaEventListeners: DOMContentLoaded"),document.addEventListener("DOMContentLoaded",aa,!1),st("adding MediaEventListeners: Load"),document.addEventListener("load",aa,!0))}catch(e){st("Exception,  Addding DOMContentLoaded and Load event listeners :"+e)}if(window)if(function(){try{if("iPad"==ct||"iPhone"==ct)return!0}catch(e){return!1}}())window.addEventListener("pagehide",sa,!1),window.addEventListener("pageshow",oa,!1);else if("undefined"!=typeof akamaiBCVideoObject&&window.addEventListener)window.addEventListener("beforeunload",ra,!1);else if(window.addEventListener)try{ge()?window.parent.addEventListener("beforeunload",ra,!1):window.addEventListener("beforeunload",ra,!1)}catch(e){st("Exception, add window document listeners : "+e),window.addEventListener("beforeunload",ra,!1)}else if(window.attachEvent)try{ge()?window.parent.attachEvent("onbeforeunload",ra):window.attachEvent("onbeforeunload",ra)}catch(e){window.attachEvent("onbeforeunload",ra)}}()}function setAkamaiMediaAnalyticsData(e,t,a){try{if(akaMediaAnalytics&&(akaMediaAnalytics.setData(e,t),akaMediaAnalytics.getShouldAnalyze())){var i={methodName:"setAkamaiMediaAnalyticsData"};i[e]=t,akaMediaAnalytics.processLogs({api:"reportAPI",value:i})}}catch(e){}}function akamaiPlaybackCompleted(){try{if(akaMediaAnalytics&&(akaMediaAnalytics.handlePlayEnd(),akaMediaAnalytics.getShouldAnalyze())){var e={methodName:"akamaiPlaybackCompleted",endReasonCode:endReason};akaMediaAnalytics.processLogs({api:"reportAPI",value:e})}}catch(e){}}function akamaiGetViewerId(){try{var e=null;akaMediaAnalytics&&(e=akaMediaAnalytics.getViewerId())}catch(e){}return e}function akamaiSetStreamURL(e,t){try{null!=e&&""!=e&&setAkamaiMediaAnalyticsData("streamURL",e),akaMediaAnalytics&&void 0!==t&&akaMediaAnalytics.enableManifestRequest(t)}catch(e){}}function akamaiSetURLManifest(e){try{akaMediaAnalytics&&akaMediaAnalytics.setURLManifest(e)}catch(e){}}function akamaiSetViewerId(e){if(null!=e&&""!=e||(e="-"),akaMediaAnalytics&&(akaMediaAnalytics.setData("viewerId",e),akaMediaAnalytics.setData("clientId",e),akaMediaAnalytics.getShouldAnalyze())){var t={methodName:"akamaiSetViewerId"};t.viewerId=e,akaMediaAnalytics.processLogs({api:"reportAPI",value:t})}}function akamaiSetViewerDiagnosticsId(e){if(null!=e&&""!=e||(e="-"),akaMediaAnalytics&&(akaMediaAnalytics.setData("viewerDiagnosticsId",e),akaMediaAnalytics.getShouldAnalyze())){var t={methodName:"akamaiSetViewerDiagnosticsId"};t.viewerDiagnosticsId=e,akaMediaAnalytics.processLogs({api:"reportAPI",value:t})}}function akamaiUpdateAdObject(e){akaMediaAnalytics&&akaMediaAnalytics.updateAdObject(e)}function akamaiHandleAdStarted(e){if(akaMediaAnalytics&&(akaMediaAnalytics.handleAdStarted(e),akaMediaAnalytics.getShouldAnalyze())){var t={methodName:"akamaiHandleAdStarted",adSetDataObj:e};akaMediaAnalytics.processLogs({api:"reportAPI",value:t})}}function akamaiHandleAdCompleted(){if(akaMediaAnalytics&&(akaMediaAnalytics.handleAdCompleted(),akaMediaAnalytics.getShouldAnalyze())){akaMediaAnalytics.processLogs({api:"reportAPI",value:{methodName:"akamaiHandleAdCompleted"}})}}function akamaiHandleAdLoaded(e){if(akaMediaAnalytics&&(akaMediaAnalytics.handleAdLoaded(e),akaMediaAnalytics.getShouldAnalyze())){var t={methodName:"akamaiHandleAdLoaded",adSetDataObj:e};akaMediaAnalytics.processLogs({api:"reportAPI",value:t})}}function akamaiHandleAdFirstQuartile(){if(akaMediaAnalytics&&(akaMediaAnalytics.handleAdFirstQuartile(),akaMediaAnalytics.getShouldAnalyze())){akaMediaAnalytics.processLogs({api:"reportAPI",value:{methodName:"akamaiHandleAdFirstQuartile"}})}}function akamaiHandleAdMidPoint(){if(akaMediaAnalytics&&(akaMediaAnalytics.handleAdMidPoint(),akaMediaAnalytics.getShouldAnalyze())){akaMediaAnalytics.processLogs({api:"reportAPI",value:{methodName:"akamaiHandleAdMidPoint"}})}}function akamaiHandleAdThirdQuartile(){if(akaMediaAnalytics&&(akaMediaAnalytics.handleAdThirdQuartile(),akaMediaAnalytics.getShouldAnalyze())){akaMediaAnalytics.processLogs({api:"reportAPI",value:{methodName:"akamaiHandleAdThirdQuartile"}})}}function akamaiHandleAdError(){if(akaMediaAnalytics&&(akaMediaAnalytics.handleAdError(),akaMediaAnalytics.getShouldAnalyze())){akaMediaAnalytics.processLogs({api:"reportAPI",value:{methodName:"akamaiHandleAdError"}})}}function akamaiHandleAdStopped(){if(akaMediaAnalytics&&(akaMediaAnalytics.handleAdStopped(),akaMediaAnalytics.getShouldAnalyze())){akaMediaAnalytics.processLogs({api:"reportAPI",value:{methodName:"akamaiHandleAdStopped"}})}}function akamaiHandleStreamSwitch(){if(akaMediaAnalytics&&(akaMediaAnalytics.handleStreamSwitch(),akaMediaAnalytics.getShouldAnalyze())){akaMediaAnalytics.processLogs({api:"reportAPI",value:{methodName:"akamaiHandleStreamSwitch"}})}}function akamaiHandleTitleSwitch(e){if(akaMediaAnalytics&&(akaMediaAnalytics.handleTitleSwitch(e),akaMediaAnalytics.getShouldAnalyze())){var t={methodName:"akamaiHandleTitleSwitch",customData:e};akaMediaAnalytics.processLogs({api:"reportAPI",value:t})}}function akamaiSetupAIS(e,t,a){akaMediaAnalytics&&akaMediaAnalytics.handleSetupAISEvent(e,t,a)}function akamaiHandleBitRateSwitch(e){if(akaMediaAnalytics&&(akaMediaAnalytics.handleBitRateSwitch(e),akaMediaAnalytics.getShouldAnalyze())){var t={methodName:"akamaiHandleBitRateSwitch",bitRate:e};akaMediaAnalytics.processLogs({api:"reportAPI",value:t})}}function akamaiHandleApplicationExit(){if(akaMediaAnalytics&&(akaMediaAnalytics.handleApplicationExit(),akaMediaAnalytics.getShouldAnalyze())){akaMediaAnalytics.processLogs({api:"reportAPI",value:{methodName:"akamaiHandleApplicationExit"}})}}function akamaiSetVideoObject(e){akaMediaAnalytics&&akaMediaAnalytics.subscribeVideoObject(e)}function akamaiSubscribeVideoObject(e){akaMediaAnalytics&&akaMediaAnalytics.subscribeVideoObject(e)}function akamaiEnableLocation(e){if(akaMediaAnalytics&&(akaMediaAnalytics.enableLocation(e),akaMediaAnalytics.getShouldAnalyze())){var t={methodName:"akamaiEnableLocation",enable:enable};akaMediaAnalytics.processLogs({api:"reportAPI",value:t})}}function akamaiDisableServerIpLookup(){try{if(akaMediaAnalytics&&(akaMediaAnalytics.disableServerIpLookUp(),akaMediaAnalytics.getShouldAnalyze())){akaMediaAnalytics.processLogs({api:"reportAPI",value:{methodName:"akamaiDisableServerIpLookup"}})}}catch(e){}}function akamaiEnableServerIpLookup(){try{if(akaMediaAnalytics&&(akaMediaAnalytics.enableServerIpLookUp(),akaMediaAnalytics.getShouldAnalyze())){akaMediaAnalytics.processLogs({api:"reportAPI",value:{methodName:"akamaiEnableServerIpLookup"}})}}catch(e){}}function akamaiHandleError(e){try{akaMediaAnalytics&&akaMediaAnalytics.handleError(e)}catch(e){}}function fragmentDownloadStarted(e){akamaiFragmentDownloadStarted(e)}function fragmentDownloadCompleted(e){akamaiFragmentDownloadCompleted(e)}function akamaiFragmentDownloadStarted(e){var t=akaMediaAnalytics.getStream();if(t&&e&&(t.streamFragmentDownloadStarted(e),akaMediaAnalytics.getShouldAnalyze())){var a={methodName:"akamaiFragmentDownloadStarted",bitRate:e};akaMediaAnalytics.processLogs({api:"reportAPI",value:a})}}function akamaiFragmentDownloadCompleted(e){var t=akaMediaAnalytics.getStream();if(t&&e&&(t.streamFragmentDownloadCompleted(e),akaMediaAnalytics.getShouldAnalyze())){var a={methodName:"akamaiFragmentDownloadCompleted",bitRate:e};akaMediaAnalytics.processLogs({api:"reportAPI",value:a})}}("undefined"!=typeof akamaiBCVideoObject||"undefined"!=typeof AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH&&-1==AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH.indexOf("enableGenericAPI=1")&&-1==AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH.indexOf("subscribeVideo"))&&(akaMediaAnalytics=new AkaHTML5MediaAnalytics(null));