@castlabs/prestoplay 6.20.0 → 6.21.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 (65) hide show
  1. package/CHANGELOG.md +35 -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 +109 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +553 -550
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +78 -77
  10. package/cjs/cl.externs.js +81 -97
  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 +22 -24
  16. package/cjs/cl.mse.js +305 -305
  17. package/cjs/cl.muxdata.js +15 -15
  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.sessions.js +16 -16
  22. package/cjs/cl.simid.js +15 -15
  23. package/cjs/cl.smooth.js +72 -72
  24. package/cjs/cl.thumbnails.js +25 -25
  25. package/cjs/cl.tizen.js +70 -69
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +13 -13
  29. package/cjs/cl.vr.js +18 -18
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +9 -0
  32. package/cjs/cl.youbora.js +38 -20
  33. package/cl.adobe.js +3 -3
  34. package/cl.airplay.js +3 -3
  35. package/cl.broadpeak.js +5 -5
  36. package/cl.cast.js +88 -89
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +471 -468
  39. package/cl.crypto.js +8 -8
  40. package/cl.dash.js +74 -72
  41. package/cl.externs.js +71 -99
  42. package/cl.freewheel.js +19 -19
  43. package/cl.hls.js +74 -74
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +16 -17
  47. package/cl.mse.js +276 -276
  48. package/cl.muxdata.js +13 -13
  49. package/cl.onboard.js +4 -4
  50. package/cl.persistent.js +11 -11
  51. package/cl.playlist.js +5 -5
  52. package/cl.sessions.js +10 -10
  53. package/cl.simid.js +13 -13
  54. package/cl.smooth.js +59 -59
  55. package/cl.thumbnails.js +19 -19
  56. package/cl.tizen.js +57 -57
  57. package/cl.ttml.js +22 -22
  58. package/cl.verimatrix.js +4 -4
  59. package/cl.vimond.js +8 -8
  60. package/cl.vr.js +14 -14
  61. package/cl.vtt.js +12 -12
  62. package/cl.yospace.js +3 -0
  63. package/cl.youbora.js +27 -15
  64. package/package.json +3 -1
  65. package/typings.d.ts +123 -24
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 qR="Unsupported unit",rR="clpp-text-plain",sR="clpp-text-ttml",tR="clpp.htmlcue.HtmlTextDisplayer",uR="initial",vR=function(a){return _.Uh(a,{bf:(b,c)=>b.yc(c)})},wR=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)},xR=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},yR=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},AR=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>zR[c]);return a},CR=function(a,b){BR(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{BR(a,c)})},BR=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},DR=function(a,b){return 0===a?"0":a+b},ER=function(a,b){return 1>Math.abs(a-b)||a<b},FR=function(a,b){return a<b&&1<Math.abs(a-b)},GR=function(a,b){return a>b&&1<Math.abs(a-b)},HR=
3
- function(a,b){return 1>Math.abs(a-b)||a>b},JR=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 IR(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
- d-e)},KR=function(a){return new IR(a.left,a.f,a.top,a.a,a.height,a.width)},LR=function(a,b){return b.some(c=>FR(a.left,c.f)&&GR(a.f,c.left)&&FR(a.top,c.a)&&GR(a.a,c.top))},MR=function(a,b){return HR(a.top,b.top)&&ER(a.a,b.a)&&HR(a.left,b.left)&&ER(a.f,b.f)},NR=function(a,b,c){switch(c){case "+x":return FR(a.left,b.left);case "-x":return GR(a.f,b.f);case "+y":return FR(a.top,b.top);case "-y":return GR(a.a,b.a);default:throw Error("Unknown axis");}},OR=function(a){return a.f.writingMode===_.Vs},PR=
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 OR(a)?b:c},QR=function(a){switch(a.f.writingMode){case _.Vs:return"horizontal-tb";case _.ig:return _.ig;case _.jg:return _.jg;default:throw Error("Unknown writing mode");}},RR=function(a){switch(a.f.positionAlign){case _.he:return _.ee;case "auto":case _.bd:return _.Us;case _.ie:return _.yf}return a.f.textAlign},SR=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 _.bd:return a.f.position-a.f.size/2;case _.ie:return a.f.position-a.f.size}return 0},TR=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ee:case _.ee:return _.he;case _.Us:return _.bd;case _.yf:case _.yf:return _.ie}return a.f.positionAlign},WR=function(a,b,c){return(UR(a)||VR(a))&&_.Wg(c)?DR(c,_.rf):UR(a)&&_.z(c)?DR(0,_.rf):OR(a)&&_.Wg(b)?DR(b,"%"):uR},YR=function(a,b,c){return OR(a)&&_.Wg(c)?DR(c,_.rf):(UR(a)||VR(a))&&_.Wg(b)?
7
- DR(b,"%"):uR},VR=function(a){return a.f.writingMode===_.jg},UR=function(a){return a.f.writingMode===_.ig},ZR=function(a,b){if(a.j)switch(b.writingMode){case _.Vs:return["-y"];case _.ig:return["+x"];case _.jg:return["-x"]}a=[];switch(b.writingMode){case _.Vs:a=["+y","-y"];break;case _.ig:a=["+x","-x"];break;case _.jg:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},$R=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=JR(a.l.a)},aS=function(a,b){$R(a.h);a.l.unshift(b);
8
- for(const c of a.l)a.h.append(c)},bS=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.bt)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(qR);},dS=function(a,b,c,d){const e=document.createElement(_.Rf),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);cS(a,c,b);a.g.debug(`Created HTML style element #${b}.`);return e.sheet},eS=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)},fS=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},gS=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.o=[]}},cS=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())},hS=function(a){a=_.Pg(a.htmlcue||{});_.z(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.z(a.enableResizeObserver)&&(a.enableResizeObserver=
11
- !0);return a},nS=function(a,b){if((b||a.l)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.so)if(a.J=c,c=iS(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,jS(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Ls(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 _.tg:g="clpp-text-vtt";
12
- break;case _.Yf:g=sR;break;case _.Ts:g=rR}g&&!f.classList.contains(g)&&_.No(f,g);f=JR(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{BR({fontSize:kS(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.tg;var h=d.payloadType===_.Yf;d.region&&(g||h||d.backgroundImage)&&(c.B.has(d.region.id)?f=c.B.get(d.region.id):(f=new lS(d.region,
13
- {}),c.B.set(d.region.id,f),aS(c.a,f)));d=new mS(d,c.L,e);f?aS(f,d):aS(c.a,d)}}}}},oS=function(a){jS(a);a.J=null;a.o=null;a.f=[]},pS=function(a,b){return a.startTime<=b&&a.endTime>b},iS=function(a,b){var c=xR(a.f,d=>pS(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&pS(a.f[d-1],b);)d--;for(;c+1<a.f.length&&pS(a.f[c+1],b);)c++;return{start:d,end:c}}},jS=function(a){a.B.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(sR);
14
- b.classList.remove(rR);a=a.a;$R(a.h);a.l=[]}},kS=function(a,b){const c=JR(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`},tS=class{parse(a){a={input:a};const b=_.Po(_.Ed),c=[];let d=b;for(var e;null!==(e=yR(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=qS[f];h?(h=_.Po(h),(f=rS[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||sS[g.localName]&&sS[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(AR(e)));return b}},qS={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},rS={v:"voice",lang:"lang"},sS={rt:"ruby"},zR={"\x26amp;":"\x26",
16
- "\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var IR=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 uS=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 mS=class extends uS{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)_.No(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===_.Yf){var c=_.Po(_.Ed);c.innerHTML=b.payload;b=c}else b.payloadType===
17
- _.tg?b=(new tS).parse(b.payload):(c=_.Po(_.Ed),c.textContent=b.payload,b=c);_.No(b,this.w);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.No(b,d);BR({writingMode:QR(this)},b);var d=b;this.a.appendChild(d);_.No(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.No(this.a,`clpp-text-wrapper__${e}`);_.z(this.f.line)&&(this.f.lineInterpretation=_.Ws,this.f.line=OR(this)?-1:0);e=QR(this);BR({writingMode:e,webkitWritingMode:e,direction:uR,textAlign:RR(this)},this.a);if(!this.f.region||
18
- !this.f.region.displayAlign){e=SR(this,TR(this));BR({position:"absolute",left:WR(this,e,null),right:VR(this)&&_.z(null)?DR(0,_.rf):uR,top:YR(this,e,null),width:OR(this)?DR(this.f.size,"%"):uR,height:UR(this)||VR(this)?DR(this.f.size,"%"):uR},this.a);b=this.f;a=OR(this)?a.height:a.width;c=PR(this);if(b.lineInterpretation===_.Ws){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 _.bd:g-=f/2;break;case _.Sd:g-=f}f=Math.round(g/
19
- 100*a)}VR(this)&&(f=a-f-c);a=f;BR({left:WR(this,e,a),right:VR(this)&&_.z(a)?DR(0,_.rf):uR,top:YR(this,e,a)},this.a)}CR(this.C,d)}}o(){return _.Po(_.Ed)}};var vS=class{constructor(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=JR(a.a);this.h=[]}append(a){const b=a.a;b.style.visibility=_.$d;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=JR(a.a);var d=ZR(this,a.f),e=PR(a);const g=KR(c);let h=null,k=0;for(const l of d){for(;NR(c,this.a,l)||MR(c,this.a)&&LR(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||MR(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=KR(c),k=d);c=KR(g)}c=h||g}BR({top:DR(c.top-this.a.top,_.rf),bottom:DR(this.a.a-c.a,_.rf),left:DR(c.left-this.a.left,_.rf),right:DR(this.a.f-c.f,_.rf),height:DR(c.height,_.rf),width:DR(c.width,_.rf)},a.a)}b.style.visibility="visible";this.h.push(JR(a.a))}};var wS=class extends uS{constructor(a,b,c){super(a,b,c);this.h=null;this.l=[]}init(){this.h=new vS(this);this.j=!0}o(){const a=_.Po(_.Ed);_.No(a,this.w);this.id&&(a.id=this.id);return a}};var lS=class extends wS{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 _.bt:b=b.width/100*a.width;break a;default:throw Error(qR);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.bt)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(qR);d=a.height;const e=bS(this,d,a.height);BR(this.B,this.a);BR({left:DR(c,_.rf),top:DR(e,_.rf),width:DR(b,
21
- _.rf),height:DR(d,_.rf)},this.a);this.f.writingMode&&BR({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&BR({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.No(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.bt:f=f.height/100*a.height;break a;case 2:f=f.height;c=new mS(new _.Zs(0,1,"Lorem ipsum",_.Ts),{},{});b=c.a;this.a.appendChild(b);c.init(JR(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
- b=c;f*=b;break a;default:throw Error(qR);}a=bS(this,f,a.height);BR({top:DR(a,_.rf),height:DR(f,_.rf)},this.a);this.h=new vS(this,!0);this.j=!0}getId(){return this.f.id}};var xS=class{constructor(a,b){this.g=new _.R("clpp.htmlcue.StyleManager");this.l=[];this.j=a;this.h=b;this.o=[];this.a=dS(this,this.h,this.j);this.f=dS(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=eS(this,a);if(fS(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 _.w(function*(){null!=a.a&&(a.l.forEach(b=>b()),a.l=[],gS(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 yS=class extends _.Ou{constructor(a){super(a);this.g=new _.R(tR);this.m=a;this.L=hS(a.getConfiguration());this.l=!1;this.f=[];this.F=a.getSurface().getContainer();this.j=new xS(a.getSurface().getUniqueCssClass(),"CLPP Subtitle Styles");this.a=new wS(null,"clpp-text-container",{});this.A=new _.Hu(a.getSurface(),this.S.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 _.mk(()=>{nS(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=wR(this.f,vR(a));this.o=null;nS(this,!1)}}h(){null==this.j||nS(this,!0)}destroy(){const a=this;return _.w(function*(){null!=a.j&&(oS(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;nS(this,!0);return!0}isTextVisible(){return this.l}setTextVisibility(a){null!=this.j&&this.l!==a&&((this.l=a)?(this.G.vb(.25),this.L.enableResizeObserver&&this.A.start(),nS(this,!0)):(this.G.stop(),this.A.stop(),oS(this)))}S(){nS(this,!0)}};_.x(tR,yS);yS.prototype.setTextVisibility=yS.prototype.setTextVisibility;yS.prototype.isTextVisible=yS.prototype.isTextVisible;yS.prototype.remove=yS.prototype.remove;yS.prototype.destroy=yS.prototype.destroy;
26
- yS.prototype.append=yS.prototype.append;var zS=class{a(a){return!!a.enableHtmlCue&&!_.Ck()}create(a){return new yS(a)}};_.x("clpp.htmlcue.HtmlCueComponent",class extends _.qu{f(){_.Wn(_.ae,new zS)}a(){_.Un.has(_.ae)&&(_.Un.delete(_.ae),_.Vn.info("Removed factory: 'html'"))}id(){return _.Sf}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var $R="Unsupported unit",aS="clpp-text-plain",bS="clpp-text-ttml",cS="clpp.htmlcue.HtmlTextDisplayer",dS="initial",eS=function(a){return _.Vh(a,{ef:(b,c)=>b.yc(c)})},fS=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)},gS=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},hS=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},jS=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>iS[c]);return a},lS=function(a,b){kS(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{kS(a,c)})},kS=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},mS=function(a,b){return 0===a?"0":a+b},nS=function(a,b){return 1>Math.abs(a-b)||a<b},oS=function(a,b){return a<b&&1<Math.abs(a-b)},pS=function(a,b){return a>b&&1<Math.abs(a-b)},qS=
3
+ function(a,b){return 1>Math.abs(a-b)||a>b},sS=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 rS(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
+ d-e)},tS=function(a){return new rS(a.left,a.f,a.top,a.a,a.height,a.width)},uS=function(a,b){return b.some(c=>oS(a.left,c.f)&&pS(a.f,c.left)&&oS(a.top,c.a)&&pS(a.a,c.top))},vS=function(a,b){return qS(a.top,b.top)&&nS(a.a,b.a)&&qS(a.left,b.left)&&nS(a.f,b.f)},wS=function(a,b,c){switch(c){case "+x":return oS(a.left,b.left);case "-x":return pS(a.f,b.f);case "+y":return oS(a.top,b.top);case "-y":return pS(a.a,b.a);default:throw Error("Unknown axis");}},xS=function(a){return a.f.writingMode===_.ft},yS=
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 xS(a)?b:c},zS=function(a){switch(a.f.writingMode){case _.ft:return"horizontal-tb";case _.hg:return _.hg;case _.ig:return _.ig;default:throw Error("Unknown writing mode");}},AS=function(a){switch(a.f.positionAlign){case _.ge:return _.de;case "auto":case _.bd:return _.et;case _.he:return _.xf}return a.f.textAlign},BS=function(a,b){if(typeof a.f.position===_.t&&typeof a.f.size===
6
+ _.t)switch(b){case _.ge:return a.f.position;case "auto":case _.bd:return a.f.position-a.f.size/2;case _.he:return a.f.position-a.f.size}return 0},CS=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.de:case _.de:return _.ge;case _.et:return _.bd;case _.xf:case _.xf:return _.he}return a.f.positionAlign},FS=function(a,b,c){return(DS(a)||ES(a))&&_.Xg(c)?mS(c,_.qf):DS(a)&&_.B(c)?mS(0,_.qf):xS(a)&&_.Xg(b)?mS(b,"%"):dS},GS=function(a,b,c){return xS(a)&&_.Xg(c)?mS(c,_.qf):(DS(a)||ES(a))&&_.Xg(b)?
7
+ mS(b,"%"):dS},ES=function(a){return a.f.writingMode===_.ig},DS=function(a){return a.f.writingMode===_.hg},HS=function(a,b){if(a.j)switch(b.writingMode){case _.ft:return["-y"];case _.hg:return["+x"];case _.ig:return["-x"]}a=[];switch(b.writingMode){case _.ft:a=["+y","-y"];break;case _.hg:a=["+x","-x"];break;case _.ig:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},IS=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=sS(a.l.a)},JS=function(a,b){IS(a.h);a.l.unshift(b);
8
+ for(const c of a.l)a.h.append(c)},KS=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.mt)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error($R);},MS=function(a,b,c,d){const e=document.createElement(_.Qf),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);LS(a,c,b);a.g.debug(`Created HTML style element #${b}.`);return e.sheet},NS=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)},OS=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},PS=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.o=[]}},LS=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())},QS=function(a){a=_.Qg(a.htmlcue||{});_.B(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.B(a.enableResizeObserver)&&(a.enableResizeObserver=
11
+ !0);return a},WS=function(a,b){if((b||a.l)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.zo)if(a.J=c,c=RS(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,SS(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Ws(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 _.pg:g="clpp-text-vtt";
12
+ break;case _.Xf:g=bS;break;case _.dt:g=aS}g&&!f.classList.contains(g)&&_.Uo(f,g);f=sS(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{kS({fontSize:TS(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.pg;var h=d.payloadType===_.Xf;d.region&&(g||h||d.backgroundImage)&&(c.B.has(d.region.id)?f=c.B.get(d.region.id):(f=new US(d.region,
13
+ {}),c.B.set(d.region.id,f),JS(c.a,f)));d=new VS(d,c.L,e);f?JS(f,d):JS(c.a,d)}}}}},XS=function(a){SS(a);a.J=null;a.o=null;a.f=[]},YS=function(a,b){return a.startTime<=b&&a.endTime>b},RS=function(a,b){var c=gS(a.f,d=>YS(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&YS(a.f[d-1],b);)d--;for(;c+1<a.f.length&&YS(a.f[c+1],b);)c++;return{start:d,end:c}}},SS=function(a){a.B.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(bS);
14
+ b.classList.remove(aS);a=a.a;IS(a.h);a.l=[]}},TS=function(a,b){const c=sS(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===_.t&&0<b)return`${Math.round(c/b)}px`;a=a.getFontSizePercent();return`${Math.round(c*a)}px`},bT=class{parse(a){a={input:a};const b=_.Wo(_.Ed),c=[];let d=b;for(var e;null!==(e=hS(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=ZS[f];h?(h=_.Wo(h),(f=$S[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||aT[g.localName]&&aT[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(jS(e)));return b}},ZS={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},$S={v:"voice",lang:"lang"},aT={rt:"ruby"},iS={"\x26amp;":"\x26",
16
+ "\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var rS=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 cT=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 VS=class extends cT{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)_.Uo(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage=`url("${this.f.backgroundImage}")`,this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.Xf){var c=_.Wo(_.Ed);c.innerHTML=b.payload;b=c}else b.payloadType===
17
+ _.pg?b=(new bT).parse(b.payload):(c=_.Wo(_.Ed),c.textContent=b.payload,b=c);_.Uo(b,this.w);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.Uo(b,d);kS({writingMode:zS(this)},b);var d=b;this.a.appendChild(d);_.Uo(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.Uo(this.a,`clpp-text-wrapper__${e}`);_.B(this.f.line)&&(this.f.lineInterpretation=_.gt,this.f.line=xS(this)?-1:0);e=zS(this);kS({writingMode:e,webkitWritingMode:e,direction:dS,textAlign:AS(this)},this.a);if(!this.f.region||
18
+ !this.f.region.displayAlign){e=BS(this,CS(this));kS({position:"absolute",left:FS(this,e,null),right:ES(this)&&_.B(null)?mS(0,_.qf):dS,top:GS(this,e,null),width:xS(this)?mS(this.f.size,"%"):dS,height:DS(this)||ES(this)?mS(this.f.size,"%"):dS},this.a);b=this.f;a=xS(this)?a.height:a.width;c=yS(this);if(b.lineInterpretation===_.gt){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 _.bd:g-=f/2;break;case _.Sd:g-=f}f=Math.round(g/
19
+ 100*a)}ES(this)&&(f=a-f-c);a=f;kS({left:FS(this,e,a),right:ES(this)&&_.B(a)?mS(0,_.qf):dS,top:GS(this,e,a)},this.a)}lS(this.C,d)}}o(){return _.Wo(_.Ed)}};var dT=class{constructor(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=sS(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=sS(a.a);var d=HS(this,a.f),e=yS(a);const g=tS(c);let h=null,k=0;for(const l of d){for(;wS(c,this.a,l)||vS(c,this.a)&&uS(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||vS(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=tS(c),k=d);c=tS(g)}c=h||g}kS({top:mS(c.top-this.a.top,_.qf),bottom:mS(this.a.a-c.a,_.qf),left:mS(c.left-this.a.left,_.qf),right:mS(this.a.f-c.f,_.qf),height:mS(c.height,_.qf),width:mS(c.width,_.qf)},a.a)}b.style.visibility="visible";this.h.push(sS(a.a))}};var eT=class extends cT{constructor(a,b,c){super(a,b,c);this.h=null;this.l=[]}init(){this.h=new dT(this);this.j=!0}o(){const a=_.Wo(_.Ed);_.Uo(a,this.w);this.id&&(a.id=this.id);return a}};var US=class extends eT{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 _.mt:b=b.width/100*a.width;break a;default:throw Error($R);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.mt)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error($R);d=a.height;const e=KS(this,d,a.height);kS(this.B,this.a);kS({left:mS(c,_.qf),top:mS(e,_.qf),width:mS(b,
21
+ _.qf),height:mS(d,_.qf)},this.a);this.f.writingMode&&kS({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&kS({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.Uo(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.mt:f=f.height/100*a.height;break a;case 2:f=f.height;c=new VS(new _.jt(0,1,"Lorem ipsum",_.dt),{},{});b=c.a;this.a.appendChild(b);c.init(sS(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
+ b=c;f*=b;break a;default:throw Error($R);}a=KS(this,f,a.height);kS({top:mS(a,_.qf),height:mS(f,_.qf)},this.a);this.h=new dT(this,!0);this.j=!0}getId(){return this.f.id}};var fT=class{constructor(a,b){this.g=new _.S("clpp.htmlcue.StyleManager");this.l=[];this.j=a;this.h=b;this.o=[];this.a=MS(this,this.h,this.j);this.f=MS(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=NS(this,a);if(OS(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=[],PS(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 gT=class extends _.Yu{constructor(a){super(a);this.g=new _.S(cS);this.m=a;this.L=QS(a.getConfiguration());this.l=!1;this.f=[];this.F=a.getSurface().getContainer();this.j=new fT(a.getSurface().getUniqueCssClass(),"CLPP Subtitle Styles");this.a=new eT(null,"clpp-text-container",{});this.A=new _.Ru(a.getSurface(),this.S.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 _.pk(()=>{WS(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=fS(this.f,eS(a));this.o=null;WS(this,!1)}}h(){null==this.j||WS(this,!0)}destroy(){const a=this;return _.x(function*(){null!=a.j&&(XS(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;WS(this,!0);return!0}isTextVisible(){return this.l}setTextVisibility(a){null!=this.j&&this.l!==a&&((this.l=a)?(this.G.wb(.25),this.L.enableResizeObserver&&this.A.start(),WS(this,!0)):(this.G.stop(),this.A.stop(),XS(this)))}S(){WS(this,!0)}};_.z(cS,gT);gT.prototype.setTextVisibility=gT.prototype.setTextVisibility;gT.prototype.isTextVisible=gT.prototype.isTextVisible;gT.prototype.remove=gT.prototype.remove;gT.prototype.destroy=gT.prototype.destroy;
26
+ gT.prototype.append=gT.prototype.append;var hT=class{a(a){return!!a.enableHtmlCue&&!_.Fk()}create(a){return new gT(a)}};_.z("clpp.htmlcue.HtmlCueComponent",class extends _.Au{f(){_.co(_.$d,new hT)}a(){_.ao.has(_.$d)&&(_.ao.delete(_.$d),_.bo.info("Removed factory: 'html'"))}id(){return _.Rf}});};f.call(g, window);
package/cl.ima.js CHANGED
@@ -1,17 +1,16 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var aR="clpp.ima.AdsManagerFactory",bR=function(a){a=a.L;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Pc?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
- _.Pc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},cR=function(a){return!1===a.L.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.qk()},dR=function(a){const b=a.a,c=a.B,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Qa.bind(a));c.on(b,d.LOADED,a.Z.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Bc.bind(a));c.on(b,d.STARTED,a.da.bind(a));c.on(b,d.LOG,a.Ha.bind(a));c.on(b,d.AD_PROGRESS,a.bc.bind(a));c.on(b,d.AD_BUFFERING,a.Ra.bind(a));
3
- c.on(b,d.FIRST_QUARTILE,a.X.bind(a));c.on(b,d.MIDPOINT,a.wb.bind(a));c.on(b,d.THIRD_QUARTILE,a.ia.bind(a));c.on(b,d.PAUSED,a.Kb.bind(a));c.on(b,d.RESUMED,a.cc.bind(a));c.on(b,d.CLICK,a.V.bind(a));c.on(b,d.SKIPPED,a.ba.bind(a));c.on(b,d.IMPRESSION,a.Y.bind(a));c.on(b,d.COMPLETE,a.Sa.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Dc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.hc.bind(a))},eR=function(a,b){const c=b?a.Pa.create(b.getErrorCode()):null;a.m.onError(new _.G(1,9,10003,{errorType:c},b))},fR=function(a,
4
- b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new W(c,a.H,a.G)});a.m.trigger(new _.C(b,d))},gR=function(a){a.F=null;fR(a,_.sc);a.m.getSurface().hide(a.K)},hR=function(a){_.Oo(a.C,{visibility:"visible"})},jR=function(a){return _.w(function*(){a.S.initialize();const b=!!a.m.getConfiguration().muted;(yield a.O.canPlay(b))||cR(a)?iR(a):(fR(a,_.Nc),a.g.warn(_.ia))})},kR=function(a,b){return _.w(function*(){a.S.initialize();yield b.play();iR(a)})},iR=function(a){a.a.init(a.C.offsetWidth,a.C.offsetHeight,google.ima.ViewMode.NORMAL);
5
- a.a.start();a.J=!0},lR=function(){return!window.google||!google.ima||!google.ima.AdsLoader},W=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c}hb(){return"Google IMA SDK"}ib(){return google.ima.VERSION}ob(){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()}getPosition(){return 0}getSkipTimeOffset(){return this.a.getSkipTimeOffset()}Nb(){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]===_.De&&typeof b[d].clickThroughUrl===_.Pf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}lb(){return this.a.getVastMediaWidth()}kb(){return this.a.getVastMediaHeight()}Za(){return this.a.getVastMediaBitrate()}Va(){return this.h?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Bb(){return this.f?this.f.getTimeOffset():0}Cb(){return this.f?this.f.getAdPosition():
7
- 1}nb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};W.prototype.getWrapperCreativeIds=W.prototype.getWrapperCreativeIds;W.prototype.getWrapperAdSystems=W.prototype.getWrapperAdSystems;W.prototype.getWrapperAdIds=W.prototype.getWrapperAdIds;W.prototype.getSequenceLength=W.prototype.nb;W.prototype.getPositionInSequence=W.prototype.Cb;
8
- W.prototype.getPodTimeOffset=W.prototype.Bb;W.prototype.getPodIndex=W.prototype.getPodIndex;W.prototype.getPodType=W.prototype.Va;W.prototype.getMediaBitrate=W.prototype.Za;W.prototype.getMediaHeight=W.prototype.kb;W.prototype.getMediaWidth=W.prototype.lb;W.prototype.getMediaUrl=W.prototype.getMediaUrl;W.prototype.getClickThroughUrl=W.prototype.xb;W.prototype.isBumper=W.prototype.Nb;W.prototype.getSkipTimeOffset=W.prototype.getSkipTimeOffset;W.prototype.getPosition=W.prototype.getPosition;
9
- W.prototype.getDuration=W.prototype.getDuration;W.prototype.getTitle=W.prototype.getTitle;W.prototype.getAdvertiserName=W.prototype.getAdvertiserName;W.prototype.getAdSystem=W.prototype.getAdSystem;W.prototype.getApiFramework=W.prototype.getApiFramework;W.prototype.getCreativeId=W.prototype.getCreativeId;W.prototype.getId=W.prototype.getId;W.prototype.getTechnology=W.prototype.ob;W.prototype.getAdManagerVersion=W.prototype.ib;W.prototype.getAdManagerName=W.prototype.hb;var mR=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 nR=class{constructor(a){this.a=a}getCuePoints(){return this.a}Eb(){return 0<=this.a.indexOf(0)||0===this.a.length}Db(){return 0<=this.a.indexOf(-1)}};nR.prototype.hasPostroll=nR.prototype.Db;nR.prototype.hasPreroll=nR.prototype.Eb;nR.prototype.getCuePoints=nR.prototype.getCuePoints;var oR=class{constructor(a){var b=a.Sc("ima");if(!b)throw Error("IMA plugin not created.");var c=b.zc(),d=b.h;b=b.a;if(!c||!d||!b)throw Error("IMA plugin not initialized.");const e=a.getSurface().getMedia();if(!e)throw Error("Missing media element.");this.m=a;this.C=e;a=this.m.getConfiguration();a=_.Pg(a.ima||{});this.L=a=_.Og({disableCustomPlayback:!1},a);this.K=c;this.S=d;this.A=b;this.O=new _.Ju;this.g=new _.R("clpp.ima");this.j=this.a=null;this.f=new _.xn;this.J=!1;this.B=new _.Rs;this.Pa=new mR;
10
- this.F=null;this.R=this.I=this.G=this.H=!1;this.M=this.l=null;c=this.B;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.A,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.fc.bind(this));c.on(this.A,d,this.ec.bind(this));c.on(this.m,_.Td,this.jc.bind(this))}fc(a){this.a=a.getAdsManager(this.C,bR(this));this.a.isCustomPlaybackUsed()&&!cR(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.G(1,9,10002)),this.h()):(this.j=
11
- new _.Hu(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.l=new nR(a),this.m.trigger(new _.C(_.vc,{adsTimeline:this.l})),dR(this));this.f.resolve()}ec(a){eR(this,a.getError());this.f.resolve()}Bc(a){const b=this;return _.w(function*(){b.I=!0;if(cR(b)){b.M=b.m.getPosition();yield b.m.detach();var c=b.m;c.a&&c.a.stopForwardingEventsTo(c)}else yield b.m.pause(),_.Oo(b.C,{visibility:_.$d});fR(b,_.bc,a);b.j.start()})}Qa(){const a=
12
- this;return _.w(function*(){a.a.start()})}Z(a){a.getAd().isLinear()?fR(this,_.lc,a):(this.a.discardAdBreak(),this.H||(this.H=!0,this.m.play()))}da(a){this.F=a.getAd().getDuration();fR(this,_.rc,a);this.m.getSurface().show(this.K)}Ha(a){a=a.getAdData();eR(this,a?a.adError:null);gR(this)}bc(a){fR(this,_.oc,a)}Ra(a){fR(this,_.dc,a)}X(a){fR(this,_.gc,a)}wb(a){fR(this,_.mc,a)}ia(a){fR(this,_.tc,a)}Kb(a){fR(this,_.nc,a)}cc(a){fR(this,_.pc,a)}V(a){this.pause();fR(this,_.ec,a)}ba(a){fR(this,_.qc,a);gR(this)}Y(a){fR(this,
13
- _.kc,a)}Sa(a){fR(this,_.fc,a);gR(this)}Dc(){const a=this;return _.w(function*(){a.H=!0;if(cR(a)&&null!==a.M){var b=a.m;b.a&&b.a.forwardEventsTo(b);yield _.Yq(a.m);a.G||(yield a.m.seek(a.M))}else{if(!a.I)return a.m.play();hR(a)}a.I=!1;a.j&&a.j.stop();a.G||(yield a.m.play());fR(a,_.cc)})}hc(){this.R=!0}jc(){this.G=!0;this.A.contentComplete()}load(){const a=this;return _.w(function*(){var b=a.m;const c=a.L;try{if(typeof c.adTagUrl!==_.Pf)throw new _.G(1,9,10001,{missingKeys:"adTagUrl"});}catch(f){return b.onError(f),
14
- a.f.resolve(),a.f}if(!c.adTagUrl)return a.f.resolve(),a.f;b=yield a.O.canPlay(!1);const d=yield a.O.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);a.A.getSettings().setAutoPlayAdBreaks(!1);a.A.requestAds(e);return a.f})}start(a){const b=this;return _.w(function*(){b.a&&b.l&&!b.J?b.l.Eb()?yield jR(b):yield kR(b,a):yield a.play()})}w(){}o(){return!0}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&this.a.skip()}getVolume(){return this.a?
15
- this.a.getVolume():1}setVolume(a){this.a&&this.a.setVolume(a)}getPosition(){if(!this.a||null===this.F)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.F-a}h(){return(new Promise(a=>{this.J&&this.l&&this.l.Db()&&!this.R?(this.B.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m.getSurface().hide(this.K)}),_.qh(this.B,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.A.contentComplete()})).then(()=>
16
- {hR(this);this.B.release();this.j&&(this.j.stop(),this.j=null);this.a&&(this.a.destroy(),this.a=null)})}};oR.prototype.getPosition=oR.prototype.getPosition;oR.prototype.setVolume=oR.prototype.setVolume;oR.prototype.getVolume=oR.prototype.getVolume;oR.prototype.skip=oR.prototype.skip;oR.prototype.pause=oR.prototype.pause;oR.prototype.resume=oR.prototype.resume;var pR=class extends _.Ru{constructor(){super();this.a=this.h=this.f=null}onPlayerCreated(a){if(lR())return a.onError(new _.G(1,9,1E4));this.f=_.Mo(_.Ed,{"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)}Fg(){return this.a}Dg(){return this.h}zc(){return this.f}id(){return"ima"}};_.x("clpp.ima.ImaPlugin",pR);pR.prototype.getAdContainer=pR.prototype.zc;pR.prototype.getAdDisplayContainer=pR.prototype.Dg;pR.prototype.getAdsLoader=pR.prototype.Fg;pR.Id="ima";pR.isSdkMissing=lR;_.Hq(new class{create(){return new pR}});_.Ko(new class{constructor(){this.f=new _.R(aR)}name(){return aR}a(a,b){return a.namespace()===_.jd?!1:lR()?(this.f.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new oR(a)}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var JR="clpp.ima.AdsManagerFactory",KR=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===_.Pc?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
+ _.Pc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},LR=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.tk()},MR=function(a){const b=a.a,c=a.J,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Sa.bind(a));c.on(b,d.LOADED,a.Y.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.hc.bind(a));c.on(b,d.STARTED,a.ba.bind(a));c.on(b,d.LOG,a.Va.bind(a));c.on(b,d.AD_PROGRESS,a.Kb.bind(a));c.on(b,d.AD_BUFFERING,a.Ta.bind(a));
3
+ c.on(b,d.FIRST_QUARTILE,a.V.bind(a));c.on(b,d.MIDPOINT,a.Ja.bind(a));c.on(b,d.THIRD_QUARTILE,a.ca.bind(a));c.on(b,d.PAUSED,a.xb.bind(a));c.on(b,d.RESUMED,a.bc.bind(a));c.on(b,d.CLICK,a.S.bind(a));c.on(b,d.SKIPPED,a.Z.bind(a));c.on(b,d.IMPRESSION,a.X.bind(a));c.on(b,d.COMPLETE,a.Ua.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.jc.bind(a))},NR=function(a,b){const c=b?a.ga.create(b.getErrorCode()):null;a.m.onError(new _.I(1,9,10003,{errorType:c},b))},OR=function(a,b,c){c=c&&c.getAd();let d=null;c&&(d=
4
+ {ad:new W(c,a.G,a.F)});a.m.trigger(new _.E(b,d))},PR=function(a){a.B=null;OR(a,_.sc);a.m.getSurface().hide(a.O)},QR=function(a){_.Vo(a.A,{visibility:"visible"})},SR=function(a){return _.x(function*(){a.R.initialize();const b=!!a.m.getConfiguration().muted;(yield a.L.canPlay(b))||LR(a)?RR(a):(OR(a,_.Nc),a.g.warn(_.ia))})},TR=function(a,b){return _.x(function*(){a.R.initialize();yield b.play();RR(a)})},RR=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();
5
+ a.M=!0},UR=function(){return!window.google||!google.ima||!google.ima.AdsLoader},W=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c}kb(){return"Google IMA SDK"}lb(){return google.ima.VERSION}pb(){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()}getPosition(){return 0}getSkipTimeOffset(){return this.a.getSkipTimeOffset()}Nb(){return this.f?
6
+ this.f.getIsBumper():!1}nb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Ce&&typeof b[d].clickThroughUrl===_.Of);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}bb(){return this.a.getVastMediaWidth()}ab(){return this.a.getVastMediaHeight()}Na(){return this.a.getVastMediaBitrate()}Oa(){return this.h?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Bb(){return this.f?this.f.getTimeOffset():0}Cb(){return this.f?this.f.getAdPosition():
7
+ 1}cb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};W.prototype.getWrapperCreativeIds=W.prototype.getWrapperCreativeIds;W.prototype.getWrapperAdSystems=W.prototype.getWrapperAdSystems;W.prototype.getWrapperAdIds=W.prototype.getWrapperAdIds;W.prototype.getSequenceLength=W.prototype.cb;W.prototype.getPositionInSequence=W.prototype.Cb;
8
+ W.prototype.getPodTimeOffset=W.prototype.Bb;W.prototype.getPodIndex=W.prototype.getPodIndex;W.prototype.getPodType=W.prototype.Oa;W.prototype.getMediaBitrate=W.prototype.Na;W.prototype.getMediaHeight=W.prototype.ab;W.prototype.getMediaWidth=W.prototype.bb;W.prototype.getMediaUrl=W.prototype.getMediaUrl;W.prototype.getClickThroughUrl=W.prototype.nb;W.prototype.isBumper=W.prototype.Nb;W.prototype.getSkipTimeOffset=W.prototype.getSkipTimeOffset;W.prototype.getPosition=W.prototype.getPosition;
9
+ W.prototype.getDuration=W.prototype.getDuration;W.prototype.getTitle=W.prototype.getTitle;W.prototype.getAdvertiserName=W.prototype.getAdvertiserName;W.prototype.getAdSystem=W.prototype.getAdSystem;W.prototype.getApiFramework=W.prototype.getApiFramework;W.prototype.getCreativeId=W.prototype.getCreativeId;W.prototype.getId=W.prototype.getId;W.prototype.getTechnology=W.prototype.pb;W.prototype.getAdManagerVersion=W.prototype.lb;W.prototype.getAdManagerName=W.prototype.kb;var VR=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 WR=class{constructor(a){this.a=a}getCuePoints(){return this.a}Eb(){return 0<=this.a.indexOf(0)||0===this.a.length}Db(){return 0<=this.a.indexOf(-1)}};WR.prototype.hasPostroll=WR.prototype.Db;WR.prototype.hasPreroll=WR.prototype.Eb;WR.prototype.getCuePoints=WR.prototype.getCuePoints;var YR=class{constructor(a){var b=a.Qc("ima");if(!b)throw Error("IMA plugin not created.");var c=b.zc(),d=b.h;b=b.a;if(!c||!d||!b)throw Error("IMA plugin not initialized.");const e=a.getSurface().getMedia();if(!e)throw Error("Missing media element.");this.m=a;this.A=e;a=this.m.getConfiguration();a=_.Qg(a.ima||{});this.I=a=_.Pg({disableCustomPlayback:!1},a);this.O=c;this.R=d;this.w=b;this.L=new _.Tu;this.g=new _.S("clpp.ima");this.j=this.a=null;this.f=new _.Cn;this.M=!1;this.J=new _.bt;this.ga=new VR;
10
+ this.B=null;this.H=this.F=this.G=!1;this.K=this.C=null;c=this.J;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.w,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.ec.bind(this));c.on(this.w,d,this.cc.bind(this));c.on(this.m,_.Td,this.fc.bind(this))}ec(a){this.a=a.getAdsManager(this.A,KR(this));this.a.isCustomPlaybackUsed()&&!LR(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.I(1,9,10002)),this.h()):(this.j=new _.Ru(this.m.getSurface(),
11
+ (b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.C=new WR(a),this.m.trigger(new _.E(_.vc,{adsTimeline:this.C})),MR(this));this.f.resolve()}cc(a){NR(this,a.getError());this.f.resolve()}hc(a){const b=this;return _.x(function*(){b.H=!0;if(LR(b)){b.K=b.m.getPosition();yield b.m.detach();var c=b.m;c.a&&c.a.stopForwardingEventsTo(c)}else yield b.m.pause(),_.Vo(b.A,{visibility:_.Zd});OR(b,_.bc,a);b.j.start()})}Sa(){const a=this;return _.x(function*(){a.a.start()})}Y(a){a.getAd().isLinear()?
12
+ OR(this,_.kc,a):(this.a.discardAdBreak(),this.G||(this.G=!0,this.m.play()))}ba(a){this.B=a.getAd().getDuration();OR(this,_.rc,a);this.m.getSurface().show(this.O)}Va(a){a=a.getAdData();NR(this,a?a.adError:null);PR(this)}Kb(a){OR(this,_.nc,a)}Ta(a){OR(this,_.dc,a)}V(a){OR(this,_.gc,a)}Ja(a){OR(this,_.lc,a)}ca(a){OR(this,_.tc,a)}xb(a){OR(this,_.mc,a)}bc(a){OR(this,_.oc,a)}S(a){this.pause();OR(this,_.ec,a)}Z(a){OR(this,_.qc,a);PR(this)}X(a){OR(this,_.jc,a)}Ua(a){OR(this,_.fc,a);PR(this)}jc(){const a=
13
+ this;return _.x(function*(){a.G=!0;if(LR(a)&&null!==a.K){var b=a.m;b.a&&b.a.forwardEventsTo(b);yield _.ir(a.m);a.F||(yield a.m.seek(a.K))}else{if(!a.H)return a.m.play();QR(a)}a.H=!1;a.j&&a.j.stop();a.F||(yield a.m.play());OR(a,_.cc)})}fc(){this.F=!0;this.w.contentComplete()}load(){const a=this;return _.x(function*(){var b=a.m;const c=a.I;try{if(typeof c.adTagUrl!==_.Of)throw new _.I(1,9,10001,{missingKeys:"adTagUrl"});}catch(f){return b.onError(f),a.f.resolve(),a.f}if(!c.adTagUrl)return a.f.resolve(),
14
+ a.f;b=yield a.L.canPlay(!1);const d=yield a.L.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);a.w.getSettings().setAutoPlayAdBreaks(!1);a.w.requestAds(e);return a.f})}start(a){const b=this;return _.x(function*(){b.a&&b.C&&!b.M?b.C.Eb()?yield SR(b):yield TR(b,a):yield a.play()})}o(){}l(){return!0}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&&
15
+ 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}h(){this.a&&(this.a.destroy(),this.a=null);QR(this);this.J.release();this.j&&(this.j.stop(),this.j=null);return Promise.resolve()}};YR.prototype.getPosition=YR.prototype.getPosition;YR.prototype.setVolume=YR.prototype.setVolume;YR.prototype.getVolume=YR.prototype.getVolume;YR.prototype.skip=YR.prototype.skip;YR.prototype.pause=YR.prototype.pause;YR.prototype.resume=YR.prototype.resume;var ZR=class extends _.av{constructor(){super();this.a=this.h=this.f=null}onPlayerCreated(a){if(UR())return a.onError(new _.I(1,9,1E4));this.f=_.To(_.Ed,{"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&&
16
+ (this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}Ig(){return this.a}Gg(){return this.h}zc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",ZR);ZR.prototype.getAdContainer=ZR.prototype.zc;ZR.prototype.getAdDisplayContainer=ZR.prototype.Gg;ZR.prototype.getAdsLoader=ZR.prototype.Ig;ZR.Id="ima";ZR.isSdkMissing=UR;_.Qq(new class{create(){return new ZR}});_.Ro(new class{constructor(){this.f=new _.S(JR)}name(){return JR}a(a,b){return a.namespace()===_.jd?!1:UR()?(this.f.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new YR(a)}});};f.call(g, window);