@castlabs/prestoplay 6.28.0 → 6.30.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 (66) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +128 -116
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +619 -614
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +92 -89
  10. package/cjs/cl.externs.js +154 -60
  11. package/cjs/cl.freewheel.js +25 -25
  12. package/cjs/cl.hls.js +77 -77
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +25 -23
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +350 -349
  18. package/cjs/cl.muxdata.js +14 -14
  19. package/cjs/cl.onboard.js +4 -4
  20. package/cjs/cl.persistent.js +15 -15
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.simid.js +16 -16
  23. package/cjs/cl.smooth.js +57 -58
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +60 -60
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -12
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +38 -38
  33. package/cjs/polyfill.min.js +2 -2
  34. package/cl.adobe.js +3 -3
  35. package/cl.airplay.js +3 -3
  36. package/cl.broadpeak.js +6 -6
  37. package/cl.cast.js +101 -92
  38. package/cl.conviva.js +27 -27
  39. package/cl.core.js +500 -496
  40. package/cl.crypto.js +9 -9
  41. package/cl.dash.js +84 -83
  42. package/cl.externs.js +150 -60
  43. package/cl.freewheel.js +19 -19
  44. package/cl.hls.js +82 -80
  45. package/cl.hlssmpte.js +5 -5
  46. package/cl.htmlcue.js +26 -26
  47. package/cl.ima.js +19 -17
  48. package/cl.mediatailor.js +2 -2
  49. package/cl.mse.js +304 -305
  50. package/cl.muxdata.js +13 -13
  51. package/cl.onboard.js +4 -4
  52. package/cl.persistent.js +11 -11
  53. package/cl.playlist.js +5 -5
  54. package/cl.simid.js +14 -14
  55. package/cl.smooth.js +60 -60
  56. package/cl.thumbnails.js +19 -19
  57. package/cl.tizen.js +56 -56
  58. package/cl.ttml.js +22 -22
  59. package/cl.verimatrix.js +4 -4
  60. package/cl.vimond.js +8 -8
  61. package/cl.vr.js +14 -14
  62. package/cl.vtt.js +12 -12
  63. package/cl.yospace.js +3 -3
  64. package/cl.youbora.js +31 -31
  65. package/package.json +1 -1
  66. package/typings.d.ts +198 -88
