@castlabs/prestoplay 6.14.1 → 6.16.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 (61) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +114 -112
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +553 -538
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +74 -73
  10. package/cjs/cl.externs.js +193 -58
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +69 -69
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -29
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mse.js +368 -264
  17. package/cjs/cl.muxdata.js +15 -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.simid.js +15 -15
  22. package/cjs/cl.smooth.js +72 -71
  23. package/cjs/cl.thumbnails.js +26 -26
  24. package/cjs/cl.tizen.js +71 -71
  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 +20 -20
  31. package/cl.adobe.js +3 -3
  32. package/cl.airplay.js +3 -3
  33. package/cl.broadpeak.js +5 -5
  34. package/cl.cast.js +89 -88
  35. package/cl.conviva.js +27 -27
  36. package/cl.core.js +455 -443
  37. package/cl.crypto.js +9 -9
  38. package/cl.dash.js +70 -68
  39. package/cl.externs.js +189 -58
  40. package/cl.freewheel.js +19 -19
  41. package/cl.hls.js +71 -71
  42. package/cl.hlssmpte.js +5 -5
  43. package/cl.htmlcue.js +26 -26
  44. package/cl.ima.js +17 -17
  45. package/cl.mse.js +318 -236
  46. package/cl.muxdata.js +13 -13
  47. package/cl.onboard.js +4 -4
  48. package/cl.persistent.js +11 -11
  49. package/cl.playlist.js +5 -5
  50. package/cl.simid.js +13 -13
  51. package/cl.smooth.js +59 -59
  52. package/cl.thumbnails.js +19 -19
  53. package/cl.tizen.js +57 -57
  54. package/cl.ttml.js +22 -22
  55. package/cl.verimatrix.js +4 -4
  56. package/cl.vimond.js +8 -8
  57. package/cl.vr.js +15 -15
  58. package/cl.vtt.js +12 -12
  59. package/cl.youbora.js +15 -15
  60. package/package.json +1 -1
  61. package/typings.d.ts +393 -57
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 mN="Unsupported unit",nN="clpp-text-plain",oN="clpp-text-ttml",pN="clpp.htmlcue.HtmlTextDisplayer",qN="initial",rN=function(a){return _.lh(a,{Me:(b,c)=>b.md(c)})},sN=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)},tN=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},uN=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},wN=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>vN[c]);return a},yN=function(a,b){xN(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{xN(a,c)})},xN=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},zN=function(a,b){return 0===a?"0":a+b},AN=function(a,b){return 1>Math.abs(a-b)||a<b},BN=function(a,b){return a<b&&1<Math.abs(a-b)},CN=function(a,b){return a>b&&1<Math.abs(a-b)},DN=
3
- function(a,b){return 1>Math.abs(a-b)||a>b},FN=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 EN(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
- d-e)},GN=function(a){return new EN(a.left,a.f,a.top,a.a,a.height,a.width)},HN=function(a,b){return b.some(c=>BN(a.left,c.f)&&CN(a.f,c.left)&&BN(a.top,c.a)&&CN(a.a,c.top))},IN=function(a,b){return DN(a.top,b.top)&&AN(a.a,b.a)&&DN(a.left,b.left)&&AN(a.f,b.f)},JN=function(a,b,c){switch(c){case "+x":return BN(a.left,b.left);case "-x":return CN(a.f,b.f);case "+y":return BN(a.top,b.top);case "-y":return CN(a.a,b.a);default:throw Error("Unknown axis");}},KN=function(a){return a.f.writingMode===_.Ir},LN=
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 KN(a)?b:c},MN=function(a){switch(a.f.writingMode){case _.Ir:return"horizontal-tb";case _.Vf:return _.Vf;case _.Wf:return _.Wf;default:throw Error("Unknown writing mode");}},NN=function(a){switch(a.f.positionAlign){case _.he:return _.ee;case "auto":case _.Vc:return _.Hr;case _.ie:return _.mf}return a.f.textAlign},ON=function(a,b){if(typeof a.f.position===_.r&&typeof a.f.size===
6
- _.r)switch(b){case _.he:return a.f.position;case "auto":case _.Vc:return a.f.position-a.f.size/2;case _.ie:return a.f.position-a.f.size}return 0},PN=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ee:case _.ee:return _.he;case _.Hr:return _.Vc;case _.mf:case _.mf:return _.ie}return a.f.positionAlign},SN=function(a,b,c){return(QN(a)||RN(a))&&_.Fg(c)?zN(c,_.ef):QN(a)&&_.z(c)?zN(0,_.ef):KN(a)&&_.Fg(b)?zN(b,"%"):qN},TN=function(a,b,c){return KN(a)&&_.Fg(c)?zN(c,_.ef):(QN(a)||RN(a))&&_.Fg(b)?
7
- zN(b,"%"):qN},RN=function(a){return a.f.writingMode===_.Wf},QN=function(a){return a.f.writingMode===_.Vf},UN=function(a,b){if(a.j)switch(b.writingMode){case _.Ir:return["-y"];case _.Vf:return["+x"];case _.Wf:return["-x"]}a=[];switch(b.writingMode){case _.Ir:a=["+y","-y"];break;case _.Vf:a=["+x","-x"];break;case _.Wf:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},VN=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=FN(a.l.a)},WN=function(a,b){VN(a.g);a.l.unshift(b);
8
- for(const c of a.l)a.g.append(c)},XN=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.Pr)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(mN);},ZN=function(a,b,c,d){const e=document.createElement(_.Af),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);YN(a,c,b);a.h.debug(`Created HTML style element #${b}.`);return e.sheet},$N=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)},aO=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},bO=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}},YN=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())},cO=function(a){a=_.yg(a.htmlcue||{});_.z(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.z(a.enableResizeObserver)&&(a.enableResizeObserver=
11
- !0);return a},iO=function(a,b){if((b||a.l)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Fn)if(a.J=c,c=dO(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,eO(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.yr(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 _.cg:g="clpp-text-vtt";
12
- break;case _.Hf:g=oN;break;case _.Gr:g=nN}g&&!f.classList.contains(g)&&_.ao(f,g);f=FN(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{xN({fontSize:fO(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.cg;var h=d.payloadType===_.Hf;d.region&&(g||h||d.backgroundImage)&&(c.B.has(d.region.id)?f=c.B.get(d.region.id):(f=new gO(d.region,
13
- {}),c.B.set(d.region.id,f),WN(c.a,f)));d=new hO(d,c.M,e);f?WN(f,d):WN(c.a,d)}}}}},jO=function(a){eO(a);a.J=null;a.o=null;a.f=[]},kO=function(a,b){return a.startTime<=b&&a.endTime>b},dO=function(a,b){var c=tN(a.f,d=>kO(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&kO(a.f[d-1],b);)d--;for(;c+1<a.f.length&&kO(a.f[c+1],b);)c++;return{start:d,end:c}}},eO=function(a){a.B.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(oN);
14
- b.classList.remove(nN);a=a.a;VN(a.g);a.l=[]}},fO=function(a,b){const c=FN(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`},oO=class{parse(a){a={input:a};const b=_.co(_.Bd),c=[];let d=b;for(var e;null!==(e=uN(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=lO[f];h?(h=_.co(h),(f=mO[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||nO[g.localName]&&nO[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(wN(e)));return b}},lO={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},mO={v:"voice",lang:"lang"},nO={rt:"ruby"},vN={"\x26amp;":"\x26",
16
- "\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var EN=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 pO=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 hO=class extends pO{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)_.ao(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===_.Hf){var c=_.co(_.Bd);c.innerHTML=b.payload;b=c}else b.payloadType===
17
- _.cg?b=(new oO).parse(b.payload):(c=_.co(_.Bd),c.textContent=b.payload,b=c);_.ao(b,this.w);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.ao(b,d);xN({writingMode:MN(this)},b);var d=b;this.a.appendChild(d);_.ao(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.ao(this.a,`clpp-text-wrapper__${e}`);_.z(this.f.line)&&(this.f.lineInterpretation=_.Jr,this.f.line=KN(this)?-1:0);e=MN(this);xN({writingMode:e,webkitWritingMode:e,direction:qN,textAlign:NN(this)},this.a);if(!this.f.region||
18
- !this.f.region.displayAlign){e=ON(this,PN(this));xN({position:"absolute",left:SN(this,e,null),right:RN(this)&&_.z(null)?zN(0,_.ef):qN,top:TN(this,e,null),width:KN(this)?zN(this.f.size,"%"):qN,height:QN(this)||RN(this)?zN(this.f.size,"%"):qN},this.a);b=this.f;a=KN(this)?a.height:a.width;c=LN(this);if(b.lineInterpretation===_.Jr){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 _.Vc:g-=f/2;break;case _.Od:g-=f}f=Math.round(g/
19
- 100*a)}RN(this)&&(f=a-f-c);a=f;xN({left:SN(this,e,a),right:RN(this)&&_.z(a)?zN(0,_.ef):qN,top:TN(this,e,a)},this.a)}yN(this.C,d)}}o(){return _.co(_.Bd)}};var qO=class{constructor(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=FN(a.a);this.g=[]}append(a){const b=a.a;b.style.visibility=_.Vd;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=FN(a.a);var d=UN(this,a.f),e=LN(a);const g=GN(c);let h=null,k=0;for(const l of d){for(;JN(c,this.a,l)||IN(c,this.a)&&HN(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||IN(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=GN(c),k=d);c=GN(g)}c=h||g}xN({top:zN(c.top-this.a.top,_.ef),bottom:zN(this.a.a-c.a,_.ef),left:zN(c.left-this.a.left,_.ef),right:zN(this.a.f-c.f,_.ef),height:zN(c.height,_.ef),width:zN(c.width,_.ef)},a.a)}b.style.visibility="visible";this.g.push(FN(a.a))}};var rO=class extends pO{constructor(a,b,c){super(a,b,c);this.g=null;this.l=[]}init(){this.g=new qO(this);this.j=!0}o(){const a=_.co(_.Bd);_.ao(a,this.w);this.id&&(a.id=this.id);return a}};var gO=class extends rO{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 _.Pr:b=b.width/100*a.width;break a;default:throw Error(mN);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Pr)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(mN);d=a.height;const e=XN(this,d,a.height);xN(this.B,this.a);xN({left:zN(c,_.ef),top:zN(e,_.ef),width:zN(b,
21
- _.ef),height:zN(d,_.ef)},this.a);this.f.writingMode&&xN({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&xN({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.ao(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.Pr:f=f.height/100*a.height;break a;case 2:f=f.height;c=new hO(new _.Mr(0,1,"Lorem ipsum",_.Gr),{},{});b=c.a;this.a.appendChild(b);c.init(FN(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
- b=c;f*=b;break a;default:throw Error(mN);}a=XN(this,f,a.height);xN({top:zN(a,_.ef),height:zN(f,_.ef)},this.a);this.g=new qO(this,!0);this.j=!0}getId(){return this.f.id}};var sO=class{constructor(a,b){this.h=new _.R("clpp.htmlcue.StyleManager");this.o=[];this.j=a;this.g=b;this.l=[];this.a=ZN(this,this.g,this.j);this.f=ZN(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=$N(this,a);if(aO(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 _.w(function*(){null!=a.a&&(a.o.forEach(b=>b()),a.o=[],bO(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 tO=class extends _.Ft{constructor(a){super(a);this.h=new _.R(pN);this.m=a;this.M=cO(a.getConfiguration());this.l=!1;this.f=[];this.F=a.getSurface().getContainer();this.j=new sO(a.getSurface().getUniqueCssClass(),"CLPP Subtitle Styles");this.a=new rO(null,"clpp-text-container",{});this.A=new _.yt(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.");
24
- this.G=new _.zj(()=>{iO(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=sN(this.f,rN(a));this.o=null;iO(this,!1)}}g(){null==this.j||iO(this,!0)}destroy(){const a=this;return _.w(function*(){null!=a.j&&(jO(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;
25
- this.f=this.f.filter(c=>c.startTime<a||c.endTime>=b);this.o=null;iO(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(),iO(this,!0)):(this.G.stop(),this.A.stop(),jO(this)))}Oc(){return this.f}V(){iO(this,!0)}};_.x(pN,tO);tO.prototype.setTextVisibility=tO.prototype.setTextVisibility;tO.prototype.isTextVisible=tO.prototype.isTextVisible;tO.prototype.remove=tO.prototype.remove;
26
- tO.prototype.destroy=tO.prototype.destroy;tO.prototype.append=tO.prototype.append;var uO=class{isSupported(a){return!!a.enableHtmlCue&&!_.Pj()}create(a){return new tO(a)}};_.x("clpp.htmlcue.HtmlCueComponent",class extends _.ht{f(){_.jn(_.Wd,new uO)}a(){_.gn.has(_.Wd)&&(_.gn.delete(_.Wd),_.hn.info("Removed factory: 'html'"))}id(){return _.Bf}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var gS="Unsupported unit",hS="clpp-text-plain",iS="clpp-text-ttml",jS="clpp.htmlcue.HtmlTextDisplayer",kS="initial",lS=function(a){return _.Ah(a,{nf:(b,c)=>b.Fc(c)})},mS=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)},nS=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},oS=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},qS=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>pS[c]);return a},sS=function(a,b){rS(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{rS(a,c)})},rS=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},tS=function(a,b){return 0===a?"0":a+b},uS=function(a,b){return 1>Math.abs(a-b)||a<b},vS=function(a,b){return a<b&&1<Math.abs(a-b)},wS=function(a,b){return a>b&&1<Math.abs(a-b)},xS=
3
+ function(a,b){return 1>Math.abs(a-b)||a>b},zS=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 yS(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
+ d-e)},AS=function(a){return new yS(a.left,a.f,a.top,a.a,a.height,a.width)},BS=function(a,b){return b.some(c=>vS(a.left,c.f)&&wS(a.f,c.left)&&vS(a.top,c.a)&&wS(a.a,c.top))},CS=function(a,b){return xS(a.top,b.top)&&uS(a.a,b.a)&&xS(a.left,b.left)&&uS(a.f,b.f)},DS=function(a,b,c){switch(c){case "+x":return vS(a.left,b.left);case "-x":return wS(a.f,b.f);case "+y":return vS(a.top,b.top);case "-y":return wS(a.a,b.a);default:throw Error("Unknown axis");}},ES=function(a){return a.f.writingMode===_.ds},FS=
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 ES(a)?b:c},GS=function(a){switch(a.f.writingMode){case _.ds:return"horizontal-tb";case _.dg:return _.dg;case _.eg:return _.eg;default:throw Error("Unknown writing mode");}},HS=function(a){switch(a.f.positionAlign){case _.he:return _.ee;case "auto":case _.$c:return _.cs;case _.ie:return _.vf}return a.f.textAlign},IS=function(a,b){if(typeof a.f.position===_.t&&typeof a.f.size===
6
+ _.t)switch(b){case _.he:return a.f.position;case "auto":case _.$c:return a.f.position-a.f.size/2;case _.ie:return a.f.position-a.f.size}return 0},JS=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ee:case _.ee:return _.he;case _.cs:return _.$c;case _.vf:case _.vf:return _.ie}return a.f.positionAlign},MS=function(a,b,c){return(KS(a)||LS(a))&&_.Tg(c)?tS(c,_.of):KS(a)&&_.A(c)?tS(0,_.of):ES(a)&&_.Tg(b)?tS(b,"%"):kS},NS=function(a,b,c){return ES(a)&&_.Tg(c)?tS(c,_.of):(KS(a)||LS(a))&&_.Tg(b)?
7
+ tS(b,"%"):kS},LS=function(a){return a.f.writingMode===_.eg},KS=function(a){return a.f.writingMode===_.dg},OS=function(a,b){if(a.j)switch(b.writingMode){case _.ds:return["-y"];case _.dg:return["+x"];case _.eg:return["-x"]}a=[];switch(b.writingMode){case _.ds:a=["+y","-y"];break;case _.dg:a=["+x","-x"];break;case _.eg:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},PS=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=zS(a.l.a)},QS=function(a,b){PS(a.h);a.l.unshift(b);
8
+ for(const c of a.l)a.h.append(c)},RS=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.ms)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(gS);},TS=function(a,b,c,d){const e=document.createElement(_.Of),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);SS(a,c,b);a.g.debug(`Created HTML style element #${b}.`);return e.sheet},US=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)},VS=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},WS=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.o=[]}},SS=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.l.push(()=>d.disconnect())},XS=function(a){a=_.Mg(a.htmlcue||{});_.A(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.A(a.enableResizeObserver)&&(a.enableResizeObserver=
11
+ !0);return a},cT=function(a,b){if((b||a.l)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Un)if(a.J=c,c=YS(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,ZS(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Ur(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 _.lg:g="clpp-text-vtt";
12
+ break;case _.Vf:g=iS;break;case _.bs:g=hS}g&&!f.classList.contains(g)&&_.qo(f,g);f=zS(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{rS({fontSize:$S(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.lg;var h=d.payloadType===_.Vf;d.region&&(g||h||d.backgroundImage)&&(c.C.has(d.region.id)?f=c.C.get(d.region.id):(f=new aT(d.region,
13
+ {}),c.C.set(d.region.id,f),QS(c.a,f)));d=new bT(d,c.M,e);f?QS(f,d):QS(c.a,d)}}}}},dT=function(a){ZS(a);a.J=null;a.o=null;a.f=[]},eT=function(a,b){return a.startTime<=b&&a.endTime>b},YS=function(a,b){var c=nS(a.f,d=>eT(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&eT(a.f[d-1],b);)d--;for(;c+1<a.f.length&&eT(a.f[c+1],b);)c++;return{start:d,end:c}}},ZS=function(a){a.C.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(iS);
14
+ b.classList.remove(hS);a=a.a;PS(a.h);a.l=[]}},$S=function(a,b){const c=zS(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.D)return a=a.getFontSizePercent(),`${Math.round(c*a)}px`;if(typeof b===_.t&&0<b)return`${Math.round(c/b)}px`;a=a.getFontSizePercent();return`${Math.round(c*a)}px`},iT=class{parse(a){a={input:a};const b=_.so(_.Fd),c=[];let d=b;for(var e;null!==(e=oS(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=fT[f];h?(h=_.so(h),(f=gT[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||hT[g.localName]&&hT[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(qS(e)));return b}},fT={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},gT={v:"voice",lang:"lang"},hT={rt:"ruby"},pS={"\x26amp;":"\x26",
16
+ "\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var yS=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 jT=class{constructor(a,b,c){this.id=a;this.w=b;this.C=c;this.a=this.o();this.j=!1}init(){this.j=!0}A(){return!1}};var bT=class extends jT{constructor(a,b,c){super(a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.D=c}A(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)}init(a){super.init(a);if(this.h)_.qo(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===_.Vf){var c=_.so(_.Fd);c.innerHTML=b.payload;b=c}else b.payloadType===
17
+ _.lg?b=(new iT).parse(b.payload):(c=_.so(_.Fd),c.textContent=b.payload,b=c);_.qo(b,this.w);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.qo(b,d);rS({writingMode:GS(this)},b);var d=b;this.a.appendChild(d);_.qo(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.qo(this.a,`clpp-text-wrapper__${e}`);_.A(this.f.line)&&(this.f.lineInterpretation=_.es,this.f.line=ES(this)?-1:0);e=GS(this);rS({writingMode:e,webkitWritingMode:e,direction:kS,textAlign:HS(this)},this.a);if(!this.f.region||
18
+ !this.f.region.displayAlign){e=IS(this,JS(this));rS({position:"absolute",left:MS(this,e,null),right:LS(this)&&_.A(null)?tS(0,_.of):kS,top:NS(this,e,null),width:ES(this)?tS(this.f.size,"%"):kS,height:KS(this)||LS(this)?tS(this.f.size,"%"):kS},this.a);b=this.f;a=ES(this)?a.height:a.width;c=FS(this);if(b.lineInterpretation===_.es){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 _.$c:g-=f/2;break;case _.Td:g-=f}f=Math.round(g/
19
+ 100*a)}LS(this)&&(f=a-f-c);a=f;rS({left:MS(this,e,a),right:LS(this)&&_.A(a)?tS(0,_.of):kS,top:NS(this,e,a)},this.a)}sS(this.D,d)}}o(){return _.so(_.Fd)}};var kT=class{constructor(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=zS(a.a);this.h=[]}append(a){const b=a.a;b.style.visibility=_.Zd;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=zS(a.a);var d=OS(this,a.f),e=FS(a);const g=AS(c);let h=null,k=0;for(const l of d){for(;DS(c,this.a,l)||CS(c,this.a)&&BS(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||CS(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=AS(c),k=d);c=AS(g)}c=h||g}rS({top:tS(c.top-this.a.top,_.of),bottom:tS(this.a.a-c.a,_.of),left:tS(c.left-this.a.left,_.of),right:tS(this.a.f-c.f,_.of),height:tS(c.height,_.of),width:tS(c.width,_.of)},a.a)}b.style.visibility="visible";this.h.push(zS(a.a))}};var lT=class extends jT{constructor(a,b,c){super(a,b,c);this.h=null;this.l=[]}init(){this.h=new kT(this);this.j=!0}o(){const a=_.so(_.Fd);_.qo(a,this.w);this.id&&(a.id=this.id);return a}};var aT=class extends lT{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 _.ms:b=b.width/100*a.width;break a;default:throw Error(gS);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.ms)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(gS);d=a.height;const e=RS(this,d,a.height);rS(this.C,this.a);rS({left:tS(c,_.of),top:tS(e,_.of),width:tS(b,
21
+ _.of),height:tS(d,_.of)},this.a);this.f.writingMode&&rS({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&rS({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.qo(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.ms:f=f.height/100*a.height;break a;case 2:f=f.height;c=new bT(new _.js(0,1,"Lorem ipsum",_.bs),{},{});b=c.a;this.a.appendChild(b);c.init(zS(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
+ b=c;f*=b;break a;default:throw Error(gS);}a=RS(this,f,a.height);rS({top:tS(a,_.of),height:tS(f,_.of)},this.a);this.h=new kT(this,!0);this.j=!0}getId(){return this.f.id}};var mT=class{constructor(a,b){this.g=new _.S("clpp.htmlcue.StyleManager");this.l=[];this.j=a;this.h=b;this.o=[];this.a=TS(this,this.h,this.j);this.f=TS(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.o.some(b=>b===a)){const b=US(this,a);if(VS(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.o.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.l.forEach(b=>b()),a.l=[],WS(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 nT=class extends _.fu{constructor(a){super(a);this.g=new _.S(jS);this.m=a;this.M=XS(a.getConfiguration());this.l=!1;this.f=[];this.F=a.getSurface().getContainer();this.j=new mT(a.getSurface().getUniqueCssClass(),"CLPP Subtitle Styles");this.a=new lT(null,"clpp-text-container",{});this.A=new _.Xt(a.getSurface(),this.T.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.");
24
+ this.G=new _.Pj(()=>{cT(this)});this.C=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=mS(this.f,lS(a));this.o=null;cT(this,!1)}}h(){null==this.j||cT(this,!0)}destroy(){const a=this;return _.x(function*(){null!=a.j&&(dT(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;
25
+ this.f=this.f.filter(c=>c.startTime<a||c.endTime>=b);this.o=null;cT(this,!0);return!0}isTextVisible(){return this.l}setTextVisibility(a){null!=this.j&&this.l!==a&&((this.l=a)?(this.G.tb(.25),this.M.enableResizeObserver&&this.A.start(),cT(this,!0)):(this.G.stop(),this.A.stop(),dT(this)))}Zc(){return this.f}T(){cT(this,!0)}};_.z(jS,nT);nT.prototype.setTextVisibility=nT.prototype.setTextVisibility;nT.prototype.isTextVisible=nT.prototype.isTextVisible;nT.prototype.remove=nT.prototype.remove;
26
+ nT.prototype.destroy=nT.prototype.destroy;nT.prototype.append=nT.prototype.append;var oT=class{isSupported(a){return!!a.enableHtmlCue&&!_.fk()}create(a){return new nT(a)}};_.z("clpp.htmlcue.HtmlCueComponent",class extends _.Gt{f(){_.yn(_.$d,new oT)}a(){_.wn.has(_.$d)&&(_.wn.delete(_.$d),_.xn.info("Removed factory: 'html'"))}id(){return _.Pf}});};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 WM="clpp.ima.AdsManagerFactory",XM=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===_.Mc?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
- _.Mc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},YM=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Dj()},ZM=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.oa.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.Tb.bind(a));c.on(b,d.AD_BUFFERING,a.Oa.bind(a));
3
- c.on(b,d.FIRST_QUARTILE,a.U.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.qb.bind(a));c.on(b,d.RESUMED,a.Sb.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))},$M=function(a,b){const c=b?a.fa.create(b.getErrorCode()):null;a.m.onError(new _.H(1,9,10003,{errorType:c},b))},aN=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 _.C(b,d))},bN=function(a){a.B=null;aN(a,_.lc);a.o&&a.m.getSurface().hide(a.o)},cN=function(a){_.bo(a.A,{visibility:"visible"})},eN=function(a){return _.w(function*(){a.O.initialize();const b=!!a.m.getConfiguration().muted;(yield a.K.canPlay(b))||YM(a)?dN(a):(aN(a,_.Kc),a.h.warn(_.ja))})},fN=function(a,b){return _.w(function*(){a.O.initialize();yield b.play();dN(a)})},dN=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,
5
- google.ima.ViewMode.NORMAL);a.H=!0},gN=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}sb(){return"Google IMA SDK"}tb(){return google.ima.VERSION}zb(){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()}dc(){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]===_.ye&&typeof b[d].clickThroughUrl===_.yf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}wb(){return this.a.getVastMediaWidth()}vb(){return this.a.getVastMediaHeight()}jb(){return this.a.getVastMediaBitrate()}Wa(){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}yb(){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.yb;X.prototype.getPositionInSequence=X.prototype.Kb;
8
- X.prototype.getPodTimeOffset=X.prototype.Jb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Wa;X.prototype.getMediaBitrate=X.prototype.jb;X.prototype.getMediaHeight=X.prototype.vb;X.prototype.getMediaWidth=X.prototype.wb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Ib;X.prototype.isBumper=X.prototype.dc;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.zb;X.prototype.getAdManagerVersion=X.prototype.tb;X.prototype.getAdManagerName=X.prototype.sb;var hN=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 iN=class{constructor(a){this.a=a}getCuePoints(){return this.a}Lb(){return 0<=this.a.indexOf(0)||0===this.a.length}kb(){return 0<=this.a.indexOf(-1)}};iN.prototype.hasPostroll=iN.prototype.kb;iN.prototype.hasPreroll=iN.prototype.Lb;iN.prototype.getCuePoints=iN.prototype.getCuePoints;var jN=class{constructor(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.yg(a.ima||{});this.I=a=_.xg({disableCustomPlayback:!1},a);this.o=this.m.$b("ima").wc();this.O=this.m.$b("ima").g;this.l=this.m.$b("ima").a;this.K=new _.At;this.h=new _.R("clpp.ima");this.g=this.a=null;this.f=new _.Km;this.H=!1;this.w=new _.Er;this.fa=new hN;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,_.Pd,this.qc.bind(this))}}Vb(a){this.a=a.getAdsManager(this.A,XM(this));this.a.isCustomPlaybackUsed()&&!YM(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 _.yt(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 iN(a),this.m.trigger(new _.C(_.oc,
11
- {adsTimeline:this.j})),ZM(this));this.f.resolve()}Ub(a){$M(this,a.getError());this.f.resolve()}uc(a){const b=this;return _.w(function*(){b.G=!0;YM(b)||(yield b.m.pause(),_.bo(b.A,{visibility:_.Vd}));aN(b,_.Xb,a);b.g.start()})}oa(){const a=this;return _.w(function*(){if(YM(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()?aN(this,_.ec,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.m.play()))}aa(a){this.B=a.getAd().getDuration();
12
- aN(this,_.kc,a);this.m.getSurface().show(this.o)}eb(a){a=a.getAdData();$M(this,a?a.adError:null);bN(this)}Tb(a){aN(this,_.hc,a)}Oa(a){aN(this,_.$b,a)}U(a){aN(this,_.cc,a)}fb(a){aN(this,_.fc,a)}ba(a){aN(this,_.mc,a)}qb(a){aN(this,_.gc,a)}Sb(a){aN(this,_.ic,a)}R(a){this.pause();aN(this,_.ac,a)}Z(a){aN(this,_.jc,a);bN(this)}V(a){aN(this,_.dc,a)}cb(a){aN(this,_.bc,a);bN(this)}vc(){const a=this;return _.w(function*(){a.F=!0;if(YM(a)&&null!==a.J){var b=a.m;b.a&&b.a.addDelegate(b);yield _.Uo(a.m);a.C||(yield a.m.seek(a.J))}else{if(!a.G)return a.m.play();
13
- cN(a)}a.G=!1;a.g&&a.g.stop();a.C||(yield a.m.play());aN(a,_.Zb)})}Wb(){this.M=!0}qc(){this.C=!0;this.l.contentComplete()}load(){const a=this;return _.w(function*(){var b=a.m;const c=a.I;try{if(typeof c.adTagUrl!==_.yf)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 _.w(function*(){b.a&&b.j&&!b.H?b.j.Lb()?yield eN(b):yield fN(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.kb()&&!this.M?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.o&&this.m.getSurface().hide(this.o)}),_.Yg(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(()=>{cN(this);this.w.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};jN.prototype.getPosition=jN.prototype.getPosition;
16
- jN.prototype.setVolume=jN.prototype.setVolume;jN.prototype.getVolume=jN.prototype.getVolume;jN.prototype.skip=jN.prototype.skip;jN.prototype.pause=jN.prototype.pause;jN.prototype.resume=jN.prototype.resume;var kN=class extends _.It{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(gN())return a.onError(new _.H(1,9,1E4));this.f=_.$n(_.Bd,{"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)}kg(){return this.a}ig(){return this.g}wc(){return this.f}id(){return"ima"}};_.x("clpp.ima.ImaPlugin",kN);kN.prototype.getAdContainer=kN.prototype.wc;kN.prototype.getAdDisplayContainer=kN.prototype.ig;kN.prototype.getAdsLoader=kN.prototype.kg;kN.Id="ima";kN.isSdkMissing=gN;_.Ho(new class{create(){return new kN}});var lN=class{constructor(){this.a=new _.R(WM)}name(){return WM}isSupported(a,b){return a.namespace()===_.fd?!1:gN()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new jN(a)}};lN.prototype.create=lN.prototype.create;lN.prototype.isSupported=lN.prototype.isSupported;lN.prototype.name=lN.prototype.name;_.Xn(new lN);};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var PR="clpp.ima.AdsManagerFactory",QR=function(a){a=a.I;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.t&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Oc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.t&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.t&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
2
+ _.Oc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},RR=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Tj()},SR=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.ga.bind(a));c.on(b,d.LOADED,a.X.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.gc.bind(a));c.on(b,d.STARTED,a.Z.bind(a));c.on(b,d.LOG,a.Va.bind(a));c.on(b,d.AD_PROGRESS,a.Rb.bind(a));c.on(b,d.AD_BUFFERING,a.Ea.bind(a));
3
+ c.on(b,d.FIRST_QUARTILE,a.S.bind(a));c.on(b,d.MIDPOINT,a.Ma.bind(a));c.on(b,d.THIRD_QUARTILE,a.aa.bind(a));c.on(b,d.PAUSED,a.Na.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.T.bind(a));c.on(b,d.COMPLETE,a.Ua.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.ic.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.ec.bind(a))},TR=function(a,b){const c=b?a.da.create(b.getErrorCode()):null;a.m.onError(new _.H(1,9,10003,{errorType:c},b))},UR=function(a,
4
+ b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.F,a.D)});a.m.trigger(new _.D(b,d))},VR=function(a){a.C=null;UR(a,_.qc);a.o&&a.m.getSurface().hide(a.o)},WR=function(a){_.ro(a.A,{visibility:"visible"})},ZR=function(a){return _.x(function*(){a.N.initialize();const b=!!a.m.getConfiguration().muted;(yield a.K.canPlay(b))||RR(a)?YR(a):(UR(a,_.Lc),a.g.warn(_.ka))})},$R=function(a,b){return _.x(function*(){a.N.initialize();yield b.play();YR(a)})},YR=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,
5
+ google.ima.ViewMode.NORMAL);a.a.start();a.H=!0},aS=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}Gb(){return"Google IMA SDK"}Hb(){return google.ima.VERSION}Mb(){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()}pc(){return this.f?
6
+ this.f.getIsBumper():!1}Xb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Ce&&typeof b[d].clickThroughUrl===_.Mf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}Kb(){return this.a.getVastMediaWidth()}Jb(){return this.a.getVastMediaHeight()}yb(){return this.a.getVastMediaBitrate()}lb(){return this.h?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Yb(){return this.f?this.f.getTimeOffset():0}Zb(){return this.f?this.f.getAdPosition():
7
+ 1}Lb(){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.Lb;X.prototype.getPositionInSequence=X.prototype.Zb;
8
+ X.prototype.getPodTimeOffset=X.prototype.Yb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.lb;X.prototype.getMediaBitrate=X.prototype.yb;X.prototype.getMediaHeight=X.prototype.Jb;X.prototype.getMediaWidth=X.prototype.Kb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Xb;X.prototype.isBumper=X.prototype.pc;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.Mb;X.prototype.getAdManagerVersion=X.prototype.Hb;X.prototype.getAdManagerName=X.prototype.Gb;var bS=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 cS=class{constructor(a){this.a=a}getCuePoints(){return this.a}$b(){return 0<=this.a.indexOf(0)||0===this.a.length}Ab(){return 0<=this.a.indexOf(-1)}};cS.prototype.hasPostroll=cS.prototype.Ab;cS.prototype.hasPreroll=cS.prototype.$b;cS.prototype.getCuePoints=cS.prototype.getCuePoints;var dS=class{constructor(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.Mg(a.ima||{});this.I=a=_.Lg({disableCustomPlayback:!1},a);this.o=this.m.kc("ima").Hc();this.N=this.m.kc("ima").h;this.l=this.m.kc("ima").a;this.K=new _.Zt;this.g=new _.S("clpp.ima");this.h=this.a=null;this.f=new _.Zm;this.H=!1;this.w=new _.$r;this.da=new bS;this.C=null;this.M=this.G=this.D=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.Sb.bind(this));a.on(this.m,_.Ud,this.fc.bind(this))}}Ub(a){this.a=a.getAdsManager(this.A,QR(this));this.a.isCustomPlaybackUsed()&&!RR(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 _.Xt(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 cS(a),this.m.trigger(new _.D(_.tc,
11
+ {adsTimeline:this.j})),SR(this));this.f.resolve()}Sb(a){TR(this,a.getError());this.f.resolve()}gc(a){const b=this;return _.x(function*(){b.G=!0;if(RR(b)){b.J=b.m.getPosition();yield b.m.detach();var c=b.m;c.a&&c.a.stopForwardingEventsTo(c)}else yield b.m.pause(),_.ro(b.A,{visibility:_.Zd});UR(b,_.bc,a);b.h.start()})}ga(){const a=this;return _.x(function*(){a.a.start()})}X(a){a.getAd().isLinear()?UR(this,_.ic,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.m.play()))}Z(a){this.C=a.getAd().getDuration();
12
+ UR(this,_.pc,a);this.m.getSurface().show(this.o)}Va(a){a=a.getAdData();TR(this,a?a.adError:null);VR(this)}Rb(a){UR(this,_.mc,a)}Ea(a){UR(this,_.dc,a)}S(a){UR(this,_.gc,a)}Ma(a){UR(this,_.jc,a)}aa(a){UR(this,_.rc,a)}Na(a){UR(this,_.lc,a)}Qb(a){UR(this,_.nc,a)}R(a){this.pause();UR(this,_.ec,a)}Y(a){UR(this,_.oc,a);VR(this)}T(a){UR(this,_.hc,a)}Ua(a){UR(this,_.fc,a);VR(this)}ic(){const a=this;return _.x(function*(){a.F=!0;if(RR(a)&&null!==a.J){var b=a.m;b.a&&b.a.forwardEventsTo(b);yield _.lp(a.m);a.D||
13
+ (yield a.m.seek(a.J))}else{if(!a.G)return a.m.play();WR(a)}a.G=!1;a.h&&a.h.stop();a.D||(yield a.m.play());UR(a,_.cc)})}ec(){this.M=!0}fc(){this.D=!0;this.l.contentComplete()}load(){const a=this;return _.x(function*(){var b=a.m;const c=a.I;try{if(typeof c.adTagUrl!==_.Mf)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=
14
+ c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);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.$b()?yield ZR(b):yield $R(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.C)return-1;const a=this.a.getRemainingTime();
15
+ return 0>a?0:this.C-a}dispose(){return(new Promise(a=>{this.H&&this.j&&this.j.Ab()&&!this.M?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.o&&this.m.getSurface().hide(this.o)}),_.mh(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(()=>{WR(this);this.w.release();this.h&&(this.h.stop(),this.h=null);this.a&&(this.a.destroy(),this.a=null)})}};
16
+ dS.prototype.getPosition=dS.prototype.getPosition;dS.prototype.setVolume=dS.prototype.setVolume;dS.prototype.getVolume=dS.prototype.getVolume;dS.prototype.skip=dS.prototype.skip;dS.prototype.pause=dS.prototype.pause;dS.prototype.resume=dS.prototype.resume;var eS=class extends _.iu{constructor(){super();this.a=this.h=this.f=null}onPlayerCreated(a){if(aS())return a.onError(new _.H(1,9,1E4));this.f=_.po(_.Fd,{"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(_.ra);this.a.getSettings().setPlayerVersion(_.fa);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)}Ag(){return this.a}yg(){return this.h}Hc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",eS);eS.prototype.getAdContainer=eS.prototype.Hc;eS.prototype.getAdDisplayContainer=eS.prototype.yg;eS.prototype.getAdsLoader=eS.prototype.Ag;eS.Id="ima";eS.isSdkMissing=aS;_.Wo(new class{create(){return new eS}});var fS=class{constructor(){this.a=new _.S(PR)}name(){return PR}isSupported(a,b){return a.namespace()===_.jd?!1:aS()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new dS(a)}};fS.prototype.create=fS.prototype.create;fS.prototype.isSupported=fS.prototype.isSupported;fS.prototype.name=fS.prototype.name;_.mo(new fS);};f.call(g, window);