@castlabs/prestoplay 6.9.0 → 6.11.0

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 (60) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +112 -111
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +467 -432
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +72 -72
  10. package/cjs/cl.externs.js +143 -45
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +78 -73
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -31
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mse.js +276 -275
  17. package/cjs/cl.muxdata.js +14 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +71 -71
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +29 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +19 -19
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +20 -20
  30. package/cl.adobe.js +3 -3
  31. package/cl.airplay.js +3 -3
  32. package/cl.broadpeak.js +5 -5
  33. package/cl.cast.js +88 -88
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +396 -365
  36. package/cl.crypto.js +9 -9
  37. package/cl.dash.js +68 -67
  38. package/cl.externs.js +139 -45
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +64 -61
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +26 -25
  43. package/cl.ima.js +17 -17
  44. package/cl.mse.js +240 -242
  45. package/cl.muxdata.js +12 -12
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +11 -11
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +59 -58
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +14 -14
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +15 -15
  58. package/clpp.styles.css +15 -0
  59. package/package.json +1 -1
  60. package/typings.d.ts +249 -21
package/cjs/cl.htmlcue.js CHANGED
@@ -1,35 +1,33 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var eK="CLPP Subtitle Styles",fK="Unsupported unit",gK="clpp-text-plain",hK="clpp-text-ttml",iK="clpp.htmlcue.HtmlTextDisplayer",jK="initial",kK=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},lK=function(){},mK=function(a){if(!a.input)return null;var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},oK=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],
3
- function(c){return nK[c]});return a},qK=function(a,b){pK(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){pK(a,c)})},pK=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},rK=function(a,b){return 0===a?"0":a+b},sK=function(a,b){return 1>Math.abs(a-b)||a<b},tK=function(a,b){return a<b&&1<Math.abs(a-b)},uK=function(a,b){return a>b&&1<Math.abs(a-b)},vK=function(a,b){return 1>Math.abs(a-b)||a>b},wK=function(a,b,c,d,e,f){this.f=a;this.g=b;this.j=c;this.a=d;this.height=e;this.width=
4
- f},xK=function(a){return new wK(a.f,a.g,a.j,a.a,a.height,a.width)},yK=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"))||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 wK(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
5
- d-e)},zK=function(a,b){return b.some(function(c){return tK(a.f,c.g)&&uK(a.g,c.f)&&tK(a.j,c.a)&&uK(a.a,c.j)})},AK=function(a,b){return vK(a.j,b.j)&&sK(a.a,b.a)&&vK(a.f,b.f)&&sK(a.g,b.g)},BK=function(a,b,c){switch(c){case "+x":return tK(a.f,b.f);case "-x":return uK(a.g,b.g);case "+y":return tK(a.j,b.j);case "-y":return uK(a.a,b.a);default:throw Error("Unknown axis");}},CK=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},DK=function(a,b,c){CK.call(this,a.id,"clpp-text-cue",{});
6
- this.m=b;this.f=a;this.g=!!this.f.backgroundImage;this.D=c},FK=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 EK(a)?b:c},IK=function(a,b,c){return EK(a)&&_.K.la(c)?rK(c,_.be):(GK(a)||HK(a))&&_.K.la(b)?rK(b,"%"):jK},GK=function(a){return a.f.writingMode===_.Ne},HK=function(a){return a.f.writingMode===_.Oe},EK=function(a){return a.f.writingMode===_.ug},JK=function(a,b,c){return(GK(a)||HK(a))&&_.K.la(c)?rK(c,_.be):
7
- GK(a)&&_.K.R(c)?rK(0,_.be):EK(a)&&_.K.la(b)?rK(b,"%"):jK},KK=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.sd:return a.f.position;case "auto":case _.Bc:return a.f.position-a.f.size/2;case _.td:return a.f.position-a.f.size}return 0},LK=function(a){switch(a.f.positionAlign){case _.sd:return _.pd;case "auto":case _.Bc:return _.tg;case _.td:return _.ie}return a.f.textAlign},MK=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.pd:case _.pd:return _.sd;
8
- case _.tg:return _.Bc;case _.ie:case _.ie:return _.td}return a.f.positionAlign},NK=function(a){switch(a.f.writingMode){case _.ug:return"horizontal-tb";case _.Ne:return _.Ne;case _.Oe:return _.Oe;default:throw Error("Unknown writing mode");}},OK=function(a,b){this.m=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=yK(a.a);this.g=[]},PK=function(a,b){if(a.j)switch(b.writingMode){case _.ug:return["-y"];case _.Ne:return["+x"];case _.Oe:return["-x"]}var c=[];switch(b.writingMode){case _.ug:c=["+y","-y"];break;
9
- case _.Ne:c=["+x","-x"];break;case _.Oe:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},QK=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=yK(a.m.a)},RK=function(a,b,c){CK.call(this,a,b,c);this.g=null;this.m=[]},SK=function(a,b){QK(a.g);a.m.unshift(b);for(var c=_.u(a.m),d=c.next();!d.done;d=c.next())a.g.append(d.value)},TK=function(a,b){RK.call(this,a.id,"clpp-text-cue-region",b);this.f=a},UK=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.zg)return a.viewportAnchorY/
10
- 100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(fK);},WK=function(a){this.h=new _.I("clpp.htmlcue.StyleManager");this.m=[];this.g=a.getSurface().getUniqueCssClass();this.j=[];this.a=VK(this,this.g);this.f=VK(this,this.g,!0);this.f.disabled=!0;this.h.debug("Stylesheet CLPP Subtitle Styles has been created.")},XK=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===
11
- e.trim().indexOf("."+a.g+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},YK=function(a,b){var c="."+a.g+" .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,c)},VK=function(a,b,c){var d=document.createElement(_.ve),e=d.dataset;e.name=eK;
12
- e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);ZK(a,b);a.h.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},ZK=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===eK&&a.h.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});c.observe(b,{subtree:!1,childList:!0});a.m.push(function(){return c.disconnect()})},
13
- bL=function(a){_.Qp.call(this,a);var b=this;this.h=new _.I(iK);this.l=a;this.M=$K(a);this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.g=new WK(a);this.a=new RK(null,"clpp-text-container",{});this.w=new _.mp(a.getSurface(),this.ei.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.h.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.F=new _.Wi(function(){aL(b)});
14
- this.A=new Map;this.m=null},$K=function(a){a=_.K.Ra(a.getConfiguration().htmlcue||{});_.K.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.K.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},cL=function(a,b){return a.startTime<=b&&a.endTime>b},aL=function(a,b){if((b||a.j)&&a.D){var c=a.l.getPosition();if(b||a.J!==c&&a.l.getState()===_.Xm){a.J=c;var d=dL(a,c);(c=b)||(c=a.m,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.m=d,eL(a),d)){c={color:a.getFontColor()||
15
- void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Vp(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.u(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,h=null;switch(e.payloadType){case _.We:h="clpp-text-vtt";break;case _.Fe:h=hK;break;case _.sg:h=gK}h&&!g.classList.contains(h)&&_.un(g,h);g=yK(f.a.a);if(0===g.width||0===g.height)f.h.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{pK({fontSize:fL(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.We;var l=e.payloadType===_.Fe;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new TK(e.region,{}),f.A.set(e.region.id,g),SK(f.a,g)));e=new DK(e,f.M,c);g?SK(g,e):SK(f.a,e)}}}}}},dL=function(a,b){var c=kK(a.f,function(e){return cL(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&cL(a.f[d-1],b);)d--;for(;c+1<a.f.length&&cL(a.f[c+1],b);)c++;return{start:d,
17
- end:c}},gL=function(a){eL(a);a.J=null;a.m=null;a.f=[]},eL=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(hK);b.classList.remove(gK);a=a.a;QK(a.g);a.m=[]}},fL=function(a,b){var c=yK(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.be}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.be;d=a.getFontSizePercent();return Math.round(c*d)+_.be},hL=function(){},iL=function(){};
18
- lK.prototype.parse=function(a){a={input:a};for(var b=_.wn(_.Xc),c=[],d=b,e;null!==(e=mK(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 h=jL[f];h?(h=_.wn(h),(f=kL[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||lL[g.localName]&&lL[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
19
- d=g)}}else d.appendChild(document.createTextNode(oK(e)));return b};var jL={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},kL={v:"voice",lang:"lang"},lL={rt:"ruby"},nK={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};CK.prototype.init=function(){this.j=!0};CK.prototype.A=function(){return!1};_.w(DK,CK);DK.prototype.A=function(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)};
20
- DK.prototype.init=function(a){CK.prototype.init.call(this,a);if(this.g)_.un(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.m.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.Fe){var c=_.wn(_.Xc);c.innerHTML=b.payload;b=c}else b.payloadType===_.We?b=(new lK).parse(b.payload):(c=_.wn(_.Xc),c.textContent=b.payload,b=c);_.un(b,this.w);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=
21
- c.next();!d.done;d=c.next())_.un(b,d.value);pK({writingMode:NK(this)},b);this.a.appendChild(b);_.un(this.a,"clpp-text-wrapper");c=_.u(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.un(this.a,"clpp-text-wrapper__"+d.value);_.K.R(this.f.line)&&(this.f.lineInterpretation=_.vg,this.f.line=EK(this)?-1:0);c=NK(this);pK({writingMode:c,webkitWritingMode:c,direction:jK,textAlign:LK(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=KK(this,MK(this));d=JK(this,c,null);var e=IK(this,
22
- c,null),f=HK(this)&&_.K.R(null)?rK(0,_.be):jK;pK({position:"absolute",left:d,right:f,top:e,width:EK(this)?rK(this.f.size,"%"):jK,height:GK(this)||HK(this)?rK(this.f.size,"%"):jK},this.a);d=this.f;a=EK(this)?a.height:a.width;e=FK(this);if(d.lineInterpretation===_.vg)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 _.Bc:g-=f/2;break;case _.ed:g-=f}f=Math.round(g/100*a)}HK(this)&&(f=a-f-e);a=f;d=JK(this,c,a);e=HK(this)&&_.K.R(a)?
23
- rK(0,_.be):jK;pK({left:d,right:e,top:IK(this,c,a)},this.a)}qK(this.D,b)}};DK.prototype.o=function(){return _.wn(_.Xc)};OK.prototype.append=function(a){var b=a.a;b.style.visibility=_.ld;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=yK(a.a);var d=PK(this,a.f),e=FK(a),f=xK(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;BK(c,this.a,l)||AK(c,this.a)&&zK(c,this.g);){var m=c,n=e;switch(l){case "+x":m.f+=n;m.g+=n;break;case "-x":m.f-=n;m.g-=n;break;case "+y":m.j+=n;m.a+=n;break;case "-y":m.j-=n,m.a-=n}}if(this.j||AK(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.g,l.g)-Math.max(c.f,
24
- l.f))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.j,l.j))/(c.height*c.width);l>h&&(g=xK(c),h=l);c=xK(f)}c=g||f}pK({top:rK(c.j-this.a.j,_.be),bottom:rK(this.a.a-c.a,_.be),left:rK(c.f-this.a.f,_.be),right:rK(this.a.g-c.g,_.be),height:rK(c.height,_.be),width:rK(c.width,_.be)},a.a)}b.style.visibility="visible";this.g.push(yK(a.a))};_.w(RK,CK);RK.prototype.init=function(){this.g=new OK(this);this.j=!0};RK.prototype.o=function(){var a=_.wn(_.Xc);_.un(a,this.w);this.id&&(a.id=this.id);return a};_.w(TK,RK);
25
- TK.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.zg:b=b.width/100*a.width;break a;default:throw Error(fK);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.zg)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(fK);d=a.height;var e=UK(this,d,a.height);pK(this.B,this.a);pK({left:rK(c,_.be),top:rK(e,_.be),width:rK(b,_.be),height:rK(d,_.be)},this.a);this.f.writingMode&&pK({display:"flex",
26
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&pK({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.un(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.zg:b=b.height/100*a.height;break a;case 2:b=b.height;d=new DK(new _.yg(0,1,"Lorem ipsum",_.sg),{},{});c=d.a;this.a.appendChild(c);d.init(yK(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(fK);
27
- }a=UK(this,b,a.height);pK({top:rK(a,_.be),height:rK(b,_.be)},this.a);this.g=new OK(this,!0);this.j=!0};TK.prototype.getId=function(){return this.f.id};WK.prototype.appendRule=function(a){if(null!=this.a&&!this.j.some(function(c){return c===a})){var b=YK(this,a);if(XK(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.h.debug("Added CSS rule "+b)}catch(c){this.h.error("An error occurred when adding a CSS rule: "+b)}this.j.push(a)}else this.h.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
28
- WK.prototype.destroy=function(){var a=this;return _.B(function(b){if(null==a.a)return b["return"]();a.m.forEach(function(c){return c()});a.m=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.j=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.h.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.y(b)})};_.w(bL,_.Qp);_.t=bL.prototype;
29
- _.t.append=function(a,b){if(null!=this.g&&0!==a.length){for(var c=_.u(b),d=c.next();!d.done;d=c.next())this.g.appendRule(d.value);a.sort(function(f,g){return f.startTime!==g.startTime?f.startTime-g.startTime:f.endTime-g.endTime});c=this.f.findIndex(function(f){return f.startTime>=a[0].startTime});0===c?this.f=[]:0<c&&this.f.splice(0,c);c={};d=_.u(a);for(var e=d.next();!e.done;c={yd:c.yd},e=d.next())c.yd=e.value,this.f.some(function(f){return function(g){var h=f.yd;return g.payload!==h.payload?!1:
30
- g.startTime!==h.startTime?!1:g.endTime!==h.endTime?!1:!0}}(c))||this.f.push(c.yd);this.m=null;aL(this,!1)}};_.t.sb=function(){null==this.g||aL(this,!0)};_.t.destroy=function(){var a=this;return _.B(function(b){if(1==b.a){if(null==a.g)return b["return"]();gL(a);a.F.stop();return _.x(b,a.g.destroy(),2)}a.g=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.y(b)})};
31
- _.t.remove=function(a,b){if(null==this.g)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.m=null;aL(this,!0);return!0};_.t.isTextVisible=function(){return this.j};_.t.setTextVisibility=function(a){null!=this.g&&this.j!==a&&((this.j=a)?(this.F.fb(.25),this.M.enableResizeObserver&&this.w.start(),aL(this,!0)):(this.F.stop(),this.w.stop(),gL(this)))};_.t.ei=function(){aL(this,!0)};_.C(iK,bL);bL.prototype.setTextVisibility=bL.prototype.setTextVisibility;
32
- bL.prototype.isTextVisible=bL.prototype.isTextVisible;bL.prototype.remove=bL.prototype.remove;bL.prototype.destroy=bL.prototype.destroy;bL.prototype.append=bL.prototype.append;hL.prototype.ba=function(a){return!!a.enableHtmlCue&&!_.ej()};hL.prototype.create=function(a){return new bL(a)};_.w(iL,_.wo);iL.prototype.Oa=function(){_.rm("html",new hL)};iL.prototype.Ha=function(){};iL.prototype.id=function(){return _.xe};_.C("clpp.htmlcue.HtmlCueComponent",iL);};
2
+ var f=function(window){var DL="CLPP Subtitle Styles",EL="Unsupported unit",FL="clpp-text-plain",GL="clpp-text-ttml",HL="clpp.htmlcue.HtmlTextDisplayer",IL="initial",JL=function(a){return _.Xg(a,{$f:function(b,c){return b.pa(c)}})},KL=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)},LL=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},ML=function(){},NL=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},PL=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return OL[c]});return a},RL=function(a,b){QL(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){QL(a,c)})},QL=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},SL=function(a,b){return 0===a?"0":a+b},TL=function(a,b){return 1>Math.abs(a-b)||a<b},UL=function(a,b){return a<b&&
4
+ 1<Math.abs(a-b)},VL=function(a,b){return a>b&&1<Math.abs(a-b)},WL=function(a,b){return 1>Math.abs(a-b)||a>b},XL=function(a,b,c,d,e,f){this.f=a;this.g=b;this.j=c;this.a=d;this.height=e;this.width=f},YL=function(a){return new XL(a.f,a.g,a.j,a.a,a.height,a.width)},ZL=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 XL(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},$L=function(a,b){return b.some(function(c){return UL(a.f,c.g)&&VL(a.g,c.f)&&UL(a.j,c.a)&&VL(a.a,c.j)})},aM=function(a,b){return WL(a.j,b.j)&&TL(a.a,b.a)&&WL(a.f,b.f)&&TL(a.g,b.g)},bM=function(a,b,c){switch(c){case "+x":return UL(a.f,b.f);case "-x":return VL(a.g,b.g);case "+y":return UL(a.j,b.j);
6
+ case "-y":return VL(a.a,b.a);default:throw Error("Unknown axis");}},cM=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},dM=function(a,b,c){cM.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.g=!!this.f.backgroundImage;this.D=c},fM=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 eM(a)?b:c},iM=function(a,b,c){return eM(a)&&_.M.la(c)?SL(c,_.De):(gM(a)||hM(a))&&_.M.la(b)?SL(b,"%"):IL},gM=
7
+ function(a){return a.f.writingMode===_.sf},hM=function(a){return a.f.writingMode===_.tf},eM=function(a){return a.f.writingMode===_.$g},jM=function(a,b,c){return(gM(a)||hM(a))&&_.M.la(c)?SL(c,_.De):gM(a)&&_.M.R(c)?SL(0,_.De):eM(a)&&_.M.la(b)?SL(b,"%"):IL},kM=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.Kd:return a.f.position;case "auto":case _.Ic:return a.f.position-a.f.size/2;case _.Ld:return a.f.position-a.f.size}return 0},lM=function(a){switch(a.f.positionAlign){case _.Kd:return _.Hd;
8
+ case "auto":case _.Ic:return _.Zg;case _.Ld:return _.Ke}return a.f.textAlign},mM=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.Hd:case _.Hd:return _.Kd;case _.Zg:return _.Ic;case _.Ke:case _.Ke:return _.Ld}return a.f.positionAlign},nM=function(a){switch(a.f.writingMode){case _.$g:return"horizontal-tb";case _.sf:return _.sf;case _.tf:return _.tf;default:throw Error("Unknown writing mode");}},oM=function(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=ZL(a.a);this.g=[]},pM=function(a,
9
+ b){if(a.j)switch(b.writingMode){case _.$g:return["-y"];case _.sf:return["+x"];case _.tf:return["-x"]}var c=[];switch(b.writingMode){case _.$g:c=["+y","-y"];break;case _.sf:c=["+x","-x"];break;case _.tf:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},qM=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=ZL(a.l.a)},rM=function(a,b,c){cM.call(this,a,b,c);this.g=null;this.l=[]},sM=function(a,b){qM(a.g);a.l.unshift(b);for(var c=_.u(a.l),d=c.next();!d.done;d=c.next())a.g.append(d.value)},
10
+ tM=function(a,b){rM.call(this,a.id,"clpp-text-cue-region",b);this.f=a},uM=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.eh)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(EL);},wM=function(a){this.h=new _.K("clpp.htmlcue.StyleManager");this.l=[];this.g=a.getSurface().getUniqueCssClass();this.j=[];this.a=vM(this,this.g);this.f=vM(this,this.g,!0);this.f.disabled=!0;this.h.debug("Stylesheet CLPP Subtitle Styles has been created.")},
11
+ xM=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+a.g+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},yM=function(a,b){var c="."+a.g+" .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,
12
+ c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,c)},vM=function(a,b,c){var d=document.createElement(_.We),e=d.dataset;e.name=DL;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);zM(a,b);a.h.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},zM=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===DL&&a.h.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.l.push(function(){return c.disconnect()})},CM=function(a){_.hr.call(this,a);var b=this;this.h=new _.K(HL);this.m=a;this.M=AM(a);this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.g=new wM(a);this.a=new rM(null,"clpp-text-container",{});this.w=new _.Cq(a.getSurface(),this.pi.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.h.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
14
+ this.F=new _.zj(function(){BM(b)});this.A=new Map;this.l=null},AM=function(a){a=_.M.Sa(a.getConfiguration().htmlcue||{});_.M.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.M.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},DM=function(a,b){return a.startTime<=b&&a.endTime>b},BM=function(a,b){if((b||a.j)&&a.D){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Xn){a.J=c;var d=EM(a,c);(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));
15
+ if(c&&(a.l=d,FM(a),d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.mr(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.u(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,h=null;switch(e.payloadType){case _.Bf:h="clpp-text-vtt";break;case _.ef:h=GL;break;case _.Yg:h=FL}h&&!g.classList.contains(h)&&_.uo(g,h);g=ZL(f.a.a);if(0===g.width||0===g.height)f.h.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{QL({fontSize:GM(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Bf;var l=e.payloadType===_.ef;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new tM(e.region,{}),f.A.set(e.region.id,g),sM(f.a,g)));e=new dM(e,f.M,c);g?sM(g,e):sM(f.a,e)}}}}}},EM=function(a,b){var c=LL(a.f,function(e){return DM(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&DM(a.f[d-1],b);)d--;for(;c+1<a.f.length&&DM(a.f[c+1],b);)c++;return{start:d,
17
+ end:c}},HM=function(a){FM(a);a.J=null;a.l=null;a.f=[]},FM=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(GL);b.classList.remove(FL);a=a.a;qM(a.g);a.l=[]}},GM=function(a,b){var c=ZL(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.De}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.De;d=a.getFontSizePercent();return Math.round(c*d)+_.De},IM=function(){},JM=function(){};
18
+ ML.prototype.parse=function(a){a={input:a};for(var b=_.wo(_.gd),c=[],d=b,e;null!==(e=NL(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 h=KM[f];h?(h=_.wo(h),(f=LM[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||MM[g.localName]&&MM[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
19
+ d=g)}}else d.appendChild(document.createTextNode(PL(e)));return b};var KM={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},LM={v:"voice",lang:"lang"},MM={rt:"ruby"},OL={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};cM.prototype.init=function(){this.j=!0};cM.prototype.A=function(){return!1};_.w(dM,cM);dM.prototype.A=function(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)};
20
+ dM.prototype.init=function(a){cM.prototype.init.call(this,a);if(this.g)_.uo(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===_.ef){var c=_.wo(_.gd);c.innerHTML=b.payload;b=c}else b.payloadType===_.Bf?b=(new ML).parse(b.payload):(c=_.wo(_.gd),c.textContent=b.payload,b=c);_.uo(b,this.w);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=
21
+ c.next();!d.done;d=c.next())_.uo(b,d.value);QL({writingMode:nM(this)},b);this.a.appendChild(b);_.uo(this.a,"clpp-text-wrapper");c=_.u(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.uo(this.a,"clpp-text-wrapper__"+d.value);_.M.R(this.f.line)&&(this.f.lineInterpretation=_.ah,this.f.line=eM(this)?-1:0);c=nM(this);QL({writingMode:c,webkitWritingMode:c,direction:IL,textAlign:lM(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=kM(this,mM(this));d=jM(this,c,null);var e=iM(this,
22
+ c,null),f=hM(this)&&_.M.R(null)?SL(0,_.De):IL;QL({position:"absolute",left:d,right:f,top:e,width:eM(this)?SL(this.f.size,"%"):IL,height:gM(this)||hM(this)?SL(this.f.size,"%"):IL},this.a);d=this.f;a=eM(this)?a.height:a.width;e=fM(this);if(d.lineInterpretation===_.ah)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 _.Ic:g-=f/2;break;case _.wd:g-=f}f=Math.round(g/100*a)}hM(this)&&(f=a-f-e);a=f;d=jM(this,c,a);e=hM(this)&&_.M.R(a)?
23
+ SL(0,_.De):IL;QL({left:d,right:e,top:iM(this,c,a)},this.a)}RL(this.D,b)}};dM.prototype.o=function(){return _.wo(_.gd)};oM.prototype.append=function(a){var b=a.a;b.style.visibility=_.Cd;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=ZL(a.a);var d=pM(this,a.f),e=fM(a),f=YL(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;bM(c,this.a,l)||aM(c,this.a)&&$L(c,this.g);){var m=c,n=e;switch(l){case "+x":m.f+=n;m.g+=n;break;case "-x":m.f-=n;m.g-=n;break;case "+y":m.j+=n;m.a+=n;break;case "-y":m.j-=n,m.a-=n}}if(this.j||aM(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.g,l.g)-Math.max(c.f,
24
+ l.f))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.j,l.j))/(c.height*c.width);l>h&&(g=YL(c),h=l);c=YL(f)}c=g||f}QL({top:SL(c.j-this.a.j,_.De),bottom:SL(this.a.a-c.a,_.De),left:SL(c.f-this.a.f,_.De),right:SL(this.a.g-c.g,_.De),height:SL(c.height,_.De),width:SL(c.width,_.De)},a.a)}b.style.visibility="visible";this.g.push(ZL(a.a))};_.w(rM,cM);rM.prototype.init=function(){this.g=new oM(this);this.j=!0};rM.prototype.o=function(){var a=_.wo(_.gd);_.uo(a,this.w);this.id&&(a.id=this.id);return a};_.w(tM,rM);
25
+ tM.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.eh:b=b.width/100*a.width;break a;default:throw Error(EL);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.eh)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(EL);d=a.height;var e=uM(this,d,a.height);QL(this.B,this.a);QL({left:SL(c,_.De),top:SL(e,_.De),width:SL(b,_.De),height:SL(d,_.De)},this.a);this.f.writingMode&&QL({display:"flex",
26
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&QL({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.uo(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.eh:b=b.height/100*a.height;break a;case 2:b=b.height;d=new dM(new _.dh(0,1,"Lorem ipsum",_.Yg),{},{});c=d.a;this.a.appendChild(c);d.init(ZL(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(EL);
27
+ }a=uM(this,b,a.height);QL({top:SL(a,_.De),height:SL(b,_.De)},this.a);this.g=new oM(this,!0);this.j=!0};tM.prototype.getId=function(){return this.f.id};wM.prototype.appendRule=function(a){if(null!=this.a&&!this.j.some(function(c){return c===a})){var b=yM(this,a);if(xM(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.h.debug("Added CSS rule "+b)}catch(c){this.h.error("An error occurred when adding a CSS rule: "+b)}this.j.push(a)}else this.h.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
28
+ wM.prototype.destroy=function(){var a=this;return _.G(function(b){if(null==a.a)return b["return"]();a.l.forEach(function(c){return c()});a.l=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.j=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.h.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.y(b)})};_.w(CM,_.hr);_.r=CM.prototype;_.r.append=function(a,b){if(null!=this.g&&0!==a.length){for(var c=_.u(b),d=c.next();!d.done;d=c.next())this.g.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=KL(this.f,JL(a));this.l=null;BM(this,!1)}};_.r.rb=function(){null==this.g||BM(this,!0)};
29
+ _.r.destroy=function(){var a=this;return _.G(function(b){if(1==b.a){if(null==a.g)return b["return"]();HM(a);a.F.stop();return _.x(b,a.g.destroy(),2)}a.g=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.y(b)})};_.r.remove=function(a,b){if(null==this.g)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;BM(this,!0);return!0};_.r.isTextVisible=function(){return this.j};
30
+ _.r.setTextVisibility=function(a){null!=this.g&&this.j!==a&&((this.j=a)?(this.F.eb(.25),this.M.enableResizeObserver&&this.w.start(),BM(this,!0)):(this.F.stop(),this.w.stop(),HM(this)))};_.r.pi=function(){BM(this,!0)};_.I(HL,CM);CM.prototype.setTextVisibility=CM.prototype.setTextVisibility;CM.prototype.isTextVisible=CM.prototype.isTextVisible;CM.prototype.remove=CM.prototype.remove;CM.prototype.destroy=CM.prototype.destroy;CM.prototype.append=CM.prototype.append;IM.prototype.aa=function(a){return!!a.enableHtmlCue&&!_.Kj()};IM.prototype.create=function(a){return new CM(a)};_.w(JM,_.Mp);JM.prototype.f=function(){_.wn(_.Dd,new IM)};JM.prototype.a=function(){_.un.has(_.Dd)&&(_.un["delete"](_.Dd),_.vn.info("Removed factory: 'html'"))};JM.prototype.id=function(){return _.Ye};_.I("clpp.htmlcue.HtmlCueComponent",JM);};
33
31
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
34
32
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
35
33
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.ima.js CHANGED
@@ -1,28 +1,28 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var MJ="clpp.ima.AdsManagerFactory",NJ=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.g=c},OJ=function(){},PJ=function(a){this.a=a},QJ=function(a){this.l=a;this.A=a.getSurface().getMedia();a=this.l.getConfiguration();a=_.K.Ra(a.ima||{});this.J=_.K.va({disableCustomPlayback:!1},a);this.o=this.l.dc("ima").Lc();this.T=this.l.dc("ima").g;this.m=this.l.dc("ima").a;this.M=new _.op;this.h=new _.I("clpp.ima");this.g=this.a=null;this.f=new _.bi;this.I=!1;this.w=new _.dg;this.V=new OJ;this.B=
3
- null;this.N=this.H=this.D=this.F=!1;this.K=this.j=null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.m,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.dk.bind(this));a.on(this.m,b,this.ck.bind(this));a.on(this.l,_.gd,this.kk.bind(this))},RJ=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Tj.bind(a));c.on(b,d.LOADED,a.ii.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.lk.bind(a));c.on(b,d.STARTED,a.ki.bind(a));c.on(b,d.LOG,a.Xj.bind(a));c.on(b,
4
- d.AD_PROGRESS,a.ak.bind(a));c.on(b,d.AD_BUFFERING,a.Uj.bind(a));c.on(b,d.FIRST_QUARTILE,a.gi.bind(a));c.on(b,d.MIDPOINT,a.Yj.bind(a));c.on(b,d.THIRD_QUARTILE,a.li.bind(a));c.on(b,d.PAUSED,a.$j.bind(a));c.on(b,d.RESUMED,a.bk.bind(a));c.on(b,d.CLICK,a.fi.bind(a));c.on(b,d.SKIPPED,a.ji.bind(a));c.on(b,d.IMPRESSION,a.hi.bind(a));c.on(b,d.COMPLETE,a.Vj.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.mk.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.fk.bind(a))},SJ=function(a){a=a.J;var b=new google.ima.AdsRenderingSettings;
5
- b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.sc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.sc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:
6
- [];return b},UJ=function(a){a.B=null;TJ(a,_.Tb);a.o&&a.l.getSurface().hide(a.o)},VJ=function(a){_.vn(a.A,{visibility:"visible"})},TJ=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new NJ(c,a.F,a.D)});a.l.trigger(new _.J(b,d))},WJ=function(a,b){var c=b?a.V.create(b.getErrorCode()):null;a.l.onError(new _.L(1,9,10003,{errorType:c},b))},XJ=function(a){return!1===a.J.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.ii()},ZJ=function(a){var b,c;return _.B(function(d){if(1==d.a)return a.T.initialize(),
7
- b=!!a.l.getConfiguration().muted,_.x(d,a.M.canPlay(b),2);c=d.f;if(!c&&!XJ(a))return TJ(a,_.qc),a.h.warn(_.ja),d["return"]();YJ(a);_.y(d)})},$J=function(a,b){return _.B(function(c){if(1==c.a)return a.T.initialize(),_.x(c,b.play(),2);YJ(a);_.y(c)})},YJ=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.I=!0},aK=function(){this.a=this.g=this.f=null},bK=function(){return!window.google||!google.ima||!google.ima.AdsLoader},cK=function(){},dK=function(){this.a=new _.I(MJ)};
8
- _.t=NJ.prototype;_.t.vb=function(){return"Google IMA SDK"};_.t.wb=function(){return google.ima.VERSION};_.t.Bb=function(){return 0};_.t.getId=function(){return this.a.getAdId()};_.t.getCreativeId=function(){return this.a.getCreativeId()};_.t.getApiFramework=function(){return this.a.getApiFramework()};_.t.getAdSystem=function(){return this.a.getAdSystem()};_.t.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.t.getTitle=function(){return this.a.getTitle()};_.t.getDuration=function(){return this.a.getDuration()};
9
- _.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.ic=function(){return this.f?this.f.getIsBumper():!1};_.t.Nb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Jd&&typeof b[d].clickThroughUrl===_.te});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.yb=function(){return this.a.getVastMediaWidth()};_.t.xb=function(){return this.a.getVastMediaHeight()};_.t.kb=function(){return this.a.getVastMediaBitrate()};
10
- _.t.$a=function(){return this.g?2:this.j?1:0};_.t.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.t.Ob=function(){return this.f?this.f.getTimeOffset():0};_.t.Pb=function(){return this.f?this.f.getAdPosition():1};_.t.Ab=function(){return this.f?this.f.getTotalAds():1};_.t.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.t.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.t.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};
11
- NJ.prototype.getWrapperCreativeIds=NJ.prototype.getWrapperCreativeIds;NJ.prototype.getWrapperAdSystems=NJ.prototype.getWrapperAdSystems;NJ.prototype.getWrapperAdIds=NJ.prototype.getWrapperAdIds;NJ.prototype.getSequenceLength=NJ.prototype.Ab;NJ.prototype.getPositionInSequence=NJ.prototype.Pb;NJ.prototype.getPodTimeOffset=NJ.prototype.Ob;NJ.prototype.getPodIndex=NJ.prototype.getPodIndex;NJ.prototype.getPodType=NJ.prototype.$a;NJ.prototype.getMediaBitrate=NJ.prototype.kb;
12
- NJ.prototype.getMediaHeight=NJ.prototype.xb;NJ.prototype.getMediaWidth=NJ.prototype.yb;NJ.prototype.getMediaUrl=NJ.prototype.getMediaUrl;NJ.prototype.getClickThroughUrl=NJ.prototype.Nb;NJ.prototype.isBumper=NJ.prototype.ic;NJ.prototype.getSkipTimeOffset=NJ.prototype.getSkipTimeOffset;NJ.prototype.getDuration=NJ.prototype.getDuration;NJ.prototype.getTitle=NJ.prototype.getTitle;NJ.prototype.getAdvertiserName=NJ.prototype.getAdvertiserName;NJ.prototype.getAdSystem=NJ.prototype.getAdSystem;
13
- NJ.prototype.getApiFramework=NJ.prototype.getApiFramework;NJ.prototype.getCreativeId=NJ.prototype.getCreativeId;NJ.prototype.getId=NJ.prototype.getId;NJ.prototype.getTechnology=NJ.prototype.Bb;NJ.prototype.getAdManagerVersion=NJ.prototype.wb;NJ.prototype.getAdManagerName=NJ.prototype.vb;OJ.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}};PJ.prototype.getCuePoints=function(){return this.a};PJ.prototype.Qb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};PJ.prototype.lb=function(){return 0<=this.a.indexOf(-1)};PJ.prototype.hasPostroll=PJ.prototype.lb;PJ.prototype.hasPreroll=PJ.prototype.Qb;PJ.prototype.getCuePoints=PJ.prototype.getCuePoints;_.t=QJ.prototype;
14
- _.t.dk=function(a){var b=this;this.a=a.getAdsManager(this.A,SJ(this));this.a.isCustomPlaybackUsed()&&!XJ(this)?(this.h.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.l.onError(new _.L(1,9,10002)),this.dispose()):(this.g=new _.mp(this.l.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new PJ(a),this.l.trigger(new _.J(_.Wb,{adsTimeline:this.j})),RJ(this));this.f.resolve()};
15
- _.t.ck=function(a){WJ(this,a.getError());this.f.resolve()};_.t.lk=function(a){var b=this;return _.B(function(c){if(1==c.a)return b.H=!0,XJ(b)?c.G(2):_.x(c,b.l.pause(),3);2!=c.a&&_.vn(b.A,{visibility:_.ld});TJ(b,_.Fb,a);b.g.start();_.y(c)})};_.t.Tj=function(){var a=this;return _.B(function(b){if(1==b.a){if(!XJ(a))return b.G(2);a.K=a.l.getPosition();return _.x(b,a.l.detach(),3)}if(2!=b.a){var c=a.l;c.a&&c.a.removeDelegate(c)}a.a.start();_.y(b)})};
16
- _.t.ii=function(a){a.getAd().isLinear()?TJ(this,_.Mb,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.l.play()))};_.t.ki=function(a){this.B=a.getAd().getDuration();TJ(this,_.Sb,a);this.l.getSurface().show(this.o)};_.t.Xj=function(a){a=a.getAdData();WJ(this,a?a.adError:null);UJ(this)};_.t.ak=function(a){TJ(this,_.Pb,a)};_.t.Uj=function(a){TJ(this,_.Hb,a)};_.t.gi=function(a){TJ(this,_.Kb,a)};_.t.Yj=function(a){TJ(this,_.Nb,a)};_.t.li=function(a){TJ(this,_.Ub,a)};_.t.$j=function(a){TJ(this,_.Ob,a)};
17
- _.t.bk=function(a){TJ(this,_.Qb,a)};_.t.fi=function(a){this.pause();TJ(this,_.Ib,a)};_.t.ji=function(a){TJ(this,_.Rb,a);UJ(this)};_.t.hi=function(a){TJ(this,_.Lb,a)};_.t.Vj=function(a){TJ(this,_.Jb,a);UJ(this)};
18
- _.t.mk=function(){var a=this;return _.B(function(b){switch(b.a){case 1:a.F=!0;if(!XJ(a)||null===a.K){if(!a.H)return b["return"](a.l.play());VJ(a);b.G(2);break}var c=a.l;c.a&&c.a.addDelegate(c);return _.x(b,_.no(a.l),3);case 3:if(a.D){b.G(2);break}return _.x(b,a.l.seek(a.K),2);case 2:a.H=!1;a.g&&a.g.stop();if(a.D){b.G(6);break}return _.x(b,a.l.play(),6);case 6:TJ(a,_.Gb),_.y(b)}})};_.t.fk=function(){this.N=!0};_.t.kk=function(){this.D=!0;this.m.contentComplete()};
19
- _.t.load=function(){var a=this,b,c,d,e,f;return _.B(function(g){if(1==g.a){b=a.l;c=a.J;try{if(typeof c.adTagUrl!==_.te)throw new _.L(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.M.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.M.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.m.getSettings().setAutoPlayAdBreaks(!1);a.m.requestAds(f);
20
- return g["return"](a.f)})};_.t.start=function(a){var b=this;return _.B(function(c){return b.a&&b.j&&!b.I?b.j.Qb()?_.x(c,ZJ(b),0):_.x(c,$J(b,a),0):_.x(c,a.play(),0)})};_.t.resume=function(){this.a&&this.a.resume()};_.t.pause=function(){this.a&&this.a.pause()};_.t.skip=function(){this.a&&this.a.skip()};_.t.getVolume=function(){return this.a?this.a.getVolume():1};_.t.setVolume=function(a){this.a&&this.a.setVolume(a)};
21
- _.t.getPosition=function(){if(!this.a||null===this.B)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.B-a};
22
- _.t.dispose=function(){var a=this;return(new Promise(function(b){a.I&&a.j&&a.j.lb()&&!a.N?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.o&&a.l.getSurface().hide(a.o)}),_.eg(a.w,a.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],function(){a.a&&a.a.discardAdBreak()})):b();a.a.discardAdBreak();a.m.contentComplete()})).then(function(){VJ(a);a.w.release();a.g&&(a.g.stop(),a.g=null);a.a&&(a.a.destroy(),a.a=null)})};QJ.prototype.getPosition=QJ.prototype.getPosition;
23
- QJ.prototype.setVolume=QJ.prototype.setVolume;QJ.prototype.getVolume=QJ.prototype.getVolume;QJ.prototype.skip=QJ.prototype.skip;QJ.prototype.pause=QJ.prototype.pause;QJ.prototype.resume=QJ.prototype.resume;_.w(aK,_.$p);_.t=aK.prototype;_.t.onPlayerCreated=function(a){if(bK())return a.onError(new _.L(1,9,1E4));this.f=_.tn(_.Xc,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.g=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.g);this.a.getSettings().setPlayerType(_.oa);this.a.getSettings().setPlayerVersion(_.ea);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
- _.t.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.t.hj=function(){return this.a};_.t.fj=function(){return this.g};_.t.Lc=function(){return this.f};_.t.id=function(){return"ima"};_.C("clpp.ima.ImaPlugin",aK);aK.prototype.getAdContainer=aK.prototype.Lc;aK.prototype.getAdDisplayContainer=aK.prototype.fj;aK.prototype.getAdsLoader=aK.prototype.hj;aK.Id="ima";
25
- aK.isSdkMissing=bK;cK.prototype.create=function(){return new aK};_.qo(new cK);dK.prototype.name=function(){return MJ};dK.prototype.ba=function(a,b){return a.namespace()===_.Hc?!1:bK()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};dK.prototype.create=function(a){return new QJ(a)};dK.prototype.create=dK.prototype.create;dK.prototype.isSupported=dK.prototype.ba;dK.prototype.name=dK.prototype.name;_.qn(new dK);};
2
+ var f=function(window){var kL="clpp.ima.AdsManagerFactory",lL=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.g=c},mL=function(){},nL=function(a){this.a=a},oL=function(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.M.Sa(a.ima||{});this.J=_.M.va({disableCustomPlayback:!1},a);this.o=this.m.cc("ima").Ic();this.T=this.m.cc("ima").g;this.l=this.m.cc("ima").a;this.M=new _.Eq;this.h=new _.K("clpp.ima");this.g=this.a=null;this.f=new _.Fi;this.I=!1;this.w=new _.Eg;this.V=new mL;this.B=
3
+ null;this.P=this.H=this.D=this.F=!1;this.K=this.j=null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.rk.bind(this));a.on(this.l,b,this.qk.bind(this));a.on(this.m,_.xd,this.yk.bind(this))},pL=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.fk.bind(a));c.on(b,d.LOADED,a.wi.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.zk.bind(a));c.on(b,d.STARTED,a.yi.bind(a));c.on(b,d.LOG,a.jk.bind(a));c.on(b,
4
+ d.AD_PROGRESS,a.nk.bind(a));c.on(b,d.AD_BUFFERING,a.gk.bind(a));c.on(b,d.FIRST_QUARTILE,a.si.bind(a));c.on(b,d.MIDPOINT,a.kk.bind(a));c.on(b,d.THIRD_QUARTILE,a.zi.bind(a));c.on(b,d.PAUSED,a.mk.bind(a));c.on(b,d.RESUMED,a.pk.bind(a));c.on(b,d.CLICK,a.ri.bind(a));c.on(b,d.SKIPPED,a.xi.bind(a));c.on(b,d.IMPRESSION,a.vi.bind(a));c.on(b,d.COMPLETE,a.hk.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Ak.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.tk.bind(a))},qL=function(a){a=a.J;var b=new google.ima.AdsRenderingSettings;
5
+ b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.zc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.zc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:
6
+ [];return b},sL=function(a){a.B=null;rL(a,_.ac);a.o&&a.m.getSurface().hide(a.o)},tL=function(a){_.vo(a.A,{visibility:"visible"})},rL=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new lL(c,a.F,a.D)});a.m.trigger(new _.L(b,d))},uL=function(a,b){var c=b?a.V.create(b.getErrorCode()):null;a.m.onError(new _.N(1,9,10003,{errorType:c},b))},vL=function(a){return!1===a.J.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Mi()},xL=function(a){var b,c;return _.G(function(d){if(1==d.a)return a.T.initialize(),
7
+ b=!!a.m.getConfiguration().muted,_.x(d,a.M.canPlay(b),2);c=d.f;if(!c&&!vL(a))return rL(a,_.xc),a.h.warn(_.ka),d["return"]();wL(a);_.y(d)})},yL=function(a,b){return _.G(function(c){if(1==c.a)return a.T.initialize(),_.x(c,b.play(),2);wL(a);_.y(c)})},wL=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.I=!0},zL=function(){this.a=this.g=this.f=null},AL=function(){return!window.google||!google.ima||!google.ima.AdsLoader},BL=function(){},CL=function(){this.a=new _.K(kL)};
8
+ _.r=lL.prototype;_.r.ub=function(){return"Google IMA SDK"};_.r.vb=function(){return google.ima.VERSION};_.r.Ab=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.getApiFramework=function(){return this.a.getApiFramework()};_.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()};
9
+ _.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.r.gc=function(){return this.f?this.f.getIsBumper():!1};_.r.Lb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.ae&&typeof b[d].clickThroughUrl===_.Ue});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.xb=function(){return this.a.getVastMediaWidth()};_.r.wb=function(){return this.a.getVastMediaHeight()};_.r.jb=function(){return this.a.getVastMediaBitrate()};
10
+ _.r.Za=function(){return this.g?2:this.j?1:0};_.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.Mb=function(){return this.f?this.f.getTimeOffset():0};_.r.Nb=function(){return this.f?this.f.getAdPosition():1};_.r.zb=function(){return this.f?this.f.getTotalAds():1};_.r.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.r.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};
11
+ lL.prototype.getWrapperCreativeIds=lL.prototype.getWrapperCreativeIds;lL.prototype.getWrapperAdSystems=lL.prototype.getWrapperAdSystems;lL.prototype.getWrapperAdIds=lL.prototype.getWrapperAdIds;lL.prototype.getSequenceLength=lL.prototype.zb;lL.prototype.getPositionInSequence=lL.prototype.Nb;lL.prototype.getPodTimeOffset=lL.prototype.Mb;lL.prototype.getPodIndex=lL.prototype.getPodIndex;lL.prototype.getPodType=lL.prototype.Za;lL.prototype.getMediaBitrate=lL.prototype.jb;
12
+ lL.prototype.getMediaHeight=lL.prototype.wb;lL.prototype.getMediaWidth=lL.prototype.xb;lL.prototype.getMediaUrl=lL.prototype.getMediaUrl;lL.prototype.getClickThroughUrl=lL.prototype.Lb;lL.prototype.isBumper=lL.prototype.gc;lL.prototype.getSkipTimeOffset=lL.prototype.getSkipTimeOffset;lL.prototype.getDuration=lL.prototype.getDuration;lL.prototype.getTitle=lL.prototype.getTitle;lL.prototype.getAdvertiserName=lL.prototype.getAdvertiserName;lL.prototype.getAdSystem=lL.prototype.getAdSystem;
13
+ lL.prototype.getApiFramework=lL.prototype.getApiFramework;lL.prototype.getCreativeId=lL.prototype.getCreativeId;lL.prototype.getId=lL.prototype.getId;lL.prototype.getTechnology=lL.prototype.Ab;lL.prototype.getAdManagerVersion=lL.prototype.vb;lL.prototype.getAdManagerName=lL.prototype.ub;mL.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}};nL.prototype.getCuePoints=function(){return this.a};nL.prototype.Ob=function(){return 0<=this.a.indexOf(0)||0===this.a.length};nL.prototype.kb=function(){return 0<=this.a.indexOf(-1)};nL.prototype.hasPostroll=nL.prototype.kb;nL.prototype.hasPreroll=nL.prototype.Ob;nL.prototype.getCuePoints=nL.prototype.getCuePoints;_.r=oL.prototype;
14
+ _.r.rk=function(a){var b=this;this.a=a.getAdsManager(this.A,qL(this));this.a.isCustomPlaybackUsed()&&!vL(this)?(this.h.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.N(1,9,10002)),this.dispose()):(this.g=new _.Cq(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.j=new nL(a),this.m.trigger(new _.L(_.dc,{adsTimeline:this.j})),pL(this));this.f.resolve()};
15
+ _.r.qk=function(a){uL(this,a.getError());this.f.resolve()};_.r.zk=function(a){var b=this;return _.G(function(c){if(1==c.a)return b.H=!0,vL(b)?c.G(2):_.x(c,b.m.pause(),3);2!=c.a&&_.vo(b.A,{visibility:_.Cd});rL(b,_.Mb,a);b.g.start();_.y(c)})};_.r.fk=function(){var a=this;return _.G(function(b){if(1==b.a){if(!vL(a))return b.G(2);a.K=a.m.getPosition();return _.x(b,a.m.detach(),3)}if(2!=b.a){var c=a.m;c.a&&c.a.removeDelegate(c)}a.a.start();_.y(b)})};
16
+ _.r.wi=function(a){a.getAd().isLinear()?rL(this,_.Tb,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.m.play()))};_.r.yi=function(a){this.B=a.getAd().getDuration();rL(this,_.$b,a);this.m.getSurface().show(this.o)};_.r.jk=function(a){a=a.getAdData();uL(this,a?a.adError:null);sL(this)};_.r.nk=function(a){rL(this,_.Xb,a)};_.r.gk=function(a){rL(this,_.Ob,a)};_.r.si=function(a){rL(this,_.Rb,a)};_.r.kk=function(a){rL(this,_.Ub,a)};_.r.zi=function(a){rL(this,_.bc,a)};_.r.mk=function(a){rL(this,_.Vb,a)};
17
+ _.r.pk=function(a){rL(this,_.Yb,a)};_.r.ri=function(a){this.pause();rL(this,_.Pb,a)};_.r.xi=function(a){rL(this,_.Zb,a);sL(this)};_.r.vi=function(a){rL(this,_.Sb,a)};_.r.hk=function(a){rL(this,_.Qb,a);sL(this)};
18
+ _.r.Ak=function(){var a=this;return _.G(function(b){switch(b.a){case 1:a.F=!0;if(!vL(a)||null===a.K){if(!a.H)return b["return"](a.m.play());tL(a);b.G(2);break}var c=a.m;c.a&&c.a.addDelegate(c);return _.x(b,_.op(a.m),3);case 3:if(a.D){b.G(2);break}return _.x(b,a.m.seek(a.K),2);case 2:a.H=!1;a.g&&a.g.stop();if(a.D){b.G(6);break}return _.x(b,a.m.play(),6);case 6:rL(a,_.Nb),_.y(b)}})};_.r.tk=function(){this.P=!0};_.r.yk=function(){this.D=!0;this.l.contentComplete()};
19
+ _.r.load=function(){var a=this,b,c,d,e,f;return _.G(function(g){if(1==g.a){b=a.m;c=a.J;try{if(typeof c.adTagUrl!==_.Ue)throw new _.N(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.M.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.M.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(f);
20
+ return g["return"](a.f)})};_.r.start=function(a){var b=this;return _.G(function(c){return b.a&&b.j&&!b.I?b.j.Ob()?_.x(c,xL(b),0):_.x(c,yL(b,a),0):_.x(c,a.play(),0)})};_.r.resume=function(){this.a&&this.a.resume()};_.r.pause=function(){this.a&&this.a.pause()};_.r.skip=function(){this.a&&this.a.skip()};_.r.getVolume=function(){return this.a?this.a.getVolume():1};_.r.setVolume=function(a){this.a&&this.a.setVolume(a)};
21
+ _.r.getPosition=function(){if(!this.a||null===this.B)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.B-a};
22
+ _.r.dispose=function(){var a=this;return(new Promise(function(b){a.I&&a.j&&a.j.kb()&&!a.P?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.o&&a.m.getSurface().hide(a.o)}),_.Fg(a.w,a.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],function(){a.a&&a.a.discardAdBreak()})):b();a.a.discardAdBreak();a.l.contentComplete()})).then(function(){tL(a);a.w.release();a.g&&(a.g.stop(),a.g=null);a.a&&(a.a.destroy(),a.a=null)})};oL.prototype.getPosition=oL.prototype.getPosition;
23
+ oL.prototype.setVolume=oL.prototype.setVolume;oL.prototype.getVolume=oL.prototype.getVolume;oL.prototype.skip=oL.prototype.skip;oL.prototype.pause=oL.prototype.pause;oL.prototype.resume=oL.prototype.resume;_.w(zL,_.rr);_.r=zL.prototype;_.r.onPlayerCreated=function(a){if(AL())return a.onError(new _.N(1,9,1E4));this.f=_.to(_.gd,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.g=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.g);this.a.getSettings().setPlayerType(_.sa);this.a.getSettings().setPlayerVersion(_.fa);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
+ _.r.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.r.sj=function(){return this.a};_.r.qj=function(){return this.g};_.r.Ic=function(){return this.f};_.r.id=function(){return"ima"};_.I("clpp.ima.ImaPlugin",zL);zL.prototype.getAdContainer=zL.prototype.Ic;zL.prototype.getAdDisplayContainer=zL.prototype.qj;zL.prototype.getAdsLoader=zL.prototype.sj;zL.Id="ima";
25
+ zL.isSdkMissing=AL;BL.prototype.create=function(){return new zL};_.qp(new BL);CL.prototype.name=function(){return kL};CL.prototype.aa=function(a,b){return a.namespace()===_.Pc?!1:AL()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};CL.prototype.create=function(a){return new oL(a)};CL.prototype.create=CL.prototype.create;CL.prototype.isSupported=CL.prototype.aa;CL.prototype.name=CL.prototype.name;_.qo(new CL);};
26
26
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
27
27
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
28
28
  else{_=this.clpp._;(f.call(g,this));}