package/cjs/cl.htmlcue.js CHANGED
@@ -1,34 +1,34 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var lT="CLPP Subtitle Styles",mT="Unsupported unit",nT="clpp-text-plain",oT="clpp-text-ttml",pT="clpp.htmlcue.HtmlTextDisplayer",qT="initial",rT=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},sT=function(a){return _.Hi(a,{Lh:function(b,c){return b.ra(c)}})},tT=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)},uT=function(){},vT=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},xT=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return wT[c]});return a},zT=function(a,b){yT(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){yT(a,c)})},yT=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},AT=function(a,b){return 0===a?"0":a+b},BT=function(a,b){return 1>Math.abs(a-b)||a<b},CT=function(a,b){return a<b&&
4
- 1<Math.abs(a-b)},DT=function(a,b){return a>b&&1<Math.abs(a-b)},ET=function(a,b){return 1>Math.abs(a-b)||a>b},FT=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},GT=function(a){return new FT(a.left,a.f,a.top,a.a,a.height,a.width)},HT=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 FT(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},IT=function(a,b){return b.some(function(c){return CT(a.left,c.f)&&DT(a.f,c.left)&&CT(a.top,c.a)&&DT(a.a,c.top)})},JT=function(a,b){return ET(a.top,b.top)&&BT(a.a,b.a)&&ET(a.left,b.left)&&BT(a.f,b.f)},KT=function(a,b,c){switch(c){case "+x":return CT(a.left,b.left);case "-x":return DT(a.f,b.f);
6
- case "+y":return CT(a.top,b.top);case "-y":return DT(a.a,b.a);default:throw Error("Unknown axis");}},LT=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},MT=function(a,b,c){LT.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.F=c},OT=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 NT(a)?b:c},RT=function(a,b,c){return NT(a)&&_.M.xa(c)?AT(c,_.If):(PT(a)||
7
- QT(a))&&_.M.xa(b)?AT(b,"%"):qT},PT=function(a){return a.f.writingMode===_.Kg},QT=function(a){return a.f.writingMode===_.Lg},NT=function(a){return a.f.writingMode===_.sp},ST=function(a,b,c){return(PT(a)||QT(a))&&_.M.xa(c)?AT(c,_.If):PT(a)&&_.M.R(c)?AT(0,_.If):NT(a)&&_.M.xa(b)?AT(b,"%"):qT},TT=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.ze:return a.f.position;case "auto":case _.gd:return a.f.position-a.f.size/2;case _.Ae:return a.f.position-a.f.size}return 0},
8
- UT=function(a){switch(a.f.positionAlign){case _.ze:return _.we;case "auto":case _.gd:return _.rp;case _.Ae:return _.Pf}return a.f.textAlign},VT=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.cg:case _.we:return _.ze;case _.rp:return _.gd;case _.he:case _.Pf:return _.Ae}return a.f.positionAlign},WT=function(a){switch(a.f.writingMode){case _.sp:return"horizontal-tb";case _.Kg:return _.Kg;case _.Lg:return _.Lg;default:throw Error("Unknown writing mode");}},XT=function(a,b){this.l=a;this.f=
9
- a.a;this.j=void 0===b?!1:b;this.a=HT(a.a);this.h=[]},YT=function(a,b){if(a.j)switch(b.writingMode){case _.sp:return["-y"];case _.Kg:return["+x"];case _.Lg:return["-x"]}var c=[];switch(b.writingMode){case _.sp:c=["+y","-y"];break;case _.Kg:c=["+x","-x"];break;case _.Lg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},ZT=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=HT(a.l.a)},$T=function(a,b,c){LT.call(this,a,b,c);this.h=null;this.l=[]},aU=function(a,b){$T.call(this,
10
- a.id,"clpp-text-cue-region",b);this.f=a},bU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.xp)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(mT);},dU=function(a){this.g=new _.L("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=cU(this,this.h);this.f=cU(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},eU=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},fU=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)},cU=function(a,b,c){var d=document.createElement(_.ig),e=d.dataset;e.name=lT;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);gU(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},gU=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===lT&&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()})},jU=function(a){_.Cv.call(this,a);var b=this;this.g=new _.L(pT);this.m=a;this.L=hU(a.getConfiguration());this.j=!1;this.f=[];this.F=a.getSurface().getContainer();this.h=new dU(a.getSurface().getUniqueCssClass());this.a=new $T(null,"clpp-text-container",{});this.w=new _.vv(a.getSurface(),this.Jk.bind(this));this.J=null;this.F?(this.F.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 _.dj(function(){iU(b)});this.A=new Map;this.l=null},hU=function(a){a=_.M.ib(a.htmlcue||{});_.M.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.M.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},kU=function(a,b){return a.startTime<=b&&a.endTime>b},iU=function(a,b){if((b||a.j)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&3===a.m.getState()){a.J=c;var d=lU(a,c);(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.l=d,mU(a),
15
- d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Hv(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,h=null;switch(e.payloadType){case _.Tg:h="clpp-text-vtt";break;case _.yg:h=oT;break;case _.qp:h=nT}h&&!g.classList.contains(h)&&_.Wi(g,h);g=HT(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{yT({fontSize:nU(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Tg;var l=e.payloadType===_.yg;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new aU(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new MT(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}}},lU=function(a,b){var c=rT(a.f,function(e){return kU(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&kU(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
- kU(a.f[c+1],b);)c++;return{start:d,end:c}},oU=function(a){mU(a);a.J=null;a.l=null;a.f=[]},mU=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(oT);b.classList.remove(nT);a=a.a;ZT(a.h);a.l=[]}},nU=function(a,b){var c=HT(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.If}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.If;d=a.getFontSizePercent();return Math.round(c*d)+_.If},pU=function(){},
18
- qU=function(){};
19
- uT.prototype.parse=function(a){a={input:a};for(var b=_.Yi(_.Pd),c=[],d=b,e;null!==(e=vT(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=rU[f];h?(h=_.Yi(h),(f=sU[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||tU[g.localName]&&tU[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(xT(e)));return b};var rU={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},sU={v:"voice",lang:"lang"},tU={rt:"ruby"},wT={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};LT.prototype.init=function(){this.j=!0};LT.prototype.A=function(){return!1};_.w(MT,LT);MT.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
- MT.prototype.init=function(a){LT.prototype.init.call(this,a);if(this.h)_.Wi(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===_.yg){var c=_.Yi(_.Pd);c.innerHTML=b.payload;b=c}else b.payloadType===_.Tg?b=(new uT).parse(b.payload):(c=_.Yi(_.Pd),c.textContent=b.payload,b=c);_.Wi(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())_.Wi(b,d.value);yT({writingMode:WT(this)},b);this.a.appendChild(b);_.Wi(this.a,"clpp-text-wrapper");c=_.v(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Wi(this.a,"clpp-text-wrapper__"+d.value);_.M.R(this.f.line)&&(this.f.lineInterpretation=_.tp,this.f.line=NT(this)?-1:0);c=WT(this);yT({writingMode:c,webkitWritingMode:c,direction:qT,textAlign:UT(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=TT(this,VT(this));d=ST(this,c,null);var e=RT(this,
23
- c,null),f=QT(this)&&_.M.R(null)?AT(0,_.If):qT;yT({position:"absolute",left:d,right:f,top:e,width:NT(this)?AT(this.f.size,"%"):qT,height:PT(this)||QT(this)?AT(this.f.size,"%"):qT},this.a);d=this.f;a=NT(this)?a.height:a.width;e=OT(this);if(d.lineInterpretation===_.tp)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 _.gd:g-=f/2;break;case _.he:g-=f}f=Math.round(g/100*a)}QT(this)&&(f=a-f-e);a=f;d=ST(this,c,a);e=QT(this)&&_.M.R(a)?
24
- AT(0,_.If):qT;yT({left:d,right:e,top:RT(this,c,a)},this.a)}zT(this.F,b)}};MT.prototype.o=function(){return _.Yi(_.Pd)};XT.prototype.append=function(a){var b=a.a;b.style.visibility=_.pe;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=HT(a.a);var d=YT(this,a.f),e=OT(a),f=GT(c),g=null,h=0;d=_.v(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;KT(c,this.a,l)||JT(c,this.a)&&IT(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||JT(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>h&&(g=GT(c),h=l);c=GT(f)}c=g||f}yT({top:AT(c.top-this.a.top,_.If),bottom:AT(this.a.a-c.a,_.If),left:AT(c.left-this.a.left,_.If),right:AT(this.a.f-c.f,_.If),height:AT(c.height,_.If),width:AT(c.width,_.If)},a.a)}b.style.visibility="visible";this.h.push(HT(a.a))};_.w($T,LT);$T.prototype.init=function(){this.h=new XT(this);this.j=!0};$T.prototype.o=function(){var a=_.Yi(_.Pd);_.Wi(a,this.w);this.id&&(a.id=this.id);return a};$T.prototype.appendChild=function(a){ZT(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(aU,$T);
26
- aU.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.xp:b=b.width/100*a.width;break a;default:throw Error(mT);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.xp)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(mT);d=a.height;var e=bU(this,d,a.height);yT(this.B,this.a);yT({left:AT(c,_.If),top:AT(e,_.If),width:AT(b,_.If),height:AT(d,_.If)},this.a);this.f.writingMode&&yT({display:"flex",
27
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&yT({"justify-content":this.f.displayAlign},this.a);b=_.v(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Wi(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.xp:b=b.height/100*a.height;break a;case 2:b=b.height;d=new MT(new _.wp(0,1,"Lorem ipsum",_.qp),{},{});c=d.a;this.a.appendChild(c);d.init(HT(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(mT);
28
- }a=bU(this,b,a.height);yT({top:AT(a,_.If),height:AT(b,_.If)},this.a);this.h=new XT(this,!0);this.j=!0};aU.prototype.getId=function(){return this.f.id};dU.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=fU(this,a);if(eU(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
- dU.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(jU,_.Cv);_.r=jU.prototype;_.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=tT(this.f,sT(a));this.l=null;iU(this,!1)}};_.r.Tb=function(){null==this.h||iU(this,!0)};
30
- _.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();oU(a);a.G.stop();return _.x(b,a.h.destroy(),2)}a.h=null;a.F.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;iU(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.Hb(.25),this.L.enableResizeObserver&&this.w.start(),iU(this,!0)):(this.G.stop(),this.w.stop(),oU(this)))};_.r.Jk=function(){iU(this,!0)};_.K(pT,jU);jU.prototype.setTextVisibility=jU.prototype.setTextVisibility;jU.prototype.isTextVisible=jU.prototype.isTextVisible;jU.prototype.remove=jU.prototype.remove;jU.prototype.destroy=jU.prototype.destroy;jU.prototype.append=jU.prototype.append;pU.prototype.a=function(a){return!!a.enableHtmlCue&&!_.pj()};pU.prototype.create=function(a){return new jU(a)};_.w(qU,_.Tu);qU.prototype.install=function(){_.Mt(_.re,new pU)};qU.prototype.uninstall=function(){_.Kt.has(_.re)&&(_.Kt["delete"](_.re),_.Lt.info("Removed factory: 'html'"))};qU.prototype.id=function(){return _.kg};_.K("clpp.htmlcue.HtmlCueComponent",qU);};
2
+ var f=function(window){var aT="CLPP Subtitle Styles",bT="Unsupported unit",cT="clpp-text-plain",dT="clpp-text-ttml",eT="clpp.htmlcue.HtmlTextDisplayer",fT="initial",gT=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},hT=function(a){return _.Mi(a,{Zh:function(b,c){return b.ta(c)}})},iT=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)},jT=function(){},kT=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},mT=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return lT[c]});return a},oT=function(a,b){nT(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){nT(a,c)})},nT=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},pT=function(a,b){return 0===a?"0":a+b},qT=function(a,b){return 1>Math.abs(a-b)||a<b},rT=function(a,b){return a<b&&
4
+ 1<Math.abs(a-b)},sT=function(a,b){return a>b&&1<Math.abs(a-b)},tT=function(a,b){return 1>Math.abs(a-b)||a>b},uT=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},vT=function(a){return new uT(a.left,a.f,a.top,a.a,a.height,a.width)},wT=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 uT(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},xT=function(a,b){return b.some(function(c){return rT(a.left,c.f)&&sT(a.f,c.left)&&rT(a.top,c.a)&&sT(a.a,c.top)})},yT=function(a,b){return tT(a.top,b.top)&&qT(a.a,b.a)&&tT(a.left,b.left)&&qT(a.f,b.f)},zT=function(a,b,c){switch(c){case "+x":return rT(a.left,b.left);case "-x":return sT(a.f,b.f);
6
+ case "+y":return rT(a.top,b.top);case "-y":return sT(a.a,b.a);default:throw Error("Unknown axis");}},AT=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},BT=function(a,b,c){AT.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.F=c},DT=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 CT(a)?b:c},GT=function(a,b,c){return CT(a)&&_.M.za(c)?pT(c,_.Nf):(ET(a)||
7
+ FT(a))&&_.M.za(b)?pT(b,"%"):fT},ET=function(a){return a.f.writingMode===_.Qg},FT=function(a){return a.f.writingMode===_.Rg},CT=function(a){return a.f.writingMode===_.Bp},HT=function(a,b,c){return(ET(a)||FT(a))&&_.M.za(c)?pT(c,_.Nf):ET(a)&&_.M.R(c)?pT(0,_.Nf):CT(a)&&_.M.za(b)?pT(b,"%"):fT},IT=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.Ge:return a.f.position;case "auto":case _.od:return a.f.position-a.f.size/2;case _.He:return a.f.position-a.f.size}return 0},
8
+ JT=function(a){switch(a.f.positionAlign){case _.Ge:return _.De;case "auto":case _.od:return _.Ap;case _.He:return _.Uf}return a.f.textAlign},KT=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.hg:case _.De:return _.Ge;case _.Ap:return _.od;case _.oe:case _.Uf:return _.He}return a.f.positionAlign},LT=function(a){switch(a.f.writingMode){case _.Bp:return"horizontal-tb";case _.Qg:return _.Qg;case _.Rg:return _.Rg;default:throw Error("Unknown writing mode");}},MT=function(a,b){this.l=a;this.f=
9
+ a.a;this.j=void 0===b?!1:b;this.a=wT(a.a);this.h=[]},NT=function(a,b){if(a.j)switch(b.writingMode){case _.Bp:return["-y"];case _.Qg:return["+x"];case _.Rg:return["-x"]}var c=[];switch(b.writingMode){case _.Bp:c=["+y","-y"];break;case _.Qg:c=["+x","-x"];break;case _.Rg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},OT=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=wT(a.l.a)},PT=function(a,b,c){AT.call(this,a,b,c);this.h=null;this.l=[]},QT=function(a,b){PT.call(this,
10
+ a.id,"clpp-text-cue-region",b);this.f=a},RT=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Gp)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(bT);},TT=function(a){this.g=new _.L("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=ST(this,this.h);this.f=ST(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},UT=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},VT=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)},ST=function(a,b,c){var d=document.createElement(_.ng),e=d.dataset;e.name=aT;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);WT(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},WT=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===aT&&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()})},ZT=function(a){_.Iv.call(this,a);var b=this;this.g=new _.L(eT);this.m=a;this.L=XT(a.getConfiguration());this.j=!1;this.f=[];this.F=a.getSurface().getContainer();this.h=new TT(a.getSurface().getUniqueCssClass());this.a=new PT(null,"clpp-text-container",{});this.w=new _.ov(a.getSurface(),this.el.bind(this));this.J=null;this.F?(this.F.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 _.gj(function(){YT(b)});this.A=new Map;this.l=null},XT=function(a){a=_.M.jb(a.htmlcue||{});_.M.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.M.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},$T=function(a,b){return a.startTime<=b&&a.endTime>b},YT=function(a,b){if((b||a.j)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&3===a.m.getState()){a.J=c;var d=aU(a,c);(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.l=d,bU(a),
15
+ d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Nv(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,h=null;switch(e.payloadType){case _.Zg:h="clpp-text-vtt";break;case _.Eg:h=dT;break;case _.zp:h=cT}h&&!g.classList.contains(h)&&_.Zi(g,h);g=wT(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{nT({fontSize:cU(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Zg;var l=e.payloadType===_.Eg;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new QT(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new BT(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}}},aU=function(a,b){var c=gT(a.f,function(e){return $T(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&$T(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
+ $T(a.f[c+1],b);)c++;return{start:d,end:c}},dU=function(a){bU(a);a.J=null;a.l=null;a.f=[]},bU=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(dT);b.classList.remove(cT);a=a.a;OT(a.h);a.l=[]}},cU=function(a,b){var c=wT(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Nf}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Nf;d=a.getFontSizePercent();return Math.round(c*d)+_.Nf},eU=function(){},
18
+ fU=function(){};
19
+ jT.prototype.parse=function(a){a={input:a};for(var b=_.aj(_.Xd),c=[],d=b,e;null!==(e=kT(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=gU[f];h?(h=_.aj(h),(f=hU[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||iU[g.localName]&&iU[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(mT(e)));return b};var gU={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},hU={v:"voice",lang:"lang"},iU={rt:"ruby"},lT={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};AT.prototype.init=function(){this.j=!0};AT.prototype.A=function(){return!1};_.w(BT,AT);BT.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
+ BT.prototype.init=function(a){AT.prototype.init.call(this,a);if(this.h)_.Zi(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===_.Eg){var c=_.aj(_.Xd);c.innerHTML=b.payload;b=c}else b.payloadType===_.Zg?b=(new jT).parse(b.payload):(c=_.aj(_.Xd),c.textContent=b.payload,b=c);_.Zi(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())_.Zi(b,d.value);nT({writingMode:LT(this)},b);this.a.appendChild(b);_.Zi(this.a,"clpp-text-wrapper");c=_.v(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Zi(this.a,"clpp-text-wrapper__"+d.value);_.M.R(this.f.line)&&(this.f.lineInterpretation=_.Cp,this.f.line=CT(this)?-1:0);c=LT(this);nT({writingMode:c,webkitWritingMode:c,direction:fT,textAlign:JT(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=IT(this,KT(this));d=HT(this,c,null);var e=GT(this,
23
+ c,null),f=FT(this)&&_.M.R(null)?pT(0,_.Nf):fT;nT({position:"absolute",left:d,right:f,top:e,width:CT(this)?pT(this.f.size,"%"):fT,height:ET(this)||FT(this)?pT(this.f.size,"%"):fT},this.a);d=this.f;a=CT(this)?a.height:a.width;e=DT(this);if(d.lineInterpretation===_.Cp)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 _.od:g-=f/2;break;case _.oe:g-=f}f=Math.round(g/100*a)}FT(this)&&(f=a-f-e);a=f;d=HT(this,c,a);e=FT(this)&&_.M.R(a)?
24
+ pT(0,_.Nf):fT;nT({left:d,right:e,top:GT(this,c,a)},this.a)}oT(this.F,b)}};BT.prototype.o=function(){return _.aj(_.Xd)};MT.prototype.append=function(a){var b=a.a;b.style.visibility=_.we;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=wT(a.a);var d=NT(this,a.f),e=DT(a),f=vT(c),g=null,h=0;d=_.v(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;zT(c,this.a,l)||yT(c,this.a)&&xT(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||yT(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>h&&(g=vT(c),h=l);c=vT(f)}c=g||f}nT({top:pT(c.top-this.a.top,_.Nf),bottom:pT(this.a.a-c.a,_.Nf),left:pT(c.left-this.a.left,_.Nf),right:pT(this.a.f-c.f,_.Nf),height:pT(c.height,_.Nf),width:pT(c.width,_.Nf)},a.a)}b.style.visibility="visible";this.h.push(wT(a.a))};_.w(PT,AT);PT.prototype.init=function(){this.h=new MT(this);this.j=!0};PT.prototype.o=function(){var a=_.aj(_.Xd);_.Zi(a,this.w);this.id&&(a.id=this.id);return a};PT.prototype.appendChild=function(a){OT(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(QT,PT);
26
+ QT.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Gp:b=b.width/100*a.width;break a;default:throw Error(bT);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Gp)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(bT);d=a.height;var e=RT(this,d,a.height);nT(this.B,this.a);nT({left:pT(c,_.Nf),top:pT(e,_.Nf),width:pT(b,_.Nf),height:pT(d,_.Nf)},this.a);this.f.writingMode&&nT({display:"flex",
27
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&nT({"justify-content":this.f.displayAlign},this.a);b=_.v(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Zi(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Gp:b=b.height/100*a.height;break a;case 2:b=b.height;d=new BT(new _.Fp(0,1,"Lorem ipsum",_.zp),{},{});c=d.a;this.a.appendChild(c);d.init(wT(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(bT);
28
+ }a=RT(this,b,a.height);nT({top:pT(a,_.Nf),height:pT(b,_.Nf)},this.a);this.h=new MT(this,!0);this.j=!0};QT.prototype.getId=function(){return this.f.id};TT.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=VT(this,a);if(UT(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
+ TT.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(ZT,_.Iv);_.r=ZT.prototype;_.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=iT(this.f,hT(a));this.l=null;YT(this,!1)}};_.r.Wb=function(){null==this.h||YT(this,!0)};
30
+ _.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();dU(a);a.G.stop();return _.x(b,a.h.destroy(),2)}a.h=null;a.F.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;YT(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.Ib(.25),this.L.enableResizeObserver&&this.w.start(),YT(this,!0)):(this.G.stop(),this.w.stop(),dU(this)))};_.r.el=function(){YT(this,!0)};_.K(eT,ZT);ZT.prototype.setTextVisibility=ZT.prototype.setTextVisibility;ZT.prototype.isTextVisible=ZT.prototype.isTextVisible;ZT.prototype.remove=ZT.prototype.remove;ZT.prototype.destroy=ZT.prototype.destroy;ZT.prototype.append=ZT.prototype.append;eU.prototype.a=function(a){return!!a.enableHtmlCue&&!_.sj()};eU.prototype.create=function(a){return new ZT(a)};_.w(fU,_.bv);fU.prototype.install=function(){_.Vt(_.ye,new eU)};fU.prototype.uninstall=function(){_.Tt.has(_.ye)&&(_.Tt["delete"](_.ye),_.Ut.info("Removed factory: 'html'"))};fU.prototype.id=function(){return _.pg};_.K("clpp.htmlcue.HtmlCueComponent",fU);};
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,27 +1,29 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var RS="clpp.ima.AdsManagerFactory",SS=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},TS=function(){},US=function(a){this.a=a},VS=function(){this.a=this.h=this.f=null},WS=function(){return!window.google||!google.ima||!google.ima.AdsLoader},XS=function(){},YS=function(a){var b=a.de("ima");if(!b)throw Error("IMA plugin not created.");var c=b.nd(),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.l=e;a=this.m.getConfiguration();a=_.M.ib(a.ima||{});this.I=_.M.ua({disableCustomPlayback:!1},a);this.L=c;this.O=d;this.j=b;this.J=new _.xv;this.g=new _.L("clpp.ima");this.h=this.a=null;this.f=new _.am;this.K=!1;this.F=new _.ti;this.P=new TS;this.o=null;this.H=this.A=this.B=!1;this.G=this.w=null;c=this.F;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Ym.bind(this));c.on(this.j,d,this.Xm.bind(this));c.on(this.m,_.ie,this.en.bind(this))},
4
- ZS=function(a){var b=a.a,c=a.F,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Om.bind(a));c.on(b,d.LOADED,a.Nk.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.fn.bind(a));c.on(b,d.STARTED,a.Qk.bind(a));c.on(b,d.LOG,a.Sm.bind(a));c.on(b,d.AD_PROGRESS,a.Ok.bind(a));c.on(b,d.AD_BUFFERING,a.Pm.bind(a));c.on(b,d.FIRST_QUARTILE,a.Lk.bind(a));c.on(b,d.MIDPOINT,a.Tm.bind(a));c.on(b,d.THIRD_QUARTILE,a.Rk.bind(a));c.on(b,d.PAUSED,a.Vm.bind(a));c.on(b,d.RESUMED,a.Wm.bind(a));c.on(b,d.CLICK,a.Kk.bind(a));c.on(b,
5
- d.SKIPPED,a.Pk.bind(a));c.on(b,d.IMPRESSION,a.Mk.bind(a));c.on(b,d.COMPLETE,a.Qm.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.gn.bind(a))},$S=function(a){a=a.I;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Xc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===
6
- _.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.Xc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},bT=function(a){a.o=null;aT(a,_.xc);a.m.getSurface().hide(a.L)},cT=function(a){return _.I(function(b){if(1==b.a)return _.x(b,a.m.detach(),2);var c=a.m;c.a&&c.a.stopForwardingEventsTo(c);_.z(b)})},dT=function(a){return _.I(function(b){return b["return"](new Promise(function(c){a.F.on(a.m,_.dg,function(){4===a.m.getState()&&
7
- c()})}))})},eT=function(a){_.Xi(a.l,{visibility:"visible"})},aT=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new SS(c,a.B,a.A)});a.m.trigger(new _.Q(b,d))},fT=function(a,b){var c=b?a.P.create(b.getErrorCode()):null;a.m.onError(new _.N(1,9,10003,{errorType:c},b))},gT=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.ij()||_.jj()},iT=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.O.initialize(),b=!!a.m.getConfiguration().muted,_.x(d,a.J.canPlay(b),
8
- 2);if(3!=d.a)return c=d.f,c||gT(a)?gT(a)?_.x(d,cT(a),3):d.C(3):(aT(a,_.Vc),a.g.warn(_.na),d["return"]());hT(a);_.z(d)})},jT=function(a,b){return _.I(function(c){if(1==c.a)return a.O.initialize(),_.x(c,b.play(),2);hT(a);_.z(c)})},hT=function(a){a.a.init(a.l.offsetWidth,a.l.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.K=!0},kT=function(){this.Ca=new _.L(RS)};_.r=SS.prototype;_.r.vb=function(){return"Google IMA SDK"};_.r.wb=function(){return google.ima.VERSION};_.r.Bb=function(){return 0};
9
- _.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.Yb=function(){return""};_.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()};_.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};
10
- _.r.bc=function(){return this.f?this.f.getIsBumper():!1};_.r.xb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Se&&typeof b[d].clickThroughUrl===_.gg});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.lb=function(){return this.a.getVastMediaWidth()};_.r.kb=function(){return this.a.getVastMediaHeight()};_.r.Va=function(){return this.a.getVastMediaBitrate()};_.r.Wa=function(){return this.h?2:this.j?1:0};
11
- _.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.Mb=function(){return this.f?this.f.getTimeOffset():0};_.r.zb=function(){return this.f?this.f.getAdPosition():1};_.r.nb=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.ac=function(){return null};
12
- SS.prototype.getVideoElement=SS.prototype.ac;SS.prototype.getWrapperCreativeIds=SS.prototype.getWrapperCreativeIds;SS.prototype.getWrapperAdSystems=SS.prototype.getWrapperAdSystems;SS.prototype.canSeek=SS.prototype.canSeek;SS.prototype.getWrapperAdIds=SS.prototype.getWrapperAdIds;SS.prototype.getSequenceLength=SS.prototype.nb;SS.prototype.getPositionInSequence=SS.prototype.zb;SS.prototype.getPodTimeOffset=SS.prototype.Mb;SS.prototype.getPodIndex=SS.prototype.getPodIndex;SS.prototype.getPodType=SS.prototype.Wa;
13
- SS.prototype.getMediaBitrate=SS.prototype.Va;SS.prototype.getMediaHeight=SS.prototype.kb;SS.prototype.getMediaWidth=SS.prototype.lb;SS.prototype.getMediaUrl=SS.prototype.getMediaUrl;SS.prototype.getClickThroughUrl=SS.prototype.xb;SS.prototype.isBumper=SS.prototype.bc;SS.prototype.getSkipTimeOffset=SS.prototype.getSkipTimeOffset;SS.prototype.getPosition=SS.prototype.getPosition;SS.prototype.getDuration=SS.prototype.getDuration;SS.prototype.getTitle=SS.prototype.getTitle;
14
- SS.prototype.getAdvertiserName=SS.prototype.getAdvertiserName;SS.prototype.getAdSystem=SS.prototype.getAdSystem;SS.prototype.getApiFramework=SS.prototype.getApiFramework;SS.prototype.getSourceId=SS.prototype.Yb;SS.prototype.getCreativeId=SS.prototype.getCreativeId;SS.prototype.getId=SS.prototype.getId;SS.prototype.getTechnology=SS.prototype.Bb;SS.prototype.getAdManagerVersion=SS.prototype.wb;SS.prototype.getAdManagerName=SS.prototype.vb;TS.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}};US.prototype.getCuePoints=function(){return this.a};US.prototype.Ob=function(){return 0<=this.a.indexOf(0)||0===this.a.length};US.prototype.Nb=function(){return 0<=this.a.indexOf(-1)};US.prototype.hasPostroll=US.prototype.Nb;US.prototype.hasPreroll=US.prototype.Ob;US.prototype.getCuePoints=US.prototype.getCuePoints;_.w(VS,_.Tv);_.r=VS.prototype;_.r.onPlayerCreated=function(a){if(WS())return a.onError(new _.N(1,9,1E4));this.f=_.Vi(_.Pd,{"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(_.xa);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
15
- _.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.Ql=function(){return this.a};_.r.Ol=function(){return this.h};_.r.nd=function(){return this.f};_.r.id=function(){return"ima"};_.K("clpp.ima.ImaPlugin",VS);VS.prototype.getAdContainer=VS.prototype.nd;VS.prototype.getAdDisplayContainer=VS.prototype.Ol;VS.prototype.getAdsLoader=VS.prototype.Ql;VS.Id="ima";
16
- VS.isSdkMissing=WS;XS.prototype.create=function(){return new VS};_.r=YS.prototype;
17
- _.r.Ym=function(a){var b=this;this.a=a.getAdsManager(this.l,$S(this));this.a.isCustomPlaybackUsed()&&!gT(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.N(1,9,10002)),this.Dc()):(this.h=new _.vv(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.w=new US(a),this.m.trigger(new _.Q(_.Ac,{adsTimeline:this.w})),ZS(this));this.f.resolve()};
18
- _.r.Xm=function(a){fT(this,a.getError());this.f.resolve()};_.r.fn=function(a){var b=this;return _.I(function(c){if(1==c.a)return b.H=!0,gT(b)?(b.G=b.m.getPosition(),_.x(c,cT(b),3)):_.x(c,b.m.pause(),4);if(3!=c.a)return _.Xi(b.l,{visibility:_.pe}),c.C(3);aT(b,_.fc,a);b.h.start();_.z(c)})};_.r.Om=function(){var a=this;return _.I(function(b){a.a.start();_.z(b)})};_.r.Nk=function(a){a.getAd().isLinear()?aT(this,_.qc,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.m.play()))};
19
- _.r.Qk=function(a){this.o=a.getAd().getDuration();aT(this,_.wc,a);this.m.getSurface().show(this.L)};_.r.Sm=function(a){a=a.getAdData();fT(this,a?a.adError:null);bT(this)};_.r.Ok=function(a){aT(this,_.tc,a)};_.r.Pm=function(a){aT(this,_.hc,a)};_.r.Lk=function(a){aT(this,_.kc,a)};_.r.Tm=function(a){aT(this,_.rc,a)};_.r.Rk=function(a){aT(this,_.yc,a)};_.r.Vm=function(a){aT(this,_.sc,a)};_.r.Wm=function(a){aT(this,_.uc,a)};_.r.Kk=function(a){this.pause();aT(this,_.ic,a)};
20
- _.r.Pk=function(a){aT(this,_.vc,a);bT(this)};_.r.Mk=function(a){aT(this,_.pc,a)};_.r.Qm=function(a){aT(this,_.jc,a);bT(this)};
21
- _.r.gn=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.B=!0;if(!gT(a)||null===a.G){if(!a.H)return b["return"](a.m.play());eT(a);b.C(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.x(b,_.Po(a.m),3);case 3:if(a.A||!a.G){b.C(2);break}return _.x(b,dT(a),5);case 5:return _.x(b,a.m.seek(a.G),2);case 2:a.H=!1;a.h&&a.h.stop();if(a.A){b.C(7);break}return _.x(b,a.m.play(),7);case 7:aT(a,_.gc),_.z(b)}})};_.r.en=function(){this.A=!0;this.j.contentComplete()};
22
- _.r.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.I;try{if(typeof c.adTagUrl!==_.gg)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.J.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.J.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);
23
- return g["return"](a.f)})};_.r.start=function(a){var b=this;return _.I(function(c){return b.a&&b.w&&!b.K?b.w.Ob()?_.x(c,iT(b),0):_.x(c,jT(b,a),0):_.x(c,a.play(),0)})};_.r.gd=function(){};_.r.ed=function(){return!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)};
24
- _.r.getPosition=function(){if(!this.a||null===this.o)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.o-a};_.r.Dc=function(){this.a&&(this.a.destroy(),this.a=null);eT(this);this.F.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};YS.prototype.getPosition=YS.prototype.getPosition;YS.prototype.setVolume=YS.prototype.setVolume;YS.prototype.getVolume=YS.prototype.getVolume;YS.prototype.skip=YS.prototype.skip;YS.prototype.pause=YS.prototype.pause;YS.prototype.resume=YS.prototype.resume;kT.prototype.name=function(){return RS};kT.prototype.a=function(a,b){return a.namespace()===_.qd?!1:WS()?(this.Ca.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};kT.prototype.create=function(a){return new YS(a)};_.Zh(new kT);_.To(new XS);};
2
+ var f=function(window){var GS="clpp.ima.AdsManagerFactory",HS=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},IS=function(){},JS=function(a){this.a=a},KS=function(){this.a=this.h=this.f=null},LS=function(){return!window.google||!google.ima||!google.ima.AdsLoader},MS=function(){},NS=function(a){var b=a.ke("ima");if(!b)throw Error("IMA plugin not created.");var c=b.sd(),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.l=e;a=this.m.getConfiguration();a=_.M.jb(a.ima||{});this.w=_.M.ra({disableCustomPlayback:!1},a);this.L=c;this.O=d;this.j=b;this.J=new _.qv;this.g=new _.L("clpp.ima");this.a=null;this.P=!1;this.h=null;this.f=new _.om;this.K=!1;this.I=new _.wi;this.T=new IS;this.o=null;this.G=this.A=this.B=!1;this.F=this.H=null;c=this.I;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.tn.bind(this));c.on(this.j,d,this.sn.bind(this));c.on(this.m,
4
+ _.pe,this.Bn.bind(this))},OS=function(a){var b=a.a,c=a.I,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.hn.bind(a));c.on(b,d.LOADED,a.il.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Cn.bind(a));c.on(b,d.STARTED,a.ll.bind(a));c.on(b,d.LOG,a.mn.bind(a));c.on(b,d.AD_PROGRESS,a.jl.bind(a));c.on(b,d.AD_BUFFERING,a.jn.bind(a));c.on(b,d.FIRST_QUARTILE,a.gl.bind(a));c.on(b,d.MIDPOINT,a.nn.bind(a));c.on(b,d.THIRD_QUARTILE,a.ml.bind(a));c.on(b,d.PAUSED,a.qn.bind(a));c.on(b,d.RESUMED,a.rn.bind(a));c.on(b,
5
+ d.CLICK,a.fl.bind(a));c.on(b,d.SKIPPED,a.kl.bind(a));c.on(b,d.IMPRESSION,a.hl.bind(a));c.on(b,d.COMPLETE,a.kn.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Dn.bind(a))},PS=function(a){a=a.w;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.bd?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&
6
+ (b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.bd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},SS=function(a){_.I(function(b){switch(b.a){case 1:return a.F=a.m.getPosition(),_.x(b,QS(a,3),2);case 2:return _.x(b,a.m.pause(),3);case 3:return _.x(b,RS(a),4);case 4:a.a.start(),_.z(b)}})},US=function(a){a.o=null;TS(a,_.Cc);a.m.getSurface().hide(a.L)},RS=
7
+ function(a){return _.I(function(b){if(1==b.a)return _.x(b,a.m.detach(),2);var c=a.m;c.a&&c.a.stopForwardingEventsTo(c);_.z(b)})},QS=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(){a.m.getState()>=b&&(clearInterval(g),clearTimeout(f),d())},200)}))})},VS=function(a){_.$i(a.l,{visibility:"visible"})},TS=function(a,b,c){c=c&&c.getAd();var d=null;c&&
8
+ (d={ad:new HS(c,a.B,a.A)});a.m.trigger(new _.Q(b,d))},WS=function(a,b){var c=b?a.T.create(b.getErrorCode()):null;a.m.onError(new _.O(1,9,10003,{errorType:c},b))},XS=function(a){return!1===a.w.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&(_.lj()||_.mj())},ZS=function(a){var b,c;_.I(function(d){if(1==d.a)return a.O.initialize(),b=!!a.m.getConfiguration().muted,_.x(d,a.J.canPlay(b),2);c=d.f;if(!c&&!XS(a))return TS(a,_.$c),a.g.warn(_.na),d["return"]();YS(a);_.z(d)})},YS=function(a){a.a.init(a.l.offsetWidth,
9
+ a.l.offsetHeight,google.ima.ViewMode.NORMAL);XS(a)?a.w.isVast&&SS(a):a.a.start();a.K=!0},$S=function(){this.Ea=new _.L(GS)};_.r=HS.prototype;_.r.wb=function(){return"Google IMA SDK"};_.r.xb=function(){return google.ima.VERSION};_.r.Cb=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.ac=function(){return""};_.r.getApiFramework=function(){return this.a.getApiFramework()};_.r.getAdSystem=function(){return this.a.getAdSystem()};
10
+ _.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.fc=function(){return this.f?this.f.getIsBumper():!1};_.r.yb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.$e&&typeof b[d].clickThroughUrl===_.lg});c&&(a=b[c].clickThroughUrl);return a};
11
+ _.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.nb=function(){return this.a.getVastMediaWidth()};_.r.lb=function(){return this.a.getVastMediaHeight()};_.r.Ya=function(){return this.a.getVastMediaBitrate()};_.r.Za=function(){return this.h?2:this.j?1:0};_.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.Pb=function(){return this.f?this.f.getTimeOffset():0};_.r.Ab=function(){return this.f?this.f.getAdPosition():1};_.r.ob=function(){return this.f?this.f.getTotalAds():1};
12
+ _.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.dc=function(){return null};HS.prototype.getVideoElement=HS.prototype.dc;HS.prototype.getWrapperCreativeIds=HS.prototype.getWrapperCreativeIds;HS.prototype.getWrapperAdSystems=HS.prototype.getWrapperAdSystems;HS.prototype.canSeek=HS.prototype.canSeek;
13
+ HS.prototype.getWrapperAdIds=HS.prototype.getWrapperAdIds;HS.prototype.getSequenceLength=HS.prototype.ob;HS.prototype.getPositionInSequence=HS.prototype.Ab;HS.prototype.getPodTimeOffset=HS.prototype.Pb;HS.prototype.getPodIndex=HS.prototype.getPodIndex;HS.prototype.getPodType=HS.prototype.Za;HS.prototype.getMediaBitrate=HS.prototype.Ya;HS.prototype.getMediaHeight=HS.prototype.lb;HS.prototype.getMediaWidth=HS.prototype.nb;HS.prototype.getMediaUrl=HS.prototype.getMediaUrl;
14
+ HS.prototype.getClickThroughUrl=HS.prototype.yb;HS.prototype.isBumper=HS.prototype.fc;HS.prototype.getSkipTimeOffset=HS.prototype.getSkipTimeOffset;HS.prototype.getPosition=HS.prototype.getPosition;HS.prototype.getDuration=HS.prototype.getDuration;HS.prototype.getTitle=HS.prototype.getTitle;HS.prototype.getAdvertiserName=HS.prototype.getAdvertiserName;HS.prototype.getAdSystem=HS.prototype.getAdSystem;HS.prototype.getApiFramework=HS.prototype.getApiFramework;HS.prototype.getSourceId=HS.prototype.ac;
15
+ HS.prototype.getCreativeId=HS.prototype.getCreativeId;HS.prototype.getId=HS.prototype.getId;HS.prototype.getTechnology=HS.prototype.Cb;HS.prototype.getAdManagerVersion=HS.prototype.xb;HS.prototype.getAdManagerName=HS.prototype.wb;IS.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}};JS.prototype.getCuePoints=function(){return this.a};JS.prototype.Sb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};JS.prototype.Rb=function(){return 0<=this.a.indexOf(-1)};JS.prototype.hasPostroll=JS.prototype.Rb;JS.prototype.hasPreroll=JS.prototype.Sb;JS.prototype.getCuePoints=JS.prototype.getCuePoints;_.w(KS,_.Zv);_.r=KS.prototype;_.r.onPlayerCreated=function(a){if(LS())return a.onError(new _.O(1,9,1E4));this.f=_.Yi(_.Xd,{"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(_.ya);this.a.getSettings().setPlayerVersion(_.ia);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.jm=function(){return this.a};_.r.hm=function(){return this.h};_.r.sd=function(){return this.f};_.r.id=function(){return"ima"};_.K("clpp.ima.ImaPlugin",KS);KS.prototype.getAdContainer=KS.prototype.sd;KS.prototype.getAdDisplayContainer=KS.prototype.hm;KS.prototype.getAdsLoader=KS.prototype.jm;KS.Id="ima";
17
+ KS.isSdkMissing=LS;MS.prototype.create=function(){return new KS};_.r=NS.prototype;
18
+ _.r.tn=function(a){var b=this;this.a=a.getAdsManager(this.l,PS(this));this.a.isCustomPlaybackUsed()&&!XS(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.Ic()):(this.h=new _.ov(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.H=new JS(a),this.m.trigger(new _.Q(_.Fc,{adsTimeline:this.H})),OS(this));this.f.resolve()};
19
+ _.r.sn=function(a){WS(this,a.getError());this.f.resolve()};_.r.Cn=function(a){this.G=!0;XS(this)||(this.m.pause(),_.$i(this.l,{visibility:_.we}));TS(this,_.jc,a);this.h.start()};_.r.hn=function(){XS(this)?SS(this):this.a.start()};_.r.il=function(a){a.getAd().isLinear()?TS(this,_.vc,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.m.play()))};_.r.ll=function(a){this.o=a.getAd().getDuration();TS(this,_.Bc,a);this.m.getSurface().show(this.L)};
20
+ _.r.mn=function(a){a=a.getAdData();WS(this,a?a.adError:null);US(this)};_.r.jl=function(a){TS(this,_.yc,a)};_.r.jn=function(a){TS(this,_.lc,a)};_.r.gl=function(a){TS(this,_.oc,a)};_.r.nn=function(a){TS(this,_.wc,a)};_.r.ml=function(a){TS(this,_.Dc,a)};_.r.qn=function(a){TS(this,_.xc,a)};_.r.rn=function(a){TS(this,_.zc,a)};_.r.fl=function(a){this.pause();TS(this,_.mc,a)};_.r.kl=function(a){TS(this,_.Ac,a);US(this)};_.r.hl=function(a){TS(this,_.uc,a)};_.r.kn=function(a){TS(this,_.nc,a);US(this)};
21
+ _.r.Dn=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.B=!0;if(!XS(a)||null===a.F){if(!a.G)return b["return"](a.m.play());VS(a);b.C(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.x(b,_.Yo(a.m),3);case 3:if(a.A||!a.F){b.C(2);break}return _.x(b,QS(a,2),5);case 5:return _.x(b,a.m.play(),6);case 6:return _.x(b,a.m.pause(),7);case 7:return _.x(b,QS(a,4),8);case 8:return _.x(b,a.m.seek(a.F),2);case 2:a.G=!1;a.h&&a.h.stop();if(a.A){b.C(10);break}return _.x(b,a.m.play(),10);case 10:TS(a,
22
+ _.kc),_.z(b)}})};_.r.Bn=function(){this.A=!0;this.j.contentComplete()};
23
+ _.r.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.w;try{if(typeof c.adTagUrl!==_.lg)throw new _.O(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.J.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.J.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);
24
+ return g["return"](a.f)})};_.r.Cd=function(){if(!this.a)return!0;if(!this.P&&!this.K){if(this.H.Sb())return ZS(this),!1;this.O.initialize();YS(this)}return!0};_.r.md=function(){};_.r.jd=function(){return!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)};
25
+ _.r.getPosition=function(){if(!this.a||null===this.o)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.o-a};_.r.Ic=function(){this.a&&(this.a.destroy(),this.a=null);this.P=!0;VS(this);this.I.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};NS.prototype.getPosition=NS.prototype.getPosition;NS.prototype.setVolume=NS.prototype.setVolume;NS.prototype.getVolume=NS.prototype.getVolume;NS.prototype.skip=NS.prototype.skip;NS.prototype.pause=NS.prototype.pause;
26
+ NS.prototype.resume=NS.prototype.resume;$S.prototype.name=function(){return GS};$S.prototype.a=function(a,b){return a.namespace()===_.xd?!1:LS()?(this.Ea.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};$S.prototype.create=function(a){return new NS(a)};_.ei(new $S);_.bp(new MS);};
25
27
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
26
28
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
27
29
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var OS=function(){this.g=new _.L("clpp.mediatailor.MediaTailorPlugin")},PS=function(a,b,c){var d,e,f,g,h;return _.I(function(l){if(1==l.a)return _.x(l,fetch(b,{method:_.qb,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;h={hj:_.qn(f,b),Fp:g?_.qn(g,b):null};a.g.info("Media Tailor session initialized.\n - manifest URI: "+h.hj);return l["return"](h)})},QS=function(){};_.w(OS,_.Tv);
3
- OS.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,PS(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.Q("mt-session-started")),b.url=e.hj,_.G(g,0);f=_.H(g);c.g.error("Failed to start session",f);throw new _.N(_.O,9,7003,"Media Tailor session failed to initialize.");})};OS.prototype.id=function(){return"mediatailor"};
4
- QS.prototype.create=function(){return new OS};_.To(new QS);};
2
+ var f=function(window){var DS=function(){this.g=new _.L("clpp.mediatailor.MediaTailorPlugin")},ES=function(a,b,c){var d,e,f,g,h;return _.I(function(l){if(1==l.a)return _.x(l,fetch(b,{method:_.rb,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;h={xj:_.An(f,b),Zp:g?_.An(g,b):null};a.g.info("Media Tailor session initialized.\n - manifest URI: "+h.xj);return l["return"](h)})},FS=function(){};_.w(DS,_.Zv);
3
+ DS.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,ES(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.Q("mt-session-started")),b.url=e.xj,_.G(g,0);f=_.H(g);c.g.error("Failed to start session",f);throw new _.O(_.P,9,7003,"Media Tailor session failed to initialize.");})};DS.prototype.id=function(){return"mediatailor"};
4
+ FS.prototype.create=function(){return new DS};_.bp(new FS);};
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));}