!function(){"use strict";function e(e){if("true"===e)return!0;if("false"===e)return!1;var t=parseFloat(e);return isNaN(t)?e:t}function t(e){var t=window.location.href,i=t.match(new RegExp(/^https?:\/\/([^\/]*)/))[1],n="//jwpltx.com/v1/adclient/ping.gif";"file:"===window.location.protocol&&(n="https:"+n),this.track=function(t,r,a,o){var s=n,d="?",l={d:i,c:"googima",m:"html5",a:e,s:"dart",n:Math.random().toFixed(16).substr(2,16),co:t?"yes":"no",l:r?"linear":"nonlinear"},u=void 0;u=a?"api":0===o?"pre":o===-1?"post":"mid",l.p=u;for(var h in l)s+=d+h+"="+encodeURIComponent(l[h]),d="&";setTimeout(function(){var e=new Image;e.src=s},0)}}function i(e){if(B)return B;var t=["//","imasdk.googleapis.com/js/sdkloader/ima3.js"];return"file:"===document.location.protocol&&t.unshift("https:"),B=new Promise(function(i,n){if(window.google&&google.ima)return void i();var r=new e.scriptloader(t.join(""));r.on("complete",function(){i(google.ima)}).on("error",function(e){return n(e)}).load()})}function n(e,t){var i=this,n=H[t];return n?n:(function(e,t){e.jwplayerEntitlements=t(),"object"==typeof module&&module.exports?module.exports=t():"function"==typeof define&&define.amd&&define([],t)}(this,function(){return function(e,t,i){var n=new e.key(t).token(),r=["//entitlements.jwplayer.com/",n,".json"];"file:"===window.location.protocol&&r.unshift("https:");var a={canPlayAds:!0};e.ajax(r.join(""),function(e){a.canPlayAds=!e||!e.response||e.response.canPlayAds!==!1,i(a)},function(){i(a)},{timeout:1e4,responseType:"json"})}}),H[t]=new Promise(function(n,r){i.jwplayerEntitlements(e,t,function(e){return e.canPlayAds?void n():void r({message:"Ad Limit Reached"})})}))}function r(){var e=window.location.href.match(new RegExp(/^[^\/]*:\/\/\/?([^\/]*)/));return e&&e.length>1?e[1]:""}function a(e,t){var i=Math.pow(10,t);return Math.round(e*i)/i}function o(e){return e.indexOf("?")!==-1?"&":"?"}function s(e,t,i){if(!e)return e;var n=t.getPlaylistItem(),s=t.getConfig(),d=e.replace("__random-number__",Math.random()*Math.pow(10,18)).replace("__timestamp__",(new Date).getTime()).replace("__page-url__",encodeURIComponent(window.location.href)).replace("__referrer__",encodeURIComponent(document.referrer)).replace("__player-height__",t.getHeight()||s.height).replace("__player-width__",t.getWidth()||s.width).replace("__item-duration__",a(t.getDuration(),3)).replace("__domain__",encodeURIComponent(r()));d=i.companiondiv&&i.companiondiv.id?d.replace("__companion-div__",i.companiondiv.id):d.replace("__companion-div__","");for(var l=d.match(new RegExp(/__item-[a-z 0-9 A-Z]*__/g)),u=0;l&&u1e3&&(c=c.substring(0,1e3)),d=d.replace(h,encodeURIComponent(c))}else d=d.replace(h,"")}if(n.title&&d.indexOf("vid_t=")===-1){var g=n.title.substring(0,100).replace(/[^\x00-\x7F]/g,"");d+=o(d)+"vid_t="+encodeURIComponent(g)}return d}function d(e,t,i){if("start"===e||"0%"===e)return"pre";if("end"===e||"100%"===e)return"post";if("pre"===e||"post"===e||i.indexOf(e,"%")>-1)return e;var n=t.seconds(e);return!!i.isNumber(n)&&n}function l(e){var t=parseInt(e,10),i=Math.floor(t)%1e3,n=Math.floor(t/1e3)%60,r=Math.floor(t/6e4)%60,a=Math.floor(t/36e5)%24;return a=a<10?"0"+a:a,r=r<10?"0"+r:r,n=n<10?"0"+n:n,i=("000"+i).slice(-3),a+":"+r+":"+n+"."+i}function u(e,t,i){var n=d(e,t,i);return n||(n="pre"),i.isNumber(n)&&(n=l(1e3*n)),n}function h(e,t,i){var n={};return t.foreach(e,function(e,r){var a={},o=r;r.ad&&(o=r.ad),a.offset=u(o.offset||o.position||r.offset||"",t,i),a.tag=o.tag,a.type=o.type||r.type||"linear,nonlinear",n[e]=a}),n}function p(e){return new Array(e+1).join((Math.random().toString(36)+"00000000000000000").slice(2,18)).slice(0,e)}function c(e){try{return e.getAdPodInfo()}catch(t){return null}}function g(e,r,a){function o(e,t,i,n){try{return e.getCompanionAds(t,i,n)}catch(r){return[]}}function s(e){if(e&&e.length){var t=document.getElementById(b.companiondiv.id);if(t){var i=e[0];i&&(f.isFunction(i.getContent)?t.innerHTML=i.getContent():t.innerHTML=i.resource||i.content)}}}function d(e){for(var t=[],i=0;i0}function u(){C&&!C.destroyed()&&(e.off(null,null,C),C.destroy(),C=null)}function h(t){P.contentComplete(),u(),t&&t.adschedule?b.adschedule=t.adschedule:b.adschedule=null,e.setCues([])}function p(t,n,r){return h(t),r.getSchedule()?(P.reset(),C=new G(t,b,e,M,_,P),C.init(n,r),C.on("all",function(t,i){return e.trigger(t,i)}),C.on(D,function(e){var t=e.ima.ad,i=e.ima.userRequestContext,n=l(t);w.track(n,t.isLinear(),i.requestType===y,t.getAdPodInfo().getTimeOffset())}),void e.once("beforePlay",function(e){return C.beforePlay(e)},C).on("beforeComplete",function(){return C.beforeComplete()},C).on("time",function(e){return C.time(e)},C).on("resize",function(){return C.resize()},C).on("fullscreen",function(){return C.resize()},C)):void i(g).then(function(){P.prepare(e)})["catch"](g.noop)}var c=this,g=e.utils;i(g)["catch"](g.noop);var f=e._,E=e.getConfig().key,b=new V(r||{}),_=new z(a,e.id,g.style),w=new t(new e.utils.key(E).token()),M=new F(g,e.Events,_),P=new Q(_.getAdDiv()),C=null;e.utils.extend(this,e.Events),e.on("destroyPlugin",function(){c.destroy()}),e.pauseAd=function(e){C&&(e?C.pause():C.resume())},e.playAd=function(t){var i={};e._.isArray(t)?i.tag=t[0]:i.tag=t;var n=new V(i);p({},y,n),C&&C.beforePlay(null)},e.on("playlistItem",function(e){p(e.item,m,b)},this).on("playlistComplete",function(){return h()},this).on("cast",function(e){e.active&&h()},this),n.call(this,g,E)["catch"](function(t){u(),e.off(null,null,c),e.playAd=g.noop,e.trigger(x,{id:A,client:v,message:"Ad Error: "+t.message,code:900,tag:""})}),this.destroy=u}var f="jwplayer",v="googima",y="TYPE_API",m="TYPE_SCHEDULE",A="-1",E="play",b=1e4,_=15e3,w="jw-flag-ads-googleima",M="jw-flag-ads-vpaid",P="state",C="buffering",k="paused",L="playing",T="adRequest",I="adClick",R="adCompanions",S="adComplete",x="adError",D="adImpression",O="adPause",j="adPlay",N="adSkipped",U="adTime",q=(function(){function e(e){this.value=e}function t(t){function i(e,t){return new Promise(function(i,r){var s={key:e,arg:t,resolve:i,reject:r,next:null};o?o=o.next=s:(a=o=s,n(e,t))})}function n(i,a){try{var o=t[i](a),s=o.value;s instanceof e?Promise.resolve(s.value).then(function(e){n("next",e)},function(e){n("throw",e)}):r(o.done?"return":"normal",o.value)}catch(d){r("throw",d)}}function r(e,t){switch(e){case"return":a.resolve({value:t,done:!0});break;case"throw":a.reject(t);break;default:a.resolve({value:t,done:!1})}a=a.next,a?n(a.key,a.arg):o=null}var a,o;this._invoke=i,"function"!=typeof t["return"]&&(this["return"]=void 0)}return"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype["throw"]=function(e){return this._invoke("throw",e)},t.prototype["return"]=function(e){return this._invoke("return",e)},{wrap:function(e){return function(){return new t(e.apply(this,arguments))}},await:function(t){return new e(t)}}}(),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}),V=function(){function t(i){q(this,t),this.config=i;var n={debug:!1,admessagestatic:"This is an Advertisement",usestaticmessage:!1,click_tracking:!0,scaled_ads:!0,advideoheight:0,advideowidth:0,invertmutebutton:!1,allowadskip:!1,allowadskippastseconds:0,allowplayercontrols:!1,allowvolumeslider:!1,autoplayadsmuted:!1,overlayslotwidth:0,overlayslotheight:0,admessage:"This ad will end in xx seconds.",admessagedynamickey:"xx",adcounterdynamic:"Ad __AD_POD_CURRENT__ of __AD_POD_LENGTH__. ",adcountercountkey:"__AD_POD_CURRENT__",adcountertotalkey:"__AD_POD_LENGTH__",cuetext:"Advertisement",companiondiv:null,vpaidmode:"insecure",loadVideoTimeout:_};for(var r in n){var a=i[r],o=n[r],s=typeof o;if("undefined"!=typeof a){if("boolean"!==s&&"number"!==s||(a=e(a)),typeof a!==s)throw new Error("invalid parameter: "+r+" should be a "+s);this[r]=a}else this[r]=o}this.admessagedynamic=this.admessage}return t.prototype.getSchedule=function(){var e=this.config;return e.tag||this.adschedule||e.schedule||e.ad},t}(),z=function(){function e(t,i,n){q(this,e);var r=document.createElement("div");this.visible=!1,this.style=n,this.div=t,this.adDiv=r,r.id=i+"_ad",n(t,{overflow:"hidden",width:"100%",height:"100%",display:"block",visibility:"hidden",pointerEvents:"none",opacity:0}),n(r,{position:"absolute",width:"100%",height:"100%"}),t.appendChild(r)}return e.prototype.resizeNonLinear=function(e,t){this.style(this.div,{height:t+"px",top:"auto",width:"100%"})},e.prototype.resizeLinear=function(){this.style(this.div,{top:"0px",left:"0px",width:"100%",height:"100%"})},e.prototype.getAdDiv=function(){return this.adDiv},e.prototype.adSetup=function(){this.visible=!0,this.style(this.div,{visibility:"visible",display:"block",pointerEvents:"all",opacity:1},!0);for(var e=this.adDiv.childNodes,t=0;t0}).map(function(e){return{begin:e,text:n.options.cuetext}});n.player.setCues(d)}}return r})["catch"](function(e){return n.asyncError(e)})},e.prototype.getViewMode=function(){var e=google.ima.ViewMode;return this.player.getFullscreen()?e.FULLSCREEN:e.NORMAL},e.prototype.prepareToPlayAd=function(){if(!this.destroyed()&&(clearTimeout(this.timeoutAdStart),!this.blockingInstreamPlayer)){this.video&&this.player.utils.isIOS()&&(this.video.controls=!1);var e=this.video&&this.player.utils.isMobile()&&!this.video.__jwMobileCanPlay&&(this.player.isBeforePlay()||0===this.video.currentTime);e?(this.mobilePlayCallback=this.getMobilePlayCallback(),this.video.addEventListener(E,this.mobilePlayCallback)):this.startBlocking()}},e.prototype.muteInstreamProvider=function(){var e=this.video&&this.video.muted||this.player.getMute();this.instreamProvider.mute(e)},e.prototype.getMobilePlayCallback=function(){var e=this,t=function(i){i.currentTarget.removeEventListener(E,t),i.currentTarget.__jwMobileCanPlay=!0,e.mobilePlayCallback=null,e.startBlocking()};return t},e.prototype.startBlocking=function(){var e=this;this.blockingInstreamPlayer||(this.player.utils.addClass(this.player.getContainer(),w),this.blockingInstreamPlayer=this.player.createInstream().init(),this.blockingInstreamPlayer.setText("Loading"),this.blockingInstreamPlayer.applyProviderListeners(this.instreamProvider),this.initAdsManagerPromise.then(function(e){e.start()}),clearTimeout(this.timeoutAdStart),this.timeoutAdStart=setTimeout(function(){e.destroyed()||(e.stopBlocking(),e.discardAdBreak())},b))},e.prototype.stopBlocking=function(){this.destroyed()||(clearTimeout(this.timeoutAdStart),this.player.utils.removeClass(this.player.getContainer(),[M,w]),this.mobilePlayCallback&&(this.video&&this.video.removeEventListener(E,this.mobilePlayCallback),this.mobilePlayCallback=null),this.blockingInstreamPlayer&&(this.video&&this.video.pause(),this.instreamProvider.off(),this.blockingInstreamPlayer.destroy(),this.blockingInstreamPlayer=null,this.view.adTakeDown()))},e.prototype.resumeRequested=function(){this.currentAd&&this.currentAd.isLinear()&&(this.finishAd(),this.view.adTakeDown()),this.stopBlocking()},e.prototype.finishAd=function(){this.currentAd&&(clearInterval(this.progressIntervalId),this.currentAd=null)},e.prototype.discardAdBreak=function(){var e=this;this.initAdsManagerPromise.then(function(t){e.destroyed()||(t.discardAdBreak(),t.stop())})},e.prototype.pause=function(){var e=this.adsLoaderManager.adsManager;e&&e.pause()},e.prototype.resume=function(){var e=this.adsLoaderManager.adsManager;e&&e.resume()},e.prototype.beforePlay=function(e){var t=this;this.player.off("beforePlay",null,this),this.isItemSchedule=!!e,this.prepareToPlayAd(),this.adsLoaderManager.initializeDisplay(),i().then(function(){t.destroyed()||t.adsLoaderManager.requestAds()})},e.prototype.beforeComplete=function(){var e=this.adsLoaderManager.adsManager;e&&e.getCuePoints().indexOf(-1)>-1&&this.prepareToPlayAd(),this.adsLoaderManager.unbindEvents(["CONTENT_RESUME_REQUESTED"]),this.playbackProxy.currentTime=this.playbackProxy.duration,this.adsLoaderManager.contentComplete()},e.prototype.time=function(e){this.playbackProxy.currentTime=e.position,e.duration>=e.position?this.playbackProxy.duration=e.duration:this.playbackProxy.duration=1/0},e.prototype.resize=function(){var e=this.currentAd,t=this.adsLoaderManager.adsManager;if(t){var i=e&&!e.isLinear(),n=this.player.getSafeRegion(i);if(i){var r=e.getHeight();r=this.player.getFullscreen()?n.height/2:Math.max(100,r+10),t.resize(n.width,r,this.getViewMode()),this.view.resizeNonLinear(n,r)}else t.resize(n.width,n.height,this.getViewMode()),this.view.resizeLinear()}},e.prototype.triggerAdPlay=function(e,t,i,n){if(e.isLinear()){this.instreamProvider.trigger(P,{newstate:i,oldstate:n});var r=this.adsLoaderManager.adEventObject(e);r.oldstate=n,r.newstate=i,this.trigger(t,r)}},e.prototype.progressInterval=function(e,t){var i=this;if(clearInterval(this.progressIntervalId),t){var n=250,r=e.getAdId(),a=e.getAdPodInfo(),o=-1,s=this.options.admessage||"",d=new RegExp(this.options.admessagedynamickey,"g"),l=this.options.adcounterdynamic||"",u=new RegExp(this.options.adcountercountkey,"g"),h=new RegExp(this.options.adcountertotalkey,"g");this.progressIntervalId=setInterval(function(){if(!i.currentAd||i.currentAd.getAdId()!==r)return void clearInterval(i.progressIntervalId);var n=t.getRemainingTime();if(!(isNaN(n)||n<=0)&&o!==n){o=n;var p=e.getDuration(),c=p-n;if(i.blockingInstreamPlayer){var g=s.replace(d,Math.round(p-c)),f=void 0,v=a.getTotalAds();if(v>1){var y=a.getAdPosition();f=l.replace(u,y),g=f.replace(h,v)+" "+g}i.blockingInstreamPlayer.setText(g)}if(p>0){var m=i.adsLoaderManager.adEventObject(e);m.position=c,m.duration=p,i.trigger(U,m)}}},n)}},e.prototype.adLoaded=function(e){this.muteInstreamProvider();var t=this.adsLoaderManager.adEventObject(e.getAd());this.trigger(T,t)},e.prototype.adStarted=function(e){var t=this,i=e.getAd(),n=i.isLinear(),r=n&&i.getDuration()===-1,a=i.getContentType(),o="application/javascript"===a||"application/x-shockwave-flash"===a;this.currentAd=i,this.adsLoaderManager.bindEvents({COMPLETE:this.adComplete.bind(this)}),o&&this.adsLoaderManager.bindEvents({VOLUME_CHANGED:function(){t.adsLoaderManager.unbindEvents(["VOLUME_CHANGED"]),t.player.setMute(!!t.adsLoaderManager.adsManager.getVolume())}}),r?this.startBlocking():n||this.stopBlocking(),this.player.utils.toggleClass(this.player.getContainer(),"jw-flag-ads-vpaid",r||o),this.view.adSetup(),this.resize(),this.muteInstreamProvider(),clearTimeout(this.timeoutAdStart);var s=this.adsLoaderManager.adsManager;this.progressInterval(i,s);var d=this.adsLoaderManager.adEventObject(i);this.trigger(D,d),this.triggerAdPlay(i,j,L,C)},e.prototype.adComplete=function(e){this.finishAd();var t=e.getAd(),i=this.adsLoaderManager.adEventObject(t);this.trigger(S,i),this.adsLoaderManager.unbindEvents(["VOLUME_CHANGED"])},e.prototype.adClick=function(e){var t=this.adsLoaderManager.adsManager,i=e.getAd(),n=i.getContentType(),r="application/javascript"===n||"application/x-shockwave-flash"===n;r||t.pause();var a=this.adsLoaderManager.adEventObject(i);this.trigger(I,a)},e.prototype.adPaused=function(e){this.triggerAdPlay(e.getAd(),O,k,L)},e.prototype.adResumed=function(e){this.triggerAdPlay(e.getAd(),j,L,k)},e.prototype.adSkipped=function(e){this.adsLoaderManager.unbindEvents(["COMPLETE","VOLUME_CHANGED"]),this.finishAd();var t=this.adsLoaderManager.adEventObject(e.getAd());this.trigger(N,t)},e.prototype.adUserClose=function(e){return this.currentAd&&this.currentAd.isLinear()&&this.currentAd.getDuration()===-1?void this.adSkipped(e):(this.adsLoaderManager.unbindEvents(["COMPLETE","VOLUME_CHANGED"]),void this.finishAd())},e.prototype.allAdsCompleted=function(){this.resumeRequested(),this.view.adTakeDown(),this.stopAdsManager()},e.prototype.stopAdsManager=function(){var e=this;this.initAdsManagerPromise.then(function(t){e.destroyed()||(t.stop(),t.destroy(),e.initAdsManagerPromise=null)})},e.prototype.adLog=function(e){var t=e.getAdData();if(t&&t.adError){var i=this.adsLoaderManager.adErrorEventObject(t.adError,e);402===i.code?this.handleAdError(t.adError,i):this.trigger(x,i)}},e.prototype.adError=function t(e){var t=e.getError();this.handleAdError(t,e)},e.prototype.asyncError=function(e){var t=this;this.destroyed()||(e&&e.getError?this.adError(e):e.target&&e.target.src?console.error("Failed to load "+e.target.src):console.error(e),this.timeoutAdStart=setTimeout(function(){return t.destroy()},0))},e.prototype.handleAdError=function(e,t){var i=this;this.options.debug&&console.error(e),900===e.getErrorCode()?this.timeoutAdStart=setTimeout(function(){return i.destroy()},0):(this.stopBlocking(),this.view.adTakeDown());var n=this.adsLoaderManager.adErrorEventObject(e,t);this.trigger(x,n)},e.prototype.destroy=function(){if(this.off(),!this.destroyed()){this.blockingInstreamPlayer&&this.stopBlocking(),this.initAdsManagerPromise&&(this.stopAdsManager(),this.initAdsManagerPromise=null),this.view.adTakeDown(),clearTimeout(this.timeoutAdStart),clearInterval(this.progressIntervalId),this.currentAd=null,this.item=null,this.options=null,this.player.off(null,null,this),this.player=null,this.view=null,this.instreamProvider.off(),this.instreamProvider.setProxy(null),this.instreamProvider=null,this.video=null;var e=this.adsLoaderManager;e&&(e.reset(),this.adsLoaderManager=null)}},e.prototype.destroyed=function(){return!this.item},e}(),W=function(){function e(t,i){q(this,e),this.player=t,this.options=i}return e.prototype.getAdsResponse=function(e){var t=this,i=this.player,n=i.utils,r='',a=[];return n.foreach(h(e,n,i._),function(e,n){a.push(r.replace(/_type_/g,n.type).replace(/_adbreakname_/g,e).replace(/_offset_/g,n.offset.replace("pre","start").replace("post","end")).replace(/_url_/g,s(n.tag,i,t.options)))}),''+a.join("")+""},e.prototype.getTagMap=function(e){var t=this,i=this.player,n=i.utils,r={};return n.foreach(h(e,n,i._),function(e,a){var o=d(a.offset,n,i._);i._.isString(o)&&(o=parseFloat(o.replace("pre","0").replace("post","-1"))),i._.isNumber(o)&&(r[o]=s(a.tag,i,t.options))}),r},e.prototype.getTagList=function(e){var t=this,i=this.player,n=i.utils,r=[];return n.foreach(h(e,n,i._),function(e,a){var o=d(a.offset,n,i._);i._.isString(o)&&(o=parseFloat(o.replace("pre","0").replace("post","-1"))),r.push({offset:o,tag:s(a.tag,i,t.options)})}),r},e}(),Q=function(){function e(t){q(this,e),this.adsLoader=null,this.adDisplayContainer=null,this.displayInitialized=!1,this.adsRequest=null,this.userRequestContext=null,this.adsManager=null,this.adsManagerEvents={},this.container=t,this.adIds={},this.schedule=null,this.tagMap={}}return e.prototype.getVpaidMode=function(e){var t=google.ima.ImaSdkSettings.VpaidMode;return"disabled"===e||"none"===e?t.DISABLED:"enabled"===e?t.ENABLED:t.INSECURE},e.prototype.initializeDisplay=function(){!this.displayInitialized&&this.adDisplayContainer&&(this.adDisplayContainer.initialize(),this.displayInitialized=!0)},e.prototype.contentComplete=function(){if(null!==this.adsRequest){var e=this.adsLoader;e&&e.contentComplete(),this.adsRequest=null}},e.prototype.reset=function(){this.userRequestContext=null,this.adsRequest=null,this.schedule=null;var e=this.adsManager;e&&(e.stop(),e.destroy(),this.adsManager=null),this.adsManagerEvents={},this.adIds={},this.tagMap={}},e.prototype.prepare=function(e){var t=this.adsLoader;if(!t){var i=e.getContainer().querySelector("video");this.adDisplayContainer=new google.ima.AdDisplayContainer(this.container,i),t=this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer)}return t},e.prototype.open=function(e,t,i,n){var r=this.prepare(i),a={requestType:e,vpaidMode:t.vpaidmode,playerVersion:i.version.split("+")[0]};this.userRequestContext=a;var o=t.getSchedule();if(!o)return Promise.reject();var d=new google.ima.AdsRequest,l=i.getSafeRegion(!1);d.linearAdSlotWidth=l.width,d.linearAdSlotHeight=l.height;var u=i.getSafeRegion(!0);d.nonLinearAdSlotWidth=u.width,d.nonLinearAdSlotHeight=u.height,d.setAdWillAutoPlay(i.getConfig().autostart&&!i.utils.isMobile()),d.forceNonLinearFullSlot=n.forceNonLinearFullSlot,this.adsRequest=d;var h=new W(i,n);if("object"==typeof o){var p=h.getTagList(o);1===p.length&&0===p[0].offset&&(o=p[0].tag)}return"string"==typeof o?o=d.adTagUrl=a.adTagUrl=s(o,i,n):(d.adsResponse=a.adsResponse=h.getAdsResponse(o),this.tagMap=h.getTagMap(o)),this.schedule=o,new Promise(function(e,t){r.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,t,!1),r.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,e,!1)})},e.prototype.requestAds=function(){var e=this.adsLoader,t=this.userRequestContext,i=this.getVpaidMode(t.vpaidMode),n=e.getSettings();n.setPlayerType(f),n.setPlayerVersion(t.playerVersion),n.setVpaidMode(i),e.requestAds(this.adsRequest,t)},e.prototype.getAdsManager=function(e,t,i){var n=new google.ima.AdsRenderingSettings;return n.enablePreloading=!0,n.loadVideoTimeout=i.loadVideoTimeout,n.uiElements=null,n.autoAlign=!0,n.useStyledNonLinearAds=!0,this.adsManager=e.getAdsManager(t,n),this.userRequestContext=e.getUserRequestContext(),this.adsManager},e.prototype.bindEvents=function(e){for(var t=google.ima.AdEvent.Type,i=google.ima.AdErrorEvent.Type,n=Object.keys(e),r=Array.isArray(n),a=0,n=r?n:n[Symbol.iterator]();;){var o;if(r){if(a>=n.length)break;o=n[a++]}else{if(a=n.next(),a.done)break;o=a.value}var s=o,d=t[s]||i[s],l=this.adsManagerEvents[d];l&&this.adsManager.removeEventListener(d,l),this.adsManager.addEventListener(d,e[s],!1),this.adsManagerEvents[d]=e[s]}},e.prototype.unbindEvents=function(e){for(var t=google.ima.AdEvent.Type,i=google.ima.AdErrorEvent.Type,n=e,r=Array.isArray(n),a=0,n=r?n:n[Symbol.iterator]();;){var o;if(r){if(a>=n.length)break;o=n[a++]}else{if(a=n.next(),a.done)break;o=a.value}var s=o,d=t[s]||i[s],l=this.adsManagerEvents[d];l&&(this.adsManager.removeEventListener(d,l),delete this.adsManagerEvents[d])}},e.prototype.getAdId=function(e){if(e){var t=e.getAdId(),i=c(e);if(i&&(t=""+i.getTimeOffset()),t)return"undefined"==typeof this.adIds[t]&&(this.adIds[t]=p(12)),this.adIds[t]}return A},e.prototype.getTag=function(e,t){if("string"==typeof this.schedule)return this.schedule;var i=c(e);if(i){var n=this.tagMap[i.getTimeOffset()];if(n)return n}var r=this.userRequestContext;return t&&t.getUserRequestContext&&(r=t.getUserRequestContext()||r),r?r.adTagUrl||r.adsResponse||"":(console.error("invalid request context",r),"")},e.prototype.adEventObject=function(e){var t={client:v,tag:this.getTag(e),ima:{ad:e,userRequestContext:this.userRequestContext}};if(!e)return t;t.id=this.getAdId(e),t.adtitle=e.getTitle(),t.adsystem=e.getAdSystem(),t.creativetype=e.getContentType(),t.linear=e.isLinear()?"linear":"nonlinear";var i=c(e);if(i){var n=i.getTotalAds();n>1&&(t.sequence=i.getAdPosition(),t.podcount=n);var r=i.getTimeOffset(),a="mid";0===r?a="pre":r===-1&&(a="post"),t.adposition=a}return t},e.prototype.adErrorEventObject=function(e,t){var i=e.getMessage&&e.getMessage()||e.message,n=e.getVastErrorCode&&e.getVastErrorCode()||900,r=this.getTag(t.getAd&&t.getAd(),t);return{id:A,client:v,message:"Ad Error: "+i,code:n,tag:r}},e}(),K=window.jwplayerPluginJsonp||window.jwplayer().registerPlugin;K(v,"7.6",g)}();