@castlabs/prestoplay 6.34.0 → 6.35.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/cjs/cl.adobe.js +3 -3
  2. package/cjs/cl.airplay.js +3 -3
  3. package/cjs/cl.broadpeak.js +18 -18
  4. package/cjs/cl.cast.js +125 -125
  5. package/cjs/cl.conviva.js +31 -31
  6. package/cjs/cl.core.js +579 -577
  7. package/cjs/cl.crypto.js +9 -9
  8. package/cjs/cl.dash.js +100 -100
  9. package/cjs/cl.freewheel.js +26 -26
  10. package/cjs/cl.hls.js +76 -76
  11. package/cjs/cl.hlssmpte.js +6 -6
  12. package/cjs/cl.htmlcue.js +30 -30
  13. package/cjs/cl.ima.js +25 -25
  14. package/cjs/cl.mediatailor.js +3 -3
  15. package/cjs/cl.mse.js +345 -345
  16. package/cjs/cl.muxdata.js +13 -13
  17. package/cjs/cl.onboard.js +4 -4
  18. package/cjs/cl.persistent.js +14 -14
  19. package/cjs/cl.playlist.js +5 -5
  20. package/cjs/cl.simid.js +16 -16
  21. package/cjs/cl.smooth.js +70 -70
  22. package/cjs/cl.thumbnails.js +25 -25
  23. package/cjs/cl.tizen.js +67 -67
  24. package/cjs/cl.ttml.js +29 -29
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +8 -8
  27. package/cjs/cl.vr.js +19 -19
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.yospace.js +3 -3
  30. package/cjs/cl.youbora.js +38 -38
  31. package/cl.adobe.js +3 -3
  32. package/cl.airplay.js +3 -3
  33. package/cl.broadpeak.js +14 -14
  34. package/cl.cast.js +97 -97
  35. package/cl.conviva.js +28 -27
  36. package/cl.core.js +463 -462
  37. package/cl.crypto.js +8 -8
  38. package/cl.dash.js +89 -89
  39. package/cl.freewheel.js +20 -20
  40. package/cl.hls.js +82 -82
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +26 -26
  43. package/cl.ima.js +19 -19
  44. package/cl.mediatailor.js +2 -2
  45. package/cl.mse.js +299 -299
  46. package/cl.muxdata.js +11 -11
  47. package/cl.onboard.js +5 -5
  48. package/cl.persistent.js +10 -10
  49. package/cl.playlist.js +5 -5
  50. package/cl.simid.js +14 -14
  51. package/cl.smooth.js +60 -60
  52. package/cl.thumbnails.js +17 -17
  53. package/cl.tizen.js +55 -55
  54. package/cl.ttml.js +22 -22
  55. package/cl.verimatrix.js +4 -4
  56. package/cl.vimond.js +7 -7
  57. package/cl.vr.js +14 -14
  58. package/cl.vtt.js +12 -12
  59. package/cl.yospace.js +3 -3
  60. package/cl.youbora.js +31 -31
  61. package/package.json +1 -1
