@castlabs/prestoplay 6.12.0 → 6.14.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 (62) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -6
  5. package/cjs/cl.cast.js +110 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +518 -517
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +72 -72
  10. package/cjs/cl.externs.js +63 -52
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +68 -67
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +275 -272
  17. package/cjs/cl.muxdata.js +15 -14
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.simid.js +15 -15
  22. package/cjs/cl.smooth.js +71 -71
  23. package/cjs/cl.thumbnails.js +26 -24
  24. package/cjs/cl.tizen.js +69 -69
  25. package/cjs/cl.ttml.js +28 -28
  26. package/cjs/cl.verimatrix.js +5 -5
  27. package/cjs/cl.vimond.js +13 -13
  28. package/cjs/cl.vr.js +19 -19
  29. package/cjs/cl.vtt.js +14 -14
  30. package/cjs/cl.youbora.js +18 -18
  31. package/cjs/polyfill.min.js +26 -23
  32. package/cl.adobe.js +3 -3
  33. package/cl.airplay.js +3 -3
  34. package/cl.broadpeak.js +5 -5
  35. package/cl.cast.js +87 -87
  36. package/cl.conviva.js +27 -27
  37. package/cl.core.js +428 -425
  38. package/cl.crypto.js +9 -9
  39. package/cl.dash.js +67 -67
  40. package/cl.externs.js +63 -52
  41. package/cl.freewheel.js +19 -19
  42. package/cl.hls.js +69 -69
  43. package/cl.hlssmpte.js +5 -5
  44. package/cl.htmlcue.js +26 -26
  45. package/cl.ima.js +17 -17
  46. package/cl.mse.js +243 -241
  47. package/cl.muxdata.js +13 -12
  48. package/cl.onboard.js +4 -4
  49. package/cl.persistent.js +10 -10
  50. package/cl.playlist.js +5 -5
  51. package/cl.simid.js +13 -13
  52. package/cl.smooth.js +59 -59
  53. package/cl.thumbnails.js +19 -17
  54. package/cl.tizen.js +57 -57
  55. package/cl.ttml.js +22 -22
  56. package/cl.verimatrix.js +4 -4
  57. package/cl.vimond.js +8 -8
  58. package/cl.vr.js +15 -15
  59. package/cl.vtt.js +12 -12
  60. package/cl.youbora.js +15 -15
  61. package/package.json +4 -4
  62. package/typings.d.ts +135 -30
