@castlabs/prestoplay 6.23.0 → 6.24.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 +23 -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 +116 -116
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +606 -592
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +87 -81
  10. package/cjs/cl.externs.js +94 -30
  11. package/cjs/cl.freewheel.js +25 -24
  12. package/cjs/cl.hls.js +73 -70
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +23 -23
  16. package/cjs/cl.mse.js +347 -333
  17. package/cjs/cl.muxdata.js +15 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +15 -14
  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 +26 -26
  25. package/cjs/cl.tizen.js +72 -72
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -12
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +37 -37
  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 -88
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +492 -479
  39. package/cl.crypto.js +9 -9
  40. package/cl.dash.js +81 -76
  41. package/cl.externs.js +94 -30
  42. package/cl.freewheel.js +19 -19
  43. package/cl.hls.js +75 -74
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +17 -17
  47. package/cl.mse.js +309 -298
  48. package/cl.muxdata.js +13 -13
  49. package/cl.onboard.js +4 -4
  50. package/cl.persistent.js +10 -10
  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 -3
  63. package/cl.youbora.js +28 -28
  64. package/package.json +1 -1
  65. package/typings.d.ts +44 -10
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 XS="Unsupported unit",YS="clpp-text-plain",ZS="clpp-text-ttml",$S="clpp.htmlcue.HtmlTextDisplayer",aT="initial",bT=function(a){return _.ai(a,{pf:(b,c)=>b.Ac(c)})},cT=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)},dT=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},eT=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},gT=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>fT[c]);return a},iT=function(a,b){hT(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{hT(a,c)})},hT=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},jT=function(a,b){return 0===a?"0":a+b},kT=function(a,b){return 1>Math.abs(a-b)||a<b},lT=function(a,b){return a<b&&1<Math.abs(a-b)},mT=function(a,b){return a>b&&1<Math.abs(a-b)},nT=
3
- function(a,b){return 1>Math.abs(a-b)||a>b},pT=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 oT(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
- d-e)},qT=function(a){return new oT(a.left,a.f,a.top,a.a,a.height,a.width)},rT=function(a,b){return b.some(c=>lT(a.left,c.f)&&mT(a.f,c.left)&&lT(a.top,c.a)&&mT(a.a,c.top))},sT=function(a,b){return nT(a.top,b.top)&&kT(a.a,b.a)&&nT(a.left,b.left)&&kT(a.f,b.f)},tT=function(a,b,c){switch(c){case "+x":return lT(a.left,b.left);case "-x":return mT(a.f,b.f);case "+y":return lT(a.top,b.top);case "-y":return mT(a.a,b.a);default:throw Error("Unknown axis");}},uT=function(a){return a.f.writingMode===_.wt},vT=
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 uT(a)?b:c},wT=function(a){switch(a.f.writingMode){case _.wt:return"horizontal-tb";case _.ng:return _.ng;case _.og:return _.og;default:throw Error("Unknown writing mode");}},xT=function(a){switch(a.f.positionAlign){case _.le:return _.ie;case "auto":case _.cd:return _.vt;case _.me:return _.Df}return a.f.textAlign},yT=function(a,b){if(typeof a.f.position===_.t&&typeof a.f.size===
6
- _.t)switch(b){case _.le:return a.f.position;case "auto":case _.cd:return a.f.position-a.f.size/2;case _.me:return a.f.position-a.f.size}return 0},zT=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ie:case _.ie:return _.le;case _.vt:return _.cd;case _.Df:case _.Df:return _.me}return a.f.positionAlign},CT=function(a,b,c){return(AT(a)||BT(a))&&_.ch(c)?jT(c,_.wf):AT(a)&&_.B(c)?jT(0,_.wf):uT(a)&&_.ch(b)?jT(b,"%"):aT},DT=function(a,b,c){return uT(a)&&_.ch(c)?jT(c,_.wf):(AT(a)||BT(a))&&_.ch(b)?
7
- jT(b,"%"):aT},BT=function(a){return a.f.writingMode===_.og},AT=function(a){return a.f.writingMode===_.ng},ET=function(a,b){if(a.j)switch(b.writingMode){case _.wt:return["-y"];case _.ng:return["+x"];case _.og:return["-x"]}a=[];switch(b.writingMode){case _.wt:a=["+y","-y"];break;case _.ng:a=["+x","-x"];break;case _.og:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},FT=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=pT(a.l.a)},GT=function(a,b,c){a=a.f;const d=
8
- a.viewportAnchorUnits;if(d===_.Dt)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(XS);},IT=function(a,b,c,d){const e=document.createElement(_.Wf),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);HT(a,c,b);a.g.debug(`Created HTML style element #${b}.`);return e.sheet},JT=function(a,b){a=`.${a.j} .clpp-text-container`;const c=`${a} .clpp-text-cue`;return b=b.replace(/::cue\((#[^)]+)\)/g,
9
- `${a} $1`).replace(/::cue\(([^)]+)\)/g,`${c} $1`).replace(/::cue-region\(([^)]+)\)/g,`${a} $1 .clpp-text-cue`).replace(/::cue/g,c).replace(/::cue-region/g,`${a} .clpp-text-cue-region .clpp-text-cue`).replace(/::ttml/g,a)},KT=function(a,b){let c=!1;try{a.f.insertRule(b,0);const d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(e=>0===e.trim().indexOf(`.${a.j} `)))}catch(d){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},LT=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);
10
- a.o=[]}},HT=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())},MT=function(a){a=_.Wg(a.htmlcue||{});_.B(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.B(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},ST=function(a,b){if((b||a.l)&&a.F){var c=a.m.getPosition();
11
- if(b||a.J!==c&&a.m.getState()===_.Oo)if(a.J=c,c=NT(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,OT(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.mt(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 _.yg:g="clpp-text-vtt";break;case _.cg:g=ZS;break;case _.ut:g=YS}g&&!f.classList.contains(g)&&
12
- _.ip(f,g);f=pT(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{hT({fontSize:PT(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.yg;var h=d.payloadType===_.cg;d.region&&(g||h||d.backgroundImage)&&(c.B.has(d.region.id)?f=c.B.get(d.region.id):(f=new QT(d.region,{}),c.B.set(d.region.id,f),c.a.appendChild(f)));d=new RT(d,c.L,e);f?f.appendChild(d):
13
- c.a.appendChild(d)}}}}},TT=function(a){OT(a);a.J=null;a.o=null;a.f=[]},UT=function(a,b){return a.startTime<=b&&a.endTime>b},NT=function(a,b){var c=dT(a.f,d=>UT(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&UT(a.f[d-1],b);)d--;for(;c+1<a.f.length&&UT(a.f[c+1],b);)c++;return{start:d,end:c}}},OT=function(a){a.B.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(ZS);b.classList.remove(YS);a=a.a;FT(a.h);a.l=[]}},PT=function(a,
14
- b){const c=pT(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`},YT=class{parse(a){a={input:a};const b=_.kp(_.Hd),c=[];let d=b;for(var e;null!==(e=eT(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=
15
- e[1];var g=e[3];var h=VT[f];h?(h=_.kp(h),(f=WT[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||XT[g.localName]&&XT[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(gT(e)));return b}},VT={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},WT={v:"voice",lang:"lang"},XT={rt:"ruby"},fT={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f",
16
- "\x26nbsp;":"\u00a0"};var oT=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 ZT=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 RT=class extends ZT{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)_.ip(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===_.cg){var c=_.kp(_.Hd);c.innerHTML=b.payload;b=c}else b.payloadType===
17
- _.yg?b=(new YT).parse(b.payload):(c=_.kp(_.Hd),c.textContent=b.payload,b=c);_.ip(b,this.w);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.ip(b,d);hT({writingMode:wT(this)},b);var d=b;this.a.appendChild(d);_.ip(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.ip(this.a,`clpp-text-wrapper__${e}`);_.B(this.f.line)&&(this.f.lineInterpretation=_.xt,this.f.line=uT(this)?-1:0);e=wT(this);hT({writingMode:e,webkitWritingMode:e,direction:aT,textAlign:xT(this)},this.a);if(!this.f.region||
18
- !this.f.region.displayAlign){e=yT(this,zT(this));hT({position:"absolute",left:CT(this,e,null),right:BT(this)&&_.B(null)?jT(0,_.wf):aT,top:DT(this,e,null),width:uT(this)?jT(this.f.size,"%"):aT,height:AT(this)||BT(this)?jT(this.f.size,"%"):aT},this.a);b=this.f;a=uT(this)?a.height:a.width;c=vT(this);if(b.lineInterpretation===_.xt){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 _.cd:g-=f/2;break;case _.Xd:g-=f}f=Math.round(g/
19
- 100*a)}BT(this)&&(f=a-f-c);a=f;hT({left:CT(this,e,a),right:BT(this)&&_.B(a)?jT(0,_.wf):aT,top:DT(this,e,a)},this.a)}iT(this.C,d)}}o(){return _.kp(_.Hd)}};var $T=class{constructor(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=pT(a.a);this.h=[]}append(a){const b=a.a;b.style.visibility=_.de;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=pT(a.a);var d=ET(this,a.f),e=vT(a);const g=qT(c);let h=null,k=0;for(const l of d){for(;tT(c,this.a,l)||sT(c,this.a)&&rT(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||sT(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=qT(c),k=d);c=qT(g)}c=h||g}hT({top:jT(c.top-this.a.top,_.wf),bottom:jT(this.a.a-c.a,_.wf),left:jT(c.left-this.a.left,_.wf),right:jT(this.a.f-c.f,_.wf),height:jT(c.height,_.wf),width:jT(c.width,_.wf)},a.a)}b.style.visibility="visible";this.h.push(pT(a.a))}};var aU=class extends ZT{constructor(a,b,c){super(a,b,c);this.h=null;this.l=[]}init(){this.h=new $T(this);this.j=!0}o(){const a=_.kp(_.Hd);_.ip(a,this.w);this.id&&(a.id=this.id);return a}appendChild(a){FT(this.h);this.l.unshift(a);for(const b of this.l)this.h.append(b)}};var QT=class extends aU{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 _.Dt:b=b.width/100*a.width;break a;default:throw Error(XS);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Dt)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(XS);d=a.height;const e=GT(this,d,a.height);hT(this.B,this.a);hT({left:jT(c,_.wf),top:jT(e,_.wf),width:jT(b,
21
- _.wf),height:jT(d,_.wf)},this.a);this.f.writingMode&&hT({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&hT({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.ip(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.Dt:f=f.height/100*a.height;break a;case 2:f=f.height;c=new RT(new _.At(0,1,"Lorem ipsum",_.ut),{},{});b=c.a;this.a.appendChild(b);c.init(pT(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
- b=c;f*=b;break a;default:throw Error(XS);}a=GT(this,f,a.height);hT({top:jT(a,_.wf),height:jT(f,_.wf)},this.a);this.h=new $T(this,!0);this.j=!0}getId(){return this.f.id}};var bU=class{constructor(a,b){this.g=new _.S("clpp.htmlcue.StyleManager");this.l=[];this.j=a;this.h=b;this.o=[];this.a=IT(this,this.h,this.j);this.f=IT(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=JT(this,a);if(KT(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=[],LT(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 cU=class extends _.ov{constructor(a){super(a);this.g=new _.S($S);this.m=a;this.L=MT(a.getConfiguration());this.l=!1;this.f=[];this.F=a.getSurface().getContainer();this.j=new bU(a.getSurface().getUniqueCssClass(),"CLPP Subtitle Styles");this.a=new aU(null,"clpp-text-container",{});this.A=new _.hv(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 _.yk(()=>{ST(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=cT(this.f,bT(a));this.o=null;ST(this,!1)}}h(){null==this.j||ST(this,!0)}destroy(){const a=this;return _.x(function*(){null!=a.j&&(TT(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;ST(this,!0);return!0}isTextVisible(){return this.l}setTextVisibility(a){null!=this.j&&this.l!==a&&((this.l=a)?(this.G.xb(.25),this.L.enableResizeObserver&&this.A.start(),ST(this,!0)):(this.G.stop(),this.A.stop(),TT(this)))}S(){ST(this,!0)}};_.y($S,cU);cU.prototype.setTextVisibility=cU.prototype.setTextVisibility;cU.prototype.isTextVisible=cU.prototype.isTextVisible;cU.prototype.remove=cU.prototype.remove;cU.prototype.destroy=cU.prototype.destroy;
26
- cU.prototype.append=cU.prototype.append;var dU=class{a(a){return!!a.enableHtmlCue&&!_.Ok()}create(a){return new cU(a)}};_.y("clpp.htmlcue.HtmlCueComponent",class extends _.Ru{f(){_.so(_.ee,new dU)}a(){_.qo.has(_.ee)&&(_.qo.delete(_.ee),_.ro.info("Removed factory: 'html'"))}id(){return _.Xf}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var aU="Unsupported unit",bU="clpp-text-plain",cU="clpp-text-ttml",dU="clpp.htmlcue.HtmlTextDisplayer",eU="initial",fU=function(a){return _.si(a,{Hf:(b,c)=>b.Mc(c)})},gU=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)},hU=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},iU=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},kU=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>jU[c]);return a},mU=function(a,b){lU(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{lU(a,c)})},lU=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},nU=function(a,b){return 0===a?"0":a+b},oU=function(a,b){return 1>Math.abs(a-b)||a<b},pU=function(a,b){return a<b&&1<Math.abs(a-b)},qU=function(a,b){return a>b&&1<Math.abs(a-b)},rU=
3
+ function(a,b){return 1>Math.abs(a-b)||a>b},tU=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 sU(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
+ d-e)},uU=function(a){return new sU(a.left,a.f,a.top,a.a,a.height,a.width)},vU=function(a,b){return b.some(c=>pU(a.left,c.f)&&qU(a.f,c.left)&&pU(a.top,c.a)&&qU(a.a,c.top))},wU=function(a,b){return rU(a.top,b.top)&&oU(a.a,b.a)&&rU(a.left,b.left)&&oU(a.f,b.f)},xU=function(a,b,c){switch(c){case "+x":return pU(a.left,b.left);case "-x":return qU(a.f,b.f);case "+y":return pU(a.top,b.top);case "-y":return qU(a.a,b.a);default:throw Error("Unknown axis");}},yU=function(a){return a.f.writingMode===_.Vt},zU=
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 yU(a)?b:c},AU=function(a){switch(a.f.writingMode){case _.Vt:return"horizontal-tb";case _.Eg:return _.Eg;case _.Fg:return _.Fg;default:throw Error("Unknown writing mode");}},BU=function(a){switch(a.f.positionAlign){case _.we:return _.te;case "auto":case _.kd:return _.Ut;case _.Ae:return _.Lf}return a.f.textAlign},CU=function(a,b){if(typeof a.f.position===_.t&&typeof a.f.size===
6
+ _.t)switch(b){case _.we:return a.f.position;case "auto":case _.kd:return a.f.position-a.f.size/2;case _.Ae:return a.f.position-a.f.size}return 0},DU=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.te:case _.te:return _.we;case _.Ut:return _.kd;case _.Lf:case _.Lf:return _.Ae}return a.f.positionAlign},GU=function(a,b,c){return(EU(a)||FU(a))&&_.sh(c)?nU(c,_.Ef):EU(a)&&_.B(c)?nU(0,_.Ef):yU(a)&&_.sh(b)?nU(b,"%"):eU},HU=function(a,b,c){return yU(a)&&_.sh(c)?nU(c,_.Ef):(EU(a)||FU(a))&&_.sh(b)?
7
+ nU(b,"%"):eU},FU=function(a){return a.f.writingMode===_.Fg},EU=function(a){return a.f.writingMode===_.Eg},IU=function(a,b){if(a.j)switch(b.writingMode){case _.Vt:return["-y"];case _.Eg:return["+x"];case _.Fg:return["-x"]}a=[];switch(b.writingMode){case _.Vt:a=["+y","-y"];break;case _.Eg:a=["+x","-x"];break;case _.Fg:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},JU=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=tU(a.l.a)},KU=function(a,b,c){a=a.f;const d=
8
+ a.viewportAnchorUnits;if(d===_.bu)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(aU);},MU=function(a,b,c,d){const e=document.createElement(_.dg),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);LU(a,c,b);a.g.debug(`Created HTML style element #${b}.`);return e.sheet},NU=function(a,b){a=`.${a.j} .clpp-text-container`;const c=`${a} .clpp-text-cue`;return b=b.replace(/::cue\((#[^)]+)\)/g,
9
+ `${a} $1`).replace(/::cue\(([^)]+)\)/g,`${c} $1`).replace(/::cue-region\(([^)]+)\)/g,`${a} $1 .clpp-text-cue`).replace(/::cue/g,c).replace(/::cue-region/g,`${a} .clpp-text-cue-region .clpp-text-cue`).replace(/::ttml/g,a)},OU=function(a,b){let c=!1;try{a.f.insertRule(b,0);const d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(e=>0===e.trim().indexOf(`.${a.j} `)))}catch(d){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},PU=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);
10
+ a.o=[]}},LU=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())},QU=function(a){a=_.lh(a.htmlcue||{});_.B(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.B(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},WU=function(a,b){if((b||a.l)&&a.F){var c=a.m.getPosition();
11
+ if(b||a.J!==c&&a.m.getState()===_.jp)if(a.J=c,c=RU(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,SU(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Jt(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 _.Mg:g="clpp-text-vtt";break;case _.qg:g=cU;break;case _.Tt:g=bU}g&&!f.classList.contains(g)&&
12
+ _.Dp(f,g);f=tU(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{lU({fontSize:TU(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.Mg;var h=d.payloadType===_.qg;d.region&&(g||h||d.backgroundImage)&&(c.B.has(d.region.id)?f=c.B.get(d.region.id):(f=new UU(d.region,{}),c.B.set(d.region.id,f),c.a.appendChild(f)));d=new VU(d,c.L,e);f?f.appendChild(d):
13
+ c.a.appendChild(d)}}}}},XU=function(a){SU(a);a.J=null;a.o=null;a.f=[]},YU=function(a,b){return a.startTime<=b&&a.endTime>b},RU=function(a,b){var c=hU(a.f,d=>YU(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&YU(a.f[d-1],b);)d--;for(;c+1<a.f.length&&YU(a.f[c+1],b);)c++;return{start:d,end:c}}},SU=function(a){a.B.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(cU);b.classList.remove(bU);a=a.a;JU(a.h);a.l=[]}},TU=function(a,
14
+ b){const c=tU(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`},bV=class{parse(a){a={input:a};const b=_.Fp(_.Sd),c=[];let d=b;for(var e;null!==(e=iU(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=
15
+ e[1];var g=e[3];var h=ZU[f];h?(h=_.Fp(h),(f=$U[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||aV[g.localName]&&aV[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(kU(e)));return b}},ZU={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},$U={v:"voice",lang:"lang"},aV={rt:"ruby"},jU={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f",
16
+ "\x26nbsp;":"\u00a0"};var sU=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 cV=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 VU=class extends cV{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)_.Dp(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===_.qg){var c=_.Fp(_.Sd);c.innerHTML=b.payload;b=c}else b.payloadType===
17
+ _.Mg?b=(new bV).parse(b.payload):(c=_.Fp(_.Sd),c.textContent=b.payload,b=c);_.Dp(b,this.w);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.Dp(b,d);lU({writingMode:AU(this)},b);var d=b;this.a.appendChild(d);_.Dp(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.Dp(this.a,`clpp-text-wrapper__${e}`);_.B(this.f.line)&&(this.f.lineInterpretation=_.Wt,this.f.line=yU(this)?-1:0);e=AU(this);lU({writingMode:e,webkitWritingMode:e,direction:eU,textAlign:BU(this)},this.a);if(!this.f.region||
18
+ !this.f.region.displayAlign){e=CU(this,DU(this));lU({position:"absolute",left:GU(this,e,null),right:FU(this)&&_.B(null)?nU(0,_.Ef):eU,top:HU(this,e,null),width:yU(this)?nU(this.f.size,"%"):eU,height:EU(this)||FU(this)?nU(this.f.size,"%"):eU},this.a);b=this.f;a=yU(this)?a.height:a.width;c=zU(this);if(b.lineInterpretation===_.Wt){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 _.kd:g-=f/2;break;case _.he:g-=f}f=Math.round(g/
19
+ 100*a)}FU(this)&&(f=a-f-c);a=f;lU({left:GU(this,e,a),right:FU(this)&&_.B(a)?nU(0,_.Ef):eU,top:HU(this,e,a)},this.a)}mU(this.C,d)}}o(){return _.Fp(_.Sd)}};var dV=class{constructor(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=tU(a.a);this.h=[]}append(a){const b=a.a;b.style.visibility=_.oe;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=tU(a.a);var d=IU(this,a.f),e=zU(a);const g=uU(c);let h=null,k=0;for(const l of d){for(;xU(c,this.a,l)||wU(c,this.a)&&vU(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||wU(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=uU(c),k=d);c=uU(g)}c=h||g}lU({top:nU(c.top-this.a.top,_.Ef),bottom:nU(this.a.a-c.a,_.Ef),left:nU(c.left-this.a.left,_.Ef),right:nU(this.a.f-c.f,_.Ef),height:nU(c.height,_.Ef),width:nU(c.width,_.Ef)},a.a)}b.style.visibility="visible";this.h.push(tU(a.a))}};var eV=class extends cV{constructor(a,b,c){super(a,b,c);this.h=null;this.l=[]}init(){this.h=new dV(this);this.j=!0}o(){const a=_.Fp(_.Sd);_.Dp(a,this.w);this.id&&(a.id=this.id);return a}appendChild(a){JU(this.h);this.l.unshift(a);for(const b of this.l)this.h.append(b)}};var UU=class extends eV{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 _.bu:b=b.width/100*a.width;break a;default:throw Error(aU);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.bu)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(aU);d=a.height;const e=KU(this,d,a.height);lU(this.B,this.a);lU({left:nU(c,_.Ef),top:nU(e,_.Ef),width:nU(b,
21
+ _.Ef),height:nU(d,_.Ef)},this.a);this.f.writingMode&&lU({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&lU({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.Dp(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.bu:f=f.height/100*a.height;break a;case 2:f=f.height;c=new VU(new _.Zt(0,1,"Lorem ipsum",_.Tt),{},{});b=c.a;this.a.appendChild(b);c.init(tU(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
+ b=c;f*=b;break a;default:throw Error(aU);}a=KU(this,f,a.height);lU({top:nU(a,_.Ef),height:nU(f,_.Ef)},this.a);this.h=new dV(this,!0);this.j=!0}getId(){return this.f.id}};var fV=class{constructor(a,b){this.g=new _.S("clpp.htmlcue.StyleManager");this.l=[];this.j=a;this.h=b;this.o=[];this.a=MU(this,this.h,this.j);this.f=MU(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=NU(this,a);if(OU(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=[],PU(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 gV=class extends _.Uv{constructor(a){super(a);this.g=new _.S(dU);this.m=a;this.L=QU(a.getConfiguration());this.l=!1;this.f=[];this.F=a.getSurface().getContainer();this.j=new fV(a.getSurface().getUniqueCssClass(),"CLPP Subtitle Styles");this.a=new eV(null,"clpp-text-container",{});this.A=new _.Nv(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(()=>{WU(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=gU(this.f,fU(a));this.o=null;WU(this,!1)}}h(){null==this.j||WU(this,!0)}destroy(){const a=this;return _.x(function*(){null!=a.j&&(XU(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;WU(this,!0);return!0}isTextVisible(){return this.l}setTextVisibility(a){null!=this.j&&this.l!==a&&((this.l=a)?(this.G.Eb(.25),this.L.enableResizeObserver&&this.A.start(),WU(this,!0)):(this.G.stop(),this.A.stop(),XU(this)))}S(){WU(this,!0)}};_.z(dU,gV);gV.prototype.setTextVisibility=gV.prototype.setTextVisibility;gV.prototype.isTextVisible=gV.prototype.isTextVisible;gV.prototype.remove=gV.prototype.remove;gV.prototype.destroy=gV.prototype.destroy;
26
+ gV.prototype.append=gV.prototype.append;var hV=class{a(a){return!!a.enableHtmlCue&&!_.bl()}create(a){return new gV(a)}};_.z("clpp.htmlcue.HtmlCueComponent",class extends _.Iv{f(){_.Qo(_.pe,new hV)}a(){_.Oo.has(_.pe)&&(_.Oo.delete(_.pe),_.Po.info("Removed factory: 'html'"))}id(){return _.eg}});};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 HS="clpp.ima.AdsManagerFactory",IS=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===_.Qc?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
- _.Qc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},JS=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Ck()},KS=function(a){const b=a.a,c=a.J,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.za.bind(a));c.on(b,d.LOADED,a.X.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.ic.bind(a));c.on(b,d.STARTED,a.$.bind(a));c.on(b,d.LOG,a.La.bind(a));c.on(b,d.AD_PROGRESS,a.Y.bind(a));c.on(b,d.AD_BUFFERING,a.Ua.bind(a));
3
- c.on(b,d.FIRST_QUARTILE,a.V.bind(a));c.on(b,d.MIDPOINT,a.hb.bind(a));c.on(b,d.THIRD_QUARTILE,a.ea.bind(a));c.on(b,d.PAUSED,a.Ib.bind(a));c.on(b,d.RESUMED,a.Jb.bind(a));c.on(b,d.CLICK,a.S.bind(a));c.on(b,d.SKIPPED,a.ca.bind(a));c.on(b,d.IMPRESSION,a.W.bind(a));c.on(b,d.COMPLETE,a.Va.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.kc.bind(a))},LS=function(a,b){const c=b?a.ya.create(b.getErrorCode()):null;a.m.onError(new _.H(1,9,10003,{errorType:c},b))},MS=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 _.D(b,d))},NS=function(a){a.B=null;MS(a,_.tc);a.m.getSurface().hide(a.O)},OS=function(a){_.jp(a.A,{visibility:"visible"})},QS=function(a){return _.x(function*(){a.R.initialize();const b=!!a.m.getConfiguration().muted;(yield a.L.canPlay(b))||JS(a)?PS(a):(MS(a,_.Oc),a.g.warn(_.ia))})},RS=function(a,b){return _.x(function*(){a.R.initialize();yield b.play();PS(a)})},PS=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();
5
- a.M=!0},SS=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()}Lb(){return""}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()}Ob(){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]===_.He&&typeof b[d].clickThroughUrl===_.Uf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}ab(){return this.a.getVastMediaWidth()}$a(){return this.a.getVastMediaHeight()}Pa(){return this.a.getVastMediaBitrate()}Qa(){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}bb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}Nb(){return null}};W.prototype.getVideoElement=W.prototype.Nb;W.prototype.getWrapperCreativeIds=W.prototype.getWrapperCreativeIds;W.prototype.getWrapperAdSystems=W.prototype.getWrapperAdSystems;W.prototype.getWrapperAdIds=W.prototype.getWrapperAdIds;W.prototype.getSequenceLength=W.prototype.bb;
8
- W.prototype.getPositionInSequence=W.prototype.Cb;W.prototype.getPodTimeOffset=W.prototype.Bb;W.prototype.getPodIndex=W.prototype.getPodIndex;W.prototype.getPodType=W.prototype.Qa;W.prototype.getMediaBitrate=W.prototype.Pa;W.prototype.getMediaHeight=W.prototype.$a;W.prototype.getMediaWidth=W.prototype.ab;W.prototype.getMediaUrl=W.prototype.getMediaUrl;W.prototype.getClickThroughUrl=W.prototype.nb;W.prototype.isBumper=W.prototype.Ob;W.prototype.getSkipTimeOffset=W.prototype.getSkipTimeOffset;
9
- W.prototype.getPosition=W.prototype.getPosition;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.getSourceId=W.prototype.Lb;W.prototype.getCreativeId=W.prototype.getCreativeId;W.prototype.getId=W.prototype.getId;W.prototype.getTechnology=W.prototype.pb;
10
- W.prototype.getAdManagerVersion=W.prototype.lb;W.prototype.getAdManagerName=W.prototype.kb;var TS=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 US=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)}};US.prototype.hasPostroll=US.prototype.Db;US.prototype.hasPreroll=US.prototype.Eb;US.prototype.getCuePoints=US.prototype.getCuePoints;var VS=class{constructor(a){var b=a.Uc("ima");if(!b)throw Error("IMA plugin not created.");var c=b.Bc(),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=_.Wg(a.ima||{});this.I=a=_.Vg({disableCustomPlayback:!1},a);this.O=c;this.R=d;this.w=b;this.L=new _.jv;this.g=new _.S("clpp.ima");this.j=this.a=null;this.f=new _.Mn;this.M=!1;this.J=new _.st;this.ya=new TS;
11
- 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.fc.bind(this));c.on(this.w,d,this.dc.bind(this));c.on(this.m,_.Yd,this.gc.bind(this))}fc(a){this.a=a.getAdsManager(this.A,IS(this));this.a.isCustomPlaybackUsed()&&!JS(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.h()):(this.j=new _.hv(this.m.getSurface(),
12
- (b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.C=new US(a),this.m.trigger(new _.D(_.wc,{adsTimeline:this.C})),KS(this));this.f.resolve()}dc(a){LS(this,a.getError());this.f.resolve()}ic(a){const b=this;return _.x(function*(){b.H=!0;if(JS(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(),_.jp(b.A,{visibility:_.de});MS(b,_.bc,a);b.j.start()})}za(){const a=this;return _.x(function*(){a.a.start()})}X(a){a.getAd().isLinear()?
13
- MS(this,_.lc,a):(this.a.discardAdBreak(),this.G||(this.G=!0,this.m.play()))}$(a){this.B=a.getAd().getDuration();MS(this,_.sc,a);this.m.getSurface().show(this.O)}La(a){a=a.getAdData();LS(this,a?a.adError:null);NS(this)}Y(a){MS(this,_.oc,a)}Ua(a){MS(this,_.dc,a)}V(a){MS(this,_.gc,a)}hb(a){MS(this,_.mc,a)}ea(a){MS(this,_.uc,a)}Ib(a){MS(this,_.nc,a)}Jb(a){MS(this,_.pc,a)}S(a){this.pause();MS(this,_.ec,a)}ca(a){MS(this,_.rc,a);NS(this)}W(a){MS(this,_.kc,a)}Va(a){MS(this,_.fc,a);NS(this)}kc(){const a=this;
14
- return _.x(function*(){a.G=!0;if(JS(a)&&null!==a.K){var b=a.m;b.a&&b.a.forwardEventsTo(b);yield _.zr(a.m);a.F||(yield a.m.seek(a.K))}else{if(!a.H)return a.m.play();OS(a)}a.H=!1;a.j&&a.j.stop();a.F||(yield a.m.play());MS(a,_.cc)})}gc(){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!==_.Uf)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(),
15
- 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 QS(b):yield RS(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&&
16
- 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);OS(this);this.J.release();this.j&&(this.j.stop(),this.j=null);return Promise.resolve()}};VS.prototype.getPosition=VS.prototype.getPosition;VS.prototype.setVolume=VS.prototype.setVolume;VS.prototype.getVolume=VS.prototype.getVolume;VS.prototype.skip=VS.prototype.skip;VS.prototype.pause=VS.prototype.pause;VS.prototype.resume=VS.prototype.resume;var WS=class extends _.rv{constructor(){super();this.a=this.h=this.f=null}onPlayerCreated(a){if(SS())return a.onError(new _.H(1,9,1E4));this.f=_.hp(_.Hd,{"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)}Tg(){return this.a}Rg(){return this.h}Bc(){return this.f}id(){return"ima"}};_.y("clpp.ima.ImaPlugin",WS);WS.prototype.getAdContainer=WS.prototype.Bc;WS.prototype.getAdDisplayContainer=WS.prototype.Rg;WS.prototype.getAdsLoader=WS.prototype.Tg;WS.Id="ima";WS.isSdkMissing=SS;_.gr(new class{create(){return new WS}});_.fp(new class{constructor(){this.f=new _.S(HS)}name(){return HS}a(a,b){return a.namespace()===_.kd?!1:SS()?(this.f.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new VS(a)}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var LT="clpp.ima.AdsManagerFactory",MT=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===_.Zc?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
+ _.Zc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},NT=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Qk()},OT=function(a){const b=a.a,c=a.J,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Aa.bind(a));c.on(b,d.LOADED,a.Y.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.pc.bind(a));c.on(b,d.STARTED,a.ba.bind(a));c.on(b,d.LOG,a.Oa.bind(a));c.on(b,d.AD_PROGRESS,a.$.bind(a));c.on(b,d.AD_BUFFERING,a.Ha.bind(a));
3
+ c.on(b,d.FIRST_QUARTILE,a.V.bind(a));c.on(b,d.MIDPOINT,a.pb.bind(a));c.on(b,d.THIRD_QUARTILE,a.ha.bind(a));c.on(b,d.PAUSED,a.Pb.bind(a));c.on(b,d.RESUMED,a.Qb.bind(a));c.on(b,d.CLICK,a.S.bind(a));c.on(b,d.SKIPPED,a.da.bind(a));c.on(b,d.IMPRESSION,a.W.bind(a));c.on(b,d.COMPLETE,a.Za.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.sc.bind(a))},PT=function(a,b){const c=b?a.va.create(b.getErrorCode()):null;a.m.onError(new _.I(1,9,10003,{errorType:c},b))},QT=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 _.D(b,d))},RT=function(a){a.B=null;QT(a,_.Bc);a.m.getSurface().hide(a.O)},ST=function(a){_.Ep(a.A,{visibility:"visible"})},UT=function(a){return _.x(function*(){a.R.initialize();const b=!!a.m.getConfiguration().muted;(yield a.L.canPlay(b))||NT(a)?TT(a):(QT(a,_.Xc),a.g.warn(_.ja))})},VT=function(a,b){return _.x(function*(){a.R.initialize();yield b.play();TT(a)})},TT=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();
5
+ a.M=!0},WT=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}sb(){return"Google IMA SDK"}tb(){return google.ima.VERSION}xb(){return 0}getId(){return this.a.getAdId()}getCreativeId(){return this.a.getCreativeId()}Sb(){return""}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()}Vb(){return this.f?
6
+ this.f.getIsBumper():!1}ub(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Re&&typeof b[d].clickThroughUrl===_.bg);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}ib(){return this.a.getVastMediaWidth()}hb(){return this.a.getVastMediaHeight()}Ta(){return this.a.getVastMediaBitrate()}Ua(){return this.h?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Ib(){return this.f?this.f.getTimeOffset():0}wb(){return this.f?this.f.getAdPosition():
7
+ 1}jb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}canSeek(){return!1}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}Ub(){return null}};W.prototype.getVideoElement=W.prototype.Ub;W.prototype.getWrapperCreativeIds=W.prototype.getWrapperCreativeIds;W.prototype.getWrapperAdSystems=W.prototype.getWrapperAdSystems;W.prototype.canSeek=W.prototype.canSeek;W.prototype.getWrapperAdIds=W.prototype.getWrapperAdIds;
8
+ W.prototype.getSequenceLength=W.prototype.jb;W.prototype.getPositionInSequence=W.prototype.wb;W.prototype.getPodTimeOffset=W.prototype.Ib;W.prototype.getPodIndex=W.prototype.getPodIndex;W.prototype.getPodType=W.prototype.Ua;W.prototype.getMediaBitrate=W.prototype.Ta;W.prototype.getMediaHeight=W.prototype.hb;W.prototype.getMediaWidth=W.prototype.ib;W.prototype.getMediaUrl=W.prototype.getMediaUrl;W.prototype.getClickThroughUrl=W.prototype.ub;W.prototype.isBumper=W.prototype.Vb;
9
+ W.prototype.getSkipTimeOffset=W.prototype.getSkipTimeOffset;W.prototype.getPosition=W.prototype.getPosition;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.getSourceId=W.prototype.Sb;W.prototype.getCreativeId=W.prototype.getCreativeId;W.prototype.getId=W.prototype.getId;
10
+ W.prototype.getTechnology=W.prototype.xb;W.prototype.getAdManagerVersion=W.prototype.tb;W.prototype.getAdManagerName=W.prototype.sb;var XT=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 YT=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)}};YT.prototype.hasPostroll=YT.prototype.Kb;YT.prototype.hasPreroll=YT.prototype.Lb;YT.prototype.getCuePoints=YT.prototype.getCuePoints;var ZT=class{constructor(a){var b=a.ed("ima");if(!b)throw Error("IMA plugin not created.");var c=b.Nc(),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=_.lh(a.ima||{});this.I=a=_.kh({disableCustomPlayback:!1},a);this.O=c;this.R=d;this.w=b;this.L=new _.Pv;this.g=new _.S("clpp.ima");this.j=this.a=null;this.f=new _.qn;this.M=!1;this.J=new _.Rt;this.va=new XT;
11
+ 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.mc.bind(this));c.on(this.w,d,this.kc.bind(this));c.on(this.m,_.ie,this.nc.bind(this))}mc(a){this.a=a.getAdsManager(this.A,MT(this));this.a.isCustomPlaybackUsed()&&!NT(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 _.Nv(this.m.getSurface(),
12
+ (b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.C=new YT(a),this.m.trigger(new _.D(_.Ec,{adsTimeline:this.C})),OT(this));this.f.resolve()}kc(a){PT(this,a.getError());this.f.resolve()}pc(a){const b=this;return _.x(function*(){b.H=!0;if(NT(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(),_.Ep(b.A,{visibility:_.oe});QT(b,_.hc,a);b.j.start()})}Aa(){const a=this;return _.x(function*(){a.a.start()})}Y(a){a.getAd().isLinear()?
13
+ QT(this,_.rc,a):(this.a.discardAdBreak(),this.G||(this.G=!0,this.m.play()))}ba(a){this.B=a.getAd().getDuration();QT(this,_.yc,a);this.m.getSurface().show(this.O)}Oa(a){a=a.getAdData();PT(this,a?a.adError:null);RT(this)}$(a){QT(this,_.uc,a)}Ha(a){QT(this,_.jc,a)}V(a){QT(this,_.mc,a)}pb(a){QT(this,_.sc,a)}ha(a){QT(this,_.Cc,a)}Pb(a){QT(this,_.tc,a)}Qb(a){QT(this,_.vc,a)}S(a){this.pause();QT(this,_.kc,a)}da(a){QT(this,_.xc,a);RT(this)}W(a){QT(this,_.qc,a)}Za(a){QT(this,_.lc,a);RT(this)}sc(){const a=
14
+ this;return _.x(function*(){a.G=!0;if(NT(a)&&null!==a.K){var b=a.m;b.a&&b.a.forwardEventsTo(b);yield _.es(a.m);a.F||(yield a.m.seek(a.K))}else{if(!a.H)return a.m.play();ST(a)}a.H=!1;a.j&&a.j.stop();a.F||(yield a.m.play());QT(a,_.ic)})}nc(){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!==_.bg)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(),
15
+ 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.Lb()?yield UT(b):yield VT(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&&
16
+ 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);ST(this);this.J.release();this.j&&(this.j.stop(),this.j=null);return Promise.resolve()}};ZT.prototype.getPosition=ZT.prototype.getPosition;ZT.prototype.setVolume=ZT.prototype.setVolume;ZT.prototype.getVolume=ZT.prototype.getVolume;ZT.prototype.skip=ZT.prototype.skip;ZT.prototype.pause=ZT.prototype.pause;ZT.prototype.resume=ZT.prototype.resume;var $T=class extends _.Xv{constructor(){super();this.a=this.h=this.f=null}onPlayerCreated(a){if(WT())return a.onError(new _.I(1,9,1E4));this.f=_.Cp(_.Sd,{"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(_.qa);this.a.getSettings().setPlayerVersion(_.ea);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)}qh(){return this.a}oh(){return this.h}Nc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",$T);$T.prototype.getAdContainer=$T.prototype.Nc;$T.prototype.getAdDisplayContainer=$T.prototype.oh;$T.prototype.getAdsLoader=$T.prototype.qh;$T.Id="ima";$T.isSdkMissing=WT;_.Mr(new class{create(){return new $T}});_.Ap(new class{constructor(){this.Wa=new _.S(LT)}name(){return LT}a(a,b){return a.namespace()===_.td?!1:WT()?(this.Wa.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new ZT(a)}});};f.call(g, window);