@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/cl.htmlcue.js CHANGED
@@ -1,25 +1,26 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var cJ="Unsupported unit",dJ="clpp-text-plain",eJ="clpp-text-ttml",fJ="clpp.htmlcue.HtmlTextDisplayer",gJ="initial",hJ=function(a,b){let c=0,d=a.length-1;for(;c<=d;){const e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},iJ=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},kJ=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>jJ[c]);return a},mJ=
2
- function(a,b){lJ(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{lJ(a,c)})},lJ=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},nJ=function(a,b){return 0===a?"0":a+b},oJ=function(a,b){return 1>Math.abs(a-b)||a<b},pJ=function(a,b){return a<b&&1<Math.abs(a-b)},qJ=function(a,b){return a>b&&1<Math.abs(a-b)},rJ=function(a,b){return 1>Math.abs(a-b)||a>b},tJ=function(a){const b=a.getBoundingClientRect();var c=getComputedStyle(a,null);const d=parseFloat(c.getPropertyValue("border-left-width"))||
3
- 0,e=parseFloat(c.getPropertyValue("border-right-width"))||0;var f=parseFloat(c.getPropertyValue("border-top-width"))||0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;const g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new sJ(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},uJ=function(a){return new sJ(a.f,a.g,a.h,a.a,a.height,a.width)},vJ=function(a,b){return b.some(c=>pJ(a.f,c.g)&&qJ(a.g,c.f)&&pJ(a.h,c.a)&&qJ(a.a,c.h))},wJ=function(a,b){return rJ(a.h,
4
- b.h)&&oJ(a.a,b.a)&&rJ(a.f,b.f)&&oJ(a.g,b.g)},xJ=function(a,b,c){switch(c){case "+x":return pJ(a.f,b.f);case "-x":return qJ(a.g,b.g);case "+y":return pJ(a.h,b.h);case "-y":return qJ(a.a,b.a);default:throw Error("Unknown axis");}},yJ=function(a){return a.f.writingMode===_.no},zJ=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect();const d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return yJ(a)?b:c},AJ=function(a){switch(a.f.writingMode){case _.no:return"horizontal-tb";case _.Ee:return _.Ee;
5
- case _.Fe:return _.Fe;default:throw Error("Unknown writing mode");}},BJ=function(a){switch(a.f.positionAlign){case _.ld:return _.fd;case "auto":case _.sc:return _.mo;case _.md:return _.ce}return a.f.textAlign},CJ=function(a,b){if(typeof a.f.position===_.r&&typeof a.f.size===_.r)switch(b){case _.ld:return a.f.position;case "auto":case _.sc:return a.f.position-a.f.size/2;case _.md:return a.f.position-a.f.size}return 0},DJ=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.fd:case _.fd:return _.ld;
6
- case _.mo:return _.sc;case _.ce:case _.ce:return _.md}return a.f.positionAlign},GJ=function(a,b,c){return(EJ(a)||FJ(a))&&_.qf(c)?nJ(c,_.Wd):EJ(a)&&_.C(c)?nJ(0,_.Wd):yJ(a)&&_.qf(b)?nJ(b,"%"):gJ},HJ=function(a,b,c){return yJ(a)&&_.qf(c)?nJ(c,_.Wd):(EJ(a)||FJ(a))&&_.qf(b)?nJ(b,"%"):gJ},FJ=function(a){return a.f.writingMode===_.Fe},EJ=function(a){return a.f.writingMode===_.Ee},IJ=function(a,b){if(a.h)switch(b.writingMode){case _.no:return["-y"];case _.Ee:return["+x"];case _.Fe:return["-x"]}a=[];switch(b.writingMode){case _.no:a=
7
- ["+y","-y"];break;case _.Ee:a=["+x","-x"];break;case _.Fe:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},JJ=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=tJ(a.j.a)},KJ=function(a,b){JJ(a.g);a.j.unshift(b);for(const c of a.j)a.g.append(c)},LJ=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.uo)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(cJ);},NJ=function(a,b,c,d){const e=document.createElement(_.oe),
8
- f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);MJ(a,c,b);a.f.debug(`Created HTML style element #${b}.`);return e.sheet},OJ=function(a,b){a=`.${a.j} .clpp-text-container`;const c=`${a} .clpp-text-cue`;return b=b.replace(/::cue\((#[^)]+)\)/g,`${a} $1`).replace(/::cue\(([^)]+)\)/g,`${c} $1`).replace(/::cue-region\(([^)]+)\)/g,`${a} $1 .clpp-text-cue`).replace(/::cue/g,c).replace(/::cue-region/g,`${a} .clpp-text-cue-region .clpp-text-cue`).replace(/::ttml/g,
9
- a)},PJ=function(a,b){let c=!1;try{a.g.insertRule(b,0);const d=a.g.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(e=>0===e.trim().indexOf(`.${a.j} `)))}catch(d){}0<a.g.cssRules.length&&a.g.deleteRule(0);return c},QJ=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.m=[]}},MJ=function(a,b,c){const d=new MutationObserver(e=>{e.forEach(f=>{f.removedNodes.forEach(g=>{g.id===c&&a.f.error(`PRESTOplay HTML style element #${c} has `+"been unexpectedly removed! Some styles will not work!")})})});
10
- d.observe(b,{subtree:!1,childList:!0});a.o.push(()=>d.disconnect())},RJ=function(a){a=_.kf(a.getConfiguration().htmlcue||{});_.C(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.C(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},XJ=function(a,b){if((b||a.j)&&a.C){var c=a.l.getPosition();if(b||a.I!==c&&a.l.getState()===_.Hl)if(a.I=c,c=SJ(a,c),b||(b=a.m,b=!(null===b&&null===c||null!==b&&null!==c&&b.start===c.start&&b.end===c.end)),b&&(a.m=c,TJ(a),c)){b={color:a.getFontColor()||void 0,
11
- backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.co(a)||void 0};c=a.f.slice(c.start,c.end+1);for(const k of c){c=a;var d=k,e=b,f=c.a.a,g=null;switch(d.payloadType){case _.Oe:g="clpp-text-vtt";break;case _.we:g=eJ;break;case _.lo:g=dJ}g&&!f.classList.contains(g)&&_.bm(f,g);f=tJ(c.a.a);if(0===f.width||0===f.height)c.M.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.");
12
- else{lJ({fontSize:UJ(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.Oe;var h=d.payloadType===_.we;d.region&&(g||h||d.backgroundImage)&&(c.A.has(d.region.id)?f=c.A.get(d.region.id):(f=new VJ(d.region,{}),c.A.set(d.region.id,f),KJ(c.a,f)));d=new WJ(d,c.K,e);f?KJ(f,d):KJ(c.a,d)}}}}},YJ=function(a){TJ(a);a.I=null;a.m=null;a.f=[]},ZJ=function(a,b){return a.startTime<=b&&a.endTime>b},SJ=function(a,b){var c=hJ(a.f,d=>ZJ(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=
13
- c;for(;0<=d-1&&ZJ(a.f[d-1],b);)d--;for(;c+1<a.f.length&&ZJ(a.f[c+1],b);)c++;return{start:d,end:c}}},TJ=function(a){a.A.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(eJ);b.classList.remove(dJ);a=a.a;JJ(a.g);a.j=[]}},UJ=function(a,b){const c=tJ(a.a.a).height;if(null!==a.H)return a.getFontSize();if(null!==a.B)return a=a.getFontSizePercent(),`${Math.round(c*a)}px`;if(typeof b===_.r&&0<b)return`${Math.round(c/b)}px`;a=a.getFontSizePercent();return`${Math.round(c*
14
- a)}px`},cK=class{parse(a){a={input:a};const b=_.dm(_.Oc),c=[];let d=b;for(var e;null!==(e=iJ(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=$J[f];h?(h=_.dm(h),(f=aK[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||bK[g.localName]&&bK[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),
15
- d.appendChild(g),d=g)}}else d.appendChild(document.createTextNode(kJ(e)));return b}},$J={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},aK={v:"voice",lang:"lang"},bK={rt:"ruby"},jJ={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var sJ=class{constructor(a,b,c,d,e,f){this.f=a;this.g=b;this.h=c;this.a=d;this.height=e;this.width=f}};var dK=class{constructor(a,b,c){this.id=a;this.o=b;this.A=c;this.a=this.m();this.h=!1}init(){this.h=!0}w(){return!1}};var WJ=class extends dK{constructor(a,b,c){super(a.id,"clpp-text-cue",{});this.j=b;this.f=a;this.g=!!this.f.backgroundImage;this.B=c}w(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)}init(a){super.init(a);if(this.g)_.bm(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage=`url("${this.f.backgroundImage}")`,this.j.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.we){var c=_.dm(_.Oc);c.innerHTML=b.payload;b=c}else b.payloadType===
16
- _.Oe?b=(new cK).parse(b.payload):(c=_.dm(_.Oc),c.textContent=b.payload,b=c);_.bm(b,this.o);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.bm(b,d);lJ({writingMode:AJ(this)},b);var d=b;this.a.appendChild(d);_.bm(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.bm(this.a,`clpp-text-wrapper__${e}`);_.C(this.f.line)&&(this.f.lineInterpretation=_.oo,this.f.line=yJ(this)?-1:0);e=AJ(this);lJ({writingMode:e,webkitWritingMode:e,direction:gJ,textAlign:BJ(this)},this.a);if(!this.f.region||
17
- !this.f.region.displayAlign){e=CJ(this,DJ(this));lJ({position:"absolute",left:GJ(this,e,null),right:FJ(this)&&_.C(null)?nJ(0,_.Wd):gJ,top:HJ(this,e,null),width:yJ(this)?nJ(this.f.size,"%"):gJ,height:EJ(this)||FJ(this)?nJ(this.f.size,"%"):gJ},this.a);b=this.f;a=yJ(this)?a.height:a.width;c=zJ(this);if(b.lineInterpretation===_.oo){var f=c*Math.round(b.line);Math.abs(f)>a&&(f=c*(0>b.line?0:-1));0>f&&(f+=a)}else{f=c/a*100;let g=b.line;switch(b.lineAlign){case _.sc:g-=f/2;break;case _.Wc:g-=f}f=Math.round(g/
18
- 100*a)}FJ(this)&&(f=a-f-c);a=f;lJ({left:GJ(this,e,a),right:FJ(this)&&_.C(a)?nJ(0,_.Wd):gJ,top:HJ(this,e,a)},this.a)}mJ(this.B,d)}}m(){return _.dm(_.Oc)}};var eK=class{constructor(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=tJ(a.a);this.g=[]}append(a){const b=a.a;b.style.visibility=_.bd;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=tJ(a.a);var d=IJ(this,a.f),e=zJ(a);const g=uJ(c);let h=null,k=0;for(const l of d){for(;xJ(c,this.a,l)||wJ(c,this.a)&&vJ(c,this.g);){d=c;var f=e;switch(l){case "+x":d.f+=f;d.g+=f;break;case "-x":d.f-=f;d.g-=f;break;case "+y":d.h+=f;d.a+=f;break;case "-y":d.h-=f,d.a-=f}}if(this.h||wJ(c,this.a))break a;
19
- d=this.a;d=Math.max(0,Math.min(c.g,d.g)-Math.max(c.f,d.f))*Math.max(0,Math.min(c.a,d.a)-Math.max(c.h,d.h))/(c.height*c.width);d>k&&(h=uJ(c),k=d);c=uJ(g)}c=h||g}lJ({top:nJ(c.h-this.a.h,_.Wd),bottom:nJ(this.a.a-c.a,_.Wd),left:nJ(c.f-this.a.f,_.Wd),right:nJ(this.a.g-c.g,_.Wd),height:nJ(c.height,_.Wd),width:nJ(c.width,_.Wd)},a.a)}b.style.visibility="visible";this.g.push(tJ(a.a))}};var fK=class extends dK{constructor(a,b,c){super(a,b,c);this.g=null;this.j=[]}init(){this.g=new eK(this);this.h=!0}m(){const a=_.dm(_.Oc);_.bm(a,this.o);this.id&&(a.id=this.id);return a}};var VJ=class extends fK{constructor(a,b){super(a.id,"clpp-text-cue-region",b);this.f=a}init(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.uo:b=b.width/100*a.width;break a;default:throw Error(cJ);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.uo)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(cJ);d=a.height;const e=LJ(this,d,a.height);lJ(this.A,this.a);lJ({left:nJ(c,_.Wd),top:nJ(e,_.Wd),width:nJ(b,
20
- _.Wd),height:nJ(d,_.Wd)},this.a);this.f.writingMode&&lJ({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&lJ({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.bm(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.uo:f=f.height/100*a.height;break a;case 2:f=f.height;c=new WJ(new _.ro(0,1,"Lorem ipsum",_.lo),{},{});b=c.a;this.a.appendChild(b);c.init(tJ(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
21
- b=c;f*=b;break a;default:throw Error(cJ);}a=LJ(this,f,a.height);lJ({top:nJ(a,_.Wd),height:nJ(f,_.Wd)},this.a);this.g=new eK(this,!0);this.h=!0}getId(){return this.f.id}};var gK=class{constructor(a,b){this.f=new _.O("clpp.htmlcue.StyleManager");this.o=[];this.j=a.getSurface().getUniqueCssClass();this.h=b;this.m=[];this.a=NJ(this,this.h,this.j);this.g=NJ(this,this.h,this.j,!0);this.g.disabled=!0;this.f.debug(`Stylesheet ${this.h} has been created.`)}appendRule(a){if(null!=this.a&&!this.m.some(b=>b===a)){const b=OJ(this,a);if(PJ(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.f.debug(`Added CSS rule ${b}`)}catch(c){this.f.error(`An error occurred when adding a CSS rule: ${b}`)}this.m.push(a)}else this.f.warn(`Stylesheet ${this.h} ignoring the CSS rule `+
22
- `because it's not safe: ${b}`)}}destroy(){const a=this;return _.y(function*(){null!=a.a&&(a.o.forEach(b=>b()),a.o=[],QJ(a),document.head.removeChild(a.a.ownerNode),document.head.removeChild(a.g.ownerNode),a.a=null,a.g=null,a.f.debug(`Stylesheet ${a.h} has been destroyed.`))})}};var hK=class extends _.Xp{constructor(a){super(a);this.M=new _.O(fJ);this.l=a;this.K=RJ(a);this.j=!1;this.f=[];this.C=a.getSurface().getContainer();this.h=new gK(a,"CLPP Subtitle Styles");this.a=new fK(null,"clpp-text-container",{});this.w=new _.Sp(a.getSurface(),this.V.bind(this));this.I=null;this.C?(this.C.appendChild(this.a.a),this.a.init(null)):this.M.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.F=
23
- new _.Yh(()=>{XJ(this)});this.A=new Map;this.m=null}append(a,b){if(null!=this.h&&0!==a.length){for(const c of b)this.h.appendRule(c);a.sort((c,d)=>c.startTime!==d.startTime?c.startTime-d.startTime:c.endTime-d.endTime);b=this.f.findIndex(c=>c.startTime>=a[0].startTime);0===b?this.f=[]:0<b&&this.f.splice(0,b);for(const c of a)this.f.some(d=>d.payload!==c.payload?!1:d.startTime!==c.startTime?!1:d.endTime!==c.endTime?!1:!0)||this.f.push(c);this.m=null;XJ(this,!1)}}g(){null==this.h||XJ(this,!0)}destroy(){const a=
24
- this;return _.y(function*(){null!=a.h&&(YJ(a),a.F.stop(),yield a.h.destroy(),a.h=null,a.C.removeChild(a.a.a),a.a=null,a.w.stop(),a.w=null,a.j=!1)})}remove(a,b){if(null==this.h)return!1;this.f=this.f.filter(c=>c.startTime<a||c.endTime>=b);this.m=null;XJ(this,!0);return!0}isTextVisible(){return this.j}setTextVisibility(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.F.Xa(.25),this.K.enableResizeObserver&&this.w.start(),XJ(this,!0)):(this.F.stop(),this.w.stop(),YJ(this)))}V(){XJ(this,!0)}};_.z(fJ,hK);
25
- hK.prototype.setTextVisibility=hK.prototype.setTextVisibility;hK.prototype.isTextVisible=hK.prototype.isTextVisible;hK.prototype.remove=hK.prototype.remove;hK.prototype.destroy=hK.prototype.destroy;hK.prototype.append=hK.prototype.append;var iK=class{ea(a){return!!a.enableHtmlCue&&!_.ni()}create(a){return new hK(a)}};_.z("clpp.htmlcue.HtmlCueComponent",class extends _.zp{f(){_.ll("html",new iK)}a(){}id(){return _.pe}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var BK="Unsupported unit",CK="clpp-text-plain",DK="clpp-text-ttml",EK="clpp.htmlcue.HtmlTextDisplayer",FK="initial",GK=function(a){return _.yg(a,{De:(b,c)=>b.bd(c)})},HK=function(a,b){if(0===b.length)return a;let c=a;a=a.findIndex(d=>d.startTime>=b[0].startTime);0<=a&&(c=c.slice(0,a));return c.concat(b)},IK=function(a,b){let c=0,d=a.length-1;for(;c<=d;){const e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},JK=function(a){if(!a.input)return null;var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);
2
+ b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},LK=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>KK[c]);return a},NK=function(a,b){MK(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{MK(a,c)})},MK=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},OK=function(a,b){return 0===a?"0":a+b},PK=function(a,b){return 1>Math.abs(a-b)||a<b},QK=function(a,b){return a<b&&1<Math.abs(a-b)},RK=function(a,b){return a>b&&1<Math.abs(a-b)},SK=
3
+ function(a,b){return 1>Math.abs(a-b)||a>b},UK=function(a){const b=a.getBoundingClientRect();var c=getComputedStyle(a,null);const d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0;var f=parseFloat(c.getPropertyValue("border-top-width"))||0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;const g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new TK(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
+ d-e)},VK=function(a){return new TK(a.f,a.g,a.j,a.a,a.height,a.width)},WK=function(a,b){return b.some(c=>QK(a.f,c.g)&&RK(a.g,c.f)&&QK(a.j,c.a)&&RK(a.a,c.j))},XK=function(a,b){return SK(a.j,b.j)&&PK(a.a,b.a)&&SK(a.f,b.f)&&PK(a.g,b.g)},YK=function(a,b,c){switch(c){case "+x":return QK(a.f,b.f);case "-x":return RK(a.g,b.g);case "+y":return QK(a.j,b.j);case "-y":return RK(a.a,b.a);default:throw Error("Unknown axis");}},ZK=function(a){return a.f.writingMode===_.zp},$K=function(a){var b=a.a.childNodes[0],
5
+ c=a.a.getBoundingClientRect();const d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return ZK(a)?b:c},aL=function(a){switch(a.f.writingMode){case _.zp:return"horizontal-tb";case _.cf:return _.cf;case _.df:return _.df;default:throw Error("Unknown writing mode");}},bL=function(a){switch(a.f.positionAlign){case _.yd:return _.vd;case "auto":case _.zc:return _.yp;case _.zd:return _.ze}return a.f.textAlign},cL=function(a,b){if(typeof a.f.position===_.r&&typeof a.f.size===_.r)switch(b){case _.yd:return a.f.position;
6
+ case "auto":case _.zc:return a.f.position-a.f.size/2;case _.zd:return a.f.position-a.f.size}return 0},dL=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.vd:case _.vd:return _.yd;case _.yp:return _.zc;case _.ze:case _.ze:return _.zd}return a.f.positionAlign},gL=function(a,b,c){return(eL(a)||fL(a))&&_.Sf(c)?OK(c,_.se):eL(a)&&_.B(c)?OK(0,_.se):ZK(a)&&_.Sf(b)?OK(b,"%"):FK},hL=function(a,b,c){return ZK(a)&&_.Sf(c)?OK(c,_.se):(eL(a)||fL(a))&&_.Sf(b)?OK(b,"%"):FK},fL=function(a){return a.f.writingMode===
7
+ _.df},eL=function(a){return a.f.writingMode===_.cf},iL=function(a,b){if(a.j)switch(b.writingMode){case _.zp:return["-y"];case _.cf:return["+x"];case _.df:return["-x"]}a=[];switch(b.writingMode){case _.zp:a=["+y","-y"];break;case _.cf:a=["+x","-x"];break;case _.df:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},jL=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=UK(a.l.a)},kL=function(a,b){jL(a.g);a.l.unshift(b);for(const c of a.l)a.g.append(c)},lL=function(a,
8
+ b,c){a=a.f;const 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(BK);},nL=function(a,b,c,d){const e=document.createElement(_.Le),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);mL(a,c,b);a.h.debug(`Created HTML style element #${b}.`);return e.sheet},oL=function(a,b){a=`.${a.j} .clpp-text-container`;const c=`${a} .clpp-text-cue`;return b=b.replace(/::cue\((#[^)]+)\)/g,
9
+ `${a} $1`).replace(/::cue\(([^)]+)\)/g,`${c} $1`).replace(/::cue-region\(([^)]+)\)/g,`${a} $1 .clpp-text-cue`).replace(/::cue/g,c).replace(/::cue-region/g,`${a} .clpp-text-cue-region .clpp-text-cue`).replace(/::ttml/g,a)},pL=function(a,b){let c=!1;try{a.f.insertRule(b,0);const d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(e=>0===e.trim().indexOf(`.${a.j} `)))}catch(d){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},qL=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);
10
+ a.l=[]}},mL=function(a,b,c){const d=new MutationObserver(e=>{e.forEach(f=>{f.removedNodes.forEach(g=>{g.id===c&&a.h.error(`PRESTOplay HTML style element #${c} has `+"been unexpectedly removed! Some styles will not work!")})})});d.observe(b,{subtree:!1,childList:!0});a.o.push(()=>d.disconnect())},rL=function(a){a=_.Hf(a.getConfiguration().htmlcue||{});_.B(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.B(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},xL=function(a,b){if((b||a.l)&&
11
+ a.F){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Dm)if(a.J=c,c=sL(a,c),b||(b=a.o,b=!(null===b&&null===c||null!==b&&null!==c&&b.start===c.start&&b.end===c.end)),b&&(a.o=c,tL(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.pp(a)||void 0};c=a.f.slice(c.start,c.end+1);for(const k of c){c=a;var d=k,e=b,f=c.a.a,g=null;switch(d.payloadType){case _.lf:g="clpp-text-vtt";break;case _.Ue:g=DK;break;case _.xp:g=
12
+ CK}g&&!f.classList.contains(g)&&_.Ym(f,g);f=UK(c.a.a);if(0===f.width||0===f.height)c.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.");else{MK({fontSize:uL(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.lf;var h=d.payloadType===_.Ue;d.region&&(g||h||d.backgroundImage)&&(c.B.has(d.region.id)?f=c.B.get(d.region.id):(f=new vL(d.region,{}),c.B.set(d.region.id,f),kL(c.a,f)));
13
+ d=new wL(d,c.M,e);f?kL(f,d):kL(c.a,d)}}}}},yL=function(a){tL(a);a.J=null;a.o=null;a.f=[]},zL=function(a,b){return a.startTime<=b&&a.endTime>b},sL=function(a,b){var c=IK(a.f,d=>zL(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&zL(a.f[d-1],b);)d--;for(;c+1<a.f.length&&zL(a.f[c+1],b);)c++;return{start:d,end:c}}},tL=function(a){a.B.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(DK);b.classList.remove(CK);a=a.a;jL(a.g);
14
+ a.l=[]}},uL=function(a,b){const c=UK(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.C)return a=a.getFontSizePercent(),`${Math.round(c*a)}px`;if(typeof b===_.r&&0<b)return`${Math.round(c/b)}px`;a=a.getFontSizePercent();return`${Math.round(c*a)}px`},DL=class{parse(a){a={input:a};const b=_.$m(_.Yc),c=[];let d=b;for(var e;null!==(e=JK(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=
15
+ e[1];var g=e[3];var h=AL[f];h?(h=_.$m(h),(f=BL[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||CL[g.localName]&&CL[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),d=g)}}else d.appendChild(document.createTextNode(LK(e)));return b}},AL={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},BL={v:"voice",lang:"lang"},CL={rt:"ruby"},KK={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f",
16
+ "\x26nbsp;":"\u00a0"};var TK=class{constructor(a,b,c,d,e,f){this.f=a;this.g=b;this.j=c;this.a=d;this.height=e;this.width=f}};var EL=class{constructor(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1}init(){this.j=!0}A(){return!1}};var wL=class extends EL{constructor(a,b,c){super(a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.g=!!this.f.backgroundImage;this.C=c}A(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)}init(a){super.init(a);if(this.g)_.Ym(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===_.Ue){var c=_.$m(_.Yc);c.innerHTML=b.payload;b=c}else b.payloadType===
17
+ _.lf?b=(new DL).parse(b.payload):(c=_.$m(_.Yc),c.textContent=b.payload,b=c);_.Ym(b,this.w);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.Ym(b,d);MK({writingMode:aL(this)},b);var d=b;this.a.appendChild(d);_.Ym(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.Ym(this.a,`clpp-text-wrapper__${e}`);_.B(this.f.line)&&(this.f.lineInterpretation=_.Ap,this.f.line=ZK(this)?-1:0);e=aL(this);MK({writingMode:e,webkitWritingMode:e,direction:FK,textAlign:bL(this)},this.a);if(!this.f.region||
18
+ !this.f.region.displayAlign){e=cL(this,dL(this));MK({position:"absolute",left:gL(this,e,null),right:fL(this)&&_.B(null)?OK(0,_.se):FK,top:hL(this,e,null),width:ZK(this)?OK(this.f.size,"%"):FK,height:eL(this)||fL(this)?OK(this.f.size,"%"):FK},this.a);b=this.f;a=ZK(this)?a.height:a.width;c=$K(this);if(b.lineInterpretation===_.Ap){var f=c*Math.round(b.line);Math.abs(f)>a&&(f=c*(0>b.line?0:-1));0>f&&(f+=a)}else{f=c/a*100;let g=b.line;switch(b.lineAlign){case _.zc:g-=f/2;break;case _.jd:g-=f}f=Math.round(g/
19
+ 100*a)}fL(this)&&(f=a-f-c);a=f;MK({left:gL(this,e,a),right:fL(this)&&_.B(a)?OK(0,_.se):FK,top:hL(this,e,a)},this.a)}NK(this.C,d)}}o(){return _.$m(_.Yc)}};var FL=class{constructor(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=UK(a.a);this.g=[]}append(a){const b=a.a;b.style.visibility=_.qd;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=UK(a.a);var d=iL(this,a.f),e=$K(a);const g=VK(c);let h=null,k=0;for(const l of d){for(;YK(c,this.a,l)||XK(c,this.a)&&WK(c,this.g);){d=c;var f=e;switch(l){case "+x":d.f+=f;d.g+=f;break;case "-x":d.f-=f;d.g-=f;break;case "+y":d.j+=f;d.a+=f;break;case "-y":d.j-=f,d.a-=f}}if(this.j||XK(c,this.a))break a;
20
+ d=this.a;d=Math.max(0,Math.min(c.g,d.g)-Math.max(c.f,d.f))*Math.max(0,Math.min(c.a,d.a)-Math.max(c.j,d.j))/(c.height*c.width);d>k&&(h=VK(c),k=d);c=VK(g)}c=h||g}MK({top:OK(c.j-this.a.j,_.se),bottom:OK(this.a.a-c.a,_.se),left:OK(c.f-this.a.f,_.se),right:OK(this.a.g-c.g,_.se),height:OK(c.height,_.se),width:OK(c.width,_.se)},a.a)}b.style.visibility="visible";this.g.push(UK(a.a))}};var GL=class extends EL{constructor(a,b,c){super(a,b,c);this.g=null;this.l=[]}init(){this.g=new FL(this);this.j=!0}o(){const a=_.$m(_.Yc);_.Ym(a,this.w);this.id&&(a.id=this.id);return a}};var vL=class extends GL{constructor(a,b){super(a.id,"clpp-text-cue-region",b);this.f=a}init(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(BK);}}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(BK);d=a.height;const e=lL(this,d,a.height);MK(this.B,this.a);MK({left:OK(c,_.se),top:OK(e,_.se),width:OK(b,
21
+ _.se),height:OK(d,_.se)},this.a);this.f.writingMode&&MK({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&MK({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.Ym(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.Gp:f=f.height/100*a.height;break a;case 2:f=f.height;c=new wL(new _.Dp(0,1,"Lorem ipsum",_.xp),{},{});b=c.a;this.a.appendChild(b);c.init(UK(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
+ b=c;f*=b;break a;default:throw Error(BK);}a=lL(this,f,a.height);MK({top:OK(a,_.se),height:OK(f,_.se)},this.a);this.g=new FL(this,!0);this.j=!0}getId(){return this.f.id}};var HL=class{constructor(a,b){this.h=new _.R("clpp.htmlcue.StyleManager");this.o=[];this.j=a.getSurface().getUniqueCssClass();this.g=b;this.l=[];this.a=nL(this,this.g,this.j);this.f=nL(this,this.g,this.j,!0);this.f.disabled=!0;this.h.debug(`Stylesheet ${this.g} has been created.`)}appendRule(a){if(null!=this.a&&!this.l.some(b=>b===a)){const b=oL(this,a);if(pL(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.l.push(a)}else this.h.warn(`Stylesheet ${this.g} ignoring the CSS rule `+
23
+ `because it's not safe: ${b}`)}}destroy(){const a=this;return _.x(function*(){null!=a.a&&(a.o.forEach(b=>b()),a.o=[],qL(a),document.head.removeChild(a.a.ownerNode),document.head.removeChild(a.f.ownerNode),a.a=null,a.f=null,a.h.debug(`Stylesheet ${a.g} has been destroyed.`))})}};var IL=class extends _.or{constructor(a){super(a);this.h=new _.R(EK);this.m=a;this.M=rL(a);this.l=!1;this.f=[];this.F=a.getSurface().getContainer();this.j=new HL(a,"CLPP Subtitle Styles");this.a=new GL(null,"clpp-text-container",{});this.A=new _.fr(a.getSurface(),this.V.bind(this));this.J=null;this.F?(this.F.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.G=
24
+ new _.zi(()=>{xL(this)});this.B=new Map;this.o=null}append(a,b){if(null!=this.j&&0!==a.length){for(const c of b)this.j.appendRule(c);a.sort((c,d)=>c.startTime!==d.startTime?c.startTime-d.startTime:c.endTime-d.endTime);this.f=HK(this.f,GK(a));this.o=null;xL(this,!1)}}g(){null==this.j||xL(this,!0)}destroy(){const a=this;return _.x(function*(){null!=a.j&&(yL(a),a.G.stop(),yield a.j.destroy(),a.j=null,a.F.removeChild(a.a.a),a.a=null,a.A.stop(),a.A=null,a.l=!1)})}remove(a,b){if(null==this.j)return!1;this.f=
25
+ this.f.filter(c=>c.startTime<a||c.endTime>=b);this.o=null;xL(this,!0);return!0}isTextVisible(){return this.l}setTextVisibility(a){null!=this.j&&this.l!==a&&((this.l=a)?(this.G.Ya(.25),this.M.enableResizeObserver&&this.A.start(),xL(this,!0)):(this.G.stop(),this.A.stop(),yL(this)))}V(){xL(this,!0)}};_.z(EK,IL);IL.prototype.setTextVisibility=IL.prototype.setTextVisibility;IL.prototype.isTextVisible=IL.prototype.isTextVisible;IL.prototype.remove=IL.prototype.remove;IL.prototype.destroy=IL.prototype.destroy;
26
+ IL.prototype.append=IL.prototype.append;var JL=class{da(a){return!!a.enableHtmlCue&&!_.Ri()}create(a){return new IL(a)}};_.z("clpp.htmlcue.HtmlCueComponent",class extends _.Pq{f(){_.hm(_.rd,new JL)}a(){_.fm.has(_.rd)&&(_.fm.delete(_.rd),_.gm.info("Removed factory: 'html'"))}id(){return _.Oe}});};f.call(g, window);
package/cl.ima.js CHANGED
@@ -1,17 +1,17 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var MI="clpp.ima.AdsManagerFactory",NI=function(a){a=a.H;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.fc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.r&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.r&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
2
- _.fc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},OI=function(a){return!1===a.H.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.bi()},PI=function(a){const b=a.a,c=a.o,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.ma.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.pc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.Za.bind(a));c.on(b,d.AD_PROGRESS,a.Db.bind(a));c.on(b,d.AD_BUFFERING,a.La.bind(a));
3
- c.on(b,d.FIRST_QUARTILE,a.T.bind(a));c.on(b,d.MIDPOINT,a.$a.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.ab.bind(a));c.on(b,d.RESUMED,a.Qb.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.Y.bind(a));c.on(b,d.IMPRESSION,a.V.bind(a));c.on(b,d.COMPLETE,a.Ya.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.qc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.kc.bind(a))},QI=function(a,b){const c=b?a.ga.create(b.getErrorCode()):null;a.l.onError(new _.H(1,9,10003,{errorType:c},b))},RI=function(a,
4
- b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new W(c,a.C,a.B)});a.l.trigger(new _.F(b,d))},SI=function(a){a.A=null;RI(a,_.Ib);a.m&&a.l.getSurface().hide(a.m)},TI=function(a){_.cm(a.w,{visibility:"visible"})},VI=function(a){return _.y(function*(){a.M.initialize();const b=!!a.l.getConfiguration().muted;(yield a.J.canPlay(b))||OI(a)?UI(a):(RI(a,_.dc),a.N.warn(_.ia))})},WI=function(a,b){return _.y(function*(){a.M.initialize();yield b.play();UI(a)})},UI=function(a){a.a.init(a.w.offsetWidth,a.w.offsetHeight,
5
- google.ima.ViewMode.NORMAL);a.G=!0},XI=function(){return!window.google||!google.ima||!google.ima.AdsLoader},W=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c}pb(){return"Google IMA SDK"}qb(){return google.ima.VERSION}vb(){return 0}getId(){return this.a.getAdId()}getCreativeId(){return this.a.getCreativeId()}getApiFramework(){return this.a.getApiFramework()}getAdSystem(){return this.a.getAdSystem()}getAdvertiserName(){return this.a.getAdvertiserName()}getTitle(){return this.a.getTitle()}getDuration(){return this.a.getDuration()}getSkipTimeOffset(){return this.a.getSkipTimeOffset()}$b(){return this.f?
6
- this.f.getIsBumper():!1}Hb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Bd&&typeof b[d].clickThroughUrl===_.me);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}sb(){return this.a.getVastMediaWidth()}rb(){return this.a.getVastMediaHeight()}gb(){return this.a.getVastMediaBitrate()}Sa(){return this.g?2:this.h?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Ib(){return this.f?this.f.getTimeOffset():0}Jb(){return this.f?this.f.getAdPosition():
7
- 1}ub(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};W.prototype.getWrapperCreativeIds=W.prototype.getWrapperCreativeIds;W.prototype.getWrapperAdSystems=W.prototype.getWrapperAdSystems;W.prototype.getWrapperAdIds=W.prototype.getWrapperAdIds;W.prototype.getSequenceLength=W.prototype.ub;W.prototype.getPositionInSequence=W.prototype.Jb;
8
- W.prototype.getPodTimeOffset=W.prototype.Ib;W.prototype.getPodIndex=W.prototype.getPodIndex;W.prototype.getPodType=W.prototype.Sa;W.prototype.getMediaBitrate=W.prototype.gb;W.prototype.getMediaHeight=W.prototype.rb;W.prototype.getMediaWidth=W.prototype.sb;W.prototype.getMediaUrl=W.prototype.getMediaUrl;W.prototype.getClickThroughUrl=W.prototype.Hb;W.prototype.isBumper=W.prototype.$b;W.prototype.getSkipTimeOffset=W.prototype.getSkipTimeOffset;W.prototype.getDuration=W.prototype.getDuration;
9
- W.prototype.getTitle=W.prototype.getTitle;W.prototype.getAdvertiserName=W.prototype.getAdvertiserName;W.prototype.getAdSystem=W.prototype.getAdSystem;W.prototype.getApiFramework=W.prototype.getApiFramework;W.prototype.getCreativeId=W.prototype.getCreativeId;W.prototype.getId=W.prototype.getId;W.prototype.getTechnology=W.prototype.vb;W.prototype.getAdManagerVersion=W.prototype.qb;W.prototype.getAdManagerName=W.prototype.pb;var YI=class{create(a){const 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}}};var ZI=class{constructor(a){this.a=a}getCuePoints(){return this.a}Kb(){return 0<=this.a.indexOf(0)||0===this.a.length}hb(){return 0<=this.a.indexOf(-1)}};ZI.prototype.hasPostroll=ZI.prototype.hb;ZI.prototype.hasPreroll=ZI.prototype.Kb;ZI.prototype.getCuePoints=ZI.prototype.getCuePoints;var $I=class{constructor(a){this.l=a;this.w=a.getSurface().getMedia();a=this.l.getConfiguration();a=_.kf(a.ima||{});this.H=a=_.jf({disableCustomPlayback:!1},a);this.m=this.l.Wb("ima").rc();this.M=this.l.Wb("ima").g;this.j=this.l.Wb("ima").a;this.J=new _.Up;this.N=new _.O("clpp.ima");this.g=this.a=null;this.f=new _.Mk;this.G=!1;this.o=new _.jo;this.ga=new YI;this.A=null;this.K=this.F=this.B=this.C=!1;this.I=this.h=null;{a=this.o;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
- this.Sb.bind(this));a.on(this.j,b,this.Rb.bind(this));a.on(this.l,_.Xc,this.oc.bind(this))}}Sb(a){this.a=a.getAdsManager(this.w,NI(this));this.a.isCustomPlaybackUsed()&&!OI(this)?(this.N.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.l.onError(new _.H(1,9,10002)),this.dispose()):(this.g=new _.Sp(this.l.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.h=new ZI(a),this.l.trigger(new _.F(_.Lb,
11
- {adsTimeline:this.h})),PI(this));this.f.resolve()}Rb(a){QI(this,a.getError());this.f.resolve()}pc(a){const b=this;return _.y(function*(){b.F=!0;OI(b)||(yield b.l.pause(),_.cm(b.w,{visibility:_.bd}));RI(b,_.ub,a);b.g.start()})}ma(){const a=this;return _.y(function*(){if(OI(a)){a.I=a.l.getPosition();yield a.l.detach();var b=a.l;b.a&&b.a.removeDelegate(b)}a.a.start()})}W(a){a.getAd().isLinear()?RI(this,_.Bb,a):(this.a.discardAdBreak(),this.C||(this.C=!0,this.l.play()))}aa(a){this.A=a.getAd().getDuration();
12
- RI(this,_.Hb,a);this.l.getSurface().show(this.m)}Za(a){a=a.getAdData();QI(this,a?a.adError:null);SI(this)}Db(a){RI(this,_.Eb,a)}La(a){RI(this,_.wb,a)}T(a){RI(this,_.zb,a)}$a(a){RI(this,_.Cb,a)}ba(a){RI(this,_.Jb,a)}ab(a){RI(this,_.Db,a)}Qb(a){RI(this,_.Fb,a)}R(a){this.pause();RI(this,_.xb,a)}Y(a){RI(this,_.Gb,a);SI(this)}V(a){RI(this,_.Ab,a)}Ya(a){RI(this,_.yb,a);SI(this)}qc(){const a=this;return _.y(function*(){a.C=!0;if(OI(a)&&null!==a.I){var b=a.l;b.a&&b.a.addDelegate(b);yield _.Vm(a.l);a.B||(yield a.l.seek(a.I))}else{if(!a.F)return a.l.play();
13
- TI(a)}a.F=!1;a.g&&a.g.stop();a.B||(yield a.l.play());RI(a,_.vb)})}kc(){this.K=!0}oc(){this.B=!0;this.j.contentComplete()}load(){const a=this;return _.y(function*(){var b=a.l;const c=a.H;try{if(typeof c.adTagUrl!==_.me)throw new _.H(1,9,10001,{missingKeys:"adTagUrl"});}catch(f){return b.onError(f),a.f.resolve(),a.f}if(!c.adTagUrl)return a.f.resolve(),a.f;b=yield a.J.canPlay(!1);const d=yield a.J.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);
14
- a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(e);return a.f})}start(a){const b=this;return _.y(function*(){b.a&&b.h&&!b.G?b.h.Kb()?yield VI(b):yield WI(b,a):yield a.play()})}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&this.a.skip()}getVolume(){return this.a?this.a.getVolume():1}setVolume(a){this.a&&this.a.setVolume(a)}getPosition(){if(!this.a||null===this.A)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.A-a}dispose(){return(new Promise(a=>
15
- {this.G&&this.h&&this.h.hb()&&!this.K?(this.o.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m&&this.l.getSurface().hide(this.m)}),_.Nf(this.o,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.j.contentComplete()})).then(()=>{TI(this);this.o.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};$I.prototype.getPosition=$I.prototype.getPosition;
16
- $I.prototype.setVolume=$I.prototype.setVolume;$I.prototype.getVolume=$I.prototype.getVolume;$I.prototype.skip=$I.prototype.skip;$I.prototype.pause=$I.prototype.pause;$I.prototype.resume=$I.prototype.resume;var aJ=class extends _.$p{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(XI())return a.onError(new _.H(1,9,1E4));this.f=_.am(_.Oc,{"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(_.ma);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
17
- (this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}Hf(){return this.a}Ff(){return this.g}rc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",aJ);aJ.prototype.getAdContainer=aJ.prototype.rc;aJ.prototype.getAdDisplayContainer=aJ.prototype.Ff;aJ.prototype.getAdsLoader=aJ.prototype.Hf;aJ.Id="ima";aJ.isSdkMissing=XI;_.Hm(new class{create(){return new aJ}});var bJ=class{constructor(){this.a=new _.O(MI)}name(){return MI}ea(a,b){return a.namespace()===_.yc?!1:XI()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new $I(a)}};bJ.prototype.create=bJ.prototype.create;bJ.prototype.isSupported=bJ.prototype.ea;bJ.prototype.name=bJ.prototype.name;_.Yl(new bJ);};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var kK="clpp.ima.AdsManagerFactory",lK=function(a){a=a.I;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.nc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.r&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.r&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
2
+ _.nc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},mK=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Fi()},nK=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.na.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.nc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.$a.bind(a));c.on(b,d.AD_PROGRESS,a.Eb.bind(a));c.on(b,d.AD_BUFFERING,a.Na.bind(a));
3
+ c.on(b,d.FIRST_QUARTILE,a.S.bind(a));c.on(b,d.MIDPOINT,a.ab.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.bb.bind(a));c.on(b,d.RESUMED,a.Db.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.Y.bind(a));c.on(b,d.IMPRESSION,a.V.bind(a));c.on(b,d.COMPLETE,a.Za.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.oc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Sb.bind(a))},oK=function(a,b){const c=b?a.fa.create(b.getErrorCode()):null;a.m.onError(new _.H(1,9,10003,{errorType:c},b))},pK=function(a,
4
+ b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.F,a.C)});a.m.trigger(new _.F(b,d))},qK=function(a){a.B=null;pK(a,_.Qb);a.o&&a.m.getSurface().hide(a.o)},rK=function(a){_.Zm(a.A,{visibility:"visible"})},tK=function(a){return _.x(function*(){a.N.initialize();const b=!!a.m.getConfiguration().muted;(yield a.K.canPlay(b))||mK(a)?sK(a):(pK(a,_.lc),a.h.warn(_.ia))})},uK=function(a,b){return _.x(function*(){a.N.initialize();yield b.play();sK(a)})},sK=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,
5
+ google.ima.ViewMode.NORMAL);a.H=!0},vK=function(){return!window.google||!google.ima||!google.ima.AdsLoader},X=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.g=c}pb(){return"Google IMA SDK"}qb(){return google.ima.VERSION}vb(){return 0}getId(){return this.a.getAdId()}getCreativeId(){return this.a.getCreativeId()}getApiFramework(){return this.a.getApiFramework()}getAdSystem(){return this.a.getAdSystem()}getAdvertiserName(){return this.a.getAdvertiserName()}getTitle(){return this.a.getTitle()}getDuration(){return this.a.getDuration()}getSkipTimeOffset(){return this.a.getSkipTimeOffset()}ac(){return this.f?
6
+ this.f.getIsBumper():!1}Ib(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Od&&typeof b[d].clickThroughUrl===_.Je);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}sb(){return this.a.getVastMediaWidth()}rb(){return this.a.getVastMediaHeight()}gb(){return this.a.getVastMediaBitrate()}Ta(){return this.g?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Jb(){return this.f?this.f.getTimeOffset():0}Kb(){return this.f?this.f.getAdPosition():
7
+ 1}ub(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};X.prototype.getWrapperCreativeIds=X.prototype.getWrapperCreativeIds;X.prototype.getWrapperAdSystems=X.prototype.getWrapperAdSystems;X.prototype.getWrapperAdIds=X.prototype.getWrapperAdIds;X.prototype.getSequenceLength=X.prototype.ub;X.prototype.getPositionInSequence=X.prototype.Kb;
8
+ X.prototype.getPodTimeOffset=X.prototype.Jb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Ta;X.prototype.getMediaBitrate=X.prototype.gb;X.prototype.getMediaHeight=X.prototype.rb;X.prototype.getMediaWidth=X.prototype.sb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Ib;X.prototype.isBumper=X.prototype.ac;X.prototype.getSkipTimeOffset=X.prototype.getSkipTimeOffset;X.prototype.getDuration=X.prototype.getDuration;
9
+ X.prototype.getTitle=X.prototype.getTitle;X.prototype.getAdvertiserName=X.prototype.getAdvertiserName;X.prototype.getAdSystem=X.prototype.getAdSystem;X.prototype.getApiFramework=X.prototype.getApiFramework;X.prototype.getCreativeId=X.prototype.getCreativeId;X.prototype.getId=X.prototype.getId;X.prototype.getTechnology=X.prototype.vb;X.prototype.getAdManagerVersion=X.prototype.qb;X.prototype.getAdManagerName=X.prototype.pb;var wK=class{create(a){const 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}}};var xK=class{constructor(a){this.a=a}getCuePoints(){return this.a}Lb(){return 0<=this.a.indexOf(0)||0===this.a.length}hb(){return 0<=this.a.indexOf(-1)}};xK.prototype.hasPostroll=xK.prototype.hb;xK.prototype.hasPreroll=xK.prototype.Lb;xK.prototype.getCuePoints=xK.prototype.getCuePoints;var yK=class{constructor(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.Hf(a.ima||{});this.I=a=_.Gf({disableCustomPlayback:!1},a);this.o=this.m.Xb("ima").pc();this.N=this.m.Xb("ima").g;this.l=this.m.Xb("ima").a;this.K=new _.hr;this.h=new _.R("clpp.ima");this.g=this.a=null;this.f=new _.Jl;this.H=!1;this.w=new _.vp;this.fa=new wK;this.B=null;this.M=this.G=this.C=this.F=!1;this.J=this.j=null;{a=this.w;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
+ this.Rb.bind(this));a.on(this.l,b,this.Fb.bind(this));a.on(this.m,_.kd,this.Ub.bind(this))}}Rb(a){this.a=a.getAdsManager(this.A,lK(this));this.a.isCustomPlaybackUsed()&&!mK(this)?(this.h.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.H(1,9,10002)),this.dispose()):(this.g=new _.fr(this.m.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new xK(a),this.m.trigger(new _.F(_.Vb,
11
+ {adsTimeline:this.j})),nK(this));this.f.resolve()}Fb(a){oK(this,a.getError());this.f.resolve()}nc(a){const b=this;return _.x(function*(){b.G=!0;mK(b)||(yield b.m.pause(),_.Zm(b.A,{visibility:_.qd}));pK(b,_.Cb,a);b.g.start()})}na(){const a=this;return _.x(function*(){if(mK(a)){a.J=a.m.getPosition();yield a.m.detach();var b=a.m;b.a&&b.a.removeDelegate(b)}a.a.start()})}W(a){a.getAd().isLinear()?pK(this,_.Jb,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.m.play()))}aa(a){this.B=a.getAd().getDuration();
12
+ pK(this,_.Pb,a);this.m.getSurface().show(this.o)}$a(a){a=a.getAdData();oK(this,a?a.adError:null);qK(this)}Eb(a){pK(this,_.Mb,a)}Na(a){pK(this,_.Eb,a)}S(a){pK(this,_.Hb,a)}ab(a){pK(this,_.Kb,a)}ba(a){pK(this,_.Rb,a)}bb(a){pK(this,_.Lb,a)}Db(a){pK(this,_.Nb,a)}R(a){this.pause();pK(this,_.Fb,a)}Y(a){pK(this,_.Ob,a);qK(this)}V(a){pK(this,_.Ib,a)}Za(a){pK(this,_.Gb,a);qK(this)}oc(){const a=this;return _.x(function*(){a.F=!0;if(mK(a)&&null!==a.J){var b=a.m;b.a&&b.a.addDelegate(b);yield _.Sn(a.m);a.C||(yield a.m.seek(a.J))}else{if(!a.G)return a.m.play();
13
+ rK(a)}a.G=!1;a.g&&a.g.stop();a.C||(yield a.m.play());pK(a,_.Db)})}Sb(){this.M=!0}Ub(){this.C=!0;this.l.contentComplete()}load(){const a=this;return _.x(function*(){var b=a.m;const c=a.I;try{if(typeof c.adTagUrl!==_.Je)throw new _.H(1,9,10001,{missingKeys:"adTagUrl"});}catch(f){return b.onError(f),a.f.resolve(),a.f}if(!c.adTagUrl)return a.f.resolve(),a.f;b=yield a.K.canPlay(!1);const d=yield a.K.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);
14
+ a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(e);return a.f})}start(a){const b=this;return _.x(function*(){b.a&&b.j&&!b.H?b.j.Lb()?yield tK(b):yield uK(b,a):yield a.play()})}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&this.a.skip()}getVolume(){return this.a?this.a.getVolume():1}setVolume(a){this.a&&this.a.setVolume(a)}getPosition(){if(!this.a||null===this.B)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.B-a}dispose(){return(new Promise(a=>
15
+ {this.H&&this.j&&this.j.hb()&&!this.M?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.o&&this.m.getSurface().hide(this.o)}),_.kg(this.w,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.l.contentComplete()})).then(()=>{rK(this);this.w.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};yK.prototype.getPosition=yK.prototype.getPosition;
16
+ yK.prototype.setVolume=yK.prototype.setVolume;yK.prototype.getVolume=yK.prototype.getVolume;yK.prototype.skip=yK.prototype.skip;yK.prototype.pause=yK.prototype.pause;yK.prototype.resume=yK.prototype.resume;var zK=class extends _.rr{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(vK())return a.onError(new _.H(1,9,1E4));this.f=_.Xm(_.Yc,{"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(_.na);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
17
+ (this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}Wf(){return this.a}Uf(){return this.g}pc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",zK);zK.prototype.getAdContainer=zK.prototype.pc;zK.prototype.getAdDisplayContainer=zK.prototype.Uf;zK.prototype.getAdsLoader=zK.prototype.Wf;zK.Id="ima";zK.isSdkMissing=vK;_.En(new class{create(){return new zK}});var AK=class{constructor(){this.a=new _.R(kK)}name(){return kK}da(a,b){return a.namespace()===_.Gc?!1:vK()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new yK(a)}};AK.prototype.create=AK.prototype.create;AK.prototype.isSupported=AK.prototype.da;AK.prototype.name=AK.prototype.name;_.Um(new AK);};f.call(g, window);