package/cl.htmlcue.js CHANGED
@@ -1,26 +1,26 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var DM="Unsupported unit",EM="clpp-text-plain",FM="clpp-text-ttml",GM="clpp.htmlcue.HtmlTextDisplayer",HM="initial",IM=function(a){return _.gh(a,{Oe:(b,c)=>b.md(c)})},JM=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)},KM=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},LM=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},NM=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>MM[c]);return a},PM=function(a,b){OM(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{OM(a,c)})},OM=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},QM=function(a,b){return 0===a?"0":a+b},RM=function(a,b){return 1>Math.abs(a-b)||a<b},SM=function(a,b){return a<b&&1<Math.abs(a-b)},TM=function(a,b){return a>b&&1<Math.abs(a-b)},UM=
3
- function(a,b){return 1>Math.abs(a-b)||a>b},WM=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 VM(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
- d-e)},XM=function(a){return new VM(a.left,a.f,a.top,a.a,a.height,a.width)},YM=function(a,b){return b.some(c=>SM(a.left,c.f)&&TM(a.f,c.left)&&SM(a.top,c.a)&&TM(a.a,c.top))},ZM=function(a,b){return UM(a.top,b.top)&&RM(a.a,b.a)&&UM(a.left,b.left)&&RM(a.f,b.f)},$M=function(a,b,c){switch(c){case "+x":return SM(a.left,b.left);case "-x":return TM(a.f,b.f);case "+y":return SM(a.top,b.top);case "-y":return TM(a.a,b.a);default:throw Error("Unknown axis");}},aN=function(a){return a.f.writingMode===_.fr},bN=
5
- 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 aN(a)?b:c},cN=function(a){switch(a.f.writingMode){case _.fr:return"horizontal-tb";case _.Lf:return _.Lf;case _.Mf:return _.Mf;default:throw Error("Unknown writing mode");}},dN=function(a){switch(a.f.positionAlign){case _.ce:return _.Wd;case "auto":case _.Tc:return _.er;case _.de:return _.gf}return a.f.textAlign},eN=function(a,b){if(typeof a.f.position===_.r&&typeof a.f.size===
6
- _.r)switch(b){case _.ce:return a.f.position;case "auto":case _.Tc:return a.f.position-a.f.size/2;case _.de:return a.f.position-a.f.size}return 0},fN=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.Wd:case _.Wd:return _.ce;case _.er:return _.Tc;case _.gf:case _.gf:return _.de}return a.f.positionAlign},iN=function(a,b,c){return(gN(a)||hN(a))&&_.Ag(c)?QM(c,_.$e):gN(a)&&_.B(c)?QM(0,_.$e):aN(a)&&_.Ag(b)?QM(b,"%"):HM},jN=function(a,b,c){return aN(a)&&_.Ag(c)?QM(c,_.$e):(gN(a)||hN(a))&&_.Ag(b)?
7
- QM(b,"%"):HM},hN=function(a){return a.f.writingMode===_.Mf},gN=function(a){return a.f.writingMode===_.Lf},kN=function(a,b){if(a.j)switch(b.writingMode){case _.fr:return["-y"];case _.Lf:return["+x"];case _.Mf:return["-x"]}a=[];switch(b.writingMode){case _.fr:a=["+y","-y"];break;case _.Lf:a=["+x","-x"];break;case _.Mf:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},lN=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=WM(a.l.a)},mN=function(a,b){lN(a.g);a.l.unshift(b);
8
- for(const c of a.l)a.g.append(c)},nN=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.mr)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(DM);},pN=function(a,b,c,d){const e=document.createElement(_.vf),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);oN(a,c,b);a.h.debug(`Created HTML style element #${b}.`);return e.sheet},qN=function(a,b){a=`.${a.j} .clpp-text-container`;
9
- 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,a)},rN=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);
10
- return c},sN=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}},oN=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())},tN=function(a){a=_.tg(a.getConfiguration().htmlcue||{});_.B(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.B(a.enableResizeObserver)&&
11
- (a.enableResizeObserver=!0);return a},zN=function(a,b){if((b||a.l)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.nn)if(a.J=c,c=uN(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,vN(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Wq(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 _.Yf:g=
12
- "clpp-text-vtt";break;case _.Cf:g=FM;break;case _.dr:g=EM}g&&!f.classList.contains(g)&&_.In(f,g);f=WM(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{OM({fontSize:wN(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.Yf;var h=d.payloadType===_.Cf;d.region&&(g||h||d.backgroundImage)&&(c.B.has(d.region.id)?f=c.B.get(d.region.id):(f=
13
- new xN(d.region,{}),c.B.set(d.region.id,f),mN(c.a,f)));d=new yN(d,c.M,e);f?mN(f,d):mN(c.a,d)}}}}},AN=function(a){vN(a);a.J=null;a.o=null;a.f=[]},BN=function(a,b){return a.startTime<=b&&a.endTime>b},uN=function(a,b){var c=KM(a.f,d=>BN(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&BN(a.f[d-1],b);)d--;for(;c+1<a.f.length&&BN(a.f[c+1],b);)c++;return{start:d,end:c}}},vN=function(a){a.B.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(FM);
14
- b.classList.remove(EM);a=a.a;lN(a.g);a.l=[]}},wN=function(a,b){const c=WM(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`},FN=class{parse(a){a={input:a};const b=_.Kn(_.yd),c=[];let d=b;for(var e;null!==(e=LM(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);
15
- else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var h=CN[f];h?(h=_.Kn(h),(f=DN[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||EN[g.localName]&&EN[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(NM(e)));return b}},CN={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},DN={v:"voice",lang:"lang"},EN={rt:"ruby"},MM={"\x26amp;":"\x26",
16
- "\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var VM=class{constructor(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f}};var GN=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 yN=class extends GN{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)_.In(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===_.Cf){var c=_.Kn(_.yd);c.innerHTML=b.payload;b=c}else b.payloadType===
17
- _.Yf?b=(new FN).parse(b.payload):(c=_.Kn(_.yd),c.textContent=b.payload,b=c);_.In(b,this.w);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.In(b,d);OM({writingMode:cN(this)},b);var d=b;this.a.appendChild(d);_.In(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.In(this.a,`clpp-text-wrapper__${e}`);_.B(this.f.line)&&(this.f.lineInterpretation=_.gr,this.f.line=aN(this)?-1:0);e=cN(this);OM({writingMode:e,webkitWritingMode:e,direction:HM,textAlign:dN(this)},this.a);if(!this.f.region||
18
- !this.f.region.displayAlign){e=eN(this,fN(this));OM({position:"absolute",left:iN(this,e,null),right:hN(this)&&_.B(null)?QM(0,_.$e):HM,top:jN(this,e,null),width:aN(this)?QM(this.f.size,"%"):HM,height:gN(this)||hN(this)?QM(this.f.size,"%"):HM},this.a);b=this.f;a=aN(this)?a.height:a.width;c=bN(this);if(b.lineInterpretation===_.gr){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 _.Tc:g-=f/2;break;case _.Kd:g-=f}f=Math.round(g/
19
- 100*a)}hN(this)&&(f=a-f-c);a=f;OM({left:iN(this,e,a),right:hN(this)&&_.B(a)?QM(0,_.$e):HM,top:jN(this,e,a)},this.a)}PM(this.C,d)}}o(){return _.Kn(_.yd)}};var HN=class{constructor(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=WM(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=WM(a.a);var d=kN(this,a.f),e=bN(a);const g=XM(c);let h=null,k=0;for(const l of d){for(;$M(c,this.a,l)||ZM(c,this.a)&&YM(c,this.g);){d=c;var f=e;switch(l){case "+x":d.left+=f;d.f+=f;break;case "-x":d.left-=f;d.f-=f;break;case "+y":d.top+=f;d.a+=f;break;case "-y":d.top-=f,d.a-=f}}if(this.j||ZM(c,this.a))break a;
20
- d=this.a;d=Math.max(0,Math.min(c.f,d.f)-Math.max(c.left,d.left))*Math.max(0,Math.min(c.a,d.a)-Math.max(c.top,d.top))/(c.height*c.width);d>k&&(h=XM(c),k=d);c=XM(g)}c=h||g}OM({top:QM(c.top-this.a.top,_.$e),bottom:QM(this.a.a-c.a,_.$e),left:QM(c.left-this.a.left,_.$e),right:QM(this.a.f-c.f,_.$e),height:QM(c.height,_.$e),width:QM(c.width,_.$e)},a.a)}b.style.visibility="visible";this.g.push(WM(a.a))}};var IN=class extends GN{constructor(a,b,c){super(a,b,c);this.g=null;this.l=[]}init(){this.g=new HN(this);this.j=!0}o(){const a=_.Kn(_.yd);_.In(a,this.w);this.id&&(a.id=this.id);return a}};var xN=class extends IN{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 _.mr:b=b.width/100*a.width;break a;default:throw Error(DM);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.mr)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(DM);d=a.height;const e=nN(this,d,a.height);OM(this.B,this.a);OM({left:QM(c,_.$e),top:QM(e,_.$e),width:QM(b,
21
- _.$e),height:QM(d,_.$e)},this.a);this.f.writingMode&&OM({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&OM({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.In(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.mr:f=f.height/100*a.height;break a;case 2:f=f.height;c=new yN(new _.jr(0,1,"Lorem ipsum",_.dr),{},{});b=c.a;this.a.appendChild(b);c.init(WM(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
- b=c;f*=b;break a;default:throw Error(DM);}a=nN(this,f,a.height);OM({top:QM(a,_.$e),height:QM(f,_.$e)},this.a);this.g=new HN(this,!0);this.j=!0}getId(){return this.f.id}};var JN=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=pN(this,this.g,this.j);this.f=pN(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=qN(this,a);if(rN(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=[],sN(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 KN=class extends _.ct{constructor(a){super(a);this.h=new _.R(GM);this.m=a;this.M=tN(a);this.l=!1;this.f=[];this.F=a.getSurface().getContainer();this.j=new JN(a,"CLPP Subtitle Styles");this.a=new IN(null,"clpp-text-container",{});this.A=new _.Us(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 _.kj(()=>{zN(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=JM(this.f,IM(a));this.o=null;zN(this,!1)}}g(){null==this.j||zN(this,!0)}destroy(){const a=this;return _.x(function*(){null!=a.j&&(AN(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;zN(this,!0);return!0}isTextVisible(){return this.l}setTextVisibility(a){null!=this.j&&this.l!==a&&((this.l=a)?(this.G.$a(.25),this.M.enableResizeObserver&&this.A.start(),zN(this,!0)):(this.G.stop(),this.A.stop(),AN(this)))}Nc(){return this.f}V(){zN(this,!0)}};_.z(GM,KN);KN.prototype.setTextVisibility=KN.prototype.setTextVisibility;KN.prototype.isTextVisible=KN.prototype.isTextVisible;KN.prototype.remove=KN.prototype.remove;
26
- KN.prototype.destroy=KN.prototype.destroy;KN.prototype.append=KN.prototype.append;var LN=class{da(a){return!!a.enableHtmlCue&&!_.Aj()}create(a){return new KN(a)}};_.z("clpp.htmlcue.HtmlCueComponent",class extends _.Ds{f(){_.Rm(_.Rd,new LN)}a(){_.Pm.has(_.Rd)&&(_.Pm.delete(_.Rd),_.Qm.info("Removed factory: 'html'"))}id(){return _.wf}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var PM="Unsupported unit",QM="clpp-text-plain",RM="clpp-text-ttml",SM="clpp.htmlcue.HtmlTextDisplayer",TM="initial",UM=function(a){return _.ih(a,{Oe:(b,c)=>b.md(c)})},VM=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)},WM=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},XM=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},ZM=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>YM[c]);return a},aN=function(a,b){$M(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{$M(a,c)})},$M=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},bN=function(a,b){return 0===a?"0":a+b},cN=function(a,b){return 1>Math.abs(a-b)||a<b},dN=function(a,b){return a<b&&1<Math.abs(a-b)},eN=function(a,b){return a>b&&1<Math.abs(a-b)},fN=
3
+ function(a,b){return 1>Math.abs(a-b)||a>b},hN=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 gN(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
+ d-e)},iN=function(a){return new gN(a.left,a.f,a.top,a.a,a.height,a.width)},jN=function(a,b){return b.some(c=>dN(a.left,c.f)&&eN(a.f,c.left)&&dN(a.top,c.a)&&eN(a.a,c.top))},kN=function(a,b){return fN(a.top,b.top)&&cN(a.a,b.a)&&fN(a.left,b.left)&&cN(a.f,b.f)},lN=function(a,b,c){switch(c){case "+x":return dN(a.left,b.left);case "-x":return eN(a.f,b.f);case "+y":return dN(a.top,b.top);case "-y":return eN(a.a,b.a);default:throw Error("Unknown axis");}},mN=function(a){return a.f.writingMode===_.mr},nN=
5
+ 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 mN(a)?b:c},oN=function(a){switch(a.f.writingMode){case _.mr:return"horizontal-tb";case _.Nf:return _.Nf;case _.Of:return _.Of;default:throw Error("Unknown writing mode");}},pN=function(a){switch(a.f.positionAlign){case _.ee:return _.Zd;case "auto":case _.Tc:return _.lr;case _.fe:return _.jf}return a.f.textAlign},qN=function(a,b){if(typeof a.f.position===_.r&&typeof a.f.size===
6
+ _.r)switch(b){case _.ee:return a.f.position;case "auto":case _.Tc:return a.f.position-a.f.size/2;case _.fe:return a.f.position-a.f.size}return 0},rN=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.Zd:case _.Zd:return _.ee;case _.lr:return _.Tc;case _.jf:case _.jf:return _.fe}return a.f.positionAlign},uN=function(a,b,c){return(sN(a)||tN(a))&&_.Cg(c)?bN(c,_.bf):sN(a)&&_.B(c)?bN(0,_.bf):mN(a)&&_.Cg(b)?bN(b,"%"):TM},vN=function(a,b,c){return mN(a)&&_.Cg(c)?bN(c,_.bf):(sN(a)||tN(a))&&_.Cg(b)?
7
+ bN(b,"%"):TM},tN=function(a){return a.f.writingMode===_.Of},sN=function(a){return a.f.writingMode===_.Nf},wN=function(a,b){if(a.j)switch(b.writingMode){case _.mr:return["-y"];case _.Nf:return["+x"];case _.Of:return["-x"]}a=[];switch(b.writingMode){case _.mr:a=["+y","-y"];break;case _.Nf:a=["+x","-x"];break;case _.Of:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},xN=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=hN(a.l.a)},yN=function(a,b){xN(a.h);a.l.unshift(b);
8
+ for(const c of a.l)a.h.append(c)},zN=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.tr)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(PM);},BN=function(a,b,c,d){const e=document.createElement(_.xf),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);AN(a,c,b);a.g.debug(`Created HTML style element #${b}.`);return e.sheet},CN=function(a,b){a=`.${a.j} .clpp-text-container`;
9
+ 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,a)},DN=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);
10
+ return c},EN=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}},AN=function(a,b,c){const d=new MutationObserver(e=>{e.forEach(f=>{f.removedNodes.forEach(g=>{g.id===c&&a.g.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())},FN=function(a){a=_.vg(a.getConfiguration().htmlcue||{});_.B(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.B(a.enableResizeObserver)&&
11
+ (a.enableResizeObserver=!0);return a},LN=function(a,b){if((b||a.l)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.rn)if(a.J=c,c=GN(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,HN(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.cr(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 _.$f:g=
12
+ "clpp-text-vtt";break;case _.Ef:g=RM;break;case _.kr:g=QM}g&&!f.classList.contains(g)&&_.Mn(f,g);f=hN(c.a.a);if(0===f.width||0===f.height)c.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.");else{$M({fontSize:IN(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.$f;var h=d.payloadType===_.Ef;d.region&&(g||h||d.backgroundImage)&&(c.B.has(d.region.id)?f=c.B.get(d.region.id):(f=
13
+ new JN(d.region,{}),c.B.set(d.region.id,f),yN(c.a,f)));d=new KN(d,c.M,e);f?yN(f,d):yN(c.a,d)}}}}},MN=function(a){HN(a);a.J=null;a.o=null;a.f=[]},NN=function(a,b){return a.startTime<=b&&a.endTime>b},GN=function(a,b){var c=WM(a.f,d=>NN(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&NN(a.f[d-1],b);)d--;for(;c+1<a.f.length&&NN(a.f[c+1],b);)c++;return{start:d,end:c}}},HN=function(a){a.B.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(RM);
14
+ b.classList.remove(QM);a=a.a;xN(a.h);a.l=[]}},IN=function(a,b){const c=hN(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`},RN=class{parse(a){a={input:a};const b=_.On(_.zd),c=[];let d=b;for(var e;null!==(e=XM(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);
15
+ else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var h=ON[f];h?(h=_.On(h),(f=PN[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||QN[g.localName]&&QN[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(ZM(e)));return b}},ON={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},PN={v:"voice",lang:"lang"},QN={rt:"ruby"},YM={"\x26amp;":"\x26",
16
+ "\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var gN=class{constructor(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f}};var SN=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 KN=class extends SN{constructor(a,b,c){super(a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.C=c}A(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)}init(a){super.init(a);if(this.h)_.Mn(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage=`url("${this.f.backgroundImage}")`,this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.Ef){var c=_.On(_.zd);c.innerHTML=b.payload;b=c}else b.payloadType===
17
+ _.$f?b=(new RN).parse(b.payload):(c=_.On(_.zd),c.textContent=b.payload,b=c);_.Mn(b,this.w);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.Mn(b,d);$M({writingMode:oN(this)},b);var d=b;this.a.appendChild(d);_.Mn(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.Mn(this.a,`clpp-text-wrapper__${e}`);_.B(this.f.line)&&(this.f.lineInterpretation=_.nr,this.f.line=mN(this)?-1:0);e=oN(this);$M({writingMode:e,webkitWritingMode:e,direction:TM,textAlign:pN(this)},this.a);if(!this.f.region||
18
+ !this.f.region.displayAlign){e=qN(this,rN(this));$M({position:"absolute",left:uN(this,e,null),right:tN(this)&&_.B(null)?bN(0,_.bf):TM,top:vN(this,e,null),width:mN(this)?bN(this.f.size,"%"):TM,height:sN(this)||tN(this)?bN(this.f.size,"%"):TM},this.a);b=this.f;a=mN(this)?a.height:a.width;c=nN(this);if(b.lineInterpretation===_.nr){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 _.Tc:g-=f/2;break;case _.Ld:g-=f}f=Math.round(g/
19
+ 100*a)}tN(this)&&(f=a-f-c);a=f;$M({left:uN(this,e,a),right:tN(this)&&_.B(a)?bN(0,_.bf):TM,top:vN(this,e,a)},this.a)}aN(this.C,d)}}o(){return _.On(_.zd)}};var TN=class{constructor(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=hN(a.a);this.h=[]}append(a){const b=a.a;b.style.visibility=_.Sd;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=hN(a.a);var d=wN(this,a.f),e=nN(a);const g=iN(c);let h=null,k=0;for(const l of d){for(;lN(c,this.a,l)||kN(c,this.a)&&jN(c,this.h);){d=c;var f=e;switch(l){case "+x":d.left+=f;d.f+=f;break;case "-x":d.left-=f;d.f-=f;break;case "+y":d.top+=f;d.a+=f;break;case "-y":d.top-=f,d.a-=f}}if(this.j||kN(c,this.a))break a;
20
+ d=this.a;d=Math.max(0,Math.min(c.f,d.f)-Math.max(c.left,d.left))*Math.max(0,Math.min(c.a,d.a)-Math.max(c.top,d.top))/(c.height*c.width);d>k&&(h=iN(c),k=d);c=iN(g)}c=h||g}$M({top:bN(c.top-this.a.top,_.bf),bottom:bN(this.a.a-c.a,_.bf),left:bN(c.left-this.a.left,_.bf),right:bN(this.a.f-c.f,_.bf),height:bN(c.height,_.bf),width:bN(c.width,_.bf)},a.a)}b.style.visibility="visible";this.h.push(hN(a.a))}};var UN=class extends SN{constructor(a,b,c){super(a,b,c);this.h=null;this.l=[]}init(){this.h=new TN(this);this.j=!0}o(){const a=_.On(_.zd);_.Mn(a,this.w);this.id&&(a.id=this.id);return a}};var JN=class extends UN{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 _.tr:b=b.width/100*a.width;break a;default:throw Error(PM);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.tr)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(PM);d=a.height;const e=zN(this,d,a.height);$M(this.B,this.a);$M({left:bN(c,_.bf),top:bN(e,_.bf),width:bN(b,
21
+ _.bf),height:bN(d,_.bf)},this.a);this.f.writingMode&&$M({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&$M({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.Mn(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.tr:f=f.height/100*a.height;break a;case 2:f=f.height;c=new KN(new _.qr(0,1,"Lorem ipsum",_.kr),{},{});b=c.a;this.a.appendChild(b);c.init(hN(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
+ b=c;f*=b;break a;default:throw Error(PM);}a=zN(this,f,a.height);$M({top:bN(a,_.bf),height:bN(f,_.bf)},this.a);this.h=new TN(this,!0);this.j=!0}getId(){return this.f.id}};var VN=class{constructor(a,b){this.g=new _.R("clpp.htmlcue.StyleManager");this.o=[];this.j=a.getSurface().getUniqueCssClass();this.h=b;this.l=[];this.a=BN(this,this.h,this.j);this.f=BN(this,this.h,this.j,!0);this.f.disabled=!0;this.g.debug(`Stylesheet ${this.h} has been created.`)}appendRule(a){if(null!=this.a&&!this.l.some(b=>b===a)){const b=CN(this,a);if(DN(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 ${this.h} 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=[],EN(a),document.head.removeChild(a.a.ownerNode),document.head.removeChild(a.f.ownerNode),a.a=null,a.f=null,a.g.debug(`Stylesheet ${a.h} has been destroyed.`))})}};var WN=class extends _.ht{constructor(a){super(a);this.g=new _.R(SM);this.m=a;this.M=FN(a);this.l=!1;this.f=[];this.F=a.getSurface().getContainer();this.j=new VN(a,"CLPP Subtitle Styles");this.a=new UN(null,"clpp-text-container",{});this.A=new _.at(a.getSurface(),this.V.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.");this.G=
24
+ new _.mj(()=>{LN(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=VM(this.f,UM(a));this.o=null;LN(this,!1)}}h(){null==this.j||LN(this,!0)}destroy(){const a=this;return _.x(function*(){null!=a.j&&(MN(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;LN(this,!0);return!0}isTextVisible(){return this.l}setTextVisibility(a){null!=this.j&&this.l!==a&&((this.l=a)?(this.G.bb(.25),this.M.enableResizeObserver&&this.A.start(),LN(this,!0)):(this.G.stop(),this.A.stop(),MN(this)))}Oc(){return this.f}V(){LN(this,!0)}};_.z(SM,WN);WN.prototype.setTextVisibility=WN.prototype.setTextVisibility;WN.prototype.isTextVisible=WN.prototype.isTextVisible;WN.prototype.remove=WN.prototype.remove;
26
+ WN.prototype.destroy=WN.prototype.destroy;WN.prototype.append=WN.prototype.append;var XN=class{da(a){return!!a.enableHtmlCue&&!_.Cj()}create(a){return new WN(a)}};_.z("clpp.htmlcue.HtmlCueComponent",class extends _.Ks{f(){_.Vm(_.Td,new XN)}a(){_.Tm.has(_.Td)&&(_.Tm.delete(_.Td),_.Um.info("Removed factory: 'html'"))}id(){return _.yf}});};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 mM="clpp.ima.AdsManagerFactory",nM=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===_.Kc?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
- _.Kc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},oM=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.oj()},pM=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.ja.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.tc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.bb.bind(a));c.on(b,d.AD_PROGRESS,a.Hb.bind(a));c.on(b,d.AD_BUFFERING,a.Oa.bind(a));
3
- c.on(b,d.FIRST_QUARTILE,a.T.bind(a));c.on(b,d.MIDPOINT,a.cb.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.eb.bind(a));c.on(b,d.RESUMED,a.Gb.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.Z.bind(a));c.on(b,d.IMPRESSION,a.V.bind(a));c.on(b,d.COMPLETE,a.ab.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.uc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Vb.bind(a))},qM=function(a,b){const c=b?a.fa.create(b.getErrorCode()):null;a.m.onError(new _.H(1,9,10003,{errorType:c},b))},rM=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))},sM=function(a){a.B=null;rM(a,_.kc);a.o&&a.m.getSurface().hide(a.o)},tM=function(a){_.Jn(a.A,{visibility:"visible"})},vM=function(a){return _.x(function*(){a.O.initialize();const b=!!a.m.getConfiguration().muted;(yield a.K.canPlay(b))||oM(a)?uM(a):(rM(a,_.Ic),a.h.warn(_.ja))})},wM=function(a,b){return _.x(function*(){a.O.initialize();yield b.play();uM(a)})},uM=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,
5
- google.ima.ViewMode.NORMAL);a.H=!0},xM=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}rb(){return"Google IMA SDK"}sb(){return google.ima.VERSION}yb(){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()}ec(){return this.f?
6
- this.f.getIsBumper():!1}Lb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.te&&typeof b[d].clickThroughUrl===_.tf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}vb(){return this.a.getVastMediaWidth()}ub(){return this.a.getVastMediaHeight()}ib(){return this.a.getVastMediaBitrate()}Va(){return this.g?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Mb(){return this.f?this.f.getTimeOffset():0}Nb(){return this.f?this.f.getAdPosition():
7
- 1}xb(){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.xb;X.prototype.getPositionInSequence=X.prototype.Nb;
8
- X.prototype.getPodTimeOffset=X.prototype.Mb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Va;X.prototype.getMediaBitrate=X.prototype.ib;X.prototype.getMediaHeight=X.prototype.ub;X.prototype.getMediaWidth=X.prototype.vb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Lb;X.prototype.isBumper=X.prototype.ec;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.yb;X.prototype.getAdManagerVersion=X.prototype.sb;X.prototype.getAdManagerName=X.prototype.rb;var yM=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 zM=class{constructor(a){this.a=a}getCuePoints(){return this.a}Ob(){return 0<=this.a.indexOf(0)||0===this.a.length}jb(){return 0<=this.a.indexOf(-1)}};zM.prototype.hasPostroll=zM.prototype.jb;zM.prototype.hasPreroll=zM.prototype.Ob;zM.prototype.getCuePoints=zM.prototype.getCuePoints;var AM=class{constructor(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.tg(a.ima||{});this.I=a=_.sg({disableCustomPlayback:!1},a);this.o=this.m.ac("ima").vc();this.O=this.m.ac("ima").g;this.l=this.m.ac("ima").a;this.K=new _.Ws;this.h=new _.R("clpp.ima");this.g=this.a=null;this.f=new _.sm;this.H=!1;this.w=new _.br;this.fa=new yM;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.Ub.bind(this));a.on(this.l,b,this.Ib.bind(this));a.on(this.m,_.Ld,this.Xb.bind(this))}}Ub(a){this.a=a.getAdsManager(this.A,nM(this));this.a.isCustomPlaybackUsed()&&!oM(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 _.Us(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 zM(a),this.m.trigger(new _.F(_.nc,
11
- {adsTimeline:this.j})),pM(this));this.f.resolve()}Ib(a){qM(this,a.getError());this.f.resolve()}tc(a){const b=this;return _.x(function*(){b.G=!0;oM(b)||(yield b.m.pause(),_.Jn(b.A,{visibility:_.Qd}));rM(b,_.Wb,a);b.g.start()})}ja(){const a=this;return _.x(function*(){if(oM(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()?rM(this,_.dc,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.m.play()))}aa(a){this.B=a.getAd().getDuration();
12
- rM(this,_.jc,a);this.m.getSurface().show(this.o)}bb(a){a=a.getAdData();qM(this,a?a.adError:null);sM(this)}Hb(a){rM(this,_.gc,a)}Oa(a){rM(this,_.Yb,a)}T(a){rM(this,_.bc,a)}cb(a){rM(this,_.ec,a)}ba(a){rM(this,_.lc,a)}eb(a){rM(this,_.fc,a)}Gb(a){rM(this,_.hc,a)}R(a){this.pause();rM(this,_.$b,a)}Z(a){rM(this,_.ic,a);sM(this)}V(a){rM(this,_.cc,a)}ab(a){rM(this,_.ac,a);sM(this)}uc(){const a=this;return _.x(function*(){a.F=!0;if(oM(a)&&null!==a.J){var b=a.m;b.a&&b.a.addDelegate(b);yield _.Co(a.m);a.C||(yield a.m.seek(a.J))}else{if(!a.G)return a.m.play();
13
- tM(a)}a.G=!1;a.g&&a.g.stop();a.C||(yield a.m.play());rM(a,_.Xb)})}Vb(){this.M=!0}Xb(){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!==_.tf)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.Ob()?yield vM(b):yield wM(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.jb()&&!this.M?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.o&&this.m.getSurface().hide(this.o)}),_.Tg(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(()=>{tM(this);this.w.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};AM.prototype.getPosition=AM.prototype.getPosition;
16
- AM.prototype.setVolume=AM.prototype.setVolume;AM.prototype.getVolume=AM.prototype.getVolume;AM.prototype.skip=AM.prototype.skip;AM.prototype.pause=AM.prototype.pause;AM.prototype.resume=AM.prototype.resume;var BM=class extends _.ft{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(xM())return a.onError(new _.H(1,9,1E4));this.f=_.Hn(_.yd,{"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(_.pa);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)}lg(){return this.a}jg(){return this.g}vc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",BM);BM.prototype.getAdContainer=BM.prototype.vc;BM.prototype.getAdDisplayContainer=BM.prototype.jg;BM.prototype.getAdsLoader=BM.prototype.lg;BM.Id="ima";BM.isSdkMissing=xM;_.oo(new class{create(){return new BM}});var CM=class{constructor(){this.a=new _.R(mM)}name(){return mM}da(a,b){return a.namespace()===_.dd?!1:xM()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new AM(a)}};CM.prototype.create=CM.prototype.create;CM.prototype.isSupported=CM.prototype.da;CM.prototype.name=CM.prototype.name;_.En(new CM);};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var yM="clpp.ima.AdsManagerFactory",zM=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===_.Kc?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
+ _.Kc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},AM=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.qj()},BM=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.la.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.uc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.eb.bind(a));c.on(b,d.AD_PROGRESS,a.Gb.bind(a));c.on(b,d.AD_BUFFERING,a.Oa.bind(a));
3
+ c.on(b,d.FIRST_QUARTILE,a.T.bind(a));c.on(b,d.MIDPOINT,a.fb.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.gb.bind(a));c.on(b,d.RESUMED,a.Tb.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.Z.bind(a));c.on(b,d.IMPRESSION,a.V.bind(a));c.on(b,d.COMPLETE,a.cb.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.vc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Wb.bind(a))},CM=function(a,b){const c=b?a.ea.create(b.getErrorCode()):null;a.m.onError(new _.H(1,9,10003,{errorType:c},b))},DM=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))},EM=function(a){a.B=null;DM(a,_.kc);a.o&&a.m.getSurface().hide(a.o)},FM=function(a){_.Nn(a.A,{visibility:"visible"})},HM=function(a){return _.x(function*(){a.N.initialize();const b=!!a.m.getConfiguration().muted;(yield a.K.canPlay(b))||AM(a)?GM(a):(DM(a,_.Ic),a.g.warn(_.ja))})},IM=function(a,b){return _.x(function*(){a.N.initialize();yield b.play();GM(a)})},GM=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,
5
+ google.ima.ViewMode.NORMAL);a.H=!0},JM=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.h=c}rb(){return"Google IMA SDK"}sb(){return google.ima.VERSION}yb(){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()}fc(){return this.f?
6
+ this.f.getIsBumper():!1}Jb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.ve&&typeof b[d].clickThroughUrl===_.vf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}vb(){return this.a.getVastMediaWidth()}ub(){return this.a.getVastMediaHeight()}kb(){return this.a.getVastMediaBitrate()}Wa(){return this.h?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Kb(){return this.f?this.f.getTimeOffset():0}Lb(){return this.f?this.f.getAdPosition():
7
+ 1}xb(){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.xb;X.prototype.getPositionInSequence=X.prototype.Lb;
8
+ X.prototype.getPodTimeOffset=X.prototype.Kb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Wa;X.prototype.getMediaBitrate=X.prototype.kb;X.prototype.getMediaHeight=X.prototype.ub;X.prototype.getMediaWidth=X.prototype.vb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Jb;X.prototype.isBumper=X.prototype.fc;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.yb;X.prototype.getAdManagerVersion=X.prototype.sb;X.prototype.getAdManagerName=X.prototype.rb;var KM=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 LM=class{constructor(a){this.a=a}getCuePoints(){return this.a}Mb(){return 0<=this.a.indexOf(0)||0===this.a.length}lb(){return 0<=this.a.indexOf(-1)}};LM.prototype.hasPostroll=LM.prototype.lb;LM.prototype.hasPreroll=LM.prototype.Mb;LM.prototype.getCuePoints=LM.prototype.getCuePoints;var MM=class{constructor(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.vg(a.ima||{});this.I=a=_.ug({disableCustomPlayback:!1},a);this.o=this.m.bc("ima").wc();this.N=this.m.bc("ima").h;this.l=this.m.bc("ima").a;this.K=new _.ct;this.g=new _.R("clpp.ima");this.h=this.a=null;this.f=new _.wm;this.H=!1;this.w=new _.ir;this.ea=new KM;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.Vb.bind(this));a.on(this.l,b,this.Ub.bind(this));a.on(this.m,_.Md,this.Yb.bind(this))}}Vb(a){this.a=a.getAdsManager(this.A,zM(this));this.a.isCustomPlaybackUsed()&&!AM(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.H(1,9,10002)),this.dispose()):(this.h=new _.at(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 LM(a),this.m.trigger(new _.F(_.nc,
11
+ {adsTimeline:this.j})),BM(this));this.f.resolve()}Ub(a){CM(this,a.getError());this.f.resolve()}uc(a){const b=this;return _.x(function*(){b.G=!0;AM(b)||(yield b.m.pause(),_.Nn(b.A,{visibility:_.Sd}));DM(b,_.Wb,a);b.h.start()})}la(){const a=this;return _.x(function*(){if(AM(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()?DM(this,_.dc,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.m.play()))}aa(a){this.B=a.getAd().getDuration();
12
+ DM(this,_.jc,a);this.m.getSurface().show(this.o)}eb(a){a=a.getAdData();CM(this,a?a.adError:null);EM(this)}Gb(a){DM(this,_.gc,a)}Oa(a){DM(this,_.Zb,a)}T(a){DM(this,_.bc,a)}fb(a){DM(this,_.ec,a)}ba(a){DM(this,_.lc,a)}gb(a){DM(this,_.fc,a)}Tb(a){DM(this,_.hc,a)}R(a){this.pause();DM(this,_.$b,a)}Z(a){DM(this,_.ic,a);EM(this)}V(a){DM(this,_.cc,a)}cb(a){DM(this,_.ac,a);EM(this)}vc(){const a=this;return _.x(function*(){a.F=!0;if(AM(a)&&null!==a.J){var b=a.m;b.a&&b.a.addDelegate(b);yield _.Go(a.m);a.C||(yield a.m.seek(a.J))}else{if(!a.G)return a.m.play();
13
+ FM(a)}a.G=!1;a.h&&a.h.stop();a.C||(yield a.m.play());DM(a,_.Xb)})}Wb(){this.M=!0}Yb(){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!==_.vf)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.Mb()?yield HM(b):yield IM(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.lb()&&!this.M?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.o&&this.m.getSurface().hide(this.o)}),_.Vg(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(()=>{FM(this);this.w.release();this.h&&(this.h.stop(),this.h=null);this.a&&(this.a.destroy(),this.a=null)})}};MM.prototype.getPosition=MM.prototype.getPosition;
16
+ MM.prototype.setVolume=MM.prototype.setVolume;MM.prototype.getVolume=MM.prototype.getVolume;MM.prototype.skip=MM.prototype.skip;MM.prototype.pause=MM.prototype.pause;MM.prototype.resume=MM.prototype.resume;var NM=class extends _.kt{constructor(){super();this.a=this.h=this.f=null}onPlayerCreated(a){if(JM())return a.onError(new _.H(1,9,1E4));this.f=_.Ln(_.zd,{"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(_.pa);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
17
+ (this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}mg(){return this.a}kg(){return this.h}wc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",NM);NM.prototype.getAdContainer=NM.prototype.wc;NM.prototype.getAdDisplayContainer=NM.prototype.kg;NM.prototype.getAdsLoader=NM.prototype.mg;NM.Id="ima";NM.isSdkMissing=JM;_.so(new class{create(){return new NM}});var OM=class{constructor(){this.a=new _.R(yM)}name(){return yM}da(a,b){return a.namespace()===_.dd?!1:JM()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new MM(a)}};OM.prototype.create=OM.prototype.create;OM.prototype.isSupported=OM.prototype.da;OM.prototype.name=OM.prototype.name;_.In(new OM);};f.call(g, window);