@castlabs/prestoplay 6.23.1 → 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 +14 -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 +113 -113
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +608 -591
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +87 -86
  10. package/cjs/cl.externs.js +94 -30
  11. package/cjs/cl.freewheel.js +25 -24
  12. package/cjs/cl.hls.js +73 -71
  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 +344 -339
  17. package/cjs/cl.muxdata.js +15 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -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 +26 -26
  25. package/cjs/cl.tizen.js +71 -71
  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 -478
  39. package/cl.crypto.js +9 -9
  40. package/cl.dash.js +81 -80
  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 +307 -305
  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
@@ -1,28 +1,29 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var tV="clpp-freewheel",uV="clpp.freewheel.AdsManagerFactory",vV="freewheel",wV=function(){this.f=this.a=null},xV=function(){},yV=function(a){switch(a){case 0:return tv.freewheel.SDK.ADUNIT_PREROLL;case 1:return tv.freewheel.SDK.ADUNIT_MIDROLL;case 2:return tv.freewheel.SDK.ADUNIT_POSTROLL;default:return""}},zV=function(a,b,c){this.h=a;this.f=b;this.a=c},AV=function(a){this.a=a},BV=function(a){this.g=new _.K("clpp.freewheel.AdsManager");this.m=a;this.h=new _.Yh;this.w=new tv.freewheel.SDK.AdManager;
3
- this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.l=new _.ok;this.j=null},CV=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.lg&&b.push("serverUrl");typeof a.profileId!==_.lg&&b.push("profileId");typeof a.videoAssetId!==_.lg&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.P(1,9,12001,{missingKeys:b.join(", ")});},DV=function(){var a,b,c,d;return _.I(function(e){if(1==e.a)return a=new _.Gu,b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE,
4
- _.y(e,a.canPlay(!1),2);if(3!=e.a)return c=e.f,_.y(e,a.canPlay(!0),3);d=e.f;c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:d&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return e["return"](b)})},GV=function(a){return _.I(function(b){if(a.B.length)return EV(a),a.f=a.B.shift(),a.f.play(),b.F(0);FV(a);return _.y(b,a.m.a.play(),0)})},HV=function(a){a.A.length?(EV(a),a.f=a.A.shift(),a.f.play()):FV(a)},EV=function(a){var b=a.m.ce(vV).ld();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),
5
- a.a.registerVideoDisplayBase(tV),a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},FV=function(a){var b=a.m.ce(vV).ld();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},IV=function(a,b,c){var d=null;a.a&&c&&(c.adInstance||c.slot)&&(c=(d=c.adInstance||null)?d.getSlot():c.slot,d={ad:new zV(a.a,c,d)});a.m.trigger(new _.L(b,d))},JV=function(){this.sd=new _.K(uV)};_.x(wV,_.Lv);_.t=wV.prototype;
6
- _.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.ir(_.Zd,{id:tV}),this.f=_.ir(_.r,{"class":_.vd}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.P(1,9,12E3))};_.t.onPlayerWillDestroy=function(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)};_.t.id=function(){return vV};_.t.ld=function(){return this.a};_.t.Ll=function(){return this.f};
7
- _.J("clpp.freewheel.FreeWheelPlugin",wV);wV.prototype.getAdVideo=wV.prototype.Ll;wV.prototype.getAdContainer=wV.prototype.ld;wV.Id=vV;wV.AD_CONTAINER_ID=tV;xV.prototype.create=function(){return new wV};_.Ht(new xV);_.t=zV.prototype;_.t.sb=function(){return"FreeWheel AdManager SDK"};_.t.tb=function(){return tv.freewheel.SDK.version};_.t.wb=function(){return 0};_.t.getId=function(){return this.a?this.a.getAdId():""};_.t.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.lg?a:""};_.t.Xb=function(){return""};_.t.getApiFramework=function(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""};_.t.getAdSystem=function(){return""};_.t.getAdvertiserName=function(){return""};
8
- _.t.getTitle=function(){return""};_.t.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.t.getPosition=function(){return 0};_.t.getSkipTimeOffset=function(){return 0};_.t.ac=function(){return!1};_.t.ub=function(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""};_.t.getMediaUrl=function(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""};
9
- _.t.jb=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.t.ib=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.t.Ta=function(){return 0};_.t.Ua=function(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}};
10
- _.t.getPodIndex=function(){switch(this.Ua()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.t.Jb=function(){switch(this.Ua()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.t.Kb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.t.kb=function(){return this.f.getAdCount()};_.t.getWrapperAdIds=function(){return[]};_.t.getWrapperAdSystems=function(){return[]};
11
- _.t.getWrapperCreativeIds=function(){return[]};_.t.$b=function(){return null};zV.prototype.getVideoElement=zV.prototype.$b;zV.prototype.getWrapperCreativeIds=zV.prototype.getWrapperCreativeIds;zV.prototype.getWrapperAdSystems=zV.prototype.getWrapperAdSystems;zV.prototype.getWrapperAdIds=zV.prototype.getWrapperAdIds;zV.prototype.getSequenceLength=zV.prototype.kb;zV.prototype.getPositionInSequence=zV.prototype.Kb;zV.prototype.getPodTimeOffset=zV.prototype.Jb;zV.prototype.getPodIndex=zV.prototype.getPodIndex;
12
- zV.prototype.getPodType=zV.prototype.Ua;zV.prototype.getMediaBitrate=zV.prototype.Ta;zV.prototype.getMediaHeight=zV.prototype.ib;zV.prototype.getMediaWidth=zV.prototype.jb;zV.prototype.getMediaUrl=zV.prototype.getMediaUrl;zV.prototype.getClickThroughUrl=zV.prototype.ub;zV.prototype.isBumper=zV.prototype.ac;zV.prototype.getSkipTimeOffset=zV.prototype.getSkipTimeOffset;zV.prototype.getPosition=zV.prototype.getPosition;zV.prototype.getDuration=zV.prototype.getDuration;zV.prototype.getTitle=zV.prototype.getTitle;
13
- zV.prototype.getAdvertiserName=zV.prototype.getAdvertiserName;zV.prototype.getAdSystem=zV.prototype.getAdSystem;zV.prototype.getApiFramework=zV.prototype.getApiFramework;zV.prototype.getSourceId=zV.prototype.Xb;zV.prototype.getCreativeId=zV.prototype.getCreativeId;zV.prototype.getId=zV.prototype.getId;zV.prototype.getTechnology=zV.prototype.wb;zV.prototype.getAdManagerVersion=zV.prototype.tb;zV.prototype.getAdManagerName=zV.prototype.sb;AV.prototype.getCuePoints=function(){return this.a.getTemporalSlots().map(function(a){switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return-1;default:return a.getTimePosition()}})};AV.prototype.Mb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};AV.prototype.Lb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
14
- AV.prototype.hasPostroll=AV.prototype.Lb;AV.prototype.hasPreroll=AV.prototype.Mb;AV.prototype.getCuePoints=AV.prototype.getCuePoints;_.t=BV.prototype;
15
- _.t.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a){b=a.m.getConfiguration().freewheel||{};try{CV(b)}catch(n){return a.m.onError(n),a.l.resolve(),m["return"](a.l)}a.w.setNetwork(b.networkId);a.w.setServer(b.serverUrl);a.a=a.w.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.lg&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.y(m,DV(),2)}c=m.f;a.a.setVideoAsset(b.videoAssetId,a.m.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(d=
16
- _.w(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,yV(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.Ze&&Object.keys(b.keyValues).forEach(function(n){return a.a.addKeyValue(n,b.keyValues[n])});a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);if(Array.isArray(b.parameters))for(g=_.w(b.parameters),h=g.next();!h.done;h=
17
- g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.h.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.ln.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.qn.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.pn.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_AD,a.Gm.bind(a));a.h.on(a.m,_.tg,a.Ak.bind(a));a.h.on(a.m,_.ig,a.zk.bind(a));a.a.submitRequest();return m["return"](a.l)})};_.t.start=function(){var a=this;return _.I(function(b){return _.y(b,GV(a),0)})};_.t.cd=function(){};
18
- _.t.resume=function(){this.f&&this.f.resume()};_.t.pause=function(){this.f&&this.f.pause()};_.t.skip=function(){this.f&&this.f.skipCurrentAd()};_.t.getVolume=function(){return this.a?this.a.getAdVolume():1};_.t.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.t.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.t.Zc=function(){return!0};_.t.yc=function(){var a=this;return _.I(function(b){a.h.release();a.j&&(a.j.stop(),a.j=null);FV(a);a.a&&(a.a.dispose(),a.a=null);_.B(b)})};
19
- _.t.ln=function(a){var b=this;if(a.success)this.B=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.o=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.A=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.m.trigger(new _.L(_.Mc,{adsTimeline:new AV(this.a)})),this.j=new _.Eu(this.m.getSurface(),function(c,d){return b.a.resize(c,d)},this.m.ce(vV).f);else this.m.onError(new _.P(1,9,10003,{errorType:0},
20
- void 0));this.l.resolve()};_.t.qn=function(a){IV(this,_.qc,a);this.j.start()};_.t.pn=function(a){this.f=null;a=a.slot;IV(this,_.sc);this.j.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:GV(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:FV(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:HV(this)}};
21
- _.t.Gm=function(a){var b=a.subType;this.g.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:IV(this,_.Ic,a);IV(this,_.Bc,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:IV(this,_.Jc,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:IV(this,_.xc,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:IV(this,_.Dc,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:IV(this,_.Kc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:IV(this,_.wc,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:IV(this,
22
- _.vc,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:IV(this,_.Ec,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:IV(this,_.Gc,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:IV(this,_.Hc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:IV(this,_.uc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:IV(this,_.Fc,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.m.onError(new _.P(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],
23
- fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.t.Ak=function(){var a=this;if(!this.f){var b=this.m.getPosition();if(this.f=this.o.find(function(d){return.5>Math.abs(b-d.getTimePosition())})||null){var c=this.o.findIndex(function(d){return d===a.f});this.o.splice(c,1);this.m.pause();EV(this);this.f.play()}}};
24
- _.t.zk=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.Iq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.Hq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.Bq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);HV(this);break;case _.uq:case _.Fq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};BV.prototype.getPosition=BV.prototype.getPosition;BV.prototype.setVolume=BV.prototype.setVolume;
25
- BV.prototype.getVolume=BV.prototype.getVolume;BV.prototype.skip=BV.prototype.skip;BV.prototype.pause=BV.prototype.pause;BV.prototype.resume=BV.prototype.resume;JV.prototype.name=function(){return uV};JV.prototype.a=function(a,b){return a.namespace()!==_.zd&&b&&b.freewheel?window.tv&&tv.freewheel&&tv.freewheel.SDK?!0:(this.sd.warn("FreeWheel SDK is not loaded."),!1):!1};JV.prototype.create=function(a){return new BV(a)};_.cr(new JV);};
2
+ var f=function(window){var iW="clpp-freewheel",jW="clpp.freewheel.AdsManagerFactory",kW="freewheel",lW=function(){this.f=this.a=null},mW=function(){},nW=function(a){switch(a){case 0:return tv.freewheel.SDK.ADUNIT_PREROLL;case 1:return tv.freewheel.SDK.ADUNIT_MIDROLL;case 2:return tv.freewheel.SDK.ADUNIT_POSTROLL;default:return""}},oW=function(a,b,c){this.h=a;this.f=b;this.a=c},pW=function(a){this.a=a},qW=function(a){this.g=new _.K("clpp.freewheel.AdsManager");this.m=a;this.h=new _.vi;this.w=new tv.freewheel.SDK.AdManager;
3
+ this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.l=new _.Gk;this.j=null},rW=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.tg&&b.push("serverUrl");typeof a.profileId!==_.tg&&b.push("profileId");typeof a.videoAssetId!==_.tg&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.O(1,9,12001,{missingKeys:b.join(", ")});},sW=function(){var a,b,c,d;return _.I(function(e){if(1==e.a)return a=new _.$u,b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE,
4
+ _.y(e,a.canPlay(!1),2);if(3!=e.a)return c=e.f,_.y(e,a.canPlay(!0),3);d=e.f;c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:d&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return e["return"](b)})},vW=function(a){return _.I(function(b){if(a.B.length)return tW(a),a.f=a.B.shift(),a.f.play(),b.F(0);uW(a);return _.y(b,a.m.a.play(),0)})},wW=function(a){a.A.length?(tW(a),a.f=a.A.shift(),a.f.play()):uW(a)},tW=function(a){var b=a.m.ge(kW).td();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),
5
+ a.a.registerVideoDisplayBase(iW),a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},uW=function(a){var b=a.m.ge(kW).td();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},xW=function(a,b,c){var d=null;a.a&&c&&(c.adInstance||c.slot)&&(c=(d=c.adInstance||null)?d.getSlot():c.slot,d={ad:new oW(a.a,c,d)});a.m.trigger(new _.L(b,d))},yW=function(){this.Ca=new _.K(jW)};_.x(lW,_.ew);_.t=lW.prototype;
6
+ _.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.sr(_.fe,{id:iW}),this.f=_.sr(_.r,{"class":_.Ad}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.O(1,9,12E3))};_.t.onPlayerWillDestroy=function(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)};_.t.id=function(){return kW};_.t.td=function(){return this.a};_.t.Yl=function(){return this.f};
7
+ _.J("clpp.freewheel.FreeWheelPlugin",lW);lW.prototype.getAdVideo=lW.prototype.Yl;lW.prototype.getAdContainer=lW.prototype.td;lW.Id=kW;lW.AD_CONTAINER_ID=iW;mW.prototype.create=function(){return new lW};_.bu(new mW);_.t=oW.prototype;_.t.yb=function(){return"FreeWheel AdManager SDK"};_.t.zb=function(){return tv.freewheel.SDK.version};_.t.Db=function(){return 0};_.t.getId=function(){return this.a?this.a.getAdId():""};_.t.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.tg?a:""};_.t.cc=function(){return""};_.t.getApiFramework=function(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""};_.t.getAdSystem=function(){return""};_.t.getAdvertiserName=function(){return""};
8
+ _.t.getTitle=function(){return""};_.t.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.t.getPosition=function(){return 0};_.t.getSkipTimeOffset=function(){return 0};_.t.gc=function(){return!1};_.t.Ab=function(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""};_.t.getMediaUrl=function(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""};
9
+ _.t.qb=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.t.pb=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.t.Xa=function(){return 0};_.t.Ya=function(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}};
10
+ _.t.getPodIndex=function(){switch(this.Ya()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.t.Pb=function(){switch(this.Ya()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.t.Cb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.t.rb=function(){return this.f.getAdCount()};_.t.getWrapperAdIds=function(){return[]};_.t.canSeek=function(){return!1};
11
+ _.t.getWrapperAdSystems=function(){return[]};_.t.getWrapperCreativeIds=function(){return[]};_.t.fc=function(){return null};oW.prototype.getVideoElement=oW.prototype.fc;oW.prototype.getWrapperCreativeIds=oW.prototype.getWrapperCreativeIds;oW.prototype.getWrapperAdSystems=oW.prototype.getWrapperAdSystems;oW.prototype.canSeek=oW.prototype.canSeek;oW.prototype.getWrapperAdIds=oW.prototype.getWrapperAdIds;oW.prototype.getSequenceLength=oW.prototype.rb;oW.prototype.getPositionInSequence=oW.prototype.Cb;
12
+ oW.prototype.getPodTimeOffset=oW.prototype.Pb;oW.prototype.getPodIndex=oW.prototype.getPodIndex;oW.prototype.getPodType=oW.prototype.Ya;oW.prototype.getMediaBitrate=oW.prototype.Xa;oW.prototype.getMediaHeight=oW.prototype.pb;oW.prototype.getMediaWidth=oW.prototype.qb;oW.prototype.getMediaUrl=oW.prototype.getMediaUrl;oW.prototype.getClickThroughUrl=oW.prototype.Ab;oW.prototype.isBumper=oW.prototype.gc;oW.prototype.getSkipTimeOffset=oW.prototype.getSkipTimeOffset;oW.prototype.getPosition=oW.prototype.getPosition;
13
+ oW.prototype.getDuration=oW.prototype.getDuration;oW.prototype.getTitle=oW.prototype.getTitle;oW.prototype.getAdvertiserName=oW.prototype.getAdvertiserName;oW.prototype.getAdSystem=oW.prototype.getAdSystem;oW.prototype.getApiFramework=oW.prototype.getApiFramework;oW.prototype.getSourceId=oW.prototype.cc;oW.prototype.getCreativeId=oW.prototype.getCreativeId;oW.prototype.getId=oW.prototype.getId;oW.prototype.getTechnology=oW.prototype.Db;oW.prototype.getAdManagerVersion=oW.prototype.zb;
14
+ oW.prototype.getAdManagerName=oW.prototype.yb;pW.prototype.getCuePoints=function(){return this.a.getTemporalSlots().map(function(a){switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return-1;default:return a.getTimePosition()}})};pW.prototype.Sb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};pW.prototype.Rb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
15
+ pW.prototype.hasPostroll=pW.prototype.Rb;pW.prototype.hasPreroll=pW.prototype.Sb;pW.prototype.getCuePoints=pW.prototype.getCuePoints;_.t=qW.prototype;
16
+ _.t.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a){b=a.m.getConfiguration().freewheel||{};try{rW(b)}catch(n){return a.m.onError(n),a.l.resolve(),m["return"](a.l)}a.w.setNetwork(b.networkId);a.w.setServer(b.serverUrl);a.a=a.w.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.tg&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.y(m,sW(),2)}c=m.f;a.a.setVideoAsset(b.videoAssetId,a.m.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(d=
17
+ _.w(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,nW(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.ff&&Object.keys(b.keyValues).forEach(function(n){return a.a.addKeyValue(n,b.keyValues[n])});a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);if(Array.isArray(b.parameters))for(g=_.w(b.parameters),h=g.next();!h.done;h=
18
+ g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.h.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.Cn.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.Gn.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.Fn.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_AD,a.Wm.bind(a));a.h.on(a.m,_.Gg,a.Mk.bind(a));a.h.on(a.m,_.qg,a.Lk.bind(a));a.a.submitRequest();return m["return"](a.l)})};_.t.start=function(){var a=this;return _.I(function(b){return _.y(b,vW(a),0)})};_.t.kd=function(){};
19
+ _.t.resume=function(){this.f&&this.f.resume()};_.t.pause=function(){this.f&&this.f.pause()};_.t.skip=function(){this.f&&this.f.skipCurrentAd()};_.t.getVolume=function(){return this.a?this.a.getAdVolume():1};_.t.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.t.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.t.gd=function(){return!0};_.t.Dc=function(){var a=this;return _.I(function(b){a.h.release();a.j&&(a.j.stop(),a.j=null);uW(a);a.a&&(a.a.dispose(),a.a=null);_.B(b)})};
20
+ _.t.Cn=function(a){var b=this;if(a.success)this.B=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.o=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.A=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.m.trigger(new _.L(_.Qc,{adsTimeline:new pW(this.a)})),this.j=new _.Yu(this.m.getSurface(),function(c,d){return b.a.resize(c,d)},this.m.ge(kW).f);else this.m.onError(new _.O(1,9,10003,{errorType:0},
21
+ void 0));this.l.resolve()};_.t.Gn=function(a){xW(this,_.wc,a);this.j.start()};_.t.Fn=function(a){this.f=null;a=a.slot;xW(this,_.xc);this.j.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:vW(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:uW(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:wW(this)}};
22
+ _.t.Wm=function(a){var b=a.subType;this.g.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:xW(this,_.Mc,a);xW(this,_.Fc,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:xW(this,_.Nc,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:xW(this,_.Bc,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:xW(this,_.Hc,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:xW(this,_.Oc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:xW(this,_.Ac,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:xW(this,
23
+ _.zc,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:xW(this,_.Ic,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:xW(this,_.Kc,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:xW(this,_.Lc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:xW(this,_.yc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:xW(this,_.Jc,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.m.onError(new _.O(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],
24
+ fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.t.Mk=function(){var a=this;if(!this.f){var b=this.m.getPosition();if(this.f=this.o.find(function(d){return.5>Math.abs(b-d.getTimePosition())})||null){var c=this.o.findIndex(function(d){return d===a.f});this.o.splice(c,1);this.m.pause();tW(this);this.f.play()}}};
25
+ _.t.Lk=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.Uq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.Tq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.Nq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);wW(this);break;case _.Gq:case _.Rq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};qW.prototype.getPosition=qW.prototype.getPosition;qW.prototype.setVolume=qW.prototype.setVolume;
26
+ qW.prototype.getVolume=qW.prototype.getVolume;qW.prototype.skip=qW.prototype.skip;qW.prototype.pause=qW.prototype.pause;qW.prototype.resume=qW.prototype.resume;yW.prototype.name=function(){return jW};yW.prototype.a=function(a,b){return a.namespace()!==_.Fd&&b&&b.freewheel?window.tv&&tv.freewheel&&tv.freewheel.SDK?!0:(this.Ca.warn("FreeWheel SDK is not loaded."),!1):!1};yW.prototype.create=function(a){return new qW(a)};_.mr(new yW);};
26
27
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
27
28
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
28
29
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.hls.js CHANGED
@@ -1,75 +1,77 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var yL="Could not parse MP4 segment start time.",zL="Failed to infer discontinuity number",AL="Guessing audio-only",BL="METHOD",CL="SAMPLE-AES-CTR",DL="Setting playlist start time to ",EL="Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one ",FL="application/vnd.apple.mpegurl",GL="sample",HL="whole-segment",IL=function(a){if(1>a.a)throw _.kn();--a.a},JL=function(a,b,c,d){if(1===b){if(!d||0===d.length)throw new _.P(_.Q,4,4043,"Media playlist must have at least one segment!");if(null==
3
- d[0].a)throw new _.P(_.Q,4,4043,"Media playlist must have at least one full segment!");}this.a=a;this.verbatimUri="";this.type=b;this.Y=c;this.S=1===b?d:null},KL=function(a,b,c){c=void 0===c?[]:c;this.Y=b;this.a=a;this.f=c;this.na=-1},LL=function(a){a=_.w(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value,b.startsWith("#EXT-")&&(b=_.ak(0,b),_.Zv.has(b.name)))return 1;return 0},ML=function(a,b){var c=new Map,d=new URL(b);a.forEach(function(e){var f=_.tj(e,"NAME"),g=_.tj(e,"QUERYPARAM");if(f)g=_.uj(e,
4
- "VALUE"),c.set(f,g);else if(g){f=d.searchParams.get(g);if(null==f)throw new _.P(_.Q,4,4044,"Query param '"+g+"' missing in playlist URI.");if(!f)throw new _.P(_.Q,4,4044,"Query param '"+g+"' has no associated value in playlist URI.");c.set(g,decodeURIComponent(f))}});return c},NL=function(a,b){return a.replace(/\{\$([a-zA-Z0-9_-]+)\}/g,function(c,d){var e=b.get(d);if(null==e)throw new _.P(_.Q,4,4044,"Undefined variable '"+d+"'");return e})},OL=function(a,b){a.forEach(function(c){c.attributes.forEach(function(d){d.value=
5
- NL(d.value,b)})})},PL=function(a,b,c){OL(a,c);b.forEach(function(d){d.a&&(d.a=NL(d.a,c));OL(d.Y,c);OL(d.f,c)})},QL=function(){this.h=0;this.a=new Map},TL=function(a,b,c){b=b.trim().split(/\n+/m).map(function(d){return d.trim()}).filter(function(d){return d.length&&!_.Y.xi(d)});if(!/^#EXTM3U($|[ \t\n])/m.test(b[0]))throw new _.P(_.Q,4,4015);return 0===LL(b)?RL(a,b,c):SL(a,b,c)},SL=function(a,b,c){for(var d=[],e=1;e<b.length;){var f=UL(a,b[e]);if(_.$v.has(f.name))break;d.push(f);e++}b=VL(a,c,b.slice(e));
6
- e=b.S;d=d.concat(b.Y);a=WL(a,d,c);PL(d,e,a);return new JL(c,1,d,b.S)},RL=function(a,b,c){for(var d=[],e=1;e<b.length;e++){var f=UL(a,b[e]);d.push(f);if(f.name===_.Xa){var g=b[e+1];if(!g)throw new _.P(_.Q,4,4044,"EXT-X-STREAM-INF is not followed by a URI.");f.attributes.push(new _.vj(_.$b,g));e++}}b=_.Y.Ub(d,"EXT-X-DEFINE");_.Y.tj(b);b=ML(b,c);a.a=b;PL(d,[],a.a);return new JL(c,0,d)},VL=function(a,b,c){var d=[],e=[],f=[],g=[];c.forEach(function(h){/^(#EXT)/.test(h)?(h=UL(a,h),_.Zv.has(h.name)||_.bw.has(h.name)?
7
- d.push(h):_.aw.has(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===_.Ua&&"PART"===_.tj(h,_.Yb)&&g.push(h):f.push(h)):_.Y.xi(h)||(h=_.Y.Qd(b,h.trim(),!1),e.push(new KL(h,f,g)),f=[],g=[])});0<g.length&&e.push(new KL(null,f,g));return{S:e,Y:d}},UL=function(a,b){return _.ak(a.h++,b)},WL=function(a,b,c){b=_.Y.Ub(b,"EXT-X-DEFINE");_.Y.tj(b);var d=ML(b,c);b.map(function(e){return _.tj(e,"IMPORT")}).filter(Boolean).forEach(function(e){var f=a.a.get(e);if(null==f)throw new _.P(_.Q,4,4044,"Cannot import variable '"+
8
- e+"' as it is not defined in the master playlist");d.set(e,f)});return d},XL=function(a){var b=void 0===b?0:b;return 0>a?[]:Array.from({length:a},function(c,d){return d+b})},YL=function(a,b){b=void 0===b?0:b;return b+10<=a.length&&73===a[b]&&68===a[b+1]&&51===a[b+2]&&255>a[b+3]&&255>a[b+4]&&128>a[b+6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1},ZL=function(){this.a=new Map;this.f=new Map},$L=function(a){function b(l,m,n){for(var p="";m<n;m++)p+="%"+("00"+l[m].toString(16)).slice(-2);return p}function c(l){return l[0]<<
9
- 21|l[1]<<14|l[2]<<7|l[3]}function d(){throw new _.P(_.Q,4,4030);}YL(a)||d();var e=10;a[5]&64&&(e=e+4+c(a.subarray(10,14)));do{var f=c(a.subarray(e+4,e+8));1>f&&d();var g=String.fromCharCode(a[e],a[e+1],a[e+2],a[e+3]);if("PRIV"===g){g=a.subarray(e+10,e+f+10);for(var h=0;h<g.byteLength;h++)if(0===g[h]){if("com.apple.streaming.transportStreamTimestamp"===unescape(b(g,0,h)))return a=g.subarray(h+1),f=(a[3]&1)<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2,f*=4,f+=a[7]&3,Math.round(f/9E4);break}}YL(a,e)||d();
10
- e+=10;e+=f}while(e<a.byteLength);return d()},aM=function(a){for(;a.getPosition()<a.Sa()-1;){var b=a.getPosition();if(71===_.ln(a))return IL(a),b}return-1},bM=function(a){function b(){d.seek(e+188);f=_.ln(d);71!==f&&(d.seek(e+192),f=_.ln(d));71!==f&&(d.seek(e+204),f=_.ln(d));71!==f&&c();IL(d)}function c(){throw new _.P(_.Q,4,4030);}var d=new _.hn(new DataView(a),!1),e=0,f=0;e=aM(d);0>e&&(_.zw.error("Unable to find sync byte in TS after scanning."),c());for(;;)if(e=d.getPosition(),f=_.ln(d),71!==f&&
11
- c(),a=_.mn(d),8191===(a&8191))b();else if(a&16384)if(a=(_.ln(d)&48)>>4,0!==a&&2!==a||c(),3===a&&(a=_.ln(d),d.skip(a)),1!==_.nn(d)>>8)b();else{d.skip(3);a=_.ln(d)>>6;0!==a&&1!==a||c();0===_.ln(d)&&c();a=_.ln(d);var g=_.mn(d),h=_.mn(d);return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},cM=function(a,b){var c=null,d=0;try{(new _.sn).N(_.Ve,_.tn).N(_.ug,_.tn).N(_.Qe,_.tn).Z("mdhd",function(g){g.reader.skip(0===g.version?8:16);d=_.nn(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=
12
- g}if(c||!d)throw _.zw.error("Unable to find timescale in init segment!"),new _.P(_.Q,4,4030,yL,c);var e=0,f=!1;try{(new _.sn).N("moof",_.tn).N("traf",_.tn).Z("tfdt",function(g){var h=d;if(0===g.version)h=_.nn(g.reader)/h;else{var l=_.nn(g.reader),m=_.nn(g.reader);if(!(2097151>=l||h>=Math.pow(2,12)))throw Error("Cannot accurately parse MP4 timestamp, base time is too high and timescale is \x3c\x3d 2^12");h=l/h*Math.pow(2,32)+m/h}e=h;f=!0;g.parser.stop()}).parse(a,!0)}catch(g){c=g}if(c||!f)throw new _.P(_.Q,
13
- 4,4030,yL,c);return e},fM=function(a){var b=_.uj(a,BL);if(!dM.includes(b))return eM.error("PlayReady in HLS is only supported with [",dM.join(", "),"], not",b),null;a=_.uj(a,_.$b);b=_.gv(a);a=null;b=_.Hj(b.data);try{a=_.XD(_.$o(b))}catch(c){a=b}return _.jE(_.Od,[{initDataType:_.qd,initData:a}],"")},gM=function(a){this.g=new _.K("clpp.hls.MediaReader");this.f=a;this.a={attemptParameters:_.ck()}},iM=function(a,b,c,d,e,f){var g,h,l,m,n,p,q,u;return _.I(function(v){switch(v.a){case 1:a.g.debug("Fetching segment to find start time");
14
- if("audio/mpeg"===d||d===_.bd||d===_.ad)return v["return"](0);g=f;if(d!==_.$c){v.F(2);break}return _.y(v,hM(a,c,g),3);case 3:h=v.f;l=_.Hj(h.data);if(!YL(l))throw new _.P(_.Q,4,4030,"AAC segment does not contain an ID3 tag.");return v["return"]($L(l));case 2:if(d!==_.Lg&&d!==_.cd){v.F(4);break}m=[hM(a,c,g)];b&&m.push(hM(a,b,!0));return _.y(v,Promise.all(m),5);case 5:return n=v.f,p=n[0],q=n[1]||n[0],v["return"](cM(p.data,q.data));case 4:if(d!==_.Kg){v.F(6);break}return _.y(v,hM(a,c,g),7);case 7:return u=
15
- v.f,v["return"](bM(u.data));case 6:if(!_.gu((d.split("/")[0]||"")+'/mp4;codecs\x3d"'+e+'"'))return v["return"](0);throw new _.P(_.Q,4,4030);}})},hM=function(a,b,c){var d,e,f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:return d=b.f(),e=_.QE(b.$a(),b.Ca,b.Ca+2048-1,a.a.attemptParameters),e.type=2,f=_.QE(b.$a(),b.Ca,b.oa,a.a.attemptParameters),f.type=2,d&&(f.keyInfo=d),_.C(n,2),g=c?f:e,_.y(n,a.f(g),4);case 4:return h=n.f,n["return"](h);case 2:l=_.E(n);if(7001===l.code||c)throw l;a.g.warn("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS pre-flights.",
16
- e.uris[0]);_.C(n,5);return _.y(n,a.f(f),7);case 7:return n["return"](n.f);case 5:throw m=_.E(n),a.g.error("Failed to fetch media segment to parse its start timestamp.",f.uris[0],m),new _.P(_.Q,4,4030,"Failed to fetch the media segment.");}})},jM=function(a){this.streams=a},kM=function(a,b){a.streams.forEach(function(c){c.Mf=b})},lM=function(a,b){a.streams.forEach(function(c){c.width=b})},mM=function(a,b){a.streams.forEach(function(c){c.height=b})},nM=function(a,b){a.streams.forEach(function(c){c.frameRate=
17
- b})},oM=function(a,b){a.streams.forEach(function(c){c.bandwidth=b})},pM=function(a,b){var c=a.streams.find(function(d){d=d.S;return d[0].position<=b&&b<=d[d.length-1].position});return null==c?null:c.S.find(function(d){return d.position===b})||null},qM=function(a,b){var c=a.map(function(d){return d.streams[b]});return c.some(function(d){return null==d})?null:c},rM=function(a){this.a=a},sM=function(a,b){var c=a.map(function(d){return d.a[b]});return c.some(function(d){return null==d})?null:c},tM=function(a,
18
- b){var c=new Set(a.map(function(d){return d.na}));return b.filter(function(d){return!c.has(d.na)})},vM=function(a,b){for(;a[0].na<b[0].na;)a.splice(0,1);var c=a[0],d=b[0];c.startTime===d.startTime&&c.endTime===d.endTime||uM(c,d);var e=a.length-1;c=a[e];d=b[e];0<e&&(c.startTime!==d.startTime||c.endTime!==d.endTime)&&uM(c,d);for(c=e+1;c<b.length;)a.push(b[c]),c++},AM=function(a,b,c,d,e){var f=b[0].length();f=XL(f).map(function(g){var h=sM(b,g)||[],l=qM(c,g)||[];g=qM(d,g)||[];var m=_.gh(wM(h)).concat(_.gh(l),
19
- _.gh(g)).filter(Boolean);xM(m);var n=m[0];m=n.na;n=n.duration;return{configurationId:a,variants:h,textStreams:l,thumbStreams:g,startTime:0,id:"P"+m,endTime:n,duration:n,na:m}});e&&yM(f[0]);zM(f);return f},wM=function(a){a=new Set(a.flatMap(function(b){return[b.video,b.audio]}).filter(Boolean));return Array.from(a)},yM=function(a){var b=wM(a.variants)[0].S[0].Ga;a.startTime+=b;a.endTime+=b},zM=function(a){for(var b=0;b<a.length;b++){var c=a[b],d=a[b-1];c.startTime=d?d.endTime:c.startTime;c.endTime=
20
- c.startTime+c.duration}},uM=function(a,b){a.startTime=b.startTime;a.endTime=b.endTime;a.duration=b.duration;BM(a.variants,b.variants);CM(_.Y.xf(a),_.Y.xf(b))},BM=function(a,b){var c=new Map(a.map(function(d){return[_.Y.Ph(d),d]}));b.forEach(function(d){c.get(_.Y.Ph(d)).drmInfos=d.drmInfos})},CM=function(a,b){var c=new Map(a.map(function(d){return[d.uc,d]}));b.forEach(function(d){var e=c.get(d.uc);e.S=d.S;e.segmentIndex.replace(d.S);e.nc=d.nc;e.df=d.df;e.duration=d.duration;e.Uh=d.Uh;e.encrypted=d.encrypted;
21
- e.drmInfos=d.drmInfos;e.keyId=d.keyId})},xM=function(a){var b=DM(a);a.forEach(function(c){_.LE(c.segmentIndex,b);c.duration=b;c.df=c.nc+b})},DM=function(a){var b=Infinity;_.Y.Bl(a).forEach(function(c){b=Math.min(b,c.duration)});return b},EM=function(){var a=this;this.a=this.D=null;this.h=1;this.f=new ZL;this.A="";this.P=new QL;this.H=0;this.l=null;this.j=new _.yl(function(){a.cc()});this.o=_.gc;this.C=null;this.G=new _.tk;this.J=this.B=null;this.g=new _.K("clpp.hls.HlsParser");this.K=new Map;this.U=
22
- new gM(this.Vf.bind(this));this.M=!1;this.I=null;this.L=!1;this.w=new Map},FM=function(a){if(null===a.l)return[];a=a.l;return[a.audio,a.video].filter(function(b){return b}).map(function(b){return b.uc})},GM=function(a,b){var c=new Set(b.map(function(h){return h.id}));a.w.forEach(function(h,l){c.has(l)||a.w["delete"](l)});for(var d=_.w(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=a.w.get(e.id);if(f&&f.startTime!==e.startTime)a.D.onError(new _.P(1,4,4044,"EXT-X-DATERANGE START-DATE has changed for ID\x3d"+
23
- e.id));var g={configurationId:a.D.configurationId,schemeIdUri:e.schemeIdUri,customAttributes:e.customAttributes,value:"",startTime:e.startTime,endTime:e.endTime,id:e.id,type:_.wi,eventElement:null};f&&!_.N.Ei(f,g)||a.w.set(e.id,g)}return Array.from(a.w.values())},MM=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v,z,A,H,G,D;return _.I(function(F){switch(F.a){case 1:c=_.Uq;d=HM(a,b,a.A,"");if(1===d.type){e=d.S[0].a;var M=_.pj(e)||"";f=null!=_.qj.video[M]?_.r:null!=_.qj.audio[M]?_.Zc:null;g="";f===c.VIDEO?
24
- g="avc1.42E01E":f===c.AUDIO&&(g="mp4a.40.2");M=a.P;var O=a.A,S=a.a.hlsDefaultCodecs||g,V=[],ra=[];ra.push(new _.vj(_.na,"0"));ra.push(new _.vj(_.$b,O));S.length&&ra.push(new _.vj(_.sa,S));V.push(new _.sj(M.h++,_.Xa,ra));d=new JL(O,0,V)}h=_.Y.Dn(d.Y);return _.y(F,IM(a,h),4);case 4:l=F.f;F.F(3);break;case 5:l=F.f;case 3:m=l;n=m.xm;p=m.periods;q=m.Pn;u=m.po;v=m.alternativeVariants;z=m.alternativeTextStreams;A=m.alternativeImageStreams;if(!a.D)throw new _.P(_.Q,7,7001);JM(a,p);M=!0;O=null;S=0;KM(a)||
25
- (M=!1,O=0,S=n.delay);V=a.a.timeline||{};V.type=void 0;O=new _.TE(V,O,S,!0,void 0,!!a.a.lowLatencyMode);_.WE(O,M);LM(O,p);q&&_.VE(O,q);H=O;if(!KM(a)){a.H=n.ze;S=0;O=_.w(a.f.values());for(M=O.next();!M.done;M=O.next())S=Math.max(S,M.value.streams[0].nc);for(O=0;95443.7176888889<=S;)O+=95443.7176888889,S-=95443.7176888889;if(O)for(a.g.debug("Offsetting live streams by",O,"to compensate for rollover"),S=_.w(a.f.values()),M=S.next();!M.done;M=S.next())M=M.value.streams[0],95443.7176888889>M.nc?(a.g.debug("Offset applied to",
26
- M.type),M.segmentIndex.offset(O)):a.g.debug("Offset NOT applied to",M.type)}M=_.Y.Ul(p);"LIVE"===a.o||"EVENT"===a.o?(M=Math.max(M,H.K),isNaN(a.a.availabilityWindowOverride)||(M=a.a.availabilityWindowOverride),H.A=M):a.o===_.gc&&(H.f=M);G=GM(a,u);D={presentationTimeline:H,periods:p,minBufferTime:0,cues:G};v&&(D.alternativeVariants=v);z&&(D.alternativeTextStreams=z);A&&(D.alternativeImageStreams=A);a.g.debug("HLS playlist parsed",D);return F["return"](D)}})},PM=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==
27
- p.a)return c=_.Y,_.y(p,NM(a,b),2);d=p.f;e=d.textStreams;f=d.thumbStreams;g=d.Pj;h=a.C.periods[0].variants;a.a.lowLatencyMode&&null!==a.l&&(h=h.filter(function(q){return q.id===a.l.id}));l=h.map(function(q){var u=c.Zh(q.audio,g),v=c.Zh(q.video,g);q=OM(a,u,v,q.bandwidth);if(!q)throw new _.P(_.Q,4,4047,{message:"Video and audio are encrypted in an incompatible way.",op:v?v.Zb():void 0,audio:u?u.Zb():void 0});return q});m=a.D.configurationId;n=AM(m,l,e,f,!0);return p["return"](n)})},NM=function(a,b){var c,
28
- d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a)return c=_.Uq,d=function(q){return q.stream.a()===c.VIDEO||q.stream.a()===c.AUDIO},e=b.filter(d),f=b.filter(function(q){return!d(q)}),g=function(q){q=q.map(function(u){var v=u.stream.streams[0];u=Object.assign({},{playlist:u.playlist},{language:v.language,channelsCount:v.channelsCount,spatialAudio:v.spatialAudio,closedCaptions:v.closedCaptions,primary:v.primary,kind:v.kind||null,groupId:v.groupId,type:v.type,codecs:v.codecs,name:v.originalId,uri:v.uc,
29
- Af:{width:v.width,height:v.height,frameRate:v.frameRate}});return QM(a,u)});return Promise.all(q)},_.y(p,g(e),2);if(3!=p.a)return h=p.f,_.y(p,g(f),3);l=p.f;RM(a,h.concat(l));m=l.filter(function(q){return q.a()===c.Gj});n=l.filter(function(q){return q.a()===c.IMAGE});return p["return"]({textStreams:m,thumbStreams:n,Pj:h})})},RM=function(a,b){b.forEach(function(c){a.f.a.set(c.Zb(),c)})},IM=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v,z,A,H,G;return _.I(function(D){switch(D.a){case 1:return c=_.Y,d=c.wn(b.td.closedCaptions),
30
- e=SM(a,b.Be),_.y(D,TM(a,b),2);case 2:return f=D.f,g=Object.values(f).flat().map(function(F){return F.playlist}),UM(a,g),h=g[0],l=c.bj(h.Y),a.o=l,a.J=c.cj(h.Y),m=c.Cn(h.Y,l,a.a.lowLatencyMode||!1,a.a.suggestedPresentationDelay),_.y(D,VM(a,f.lh,e),3);case 3:return n=D.f,_.y(D,WM(a,f.Be,n,d),4);case 4:return p=D.f,_.y(D,XM(a,f.lo,e),5);case 5:return q=D.f,_.y(D,YM(a,f.ig),6);case 6:return u=D.f,v=a.D.configurationId,z=AM(v,p,q,u,!KM(a)),a.D.filterAllPeriods(z),A=_.gh(f.Be).concat(_.gh(f.lh)).map(function(F){return F.playlist}),
31
- H=ZM(a,A),G=$M(a,A,H),D["return"]({periods:z,Pn:H,po:G,xm:m})}})},JM=function(a,b){KM(a)||2!==a.a.timeline.version||(a.I||(a.I=b[0].startTime),_.tG(b,-a.I))},$M=function(a,b,c){b=b.find(function(d){return null!==_.Y.Za(d.Y,_.Ka)});if(!b)return[];if(null===c)throw new _.P(_.Q,4,4024,"EXT-X-PROGRAM-DATE-TIME tag is required when EXT-X-DATERANGE tags are present");return b.Y.filter(function(d){return d.name===_.Ka}).map(function(d){return _.Y.xn(d,c,a.B,!KM(a))}).filter(Boolean)},ZM=function(a,b){var c=
32
- b.flatMap(function(e){return e.S[0].Y});c=_.Y.Za(c,_.Va);if(!c)return null;var d=(new Date(c.value)).getTime();return isNaN(d)?(a.g.warn("Failed to parse EXT-X-PROGRAM-DATE-TIME tag value (value: "+(c.value+").")),null):d/1E3},TM=function(a,b){var c,d,e,f,g,h;return _.I(function(l){if(1==l.a)return _.y(l,Promise.all([aN(a,b.td.Oj),aN(a,b.td.mo),aN(a,b.Be),aN(a,b.ig)]),2);c=l.f;d=_.w(c);e=d.next().value;f=d.next().value;g=d.next().value;h=d.next().value;return l["return"]({lh:e,lo:f,Be:g,ig:h})})},
33
- cN=function(a,b){return Promise.all(b.map(function(c){return bN(a,c)}))},SM=function(a,b){for(var c=_.Y.Re,d=new Map,e=_.w(b),f=e.next();!f.done;f=e.next()){var g=f.value,h=_.tj(g,"AUDIO");f=_.tj(g,_.fc);var l=_.tj(g,_.Qb);g=dN(a,g);if(l){var m=_.oj(_.R,g);d.set(c(_.R,l),m);l=g.indexOf(m);-1<l&&g.splice(l,1)}h&&(l=eN(_.Zc,g),d.set(c(_.Zc,h),l));f&&(h=eN(_.r,g),d.set(c(_.r,f),h))}return d},XM=function(a,b,c){return Promise.all(b.map(function(d){return fN(a,d,c)}))},YM=function(a,b){return Promise.all(b.map(function(c){return gN(a,
34
- c)}))},VM=function(a,b,c){var d,e;return _.I(function(f){if(1==f.a){if(0===b.length)return f["return"](new Map);d=[fN(a,b[0],c)];return _.y(f,d[0],2)}if(3!=f.a)return d=d.concat(b.slice(1).map(function(g){return fN(a,g,c)})),_.y(f,Promise.all(d),3);e=f.f;return f["return"](_.Y.qo(e))})},WM=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,u,v;return _.I(function(z){if(1==z.a){e=new Set;f=_.gh(b).concat();g=0;h=Infinity;for(l=0;l<f.length;++l)m=Number(_.uj(f[l].tag,_.na)),m<h&&(h=m,g=l);n=f.splice(g,1).pop();
35
- return _.y(z,hN(a,n,c,d,e),2)}if(3!=z.a)return p=z.f,q=f.map(function(A){return hN(a,A,c,d,e)}),_.y(z,Promise.all(q),3);u=z.f;u.splice(g,0,p);v=u.reduce(_.gE,[]);return z["return"](v)})},hN=function(a,b,c,d,e){var f,g,h,l,m,n;return _.I(function(p){return 1==p.a?(f=_.Y,g=b,h=g.tag,l=Number(_.uj(h,_.na)),m=f.Gn(h),_.y(p,iN(a,b,m,c,d),2)):(n=p.f)?p["return"](jN(a,n,l,e)):p["return"]([])})},kN=function(a,b,c,d,e,f){var g=dN(a,b);a.g.debug("Guessing stream type for",b.toString());b=!1;var h=_.oj(_.r,
36
- g),l=d+e;1!==g.length||c||h?!l&&1<g.length?(a.g.debug("Guessing multiplexed audio+video"),c=_.r,g=[g.join(",")]):d&&f?(a.g.debug(AL),c=_.Zc,b=!0):e?(a.g.debug(AL),c=_.Zc):(a.g.debug("Guessing video-only"),c=_.r):(c=_.Zc,a.g.debug(AL));return{type:c,Mj:g,im:b}},iN=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,u,v,z,A,H,G,D,F,M;return _.I(function(O){if(1==O.a)return f=_.Uq,g=_.Y.Re,h=b,l=h.tag,m=h.playlist,n=_.tj(l,"AUDIO"),p=_.tj(l,_.fc),q=n?d.get(g(f.AUDIO,n))||[]:[],u=p?d.get(g(f.VIDEO,p))||[]:[],v={audio:q,
37
- video:u},z=m.verbatimUri,A=v.audio.find(function(S){return S.Zb()===z}),H=kN(a,l,c,v.audio.length,v.video.length,A),G=H.type,D=H.Mj,F=H.im,M=null,F?O.F(2):_.y(O,lN(a,b,D,G,e,c),3);2!=O.a&&(M=O.f);if(null==M)return O["return"](null);v[G]=[M];G===f.AUDIO&&c&&v.video.forEach(function(S){lM(S,c.width);mM(S,c.height);nM(S,c.frameRate)});return O["return"](v)})},jN=function(a,b,c,d){var e=b.video,f=b.audio;e=0<e.length?e:[null];b=[];f=_.w(0<f.length?f:[null]);for(var g=f.next();!g.done;g=f.next()){g=g.value;
38
- for(var h=_.w(e),l=h.next();!l.done;l=h.next()){var m=l.value;l=_.Y.tl(g,m);d.has(l)?a.g.debug("Skipping variant which only differs in text streams."):(m=OM(a,g,m,c),null==m?a.g.warn("Incompatible DRM info in HLS variant. Skipping."):(b.push(m),d.add(l)))}}return b},OM=function(a,b,c,d){for(var e=[],f=(c||b).length(),g=0;g<f;g++){var h=b?b.streams[g]||null:null,l=c?c.streams[g]||null:null,m=_.Y.Ol(h,l);if(!m)return null;var n=d;h={id:a.h++,language:h?h.language:_.xg,primary:!!h&&h.primary||!!l&&l.primary,
39
- audio:h,video:l,bandwidth:n,drmInfos:m,allowedByApplication:!0,allowedByKeySystem:!0};e.push(h)}return new rM(e)},fN=function(a,b,c){var d,e,f,g;return _.I(function(h){d=b;e=d.tag;f=d.playlist;g=f.verbatimUri;return h["return"](mN(a,g,function(){var l,m,n,p,q,u,v,z,A,H,G,D,F,M,O;return _.I(function(S){if(1==S.a){l=_.Uq;m=_.Y.Re;n=_.uj(e,_.cb);p=_.Y.Nh(_.uj(e,_.Yb));q=_.Y.pl(e);u=c.get(m(p,n))||"";v=_.tj(e,_.ob);z=_.tj(e,"NAME");A=e.getAttribute("DEFAULT");H=e.getAttribute("AUTOSELECT");G=_.tj(e,"CHANNELS");
40
- D=p===l.AUDIO?G?parseInt(G.split("/")[0],10):null:null;var V=p===l.AUDIO?(V=_.tj(e,"CHANNELS"))?V.includes("/JOC"):!1:!1;F=V;M=!!A&&!!H;return _.y(S,QM(a,{playlist:f,codecs:u,type:p,ne:v,primary:M,name:z,channelsCount:D,spatialAudio:F,groupId:n,kind:q,Lc:null,closedCaptions:null,Af:null}),2)}O=S.f;return S["return"](O)})}))})},gN=function(a,b){var c,d,e,f;return _.I(function(g){c=b;d=c.tag;e=c.playlist;f=e.verbatimUri;return g["return"](mN(a,f,function(){var h,l,m,n,p;return _.I(function(q){if(1==
41
- q.a)return h=_.tj(d,_.sa)||"jpg",l=_.tj(d,_.ob),m=_.tj(d,"NAME"),_.y(q,QM(a,{playlist:e,codecs:h,type:_.Ae,ne:l,name:m,primary:!1,kind:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,Lc:null,groupId:null,Af:null}),2);n=q.f;(p=_.tj(d,_.na))&&oM(n,Number(p));return q["return"](n)})}))})},dN=function(a,b){var c=_.tj(b,_.sa,a.a.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/);c=_.Y.xl(c);var d=new Set,e=[];c=_.w(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.sE(f);
42
- d.has(g)?a.g.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},lN=function(a,b,c,d,e,f){var g,h,l,m,n;return _.I(function(p){g=b;h=g.tag;l=g.playlist;m=_.Uq;n=l.verbatimUri;return p["return"](mN(a,n,function(){var q,u,v,z;return _.I(function(A){if(1==A.a)return q=_.tj(h,_.qa),u=null,d===m.VIDEO&&q&&"NONE"!==q&&(u=e.get(q)),v=eN(d,c),_.y(A,QM(a,{playlist:l,codecs:v,type:d,closedCaptions:u,primary:!1,kind:null,ne:null,name:null,channelsCount:null,spatialAudio:!1,Lc:null,groupId:null,
43
- Af:f}),2);z=A.f;return A["return"](z)})}))})},mN=function(a,b,c){if(a.f.has(b))return a=a.f.get(b),Promise.resolve(a);if(a.f.f.has(b))return a.f.f.get(b)||null;c=c();a.f.set(b,c);return c},QM=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v,z,A,H,G,D,F,M,O,S,V;return _.I(function(ra){if(1==ra.a){c=nN;d=oN;e=_.Uq;f=b;g=f.playlist;h=f.codecs;l=f.type;m=f.ne;n=f.Lc;p=f.groupId;q=f.primary;u=f.kind;v=f.name;z=f.channelsCount;A=f.spatialAudio;H=f.closedCaptions;G=f.Af;D=_.Y.fi(m);if(1!==g.type)throw new _.P(_.Q,
44
- 4,4017);return _.y(ra,pN(a,g,l,h),2)}F=ra.f;M=a.a.lowLatencyMode?d.Aj:d.Cj;O=u;l!==e.TEXT||u||(O=_.og);S=_.Y.bj(g.Y);V=F.map(function(Da){var Ea=Da.S,Fa=Da.zl,Sa=Da.mimeType;Da=Da.na;var sb=Ea[0].startTime,Id=Ea[Ea.length-1].endTime,Fg=Id-sb,rc=new _.oF(Ea),wu=Ea[0].initSegment||null;return{id:null===n?_.xL++:n,originalId:v,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:rc.dd.bind(rc),getSegmentReference:rc.get.bind(rc),adjustSegmentDurations:rc.Fd.bind(rc),getDuration:rc.getDuration.bind(rc),
45
- segmentIndex:rc,segmentLookupStrategy:M,initSegmentReference:wu,mimeType:Sa,codecs:h,kind:O,Uh:Fa.type,encrypted:Fa.type===c.Fj,aesEncrypted:!!Fa.keyInfo,keyId:Fa.keyId,language:D,originalLanguage:m||_.xg,label:v,type:l,primary:q,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:G?G.frameRate:void 0,width:G?G.width:void 0,height:G?G.height:void 0,bandwidth:void 0,roles:[],channelsCount:z,spatialAudio:A,closedCaptions:H,S:Ea,drmInfos:Fa.drmInfos,na:Da,uc:g.verbatimUri,Mf:g.a,nc:sb,df:Id,duration:Fg,
46
- groupId:p,ip:S}});return ra["return"](new jM(V))})},aN=function(a,b){var c;return _.I(function(d){if(1==d.a)return _.y(d,Promise.all(b.map(function(e){var f;return _.I(function(g){if(1==g.a)return _.y(g,qN(a,e),2);f=g.f;return g["return"](f?{tag:e,playlist:f}:null)})})),2);c=d.f;return d["return"](c.filter(Boolean))})},qN=function(a,b){var c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a){c=_.Y.sm(b);d=_.tj(b,_.$b,void 0,{required:c});if(!d)return m["return"](null);e=_.Y.Qd(a.A,d);return _.y(m,rN(a,
47
- e),2)}f=m.f;g=f.response;h=f.text;l=g.uri;return m["return"](HM(a,h,l,d))})},bN=function(a,b){var c,d,e,f,g,h,l,m;return _.I(function(n){if(1==n.a){var p=new _.Zi(b.streams[0].Mf);if(a.a.lowLatencyMode&&a.J&&a.J.qh){var q=b.streams[b.streams.length-1].segmentIndex;if(q=q.a[q.a.length-1]){var u=q.a,v=u.length-1;q={Am:q.position,Hn:u&&0<u.length?v:null}}else q=null;if(u=q)q=u.Am,u=u.Hn,v=_.Uk(p.a.toString()),v._HLS_msn=q.toString(),null===u&&v._HLS_part&&delete v._HLS_part,null!==u&&(v._HLS_part=u.toString()),
48
- q=_.Tk(v,!0),_.cj(p,new _.gj(q))}c=p.toString();return _.y(n,rN(a,c),2)}d=n.f;e=d.response;f=d.text;g=b.Zb();h=b.streams[0].Mf;l=e.uri;h!==l&&(h=l,kM(b,h));m=HM(a,f,h,g);return n["return"]({stream:b,playlist:m})})},HM=function(a,b,c,d){a=TL(a.P,b,c);a.verbatimUri=d;return a},sN=function(a){if(1<(new Set(a.map(function(b){return b.mimeType}))).size)throw new _.P(_.Q,4,4045,"Media playlist contains discontinuities with different MIME types. This is valid, but not yet supported.");},tN=function(a){a=
49
- a.map(function(b){return b.a?b.a:b.f.map(function(c){return _.tj(c,_.$b)})||null}).map(function(b){return _.pj(b)});if(1<(new Set(a)).size)throw new _.P(_.Q,4,4044,"Unexpected change in file format.");},uN=function(a,b,c){a=_.Y.Ub(a.Y,_.Pa);if(1<a.length)throw new _.P(_.Q,4,4020);a=a[0];if(!a)return null;var d=_.uj(a,_.$b),e=_.Y.Qd(b,d);b=_.Y.$i(a,null,!0);return new _.kE(function(){return[e]},b.Ca,b.oa,c)},wN=function(a,b,c,d,e,f,g){var h=[],l={};b=_.w(vN(b.f));for(var m=b.next();!m.done;l={Cf:l.Cf},
50
- m=b.next()){var n=m.value;m=n.pi;n=n.item;var p=0===m,q=p?a:h[h.length-1],u=p?d:q.endTime,v=Number(_.tj(n,_.Ha));v=u+v;p=_.Y.$i(n,p?null:q.oa,p);q=_.tj(n,_.$b);q=_.Y.Qd(g,q);l.Cf=q?[q]:[];u=new _.xj(c,u,v,function(z){return function(){return z.Cf}}(l),p.Ca,p.oa,e,f,!1,null,null,null,null);if("YES"===_.tj(n,"INDEPENDENT")||0===m)u.h=!0;h.push(u)}return h},xN=function(a,b,c,d,e,f,g,h,l,m,n){var p=c.Y,q=c.a;0<_.Y.Ub(p,_.Pa).length&&(n=uN(c,l,g));var u=null!=q,v=q?[q]:[];if(!u&&!a.a.lowLatencyMode)return null;
51
- a=0;q={Ca:0,oa:null};var z=null;u?(c=_.Y.An(p).duration,a=e+c,q=_.Y.aj(p,b?b.oa:null)):(b=wN(b,c,d,e,f,g,l),a=b[b.length-1].endTime,z=b);h=h===_.Ae?_.Y.Fn(p):null;d=new _.xj(d,e,a,function(){return v},q.Ca,q.oa,f,g,!1,null,h?h.ee:null,h?h.Ae:null,h?h.durationPerTile:null,z,n);d.na=m;return d},pN=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,u,v,z,A,H;return _.I(function(G){switch(G.a){case 1:return e=_.Y,f=yN,g=zN,h=b.verbatimUri,l=b.S,m=e.Sl(b.Y,_.Qa),n=[],!KM(a)&&g.Nj(l),_.y(G,AN(a,b.a,h,l,m,c,d),2);
52
- case 2:p=G.f,q=m,u=f.jo(l),v=0;case 3:if(!(v<u.length)){G.F(5);break}z=u[v];A=n[n.length-1]||null;return _.y(G,BN(a,b.a,z,q,p,c,d,A,u.length),6);case 6:H=G.f;n.push(H);q+=z.length;v++;G.F(3);break;case 5:return sN(n),G["return"](n)}})},AN=function(a,b,c,d,e,f,g){var h,l,m,n,p,q,u,v,z,A,H,G;return _.I(function(D){if(1==D.a){h=d[0];if(null!=a.B)return D["return"](a.B);if(!KM(a)&&a.C)try{var F=a.f.get(c),M=F?pM(F,e)||null:null;if(!M)throw new _.P(_.Q,4,4030,"Segment not found in pervious playlist update.");
53
- l=M.startTime+M.Ga;a.g.debug(DL+l+".");a.B=l;return D["return"](l)}catch(O){if(m=a.f.get(c))n=m.streams[0].S[0].position,D=m.streams[m.streams.length-1].S,p=D[D.length-1].position,q=e,u=e+d.length-1,a.g.warn("Last #EXT-X-MEDIA-SEQUENCE values "+n+" - "+p+(", new values "+q+" - "+u+"."),b,m);throw new _.P(_.Q,4,4047,{message:"The updated playlist does not share any segments with the previous one.",uri:c});}return _.y(D,CN(a,f,g,h),2)}if(3!=D.a)return v=D.f,z=zN.En(h,a.A,v),A=uN(h,b,z.keyInfo),H=_.Y.fg(z.keyInfo,
54
- e),_.y(D,DN(a,A,h,H,v,g),3);G=D.f;a.g.debug(DL+G+".");a.B=G;return D["return"](G)})},BN=function(a,b,c,d,e,f,g,h,l){var m,n,p,q,u,v,z,A,H,G,D,F,M,O,S,V,ra,Da,Ea,Fa,Sa;return _.I(function(sb){switch(sb.a){case 1:return m=_.Y,n=zN,p=c[0],q=null==h,tN(c),_.y(sb,CN(a,f,g,p),2);case 2:u=sb.f;v=n.zn(c,a.A,u,h?h.wm:null,1===l);z=v[v.length-1];A=zN.ta(v);H=uN(p,b,A.keyInfo)||(h?h.km:null);G=_.Y.fg(A.keyInfo,d);D=p.na;if(q){F=e;sb.F(3);break}return _.y(sb,EN(a,D,H,p,d,G,u,g),4);case 4:F=sb.f;case 3:M=F;O=
55
- [];for(S=0;S<c.length;S++)if(V=c[S],ra=O[O.length-1]||null,Da=0===S?0:ra.endTime,Ea=d+S,Fa=m.fg(A.keyInfo,Ea),Sa=xN(a,ra,V,Ea,Da,M,Fa,f,b,D,H))H=Sa.initSegment,O.push(Sa);return sb["return"]({S:O,zl:A,wm:z,mimeType:u,endTime:O[O.length-1].endTime,na:D,km:H})}})},UM=function(a,b){b.forEach(function(c){var d=a.f.get(c.verbatimUri);yN.Tj(c,d,!KM(a))});yN.ul(b)},EN=function(a,b,c,d,e,f,g,h){var l;return _.I(function(m){if(1==m.a)return a.K.has(b)?m["return"](a.K.get(b)):_.y(m,DN(a,c,d,f,g,h),2);l=m.f;
56
- a.g.debug("Segment #"+e+" has raw media timestamp "+(l+" s."));a.K.set(b,l);return m["return"](l)})},DN=function(a,b,c,d,e,f){var g;return _.I(function(h){if(null==c.a)return h["return"](0);g=_.Y.rl(c,d);return h["return"](iM(a.U,b,g,e,f,null!=d))})},eN=function(a,b){if(1===b.length)return b[0];var c=_.oj(a,b);if(null!=c)return c;throw new _.P(_.Q,4,4025,{codecList:b});},CN=function(a,b,c,d){var e,f,g;return _.I(function(h){e=d.a;g=(f=_.Y.Za(d.Y,_.Pa))?_.uj(f,_.$b):null;return h["return"](FN(a,b,
57
- c,e,g))})},FN=function(a,b,c,d,e){var f,g,h,l,m;return _.I(function(n){if(1==n.a){f=[d,e].filter(Boolean);if(g=_.rj(f,b,c))return n["return"](g);h=_.gk([d],a.a.attemptParameters);h.method="HEAD";h.type=2;return _.y(n,a.Vf(h),2)}l=n.f;m=l.headers["content-type"];if(!m)throw new _.P(_.Q,4,4021,"Unknown MIME type of: "+f.join(", "));return n["return"](m.split(";")[0])})},rN=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return c=_.gk([b],a.a.attemptParameters),c.type=1,_.y(f,a.Vf(c),2);d=f.f;
58
- e="";try{e=_.T.ba(d.data)}catch(g){throw new _.P(_.Q,4,4042);}e=_.T.Ki(e);e=e.trim();return f["return"]({text:e,response:d})})},KM=function(a){return a.o===_.gc},LM=function(a,b){_.Y.tm(b,function(c,d){_.$E(a,c.S,d.startTime)});_.SE(a.a,b[0].startTime,b[b.length-1].endTime)},GN=function(){},oN={Aj:_.GD,Cj:_.FD},nN={Fj:GL,Lo:HL,NONE:_.Ye},vN=function HN(a){var c,d,e,f,g,h;return _.Ch(HN,function(l){1==l.a&&(c=-1,e=d=void 0,f=_.w(a),g=f.next());if(5!=l.a){if(g.done)return-1===c?l.F(0):_.y(l,{pi:c,Nn:d,
59
- item:e,next:void 0},0);h=g.value;return 0<=c?_.y(l,{pi:c,item:e,Nn:d,next:h},5):l.F(5)}c++;d=e;e=h;g=f.next();return l.F(2)})};_.t=ZL.prototype;_.t.set=function(a,b){var c=this;this.f.set(a,b);return b.then(function(d){return c.a.set(a,d)})["catch"](function(){}).then(function(){return c.f["delete"](a)})};_.t.has=function(a){return this.a.has(a)};_.t.get=function(a){return this.a.get(a)||null};_.t.values=function(){return Array.from(this.a.values())};_.t.clear=function(){this.f.clear();this.a.clear()};
60
- var yN={ul:function(a){var b=yN.Il(a),c=yN.vm(a);a.forEach(function(d){var e=d.S,f=e.findIndex(function(h){return h.na===b}),g=e.findIndex(function(h){return h.na===c+1});-1===g&&(g=e.length);d.S=e.slice(f,g)})},Tj:function(a,b,c){b=yN.Rl(a,b,c);a=_.w(a.S||[]);for(c=a.next();!c.done;c=a.next())c=c.value,_.Y.od(c.Y,_.La)&&b++,c.na=b},Rl:function(a,b,c){var d=_.Y.Za(a.Y,_.Ma);if(d)return Number(d.value);d=yN.mm(b);if(c&&d)try{return yN.jm(a,b)}catch(e){throw new _.P(_.Q,4,4024,"EXT-X-DISCONTINUITY-SEQUENCE tag is required for discontinuous HLS live streams.");
61
- }return 0},mm:function(a){return 0<yN.Tl(a)},jo:function(a){if(0===a.length)return[];var b=[],c=[];a=_.w(a);for(var d=a.next();!d.done;d=a.next())d=d.value,_.Y.od(d.Y,_.La)&&0<c.length&&(b.push(c),c=[]),c.push(d);b.push(c);return b},Tl:function(a){if(!a)return 0;a=a.streams[a.streams.length-1].S;return a[a.length-1].na},jm:function(a,b){var c=_.Y.Za(a.Y,_.Qa);if(!c)throw yN.g.error("Failed to infer discontinuity number, because EXT-X-MEDIA-SEQUENCE tag is missing."),Error(zL);c=Number(c.value);var d=
62
- pM(b,c);if(!d)throw yN.g.error("Failed to infer discontinuity number, could not find the appropriate segment in the previous playlist (segment position \x3d "+(c+")")),Error(zL);return d.na},vm:function(a){a=a.map(function(b){return b.S[b.S.length-1].na});return Math.min.apply(Math,_.gh(a))},Il:function(a){a=a.map(function(b){return b.S[0].na});return Math.max.apply(Math,_.gh(a))}};yN.g=new _.K("clpp.hls.DiscontinuityUtils");var IN={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Kg)throw new _.P(_.Q,4,4041);if(_.uj(a,BL)===CL)throw new _.P(_.Q,4,4044,"EXT-X-KEY:METHOD SAMPLE-AES-CTR is not supported in FairPlay.");return _.jE(_.Kd,[{initDataType:_.eg,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":fM,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":fM,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=_.uj(a,BL);if(!dM.includes(b))return eM.error("Widevine in HLS is only supported with [",
63
- dM.join(", "),"], not",b),null;b=_.uj(a,_.$b);b=_.gv(b);b=_.Hj(b.data);b=_.jE(_.Qd,[{initDataType:_.qd,initData:b}],"");if(a=_.tj(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},dM=["SAMPLE-AES",CL],eM=new _.K("clpp.hls.DrmParser");var zN={En:function(a,b,c){return zN.Bg(a.Y,b,c)||{type:_.Ye,keyInfo:null,drmInfos:[],keyId:null}},zn:function(a,b,c,d,e){if(a.slice(1).some(zN.ni))throw new _.P(_.Q,4,4046,e?"Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not at the beginning of the playlist.":"Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not marked by an EXT-X-DISCONTINUITY tag and is not at the beginning of the playlist.");if(_.Y.od(a[0].Y,_.Oa)||null===d){if((d=zN.Bg(a[0].Y,
64
- b,c))&&d.type===HL){if(1<zN.Oh(a))throw new _.P(_.Q,4,4046,EL+((e?"playlist":"discontinuity")+"."));return[d]}a=zN.Yi(a,b,c);return 0===a.length?[{type:_.Ye,keyInfo:null,drmInfos:[],keyId:null}]:a}b=zN.Yi(a,b,c);if(d.type===_.Ye||d.type===GL)return[d].concat(_.gh(b));if(0<zN.Oh(a))throw new _.P(_.Q,4,4046,EL+((e?"playlist":"discontinuity")+"."));return[d]},ta:function(a){if(0===a.length)return{type:_.Ye,keyInfo:null,drmInfos:[],keyId:null};if(a.some(function(c){return c.type===HL})||a.every(function(c){return c.type===
65
- _.Ye}))return a[0];a=a.filter(function(c){return c.type===GL});var b=_.Fi(a.flatMap(function(c){return c.drmInfos}));return{keyInfo:null,keyId:a[a.length-1].keyId,type:GL,drmInfos:b}},Nj:function(a){a=zN.Yh(a);if(a.some(function(b){return zN.ni(b)})&&1<a.length)throw new _.P(_.Q,4,4046,"Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one playlist.");},ni:function(a){return _.Y.Ub(a.Y,_.Oa).some(function(b){return"AES-128"===_.tj(b,BL)})},Yi:function(a,b,c){return zN.Yh(a).map(function(d){return zN.Bg(d.Y,
66
- b,c)})},Oh:function(a){return a.filter(function(b){return _.Y.od(b.Y,_.Oa)}).length},Yh:function(a){return a.filter(function(b){return _.Y.od(b.Y,_.Oa)})},Bg:function(a,b,c){a=_.Y.Ub(a,_.Oa);if(0===a.length)return null;var d=_.uj(a[0],BL);if(1===a.length){if("NONE"===d)return{type:_.Ye,keyInfo:null,drmInfos:[],keyId:null};if("AES-128"===d)return a=a[0],d=_.tj(a,"IV",""),{type:HL,keyInfo:{method:"AES-128",url:_.Y.Qd(b,_.uj(a,_.$b)),iv:d?_.Uj((d||"0x").slice(2)):null},drmInfos:[],keyId:null}}b=a.map(function(e){return _.uj(e,
67
- BL)});if(!b.every(function(e){return"SAMPLE-AES"===e})&&!b.every(function(e){return e===CL}))throw zN.g.warn("EXT-X-KEY methods "+b.join(", ")+" are incompatible."),new _.P(_.Q,4,4044,"Multiple EXT-X-KEY tags with incompatible METHOD values.");b=a.map(function(e){var f=_.tj(e,"KEYFORMAT","identity"),g=IN[f]||null;(e=g?g(e,c):null)||zN.g.warn("Unsupported HLS KEYFORMAT",f);return e}).filter(Boolean);if(0===b.length)throw new _.P(_.Q,4,4026);return{keyInfo:null,keyId:b.map(function(e){return e.keyIds}).reduce(function(e,
68
- f){return e.concat(f)},[]).reverse()[0]||null,type:GL,drmInfos:b}},fp:function(){return{type:_.Ye,keyInfo:null,drmInfos:[],keyId:null}}};zN.g=new _.K("clpp.hls.EncryptionUtils");jM.prototype.length=function(){return this.streams.length};jM.prototype.f=function(){return this.streams[0].groupId};jM.prototype.a=function(){return this.streams[0].type};jM.prototype.Zb=function(){return this.streams[0].uc};rM.prototype.length=function(){return this.a.length};_.t=EM.prototype;_.t.configure=function(a){this.a=a;this.U.a=a};_.t.setCurrentVariant=function(a){this.l=a};_.t.start=function(a,b){var c=this,d,e,f,g,h;return _.I(function(l){if(1==l.a){if(c.M)throw Error("start() may be called only once!");c.M=!0;c.D=b;return _.y(l,rN(c,a),2)}if(3!=l.a)return d=l.f,e=d.response,f=d.text,c.A=e.uri,_.y(l,MM(c,f),3);g=l.f;c.C=g;h=c.H;c.j&&0<h&&c.j.ea(h);return l["return"](g)})};_.t.requestStop=function(){this.L=!0};
69
- _.t.stop=function(){this.j&&(this.j.stop(),this.j=null);var a=[];this.G&&(a.push(this.G.destroy()),this.G=null);this.f.clear();this.C=this.a=this.D=this.l=null;this.w.clear();return Promise.all(a)};
70
- _.t.update=function(){var a=this,b,c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:b=a.C;if(KM(a)||!b)return p["return"]();c=b.presentationTimeline;"LIVE"===a.o&&(a.B=null);d=Array.from(a.f.values());a.a.lowLatencyMode&&null!==a.l&&(e=FM(a),d=d.filter(function(q){return e.includes(q.Zb())}));return _.y(p,cN(a,d),2);case 2:return f=p.f,g=f.map(function(q){return q.playlist}),UM(a,g),_.y(p,PM(a,f),3);case 3:h=p.f;tM(b.periods,h).forEach(function(q){a.D.filterNewPeriod(q)});JM(a,h);l=ZM(a,
71
- g);m=$M(a,g,l);b.cues=GM(a,m);vM(b.periods,h);LM(c,h);if(n=_.Y.gm(g))!0!==a.a.keepTimelineLive&&(a.o=_.gc,_.WE(c,!0),c.f=h[h.length-1].endTime),a.j.stop(),a.j=null;if(a.D.onUpdate)a.D.onUpdate(b);if(n&&a.D.onTurnedStatic)a.D.onTurnedStatic();if(!a.L){p.F(4);break}return _.y(p,a.stop(),4);case 4:return p["return"](b)}})};
72
- _.t.cc=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){a.g.debug(_.vD);if(!a.D)return d["return"]();_.C(d,2);return _.y(d,a.update(),4)}if(2!=d.a)return a.j&&0<a.H&&a.j.ea(a.H),_.uh(d,0);b=_.E(d);if(!(b instanceof _.P))throw b;a.D&&(a.D.onError(b),c=b,1===c.severity&&a.j&&a.j.ea(.1));_.B(d)})};_.t.Vf=function(a){if(!this.G)throw new _.P(_.Q,7,7001);a=this.D.networkingEngine.fetch(a);_.uk(this.G,a);return a.T};_.x(GN,_.ku);GN.prototype.f=function(){_.Nu.m3u8=EM;_.Lu[_.hm]=EM;_.Lu[FL]=EM};GN.prototype.a=function(){_.SF("m3u8");_.TF(_.hm);_.TF(FL)};GN.prototype.id=function(){return"hls"};_.J("clpp.hls.HlsComponent",GN);};
2
+ var f=function(window){var dM="Could not parse MP4 segment start time.",eM="Failed to infer discontinuity number",fM="Guessing audio-only",gM="METHOD",hM="SAMPLE-AES-CTR",iM="Setting playlist start time to ",jM="Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one ",kM="application/vnd.apple.mpegurl",lM="sample",mM="whole-segment",nM=function(a){if(1>a.a)throw _.un();--a.a},oM=function(a){a=_.Gj(a)||"";return null!=_.Hj.video[a]?_.r:null!=_.Hj.audio[a]?_.cd:null},pM=function(a,b,c,d){if(1===b){if(!d||0===d.length)throw new _.O(_.P,
3
+ 4,4043,"Media playlist must have at least one segment!");if(null==d[0].a)throw new _.O(_.P,4,4043,"Media playlist must have at least one full segment!");}this.a=a;this.verbatimUri="";this.type=b;this.$=c;this.S=1===b?d:null},qM=function(a,b,c){c=void 0===c?[]:c;this.$=b;this.a=a;this.f=c;this.oa=-1},rM=function(a){a=_.w(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value,b.startsWith("#EXT-")&&(b=_.qk(0,b),_.sw.has(b.name)))return 1;return 0},sM=function(a,b){var c=new Map,d=new URL(b);a.forEach(function(e){var f=
4
+ _.S(e,_.wb),g=_.S(e,"QUERYPARAM");if(f)g=_.Kj(e,"VALUE"),c.set(f,g);else if(g){f=d.searchParams.get(g);if(null==f)throw new _.O(_.P,4,4044,"Query param '"+g+"' missing in playlist URI.");if(!f)throw new _.O(_.P,4,4044,"Query param '"+g+"' has no associated value in playlist URI.");c.set(g,decodeURIComponent(f))}});return c},tM=function(a,b){return a.replace(/\{\$([a-zA-Z0-9_-]+)\}/g,function(c,d){var e=b.get(d);if(null==e)throw new _.O(_.P,4,4044,"Undefined variable '"+d+"'");return e})},uM=function(a,
5
+ b){a.forEach(function(c){c.attributes.forEach(function(d){d.value=tM(d.value,b)})})},vM=function(a,b,c){uM(a,c);b.forEach(function(d){d.a&&(d.a=tM(d.a,c));uM(d.$,c);uM(d.f,c)})},wM=function(){this.h=0;this.a=new Map},zM=function(a,b,c){b=b.trim().split(/\n+/m).map(function(d){return d.trim()}).filter(function(d){return d.length&&!_.Y.Ei(d)});if(!/^#EXTM3U($|[ \t\n])/m.test(b[0]))throw new _.O(_.P,4,4015);return 0===rM(b)?xM(a,b,c):yM(a,b,c)},yM=function(a,b,c){for(var d=[],e=1;e<b.length;){var f=
6
+ AM(a,b[e]);if(_.tw.has(f.name))break;d.push(f);e++}b=BM(a,c,b.slice(e));e=b.S;d=d.concat(b.$);a=CM(a,d,c);vM(d,e,a);return new pM(c,1,d,b.S)},xM=function(a,b,c){for(var d=[],e=1;e<b.length;e++){var f=AM(a,b[e]);d.push(f);if(f.name===_.$a){var g=b[e+1];if(!g)throw new _.O(_.P,4,4044,"EXT-X-STREAM-INF is not followed by a URI.");f.attributes.push(new _.Lj(_.bc,g));e++}}b=_.Y.ac(d,"EXT-X-DEFINE");_.Y.Bj(b);b=sM(b,c);a.a=b;vM(d,[],a.a);return new pM(c,0,d)},DM=function(a,b,c){var d=[],e=[];e.push(new _.Lj(_.pa,
7
+ "0"));e.push(new _.Lj(_.bc,b));c.length&&e.push(new _.Lj(_.ta,c));d.push(new _.Jj(a.h++,_.$a,e));return new pM(b,0,d)},BM=function(a,b,c){var d=[],e=[],f=[],g=[];c.forEach(function(h){/^(#EXT)/.test(h)?(h=AM(a,h),_.sw.has(h.name)||_.vw.has(h.name)?d.push(h):_.uw.has(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===_.Xa&&"PART"===_.S(h,_.$b)&&g.push(h):f.push(h)):_.Y.Ei(h)||(h=_.Y.Vd(b,h.trim(),!1),e.push(new qM(h,f,g)),f=[],g=[])});0<g.length&&e.push(new qM(null,f,g));return{S:e,$:d}},AM=function(a,
8
+ b){return _.qk(a.h++,b)},CM=function(a,b,c){b=_.Y.ac(b,"EXT-X-DEFINE");_.Y.Bj(b);var d=sM(b,c);b.map(function(e){return _.S(e,"IMPORT")}).filter(Boolean).forEach(function(e){var f=a.a.get(e);if(null==f)throw new _.O(_.P,4,4044,"Cannot import variable '"+e+"' as it is not defined in the master playlist");d.set(e,f)});return d},EM=function(a){var b=void 0===b?0:b;return 0>a?[]:Array.from({length:a},function(c,d){return d+b})},FM=function(a,b){b=void 0===b?0:b;return b+10<=a.length&&73===a[b]&&68===
9
+ a[b+1]&&51===a[b+2]&&255>a[b+3]&&255>a[b+4]&&128>a[b+6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1},GM=function(){this.a=new Map;this.f=new Map},HM=function(a){function b(l,m,n){for(var p="";m<n;m++)p+="%"+("00"+l[m].toString(16)).slice(-2);return p}function c(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]}function d(){throw new _.O(_.P,4,4030);}FM(a)||d();var e=10;a[5]&64&&(e=e+4+c(a.subarray(10,14)));do{var f=c(a.subarray(e+4,e+8));1>f&&d();var g=String.fromCharCode(a[e],a[e+1],a[e+2],a[e+3]);if("PRIV"===
10
+ g){g=a.subarray(e+10,e+f+10);for(var h=0;h<g.byteLength;h++)if(0===g[h]){if("com.apple.streaming.transportStreamTimestamp"===unescape(b(g,0,h)))return a=g.subarray(h+1),f=(a[3]&1)<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2,f*=4,f+=a[7]&3,Math.round(f/9E4);break}}FM(a,e)||d();e+=10;e+=f}while(e<a.byteLength);return d()},IM=function(a){for(;a.getPosition()<a.Wa()-1;){var b=a.getPosition();if(71===_.vn(a))return nM(a),b}return-1},JM=function(a){function b(){d.seek(e+188);f=_.vn(d);71!==f&&(d.seek(e+192),
11
+ f=_.vn(d));71!==f&&(d.seek(e+204),f=_.vn(d));71!==f&&c();nM(d)}function c(){throw new _.O(_.P,4,4030);}var d=new _.sn(new DataView(a),!1),e=0,f=0;e=IM(d);0>e&&(_.Sw.error("Unable to find sync byte in TS after scanning."),c());for(;;)if(e=d.getPosition(),f=_.vn(d),71!==f&&c(),a=_.wn(d),8191===(a&8191))b();else if(a&16384)if(a=(_.vn(d)&48)>>4,0!==a&&2!==a||c(),3===a&&(a=_.vn(d),d.skip(a)),1!==_.xn(d)>>8)b();else{d.skip(3);a=_.vn(d)>>6;0!==a&&1!==a||c();0===_.vn(d)&&c();a=_.vn(d);var g=_.wn(d),h=_.wn(d);
12
+ return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},KM=function(a,b){var c=null,d=0;try{(new _.Cn).N(_.bf,_.Dn).N(_.Ig,_.Dn).N(_.Xe,_.Dn).aa("mdhd",function(g){g.reader.skip(0===g.version?8:16);d=_.xn(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=g}if(c||!d)throw _.Sw.error("Unable to find timescale in init segment!"),new _.O(_.P,4,4030,dM,c);var e=0,f=!1;try{(new _.Cn).N("moof",_.Dn).N("traf",_.Dn).aa("tfdt",function(g){var h=d;if(0===g.version)h=_.xn(g.reader)/h;else{var l=
13
+ _.xn(g.reader),m=_.xn(g.reader);if(!(2097151>=l||h>=Math.pow(2,12)))throw Error("Cannot accurately parse MP4 timestamp, base time is too high and timescale is \x3c\x3d 2^12");h=l/h*Math.pow(2,32)+m/h}e=h;f=!0;g.parser.stop()}).parse(a,!0)}catch(g){c=g}if(c||!f)throw new _.O(_.P,4,4030,dM,c);return e},NM=function(a){var b=_.Kj(a,gM);if(!LM.includes(b))return MM.error("PlayReady in HLS is only supported with [",LM.join(", "),"], not",b),null;a=_.Kj(a,_.bc);b=_.Bv(a);a=null;b=_.Xj(b.data);try{a=_.qE(_.kp(b))}catch(c){a=
14
+ b}return _.EE(_.Vd,[{initDataType:_.vd,initData:a}],"")},OM=function(a){this.g=new _.K("clpp.hls.MediaReader");this.f=a;this.a={attemptParameters:_.sk()}},QM=function(a,b,c,d,e,f){var g,h,l,m,n,p,q,u;return _.I(function(v){switch(v.a){case 1:a.g.debug("Fetching segment to find start time");if("audio/mpeg"===d||d===_.fd||d===_.ed)return v["return"](0);g=f;if(d!==_.dd){v.F(2);break}return _.y(v,PM(a,c,g),3);case 3:h=v.f;l=_.Xj(h.data);if(!FM(l))throw new _.O(_.P,4,4030,"AAC segment does not contain an ID3 tag.");
15
+ return v["return"](HM(l));case 2:if(d!==_.Yg&&d!==_.gd){v.F(4);break}m=[PM(a,c,g)];b&&m.push(PM(a,b,!0));return _.y(v,Promise.all(m),5);case 5:return n=v.f,p=n[0],q=n[1]||n[0],v["return"](KM(p.data,q.data));case 4:if(d!==_.Xg){v.F(6);break}return _.y(v,PM(a,c,g),7);case 7:return u=v.f,v["return"](JM(u.data));case 6:if(!_.Bu((d.split("/")[0]||"")+'/mp4;codecs\x3d"'+e+'"'))return v["return"](0);throw new _.O(_.P,4,4030);}})},PM=function(a,b,c){var d,e,f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:return d=
16
+ b.f(),e=_.kF(b.eb(),b.Da,b.Da+2048-1,a.a.attemptParameters),e.type=2,f=_.kF(b.eb(),b.Da,b.pa,a.a.attemptParameters),f.type=2,d&&(f.keyInfo=d),_.C(n,2),g=c?f:e,_.y(n,a.f(g),4);case 4:return h=n.f,n["return"](h);case 2:l=_.E(n);if(7001===l.code||c)throw l;a.g.warn("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS pre-flights.",e.uris[0]);_.C(n,5);return _.y(n,a.f(f),7);case 7:return n["return"](n.f);
17
+ case 5:throw m=_.E(n),a.g.error("Failed to fetch media segment to parse its start timestamp.",f.uris[0],m),new _.O(_.P,4,4030,"Failed to fetch the media segment.");}})},RM=function(a){this.streams=a},SM=function(a,b){a.streams.forEach(function(c){c.Rf=b})},TM=function(a,b){a.streams.forEach(function(c){c.width=b})},UM=function(a,b){a.streams.forEach(function(c){c.height=b})},VM=function(a,b){a.streams.forEach(function(c){c.frameRate=b})},WM=function(a,b){a.streams.forEach(function(c){c.bandwidth=
18
+ b})},XM=function(a,b){var c=a.streams.find(function(d){d=d.S;return d[0].position<=b&&b<=d[d.length-1].position});return null==c?null:c.S.find(function(d){return d.position===b})||null},YM=function(a,b){var c=a.map(function(d){return d.streams[b]});return c.some(function(d){return null==d})?null:c},ZM=function(a){this.a=a},$M=function(a,b){var c=a.map(function(d){return d.a[b]});return c.some(function(d){return null==d})?null:c},aN=function(a,b){var c=new Set(a.map(function(d){return d.oa}));return b.filter(function(d){return!c.has(d.oa)})},
19
+ cN=function(a,b){for(;a[0].oa<b[0].oa;)a.splice(0,1);var c=a[0],d=b[0];c.startTime===d.startTime&&c.endTime===d.endTime||bN(c,d);var e=a.length-1;c=a[e];d=b[e];0<e&&(c.startTime!==d.startTime||c.endTime!==d.endTime)&&bN(c,d);for(c=e+1;c<b.length;)a.push(b[c]),c++},hN=function(a,b,c,d,e){var f=b[0].length();f=EM(f).map(function(g){var h=$M(b,g)||[],l=YM(c,g)||[];g=YM(d,g)||[];var m=_.th(dN(h)).concat(_.th(l),_.th(g)).filter(Boolean);eN(m);var n=m[0];m=n.oa;n=n.duration;return{configurationId:a,variants:h,
20
+ textStreams:l,thumbStreams:g,startTime:0,id:"P"+m,endTime:n,duration:n,oa:m}});e&&fN(f[0]);gN(f);return f},dN=function(a){a=new Set(a.flatMap(function(b){return[b.video,b.audio]}).filter(Boolean));return Array.from(a)},fN=function(a){var b=dN(a.variants)[0].S[0].Ja;a.startTime+=b;a.endTime+=b},gN=function(a){for(var b=0;b<a.length;b++){var c=a[b],d=a[b-1];c.startTime=d?d.endTime:c.startTime;c.endTime=c.startTime+c.duration}},bN=function(a,b){a.startTime=b.startTime;a.endTime=b.endTime;a.duration=
21
+ b.duration;iN(a.variants,b.variants);jN(_.Y.Cf(a),_.Y.Cf(b))},iN=function(a,b){var c=new Map(a.map(function(d){return[_.Y.Vh(d),d]}));b.forEach(function(d){c.get(_.Y.Vh(d)).drmInfos=d.drmInfos})},jN=function(a,b){var c=new Map(a.map(function(d){return[d.zc,d]}));b.forEach(function(d){var e=c.get(d.zc);e.S=d.S;d.S.forEach(function(f){f.initSegment=e.initSegmentReference});e.segmentIndex.replace(d.S);e.rc=d.rc;e.jf=d.jf;e.duration=d.duration;e.$h=d.$h;e.encrypted=d.encrypted;e.drmInfos=d.drmInfos;e.keyId=
22
+ d.keyId})},eN=function(a){var b=kN(a);a.forEach(function(c){_.fF(c.segmentIndex,b);c.duration=b;c.jf=c.rc+b})},kN=function(a){var b=Infinity;_.Y.Ol(a).forEach(function(c){b=Math.min(b,c.duration)});return b},lN=function(){var a=this;this.a=this.D=null;this.h=1;this.f=new GM;this.A="";this.U=new wM;this.H=0;this.l=null;this.j=new _.li(function(){a.ic()});this.o=_.jc;this.C=null;this.G=new _.Jk;this.K=this.B=null;this.g=new _.K("clpp.hls.HlsParser");this.L=new Map;this.Y=new OM(this.ag.bind(this));
23
+ this.P=!1;this.I=null;this.M=!1;this.w=new Map;this.J=new Set},mN=function(a){if(null===a.l)return[];a=a.l;return[a.audio,a.video].filter(function(b){return b}).map(function(b){return b.zc})},nN=function(a,b){var c=new Set(b.map(function(h){return h.id}));a.w.forEach(function(h,l){c.has(l)||a.w["delete"](l)});for(var d=_.w(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=a.w.get(e.id);if(f&&f.startTime!==e.startTime)a.D.onError(new _.O(1,4,4044,"EXT-X-DATERANGE START-DATE has changed for ID\x3d"+
24
+ e.id));var g={configurationId:a.D.configurationId,schemeIdUri:e.schemeIdUri,customAttributes:e.customAttributes,value:"",startTime:e.startTime,endTime:e.endTime,id:e.id,type:_.Pi,eventElement:null};f&&!_.N.Li(f,g)||a.w.set(e.id,g)}return Array.from(a.w.values())},wN=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v,z,A,H,G,D,F;return _.I(function(M){switch(M.a){case 1:return c=_.dr,d=oN(a,b,a.A,""),1===d.type&&(e=d.S[0].a,f=oM(e),g="",f===c.VIDEO?g="avc1.42E01E":f===c.AUDIO&&(g="mp4a.40.2"),d=DM(a.U,a.A,
25
+ a.a.hlsDefaultCodecs||g)),h=_.Y.Tn(d.$),l=pN(h.Pc.rh),l.forEach(function(R){a.J.add(R.groupId)}),_.y(M,qN(a,h),4);case 4:m=M.f;M.F(3);break;case 5:m=M.f;case 3:n=m;p=n.Lm;q=n.periods;u=n.fo;v=n.Ho;z=n.alternativeVariants;A=n.alternativeTextStreams;H=n.alternativeImageStreams;if(!a.D)throw new _.O(_.P,7,7001);rN(a,q);G=sN(a,p.delay,q,u);tN(a)||(a.H=p.Fe,uN(a));vN(a,G,q);D=nN(a,v);F={presentationTimeline:G,periods:q,minBufferTime:0,cues:D,muxedAudioTracks:l};z&&(F.alternativeVariants=z);A&&(F.alternativeTextStreams=
26
+ A);H&&(F.alternativeImageStreams=H);a.g.debug("HLS playlist parsed",F);return M["return"](F)}})},pN=function(a){return a.filter(function(b){return b.name===_.Ta&&_.S(b,_.$b)===_.ja&&!_.S(b,_.bc)}).map(function(b){var c=_.Y.ii(b),d=_.S(b,_.pb)||_.Lg;return{groupId:_.Kj(b,_.fb),id:_.cM++,label:_.Kj(b,_.wb),language:d,channelsCount:c,primary:"YES"===_.S(b,"DEFAULT")}})},zN=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a)return c=_.Y,_.y(p,xN(a,b),2);d=p.f;e=d.textStreams;f=d.thumbStreams;
27
+ g=d.Yj;h=a.C.periods[0].variants;a.a.lowLatencyMode&&null!==a.l&&(h=h.filter(function(q){return q.id===a.l.id}));l=h.map(function(q){var u=c.ei(q.audio,g),v=c.ei(q.video,g);q=yN(a,u,v,q.bandwidth);if(!q)throw new _.O(_.P,4,4047,{message:"Video and audio are encrypted in an incompatible way.",Fp:v?v.ec():void 0,audio:u?u.ec():void 0});return q});m=a.D.configurationId;n=hN(m,l,e,f,!0);return p["return"](n)})},xN=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a)return c=_.dr,d=function(q){return q.stream.a()===
28
+ c.VIDEO||q.stream.a()===c.AUDIO},e=b.filter(d),f=b.filter(function(q){return!d(q)}),g=function(q){q=q.map(function(u){var v=u.stream.streams[0];u=Object.assign({},{playlist:u.playlist},{language:v.language,channelsCount:v.channelsCount,spatialAudio:v.spatialAudio,closedCaptions:v.closedCaptions,primary:v.primary,kind:v.kind||null,groupId:v.groupId,type:v.type,codecs:v.codecs,name:v.originalId,uri:v.zc,Ff:{width:v.width,height:v.height,frameRate:v.frameRate}});return AN(a,u)});return Promise.all(q)},
29
+ _.y(p,g(e),2);if(3!=p.a)return h=p.f,_.y(p,g(f),3);l=p.f;BN(a,h.concat(l));m=l.filter(function(q){return q.a()===c.Oj});n=l.filter(function(q){return q.a()===c.IMAGE});return p["return"]({textStreams:m,thumbStreams:n,Yj:h})})},BN=function(a,b){b.forEach(function(c){a.f.a.set(c.ec(),c)})},qN=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v,z,A,H,G;return _.I(function(D){switch(D.a){case 1:return c=_.Y,d=c.Mn(b.Pc.closedCaptions),e=CN(a,b.He),_.y(D,DN(a,b),2);case 2:return f=D.f,g=Object.values(f).flat().map(function(F){return F.playlist}),
30
+ EN(a,g),h=g[0],l=c.jj(h.$),a.o=l,a.K=c.kj(h.$),m=c.Sn(h.$,l,a.a.lowLatencyMode||!1,a.a.suggestedPresentationDelay,a.a.liveRefreshPeriod),_.y(D,FN(a,f.sh,e),3);case 3:return n=D.f,_.y(D,GN(a,f.He,n,d),4);case 4:return p=D.f,_.y(D,HN(a,f.Do,e),5);case 5:return q=D.f,_.y(D,IN(a,f.og),6);case 6:return u=D.f,v=a.D.configurationId,z=hN(v,p,q,u,!tN(a)),a.D.filterAllPeriods(z),A=_.th(f.He).concat(_.th(f.sh)).map(function(F){return F.playlist}),H=JN(a,A),G=KN(a,A,H),D["return"]({periods:z,fo:H,Ho:G,Lm:m})}})},
31
+ rN=function(a,b){tN(a)||2!==a.a.timeline.version||(a.I||(a.I=b[0].startTime),_.OG(b,-a.I))},KN=function(a,b,c){b=b.find(function(d){return null!==_.Y.cb(d.$,_.Na)});if(!b)return[];if(null===c)throw new _.O(_.P,4,4024,"EXT-X-PROGRAM-DATE-TIME tag is required when EXT-X-DATERANGE tags are present");return b.$.filter(function(d){return d.name===_.Na}).map(function(d){return _.Y.Nn(d,c,a.B,!tN(a))}).filter(Boolean)},JN=function(a,b){var c=b.flatMap(function(e){return e.S[0].$});c=_.Y.cb(c,_.Ya);if(!c)return null;
32
+ var d=(new Date(c.value)).getTime();return isNaN(d)?(a.g.warn("Failed to parse EXT-X-PROGRAM-DATE-TIME tag value (value: "+(c.value+").")),null):d/1E3},DN=function(a,b){var c,d,e,f,g,h;return _.I(function(l){if(1==l.a)return _.y(l,Promise.all([LN(a,b.Pc.rh),LN(a,b.Pc.Eo),LN(a,b.He),LN(a,b.og)]),2);c=l.f;d=_.w(c);e=d.next().value;f=d.next().value;g=d.next().value;h=d.next().value;return l["return"]({sh:e,Do:f,He:g,og:h})})},NN=function(a,b){return Promise.all(b.map(function(c){return MN(a,c)}))},CN=
33
+ function(a,b){for(var c=_.Y.Xe,d=new Map,e=_.w(b),f=e.next();!f.done;f=e.next()){var g=f.value,h=_.S(g,_.ja);f=_.S(g,_.ic);var l=_.S(g,_.Sb);g=ON(a,g);if(l){var m=_.Fj(_.Q,g);d.set(c(_.Q,l),m);l=g.indexOf(m);-1<l&&g.splice(l,1)}h&&(l=PN(_.cd,g),d.set(c(_.cd,h),l));f&&(h=PN(_.r,g),d.set(c(_.r,f),h))}return d},HN=function(a,b,c){return Promise.all(b.map(function(d){return QN(a,d,c)}))},IN=function(a,b){return Promise.all(b.map(function(c){return RN(a,c)}))},FN=function(a,b,c){var d,e;return _.I(function(f){if(1==
34
+ f.a){if(0===b.length)return f["return"](new Map);d=[QN(a,b[0],c)];return _.y(f,d[0],2)}if(3!=f.a)return d=d.concat(b.slice(1).map(function(g){return QN(a,g,c)})),_.y(f,Promise.all(d),3);e=f.f;return f["return"](_.Y.Io(e))})},GN=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,u,v;return _.I(function(z){if(1==z.a){e=new Set;f=_.th(b).concat();g=0;h=Infinity;for(l=0;l<f.length;++l)m=Number(_.Kj(f[l].tag,_.pa)),m<h&&(h=m,g=l);n=f.splice(g,1).pop();return _.y(z,SN(a,n,c,d,e),2)}if(3!=z.a)return p=z.f,q=f.map(function(A){return SN(a,
35
+ A,c,d,e)}),_.y(z,Promise.all(q),3);u=z.f;u.splice(g,0,p);v=u.reduce(_.BE,[]);return z["return"](v)})},SN=function(a,b,c,d,e){var f,g,h,l,m,n;return _.I(function(p){return 1==p.a?(f=_.Y,g=b,h=g.tag,l=Number(_.Kj(h,_.pa)),m=f.Wn(h),_.y(p,TN(a,b,m,c,d),2)):(n=p.f)?p["return"](UN(a,n,l,e)):p["return"]([])})},VN=function(a,b,c,d,e,f){var g=ON(a,b);a.g.debug("Guessing stream type for",b.toString());b=!1;var h=_.Fj(_.r,g),l=d+e;1!==g.length||c||h?!l&&1<g.length?(a.g.debug("Guessing multiplexed audio+video"),
36
+ c=_.r,g=[g.join(",")]):d&&f?(a.g.debug(fM),c=_.cd,b=!0):e?(a.g.debug(fM),c=_.cd):(a.g.debug("Guessing video-only"),c=_.r):(c=_.cd,a.g.debug(fM));return{type:c,Wj:g,vm:b}},TN=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,u,v,z,A,H,G,D,F,M;return _.I(function(R){if(1==R.a)return f=_.dr,g=_.Y.Xe,h=b,l=h.tag,m=h.playlist,n=_.S(l,_.ja),p=_.S(l,_.ic),q=n?d.get(g(f.AUDIO,n))||[]:[],u=p?d.get(g(f.VIDEO,p))||[]:[],v={audio:q,video:u},z=m.verbatimUri,A=v.audio.find(function(la){return la.ec()===z}),H=VN(a,l,c,v.audio.length,
37
+ v.video.length,A),G=H.type,D=H.Wj,F=H.vm,M=null,F?R.F(2):_.y(R,WN(a,b,D,G,e,c),3);2!=R.a&&(M=R.f);if(null==M)return R["return"](null);v[G]=[M];G===f.AUDIO&&c&&v.video.forEach(function(la){TM(la,c.width);UM(la,c.height);VM(la,c.frameRate)});return R["return"](v)})},UN=function(a,b,c,d){var e=b.video,f=b.audio;e=0<e.length?e:[null];b=[];f=_.w(0<f.length?f:[null]);for(var g=f.next();!g.done;g=f.next()){g=g.value;for(var h=_.w(e),l=h.next();!l.done;l=h.next()){var m=l.value;l=_.Y.Fl(g,m);d.has(l)?a.g.debug("Skipping variant which only differs in text streams."):
38
+ (m=yN(a,g,m,c),null==m?a.g.warn("Incompatible DRM info in HLS variant. Skipping."):(b.push(m),d.add(l)))}}return b},yN=function(a,b,c,d){for(var e=[],f=(c||b).length(),g=0;g<f;g++){var h=b?b.streams[g]||null:null,l=c?c.streams[g]||null:null,m=_.Y.am(h,l);if(!m)return null;var n=d;h={id:a.h++,language:h?h.language:_.Lg,primary:!!h&&h.primary||!!l&&l.primary,audio:h,video:l,bandwidth:n,drmInfos:m,allowedByApplication:!0,allowedByKeySystem:!0};e.push(h)}return new ZM(e)},QN=function(a,b,c){var d,e,f,
39
+ g;return _.I(function(h){d=b;e=d.tag;f=d.playlist;g=f.verbatimUri;return h["return"](XN(a,g,function(){var l,m,n,p,q,u,v,z,A,H,G,D,F;return _.I(function(M){if(1==M.a){l=_.dr;m=_.Y.Xe;n=_.Kj(e,_.fb);p=_.Y.Th(_.Kj(e,_.$b));q=_.Y.Bl(e);u=c.get(m(p,n))||"";v=_.S(e,_.pb);z=_.S(e,_.wb);A=_.S(e,"DEFAULT");H=p===l.AUDIO?_.Y.ii(e):null;var R=p===l.AUDIO?(R=_.S(e,"CHANNELS"))?R.includes("/JOC"):!1:!1;G=R;D="YES"===A;return _.y(M,AN(a,{playlist:f,codecs:u,type:p,re:v,primary:D,name:z,channelsCount:H,spatialAudio:G,
40
+ groupId:n,kind:q,Sc:null,closedCaptions:null,Ff:null}),2)}F=M.f;return M["return"](F)})}))})},RN=function(a,b){var c,d,e,f;return _.I(function(g){c=b;d=c.tag;e=c.playlist;f=e.verbatimUri;return g["return"](XN(a,f,function(){var h,l,m,n,p;return _.I(function(q){if(1==q.a)return h=_.S(d,_.ta)||"jpg",l=_.S(d,_.pb),m=_.S(d,_.wb),_.y(q,AN(a,{playlist:e,codecs:h,type:_.He,re:l,name:m,primary:!1,kind:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,Sc:null,groupId:null,Ff:null}),2);n=q.f;(p=_.S(d,
41
+ _.pa))&&WM(n,Number(p));return q["return"](n)})}))})},ON=function(a,b){var c=_.S(b,_.ta,a.a.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/);c=_.Y.Jl(c);var d=new Set,e=[];c=_.w(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.NE(f);d.has(g)?a.g.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},WN=function(a,b,c,d,e,f){var g,h,l,m,n;return _.I(function(p){g=b;h=g.tag;l=g.playlist;m=_.dr;n=l.verbatimUri;return p["return"](XN(a,n,function(){var q,u,v,z,A;return _.I(function(H){if(1==
42
+ H.a){q=_.S(h,_.sa);u=null;d===m.VIDEO&&q&&"NONE"!==q&&(u=e.get(q));var G=_.S(h,_.ja)||void 0;v=G&&a.J.has(G)?G:void 0;G=PN(d,c);if(v){var D=PN(_.cd,c);G+=","+D}z=G;return _.y(H,AN(a,{playlist:l,codecs:z,type:d,closedCaptions:u,primary:!1,kind:null,re:null,name:null,channelsCount:null,spatialAudio:!1,Sc:null,groupId:null,muxedAudioId:v,Ff:f}),2)}A=H.f;return H["return"](A)})}))})},XN=function(a,b,c){if(a.f.has(b))return a=a.f.get(b),Promise.resolve(a);if(a.f.f.has(b))return a.f.f.get(b)||null;c=c();
43
+ a.f.set(b,c);return c},AN=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v,z,A,H,G,D,F,M,R,la,V,za;return _.I(function(Ia){if(1==Ia.a){c=YN;d=ZN;e=_.dr;f=b;g=f.playlist;h=f.codecs;l=f.type;m=f.re;n=f.Sc;p=f.groupId;q=f.muxedAudioId;u=f.primary;v=f.kind;z=f.name;A=f.channelsCount;H=f.spatialAudio;G=f.closedCaptions;D=f.Ff;F=_.Y.mi(m);if(1!==g.type)throw new _.O(_.P,4,4017);return _.y(Ia,$N(a,g,l,h),2)}M=Ia.f;R=a.a.lowLatencyMode?d.Ij:d.Kj;la=v;l!==e.TEXT||v||(la=_.wg);V=_.Y.jj(g.$);za=M.map(function(Aa){var Ca=
44
+ Aa.S,La=Aa.Ll,zb=Aa.mimeType;Aa=Aa.oa;var Nd=Ca[0].startTime,Ff=Ca[Ca.length-1].endTime,ei=Ff-Nd,Od=new _.JF(Ca),Jn=Ca[0].initSegment||null;return{id:null===n?_.cM++:n,originalId:z,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:Od.ld.bind(Od),getSegmentReference:Od.get.bind(Od),adjustSegmentDurations:Od.Ld.bind(Od),getDuration:Od.getDuration.bind(Od),segmentIndex:Od,segmentLookupStrategy:R,initSegmentReference:Jn,mimeType:zb,codecs:h,kind:la,$h:La.type,encrypted:La.type===c.Nj,
45
+ aesEncrypted:!!La.keyInfo,keyId:La.keyId,language:F,originalLanguage:m||_.Lg,label:z,type:l,primary:u,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:D?D.frameRate:void 0,width:D?D.width:void 0,height:D?D.height:void 0,bandwidth:void 0,roles:[],channelsCount:A,spatialAudio:H,closedCaptions:G,S:Ca,drmInfos:La.drmInfos,oa:Aa,zc:g.verbatimUri,Rf:g.a,rc:Nd,jf:Ff,duration:ei,groupId:p,zp:V,muxedAudioId:q}});return Ia["return"](new RM(za))})},LN=function(a,b){var c;return _.I(function(d){if(1==d.a)return _.y(d,
46
+ Promise.all(b.map(function(e){var f;return _.I(function(g){if(1==g.a)return _.y(g,aO(a,e),2);f=g.f;return g["return"](f?{tag:e,playlist:f}:null)})})),2);c=d.f;return d["return"](c.filter(Boolean))})},aO=function(a,b){var c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a){c=_.Y.Gm(b);d=_.S(b,_.bc,void 0,{required:c});if(!d)return m["return"](null);e=_.Y.Vd(a.A,d);return _.y(m,bO(a,e),2)}f=m.f;g=f.response;h=f.text;l=g.uri;return m["return"](oN(a,h,l,d))})},MN=function(a,b){var c,d,e,f,g,h,l,m;return _.I(function(n){if(1==
47
+ n.a){var p=new _.rj(b.streams[0].Rf);if(a.a.lowLatencyMode&&a.K&&a.K.wh){var q=b.streams[b.streams.length-1].segmentIndex;if(q=q.a[q.a.length-1]){var u=q.a,v=u.length-1;q={Om:q.position,Xn:u&&0<u.length?v:null}}else q=null;if(u=q)q=u.Om,u=u.Xn,v=_.kl(p.a.toString()),v._HLS_msn=q.toString(),null===u&&v._HLS_part&&delete v._HLS_part,null!==u&&(v._HLS_part=u.toString()),q=_.jl(v,!0),_.uj(p,new _.yj(q))}c=p.toString();return _.y(n,bO(a,c),2)}d=n.f;e=d.response;f=d.text;g=b.ec();h=b.streams[0].Rf;l=e.uri;
48
+ h!==l&&(h=l,SM(b,h));m=oN(a,f,h,g);return n["return"]({stream:b,playlist:m})})},oN=function(a,b,c,d){a=zM(a.U,b,c);a.verbatimUri=d;return a},cO=function(a){if(1<(new Set(a.map(function(b){return b.mimeType}))).size)throw new _.O(_.P,4,4045,"Media playlist contains discontinuities with different MIME types. This is valid, but not yet supported.");},dO=function(a){a=a.map(function(b){return b.a?b.a:b.f.map(function(c){return _.S(c,_.bc)})||null}).map(function(b){return _.Gj(b)});if(1<(new Set(a)).size)throw new _.O(_.P,
49
+ 4,4044,"Unexpected change in file format.");},sN=function(a,b,c,d){var e=!0,f=null,g=0;tN(a)||(e=!1,f=0,g=b);b=a.a.timeline||{};b.type=void 0;a=new _.nF(b,f,g,!0,void 0,!!a.a.lowLatencyMode);_.qF(a,e);eO(a,c);d&&_.pF(a,d);return a},fO=function(a,b,c){a=_.Y.ac(a.$,_.Sa);if(1<a.length)throw new _.O(_.P,4,4020);a=a[0];if(!a)return null;var d=_.Kj(a,_.bc),e=_.Y.Vd(b,d);b=_.Y.hj(a,null,!0);return new _.FE(function(){return[e]},b.Da,b.pa,c)},hO=function(a,b,c,d,e,f,g){var h=[],l={};b=_.w(gO(b.f));for(var m=
50
+ b.next();!m.done;l={Hf:l.Hf},m=b.next()){var n=m.value;m=n.zi;n=n.item;var p=0===m,q=p?a:h[h.length-1],u=p?d:q.endTime,v=Number(_.S(n,_.Ja));v=u+v;p=_.Y.hj(n,p?null:q.pa,p);q=_.S(n,_.bc);q=_.Y.Vd(g,q);l.Hf=q?[q]:[];u=new _.Nj(c,u,v,function(z){return function(){return z.Hf}}(l),p.Da,p.pa,e,f,!1,null,null,null,null);if("YES"===_.S(n,"INDEPENDENT")||0===m)u.h=!0;h.push(u)}return h},iO=function(a,b,c,d,e,f,g,h,l,m,n){var p=c.$,q=c.a;0<_.Y.ac(p,_.Sa).length&&(n=fO(c,l,g));var u=null!=q,v=q?[q]:[];if(!u&&
51
+ !a.a.lowLatencyMode)return null;a=0;q={Da:0,pa:null};var z=null;u?(c=_.Y.Qn(p).duration,a=e+c,q=_.Y.ij(p,b?b.pa:null)):(b=hO(b,c,d,e,f,g,l),a=b[b.length-1].endTime,z=b);h=h===_.He?_.Y.Vn(p):null;d=new _.Nj(d,e,a,function(){return v},q.Da,q.pa,f,g,!1,null,h?h.je:null,h?h.Ge:null,h?h.durationPerTile:null,z,n);d.oa=m;return d},$N=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,u,v,z,A,H;return _.I(function(G){switch(G.a){case 1:return e=_.Y,f=jO,g=kO,h=b.verbatimUri,l=b.S,m=e.em(b.$,_.Ua),n=[],!tN(a)&&g.Xj(l),
52
+ _.y(G,lO(a,b.a,h,l,m,c,d),2);case 2:p=G.f,q=m,u=f.Bo(l),v=0;case 3:if(!(v<u.length)){G.F(5);break}z=u[v];A=n[n.length-1]||null;return _.y(G,mO(a,b.a,z,q,p,c,d,A,u.length),6);case 6:H=G.f;n.push(H);q+=z.length;v++;G.F(3);break;case 5:return cO(n),G["return"](n)}})},lO=function(a,b,c,d,e,f,g){var h,l,m,n,p,q,u,v,z,A,H,G;return _.I(function(D){if(1==D.a){h=d[0];if(null!=a.B)return D["return"](a.B);if(!tN(a)&&a.C)try{var F=a.f.get(c),M=F?XM(F,e)||null:null;if(!M)throw new _.O(_.P,4,4030,"Segment not found in pervious playlist update.");
53
+ l=M.startTime+M.Ja;a.g.debug(iM+l+".");a.B=l;return D["return"](l)}catch(R){if(m=a.f.get(c))n=m.streams[0].S[0].position,D=m.streams[m.streams.length-1].S,p=D[D.length-1].position,q=e,u=e+d.length-1,a.g.warn("Last #EXT-X-MEDIA-SEQUENCE values "+n+" - "+p+(", new values "+q+" - "+u+"."),b,m);throw new _.O(_.P,4,4047,{message:"The updated playlist does not share any segments with the previous one.",uri:c});}return _.y(D,nO(a,f,g,h),2)}if(3!=D.a)return v=D.f,z=kO.Un(h,a.A,v),A=fO(h,b,z.keyInfo),H=_.Y.lg(z.keyInfo,
54
+ e),_.y(D,oO(a,A,h,H,v,g),3);G=D.f;a.g.debug(iM+G+".");a.B=G;return D["return"](G)})},mO=function(a,b,c,d,e,f,g,h,l){var m,n,p,q,u,v,z,A,H,G,D,F,M,R,la,V,za,Ia,Aa,Ca,La;return _.I(function(zb){switch(zb.a){case 1:return m=_.Y,n=kO,p=c[0],q=null==h,dO(c),_.y(zb,nO(a,f,g,p),2);case 2:u=zb.f;v=n.Pn(c,a.A,u,h?h.Km:null,1===l);z=v[v.length-1];A=kO.ua(v);H=fO(p,b,A.keyInfo)||(h?h.xm:null);G=_.Y.lg(A.keyInfo,d);D=p.oa;if(q){F=e;zb.F(3);break}return _.y(zb,pO(a,D,H,p,d,G,u,g),4);case 4:F=zb.f;case 3:M=F;R=
55
+ [];for(la=0;la<c.length;la++)if(V=c[la],za=R[R.length-1]||null,Ia=0===la?0:za.endTime,Aa=d+la,Ca=m.lg(A.keyInfo,Aa),La=iO(a,za,V,Aa,Ia,M,Ca,f,b,D,H))H=La.initSegment,R.push(La);return zb["return"]({S:R,Ll:A,Km:z,mimeType:u,endTime:R[R.length-1].endTime,oa:D,xm:H})}})},EN=function(a,b){b.forEach(function(c){var d=a.f.get(c.verbatimUri);jO.bk(c,d,!tN(a))});jO.Gl(b)},pO=function(a,b,c,d,e,f,g,h){var l;return _.I(function(m){if(1==m.a)return a.L.has(b)?m["return"](a.L.get(b)):_.y(m,oO(a,c,d,f,g,h),2);
56
+ l=m.f;a.g.debug("Segment #"+e+" has raw media timestamp "+(l+" s."));a.L.set(b,l);return m["return"](l)})},oO=function(a,b,c,d,e,f){var g;return _.I(function(h){if(null==c.a)return h["return"](0);g=_.Y.Dl(c,d);return h["return"](QM(a.Y,b,g,e,f,null!=d))})},PN=function(a,b){if(1===b.length)return b[0];var c=_.Fj(a,b);if(null!=c)return c;throw new _.O(_.P,4,4025,{codecList:b});},nO=function(a,b,c,d){var e,f,g;return _.I(function(h){e=d.a;g=(f=_.Y.cb(d.$,_.Sa))?_.Kj(f,_.bc):null;return h["return"](qO(a,
57
+ b,c,e,g))})},qO=function(a,b,c,d,e){var f,g,h,l,m;return _.I(function(n){if(1==n.a){f=[d,e].filter(Boolean);if(g=_.Ij(f,b,c))return n["return"](g);h=_.wk([d],a.a.attemptParameters);h.method="HEAD";h.type=2;return _.y(n,a.ag(h),2)}l=n.f;m=l.headers["content-type"];if(!m)throw new _.O(_.P,4,4021,"Unknown MIME type of: "+f.join(", "));return n["return"](m.split(";")[0])})},vN=function(a,b,c){c=_.Y.gm(c);"LIVE"===a.o||"EVENT"===a.o?(c=Math.max(c,b.K),isNaN(a.a.availabilityWindowOverride)||(c=a.a.availabilityWindowOverride),
58
+ b.A=c):a.o===_.jc&&(b.f=c)},uN=function(a){for(var b=0,c=_.w(a.f.values()),d=c.next();!d.done;d=c.next())b=Math.max(b,d.value.streams[0].rc);for(c=0;95443.7176888889<=b;)c+=95443.7176888889,b-=95443.7176888889;if(c)for(a.g.debug("Offsetting live streams by",c,"to compensate for rollover"),b=_.w(a.f.values()),d=b.next();!d.done;d=b.next())d=d.value.streams[0],95443.7176888889>d.rc?(a.g.debug("Offset applied to",d.type),d.segmentIndex.offset(c)):a.g.debug("Offset NOT applied to",d.type)},bO=function(a,
59
+ b){var c,d,e;return _.I(function(f){if(1==f.a)return c=_.wk([b],a.a.attemptParameters),c.type=1,_.y(f,a.ag(c),2);d=f.f;e="";try{e=_.T.da(d.data)}catch(g){throw new _.O(_.P,4,4042);}e=_.T.Si(e);e=e.trim();return f["return"]({text:e,response:d})})},tN=function(a){return a.o===_.jc},eO=function(a,b){_.Y.Hm(b,function(c,d){_.uF(a,c.S,d.startTime)});_.mF(a.a,b[0].startTime,b[b.length-1].endTime)},rO=function(){},ZN={Ij:_.ZD,Kj:_.YD},YN={Nj:lM,bp:mM,NONE:_.ef},gO=function sO(a){var c,d,e,f,g,h;return _.Ph(sO,
60
+ function(l){1==l.a&&(c=-1,e=d=void 0,f=_.w(a),g=f.next());if(5!=l.a){if(g.done)return-1===c?l.F(0):_.y(l,{zi:c,co:d,item:e,next:void 0},0);h=g.value;return 0<=c?_.y(l,{zi:c,item:e,co:d,next:h},5):l.F(5)}c++;d=e;e=h;g=f.next();return l.F(2)})};_.t=GM.prototype;_.t.set=function(a,b){var c=this;this.f.set(a,b);return b.then(function(d){return c.a.set(a,d)})["catch"](function(){}).then(function(){return c.f["delete"](a)})};_.t.has=function(a){return this.a.has(a)};
61
+ _.t.get=function(a){return this.a.get(a)||null};_.t.values=function(){return Array.from(this.a.values())};_.t.clear=function(){this.f.clear();this.a.clear()};
62
+ var jO={Gl:function(a){var b=jO.Vl(a),c=jO.Jm(a);a.forEach(function(d){var e=d.S,f=e.findIndex(function(h){return h.oa===b}),g=e.findIndex(function(h){return h.oa===c+1});-1===g&&(g=e.length);d.S=e.slice(f,g)})},bk:function(a,b,c){b=jO.dm(a,b,c);a=_.w(a.S||[]);for(c=a.next();!c.done;c=a.next())c=c.value,_.Y.wd(c.$,_.Oa)&&b++,c.oa=b},dm:function(a,b,c){var d=_.Y.cb(a.$,_.Pa);if(d)return Number(d.value);d=jO.zm(b);if(c&&d)try{return jO.wm(a,b)}catch(e){throw new _.O(_.P,4,4024,"EXT-X-DISCONTINUITY-SEQUENCE tag is required for discontinuous HLS live streams.");
63
+ }return 0},zm:function(a){return 0<jO.fm(a)},Bo:function(a){if(0===a.length)return[];var b=[],c=[];a=_.w(a);for(var d=a.next();!d.done;d=a.next())d=d.value,_.Y.wd(d.$,_.Oa)&&0<c.length&&(b.push(c),c=[]),c.push(d);b.push(c);return b},fm:function(a){if(!a)return 0;a=a.streams[a.streams.length-1].S;return a[a.length-1].oa},wm:function(a,b){var c=_.Y.cb(a.$,_.Ua);if(!c)throw jO.g.error("Failed to infer discontinuity number, because EXT-X-MEDIA-SEQUENCE tag is missing."),Error(eM);c=Number(c.value);var d=
64
+ XM(b,c);if(!d)throw jO.g.error("Failed to infer discontinuity number, could not find the appropriate segment in the previous playlist (segment position \x3d "+(c+")")),Error(eM);return d.oa},Jm:function(a){a=a.map(function(b){return b.S[b.S.length-1].oa});return Math.min.apply(Math,_.th(a))},Vl:function(a){a=a.map(function(b){return b.S[0].oa});return Math.max.apply(Math,_.th(a))}};jO.g=new _.K("clpp.hls.DiscontinuityUtils");var tO={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Xg)throw new _.O(_.P,4,4041);if(_.Kj(a,gM)===hM)throw new _.O(_.P,4,4044,"EXT-X-KEY:METHOD SAMPLE-AES-CTR is not supported in FairPlay.");return _.EE(_.Sd,[{initDataType:_.mg,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":NM,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":NM,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=_.Kj(a,gM);if(!LM.includes(b))return MM.error("Widevine in HLS is only supported with [",
65
+ LM.join(", "),"], not",b),null;b=_.Kj(a,_.bc);b=_.Bv(b);b=_.Xj(b.data);b=_.EE(_.Xd,[{initDataType:_.vd,initData:b}],"");if(a=_.S(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},LM=["SAMPLE-AES",hM],MM=new _.K("clpp.hls.DrmParser");var kO={Un:function(a,b,c){return kO.Gg(a.$,b,c)||{type:_.ef,keyInfo:null,drmInfos:[],keyId:null}},Pn:function(a,b,c,d,e){if(a.slice(1).some(kO.xi))throw new _.O(_.P,4,4046,e?"Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not at the beginning of the playlist.":"Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not marked by an EXT-X-DISCONTINUITY tag and is not at the beginning of the playlist.");if(_.Y.wd(a[0].$,_.Ra)||null===d){if((d=kO.Gg(a[0].$,
66
+ b,c))&&d.type===mM){if(1<kO.Uh(a))throw new _.O(_.P,4,4046,jM+((e?"playlist":"discontinuity")+"."));return[d]}a=kO.fj(a,b,c);return 0===a.length?[{type:_.ef,keyInfo:null,drmInfos:[],keyId:null}]:a}b=kO.fj(a,b,c);if(d.type===_.ef||d.type===lM)return[d].concat(_.th(b));if(0<kO.Uh(a))throw new _.O(_.P,4,4046,jM+((e?"playlist":"discontinuity")+"."));return[d]},ua:function(a){if(0===a.length)return{type:_.ef,keyInfo:null,drmInfos:[],keyId:null};if(a.some(function(c){return c.type===mM})||a.every(function(c){return c.type===
67
+ _.ef}))return a[0];a=a.filter(function(c){return c.type===lM});var b=_.Yi(a.flatMap(function(c){return c.drmInfos}));return{keyInfo:null,keyId:a[a.length-1].keyId,type:lM,drmInfos:b}},Xj:function(a){a=kO.di(a);if(a.some(function(b){return kO.xi(b)})&&1<a.length)throw new _.O(_.P,4,4046,"Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one playlist.");},xi:function(a){return _.Y.ac(a.$,_.Ra).some(function(b){return"AES-128"===_.S(b,gM)})},fj:function(a,b,c){return kO.di(a).map(function(d){return kO.Gg(d.$,
68
+ b,c)})},Uh:function(a){return a.filter(function(b){return _.Y.wd(b.$,_.Ra)}).length},di:function(a){return a.filter(function(b){return _.Y.wd(b.$,_.Ra)})},Gg:function(a,b,c){a=_.Y.ac(a,_.Ra);if(0===a.length)return null;var d=_.Kj(a[0],gM);if(1===a.length){if("NONE"===d)return{type:_.ef,keyInfo:null,drmInfos:[],keyId:null};if("AES-128"===d)return a=a[0],d=_.S(a,"IV",""),{type:mM,keyInfo:{method:"AES-128",url:_.Y.Vd(b,_.Kj(a,_.bc)),iv:d?_.kk((d||"0x").slice(2)):null},drmInfos:[],keyId:null}}b=a.map(function(e){return _.Kj(e,
69
+ gM)});if(!b.every(function(e){return"SAMPLE-AES"===e})&&!b.every(function(e){return e===hM}))throw kO.g.warn("EXT-X-KEY methods "+b.join(", ")+" are incompatible."),new _.O(_.P,4,4044,"Multiple EXT-X-KEY tags with incompatible METHOD values.");b=a.map(function(e){var f=_.S(e,"KEYFORMAT","identity"),g=tO[f]||null;(e=g?g(e,c):null)||kO.g.warn("Unsupported HLS KEYFORMAT",f);return e}).filter(Boolean);if(0===b.length)throw new _.O(_.P,4,4026);return{keyInfo:null,keyId:b.map(function(e){return e.keyIds}).reduce(function(e,
70
+ f){return e.concat(f)},[]).reverse()[0]||null,type:lM,drmInfos:b}},wp:function(){return{type:_.ef,keyInfo:null,drmInfos:[],keyId:null}}};kO.g=new _.K("clpp.hls.EncryptionUtils");RM.prototype.length=function(){return this.streams.length};RM.prototype.f=function(){return this.streams[0].groupId};RM.prototype.a=function(){return this.streams[0].type};RM.prototype.ec=function(){return this.streams[0].zc};ZM.prototype.length=function(){return this.a.length};_.t=lN.prototype;_.t.configure=function(a){this.a=a;this.Y.a=a};_.t.setCurrentVariant=function(a){this.l=a};_.t.start=function(a,b){var c=this,d,e,f,g,h;return _.I(function(l){if(1==l.a){if(c.P)throw Error("start() may be called only once!");c.P=!0;c.D=b;return _.y(l,bO(c,a),2)}if(3!=l.a)return d=l.f,e=d.response,f=d.text,c.A=e.uri,_.y(l,wN(c,f),3);g=l.f;c.C=g;h=c.H;c.j&&0<h&&c.j.fa(h);return l["return"](g)})};_.t.requestStop=function(){this.M=!0};
71
+ _.t.stop=function(){this.j&&(this.j.stop(),this.j=null);var a=[];this.G&&(a.push(this.G.destroy()),this.G=null);this.f.clear();this.C=this.a=this.D=this.l=null;this.w.clear();this.J.clear();return Promise.all(a)};
72
+ _.t.update=function(){var a=this,b,c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:b=a.C;if(tN(a)||!b)return p["return"]();c=b.presentationTimeline;"LIVE"===a.o&&(a.B=null);d=Array.from(a.f.values());a.a.lowLatencyMode&&null!==a.l&&(e=mN(a),d=d.filter(function(q){return e.includes(q.ec())}));return _.y(p,NN(a,d),2);case 2:return f=p.f,g=f.map(function(q){return q.playlist}),EN(a,g),_.y(p,zN(a,f),3);case 3:h=p.f;aN(b.periods,h).forEach(function(q){a.D.filterNewPeriod(q)});rN(a,h);l=JN(a,
73
+ g);m=KN(a,g,l);b.cues=nN(a,m);cN(b.periods,h);eO(c,h);if(n=_.Y.tm(g))!0!==a.a.keepTimelineLive&&(a.o=_.jc,_.qF(c,!0),c.f=h[h.length-1].endTime),a.j.stop(),a.j=null;if(a.D.onUpdate)a.D.onUpdate(b);if(n&&a.D.onTurnedStatic)a.D.onTurnedStatic();if(!a.M){p.F(4);break}return _.y(p,a.stop(),4);case 4:return p["return"](b)}})};
74
+ _.t.ic=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){a.g.debug(_.OD);if(!a.D)return d["return"]();_.C(d,2);return _.y(d,a.update(),4)}if(2!=d.a)return a.j&&0<a.H&&a.j.fa(a.H),_.Hh(d,0);b=_.E(d);if(!(b instanceof _.O))throw b;a.D&&(a.D.onError(b),c=b,1===c.severity&&a.j&&a.j.fa(.1));_.B(d)})};_.t.ag=function(a){if(!this.G)throw new _.O(_.P,7,7001);a=this.D.networkingEngine.fetch(a);_.Kk(this.G,a);return a.T};_.x(rO,_.Fu);rO.prototype.f=function(){_.gv.m3u8=lN;_.ev[_.tm]=lN;_.ev[kM]=lN};rO.prototype.a=function(){_.mG("m3u8");_.nG(_.tm);_.nG(kM)};rO.prototype.id=function(){return"hls"};_.J("clpp.hls.HlsComponent",rO);};
73
75
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
74
76
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
75
77
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,10 +1,10 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var iV=function(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.N.R(a)){a:{var b=a.info;if(_.N.fa(b)&&(b=b.toLowerCase().match(/lang:(\w+)/))&&b[1]){b=b[1].toLowerCase();break a}b=null}this.f=b;a=a.data;this.a=_.N.fa(a)?a:null}},kV=function(a,b,c){this.m=a;this.l=b;this.j=c;this.a=new _.Yh;this.h=(a=_.rv(_.Wc))?new a(this.m.getConfiguration()):null;this.g=new _.K("clpp.hlssmpte.ImageCueHandler");this.f=null;jV(this)},jV=function(a){a.a.one(a.m,_.Ke,function(){return lV(a)})},
3
- lV=function(a){var b=a.m.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Lc,function(d){return mV(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Se}).forEach(function(d){mV(a,{track:d})});!nV(c)&&a.l&&(a.g.warn("The metadata track is not present. Changing an audio track in order to enforce the creation of the metadata track."),oV(a,b))}else a.g.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");else a.g.warn("A video element is not available. Skipping.")},
4
- nV=function(a){return a.some(function(b){return b.kind===_.Se})},oV=function(a,b){var c=a.m.getTrackManager(),d=c.qa(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.Ha(d)};a.a.on(b.textTracks,_.Lc,function(g){g.track.kind===_.Se&&(a.a.off(b.textTracks,_.Lc,f),f())});c.Ha(e)}else a.g.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},mV=function(a,b){var c=b.track;c.kind===_.Se&&(a.g.info("The metadata track has been added."),
5
- c.mode=_.ye,a.a.on(c,_.Vd,function(d){return pV(a,d)}))},pV=function(a,b){var c=qV(a);c&&Array.from(b.target.activeCues||[]).forEach(function(d){if(d!==a.f&&Number.isFinite(d.startTime)&&Number.isFinite(d.endTime)&&"org.id3"===d.type&&d.value&&"TXXX"===d.value.key){var e=new iV(d);if(e.f===c&&null!==e.a){a.f=d;d=a.h.parseMedia(_.T.cb(e.a),{periodStart:a.j,segmentStart:e.startTime,segmentEnd:e.endTime});var f=a.m.getTextDisplayer();f.remove(0,e.startTime);f.append(d.cues,d.styles)}}})},qV=function(a){return(a=
6
- a.m.getTrackManager().Ba())&&a.language&&a.language.toLowerCase()},rV=function(){this.a=null;this.f=!1},sV=function(){};kV.prototype.destroy=function(){this.a.release();this.f=null;return Promise.resolve()};_.x(rV,_.Lv);rV.prototype.onPlayerCreated=function(){};rV.prototype.onContentWillLoad=function(a){if(this.f=_.Gl()){var b=a.getConfiguration();b=_.N.gb(b.hlssmpte||{});_.N.wi(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.N.xa(b.timestampOffset)||(b.timestampOffset=0);this.a=new kV(a,b.patchMetadataTrack,b.timestampOffset)}};rV.prototype.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.y(b,a.a.destroy(),3):b.F(0);a.a=null;_.B(b)})};rV.prototype.id=function(){return"hlssmpte"};
7
- _.J("clpp.hlssmpte.HlsSmptePlugin",rV);rV.Id="hlssmpte";sV.prototype.create=function(){return new rV};_.Ht(new sV);};
2
+ var f=function(window){var YV=function(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.N.R(a)){a:{var b=a.info;if(_.N.ga(b)&&(b=b.toLowerCase().match(/lang:(\w+)/))&&b[1]){b=b[1].toLowerCase();break a}b=null}this.f=b;a=a.data;this.a=_.N.ga(a)?a:null}},$V=function(a,b,c){this.m=a;this.l=b;this.j=c;this.a=new _.vi;this.h=(a=_.Ev(_.$c))?new a(this.m.getConfiguration()):null;this.g=new _.K("clpp.hlssmpte.ImageCueHandler");this.f=null;ZV(this)},ZV=function(a){a.a.one(a.m,_.Se,function(){return aW(a)})},
3
+ aW=function(a){var b=a.m.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Pc,function(d){return bW(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Ze}).forEach(function(d){bW(a,{track:d})});!cW(c)&&a.l&&(a.g.warn("The metadata track is not present. Changing an audio track in order to enforce the creation of the metadata track."),dW(a,b))}else a.g.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");else a.g.warn("A video element is not available. Skipping.")},
4
+ cW=function(a){return a.some(function(b){return b.kind===_.Ze})},dW=function(a,b){var c=a.m.getTrackManager(),d=c.ra(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.Ka(d)};a.a.on(b.textTracks,_.Pc,function(g){g.track.kind===_.Ze&&(a.a.off(b.textTracks,_.Pc,f),f())});c.Ka(e)}else a.g.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},bW=function(a,b){var c=b.track;c.kind===_.Ze&&(a.g.info("The metadata track has been added."),
5
+ c.mode=_.Fe,a.a.on(c,_.be,function(d){return eW(a,d)}))},eW=function(a,b){var c=fW(a);c&&Array.from(b.target.activeCues||[]).forEach(function(d){if(d!==a.f&&Number.isFinite(d.startTime)&&Number.isFinite(d.endTime)&&"org.id3"===d.type&&d.value&&"TXXX"===d.value.key){var e=new YV(d);if(e.f===c&&null!==e.a){a.f=d;d=a.h.parseMedia(_.T.ib(e.a),{periodStart:a.j,segmentStart:e.startTime,segmentEnd:e.endTime});var f=a.m.getTextDisplayer();f.remove(0,e.startTime);f.append(d.cues,d.styles)}}})},fW=function(a){return(a=
6
+ a.m.getTrackManager().Ba())&&a.language&&a.language.toLowerCase()},gW=function(){this.a=null;this.f=!1},hW=function(){};$V.prototype.destroy=function(){this.a.release();this.f=null;return Promise.resolve()};_.x(gW,_.ew);gW.prototype.onPlayerCreated=function(){};gW.prototype.onContentWillLoad=function(a){if(this.f=_.Sl()){var b=a.getConfiguration();b=_.N.nb(b.hlssmpte||{});_.N.Di(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.N.xa(b.timestampOffset)||(b.timestampOffset=0);this.a=new $V(a,b.patchMetadataTrack,b.timestampOffset)}};gW.prototype.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.y(b,a.a.destroy(),3):b.F(0);a.a=null;_.B(b)})};gW.prototype.id=function(){return"hlssmpte"};
7
+ _.J("clpp.hlssmpte.HlsSmptePlugin",gW);gW.Id="hlssmpte";hW.prototype.create=function(){return new gW};_.bu(new hW);};
8
8
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
9
9
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
10
10
  else{_=this.clpp._;(f.call(g,this));}