package/cjs/cl.htmlcue.js CHANGED
@@ -1,34 +1,34 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var qT="CLPP Subtitle Styles",rT="Unsupported unit",sT="clpp-text-plain",tT="clpp-text-ttml",uT="clpp.htmlcue.HtmlTextDisplayer",vT="initial",wT=function(a){return _.Ij(a,{gi:function(b,c){return b.va(c)}})},xT=function(a,b){if(0===b.length)return a;var c=a,d=a.findIndex(function(e){return e.startTime>=b[0].startTime});0<=d&&(c=c.slice(0,d));return c.concat(b)},yT=function(a,b){for(var c=0,d=a.length-1;c<=d;){var e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},zT=function(){},AT=function(a){if(!a.input)return null;
3
- var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},CT=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return BT[c]});return a},ET=function(a,b){DT(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){DT(a,c)})},DT=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},FT=function(a,b){return 0===a?"0":a+b},GT=function(a,b){return 1>Math.abs(a-b)||a<b},HT=function(a,b){return a<b&&
4
- 1<Math.abs(a-b)},IT=function(a,b){return a>b&&1<Math.abs(a-b)},JT=function(a,b){return 1>Math.abs(a-b)||a>b},KT=function(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f},LT=function(a){return new KT(a.left,a.f,a.top,a.a,a.height,a.width)},MT=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,null),d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0,f=parseFloat(c.getPropertyValue("border-top-width"))||
5
- 0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;var g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new KT(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},NT=function(a,b){return b.some(function(c){return HT(a.left,c.f)&&IT(a.f,c.left)&&HT(a.top,c.a)&&IT(a.a,c.top)})},OT=function(a,b){return JT(a.top,b.top)&&GT(a.a,b.a)&&JT(a.left,b.left)&&GT(a.f,b.f)},PT=function(a,b,c){switch(c){case "+x":return HT(a.left,b.left);case "-x":return IT(a.f,b.f);
6
- case "+y":return HT(a.top,b.top);case "-y":return IT(a.a,b.a);default:throw Error("Unknown axis");}},QT=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},RT=function(a,b,c){QT.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.D=c},TT=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect(),d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return ST(a)?b:c},WT=function(a,b,c){return ST(a)&&_.N.ya(c)?FT(c,_.Kf):(UT(a)||
7
- VT(a))&&_.N.ya(b)?FT(b,"%"):vT},UT=function(a){return a.f.writingMode===_.Ig},VT=function(a){return a.f.writingMode===_.Jg},ST=function(a){return a.f.writingMode===_.Mj},XT=function(a,b,c){return(UT(a)||VT(a))&&_.N.ya(c)?FT(c,_.Kf):UT(a)&&_.N.R(c)?FT(0,_.Kf):ST(a)&&_.N.ya(b)?FT(b,"%"):vT},YT=function(a,b){if(typeof a.f.position===_.h&&typeof a.f.size===_.h)switch(b){case _.Ae:return a.f.position;case "auto":case _.md:return a.f.position-a.f.size/2;case _.Be:return a.f.position-a.f.size}return 0},
8
- ZT=function(a){switch(a.f.positionAlign){case _.Ae:return _.xe;case "auto":case _.md:return _.Lj;case _.Be:return _.Rf}return a.f.textAlign},$T=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.dg:case _.xe:return _.Ae;case _.Lj:return _.md;case _.je:case _.Rf:return _.Be}return a.f.positionAlign},aU=function(a){switch(a.f.writingMode){case _.Mj:return"horizontal-tb";case _.Ig:return _.Ig;case _.Jg:return _.Jg;default:throw Error("Unknown writing mode");}},bU=function(a,b){this.l=a;this.f=
9
- a.a;this.j=void 0===b?!1:b;this.a=MT(a.a);this.h=[]},cU=function(a,b){if(a.j)switch(b.writingMode){case _.Mj:return["-y"];case _.Ig:return["+x"];case _.Jg:return["-x"]}var c=[];switch(b.writingMode){case _.Mj:c=["+y","-y"];break;case _.Ig:c=["+x","-x"];break;case _.Jg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},dU=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=MT(a.l.a)},eU=function(a,b,c){QT.call(this,a,b,c);this.h=null;this.l=[]},fU=function(a,b){eU.call(this,
10
- a.id,"clpp-text-cue-region",b);this.f=a},gU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Rj)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(rT);},iU=function(a){this.g=new _.L("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=hU(this,this.h);this.f=hU(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},jU=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=
11
- a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},kU=function(a,b){var c="."+a.h+" .clpp-text-container",d=c+" .clpp-text-cue";return b=b.replace(/::cue\((#[^)]+)\)/g,c+" $1").replace(/::cue\(([^)]+)\)/g,d+" $1").replace(/::cue-region\(([^)]+)\)/g,c+" $1 .clpp-text-cue").replace(/::cue/g,d).replace(/::cue-region/g,c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,
12
- c)},hU=function(a,b,c){var d=document.createElement(_.jg),e=d.dataset;e.name=qT;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);lU(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},lU=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===qT&&a.g.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});
13
- c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},oU=function(a){_.Rv.call(this,a);var b=this;this.g=new _.L(uT);this.m=a;this.L=mU(a.getConfiguration());this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.h=new iU(a.getSurface().getUniqueCssClass());this.a=new eU(null,"clpp-text-container",{});this.w=new _.yv(a.getSurface(),this.ml.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
14
- this.G=new _.Yh(function(){nU(b)});this.A=new Map;this.l=null},mU=function(a){a=_.N.wb(a.htmlcue||{});_.N.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.N.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},pU=function(a,b){return a.startTime<=b&&a.endTime>b},nU=function(a,b){if((b||a.j)&&a.D){var c=a.m.getPosition(),d;!(d=b)&&(d=a.J!==c)&&(d=a.m instanceof _.X?3===a.m.getState():8===a.m.getState());if(d&&(a.J=c,d=qU(a,c),(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&
15
- c.start===d.start&&c.end===d.end)),c&&(a.l=d,rU(a),d))){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Wv(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.v(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,k=null;switch(e.payloadType){case _.Tg:k="clpp-text-vtt";break;case _.xg:k=tT;break;case _.Kj:k=sT}k&&!g.classList.contains(k)&&_.qr(g,k);g=MT(f.a.a);if(0===g.width||0===g.height)f.g.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");
16
- else{DT({fontSize:sU(f,e.containerRows)},f.a.a);g=null;k=e.payloadType===_.Tg;var l=e.payloadType===_.xg;e.region&&(k||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new fU(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new RT(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}},qU=function(a,b){var c=yT(a.f,function(e){return pU(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&pU(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
- pU(a.f[c+1],b);)c++;return{start:d,end:c}},tU=function(a){rU(a);a.J=null;a.l=null;a.f=[]},rU=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(tT);b.classList.remove(sT);a=a.a;dU(a.h);a.l=[]}},sU=function(a,b){var c=MT(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Kf}if(typeof b===_.h&&0<b)return Math.round(c/b)+_.Kf;d=a.getFontSizePercent();return Math.round(c*d)+_.Kf},uU=function(){},
18
- vU=function(){};
19
- zT.prototype.parse=function(a){a={input:a};for(var b=_.sr(_.Sd),c=[],d=b,e;null!==(e=AT(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var k=wU[f];k?(k=_.sr(k),(f=xU[f])&&g&&k.setAttribute(f,g.trim()),g=k):g=null;!g||yU[g.localName]&&yU[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
20
- d=g)}}else d.appendChild(document.createTextNode(CT(e)));return b};var wU={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},xU={v:"voice",lang:"lang"},yU={rt:"ruby"},BT={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};QT.prototype.init=function(){this.j=!0};QT.prototype.A=function(){return!1};_.w(RT,QT);RT.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
- RT.prototype.init=function(a){QT.prototype.init.call(this,a);if(this.h)_.qr(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.xg){var c=_.sr(_.Sd);c.innerHTML=b.payload;b=c}else b.payloadType===_.Tg?b=(new zT).parse(b.payload):(c=_.sr(_.Sd),c.textContent=b.payload,b=c);_.qr(b,this.w);this.id&&(b.id=this.id);c=_.v(this.f.cssClassList);for(var d=
22
- c.next();!d.done;d=c.next())_.qr(b,d.value);DT({writingMode:aU(this)},b);this.a.appendChild(b);_.qr(this.a,"clpp-text-wrapper");c=_.v(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.qr(this.a,"clpp-text-wrapper__"+d.value);_.N.R(this.f.line)&&(this.f.lineInterpretation=_.Nj,this.f.line=ST(this)?-1:0);c=aU(this);DT({writingMode:c,webkitWritingMode:c,direction:vT,textAlign:ZT(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=YT(this,$T(this));d=XT(this,c,null);var e=WT(this,
23
- c,null),f=VT(this)&&_.N.R(null)?FT(0,_.Kf):vT;DT({position:"absolute",left:d,right:f,top:e,width:ST(this)?FT(this.f.size,"%"):vT,height:UT(this)||VT(this)?FT(this.f.size,"%"):vT},this.a);d=this.f;a=ST(this)?a.height:a.width;e=TT(this);if(d.lineInterpretation===_.Nj)f=e*Math.round(d.line),Math.abs(f)>a&&(f=e*(0>d.line?0:-1)),0>f&&(f+=a);else{f=e/a*100;var g=d.line;switch(d.lineAlign){case _.md:g-=f/2;break;case _.je:g-=f}f=Math.round(g/100*a)}VT(this)&&(f=a-f-e);a=f;d=XT(this,c,a);e=VT(this)&&_.N.R(a)?
24
- FT(0,_.Kf):vT;DT({left:d,right:e,top:WT(this,c,a)},this.a)}ET(this.D,b)}};RT.prototype.o=function(){return _.sr(_.Sd)};bU.prototype.append=function(a){var b=a.a;b.style.visibility=_.re;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=MT(a.a);var d=cU(this,a.f),e=TT(a),f=LT(c),g=null,k=0;d=_.v(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;PT(c,this.a,l)||OT(c,this.a)&&NT(c,this.h);){var m=c,n=e;switch(l){case "+x":m.left+=n;m.f+=n;break;case "-x":m.left-=n;m.f-=n;break;case "+y":m.top+=n;m.a+=n;break;case "-y":m.top-=n,m.a-=n}}if(this.j||OT(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
25
- l.f)-Math.max(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>k&&(g=LT(c),k=l);c=LT(f)}c=g||f}DT({top:FT(c.top-this.a.top,_.Kf),bottom:FT(this.a.a-c.a,_.Kf),left:FT(c.left-this.a.left,_.Kf),right:FT(this.a.f-c.f,_.Kf),height:FT(c.height,_.Kf),width:FT(c.width,_.Kf)},a.a)}b.style.visibility="visible";this.h.push(MT(a.a))};_.w(eU,QT);eU.prototype.init=function(){this.h=new bU(this);this.j=!0};eU.prototype.o=function(){var a=_.sr(_.Sd);_.qr(a,this.w);this.id&&(a.id=this.id);return a};eU.prototype.appendChild=function(a){dU(this.h);this.l.unshift(a);a=_.v(this.l);for(var b=a.next();!b.done;b=a.next())this.h.append(b.value)};_.w(fU,eU);
26
- fU.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Rj:b=b.width/100*a.width;break a;default:throw Error(rT);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Rj)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(rT);d=a.height;var e=gU(this,d,a.height);DT(this.B,this.a);DT({left:FT(c,_.Kf),top:FT(e,_.Kf),width:FT(b,_.Kf),height:FT(d,_.Kf)},this.a);this.f.writingMode&&DT({display:"flex",
27
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&DT({"justify-content":this.f.displayAlign},this.a);b=_.v(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.qr(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Rj:b=b.height/100*a.height;break a;case 2:b=b.height;d=new RT(new _.Qj(0,1,"Lorem ipsum",_.Kj),{},{});c=d.a;this.a.appendChild(c);d.init(MT(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(rT);
28
- }a=gU(this,b,a.height);DT({top:FT(a,_.Kf),height:FT(b,_.Kf)},this.a);this.h=new bU(this,!0);this.j=!0};fU.prototype.getId=function(){return this.f.id};iU.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=kU(this,a);if(jU(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.g.debug("Added CSS rule "+b)}catch(c){this.g.error("An error occurred when adding a CSS rule: "+b)}this.l.push(a)}else this.g.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
29
- iU.prototype.destroy=function(){var a=this;return _.I(function(b){if(null==a.a)return b["return"]();a.j.forEach(function(c){return c()});a.j=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.z(b)})};_.w(oU,_.Rv);_.r=oU.prototype;_.r.getClass=function(){return _.se};_.r.isRenderer=function(){return!0};_.r.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.v(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=xT(this.f,wT(a));this.l=null;nU(this,!1)}};_.r.ec=function(){null==this.h||nU(this,!0)};
30
- _.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();tU(a);a.G.stop();return _.x(b,a.h.destroy(),2)}a.h=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.z(b)})};_.r.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;nU(this,!0);return!0};_.r.isTextVisible=function(){return this.j};
31
- _.r.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.Qb(.25),this.L.enableResizeObserver&&this.w.start(),nU(this,!0)):(this.G.stop(),this.w.stop(),tU(this)))};_.r.ml=function(){nU(this,!0)};_.J(uT,oU);oU.prototype.setTextVisibility=oU.prototype.setTextVisibility;oU.prototype.isTextVisible=oU.prototype.isTextVisible;oU.prototype.remove=oU.prototype.remove;oU.prototype.destroy=oU.prototype.destroy;oU.prototype.append=oU.prototype.append;uU.prototype.a=function(a){return!!a.enableHtmlCue&&!_.xi()};uU.prototype.create=function(a){return new oU(a)};_.w(vU,_.Iu);vU.prototype.install=function(){_.wq(_.se,new uU)};vU.prototype.uninstall=function(){_.uq.has(_.se)&&(_.uq["delete"](_.se),_.vq.info("Removed factory: 'html'"))};vU.prototype.id=function(){return"subtitles-htmlcue"};_.J("clpp.htmlcue.HtmlCueComponent",vU);};
2
+ var f=function(window){var rT="CLPP Subtitle Styles",sT="Unsupported unit",tT="clpp-text-plain",uT="clpp-text-ttml",vT="clpp.htmlcue.HtmlTextDisplayer",wT="initial",xT=function(a){return _.Jj(a,{gi:function(b,c){return b.wa(c)}})},yT=function(a,b){if(0===b.length)return a;var c=a,d=a.findIndex(function(e){return e.startTime>=b[0].startTime});0<=d&&(c=c.slice(0,d));return c.concat(b)},zT=function(a,b){for(var c=0,d=a.length-1;c<=d;){var e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},AT=function(){},BT=function(a){if(!a.input)return null;
3
+ var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},DT=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return CT[c]});return a},FT=function(a,b){ET(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){ET(a,c)})},ET=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},GT=function(a,b){return 0===a?"0":a+b},HT=function(a,b){return 1>Math.abs(a-b)||a<b},IT=function(a,b){return a<b&&
4
+ 1<Math.abs(a-b)},JT=function(a,b){return a>b&&1<Math.abs(a-b)},KT=function(a,b){return 1>Math.abs(a-b)||a>b},LT=function(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f},MT=function(a){return new LT(a.left,a.f,a.top,a.a,a.height,a.width)},NT=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,null),d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0,f=parseFloat(c.getPropertyValue("border-top-width"))||
5
+ 0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;var g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new LT(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},OT=function(a,b){return b.some(function(c){return IT(a.left,c.f)&&JT(a.f,c.left)&&IT(a.top,c.a)&&JT(a.a,c.top)})},PT=function(a,b){return KT(a.top,b.top)&&HT(a.a,b.a)&&KT(a.left,b.left)&&HT(a.f,b.f)},QT=function(a,b,c){switch(c){case "+x":return IT(a.left,b.left);case "-x":return JT(a.f,b.f);
6
+ case "+y":return IT(a.top,b.top);case "-y":return JT(a.a,b.a);default:throw Error("Unknown axis");}},RT=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},ST=function(a,b,c){RT.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.D=c},UT=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect(),d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return TT(a)?b:c},XT=function(a,b,c){return TT(a)&&_.N.za(c)?GT(c,_.Kf):(VT(a)||
7
+ WT(a))&&_.N.za(b)?GT(b,"%"):wT},VT=function(a){return a.f.writingMode===_.Ig},WT=function(a){return a.f.writingMode===_.Jg},TT=function(a){return a.f.writingMode===_.Nj},YT=function(a,b,c){return(VT(a)||WT(a))&&_.N.za(c)?GT(c,_.Kf):VT(a)&&_.N.R(c)?GT(0,_.Kf):TT(a)&&_.N.za(b)?GT(b,"%"):wT},ZT=function(a,b){if(typeof a.f.position===_.h&&typeof a.f.size===_.h)switch(b){case _.Ae:return a.f.position;case "auto":case _.md:return a.f.position-a.f.size/2;case _.Be:return a.f.position-a.f.size}return 0},
8
+ $T=function(a){switch(a.f.positionAlign){case _.Ae:return _.xe;case "auto":case _.md:return _.Mj;case _.Be:return _.Rf}return a.f.textAlign},aU=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.dg:case _.xe:return _.Ae;case _.Mj:return _.md;case _.je:case _.Rf:return _.Be}return a.f.positionAlign},bU=function(a){switch(a.f.writingMode){case _.Nj:return"horizontal-tb";case _.Ig:return _.Ig;case _.Jg:return _.Jg;default:throw Error("Unknown writing mode");}},cU=function(a,b){this.l=a;this.f=
9
+ a.a;this.j=void 0===b?!1:b;this.a=NT(a.a);this.h=[]},dU=function(a,b){if(a.j)switch(b.writingMode){case _.Nj:return["-y"];case _.Ig:return["+x"];case _.Jg:return["-x"]}var c=[];switch(b.writingMode){case _.Nj:c=["+y","-y"];break;case _.Ig:c=["+x","-x"];break;case _.Jg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},eU=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=NT(a.l.a)},fU=function(a,b,c){RT.call(this,a,b,c);this.h=null;this.l=[]},gU=function(a,b){fU.call(this,
10
+ a.id,"clpp-text-cue-region",b);this.f=a},hU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Sj)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(sT);},jU=function(a){this.g=new _.L("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=iU(this,this.h);this.f=iU(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},kU=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=
11
+ a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},lU=function(a,b){var c="."+a.h+" .clpp-text-container",d=c+" .clpp-text-cue";return b=b.replace(/::cue\((#[^)]+)\)/g,c+" $1").replace(/::cue\(([^)]+)\)/g,d+" $1").replace(/::cue-region\(([^)]+)\)/g,c+" $1 .clpp-text-cue").replace(/::cue/g,d).replace(/::cue-region/g,c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,
12
+ c)},iU=function(a,b,c){var d=document.createElement(_.jg),e=d.dataset;e.name=rT;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);mU(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},mU=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===rT&&a.g.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});
13
+ c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},pU=function(a){_.Sv.call(this,a);var b=this;this.g=new _.L(vT);this.m=a;this.L=nU(a.getConfiguration());this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.h=new jU(a.getSurface().getUniqueCssClass());this.a=new fU(null,"clpp-text-container",{});this.w=new _.zv(a.getSurface(),this.ml.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
14
+ this.G=new _.oi(function(){oU(b)});this.A=new Map;this.l=null},nU=function(a){a=_.N.xb(a.htmlcue||{});_.N.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.N.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},qU=function(a,b){return a.startTime<=b&&a.endTime>b},oU=function(a,b){if((b||a.j)&&a.D){var c=a.m.getPosition(),d;!(d=b)&&(d=a.J!==c)&&(d=a.m instanceof _.X?3===a.m.getState():8===a.m.getState());if(d&&(a.J=c,d=rU(a,c),(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&
15
+ c.start===d.start&&c.end===d.end)),c&&(a.l=d,sU(a),d))){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Xv(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.v(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,k=null;switch(e.payloadType){case _.Tg:k="clpp-text-vtt";break;case _.xg:k=uT;break;case _.Lj:k=tT}k&&!g.classList.contains(k)&&_.rr(g,k);g=NT(f.a.a);if(0===g.width||0===g.height)f.g.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");
16
+ else{ET({fontSize:tU(f,e.containerRows)},f.a.a);g=null;k=e.payloadType===_.Tg;var l=e.payloadType===_.xg;e.region&&(k||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new gU(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new ST(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}},rU=function(a,b){var c=zT(a.f,function(e){return qU(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&qU(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
+ qU(a.f[c+1],b);)c++;return{start:d,end:c}},uU=function(a){sU(a);a.J=null;a.l=null;a.f=[]},sU=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(uT);b.classList.remove(tT);a=a.a;eU(a.h);a.l=[]}},tU=function(a,b){var c=NT(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Kf}if(typeof b===_.h&&0<b)return Math.round(c/b)+_.Kf;d=a.getFontSizePercent();return Math.round(c*d)+_.Kf},vU=function(){},
18
+ wU=function(){};
19
+ AT.prototype.parse=function(a){a={input:a};for(var b=_.tr(_.Sd),c=[],d=b,e;null!==(e=BT(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var k=xU[f];k?(k=_.tr(k),(f=yU[f])&&g&&k.setAttribute(f,g.trim()),g=k):g=null;!g||zU[g.localName]&&zU[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
20
+ d=g)}}else d.appendChild(document.createTextNode(DT(e)));return b};var xU={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},yU={v:"voice",lang:"lang"},zU={rt:"ruby"},CT={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};RT.prototype.init=function(){this.j=!0};RT.prototype.A=function(){return!1};_.w(ST,RT);ST.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
+ ST.prototype.init=function(a){RT.prototype.init.call(this,a);if(this.h)_.rr(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.xg){var c=_.tr(_.Sd);c.innerHTML=b.payload;b=c}else b.payloadType===_.Tg?b=(new AT).parse(b.payload):(c=_.tr(_.Sd),c.textContent=b.payload,b=c);_.rr(b,this.w);this.id&&(b.id=this.id);c=_.v(this.f.cssClassList);for(var d=
22
+ c.next();!d.done;d=c.next())_.rr(b,d.value);ET({writingMode:bU(this)},b);this.a.appendChild(b);_.rr(this.a,"clpp-text-wrapper");c=_.v(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.rr(this.a,"clpp-text-wrapper__"+d.value);_.N.R(this.f.line)&&(this.f.lineInterpretation=_.Oj,this.f.line=TT(this)?-1:0);c=bU(this);ET({writingMode:c,webkitWritingMode:c,direction:wT,textAlign:$T(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=ZT(this,aU(this));d=YT(this,c,null);var e=XT(this,
23
+ c,null),f=WT(this)&&_.N.R(null)?GT(0,_.Kf):wT;ET({position:"absolute",left:d,right:f,top:e,width:TT(this)?GT(this.f.size,"%"):wT,height:VT(this)||WT(this)?GT(this.f.size,"%"):wT},this.a);d=this.f;a=TT(this)?a.height:a.width;e=UT(this);if(d.lineInterpretation===_.Oj)f=e*Math.round(d.line),Math.abs(f)>a&&(f=e*(0>d.line?0:-1)),0>f&&(f+=a);else{f=e/a*100;var g=d.line;switch(d.lineAlign){case _.md:g-=f/2;break;case _.je:g-=f}f=Math.round(g/100*a)}WT(this)&&(f=a-f-e);a=f;d=YT(this,c,a);e=WT(this)&&_.N.R(a)?
24
+ GT(0,_.Kf):wT;ET({left:d,right:e,top:XT(this,c,a)},this.a)}FT(this.D,b)}};ST.prototype.o=function(){return _.tr(_.Sd)};cU.prototype.append=function(a){var b=a.a;b.style.visibility=_.re;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=NT(a.a);var d=dU(this,a.f),e=UT(a),f=MT(c),g=null,k=0;d=_.v(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;QT(c,this.a,l)||PT(c,this.a)&&OT(c,this.h);){var m=c,n=e;switch(l){case "+x":m.left+=n;m.f+=n;break;case "-x":m.left-=n;m.f-=n;break;case "+y":m.top+=n;m.a+=n;break;case "-y":m.top-=n,m.a-=n}}if(this.j||PT(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
25
+ l.f)-Math.max(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>k&&(g=MT(c),k=l);c=MT(f)}c=g||f}ET({top:GT(c.top-this.a.top,_.Kf),bottom:GT(this.a.a-c.a,_.Kf),left:GT(c.left-this.a.left,_.Kf),right:GT(this.a.f-c.f,_.Kf),height:GT(c.height,_.Kf),width:GT(c.width,_.Kf)},a.a)}b.style.visibility="visible";this.h.push(NT(a.a))};_.w(fU,RT);fU.prototype.init=function(){this.h=new cU(this);this.j=!0};fU.prototype.o=function(){var a=_.tr(_.Sd);_.rr(a,this.w);this.id&&(a.id=this.id);return a};fU.prototype.appendChild=function(a){eU(this.h);this.l.unshift(a);a=_.v(this.l);for(var b=a.next();!b.done;b=a.next())this.h.append(b.value)};_.w(gU,fU);
26
+ gU.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Sj:b=b.width/100*a.width;break a;default:throw Error(sT);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Sj)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(sT);d=a.height;var e=hU(this,d,a.height);ET(this.B,this.a);ET({left:GT(c,_.Kf),top:GT(e,_.Kf),width:GT(b,_.Kf),height:GT(d,_.Kf)},this.a);this.f.writingMode&&ET({display:"flex",
27
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&ET({"justify-content":this.f.displayAlign},this.a);b=_.v(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.rr(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Sj:b=b.height/100*a.height;break a;case 2:b=b.height;d=new ST(new _.Rj(0,1,"Lorem ipsum",_.Lj),{},{});c=d.a;this.a.appendChild(c);d.init(NT(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(sT);
28
+ }a=hU(this,b,a.height);ET({top:GT(a,_.Kf),height:GT(b,_.Kf)},this.a);this.h=new cU(this,!0);this.j=!0};gU.prototype.getId=function(){return this.f.id};jU.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=lU(this,a);if(kU(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.g.debug("Added CSS rule "+b)}catch(c){this.g.error("An error occurred when adding a CSS rule: "+b)}this.l.push(a)}else this.g.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
29
+ jU.prototype.destroy=function(){var a=this;return _.I(function(b){if(null==a.a)return b["return"]();a.j.forEach(function(c){return c()});a.j=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.z(b)})};_.w(pU,_.Sv);_.r=pU.prototype;_.r.getClass=function(){return _.se};_.r.isRenderer=function(){return!0};_.r.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.v(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=yT(this.f,xT(a));this.l=null;oU(this,!1)}};_.r.fc=function(){null==this.h||oU(this,!0)};
30
+ _.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();uU(a);a.G.stop();return _.x(b,a.h.destroy(),2)}a.h=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.z(b)})};_.r.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;oU(this,!0);return!0};_.r.isTextVisible=function(){return this.j};
31
+ _.r.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.Rb(.25),this.L.enableResizeObserver&&this.w.start(),oU(this,!0)):(this.G.stop(),this.w.stop(),uU(this)))};_.r.ml=function(){oU(this,!0)};_.J(vT,pU);pU.prototype.setTextVisibility=pU.prototype.setTextVisibility;pU.prototype.isTextVisible=pU.prototype.isTextVisible;pU.prototype.remove=pU.prototype.remove;pU.prototype.destroy=pU.prototype.destroy;pU.prototype.append=pU.prototype.append;vU.prototype.a=function(a){return!!a.enableHtmlCue&&!_.yi()};vU.prototype.create=function(a){return new pU(a)};_.w(wU,_.Ju);wU.prototype.install=function(){_.xq(_.se,new vU)};wU.prototype.uninstall=function(){_.vq.has(_.se)&&(_.vq["delete"](_.se),_.wq.info("Removed factory: 'html'"))};wU.prototype.id=function(){return"subtitles-htmlcue"};_.J("clpp.htmlcue.HtmlCueComponent",wU);};
32
32
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
33
33
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
34
34
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.ima.js CHANGED
@@ -1,30 +1,30 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var WS="clpp.ima.AdsManagerFactory",XS=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},YS=function(){},ZS=function(a){this.a=a},$S=function(){this.a=this.h=this.f=null},aT=function(){return!window.google||!google.ima||!google.ima.AdsLoader},bT=function(){},cT=function(a){var b=a.ye("ima");if(!b)throw Error("IMA plugin not created.");var c=b.Hd(),d=b.h;b=b.a;if(!c||!d||!b)throw Error("IMA plugin not initialized.");var e=a.getSurface().getMedia();if(!e)throw Error("Missing media element.");
3
- this.m=a;this.o=e;a=this.m.getConfiguration();a=_.N.wb(a.ima||{});this.A=_.N.ta({disableCustomPlayback:!1},a);this.X=c;this.ba=d;this.j=b;this.T=new _.Av;this.g=new _.L("clpp.ima");this.a=null;this.P=!1;this.h=null;this.f=new _.ol;this.W=!1;this.L=new _.ki;this.ha=new YS;this.w=null;this.l=this.M=!1;this.H=1;this.J=this.B=this.D=!1;this.I=this.K=null;this.G=!0;c=this.L;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.An.bind(this));
4
- c.on(this.j,d,this.zn.bind(this));c.on(this.m,_.ke,this.Jn.bind(this))},dT=function(a){var b=a.a,c=a.L,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.pn.bind(a));c.on(b,d.LOADED,a.ql.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Kn.bind(a));c.on(b,d.STARTED,a.tl.bind(a));c.on(b,d.LOG,a.tn.bind(a));c.on(b,d.AD_PROGRESS,a.rl.bind(a));c.on(b,d.AD_BUFFERING,a.qn.bind(a));c.on(b,d.FIRST_QUARTILE,a.ol.bind(a));c.on(b,d.MIDPOINT,a.un.bind(a));c.on(b,d.THIRD_QUARTILE,a.ul.bind(a));c.on(b,d.PAUSED,a.wn.bind(a));
5
- c.on(b,d.RESUMED,a.xn.bind(a));c.on(b,d.CLICK,a.nl.bind(a));c.on(b,d.SKIPPED,a.sl.bind(a));c.on(b,d.IMPRESSION,a.pl.bind(a));c.on(b,d.COMPLETE,a.rn.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Ln.bind(a))},eT=function(a){a=a.A;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.h&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.bd?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.h&&(b.loadVideoTimeout=a.loadVideoTimeout);
6
- Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.h&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.bd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},gT=function(a){_.I(function(b){switch(b.a){case 1:return a.I=a.m.getPosition(),_.x(b,fT(a,[8,10,11]),2);case 2:return _.x(b,a.m.pause(),3);case 3:return _.x(b,a.m.detach(),4);case 4:a.a.start(),_.z(b)}})},iT=function(a){a.M=!1;
7
- a.w=null;hT(a,_.zc);a.m.getSurface().hide(a.X)},fT=function(a,b){return _.I(function(c){return c["return"](new Promise(function(d,e){var f=setTimeout(function(){clearInterval(g);e(Error("Timeout waiting for player state"))},1E4),g=setInterval(function(){var k=a.m.getPlayerState();3===k?(clearInterval(g),clearTimeout(f),e(Error("Player entered error state"))):b.includes(k)&&(clearInterval(g),clearTimeout(f),d())},200)}))})},jT=function(a){_.rr(a.o,{visibility:"visible"})},hT=function(a,b,c){c=c&&c.getAd();
8
- var d=null;c&&(d={ad:new XS(c,a.D,a.B)});a.m.trigger(new _.R(b,d))},kT=function(a,b){var c=b?a.ha.create(b.getErrorCode()):null;a.m.onError(new _.O(1,9,10003,{errorType:c},b))},lT=function(a){var b=_.si()||_.ti()||_.xi();return!1===a.A.disableCustomPlayback&&b},mT=function(a){return lT(a)&&a.a.isCustomPlaybackUsed()},oT=function(a){var b,c;_.I(function(d){if(1==d.a)return a.ba.initialize(),b=!!a.m.getConfiguration().muted,_.x(d,a.T.canPlay(b),2);c=d.f;if(!c&&!mT(a))return hT(a,_.$c),a.g.warn(_.qa),
9
- d["return"]();nT(a);_.z(d)})},nT=function(a){a.a.init(a.o.offsetWidth,a.o.offsetHeight,google.ima.ViewMode.NORMAL);mT(a)?a.A.isVast&&gT(a):a.a.start();a.W=!0},pT=function(){this.Ea=new _.L(WS)};_.r=XS.prototype;_.r.lb=function(){return"Google IMA SDK"};_.r.nb=function(){return google.ima.VERSION};_.r.pb=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.Ib=function(){return""};_.r.getApiFramework=function(){return this.a.getApiFramework()};
10
- _.r.getAdSystem=function(){return this.a.getAdSystem()};_.r.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.r.getTitle=function(){return this.a.getTitle()};_.r.getDuration=function(){return this.a.getDuration()};_.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.r.Kb=function(){return this.f?this.f.getIsBumper():!1};
11
- _.r.$a=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Ue&&typeof b[d].clickThroughUrl===_.hg});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.fb=function(){return this.a.getVastMediaWidth()};_.r.eb=function(){return this.a.getVastMediaHeight()};_.r.Ga=function(){return this.a.getVastMediaBitrate()};_.r.Ha=function(){return this.h?_.Bk:this.j?_.Ek:0};
12
- _.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.yb=function(){return this.f?this.f.getTimeOffset():0};_.r.ob=function(){return this.f?this.f.getAdPosition():1};_.r.gb=function(){return this.f?this.f.getTotalAds():1};_.r.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.r.Jb=function(){return null};
13
- XS.prototype.getVideoElement=XS.prototype.Jb;XS.prototype.getWrapperCreativeIds=XS.prototype.getWrapperCreativeIds;XS.prototype.getWrapperAdSystems=XS.prototype.getWrapperAdSystems;XS.prototype.canSeek=XS.prototype.canSeek;XS.prototype.getWrapperAdIds=XS.prototype.getWrapperAdIds;XS.prototype.getSequenceLength=XS.prototype.gb;XS.prototype.getPositionInSequence=XS.prototype.ob;XS.prototype.getPodTimeOffset=XS.prototype.yb;XS.prototype.getPodIndex=XS.prototype.getPodIndex;XS.prototype.getPodType=XS.prototype.Ha;
14
- XS.prototype.getMediaBitrate=XS.prototype.Ga;XS.prototype.getMediaHeight=XS.prototype.eb;XS.prototype.getMediaWidth=XS.prototype.fb;XS.prototype.getMediaUrl=XS.prototype.getMediaUrl;XS.prototype.getClickThroughUrl=XS.prototype.$a;XS.prototype.isBumper=XS.prototype.Kb;XS.prototype.getSkipTimeOffset=XS.prototype.getSkipTimeOffset;XS.prototype.getPosition=XS.prototype.getPosition;XS.prototype.getDuration=XS.prototype.getDuration;XS.prototype.getTitle=XS.prototype.getTitle;
15
- XS.prototype.getAdvertiserName=XS.prototype.getAdvertiserName;XS.prototype.getAdSystem=XS.prototype.getAdSystem;XS.prototype.getApiFramework=XS.prototype.getApiFramework;XS.prototype.getSourceId=XS.prototype.Ib;XS.prototype.getCreativeId=XS.prototype.getCreativeId;XS.prototype.getId=XS.prototype.getId;XS.prototype.getTechnology=XS.prototype.pb;XS.prototype.getAdManagerVersion=XS.prototype.nb;XS.prototype.getAdManagerName=XS.prototype.lb;YS.prototype.create=function(a){var b=google.ima.AdError.ErrorCode;switch(a){case b.VAST_LOAD_TIMEOUT:case b.VAST_MEDIA_LOAD_TIMEOUT:case b.FAILED_TO_REQUEST_ADS:return 0;case b.VIDEO_PLAY_ERROR:return 1;default:return 2}};ZS.prototype.getCuePoints=function(){return this.a};ZS.prototype.$b=function(){return 0<=this.a.indexOf(0)||0===this.a.length};ZS.prototype.Zb=function(){return 0<=this.a.indexOf(-1)};ZS.prototype.hasPostroll=ZS.prototype.Zb;ZS.prototype.hasPreroll=ZS.prototype.$b;ZS.prototype.getCuePoints=ZS.prototype.getCuePoints;_.w($S,_.hw);_.r=$S.prototype;_.r.onPlayerCreated=function(a){if(aT())return a.onError(new _.O(1,9,1E4));this.f=_.pr(_.Sd,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.Ba);this.a.getSettings().setPlayerVersion(_.ja);this.a.getSettings().setAutoPlayAdBreaks(!0)};
16
- _.r.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.r.pm=function(){return this.a};_.r.nm=function(){return this.h};_.r.Hd=function(){return this.f};_.r.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",$S);$S.prototype.getAdContainer=$S.prototype.Hd;$S.prototype.getAdDisplayContainer=$S.prototype.nm;$S.prototype.getAdsLoader=$S.prototype.pm;$S.Id="ima";
17
- $S.isSdkMissing=aT;bT.prototype.create=function(){return new $S};_.r=cT.prototype;
18
- _.r.An=function(a){var b=this;this.a=a.getAdsManager(this.o,eT(this));this.a.isCustomPlaybackUsed()&&!lT(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.O(1,9,10002)),this.Ac()):(this.setMuted(this.l),this.Pa(this.H),this.h=new _.yv(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.K=new ZS(a),this.m.trigger(new _.R(_.Dc,{adsTimeline:this.K})),
19
- dT(this));this.f.resolve()};_.r.zn=function(a){kT(this,a.getError());this.f.resolve()};_.r.Kn=function(a){this.J=!0;mT(this)||(this.m.pause(),_.rr(this.o,{visibility:_.re}));hT(this,_.gc,a);this.h.start()};_.r.pn=function(){mT(this)?gT(this):this.a.start()};_.r.ql=function(a){a.getAd().isLinear()?hT(this,_.qc,a):(this.a.discardAdBreak(),this.D||(this.D=!0,this.m.play()))};_.r.tl=function(a){this.M=!0;this.G=!1;this.w=a.getAd().getDuration();hT(this,_.xc,a);this.m.getSurface().show(this.X)};
20
- _.r.tn=function(a){a=a.getAdData();kT(this,a?a.adError:null);iT(this)};_.r.rl=function(a){hT(this,_.uc,a)};_.r.qn=function(a){hT(this,_.ic,a)};_.r.ol=function(a){hT(this,_.lc,a)};_.r.un=function(a){hT(this,_.rc,a)};_.r.ul=function(a){hT(this,_.Bc,a)};_.r.wn=function(a){this.G=!0;hT(this,_.tc,a)};_.r.xn=function(a){this.G=!1;hT(this,_.vc,a)};_.r.nl=function(a){this.pause();hT(this,_.jc,a)};_.r.sl=function(a){hT(this,_.wc,a);iT(this)};_.r.pl=function(a){hT(this,_.pc,a)};
21
- _.r.rn=function(a){hT(this,_.kc,a);iT(this)};
22
- _.r.Ln=function(){var a=this,b,c;return _.I(function(d){switch(d.a){case 1:a.D=!0;if(!mT(a)||null===a.I){if(!a.J)return d["return"](a.m.play());jT(a);d.C(2);break}b=a.m.getVolume();c=a.m.isMuted();var e=a.m;e.a&&e.a.forwardEventsTo(e);e=a.m;e.f=_.N.ta(e.f,{volume:b,muted:c});return _.x(d,_.$t(a.m),3);case 3:if(a.B||!a.I){d.C(2);break}return _.x(d,fT(a,[6,8,10,11]),5);case 5:return _.x(d,a.m.play(),6);case 6:return _.x(d,a.m.pause(),7);case 7:return _.x(d,fT(a,[10,11]),8);case 8:return _.x(d,a.m.setPosition(a.I),
23
- 2);case 2:a.J=!1;a.h&&a.h.stop();if(a.B){d.C(10);break}return _.x(d,a.m.play(),10);case 10:hT(a,_.hc),_.z(d)}})};_.r.Jn=function(){this.B=!0;this.j.contentComplete()};
2
+ var f=function(window){var XS="clpp.ima.AdsManagerFactory",YS=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},ZS=function(){},$S=function(a){this.a=a},aT=function(){this.a=this.h=this.f=null},bT=function(){return!window.google||!google.ima||!google.ima.AdsLoader},cT=function(){},dT=function(a){var b=a.ye("ima");if(!b)throw Error("IMA plugin not created.");var c=b.Hd(),d=b.h;b=b.a;if(!c||!d||!b)throw Error("IMA plugin not initialized.");var e=a.getSurface().getMedia();if(!e)throw Error("Missing media element.");
3
+ this.m=a;this.o=e;a=this.m.getConfiguration();a=_.N.xb(a.ima||{});this.A=_.N.ta({disableCustomPlayback:!1},a);this.X=c;this.ba=d;this.j=b;this.T=new _.Bv;this.g=new _.L("clpp.ima");this.a=null;this.P=!1;this.h=null;this.f=new _.pl;this.W=!1;this.L=new _.gi;this.ha=new ZS;this.w=null;this.l=this.M=!1;this.H=1;this.J=this.B=this.D=!1;this.I=this.K=null;this.G=!0;c=this.L;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Cn.bind(this));
4
+ c.on(this.j,d,this.Bn.bind(this));c.on(this.m,_.ke,this.Ln.bind(this))},eT=function(a){var b=a.a,c=a.L,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.rn.bind(a));c.on(b,d.LOADED,a.ql.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Mn.bind(a));c.on(b,d.STARTED,a.tl.bind(a));c.on(b,d.LOG,a.vn.bind(a));c.on(b,d.AD_PROGRESS,a.rl.bind(a));c.on(b,d.AD_BUFFERING,a.sn.bind(a));c.on(b,d.FIRST_QUARTILE,a.ol.bind(a));c.on(b,d.MIDPOINT,a.wn.bind(a));c.on(b,d.THIRD_QUARTILE,a.ul.bind(a));c.on(b,d.PAUSED,a.yn.bind(a));
5
+ c.on(b,d.RESUMED,a.zn.bind(a));c.on(b,d.CLICK,a.nl.bind(a));c.on(b,d.SKIPPED,a.sl.bind(a));c.on(b,d.IMPRESSION,a.pl.bind(a));c.on(b,d.COMPLETE,a.tn.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Nn.bind(a))},fT=function(a){a=a.A;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.h&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.bd?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.h&&(b.loadVideoTimeout=a.loadVideoTimeout);
6
+ Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.h&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.bd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},hT=function(a){_.I(function(b){switch(b.a){case 1:return a.I=a.m.getPosition(),_.x(b,gT(a,[8,10,11]),2);case 2:return _.x(b,a.m.pause(),3);case 3:return _.x(b,a.m.detach(),4);case 4:a.a.start(),_.z(b)}})},jT=function(a){a.M=!1;
7
+ a.w=null;iT(a,_.yc);a.m.getSurface().hide(a.X)},gT=function(a,b){return _.I(function(c){return c["return"](new Promise(function(d,e){var f=setTimeout(function(){clearInterval(g);e(Error("Timeout waiting for player state"))},1E4),g=setInterval(function(){var k=a.m.getPlayerState();3===k?(clearInterval(g),clearTimeout(f),e(Error("Player entered error state"))):b.includes(k)&&(clearInterval(g),clearTimeout(f),d())},200)}))})},kT=function(a){_.sr(a.o,{visibility:"visible"})},iT=function(a,b,c){c=c&&c.getAd();
8
+ var d=null;c&&(d={ad:new YS(c,a.D,a.B)});a.m.trigger(new _.R(b,d))},lT=function(a,b){var c=b?a.ha.create(b.getErrorCode()):null;a.m.onError(new _.O(1,9,10003,{errorType:c},b))},mT=function(a){var b=_.ti()||_.ui()||_.yi();return!1===a.A.disableCustomPlayback&&b},nT=function(a){return mT(a)&&a.a.isCustomPlaybackUsed()},pT=function(a){var b,c;_.I(function(d){if(1==d.a)return a.ba.initialize(),b=!!a.m.getConfiguration().muted,_.x(d,a.T.canPlay(b),2);c=d.f;if(!c&&!nT(a))return iT(a,_.$c),a.g.warn(_.qa),
9
+ d["return"]();oT(a);_.z(d)})},oT=function(a){a.a.init(a.o.offsetWidth,a.o.offsetHeight,google.ima.ViewMode.NORMAL);nT(a)?a.A.isVast&&hT(a):a.a.start();a.W=!0},qT=function(){this.va=new _.L(XS)};_.r=YS.prototype;_.r.nb=function(){return"Google IMA SDK"};_.r.ob=function(){return google.ima.VERSION};_.r.qb=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.Ib=function(){return""};_.r.getApiFramework=function(){return this.a.getApiFramework()};
10
+ _.r.getAdSystem=function(){return this.a.getAdSystem()};_.r.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.r.getTitle=function(){return this.a.getTitle()};_.r.getDuration=function(){return this.a.getDuration()};_.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.r.Lb=function(){return this.f?this.f.getIsBumper():!1};
11
+ _.r.ab=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Ue&&typeof b[d].clickThroughUrl===_.hg});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.gb=function(){return this.a.getVastMediaWidth()};_.r.fb=function(){return this.a.getVastMediaHeight()};_.r.Ga=function(){return this.a.getVastMediaBitrate()};_.r.Ha=function(){return this.h?_.Ck:this.j?_.Fk:0};
12
+ _.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.zb=function(){return this.f?this.f.getTimeOffset():0};_.r.pb=function(){return this.f?this.f.getAdPosition():1};_.r.hb=function(){return this.f?this.f.getTotalAds():1};_.r.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.r.Jb=function(){return null};
13
+ YS.prototype.getVideoElement=YS.prototype.Jb;YS.prototype.getWrapperCreativeIds=YS.prototype.getWrapperCreativeIds;YS.prototype.getWrapperAdSystems=YS.prototype.getWrapperAdSystems;YS.prototype.canSeek=YS.prototype.canSeek;YS.prototype.getWrapperAdIds=YS.prototype.getWrapperAdIds;YS.prototype.getSequenceLength=YS.prototype.hb;YS.prototype.getPositionInSequence=YS.prototype.pb;YS.prototype.getPodTimeOffset=YS.prototype.zb;YS.prototype.getPodIndex=YS.prototype.getPodIndex;YS.prototype.getPodType=YS.prototype.Ha;
14
+ YS.prototype.getMediaBitrate=YS.prototype.Ga;YS.prototype.getMediaHeight=YS.prototype.fb;YS.prototype.getMediaWidth=YS.prototype.gb;YS.prototype.getMediaUrl=YS.prototype.getMediaUrl;YS.prototype.getClickThroughUrl=YS.prototype.ab;YS.prototype.isBumper=YS.prototype.Lb;YS.prototype.getSkipTimeOffset=YS.prototype.getSkipTimeOffset;YS.prototype.getPosition=YS.prototype.getPosition;YS.prototype.getDuration=YS.prototype.getDuration;YS.prototype.getTitle=YS.prototype.getTitle;
15
+ YS.prototype.getAdvertiserName=YS.prototype.getAdvertiserName;YS.prototype.getAdSystem=YS.prototype.getAdSystem;YS.prototype.getApiFramework=YS.prototype.getApiFramework;YS.prototype.getSourceId=YS.prototype.Ib;YS.prototype.getCreativeId=YS.prototype.getCreativeId;YS.prototype.getId=YS.prototype.getId;YS.prototype.getTechnology=YS.prototype.qb;YS.prototype.getAdManagerVersion=YS.prototype.ob;YS.prototype.getAdManagerName=YS.prototype.nb;ZS.prototype.create=function(a){var b=google.ima.AdError.ErrorCode;switch(a){case b.VAST_LOAD_TIMEOUT:case b.VAST_MEDIA_LOAD_TIMEOUT:case b.FAILED_TO_REQUEST_ADS:return 0;case b.VIDEO_PLAY_ERROR:return 1;default:return 2}};$S.prototype.getCuePoints=function(){return this.a};$S.prototype.$b=function(){return 0<=this.a.indexOf(0)||0===this.a.length};$S.prototype.Kb=function(){return 0<=this.a.indexOf(-1)};$S.prototype.hasPostroll=$S.prototype.Kb;$S.prototype.hasPreroll=$S.prototype.$b;$S.prototype.getCuePoints=$S.prototype.getCuePoints;_.w(aT,_.iw);_.r=aT.prototype;_.r.onPlayerCreated=function(a){if(bT())return a.onError(new _.O(1,9,1E4));this.f=_.qr(_.Sd,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.Ba);this.a.getSettings().setPlayerVersion(_.ja);this.a.getSettings().setAutoPlayAdBreaks(!0)};
16
+ _.r.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.r.pm=function(){return this.a};_.r.nm=function(){return this.h};_.r.Hd=function(){return this.f};_.r.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",aT);aT.prototype.getAdContainer=aT.prototype.Hd;aT.prototype.getAdDisplayContainer=aT.prototype.nm;aT.prototype.getAdsLoader=aT.prototype.pm;aT.Id="ima";
17
+ aT.isSdkMissing=bT;cT.prototype.create=function(){return new aT};_.r=dT.prototype;
18
+ _.r.Cn=function(a){var b=this;this.a=a.getAdsManager(this.o,fT(this));this.a.isCustomPlaybackUsed()&&!mT(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.O(1,9,10002)),this.Bc()):(this.setMuted(this.l),this.Pa(this.H),this.h=new _.zv(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.K=new $S(a),this.m.trigger(new _.R(_.Dc,{adsTimeline:this.K})),
19
+ eT(this));this.f.resolve()};_.r.Bn=function(a){lT(this,a.getError());this.f.resolve()};_.r.Mn=function(a){this.J=!0;nT(this)||(this.m.pause(),_.sr(this.o,{visibility:_.re}));iT(this,_.gc,a);this.h.start()};_.r.rn=function(){nT(this)?hT(this):this.a.start()};_.r.ql=function(a){a.getAd().isLinear()?iT(this,_.qc,a):(this.a.discardAdBreak(),this.D||(this.D=!0,this.m.play()))};_.r.tl=function(a){this.M=!0;this.G=!1;this.w=a.getAd().getDuration();iT(this,_.xc,a);this.m.getSurface().show(this.X)};
20
+ _.r.vn=function(a){a=a.getAdData();lT(this,a?a.adError:null);jT(this)};_.r.rl=function(a){iT(this,_.uc,a)};_.r.sn=function(a){iT(this,_.ic,a)};_.r.ol=function(a){iT(this,_.lc,a)};_.r.wn=function(a){iT(this,_.rc,a)};_.r.ul=function(a){iT(this,_.Ac,a)};_.r.yn=function(a){this.G=!0;iT(this,_.sc,a)};_.r.zn=function(a){this.G=!1;iT(this,_.vc,a)};_.r.nl=function(a){this.pause();iT(this,_.jc,a)};_.r.sl=function(a){iT(this,_.wc,a);jT(this)};_.r.pl=function(a){iT(this,_.pc,a)};
21
+ _.r.tn=function(a){iT(this,_.kc,a);jT(this)};
22
+ _.r.Nn=function(){var a=this,b,c;return _.I(function(d){switch(d.a){case 1:a.D=!0;if(!nT(a)||null===a.I){if(!a.J)return d["return"](a.m.play());kT(a);d.C(2);break}b=a.m.getVolume();c=a.m.isMuted();var e=a.m;e.a&&e.a.forwardEventsTo(e);e=a.m;e.f=_.N.ta(e.f,{volume:b,muted:c});return _.x(d,_.au(a.m),3);case 3:if(a.B||!a.I){d.C(2);break}return _.x(d,gT(a,[6,8,10,11]),5);case 5:return _.x(d,a.m.play(),6);case 6:return _.x(d,a.m.pause(),7);case 7:return _.x(d,gT(a,[10,11]),8);case 8:return _.x(d,a.m.setPosition(a.I),
23
+ 2);case 2:a.J=!1;a.h&&a.h.stop();if(a.B){d.C(10);break}return _.x(d,a.m.play(),10);case 10:iT(a,_.hc),_.z(d)}})};_.r.Ln=function(){this.B=!0;this.j.contentComplete()};
24
24
  _.r.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.A;try{if(typeof c.adTagUrl!==_.hg)throw new _.O(1,9,10001,{missingKeys:"adTagUrl"});}catch(k){return b.onError(k),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.T.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.T.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(f);
25
- return g["return"](a.f)})};_.r.Bb=function(){if(this.P||!this.a||this.P)return!0;if(!this.W){if(this.K.$b())return oT(this),!1;this.ba.initialize();nT(this);return!0}return this.zb()&&this.a?(this.a.resume(),!1):!0};_.r.Sc=function(){};_.r.Pc=function(){return!0};_.r.Sa=function(){this.a&&this.a.pause()};_.r.isPaused=function(){return this.G};_.r.skip=function(){this.a&&this.a.skip()};_.r.getAdVolume=function(){return this.a?this.l?this.H:this.a.getVolume():1};
26
- _.r.Pa=function(a){this.H=a;this.a&&(this.l||this.a.setVolume(a))};_.r.setVolume=function(a){this.Pa(a)};_.r.getVolume=function(){return this.getAdVolume()};_.r.pause=function(){this.Sa()};_.r.resume=function(){this.Bb()};_.r.setMuted=function(a){this.l=a;this.a&&(a?this.a.setVolume(0):this.a.setVolume(this.H))};_.r.isMuted=function(){return this.l};_.r.zb=function(){return this.M};_.r.getPosition=function(){if(!this.a||null===this.w)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.w-a};
27
- _.r.Ac=function(){this.a&&(this.a.destroy(),this.a=null);this.P=!0;jT(this);this.L.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};cT.prototype.getPosition=cT.prototype.getPosition;cT.prototype.resume=cT.prototype.resume;cT.prototype.pause=cT.prototype.pause;cT.prototype.getVolume=cT.prototype.getVolume;cT.prototype.setVolume=cT.prototype.setVolume;cT.prototype.getAdVolume=cT.prototype.getAdVolume;cT.prototype.skip=cT.prototype.skip;cT.prototype.pauseAd=cT.prototype.Sa;pT.prototype.name=function(){return WS};pT.prototype.a=function(a,b){return a.namespace()===_.wd?!1:aT()?(this.Ea.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};pT.prototype.create=function(a){return new cT(a)};_.Yq(new pT);_.eu(new bT);};
25
+ return g["return"](a.f)})};_.r.Bb=function(){if(this.P||!this.a||this.P)return!0;if(!this.W){if(this.K.$b())return pT(this),!1;this.ba.initialize();oT(this);return!0}return this.Sa()&&this.a?(this.a.resume(),!1):!0};_.r.Tc=function(){};_.r.Qc=function(){return!0};_.r.Ta=function(){this.a&&this.a.pause()};_.r.isPaused=function(){return this.G};_.r.skip=function(){this.a&&this.a.skip()};_.r.getAdVolume=function(){return this.a?this.l?this.H:this.a.getVolume():1};
26
+ _.r.Pa=function(a){this.H=a;this.a&&(this.l||this.a.setVolume(a))};_.r.setVolume=function(a){this.Pa(a)};_.r.getVolume=function(){return this.getAdVolume()};_.r.pause=function(){this.Ta()};_.r.resume=function(){this.Bb()};_.r.setMuted=function(a){this.l=a;this.a&&(a?this.a.setVolume(0):this.a.setVolume(this.H))};_.r.isMuted=function(){return this.l};_.r.Sa=function(){return this.M};_.r.getPosition=function(){if(!this.a||null===this.w)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.w-a};
27
+ _.r.Bc=function(){this.a&&(this.a.destroy(),this.a=null);this.P=!0;kT(this);this.L.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};dT.prototype.getPosition=dT.prototype.getPosition;dT.prototype.resume=dT.prototype.resume;dT.prototype.pause=dT.prototype.pause;dT.prototype.getVolume=dT.prototype.getVolume;dT.prototype.setVolume=dT.prototype.setVolume;dT.prototype.getAdVolume=dT.prototype.getAdVolume;dT.prototype.skip=dT.prototype.skip;dT.prototype.pauseAd=dT.prototype.Ta;qT.prototype.name=function(){return XS};qT.prototype.a=function(a,b){return a.namespace()===_.wd?!1:bT()?(this.va.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};qT.prototype.create=function(a){return new dT(a)};_.Zq(new qT);_.fu(new cT);};
28
28
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
29
29
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
30
30
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var TS=function(){this.g=new _.L("clpp.mediatailor.MediaTailorPlugin")},US=function(a,b,c){var d,e,f,g,k;return _.I(function(l){if(1==l.a)return _.x(l,fetch(b,{method:_.pb,body:JSON.stringify(c.sessionConfig)}),2);if(3!=l.a)return d=l.f,_.x(l,d.json(),3);e=l.f;f=e.manifestUrl;g=e.trackingUrl;k={Dj:_.gk(f,b),nq:g?_.gk(g,b):null};a.g.info("Media Tailor session initialized.\n - manifest URI: "+k.Dj);return l["return"](k)})},VS=function(){};_.w(TS,_.hw);
3
- TS.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f;return _.I(function(g){if(1==g.a){d=a.getConfiguration().mediatailor;if(!d.enabled)return g["return"]();c.g.info("MediaTailor plugin is enabled");_.F(g,2);return _.x(g,US(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.R("mt-session-started")),b.url=e.Dj,_.G(g,0);f=_.H(g);c.g.error("Failed to start session",f);throw new _.O(_.Q,9,7003,"Media Tailor session failed to initialize.");})};TS.prototype.id=function(){return"mediatailor"};
4
- VS.prototype.create=function(){return new TS};_.eu(new VS);};
2
+ var f=function(window){var US=function(){this.g=new _.L("clpp.mediatailor.MediaTailorPlugin")},VS=function(a,b,c){var d,e,f,g,k;return _.I(function(l){if(1==l.a)return _.x(l,fetch(b,{method:_.pb,body:JSON.stringify(c.sessionConfig)}),2);if(3!=l.a)return d=l.f,_.x(l,d.json(),3);e=l.f;f=e.manifestUrl;g=e.trackingUrl;k={Dj:_.hk(f,b),pq:g?_.hk(g,b):null};a.g.info("Media Tailor session initialized.\n - manifest URI: "+k.Dj);return l["return"](k)})},WS=function(){};_.w(US,_.iw);
3
+ US.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f;return _.I(function(g){if(1==g.a){d=a.getConfiguration().mediatailor;if(!d.enabled)return g["return"]();c.g.info("MediaTailor plugin is enabled");_.F(g,2);return _.x(g,VS(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.R("mt-session-started")),b.url=e.Dj,_.G(g,0);f=_.H(g);c.g.error("Failed to start session",f);throw new _.O(_.Q,9,7003,"Media Tailor session failed to initialize.");})};US.prototype.id=function(){return"mediatailor"};
4
+ WS.prototype.create=function(){return new US};_.fu(new WS);};
5
5
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
6
6
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
7
7
  else{_=this.clpp._;(f.call(g,this));}