@castlabs/prestoplay 6.14.0 → 6.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +25 -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 -111
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +550 -529
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +74 -73
  10. package/cjs/cl.externs.js +191 -64
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +69 -68
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -30
  15. package/cjs/cl.ima.js +23 -23
  16. package/cjs/cl.mse.js +290 -275
  17. package/cjs/cl.muxdata.js +15 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.simid.js +15 -15
  22. package/cjs/cl.smooth.js +72 -71
  23. package/cjs/cl.thumbnails.js +26 -26
  24. package/cjs/cl.tizen.js +70 -70
  25. package/cjs/cl.ttml.js +28 -28
  26. package/cjs/cl.verimatrix.js +5 -5
  27. package/cjs/cl.vimond.js +13 -13
  28. package/cjs/cl.vr.js +19 -19
  29. package/cjs/cl.vtt.js +14 -14
  30. package/cjs/cl.youbora.js +20 -20
  31. package/cl.adobe.js +3 -3
  32. package/cl.airplay.js +3 -3
  33. package/cl.broadpeak.js +5 -5
  34. package/cl.cast.js +89 -88
  35. package/cl.conviva.js +27 -27
  36. package/cl.core.js +457 -438
  37. package/cl.crypto.js +9 -9
  38. package/cl.dash.js +70 -68
  39. package/cl.externs.js +187 -64
  40. package/cl.freewheel.js +19 -19
  41. package/cl.hls.js +71 -69
  42. package/cl.hlssmpte.js +5 -5
  43. package/cl.htmlcue.js +26 -26
  44. package/cl.ima.js +17 -17
  45. package/cl.mse.js +255 -240
  46. package/cl.muxdata.js +13 -13
  47. package/cl.onboard.js +4 -4
  48. package/cl.persistent.js +11 -11
  49. package/cl.playlist.js +5 -5
  50. package/cl.simid.js +13 -13
  51. package/cl.smooth.js +59 -59
  52. package/cl.thumbnails.js +19 -19
  53. package/cl.tizen.js +57 -57
  54. package/cl.ttml.js +22 -22
  55. package/cl.verimatrix.js +4 -4
  56. package/cl.vimond.js +8 -8
  57. package/cl.vr.js +15 -15
  58. package/cl.vtt.js +12 -12
  59. package/cl.youbora.js +15 -15
  60. package/clpp.styles.css +2 -0
  61. package/package.json +1 -1
  62. package/typings.d.ts +387 -90
package/cjs/cl.mse.js CHANGED
@@ -1,281 +1,296 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Jy,Ky,Ly,My,Ny,Oy,Py,Qy,Ry,Sy,Vy,Wy,Xy,Zy,$y,az,bz,cz,dz,fz,gz,hz,jz,kz,lz,mz,nz,pz,qz,rz,wz,xz,yz,zz,Az,Bz,Ez,Fz,Hz,Jz,Kz,Lz,Mz,Nz,Oz,Qz,Rz,Tz,Uz,Vz,Wz,Xz,Yz,Zz,aA,gA,lA,nA,pA,qA,rA,sA,tA,xA,zA,yA,AA,BA,EA,FA,GA,HA,JA,NA,LA,PA,QA,RA,SA,UA,TA,VA,XA,YA,ZA,aB,$A,cB,WA,dB,bB,eB,kB,hB,fB,iB,jB,lB,mB,pB,oB,qB,rB,sB,gB,tB,vB,nB,wB,xB,yB,zB,AB,BB,CB,DB,FB,GB,EB,OB,NB,PB,QB,SB,TB,VB,UB,WB,ZB,XB,YB,aC,$B,bC,cC,dC,gC,iC,hC,jC,kC,lC,mC,pC,oC,nC,rC,sC,tC,qC,vC,uC,zC,AC,CC,yC,xC,DC,wC,BC,HC,JC,GC,KC,FC,IC,
3
- EC,MC,LC,OC,RC,TC,UC,ZC,bD,dD,fD,iD,kD,lD,nD,eD,qD,XC,rD,VC,pD,uD,sD,mD,oD,xD,wD,tD,DD,ED,yD,GD,zD,BD,JD,ID,CD,HD,KD,WC,AD,jD,YC,$C,QC,aD,FD,gD,hD,ND,OD,PD,VD,bE,TD,SD,RD,UD,XD,YD,ZD,$D,aE,fE,qE,rE,sE,mE,tE,kE,WD,KB,IB,LB,JB,MB,HB,CE,AE,oE,lE,vE,DE,BE,FE,uE,wE,cE,nE,GE,jE,HE,xE,KE,pE,iE,JE,IE,dE,EE,zE,ME,gE,yE,LE,NE,eE,OE,PE,QE,RE,SE,TE,UE,VE,WE;Jy=" buffer";Ky=" is being or has been set up";Ly="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";My="\x3c/LA_URL\x3e";Ny="\x3cLA_URL\x3e";Oy='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';
4
- Py="Choosing new streams after key status change";Qy="IterateSegmentReference";Ry="Jumping forward";Sy="MediaSource threw QuotaExceededError:";_.Ty="No stream with id";_.Uy="Player is in ERROR state and can not switch to ";Vy="PrestoPlay TextTrack";Wy="Removing audio from variant - audio not compatible with platform";Xy="Setting playback rate to\x3d";_.Yy="Updating manifest...";Zy="bufferBehind\x3d";$y="bufferedBehind\x3d";az="calling onCanSwitch()...";bz="cannot find segment";cz="clpp.mse.Player";
5
- dz="currentPeriod.startTime\x3d";_.ez="getSegmentNextReference";fz="key-restriction";gz="manifest.end";hz="manifest.start";_.iz="onChooseStreams_";jz="presentationTime:";kz="presentationTime\x3d";lz="reference.endTime\x3d";mz="reference.position\x3d";nz="reference.startTime\x3d";_.oz="subtitles";pz="switch: Stream ";qz=function(a,b){return _.Lg[a]=b};rz=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.em(a);)if(0===_.gm(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.R.Z(a)};
6
- _.tz=function(a){var b=new Uint8Array(sz),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.am(c,!1);_.V(d,c);_.cm(d,b);_.cm(d,a.j);_.V(d,a.f.byteLength);_.cm(d,a.f);return _.Ui(d.buffer)};
7
- _.uz=function(a,b,c,d){var e=_.gj(b);if(8!==e.byteLength)e="";else{var f=_.nn(e);e=_.dj(f);b:switch(f=f.byteLength,_.th("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[Oy+a+'"\x3e',"\x3cDATA\x3e\x3cPROTECTINFO\x3e","\x3cKEYLEN\x3e"+f+"\x3c/KEYLEN\x3e","\x3cALGID\x3eAESCTR\x3c/ALGID\x3e\x3c/PROTECTINFO\x3e","\x3cKID\x3e"+e+"\x3c/KID\x3e",c?"\x3cCHECKSUM\x3e"+c+"\x3c/CHECKSUM\x3e":"",d?Ny+d+My:"",Ly].join("");break b;case "4.1.0.0":e=[Oy+a+'"\x3e','\x3cDATA\x3e\x3cPROTECTINFO\x3e\x3cKID ALGID\x3d"AESCTR" ',
8
- c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?Ny+d+My:"",Ly].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[Oy+a+'"\x3e','\x3cDATA\x3e\x3cPROTECTINFO\x3e\x3cKIDS\x3e\x3cKID ALGID\x3d"AESCTR" ',c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/KIDS\x3e\x3c/PROTECTINFO\x3e",d?Ny+d+My:"",Ly].join("");break b;default:_.J("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.th("New payload",e);e=_.Ui(_.R.Ce(e,!0));return new _.kn(_.on,
9
- b,d||null,e,a,c)};_.vz=function(a,b){return b===a.version?a:_.uz(b,a.a,a.l||void 0,a.h||void 0)};wz=function(a,b){a:{if(b){var c=_.u(a.f.keys());for(var d=c.next();!d.done;d=c.next()){d=a.f.get(d.value);for(var e=0;e<d.$a.length;e++)if(d.$a[e]===b){c=d;break a}}}c=null}return c?c.Ja:null};xz=function(a,b){return _.xk("Edge/")?!0:a.M.has(b)};yz=function(a,b){var c=a.l.get(b);return!(!c||c!==_.bf&&c!==_.ve)};
10
- zz=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&!xz(a,_.rk(c.mimeType,c.codecs))||d&&d.encrypted&&!xz(a,_.rk(d.mimeType,d.codecs)))return!1;var e=a.keySystem();return 0==b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem==e})};Az=function(a,b){a.a=b.enabled};Bz=function(){};
11
- _.Cz=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};_.Dz=function(a,b,c,d,e){this.Sa=a;this.wa=b;this.ia=c;this.keyInfo=d||null;this.Oc=_.N.R(e)?!1:!!e};Ez=function(a,b){a=_.Ni(a);b=_.Ni(b);var c=a.split("-"),d=b.split("-");return c[0]==d[0]&&1==c.length&&2==d.length};
12
- Fz=function(a){return a.language?_.Ni(a.language):a.audio&&a.audio.language?_.Ni(a.audio.language):a.video&&a.video.language?_.Ni(a.video.language):_.hg};
13
- _.Gz=function(a,b){for(var c=_.Ni(a),d=new Set,e=_.u(b),f=e.next();!f.done;f=e.next())d.add(_.Ni(f.value));e=_.u(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,f==c)return f;e=_.u(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,Ez(f,c))return f;e=_.u(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.Ni(g);h=_.Ni(h);g=g.split("-");h=h.split("-");if(2==g.length&&2==h.length&&g[0]==h[0])return f}d=_.u(d);for(f=d.next();!f.done;f=d.next())if(e=f.value,Ez(c,e))return e;return null};
14
- Hz=function(a,b){for(var c=0,d=_.u(a),e=d.next();!e.done;e=d.next())c+=b(e.value)?1:0;return c};_.Iz=function(a){if(_.au.has(a))return _.au.get(a);if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported(a);_.au.set(a,b);return b}return window.MediaSource?(b=MediaSource.isTypeSupported(a),_.au.set(a,b),b):!1};
15
- Jz=function(){this.a=new muxjs.mp4.Transmuxer({keepOriginalTimestamps:!0,remux:!1});this.f=null;this.o=[];this.l=[];this.h=[];this.j=!1;this.a.on("data",this.A.bind(this));this.a.on("done",this.w.bind(this))};Kz=function(a,b){a.j=!0;a.f=new _.wj;a.o=[];a.l=[];a.h=[];var c=_.Ui(b);a.a.push(c);a.a.flush();a.j&&a.f.reject(new _.P(_.Q,3,3018));return a.f};
16
- Lz=function(a,b){var c=b.replace(/mp2t/i,_.Pe);a==_.$c&&(c=c.replace(_.sg,_.$c));var d=/avc1\.(66|77|100)\.(\d+)/.exec(c);if(d){var e="avc1.",f=d[1],g=Number(d[2]);e=("66"==f?e+"4200":"77"==f?e+"4d00":e+"6400")+(g>>4).toString(16);e+=(g&15).toString(16);c=c.replace(d[0],e)}return c};
17
- Mz=function(a,b){return!window.muxjs||"mp2t"!=a.toLowerCase().split(";")[0].split("/")[1]&&"aac"!=a.toLowerCase().split(";")[0].split("/")[1]?!1:b?_.Iz(Lz(b,a))||_.Iz(a.replace(/aac/i,_.Pe)):_.Iz(Lz(_.$c,a))||_.Iz(a.replace(/aac/i,_.Pe))||_.Iz(Lz(_.sg,a))};
18
- Nz=function(a,b){var c=new Map;c.set(a,b);try{var d=b.match(/"(.*?)"/)[0].replace(/"/g,"").split(","),e=new Map;if(1<d.length)for(var f=_.u(d),g=f.next();!g.done;g=f.next()){var h=g.value;h.startsWith("avc")?e.set(_.sg,'video/mp4;codecs\x3d"'+h+'"'):h.startsWith("mp4a")&&e.set(_.$c,'audio/mp4;codecs\x3d"'+h+'"')}return 0<e.size?e:c}catch(l){return c}};Oz=function(a){var b=[a.mimeType];_.bu.forEach(function(c,d){var e=a[d];e&&b.push(c+'\x3d"'+e+'"')});return b.join(";")};
19
- _.Pz=function(a){a=a.split(".");var b=a[0];a.pop();return[b,a.join(".")]};Qz=function(a,b){for(var c=new _.sl(void 0,void 0===b?"total":b),d=_.u(a),e=d.next();!e.done;e=d.next())c.a.push(e.value);c.length=a.length;return c};Rz=function(a,b){return a.start-b.start};_.Sz=function(a){this.j=a;this.log=new _.K("clpp.renditions");this.S=[];this.h=this.player=null;this.f=!1};Tz=function(a){return a.S.map(function(b){return{start:b.start,end:b.end,width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b.rendition}})};
20
- Uz=function(a){a.player&&a.player.trigger(new _.L(_.ed))};Vz=function(a){if(a.player){for(var b=!1,c={},d=0;d<a.S.length;d++){var e=a.S[d],f=e.width+"x"+e.height,g=c[f];if(g&&g!==e.bandwidth){b=!0;break}c[f]=e.bandwidth}b&&!a.f?(a.log.debug("Tracking timeupdates"),a.player.on(_.eg,a.a,a),a.f=!0):!b&&a.f&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.eg,a.a),a.f=!1)}};
21
- Wz=function(a,b,c){a.S=a.S.filter(function(d){if(d.end<=b||d.start>=c)return!1;d.start=Math.max(d.start,b);d.end=Math.min(d.end,c);return!0});a.player&&a.player.trigger(new _.L(_.vg))};Xz=function(a,b){for(var c=null,d=_.u(a),e=d.next();!e.done;e=d.next())e=e.value,b>=e.startTime&&(c=e);return c};
22
- Yz=function(a){var b=new Set;a.variants.forEach(function(c){c.audio&&b.add(c.audio);c.video&&(b.add(c.video),c.video.trickModeVideo&&b.add(c.video.trickModeVideo))});a.textStreams.forEach(function(c){return b.add(c)});a.thumbStreams.forEach(function(c){return b.add(c)});return b};Zz=function(a,b){for(var c=0;c<a.length;c++)if(Yz(a[c]).has(b))return c;return-1};aA=function(a,b){Array.from(Yz(a)).forEach(function(c){c.segmentIndex&&_.$z(c.segmentIndex,b)})};
23
- _.bA=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.cA=function(a,b,c){var d=Math.pow(a.h,b);c=c*(1-d)+d*a.a;isNaN(c)||(a.a=c,a.f+=b)};_.dA=function(a){return a.a/(1-Math.pow(a.h,a.f))};
24
- _.eA=function(a,b,c,d,e,f,g,h){a=_.rj(a);a.timeout=d.timeout;a.maxAttempts=d.maxAttempts;a.baseDelay=d.baseDelay;a.fuzzFactor=d.fuzzFactor;a.backoffFactor=d.backoffFactor;if(0!==b||null!=c)a.headers.Range=c?"bytes\x3d"+b+"-"+c:"bytes\x3d"+b+"-";e&&(a.startTime=e);f&&(a.endTime=f);g&&(a.contentType=g);h&&(a.timescale=h);return a};
25
- _.fA=function(a,b,c,d,e){e=void 0===e?!1:e;this.A=a;this.G=b;this.w=this.f=Infinity;this.a=1;this.B=0;this.h=this.o=null;this.C=0;this.l=this.j=c;this.I=void 0===d?!0:d;this.g=new _.K("clpp.media.PresentationTimeline");this.J=e;this.H=null};gA=function(a){return a.j?a.f:a.l?a.h:null};
26
- _.jA=function(a,b,c){if(0!=b.length){var d=b[b.length-1].endTime+c;_.hA(a,b[0].startTime+c);a.a=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.a);_.iA(a,d);null!=a.A&&a.I&&(a.A=(Date.now()+a.C)/1E3-(a.h||0)-a.a);a.g.debug("notifySegments: maxSegmentDuration\x3d"+a.a)}};_.hA=function(a,b){a.o=null==a.o?b:Math.min(a.o,b)};_.iA=function(a,b){a.h=Math.max(a.h||0,b)};_.kA=function(a,b){a.a=Math.max(a.a,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.a)};
27
- _.mA=function(a){return Infinity==a.w?0:Math.max(0,lA(a)-a.w)};lA=function(a){if(a.j)a=a.f;else if(a.l)a=a.h||0;else{var b=(Date.now()+a.C)/1E3;a=Math.min(a.J?Math.max(0,b-(a.a-a.B)-a.A):Math.max(0,b-a.a-a.A),a.f)}return a};_.oA=function(a,b){var c=Math.max(a.o,0);return Infinity==a.w?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(lA(a)-a.w+b,nA(a)))};nA=function(a){return Math.max(0,lA(a)-(a.j||a.l?0:a.G))};
28
- pA=function(a){return{schemeIdUri:a.schemeIdUri,value:a.value,startTime:a.startTime,endTime:a.endTime,id:a.id,eventElement:a.eventElement,type:a.type,Wa:a.Wa}};qA=function(){this.f=function(){};this.a=new Set};rA=function(a,b){a.f=b};sA=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.K("clpp.media.SegmentIterator")};tA=function(a){var b=a.h.get(a.a);if(!b)return null;0<b.a.length&&b.Sa().length&&a.f>=b.a.length&&(a.a+=1,a.f=0,b=a.h.get(a.a));return b&&0<b.a.length?b.a[a.f]||null:b};
29
- _.uA=function(a){this.a=a;this.g=new _.K("clpp.media.SegmentIndex")};_.vA=function(a){return a.a.length?a.a[a.a.length-1].endTime:0};_.wA=function(a,b){for(var c=0;c<a.a.length;++c)if(a.a[c].endTime>b)return a.a.splice(0,c);c=a.a;a.a=[];return c};xA=function(a,b){var c=a.Mc(b);c=null===c?-1:c-1;var d=a.get(c+1),e=-1;if(d&&0<d.a.length)for(var f=d.a.length-1;0<=f;--f){var g=d.a[f];if(b>=g.startTime&&b<g.endTime){for(;f&&!g.h;)--f,g=d.a[f];if(!g.h)break;c+=1;e=f-1;break}}return new sA(a,c,e)};
30
- _.$z=function(a,b){for(;a.a.length;)if(0>=a.a[0].endTime)a.a.shift();else break;0==a.a.length||a.a[a.a.length-1].startTime>=b||(a.a[a.a.length-1].endTime=b)};zA=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.uk(function(){yA(b,!1)})).jb(.25)};yA=function(a,b){for(var c=_.u(a.a),d=c.next();!d.done;d=c.next())d.value.o(a.f.currentTime,b)};
31
- AA=function(a){var b=this;this.l=a;this.j=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{Bc:null,Ac:2,oc:function(c,d){return b.a(c,d)}},{Bc:1,Ac:2,oc:function(c,d){return b.a(c,d)}},{Bc:3,Ac:2,oc:function(c,d){return b.a(c,d)}},{Bc:2,Ac:1,oc:function(c,d){return b.f(c,d)}},{Bc:2,Ac:3,oc:function(c,d){return b.f(c,d)}},{Bc:1,Ac:3,oc:function(c,d){return b.h(c,d)}},{Bc:3,Ac:1,oc:function(c,d){return b.h(c,d)}}]};BA=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
32
- _.CA=function(a){_.Fs[a]&&delete _.Fs[a]};_.DA=function(a){_.Ds[a]&&delete _.Ds[a]};EA=function(a,b){this.w=null;this.C=a;this.h=b;this.j=this.A=0;this.l=Infinity;this.f=this.a=null;this.B="";this.o=new Map};
33
- FA=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.h)if(null==c||null==d)a.w.parseInit(_.Ui(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.Ui(b),e);var f=e.cues.filter(function(g){return g.startTime>=a.j&&g.startTime<a.l});a.h.append(f,e.styles);null==a.a&&(a.a=Math.max(c,a.j));a.f=Math.min(d,a.l)}})};
34
- GA=function(a,b,c){a.B=b;if(b=a.o.get(b))for(var d=_.u(b.keys()),e=d.next();!e.done;e=d.next())if(e=b.get(e.value))e=e.filter(function(f){return f.endTime<=c}),a.h.append(e,[])};
35
- HA=function(a,b,c,d,e){var f=c+" "+d,g=new Map;b=_.u(b);for(var h=b.next();!h.done;h=b.next()){var l=h.value;h=l.stream;g.has(h)||g.set(h,new Map);g.get(h).has(f)||g.get(h).set(f,[]);l.startTime+=e;l.endTime+=e;l.startTime>=a.j&&l.startTime<a.l&&(l=new _.di(l.startTime,l.endTime,l.text),g.get(h).get(f).push(l),h==a.B&&a.h.append([l],[]))}e=_.u(g.keys());for(f=e.next();!f.done;f=e.next())for(f=f.value,a.o.has(f)||a.o.set(f,new Map),b=_.u(g.get(f).keys()),h=b.next();!h.done;h=b.next())h=h.value,l=g.get(f).get(h),
36
- a.o.get(f).set(h,l);a.a=null==a.a?Math.max(c,a.j):Math.min(a.a,Math.max(c,a.j));a.f=Math.max(a.f,Math.min(d,a.l))};_.IA=function(a){a=a.toLowerCase();return _.ft[a]||window.muxjs&&a==_.Sc?!0:!1};JA=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.KA=function(){};
37
- _.MA=function(a,b,c,d,e){this.j=a;this.B=c;this.f={};this.M=!1;this.a=null;this.h={};this.l=new _.Eh;this.J=!1;this.A={};this.H=b;this.C=d;this.K=e;this.T=this.K.streaming.maxSegmentToMediaOffset||1;this.I=new _.wj;this.w="";this.G={};this.o=LA(this,this.I);this.P=!0;this.g=new _.K("clpp.mse.MediaSourceEngine")};NA=function(a){var b=_.rk(a.mimeType,a.codecs),c=Oz(a);return _.IA(b)||_.Iz(c)||Mz(b,a.type)};
38
- LA=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,"sourceopen",function(){URL.revokeObjectURL(a.w);b.resolve()});a.l.on(c,"startstreaming",function(){a.P=!0});a.l.on(c,"endstreaming",function(){a.P=!1});a.w=OA(c);a.j.src=a.w;return c}c=new MediaSource;a.w=OA(c);a.l.one(c,"sourceopen",function(){URL.revokeObjectURL(a.w);b.resolve()});a.j.src=a.w;return c};
39
- PA=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.ne,a.U.bind(a,d));a.l.on(e,"updateend",a.$c.bind(a,d));a.f[d]=e;a.h[d]=[];a.G[d]=!1});a.M=b.has(_.$c)&&b.has(_.sg)};QA=function(a){return a.K.streaming.ignoreManagedMediaSourceStreamingHints?!0:a.P};RA=function(a,b){a.a||(a.a=new EA(a.K,a.B));var c=a.a;if(b!=_.Sc){var d=_.ft[b];if(!d)throw new _.P(_.Q,2,2012,"Text parser is unavailable for "+b);c.w=new d(c.C)}};SA=function(a){return a.o?a.o.readyState==_.me:!0};
40
- UA=function(a){var b={};b.total=new _.sl(a.j.buffered,"total");b.audio=TA(a,_.$c);b.video=TA(a,_.sg);var c=[];a.a&&(c=[{start:a.a.wb(),end:a.a.Fa()}]);b.text=Qz(c,_.bg);return b};TA=function(a,b){try{return new _.sl(a.f[b].buffered,b)}catch(c){return b in a.f&&a.g.error("failed to get buffered range for "+b,c),null}};VA=function(a,b){if(!a.f[b])return"";var c=TA(a,b);return c?c.toString():""};
41
- XA=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l=a.f[b],m=-1,n=0;l&&l.buffered&&(n=l.buffered.length);b===_.sg&&null!==d&&null!==e&&h&&(m=0<n?l.buffered.end(n-1):-1);b==_.bg?c=FA(a.a,c,d,e):a.A[b]?c=Kz(a.A[b],c).then(function(p){p.captions&&0<p.captions.length&&(a.a||RA(a,_.cg),HA(a.a,p.captions,d,e,a.f.video.timestampOffset));var q=[];0<p.audio.byteLength&&a.f.audio&&q.push(WA(a,_.$c,a.Ze.bind(a,_.$c,p.audio.buffer)));0<p.video.byteLength&&a.f.video&&q.push(WA(a,_.sg,a.Ze.bind(a,_.sg,p.video.buffer)));
42
- return Promise.all(q)}):(f&&window.muxjs&&(a.a||RA(a,_.cg),null==d&&null==e?a.H.init(c):a.H.h(c,function(p){p.length&&HA(a.a,p,d,e,a.f.video.timestampOffset)})),c=WA(a,b,a.Ze.bind(a,b,c)));return c.then(function(){if(b===_.sg&&null!==d&&null!==e&&!h)a.C.append(d,e,g),null!==d&&null!==e&&a.g.debug("Appended video segment ",d,e,"Buffer:",VA(a,b));else if(b===_.$c&&null!==d&&null!==e)Uz(a.C),null!==d&&null!==e&&a.g.debug("Appended audio segment ",d,e,"Buffer:",VA(a,b));else if(b===_.sg&&null!==d&&null!==
43
- e&&h){var p=l.buffered.length,q=0<p?l.buffered.end(p-1):-1;0>m&&0<p&&(m=l.buffered.start(0));0<=m&&0<q&&a.C.append(m,q,g)}if(!a.G[b]&&l&&1===l.buffered.length){p=l.buffered.start(0);var t=d-p;if(Math.abs(t)>a.T&&0===l.timestampOffset)return a.g.warn("Detected a delta of "+t+" between media times and segment times for "+(b+". The segment start time is ")+(d+" and the media start time is ")+(p+". Adjusting timestampOffset.")),p=WA(a,b,function(){a.Lh(b,t)}),q=WA(a,b,a.Ig.bind(a,b,!1)),Promise.all([p,
44
- q])}null!==d&&null!==e&&(a.G[b]=!0)})["catch"](function(p){throw p;})};YA=function(a,b){var c=a.Fa(_.sg)||0;GA(a.a,b,c)};ZA=function(a){a.a&&GA(a.a,"",0)};aB=function(a,b,c,d,e){if(b==_.bg)return a.a.A=c,a=a.a,a.j=d,a.l=e,Promise.resolve();b=$A(a,b,c,d,e);a.M&&(b=b.concat($A(a,_.$c,c,d,e)));return Promise.all(b)};$A=function(a,b,c,d,e){return[WA(a,b,a.di.bind(a,b)),WA(a,b,a.Lh.bind(a,b,c)),WA(a,b,a.gm.bind(a,b,d,e))]};cB=function(a,b){bB(a,function(){a.o.duration=b})};
45
- WA=function(a,b,c){if(a.J)return Promise.reject();c={start:c,p:new _.wj};a.h[b].push(c);1===a.h[b].length&&dB(a,b);return c.p};dB=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug("Starting next operation for "+b),c.start()}catch(d){"QuotaExceededError"==d.name?c.p.reject(new _.P(_.Q,3,3017,{type:b})):c.p.reject(new _.P(_.Q,3,3015,{mediaError:d})),eB(a,b)}else a.g.debug("No more scheduled operations for "+b)};
46
- bB=function(a,b){if(a.J)return Promise.reject();var c=[],d;for(d in a.f){var e=new _.wj,f={start:function(g){g.resolve()}.bind(null,e),p:e};a.h[d].push(f);c.push(e);1==a.h[d].length&&f.start()}return Promise.all(c).then(function(){for(var g in a.f);try{b()}catch(m){var h=Promise.reject(new _.P(_.Q,3,3015,{mediaError:m}))}for(var l in a.f)eB(a,l);return h},function(){for(var g in a.f)a.h[g].length&&a.h[g].shift();return Promise.reject()})};eB=function(a,b){a.h[b].shift();dB(a,b)};
47
- kB=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants});if(b.length||c.length)e=fB(e,b,c);e=gB(e,d);if(1<a.periods.length){var f=function(n){n=n.split(".");var p=n[0];1<n.length&&(p+="."+n[1]);return p.toLowerCase()};b=[];c=_.u(a.periods);for(var g=c.next();!g.done;g=c.next()){d=new Set;g=_.u(g.value.variants);for(var h=g.next();!h.done;h=g.next())h=h.value,null!==h.audio&&d.add(f(h.audio.codecs));b.push(d)}var l=b[0];c={};for(d=1;d<b.length;c={Ie:c.Ie},d++)c.Ie=b[d],l=new Set(_.Og(l).concat().filter(function(n){return function(p){return n.Ie.has(p)}}(c)));
48
- e=e.filter(function(n){return 0===l.size&&null===n.audio?!0:0<l.size&&null===n.audio?!1:l.has(f(n.audio.codecs))})}e=hB(e);var m=iB(e);a=_.u(a.periods);for(e=a.next();!e.done;e=a.next())e=e.value,e.variants=e.variants.filter(function(n){if(jB(n)===m)return!0;_.th("Dropping Variant (better codec available)",n);return!1})};hB=function(a){var b=new _.Bh;a=_.u(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=jB(c);b.push(d,c)}return b};
49
- fB=function(a,b,c){var d={};b=_.u(b);for(var e=b.next();!e.done;d={Ne:d.Ne},e=b.next())if(d.Ne=e.value,e=a.filter(function(f){return function(g){return g.video&&g.video.codecs.startsWith(f.Ne)}}(d)),e.length){a=e;break}d={};c=_.u(c);for(b=c.next();!b.done;d={Ge:d.Ge},b=c.next())if(d.Ge=b.value,b=a.filter(function(f){return function(g){return g.audio&&g.audio.codecs.startsWith(f.Ge)}}(d)),b.length){a=b;break}return a};
50
- iB=function(a){var b="",c=Infinity;a.forEach(function(d,e){var f=e.reduce(function(g,h){return g+h.bandwidth||0},0)/e.length;_.th(_.Jd,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};jB=function(a){var b="";a.video&&(b=_.Pz(a.video.codecs)[0]);var c="";a.audio&&(c=_.Pz(a.audio.codecs)[0]);return b+"-"+c};
51
- lB=function(a,b,c){function d(f,g,h){return f>=g&&f<=h}var e=a.video;return e&&e.width&&e.height&&!(d(e.width,b.minWidth,Math.min(b.maxWidth,c.width))&&d(e.height,b.minHeight,Math.min(b.maxHeight,c.height))&&d(e.width*e.height,b.minPixels,b.maxPixels))||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0};mB=function(a,b,c){var d=!1;a=_.u(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=lB(e,b,c);f!=e.allowedByApplication&&(d=!0)}return d};
52
- pB=function(a,b,c,d){var e=!1;d.variants=d.variants.filter(function(m){if(a&&a.da&&!zz(a,m))return _.th("Dropping variant - not compatible with key system",m),!1;var n=m.audio,p=m.video;if(n&&!NA(n)){var q=n.codecs;0<=n.codecs.indexOf("ec-3")?(_.th("Trying to use AC-3 for EC-3"),n.codecs=n.codecs.replace("ec-3","ac-3"),NA(n)?_.sh("Using AC-3 instead of EC-3 for",nB(n)):(n.codecs=q,_.sh(Wy,nB(n)),m.audio=null,e=!0,n=null)):(_.sh(Wy,nB(n)),m.audio=null,e=!0,n=null)}return p&&!NA(p)?(_.sh("Dropping variant - video not compatible with platform",
53
- nB(p)),!1):n&&b&&!oB(n,b)?(_.sh("Dropping variant - not compatible with active audio","active audio",nB(b),"variant.audio",nB(n)),!1):p&&c&&!oB(p,c)?(_.sh("Dropping variant - not compatible with active video","active video",nB(c),"variant.video",nB(p)),!1):!0});if(e){for(var f=!1,g=!1,h=_.u(d.variants),l=h.next();!l.done;l=h.next())l=l.value,!f&&l.video&&l.audio&&(f=!0),g||l.audio||!l.video||(g=!0);f&&g&&(d.variants=d.variants.filter(function(m){return m.video&&!m.audio?(_.sh("Dropping variant - not compatible with video + audio",
54
- "variant.video",nB(m.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(m){var n=_.IA(_.rk(m.mimeType,m.codecs));n||_.th("Dropping text stream. Is not supported by the platform.",m);return n})};oB=function(a,b){return a.mimeType!=b.mimeType||a.codecs.split(".")[0]!=b.codecs.split(".")[0]?!1:!0};
55
- qB=function(a){var b=a.audio,c=a.video,d=b?b.codecs:null,e=c?c.codecs:null,f=[];e&&f.push(e);d&&f.push(d);var g=c&&c.mimeType||null,h=b&&b.mimeType||null,l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;var m=new Set,n=new Set;if(b)for(var p=_.u(b.roles),q=p.next();!q.done;q=p.next())n.add(q.value);if(c)for(p=_.u(c.roles),q=p.next();!q.done;q=p.next())m.add(q.value);q=[c,b].map(function(t){return t?t.accessibility||[]:[]}).reduce(function(t,v){return t.concat(v)},[]);a={id:a.id,active:!1,type:"variant",
2
+ var f=function(window){var Hz,Iz,Jz,Kz,Lz,Mz,Nz,Oz,Pz,Qz,Tz,Uz,Vz,Xz,Yz,Zz,$z,aA,bA,dA,eA,gA,hA,iA,jA,kA,mA,nA,oA,pA,uA,vA,wA,xA,yA,zA,AA,BA,EA,FA,HA,IA,JA,LA,MA,OA,PA,QA,RA,SA,TA,UA,VA,XA,bB,hB,mB,pB,eB,oB,qB,rB,sB,tB,uB,vB,wB,xB,yB,zB,DB,FB,GB,HB,EB,JB,IB,KB,LB,OB,PB,QB,NB,MB,RB,VB,XB,UB,YB,TB,WB,SB,$B,ZB,aC,bC,cC,fC,gC,hC,iC,kC,oC,mC,qC,rC,sC,tC,uC,wC,vC,xC,zC,AC,BC,DC,CC,FC,yC,GC,EC,HC,NC,KC,IC,LC,MC,OC,PC,SC,RC,TC,UC,VC,JC,WC,QC,YC,ZC,$C,aD,bD,dD,eD,gD,hD,fD,iD,jD,kD,mD,nD,lD,vD,uD,wD,xD,zD,AD,CD,BD,DD,FD,ED,GD,JD,
3
+ HD,ID,LD,KD,MD,ND,OD,RD,TD,SD,UD,VD,WD,XD,$D,ZD,YD,bE,aE,dE,gE,iE,jE,oE,rE,tE,vE,xE,AE,BE,CE,EE,FE,HE,wE,JE,mE,KE,kE,uE,NE,LE,GE,IE,QE,PE,ME,WE,XE,RE,ZE,SE,UE,bF,aF,VE,$E,cF,lE,TE,DE,nE,pE,fE,qE,YE,yE,zE,dF,gF,hF,iF,jF,kF,mF,nF,lF,oF,uF,BF,AF,CF,vF,wF,xF,HF,DF,sF,rF,qF,tF,FF,GF,yF,zF,RF,LF,UF,VF,WF,$F,XF,rD,pD,sD,qD,tD,oD,gG,eG,iG,SF,QF,ZF,hG,fG,kG,YF,bG,JF,aG,lG,PF,mG,oG,LG,TF,OF,KG,pG,EF,jG,dG,NG,MF,cG,MG,pF,OG,KF,PG,QG,RG,SG,TG,UG,VG,WG,XG;Hz=" buffer";Iz=" is being or has been set up";Jz="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";
4
+ Kz="\x3c/LA_URL\x3e";Lz="\x3cLA_URL\x3e";Mz='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';Nz="Choosing new streams after key status change";Oz="IterateSegmentReference";Pz="Jumping forward";Qz="MediaSource threw QuotaExceededError:";_.Rz="No stream with id";_.Sz="Player is in ERROR state and can not switch to ";Tz="PrestoPlay TextTrack";Uz="Removing audio from variant - audio not compatible with platform";Vz="Setting playback rate to\x3d";_.Wz="Updating manifest...";
5
+ Xz="bufferBehind\x3d";Yz="bufferedBehind\x3d";Zz="calling onCanSwitch()...";$z="cannot find segment";aA="clpp.mse.Player";bA="currentPeriod.startTime\x3d";_.cA="getSegmentNextReference";dA="key-restriction";eA="manifest.start";_.fA="onChooseStreams_";gA="presentationTime:";hA="presentationTime\x3d";iA="reference.endTime\x3d";jA="reference.position\x3d";kA="reference.startTime\x3d";_.lA="subtitles";mA="switch: Stream ";nA=function(a,b){return _.Yg[a]=b};oA=function(a,b){for(var c in a.a)b(c,a.a[c])};
6
+ pA=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.Fm(a);)if(0===_.Hm(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.R.aa(a)};_.rA=function(a){var b=new Uint8Array(qA),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.Bm(c,!1);_.V(d,c);_.Dm(d,b);_.Dm(d,a.j);_.V(d,a.f.byteLength);_.Dm(d,a.f);return _.lj(d.buffer)};
7
+ _.sA=function(a,b,c,d){var e=_.yj(b);if(8!==e.byteLength)e="";else{var f=_.Un(e);e=_.vj(f);b:switch(f=f.byteLength,_.Hh("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[Mz+a+'"\x3e',"\x3cDATA\x3e\x3cPROTECTINFO\x3e","\x3cKEYLEN\x3e"+f+"\x3c/KEYLEN\x3e","\x3cALGID\x3eAESCTR\x3c/ALGID\x3e\x3c/PROTECTINFO\x3e","\x3cKID\x3e"+e+"\x3c/KID\x3e",c?"\x3cCHECKSUM\x3e"+c+"\x3c/CHECKSUM\x3e":"",d?Lz+d+Kz:"",Jz].join("");break b;case "4.1.0.0":e=[Mz+a+'"\x3e','\x3cDATA\x3e\x3cPROTECTINFO\x3e\x3cKID ALGID\x3d"AESCTR" ',
8
+ c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?Lz+d+Kz:"",Jz].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[Mz+a+'"\x3e','\x3cDATA\x3e\x3cPROTECTINFO\x3e\x3cKIDS\x3e\x3cKID ALGID\x3d"AESCTR" ',c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/KIDS\x3e\x3c/PROTECTINFO\x3e",d?Lz+d+Kz:"",Jz].join("");break b;default:_.J("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.Hh("New payload",e);e=_.lj(_.R.Le(e,!0));return new _.Rn(_.Vn,
9
+ b,d||null,e,a,c)};_.tA=function(a,b){return b===a.version?a:_.sA(b,a.a,a.l||void 0,a.h||void 0)};uA=function(a,b){a:{if(b){var c=_.t(a.f.keys());for(var d=c.next();!d.done;d=c.next()){d=a.f.get(d.value);for(var e=0;e<d.ab.length;e++)if(d.ab[e]===b){c=d;break a}}}c=null}return c?c.Ia:null};vA=function(a,b){if(_.Yk("Edge/"))return!0;b=b.toLowerCase();if(_.Vj()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.ne);return a.J.has(b)||a.J.has(c)}return a.J.has(b)};
10
+ wA=function(a,b){var c=a.l.get(b);return!(!c||c!==_.ff&&c!==_.ze)};xA=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.Do(c),!vA(a,c))||d&&d.encrypted&&(d=_.Do(d),!vA(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};yA=function(a,b){return a.a.find(function(c){return c.getId()===b})||null};
11
+ zA=function(a,b){if(a.a.length)if(0>b)a.f=0;else{for(var c=0,d=a.a[c]||null;d&&b>d.pb()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};AA=function(a,b){a.a=b.enabled};BA=function(){};_.CA=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};
12
+ _.DA=function(a,b,c,d,e){this.Qa=a;this.va=b;this.ja=c;this.keyInfo=d||null;this.Sc=_.O.R(e)?!1:!!e};EA=function(a,b){a=_.dj(a);b=_.dj(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};FA=function(a){return a.language?_.dj(a.language):a.audio&&a.audio.language?_.dj(a.audio.language):a.video&&a.video.language?_.dj(a.video.language):_.vg};
13
+ _.GA=function(a,b){for(var c=_.dj(a),d=new Set,e=_.t(b),f=e.next();!f.done;f=e.next())d.add(_.dj(f.value));e=_.t(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,f===c)return f;e=_.t(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,EA(f,c))return f;e=_.t(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.dj(g);h=_.dj(h);g=g.split("-");h=h.split("-");if(2===g.length&&2===h.length&&g[0]===h[0])return f}d=_.t(d);for(f=d.next();!f.done;f=d.next())if(e=f.value,EA(c,e))return e;return null};
14
+ HA=function(a,b){for(var c=0,d=_.t(a),e=d.next();!e.done;e=d.next())c+=b(e.value)?1:0;return c};IA=function(a,b){var c=_.Qk(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};JA=function(a){var b=[a.mimeType];_.Yu.forEach(function(c,d){var e=a[d];e&&b.push(c+'\x3d"'+e+'"')});return b.join(";")};_.KA=function(a){a=a.split(".");var b=a[0];a.pop();return[b,a.join(".")]};
15
+ LA=function(a,b){for(var c=new _.Tl(void 0,void 0===b?"total":b),d=_.t(a),e=d.next();!e.done;e=d.next())c.a.push(e.value);c.length=a.length;return c};MA=function(a,b){return a.start-b.start};_.NA=function(a){this.h=a;this.log=new _.K("clpp.renditions");this.S=[];this.f=this.player=null;this.a=!1};OA=function(a){return a.S.map(function(b){return{start:b.start,end:b.end,width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b.rendition}})};
16
+ PA=function(a){a.player&&(a.player.off(_.Rf,a.Oc),a.a&&a.player.off(_.rg,a.Oc));a.player=null};QA=function(a){a.player&&a.player.trigger(new _.L(_.hd))};RA=function(a){if(a.player){for(var b=!1,c={},d=0;d<a.S.length;d++){var e=a.S[d],f=e.width+"x"+e.height,g=c[f];if(g&&g!==e.bandwidth){b=!0;break}c[f]=e.bandwidth}b&&!a.a?(a.log.debug("Tracking timeupdates"),a.player.on(_.rg,a.Oc,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.rg,a.Oc),a.a=!1)}};
17
+ SA=function(a,b,c){a.S=a.S.filter(function(d){if(d.end<=b||d.start>=c)return!1;d.start=Math.max(d.start,b);d.end=Math.min(d.end,c);return!0});a.player&&a.player.trigger(new _.L(_.Ig))};TA=function(a,b){for(var c=null,d=_.t(a),e=d.next();!e.done;e=d.next())e=e.value,b>=e.startTime&&(c=e);return c};
18
+ UA=function(a){var b=new Set;a.variants.forEach(function(c){c.audio&&b.add(c.audio);c.video&&(b.add(c.video),c.video.trickModeVideo&&b.add(c.video.trickModeVideo))});a.textStreams.forEach(function(c){return b.add(c)});a.thumbStreams.forEach(function(c){return b.add(c)});return b};VA=function(a,b){for(var c=0;c<a.length;c++)if(UA(a[c]).has(b))return c;return-1};XA=function(a,b){Array.from(UA(a)).forEach(function(c){c.segmentIndex&&_.WA(c.segmentIndex,b)})};
19
+ _.YA=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.ZA=function(a,b,c){var d=Math.pow(a.h,b);c=c*(1-d)+d*a.a;isNaN(c)||(a.a=c,a.f+=b)};_.$A=function(a){return a.a/(1-Math.pow(a.h,a.f))};
20
+ _.aB=function(a,b,c,d,e,f,g,h){a=_.Jj(a);a.timeout=d.timeout;a.maxAttempts=d.maxAttempts;a.baseDelay=d.baseDelay;a.fuzzFactor=d.fuzzFactor;a.backoffFactor=d.backoffFactor;if(0!==b||null!=c)a.headers.Range=c?"bytes\x3d"+b+"-"+c:"bytes\x3d"+b+"-";e&&(a.startTime=e);f&&(a.endTime=f);g&&(a.contentType=g);h&&(a.timescale=h);return a};bB=function(a){this.a=this.h=0;this.f=a};_.cB=function(a,b,c){a.h=b;a.a=c};
21
+ _.dB=function(a,b,c,d,e,f){f=void 0===f?!1:f;this.j=a;this.D=b;this.I=c;this.A=this.f=Infinity;this.h=1;this.G=0;this.l=this.w=null;this.H=0;this.B=this.o=d;this.K=void 0===e?!0:e;this.g=new _.K("clpp.media.PresentationTimeline");this.L=f;this.J=null;this.a=new bB(d)};_.fB=function(a,b){a.J={offsetDateTime:b-eB(a),seekRangeStartDateTime:b}};_.gB=function(a,b){a.o=b;a.B=b;a.a.f=b};hB=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.o?a.f:a.B?a.l:null};
22
+ _.kB=function(a,b,c){if(0!==b.length){var d=b[b.length-1].endTime+c;_.iB(a,b[0].startTime+c);a.h=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.jB(a,d);null!=a.D&&a.K&&(a.D=(Date.now()+a.H)/1E3-(a.l||0)-a.h);a.g.debug("notifySegments: maxSegmentDuration\x3d"+a.h)}};_.iB=function(a,b){a.w=null==a.w?b:Math.min(a.w,b)};_.jB=function(a,b){a.l=Math.max(a.l||0,b)};_.lB=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};
23
+ _.nB=function(a){return 2===a.j.version?a.a.pb():Infinity===a.A?0:Math.max(0,mB(a)-a.A)};mB=function(a){if(2===a.j.version)a=a.a.a;else if(a.o)a=a.f;else if(a.B)a=a.l||0;else{var b=(Date.now()+a.H)/1E3;a=Math.min(a.L?Math.max(0,b-(a.h-a.G)-a.D):Math.max(0,b-a.h-a.D),a.f)}return a};pB=function(a,b){if(2===a.j.version)return a.a.pb();var c=Math.max(a.w,0);return Infinity===a.A?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(mB(a)-a.A+b,oB(a)))};eB=function(a){return 2===a.j.version?a.a.pb():pB(a,0)};
24
+ oB=function(a){var b=a.Md()&&!a.B?a.I:0;return 2===a.j.version?a.a.a-b:Math.max(0,mB(a)-b)};qB=function(a,b){var c=(void 0===b?0:b)?a.offset:0;return{schemeIdUri:a.schemeIdUri,configurationId:a.configurationId,value:a.value,startTime:a.startTime+c,endTime:a.endTime+c,id:a.id,eventElement:a.eventElement,type:a.type,Wa:a.Wa}};rB=function(){this.f=function(){};this.a=new Set};sB=function(a,b){a.f=b};
25
+ tB=function(a,b){a:{var c=_.t(a.a);for(var d=c.next();!d.done;d=c.next())if(d=d.value,d.schemeIdUri===b.schemeIdUri&&d.startTime===b.startTime&&d.endTime===b.endTime&&d.configurationId===b.configurationId){c=d;break a}c=null}null==c&&(a.a.add(b),a.f(b))};uB=function(a,b){for(var c=_.t(b),d=c.next();!d.done;d=c.next())tB(a,d.value)};vB=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return qB(c,b)})};
26
+ wB=function(a,b,c,d){this.a=a;this.h=null;this.j=b;this.f=c;this.o=d;"flat"===d.timeline&&d.cropTimeline&&(a=d.startTime||0,this.j.a=new _.wt("crop",a,d.endTime?d.endTime-a:Infinity,!1))};xB=function(a){var b=a.a.$g(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.L(_.Uf,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};yB=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.K("clpp.media.SegmentIterator")};
27
+ zB=function(a){var b=a.h.get(a.a);if(!b)return null;0<b.a.length&&b.Qa().length&&a.f>=b.a.length&&(a.a+=1,a.f=0,b=a.h.get(a.a));return b&&0<b.a.length?b.a[a.f]||null:b};_.AB=function(a){this.a=a;this.g=new _.K("clpp.media.SegmentIndex")};_.BB=function(a){return a.a.length?a.a[a.a.length-1].endTime:0};_.CB=function(a,b){for(var c=0;c<a.a.length;++c)if(a.a[c].endTime>b)return a.a.splice(0,c);c=a.a;a.a=[];return c};
28
+ DB=function(a,b){var c=a.Pc(b);c=null===c?-1:c-1;var d=a.get(c+1),e=-1;if(d&&0<d.a.length)for(var f=d.a.length-1;0<=f;--f){var g=d.a[f];if(b>=g.startTime&&b<g.endTime){for(;f&&!g.h;)--f,g=d.a[f];if(!g.h)break;c+=1;e=f-1;break}}return new yB(a,c,e)};_.WA=function(a,b){for(;a.a.length;)if(0>=a.a[0].endTime)a.a.shift();else break;0===a.a.length||a.a[a.a.length-1].startTime>=b||(a.a[a.a.length-1].endTime=b)};
29
+ FB=function(a,b){this.h=a;this.l=EB(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};GB=function(a,b){a.f=b};HB=function(a){this.a=a};EB=function(a){if(a.a.paused||0===a.a.playbackRate||0===a.a.buffered.length)var b=!1;else a:{b=a.a.buffered;a=a.a.currentTime;for(var c=0;c<b.length;c++){var d=b.start(c),e=b.end(c);if(!(a<d-.1||a>e-(c+1===b.length?.5:.1))){b=!0;break a}}b=!1}return b};
30
+ JB=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.l=c;this.G=e;this.h=new _.Sh;this.D=!1;this.J=a.readyState;this.j=!1;this.f=d;this.B=this.o=this.I=this.A=!1;this.h.on(a,_.Ng,function(){return IB(f)});this.w=(new _.Vk(function(){IB(f)})).kb(.25)};
31
+ IB=function(a){if(0!==a.a.readyState){if(a.a.seeking){if(!a.D)return}else a.D=!1;if(!a.a.paused&&!a.o){a.a.readyState!==a.J&&(a.j=!1,a.J=a.a.readyState);var b=a.l.smallGapLimit,c=a.a.currentTime,d=a.a.buffered;a:{var e=new _.Tl(d);var f=a.l.gapDetectionThreshold;if(e.length&&!(1===e.length&&1E-6>e.end(0)-e.start(0)))for(var g=0;g<e.length;g++)if(e.start(g)>c&&(0===g||e.end(g-1)-c<=f)){e=g;break a}e=null}if(null==e){if(a.f){a=a.f;d=a.h;c=EB(d);d=d.a.currentTime;b=Date.now()/1E3;if(a.a!==d||a.l!==c)a.j=
32
+ b,a.a=d,a.l=c;d=b-a.j;d>=a.o&&c&&a.f(a.a,d)}}else if((0!==e||a.A)&&a.I&&(f=d.start(e),!(f>=oB(a.H)))){g=f-c;b=g<=b;var h=!1;if(!(.001>g)){if(!b&&!a.j){a.j=!0;var l=new _.L("largegap",{detail:{currentTime:c,gapSize:g}});l.cancelable=!0;a.G(l);a.l.jumpLargeGaps&&!l.defaultPrevented?h=!0:_.Gh("Ignoring large gap at",c,"size",g)}if(b||h)0===e?_.Gh(Pz,g,"seconds because of gap before start time of",f):_.Gh(Pz,g,"seconds because of gap starting at",d.end(e-1),"and ending at",f),a.B=!0,a.a.currentTime=f}}}}};
33
+ KB=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.Vk(function(){0>=b.j?(_.J(["Failed to move playhead from",b.h,"to",b.l].join(" ")),b.a.stop()):b.f.currentTime!==b.h?b.a.stop():(b.f.currentTime=b.l,b.j--)})};LB=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.kb(.1)};OB=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.Sh;this.h=new KB(a);this.w=!1;0<a.readyState?MB(this,c):NB(this,c)};
34
+ PB=function(a){return a.l?a.a.currentTime:a.A};QB=function(a,b){0<a.a.readyState?LB(a.h,b):NB(a,b)};NB=function(a,b){a.A=b;a.f.off(a.a,_.Ke);a.f.one(a.a,_.Ke,function(){MB(a,b)})};MB=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?RB(a):(a.f.one(a.a,_.Yf,function(){RB(a)}),LB(a.h,0===a.a.currentTime?b:a.a.currentTime))};RB=function(a){_.$k()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.Yf,function(){return a.j()})};
35
+ VB=function(a,b,c,d,e,f,g){var h=this;this.h=a;this.a=b.presentationTimeline;this.B=b.minBufferTime||0;this.l=c;this.A=e;this.w=null;this.j=new JB(a,b.presentationTimeline,c,SB(this,a,c),f);this.f=new OB(a,function(){a:{var l=h.j;var m=l.B;l.B=!1;l.D=!0;l.A=!1;l.j=!1;l=PB(h.f);var n=TB(h,l);if(.001<Math.abs(n-l)){var p=(new Date).getTime()/1E3;if(!h.w||h.w<p-1){h.w=p;QB(h.f,n);m=void 0;break a}}h.g.debug("Seek to "+l);h.A(m?1:0);m=void 0}return m},UB(this,d,g),function(){h.j.I=!0});this.o=(new _.Vk(function(){if(0!==
36
+ h.h.readyState&&!h.h.paused){var l=PB(h.f),m=eB(h.a),n=oB(h.a);3>n-m&&(m=n-3);l<m&&(m=TB(h,l),h.g.info("Jumping forward "+(m-l)+" seconds to catch up with the seek range."),h.h.currentTime=m)}})).kb(.25);this.g=new _.K("clpp.mse.Playhead")};XB=function(a){var b=PB(a.f);return 0<a.h.readyState&&!a.h.paused?WB(a,b):b};UB=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?eB(a.a):oB(a.a):0>b&&(b=oB(a.a)+b);return YB(a,WB(a,b))};
37
+ YB=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
38
+ TB=function(a,b){var c=new _.Tl(a.h.buffered);c=c.qc.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=eB(a.a),g=oB(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=pB(a.a,d),m=pB(a.a,e);d=pB(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),YB(a,b);if(b>g)return a.g.debug("Playhead past end."),g;if(b<f){if(c(m))return a.g.debug("Playhead before start \x26 start is buffered"),m;a.g.debug("Playhead before start \x26 start is unbuffered");return d}if(b>=l||c(b))return a.g.debug("Playhead in safe region or in buffered region."),
39
+ b;a.g.debug("Playhead outside safe region \x26 in unbuffered region.");return d};WB=function(a,b){var c=eB(a.a);if(b<c)return c;c=oB(a.a);return b>c?c:b};
40
+ SB=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new FB(new HB(b),c.stallThreshold);GB(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var h=new _.Tl(b.buffered),l;if(l=_.Yk("Edge/")||_.Yk("Trident/")||_.Vj()||_.$k())a:{if(h.length&&!(1>=h.length))for(l=0;l<h.length-1;l++)if(f>h.start(l)&&f<h.end(l)){l=h.start(l+1)-h.end(l)>=d;break a}l=!1}if(l){a:{if(h.length&&!(1>=h.length))for(l=0;l<h.length-1;l++)if(f>h.start(l)&&f<h.end(l)){h=
41
+ h.start(l+1)-f;break a}h=null}h&&(e=Math.min(h+.1,e))}a.g.warn("Seeking forward "+e+" seconds to break stall.");b.currentTime+=e}else a.g.warn("Pausing and unpausing to break stall."),b.pause(),b.play()});return c};$B=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.Vk(function(){ZB(b,!1)})).kb(.25)};ZB=function(a,b,c){c=void 0===c?0:c;for(var d=_.t(a.a),e=d.next();!e.done;e=d.next())e.value.l(a.f.currentTime,b,c)};
42
+ aC=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
43
+ bC=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{Bc:null,Ac:2,oc:function(c,d){return b.a(c,d)}},{Bc:1,Ac:2,oc:function(c,d){return b.a(c,d)}},{Bc:3,Ac:2,oc:function(c,d){return b.a(c,d)}},{Bc:2,Ac:1,oc:function(c,d){return b.f(c,d)}},{Bc:2,Ac:3,oc:function(c,d){return b.f(c,d)}},{Bc:1,Ac:3,oc:function(c,d){return b.h(c,d)}},{Bc:3,Ac:1,oc:function(c,d){return b.h(c,d)}}]};cC=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
44
+ _.dC=function(a){_.Ct[a]&&delete _.Ct[a]};_.eC=function(a){_.At[a]&&delete _.At[a]};fC=function(a,b){this.w=null;this.D=a;this.h=b;this.j=this.A=0;this.l=Infinity;this.f=this.a=null;this.B="";this.o=new Map};
45
+ gC=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.h)if(null==c||null==d)a.w.parseInit(_.lj(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.lj(b),e);var f=e.cues.filter(function(g){return g.startTime>=a.j&&g.startTime<a.l});a.h.append(f,e.styles);null==a.a&&(a.a=Math.max(c,a.j));a.f=Math.min(d,a.l)}})};
46
+ hC=function(a,b,c){a.B=b;if(b=a.o.get(b))for(var d=_.t(b.keys()),e=d.next();!e.done;e=d.next())if(e=b.get(e.value))e=e.filter(function(f){return f.endTime<=c}),a.h.append(e,[])};
47
+ iC=function(a,b,c,d,e){var f=c+" "+d,g=new Map;b=_.t(b);for(var h=b.next();!h.done;h=b.next()){var l=h.value;h=l.stream;g.has(h)||g.set(h,new Map);g.get(h).has(f)||g.get(h).set(f,[]);l.startTime+=e;l.endTime+=e;l.startTime>=a.j&&l.startTime<a.l&&(l=new _.ri(l.startTime,l.endTime,l.text),g.get(h).get(f).push(l),h===a.B&&a.h.append([l],[]))}e=_.t(g.keys());for(f=e.next();!f.done;f=e.next())for(f=f.value,a.o.has(f)||a.o.set(f,new Map),b=_.t(g.get(f).keys()),h=b.next();!h.done;h=b.next())h=h.value,l=
48
+ g.get(f).get(h),a.o.get(f).set(h,l);a.a=null==a.a?Math.max(c,a.j):Math.min(a.a,Math.max(c,a.j));a.f=Math.max(a.f,Math.min(d,a.l))};_.jC=function(a){a=a.toLowerCase();return _.qu[a]||window.muxjs&&a===_.Tc?!0:!1};kC=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.lC=function(){};
49
+ _.nC=function(a,b,c,d,e){this.j=a;this.B=c;this.f={};this.L=!1;this.a=null;this.h={};this.l=new _.Sh;this.I=!1;this.w={};this.H=b;this.D=d;this.J=e;this.T=this.J.streaming.maxSegmentToMediaOffset||1;this.K=new _.Oj;this.A="";this.G={};this.o=mC(this,this.K);this.N=!0;this.g=new _.K("clpp.mse.MediaSourceEngine")};oC=function(a){var b=_.Rk(a.mimeType,a.codecs),c=JA(a);return _.jC(b)||_.vr(c)||(_.Qk(b,a.type)?!0:!1)};
50
+ mC=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,"sourceopen",function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,"startstreaming",function(){a.N=!0});a.l.on(c,"endstreaming",function(){a.N=!1});a.A=pC(c);a.j.src=a.A;return c}c=new MediaSource;a.A=pC(c);a.l.one(c,"sourceopen",function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};qC=function(a){a.g.debug("Reset transmuxers.");Object.values(a.w).forEach(function(b){return b.reset()})};
51
+ rC=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.re,a.U.bind(a,d));a.l.on(e,"updateend",a.cd.bind(a,d));a.f[d]=e;a.h[d]=[];a.G[d]=!1});a.L=b.has(_.bd)&&b.has(_.Fg)};sC=function(a){return a.J.streaming.ignoreManagedMediaSourceStreamingHints?!0:a.N};tC=function(a,b){a.a||(a.a=new fC(a.J,a.B));var c=a.a;if(b!==_.Tc){var d=_.qu[b];if(!d)throw new _.P(_.Q,2,2012,"Text parser is unavailable for "+b);c.w=new d(c.D)}};uC=function(a){return a.o?a.o.readyState===_.qe:!0};
52
+ wC=function(a){var b={};b.total=new _.Tl(a.j.buffered,"total");b.audio=vC(a,_.bd);b.video=vC(a,_.Fg);var c=[];a.a&&(c=[{start:a.a.xb(),end:a.a.Ea()}]);b.text=LA(c,_.Ri);return b};vC=function(a,b){try{return new _.Tl(a.f[b].buffered,b)}catch(c){return b in a.f&&a.g.error("failed to get buffered range for "+b,c),null}};xC=function(a,b){if(!a.f[b])return"";var c=vC(a,b);return c?c.toString():""};
53
+ zC=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l=a.f[b],m=-1,n=0;l&&l.buffered&&(n=l.buffered.length);b===_.Fg&&null!==d&&null!==e&&h&&(m=0<n?l.buffered.end(n-1):-1);b===_.Ri?c=gC(a.a,c,d,e):a.w[b]?(c=a.w[b].transmux(c),c.captions&&0<c.captions.length&&(a.a||tC(a,_.ng),iC(a.a,c.captions,d,e,a.f.video.timestampOffset)),f=[],0<c.audio.byteLength&&a.f.audio&&f.push(yC(a,_.bd,a.mf.bind(a,_.bd,c.audio.buffer))),0<c.video.byteLength&&a.f.video&&f.push(yC(a,_.Fg,a.mf.bind(a,_.Fg,c.video.buffer))),c=
54
+ Promise.all(f)):(f&&window.muxjs&&(a.a||tC(a,_.ng),null==d&&null==e?a.H.init(c):a.H.h(c,function(p){p.length&&iC(a.a,p,d,e,a.f.video.timestampOffset)})),c=yC(a,b,a.mf.bind(a,b,c)));return c.then(function(){if(b===_.Fg&&null!==d&&null!==e&&!h)a.D.append(d,e,g),null!==d&&null!==e&&a.g.debug("Appended video segment ",d,e,"Buffer:",xC(a,b));else if(b===_.bd&&null!==d&&null!==e)QA(a.D),null!==d&&null!==e&&a.g.debug("Appended audio segment ",d,e,"Buffer:",xC(a,b));else if(b===_.Fg&&null!==d&&null!==e&&
55
+ h){var p=l.buffered.length,q=0<p?l.buffered.end(p-1):-1;0>m&&0<p&&(m=l.buffered.start(0));0<=m&&0<q&&a.D.append(m,q,g)}if(!a.G[b]&&l&&1===l.buffered.length){p=l.buffered.start(0);var u=d-p;if(Math.abs(u)>a.T&&0===l.timestampOffset)return a.g.warn("Detected a delta of "+u+" between media times and segment times for "+(b+". The segment start time is ")+(d+" and the media start time is ")+(p+". Adjusting timestampOffset.")),p=yC(a,b,function(){a.ci(b,u)}),q=yC(a,b,a.Xg.bind(a,b,!1)),Promise.all([p,q])}null!==
56
+ d&&null!==e&&(a.G[b]=!0)})["catch"](function(p){throw p;})};AC=function(a,b){var c=a.Ea(_.Fg)||0;hC(a.a,b,c)};BC=function(a){a.a&&hC(a.a,"",0)};DC=function(a,b,c,d,e){if(b===_.Ri)return a.a.A=c,a=a.a,a.j=d,a.l=e,Promise.resolve();b=CC(a,b,c,d,e);a.L&&(b=b.concat(CC(a,_.bd,c,d,e)));return Promise.all(b)};CC=function(a,b,c,d,e){return[yC(a,b,a.zi.bind(a,b)),yC(a,b,a.ci.bind(a,b,c)),yC(a,b,a.Dm.bind(a,b,d,e))]};FC=function(a,b){EC(a,function(){a.o.duration=b})};
57
+ yC=function(a,b,c){if(a.I)return Promise.reject();c={start:c,p:new _.Oj};a.h[b].push(c);1===a.h[b].length&&GC(a,b);return c.p};GC=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug("Starting next operation for "+b),c.start()}catch(d){"QuotaExceededError"===d.name?c.p.reject(new _.P(_.Q,3,3017,{type:b})):c.p.reject(new _.P(_.Q,3,3015,{mediaError:d})),HC(a,b)}else a.g.debug("No more scheduled operations for "+b)};
58
+ EC=function(a,b){if(a.I)return Promise.reject();var c=[],d;for(d in a.f){var e=new _.Oj,f={start:function(g){g.resolve()}.bind(null,e),p:e};a.h[d].push(f);c.push(e);1===a.h[d].length&&f.start()}return Promise.all(c).then(function(){for(var g in a.f);try{b()}catch(m){var h=Promise.reject(new _.P(_.Q,3,3015,{mediaError:m}))}for(var l in a.f)HC(a,l);return h},function(){for(var g in a.f)a.h[g].length&&a.h[g].shift();return Promise.reject()})};HC=function(a,b){a.h[b].shift();GC(a,b)};
59
+ NC=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants});if(b.length||c.length)e=IC(e,b,c);e=JC(e,d);if(1<a.periods.length){var f=function(n){n=n.split(".");var p=n[0];1<n.length&&(p+="."+n[1]);return p.toLowerCase()};b=[];c=_.t(a.periods);for(var g=c.next();!g.done;g=c.next()){d=new Set;g=_.t(g.value.variants);for(var h=g.next();!h.done;h=g.next())h=h.value,null!==h.audio&&d.add(f(h.audio.codecs));b.push(d)}var l=b[0];c={};for(d=1;d<b.length;c={Te:c.Te},d++)c.Te=b[d],l=new Set(_.ah(l).concat().filter(function(n){return function(p){return n.Te.has(p)}}(c)));
60
+ e=e.filter(function(n){return 0===l.size&&null===n.audio?!0:0<l.size&&null===n.audio?!1:l.has(f(n.audio.codecs))})}e=KC(e);var m=LC(e);a=_.t(a.periods);for(e=a.next();!e.done;e=a.next())e=e.value,e.variants=e.variants.filter(function(n){if(MC(n)===m)return!0;_.Hh("Dropping Variant (better codec available)",n);return!1})};KC=function(a){var b=new _.Ph;a=_.t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=MC(c);b.push(d,c)}return b};
61
+ IC=function(a,b,c){var d={};b=_.t(b);for(var e=b.next();!e.done;d={$e:d.$e},e=b.next())if(d.$e=e.value,e=a.filter(function(f){return function(g){return g.video&&g.video.codecs.startsWith(f.$e)}}(d)),e.length){a=e;break}d={};c=_.t(c);for(b=c.next();!b.done;d={Pe:d.Pe},b=c.next())if(d.Pe=b.value,b=a.filter(function(f){return function(g){return g.audio&&g.audio.codecs.startsWith(f.Pe)}}(d)),b.length){a=b;break}return a};
62
+ LC=function(a){var b="",c=Infinity;oA(a,function(d,e){var f=e.reduce(function(g,h){return g+h.bandwidth||0},0)/e.length;_.Hh(_.Md,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};MC=function(a){var b="";a.video&&(b=_.KA(a.video.codecs)[0]);var c="";a.audio&&(c=_.KA(a.audio.codecs)[0]);return b+"-"+c};
63
+ OC=function(a,b,c){function d(f,g,h){return f>=g&&f<=h}var e=a.video;return e&&e.width&&e.height&&!(d(e.width,b.minWidth,Math.min(b.maxWidth,c.width))&&d(e.height,b.minHeight,Math.min(b.maxHeight,c.height))&&d(e.width*e.height,b.minPixels,b.maxPixels))||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0};PC=function(a,b,c){var d=!1;a=_.t(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=OC(e,b,c);f!==e.allowedByApplication&&(d=!0)}return d};
64
+ SC=function(a,b,c,d){var e=!1;d.variants=d.variants.filter(function(m){if(a&&a.$&&!xA(a,m))return _.Hh("Dropping variant - not compatible with key system",m),!1;var n=m.audio,p=m.video;if(n&&!oC(n)){var q=n.codecs;0<=n.codecs.indexOf(_.ne)?(_.Hh("Trying to use AC-3 for EC-3"),n.codecs=n.codecs.replace(_.ne,"ac-3"),oC(n)?_.Gh("Using AC-3 instead of EC-3 for",QC(n)):(n.codecs=q,_.Gh(Uz,QC(n)),m.audio=null,e=!0,n=null)):(_.Gh(Uz,QC(n)),m.audio=null,e=!0,n=null)}return p&&!oC(p)?(_.Gh("Dropping variant - video not compatible with platform",
65
+ QC(p)),!1):n&&b&&!RC(n,b)?(_.Gh("Dropping variant - not compatible with active audio","active audio",QC(b),"variant.audio",QC(n)),!1):p&&c&&!RC(p,c)?(_.Gh("Dropping variant - not compatible with active video","active video",QC(c),"variant.video",QC(p)),!1):!0});if(e){for(var f=!1,g=!1,h=_.t(d.variants),l=h.next();!l.done;l=h.next())l=l.value,!f&&l.video&&l.audio&&(f=!0),g||l.audio||!l.video||(g=!0);f&&g&&(d.variants=d.variants.filter(function(m){return m.video&&!m.audio?(_.Gh("Dropping variant - not compatible with video + audio",
66
+ "variant.video",QC(m.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(m){var n=_.jC(_.Rk(m.mimeType,m.codecs));n||_.Hh("Dropping text stream. Is not supported by the platform.",m);return n})};RC=function(a,b){return a.mimeType!==b.mimeType||a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
67
+ TC=function(a){var b=a.audio,c=a.video,d=b?b.codecs:null,e=c?c.codecs:null,f=[];e&&f.push(e);d&&f.push(d);var g=c&&c.mimeType||null,h=b&&b.mimeType||null,l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;var m=new Set,n=new Set;if(b)for(var p=_.t(b.roles),q=p.next();!q.done;q=p.next())n.add(q.value);if(c)for(p=_.t(c.roles),q=p.next();!q.done;q=p.next())m.add(q.value);q=[c,b].map(function(u){return u?u.accessibility||[]:[]}).reduce(function(u,v){return u.concat(v)},[]);a={id:a.id,active:!1,type:"variant",
56
68
  bandwidth:a.bandwidth,language:a.language,originalLanguage:a.language,label:null,kind:l,width:null,height:null,frameRate:null,trickPlay:!1,mimeType:g,audioMimeType:h,codecs:f.join(", "),audioCodec:d,videoCodec:e,primary:a.primary,roles:Array.from(m),audioRoles:Array.from(n),videoId:null,audioId:null,channelsCount:null,spatialAudio:!1,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,accessibility:q,keyId:c?c.keyId:b?b.keyId:null};c&&(a.videoId=c.id,
57
69
  a.originalVideoId=c.originalId,a.width=c.width||null,a.height=c.height||null,a.frameRate=c.frameRate||null,a.trickPlay=!!c.trickPlay,a.videoBandwidth=c.bandwidth||null);b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.originalLanguage=b.originalLanguage,a.channelsCount=b.channelsCount,a.audioBandwidth=b.bandwidth||null,a.label=b.label,a.audioRoles=b.roles);return a};
58
- rB=function(a){return{id:a.id,active:!1,type:_.bg,bandwidth:0,language:a.language,originalLanguage:a.originalLanguage,label:a.label,kind:a.kind||null,width:null,height:null,frameRate:null,trickPlay:!1,mimeType:a.mimeType,audioMimeType:null,codecs:a.codecs||null,audioCodec:null,videoCodec:null,primary:a.primary,roles:a.roles,audioRoles:null,videoId:null,audioId:null,channelsCount:null,spatialAudio:!1,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:a.originalId,
59
- accessibility:a.accessibility,keyId:null}};sB=function(a){return a.allowedByApplication&&a.allowedByKeySystem};gB=function(a,b){var c=a.filter(function(g){return g.audio&&g.audio.channelsCount}),d=new Map;c=_.u(c);for(var e=c.next();!e.done;e=c.next()){e=e.value;var f=e.audio.channelsCount;d.has(f)||d.set(f,[]);d.get(f).push(e)}c=Array.from(d.keys());if(0===c.length)return a;e=c.filter(function(g){return g<=b});return e.length?d.get(Math.max.apply(null,e)):d.get(Math.min.apply(null,c))};
60
- _.uB=function(a,b,c,d){b=_.Th(b);var e=a,f=a.filter(function(h){return h.primary});f.length&&(e=f);var g=e.length?e[0].language:"";e=e.filter(function(h){return h.language===g});b.some(function(h){var l=_.Gz(_.Ni(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.Ni(m.language)===l}),!0):!1});e=e.filter(function(h){return d?h.kind===_.oe:h.kind!==_.oe});if(c){b=tB(e,c);if(b.length)return b;_.J("No exact match for the text role could be found.")}else if(b=e.filter(function(h){return 0===
61
- h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.mi,[]);return b.length?tB(e,b[0]):e};tB=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};vB=function(a,b,c){for(var d=0;d<c.length;d++)if(c[d].audio===a&&c[d].video===b)return c[d];return null};
62
- nB=function(a){var b=Oz(a);return a.type===_.$c?"type\x3daudio mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" channelsCount\x3d"+a.channelsCount:a.type===_.sg?"type\x3dvideo mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" frameRate\x3d"+a.frameRate+" width\x3d"+a.width+" height\x3d"+a.height:"unexpected stream type"};
63
- wB=function(a,b){var c=String(_.Tj++);c=new _.Oj(c,a);c.mimeType=_.Pj(b.mimeType);if(a===_.S||a===_.T)c.label=_.Pj(b.label),c.language=_.Pj(b.language),c.originalLanguage=_.Pj(b.originalLanguage);a===_.Qj?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.T?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.Pj(b.audioMimeType)):(c.kind=_.Pj(b.kind),c.roles=b.roles);c.accessibility=a===_.Qj||a===_.T?(b.accessibility||[]).filter(function(d){return d.type===a}):
64
- b.accessibility||[];return c};
65
- xB=function(a,b,c){var d=new _.Wj(a===_.Qj?""+b.videoId:a===_.T?""+b.audioId:""+b.id,c);switch(a){case _.Qj:d.codec=_.Pj(b.videoCodec);d.bandwidth=b.videoBandwidth||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.originalVideoId;d.drm={keyId:b.keyId||void 0};break;case _.T:d.codec=_.Pj(b.audioCodec);d.bandwidth=b.audioBandwidth||b.bandwidth;d.originalId=b.originalAudioId;d.drm={keyId:b.keyId||void 0};break;default:d.codec=_.Pj(b.codecs),d.originalId=b.originalTextId}(a=c.renditions.find(function(e){return _.N.ta(e,
66
- d,null,["id","track"])}))||c.renditions.push(d);return a||d};yB=function(a,b){var c=a.reduce(function(d,e){b===_.Qj?null===e.videoId||d[e.videoId]&&!e.active||(d[e.videoId]=e):b===_.T&&(null===e.audioId||d[e.audioId]&&!e.active||(d[e.audioId]=e));return d},{});return Object.values(c)};zB=function(a,b){if(void 0!==b&&null!==b){var c=a.filter(function(d){return d.audio&&d.audio.id===b});if(0<c.length)return c}return a};
67
- AB=function(a,b,c){function d(f,g){return null==f?null==g:g.id==f}for(var e=0;e<c.length;e++)if(d(a,c[e].audio)&&d(b,c[e].video))return c[e];return null};BB=function(){this.g=new _.K("cl.api.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};CB=function(a,b){return a.h.filter(function(c){return c.type===b})};DB=function(a,b){var c=a.a.get(b)||null;return c&&c.track};
68
- FB=function(a,b,c){if(!c||DB(a,c.type)!==c||a.m.ma())switch(b){case _.Qj:a.Ya(c&&c.renditions[0]);break;case _.T:a.gb(c&&c.renditions[0]);break;case _.S:a.hb(c&&c.renditions[0]);break;default:EB(a,b,c&&c.renditions[0])}};GB=function(a,b){a.a.set(b.track.type,b);b===(a.f.get(b.track.type)||null)&&a.f.set(b.track.type,null)};
69
- EB=function(a,b,c,d){d=void 0===d?!1:d;if(a.m&&((a.a.get(b)||null)!==c||a.m.ma())){var e=a.m;if(c){if(0>a.h.indexOf(c.track))throw Error("Unknown rendition with ID "+c.id);if(b!==c.track.type)throw Error("Types mismatch");a.g.debug("Activate rendition type\n "+b+" with ID: "+c.id);if(b===_.S){var f=e.fa().find(function(n){return n.id==c.id});f&&(a.f.set(b,c),GB(a,c),e.trigger(new _.L(_.nl)),HB(e,!0).then(function(){IB(e,f)})["catch"](function(n){a.g.warn("Error while activating track",n)}))}else if(b===
70
- _.T)a.f.set(b,c),JB(e,parseInt(c.id,10));else if(b===_.Qj){var g=a.a.get(_.T)||null,h=null;if(g){var l=KB(e).filter(function(n){return n.videoId==c.id});h=l.find(function(n){return n.audioId==g.id})||null;if(!h){a.g.debug("Unable to find exact variant. Searching for equivalent");var m=g.track.renditions.map(function(n){return n.id}).filter(function(n){return n!==g.id});h=l.find(function(n){return m.find(function(p){return p==n.audioId})})||null}}else h=KB(e).find(function(n){return n.videoId==c.id})||
71
- null;h?(a.f.set(b,c),LB(e,h,d)):a.g.warn("Cannot find matching variant")}}else a.g.debug(_.Ja+b),(h=DB(a,b))&&(b===_.S?HB(e,!1).then(function(){a.a.set(b,null);e.trigger(new _.L(_.nl))})["catch"](function(n){a.g.warn("Error while de-activating text tracks",n)}):b===_.T?a.g.info("Enabling ABR for audio is not supported"):b===_.Qj&&h.trickPlay?a.g.info("Enabling ABR for trick play tracks is not supported"):LB(e,null,d))}};
72
- OB=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.u(Object.values(_.$t)),d=c.next();!d.done;d=c.next())d=d.value,a.a.set(d,null),a.f.set(d,null);c={};d=_.u(a.m.fa());for(var e=d.next();!e.done;c={ec:c.ec},e=d.next()){e=e.value;c.ec=wB(_.S,e);var f=b.find(function(h){return function(l){return h.ec.ta(l)}}(c));c.ec=f||c.ec;var g=xB(_.S,e,c.ec);e.active&&a.a.set(_.S,g);f||b.push(c.ec)}MB(a.m)||a.a.set(_.S,null);c=KB(a.m);NB(a,b,c,_.Qj);NB(a,b,c,_.T);
73
- a.h=b}};NB=function(a,b,c,d){var e=yB(c,d);c={};e=_.u(e);for(var f=e.next();!f.done;c={fc:c.fc},f=e.next()){f=f.value;c.fc=wB(d,f);var g=b.find(function(l){return function(m){return l.fc.ta(m)}}(c));c.fc=g||c.fc;var h=xB(d,f,c.fc);f.active&&a.a.set(d,h);g||b.push(c.fc)}};
74
- PB=function(a,b,c){if(b){a.h.length||OB(a);for(var d=b.type,e=a.a.get(d)||null,f,g=_.u(CB(a,d)),h=g.next();!h.done&&!(f=h.value.renditions.find(function(l){return l.id==b.id}));h=g.next());f&&e!==f&&(GB(a,f),d===_.T?a.m.trigger(new _.L(_.ml)):d===_.Qj&&a.m.trigger(new _.L(_.wg,{details:{width:f.width||0,height:f.height||0,bandwidth:f.bandwidth,track:f.track,abrSelection:c}})))}};QB=function(){this.f=new _.bA(2);this.h=new _.bA(5);this.a=0};
75
- _.RB=function(){this.g=new _.K("clpp.abr");this.w=null;this.h=!1;this.o=new QB;this.l=[];this.j=1;this.C=this.B=!1;this.A=this.a=this.f=null};SB=function(a,b){a&&(b=b.filter(function(c){return c.video&&c.video.trickPlay?!1:lB(c,a,{width:Infinity,height:Infinity})}));return b.sort(function(c,d){return c.bandwidth-d.bandwidth})};TB=function(){this.a=new Map};VB=function(a,b){a.a.has(b)||a.a.set(b,new UB);return a.a.get(b)};UB=function(){this.text=this.variant=null};
76
- WB=function(a,b){this.f=a;this.a=new Set([a]);b=b||[];for(var c=_.u(b),d=c.next();!d.done;d=c.next())this.add(d.value)};ZB=function(a,b){var c;if(!(c=!!a.audio!=!!b.audio||!!a.video!=!!b.video||a.language!=b.language)&&(c=a.audio&&b.audio)){c=a.audio;var d=b.audio;c=!(c.channelsCount==d.channelsCount&&XB(c,d)&&YB(c.roles,d.roles))}!c&&(c=a.video&&b.video)&&(c=a.video,d=b.video,c=!(XB(c,d)&&YB(c.roles,d.roles)));return c?!1:!0};
77
- XB=function(a,b){if(a.mimeType!=b.mimeType)return!1;var c=a.codecs.split(",").map(function(f){return _.Pz(f)[0]}),d=b.codecs.split(",").map(function(f){return _.Pz(f)[0]});if(c.length!=d.length)return!1;c.sort();d.sort();for(var e=0;e<c.length;e++)if(c[e]!=d[e])return!1;return!0};YB=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.He);d["delete"](_.He);if(c.size!=d.size)return!1;c=_.u(c);for(var e=c.next();!e.done;e=c.next())if(!d.has(e.value))return!1;return!0};
78
- aC=function(a){this.a=a;this.f=new $B(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1)};$B=function(a,b,c,d){this.h=_.Th(a);this.a=b;this.f=c;this.j=void 0===d?!1:d};bC=function(a,b){var c=null;b.some(function(d){c=_.Gz(_.Ni(d),a.map(function(e){return Fz(e)}));return!!c});return c?a.filter(function(d){return c===Fz(d)}):[]};cC=function(a,b){return a.filter(function(c){var d=c.audio;c=c.video;return d&&0<=d.roles.indexOf(b)||c&&0<=c.roles.indexOf(b)})};
79
- dC=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!=b?!1:!0})};gC=function(a,b){this.a=eC;this.f=(new Map).set(eC,b).set(fC,a)};
80
- iC=function(a){var b=this;this.D=a;this.a=a.getConfiguration().streaming;this.f=new _.Eh;this.g=new _.K("clpp.mse.media.LiveEdgeObserver");hC(this)&&(a=this.D.getSurface().getMedia(),this.f.on(a,_.eg,function(){var c=b.D.getPosition(),d=b.D.getSeekRange().end;c=d-c;var e=b.D.getPlaybackRate(),f=b.a.stopChasingAt;1<=e&&c>=b.a.chaseJumpDistance?(b.g.debug("Too far from edge, jump to beginning."),b.D.setPlaybackRate(1),b.D.seek(d)):1===e&&c>=b.a.startChasingAt?(b.g.debug("Not on live edge, increase playback rate."),
81
- b.D.setPlaybackRate(b.a.chasingRate,_.Vd)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.D.setPlaybackRate(1))}))};
82
- hC=function(a){return 1>=a.a.chasingRate?(a.g.warn("chasingRate must be greater than 1."),!1):a.a.chaseJumpDistance<=a.a.startChasingAt?(a.g.warn("chaseJumpDistance must be greater than startChasingAt."),!1):a.a.startChasingAt<=a.a.stopChasingAt?(a.g.warn("startChasingAt must be greater than stopChasingAt."),!1):0>a.a.stopChasingAt?(a.g.warn("stopChasingAt must be greater than or equal to 0."),!1):!0};jC=function(a){this.h=a;this.a=null;this.f=function(){}};kC=function(a,b){a.f=b};
83
- lC=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.Qg();this.w=_.Vd;this.j=null;this.a=new _.uk(function(){b.A||b.f.Pk(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};mC=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
84
- pC=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.Vd||0===c||1===c)try{nC(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),oC(a)}else oC(a)};oC=function(a){a.g.debug(Xy,a.h,' using "seek" mode.');nC(a,0);a.o=!0;a.a.jb(.25)};nC=function(a,b){if(a.f.Qg()!=b){a.g.debug(Xy,b,' using native playbackRate "decoder" mode.');try{a.f.mm(b)}catch(c){throw c;}}};
85
- rC=function(a,b){this.h=a;this.l=qC(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};sC=function(a,b){a.f=b};tC=function(a){this.a=a};qC=function(a){if(a.a.paused||0==a.a.playbackRate||0===a.a.buffered.length)var b=!1;else a:{b=a.a.buffered;a=a.a.currentTime;for(var c=0;c<b.length;c++){var d=b.start(c),e=b.end(c);if(!(a<d-.1||a>e-(c+1===b.length?.5:.1))){b=!0;break a}}b=!1}return b};
86
- vC=function(a,b,c,d,e){var f=this;this.a=a;this.G=b;this.l=c;this.C=e;this.h=new _.Eh;this.B=!1;this.I=a.readyState;this.j=!1;this.f=d;this.o=this.H=this.A=!1;this.h.on(a,_.Ag,function(){return uC(f)});this.w=(new _.uk(function(){uC(f)})).jb(.25)};
87
- uC=function(a){if(0!=a.a.readyState){if(a.a.seeking){if(!a.B)return}else a.B=!1;if(!a.a.paused&&!a.o){a.a.readyState!=a.I&&(a.j=!1,a.I=a.a.readyState);var b=a.l.smallGapLimit,c=a.a.currentTime,d=a.a.buffered;a:{var e=new _.sl(d);var f=a.l.gapDetectionThreshold;if(e.length&&!(1===e.length&&1E-6>e.end(0)-e.start(0)))for(var g=0;g<e.length;g++)if(e.start(g)>c&&(0===g||e.end(g-1)-c<=f)){e=g;break a}e=null}if(null==e){if(a.f){a=a.f;d=a.h;c=qC(d);d=d.a.currentTime;b=Date.now()/1E3;if(a.a!=d||a.l!=c)a.j=
88
- b,a.a=d,a.l=c;d=b-a.j;d>=a.o&&c&&a.f(a.a,d)}}else if((0!=e||a.A)&&a.H&&(f=d.start(e),!(f>=nA(a.G)))){g=f-c;b=g<=b;var h=!1;if(!(.001>g)){if(!b&&!a.j){a.j=!0;var l=new _.L("largegap",{detail:{currentTime:c,gapSize:g}});l.cancelable=!0;a.C(l);a.l.jumpLargeGaps&&!l.defaultPrevented?h=!0:_.sh("Ignoring large gap at",c,"size",g)}if(b||h)0==e?_.sh(Ry,g,"seconds because of gap before start time of",f):_.sh(Ry,g,"seconds because of gap starting at",d.end(e-1),"and ending at",f),a.a.currentTime=f}}}}};
89
- zC=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.Eh;this.h=new wC(a);this.w=!1;0<a.readyState?xC(this,c):yC(this,c)};AC=function(a){return a.l?a.a.currentTime:a.A};CC=function(a,b){0<a.a.readyState?BC(a.h,b):yC(a,b)};yC=function(a,b){a.A=b;a.f.off(a.a,_.Fe);a.f.one(a.a,_.Fe,function(){xC(a,b)})};xC=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?DC(a):(a.f.one(a.a,_.Mf,function(){DC(a)}),BC(a.h,0==a.a.currentTime?b:a.a.currentTime))};
90
- DC=function(a){_.zk()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.Mf,function(){return a.j()})};wC=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.uk(function(){0>=b.j?(_.J(["Failed to move playhead from",b.h,"to",b.l].join(" ")),b.a.stop()):b.f.currentTime!=b.h?b.a.stop():(b.f.currentTime=b.l,b.j--)})};BC=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.jb(.1)};
91
- HC=function(a,b,c,d,e,f){var g=this;this.h=a;this.a=b.presentationTimeline;this.B=b.minBufferTime||0;this.l=c;this.A=e;this.w=null;this.j=new vC(a,b.presentationTimeline,c,EC(this,a,c),f);this.f=new zC(a,function(){a:{var h=g.j;h.B=!0;h.A=!1;h.j=!1;h=AC(g.f);var l=FC(g,h);if(.001<Math.abs(l-h)){var m=(new Date).getTime()/1E3;if(!g.w||g.w<m-1){g.w=m;CC(g.f,l);h=void 0;break a}}g.g.debug("Seek to "+h);g.A();h=void 0}return h},GC(this,d),function(){g.j.H=!0});this.o=(new _.uk(function(){if(0!=g.h.readyState&&
92
- !g.h.paused){var h=AC(g.f),l=_.oA(g.a,0),m=nA(g.a);3>m-l&&(l=m-3);h<l&&(l=FC(g,h),g.g.info("Jumping forward "+(l-h)+" seconds to catch up with the seek range."),g.h.currentTime=l)}})).jb(.25);this.g=new _.K("clpp.mse.Playhead")};JC=function(a){var b=AC(a.f);return 0<a.h.readyState&&!a.h.paused?IC(a,b):b};GC=function(a,b){null==b?b=Infinity>a.a.getDuration()?_.oA(a.a,0):nA(a.a):0>b&&(b=nA(a.a)+b);return KC(a,IC(a,b))};KC=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
93
- FC=function(a,b){var c=new _.sl(a.h.buffered);c=c.qc.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=_.oA(a.a,0),g=nA(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=_.oA(a.a,d),m=_.oA(a.a,e);d=_.oA(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),KC(a,b);if(b>g)return a.g.debug("Playhead past end."),g;if(b<f){if(c(m))return a.g.debug("Playhead before start \x26 start is buffered"),m;a.g.debug("Playhead before start \x26 start is unbuffered");return d}if(b>=l||c(b))return a.g.debug("Playhead in safe region or in buffered region."),
94
- b;a.g.debug("Playhead outside safe region \x26 in unbuffered region.");return d};IC=function(a,b){var c=_.oA(a.a,0);if(b<c)return c;c=nA(a.a);return b>c?c:b};
95
- EC=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new rC(new tC(b),c.stallThreshold);sC(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var h=new _.sl(b.buffered),l;if(l=_.xk("Edge/")||_.xk("Trident/")||_.Dj()||_.zk())a:{if(h.length&&!(1>=h.length))for(l=0;l<h.length-1;l++)if(f>h.start(l)&&f<h.end(l)){l=h.start(l+1)-h.end(l)>=d;break a}l=!1}if(l){a:{if(h.length&&!(1>=h.length))for(l=0;l<h.length-1;l++)if(f>h.start(l)&&f<h.end(l)){h=
96
- h.start(l+1)-f;break a}h=null}h&&(e=Math.min(h+.1,e))}a.g.warn("Seeking forward "+e+" seconds to break stall.");b.currentTime+=e}else a.g.warn("Pausing and unpausing to break stall."),b.pause(),b.play()});return c};
97
- MC=function(a){function b(){d=!0}function c(m){f.push(m);_.nm(m)}a=_.Ui(a);var d=!1,e,f=[],g=[];(new _.mm).L(_.Oe,c).L(_.fg,c).L(_.Je,c).L(_.Ne,c).L(_.Vf,c).Y(_.Xf,function(m){e=m;f.push(m);_.om(m)}).Y("encv",b).Y("enca",b).Y("avc1",function(m){g.push({L:m,Zc:1701733238})}).Y("avc3",function(m){g.push({L:m,Zc:1701733238})}).Y("ac-3",function(m){g.push({L:m,Zc:1701733217})}).Y("ec-3",function(m){g.push({L:m,Zc:1701733217})}).Y("mp4a",function(m){g.push({L:m,Zc:1701733217})}).parse(a);if(d)return _.sh("Init segment already indicates encryption."),
98
- a;if(0===g.length||!e)throw _.uh("Failed to find boxes needed to fake encryption!"),_.uh("Failed init segment (hex):",_.hj(a)),new _.P(_.Q,3,14E3);g.reverse();for(var h=_.u(g),l=h.next();!l.done;l=h.next())l=l.value,_.sh('Inserting "'+_.rm(l.Zc)+'" box into init segment.'),a=LC(a,e,l.L,f,l.Zc);return a};
99
- LC=function(a,b,c,d,e){var f=NC.value(),g=a.subarray(c.start,c.start+c.size),h=_.aj(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.aj(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);OC(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.xk("Xbox One")||_.wk()?c.start:c.start+c.size;f=a.subarray(c);e.set(a.subarray(0,c));e.set(l,c);e.set(f,c+l.byteLength);a=_.u(d);for(d=a.next();!d.done;d=a.next())d=d.value,OC(e,d.start,d.size+l.byteLength);l=_.aj(e,
100
- b.start);b=_.sm(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};OC=function(a,b,c){a=_.aj(a,b);b=a.getUint32(0);0!=b&&(1==b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.PC=function(a,b){this.D=b;this.j=a;this.h=null;this.w=1;this.G=Promise.resolve();this.l=[];this.o=new Map;this.a=new Map;this.I=this.f=this.A=this.B=!1;this.H=0;this.g=new _.K("clpp.mse.Streaming");this.C=!1};RC=function(a){var b=a.a.get(_.sg);return b?QC(a)[b.Fb]:(b=a.a.get(_.$c))?QC(a)[b.Fb]:null};
101
- TC=function(a){return _.SC(a,_.$c)};UC=function(a){return _.SC(a,_.sg)};
102
- ZC=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.E(function(q){switch(q.a){case 1:return c=_.fp,_.x(q,a.D.X.clear(c.TEXT),2);case 2:return a.H++,a.I=!1,d=a.H,e=a.D.X,f=new Map,g=new Set,f.set(c.TEXT,b),g.add(b),_.x(q,e.init(f,!1,a.h.disableAudioTracks),3);case 3:return a.f?q["return"]():_.x(q,VC(a,g),4);case 4:if(a.f)return q["return"]();l=(h=e.getTextDisplayer().isTextVisible())||a.h.alwaysStreamText;a.H!=d||a.a.has(c.TEXT)||a.I||!l||(m=a.D.Cb(),n=WC(a,m),p=XC(b,n,0),a.a.set(c.TEXT,p),YC(a,p,0));
103
- _.y(q)}})};bD=function(a){a.I=!0;var b=a.a.get(_.bg);b&&($C(b),aD(b)["catch"](function(){}),a.a["delete"](_.bg))};dD=function(a,b,c,d){b.video&&_.cD(a,b.video,c,d);b.audio&&_.cD(a,b.audio,c,d)};
104
- fD=function(a){function b(l){return a.D.X.qc(l,c,0)}var c=a.D.Cb(),d=!1,e=WC(a,c);if(_.Ri(a.a.values(),function(l){return l.Fb==e}))for(var f=_.u(a.a.keys()),g=f.next();!g.done;g=f.next()){g=g.value;var h=a.a.get(g);h.stream.segmentIterator=null;b(g)||(eD(a,h),d=!0)}else if(!_.Ri(a.a.keys(),b)){a.g.debug("(all): seeked: unbuffered seek: clearing all buffers");d=_.u(a.a.values());for(f=d.next();!f.done;f=d.next())eD(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
105
- c)};iD=function(a,b){b=void 0===b?!1:b;if(a.f)a.g.error("Unable to retry after StreamingEngine is destroyed!");else if(a.A)a.g.error("Unable to retry after StreamingEngine encountered a fatal error!");else for(var c=_.u(a.a.values()),d=c.next();!d.done;d=c.next()){d=d.value;var e=gD(d);if(d.Uc||b&&hD(d))a.g.info(e,"Retrying after failure..."),d.Uc=!1,YC(a,d,.1)}};
106
- kD=function(a){var b,c,d,e;return _.E(function(f){b=[];c=_.u(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,$C(e),e.eb&&e.Ib&&(e.eb=!1,b.push(e.Ib.abort())),e.Mb&&b.push(jD(a,e,!0,0));return _.x(f,Promise.all(b),0)})};lD=function(a,b,c){(a=a.a.get(b))&&c&&($C(a),a.stream=c,a.Xb=c,a.va&&(a.va=c.getSegmentReference(a.va.position)),a.va||(a.Xb=null))};_.SC=function(a,b){var c=a.a.get(b);return c?c.ac||c.stream:null};
107
- _.cD=function(a,b,c,d){var e=a.a.get(b.type);if(!e&&b.type==_.bg&&a.h.ignoreTextStreamFailures)ZC(a,b);else if(e){var f=Zz(QC(a),b);if(c&&f!=e.Fb)for(a.g.debug("switch: switching to stream in another Period; clearing buffer and changing Periods"),b=_.u(a.a.values()),c=b.next();!c.done;c=b.next())eD(a,c.value);else{e.ac&&(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(e.ac=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(e.ac=null,a.g.debug("switch found no special trick play stream")));
108
- var g=a.l[f];if(g&&g.cd&&(g=a.o.get(b.id))&&g.cd)if(e.stream!=b){g=a.j.presentationTimeline.getDuration();var h=a.D.Cb();h=mD(a,e,h);!c&&(e.endOfStream||h>=g)?a.g.debug(pz+gD(e)+" already buffered to the end. Not switching."):(b.type==_.bg&&RA(a.D.X,_.rk(b.mimeType,b.codecs)),e.stream=b,e.stream.segmentIterator=null,e.Ld=!0,a.g.debug("switch: switching to Stream "+gD(e)),nD(a,e,f)&&(a.g.info("Aborting current segment request to switch."),e.Ib.abort()),c&&(e.hc?e.Ee=!0:e.eb?(e.Mb=!0,e.ae=d,e.Ee=!0):
109
- ($C(e),jD(a,e,!0,d)["catch"](function(l){if(a.D)a.D.onError(l)}))))}else a.g.debug(pz+gD(e)+" already active")}}};nD=function(a,b,c){if(!b.Ib)return!1;var d=a.D.Cb(),e=a.D.X.Fa(b.type);c=(c=oD(a,b,d,e,c))?c.ia?c.ia-c.wa+1:null:null;if(null==c)return!1;var f=b.stream.initSegmentReference;f&&(c+=(f.ia?f.ia-f.wa+1:null)||0);f=a.D.ef().getBandwidthEstimate();if(8*c/f<(null===e?0:e-d)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal))return!0;a=b.Ib;a=a.j?a.j.bytesRemaining:-1;return 0>a||a>c?!0:!1};
110
- eD=function(a,b){var c=gD(b);b.hc?a.g.debug(c,"clear: already clearing the buffer"):b.Mb?a.g.debug(c,"clear: already waiting"):b.eb?(a.g.debug(c,"clear: currently updating"),b.Mb=!0,b.ae=0):null==a.D.X.wb(b.type)?(a.g.debug(c,"clear: nothing buffered"),null==b.vb&&YC(a,b,0)):(a.g.debug(c,"clear: handling right now"),$C(b),jD(a,b,!1,0)["catch"](function(d){if(a.D)a.D.onError(d)}))};
111
- qD=function(a,b,c,d,e){var f,g,h,l,m,n,p;return _.E(function(q){if(1==q.a)return f=a.D.Cb(),g=WC(a,f),h=_.fp,l=new Map,m=new Set,b&&(l.set(h.AUDIO,b),m.add(b)),c&&(l.set(h.VIDEO,c),m.add(c)),d&&(l.set(h.TEXT,d),m.add(d)),n=a.D.X,p=a.h.forceNativeTS,_.x(q,n.init(l,p,a.h.disableAudioTracks),2);if(3!=q.a){if(a.f)return q["return"]();pD(a);return _.x(q,VC(a,m),3)}if(a.f)return q["return"]();l.forEach(function(t,v){if(!a.a.has(v)){var z=XC(t,g,e);a.a.set(v,z);YC(a,z,0)}});_.y(q)})};
112
- XC=function(a,b,c){return{stream:a,type:a.type,Xb:null,segmentIterator:null,va:null,ac:null,Ld:!0,Fb:b,endOfStream:!1,eb:!1,vb:null,Mb:!1,ae:0,Ee:!1,hc:!1,If:!1,Uc:!1,Jh:c||0,Ib:null,de:!1,fh:0}};
113
- rD=function(a,b){var c=a.l[b];if(c)return a.g.debug("(all) Period "+b+Ky),c.O;a.g.debug("(all) setting up Period "+b);c={O:new _.wj,cd:!1};a.l[b]=c;for(var d=new Set,e=_.u(QC(a)[b].variants),f=e.next();!f.done;f=e.next())f=f.value,f.video&&d.add(f.video),f.video&&f.video.trickModeVideo&&d.add(f.video.trickModeVideo),f.audio&&d.add(f.audio);e=_.u(QC(a)[b].textStreams);for(f=e.next();!f.done;f=e.next())d.add(f.value);a.G=a.G.then(function(){return a.f?null:VC(a,d)}).then(function(){a.f||(a.l[b].O.resolve(),
114
- a.l[b].cd=!0,a.g.debug("(all) setup Period "+b))})["catch"](function(g){a.f||(a.l[b].O["catch"](function(){}),a.l[b].O.reject(),delete a.l[b],a.g.warn("(all) failed to setup Period "+b),a.D.onError(g))});return c.O};
115
- VC=function(a,b){var c,d,e,f,g,h,l,m,n,p,q;return _.E(function(t){switch(t.a){case 1:c=[];d=_.u(b);for(e=d.next();!e.done;e=d.next())f=e.value,(g=a.o.get(f.id))?(a.g.debug("(all) Stream "+f.id+Ky),c.push(g.O)):(a.g.debug("(all) setting up Stream "+f.id),a.o.set(f.id,{O:new _.wj,cd:!1}),c.push(f.createSegmentIndex()));_.A(t,2);return _.x(t,Promise.all(c),4);case 4:if(a.f)return t["return"]();_.ah(t,3);break;case 2:h=_.C(t);if(a.f)return t["return"]();l=_.u(b);for(e=l.next();!e.done;e=l.next())m=e.value,
116
- a.o.get(m.id).O["catch"](function(){}),a.o.get(m.id).O.reject(),a.o["delete"](m.id);throw h;case 3:n=_.u(b);for(e=n.next();!e.done;e=n.next())p=e.value,q=a.o.get(p.id),q.cd||(q.O.resolve(),q.cd=!0,a.g.debug("(all) setup Stream "+p.id));_.y(t)}})};pD=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?cB(a.D.X,b):cB(a.D.X,Math.pow(2,32))};
117
- uD=function(a,b){function c(p){return p.type==_.bg&&p.stream.mimeType==_.Sc}if(c(b))return YA(a.D.X,b.stream.originalId||""),null;b.type==_.bg&&ZA(a.D.X);if(!QA(a.D.X)&&b.type!=_.bg)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=gD(b),e=a.D.Cb(),f=mD(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=Zz(QC(a),b.stream),h=WC(a,f),l=a.D.X.Na(b.type,e);a.g.debug(d,"update_:",kz+e,"bufferedAhead\x3d"+l);var m=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*
118
- a.w,n=gA(a.j.presentationTimeline);if(null!=n&&f>=n&&!b.de)return sD(a,b),null;b.endOfStream=!1;b.Fb=h;if(h!=g)return a.g.debug(d,"need Period "+h,kz+e,"timeNeeded\x3d"+f,"currentPeriodIndex\x3d"+g),null;if(l>=m)return a.g.debug(d,"buffering goal met"),a.h.bufferLimitUpdateInterval||.5;h=a.D.X.Fa(b.type);h=oD(a,b,e,h,g);if(!h)return a.j.presentationTimeline.isLive()||b.type===_.bg?a.h.bufferLimitUpdateInterval||1:(a.g.debug("Media state "+d+": no next segment found. Assuming EOS."),sD(a,b),null);
119
- d=Infinity;l=_.u(a.a.values());for(m=l.next();!m.done;m=l.next())m=m.value,c(m)||(m=mD(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.a)return a.h.bufferLimitUpdateInterval||1;b.Jh=0;tD(a,b,e,g,h)["catch"](function(){});return null};sD=function(a,b){a.g.debug(gD(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type==_.sg){var c=a.a.get(_.bg);c&&c.stream.mimeType==_.Sc&&(c.endOfStream=!0)}};
120
- mD=function(a,b,c){if(!b.Xb||!b.va)return Math.max(c,b.Jh);c=Zz(QC(a),b.Xb);return QC(a)[c].startTime+b.va.endTime};
121
- oD=function(a,b,c,d,e){if(b.stream.segmentLookupStrategy===vD)b.stream.segmentIterator?a=tA(b.stream.segmentIterator):b.va||d?(c=b.va?b.va.endTime:d,a.g.info(Qy,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=xA(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(Qy,bz,"endTime:",c,b.va)),a=e):(e=Math.max(c,0),a.g.info(Qy,"looking up segment","lookupTime:",e,jz,c),d=null,d||(b.stream.segmentIterator=xA(b.stream.segmentIndex,
122
- c),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(Qy,bz,"lookupTime:",e,jz,c),a=d);else{var f=gD(b);if(b.va&&b.stream==b.Xb)c=b.va.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=wD(a,b,e,c);else{if(b.va){a.g.debug(f,"next position unknown: another Stream buffered");f=Zz(QC(a),b.Xb);var g=xD(a,b,QC(a)[f].startTime+b.va.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=xD(a,b,d||c,e);if(null==g)a=null;else if(f=wD(a,b,e,g),null==f)a=null;else{var h=
123
- null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.ya+d.startTime+2>c&&(a=wD(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};xD=function(a,b,c,d){var e=gD(b);d=QC(a)[d];var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",kz+c,"lookupTime\x3d"+f,dz+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",dz+d.startTime,"lookupTime\x3d"+f);return b};
124
- wD=function(a,b,c,d){var e=gD(b);c=QC(a)[c];var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",dz+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.mA(g);g=lA(g);return!b.de&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",dz+c.startTime,nz+f.startTime,lz+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
125
- tD=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,t,v,z,D,G;return _.E(function(F){f=_.fp;g=gD(b);h=QC(a)[d];a.g.debug(g,"fetchAndAppend_:",kz+c,dz+h.startTime,mz+e.position,nz+e.startTime,lz+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=QC(a)[d+1];q=Math.max(0,h.startTime-.1);t=p?p.startTime+.01:n;v=yD(a,b,d,q,t,e);b.eb=!0;b.Ld=!1;a.g.debug(g,"fetching segment");z=!1;D=function(B,I){if(a.f||a.A)return null;z=!0;return zD(a,b,c,h,l,e,B,I)};G=a.D.X.Fa(b.type)||
126
- 0;v.then(function(){return a.f||a.A?null:AD(a,b,e,!1,function(B){return D(B.data,!0)})}).then(function(B){return a.f||a.A?null:z||null===B?(BD(a,b,G,e,l),null):D(B,!1)}).then(function(){if(!a.f&&!a.A){BD(a,b,G,e,l);b.eb=!1;b.If=!1;b.Mb||a.D.xe();if(m){var B=m.next().value;B&&a.g.debug("New iterated segment",B)}YC(a,b,0);CD(a,b,l);a.g.debug(g,"finished fetch and append")}})["catch"](function(B){return _.E(function(I){if(a.f||a.A)return I["return"]();b.eb=!1;if(b.type==f.TEXT&&a.h.ignoreTextStreamFailures)return 1001==
127
- B.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),I.F(0);if(7001==B.code)return b.eb=!1,b.vb=null,YC(a,b,0),I.F(0);if(3017===B.code)return DD(a,b,B),I.F(0);if(1001===B.code&&B.data&&404===B.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",mz+e.position,nz+e.startTime,lz+e.endTime,"error\x3d"+B),b.eb=!1,b.vb=null,YC(a,b,1),I.F(0);if(b.type===f.TEXT)return B instanceof
128
- _.P&&B.a(1),$C(b),a.D.onError(new _.P(1,2,2010,B)),I.F(0);if(1001<=B.code&&1003>=B.code)return _.x(I,ED(a,b,h,B),0);a.g.error(g,"failed fetch and append: code\x3d"+B.code);b.Uc=!0;B instanceof _.P&&B.a(_.Q);return _.x(I,FD(a,B),0)})});_.y(F)})};
129
- DD=function(a,b,c){var d=gD(b);if(Array.from(a.a.values()).some(function(f){return f!=b&&f.If}))a.g.debug(d,Sy,"waiting for another stream to recover...");else{var e=Math.round(100*a.w);if(20<e)a.w-=.2;else if(4<e)a.w-=.04;else{a.g.error(d,"MediaSource threw QuotaExceededError too many times");b.Uc=!0;a.A=!0;a.D.onError(c);return}a.g.warn(d,Sy,"reducing buffering goals by "+(100-Math.round(100*a.w))+"%");b.If=!0}YC(a,b,4)};
130
- ED=function(a,b,c,d){var e,f;return _.E(function(g){e=1001===d.code&&500<=d.data.status;f=!0;e||(f=!a.D.Se(b.stream,c));if(!f)return g.F(0);b.Uc=!0;d.a(_.Q);return _.x(g,FD(a,d),0)})};
131
- yD=function(a,b,c,d,e,f){c=QC(a)[c].startTime-f.ya;if(!b.Ld&&c===b.fh)return Promise.resolve();b.fh=c;var g=gD(b);a.g.debug(g,"setting timestamp offset to "+c);a.g.debug(g,"setting append window start to "+d);a.g.debug(g,"setting append window end to "+e);d=aB(a.D.X,b.type,c,d,e);if(!b.stream.initSegmentReference||!b.Ld)return d;a.g.debug(g,"fetching init segment");e=AD(a,b,b.stream.initSegmentReference,!0).then(function(h){if(a.f)return null;a.g.debug(g,"appending init segment");return GD(a,h,b).then(function(){return XA(a.D.X,
132
- b.type,h,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size)})})["catch"](function(h){b.Ld=!0;return Promise.reject(h)});return Promise.all([d,e])};GD=function(a,b,c){var d;return _.E(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.wk())return e.F(0);d=MC(b);return _.x(e,XA(a.D.X,c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
133
- zD=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,t,v,z,D;return _.E(function(G){switch(G.a){case 1:l=gD(b);if(!(e&&e.keyId&&a.D.vd)){G.F(2);break}m=wz(a.D.vd,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);G.F(2);break}_.A(G,4);return _.x(G,m,6);case 6:_.ah(G,2);break;case 4:n=_.C(G),a.g.warn("DRM session load failed!",n);case 2:if(!(e.encrypted&&e.keyId&&a.D.vd&&yz(a.D.vd,e.keyId))){G.F(7);break}$C(b);p=Zz(QC(a),e);q=HD(a,p);if(!q){G.F(8);break}return _.x(G,q,8);case 8:return t=
134
- a.D.Se(e,d,fz),v=f.startTime+d.startTime,z=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+v+" - "+z+": "+t+". Stream with Key ID "+(e.keyId+" has restrictions.")),G["return"](Promise.resolve());case 7:return D=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.mm).Y("emsg",a.Jl.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),G["return"](ID(a,b,c).then(function(){if(a.f)return null;var F=f.startTime+d.startTime,B=f.endTime+d.startTime;a.g.debug(l,
135
- "Appending segment with "+(F.toFixed(3)+" - "+B.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.R.Re(e.bandwidth)+" Fragment: ")+h);return XA(a.D.X,b.type,g,F,B,D,e.id,h)}).then(function(){a.f||(a.g.debug(l,"appended media segment"),b.Xb=e,b.va=f)}))}})};
136
- BD=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.bg){var f=gD(b),g=(a.D.X.Fa(b.type)||0)-c,h=d.endTime-d.startTime;c=g-h;if(Math.abs(c)>=Math.min(.01,h)&&Math.abs(c)<=Math.min(1,h))for(a.g.debug(f,"Adjusted segment",d.position,"with real duration",g,"and accounted for",c,"delta between segment duration and real duration"),b.de=!0,a=QC(a),e.adjustSegmentDurations(d.position,c),d=Zz(a,e),b=a[d],e=e.getDuration(),aA(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
137
- JD=function(a,b,c){(new _.mm).L(_.Oe,_.nm).L(_.fg,_.nm).L(_.Je,_.nm).L(_.Ne,_.nm).L(_.Vf,_.nm).Y(_.Xf,_.om).L("encv",function(d){d.reader.skip(78);_.nm(d)}).L(_.Qf,_.nm).L("schi",_.nm).L("tenc",function(d){d.reader.skip(6);if(_.gm(d.reader)){d.reader.skip(1);var e=_.hj(_.lm(d.reader,16));e!==b.stream.keyId&&(a.g.debug(gD(b),"Key id from tenc mismatches with key id from manifest. Switching from "+(b.stream.keyId+" to "+e+".")),b.stream.keyId=e)}d.parser.stop()}).parse(c)};
138
- ID=function(a,b,c){if(a.f)return Promise.resolve();var d=gD(b);a.g.debug(d,"checking buffer length");var e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.a),f=a.D.X.wb(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",kz+c,Zy+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",kz+c,$y+g,Zy+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",kz+c,$y+g,Zy+e,"overflow\x3d"+h);return a.D.X.remove(b.type,
139
- f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+" seconds")})};CD=function(a,b,c){if(!a.B){b=gD(b);var d=Array.from(a.a.values());1!=d.length||d[0].type!=_.bg?a.B=d.every(function(e){return e.type==_.bg||a.C?!0:!e.Mb&&!e.hc&&e.va}):a.C&&(a.B=!0);a.B&&(a.g.debug(b,"startup complete"),c=Zz(QC(a),c),HD(a,c))}};
140
- HD=function(a,b){var c=null;a.l[b]||(c=rD(a,b).then(function(){a.f||(a.g.debug(az),a.D.vf())})["catch"](Bz));for(var d=0;d<QC(a).length;++d)rD(a,d)["catch"](Bz);a.D.Dl&&(a.g.debug("calling onStartupComplete()..."),a.D.Dl());return c};
141
- KD=function(a,b){var c=gD(b),d=Zz(QC(a),b.stream);if(b.Fb!=d){var e=b.Fb,f=Array.from(a.a.values());f.every(function(g){return g.Fb==e})?f.every(hD)?(a.g.debug(c,"all need Period "+e),rD(a,e).then(function(){if(!a.f)if(f.every(function(n){var p=hD(n),q=Zz(QC(a),n.stream);return p&&n.Fb==e&&q!=e})){var g=QC(a)[e];a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.D.wf(g);a.C=!h.variant&&!!h.text;var l=new Map;h.variant&&h.variant.video&&l.set(_.sg,h.variant.video);
142
- h.variant&&h.variant.audio&&l.set(_.$c,h.variant.audio);h.text&&l.set(_.bg,h.text);var m=_.u(a.a.keys());for(h=m.next();!h.done;h=m.next())if(h=h.value,!l.has(h)&&h!=_.bg){a.g.error(c,"invalid Streams chosen: missing "+h+" Stream");a.D.onError(new _.P(_.Q,5,5005));return}m=_.u(Array.from(l.keys()));for(h=m.next();!h.done;h=m.next())if(h=h.value,!a.a.has(h))if(h==_.bg)qD(a,null,null,l.get(_.bg),g.startTime),l["delete"](h);else{a.g.error(c,"invalid Streams chosen: unusable "+h+" Stream");a.D.onError(new _.P(_.Q,
143
- 5,5005));return}g=_.u(Array.from(a.a.keys()));for(h=g.next();!h.done;h=g.next())h=h.value,(m=l.get(h))?(_.cD(a,m,!1,0),YC(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,az);a.D.vf()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"](Bz)):a.g.debug(c,"all MediaStates need Period "+e+", but not all MediaStates are idle"):a.g.debug(c,"not all MediaStates need Period "+e)}};WC=function(a,b){var c=Xz(QC(a),b+_.Tt);return c?QC(a).indexOf(c):0};
144
- AD=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=_.eA(c.Sa(),c.wa,c.ia,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.Oc?null:e;f.disableFragmentSupport=c.Oc||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(g){JD(a,b,g.data)}),b.type===_.sg&&a.h.overridePasp&&f.responseModifiers.push(a.Am.bind(a)));a.g.debug("fetching: reference\x3d",
145
- c);c=a.D.Gb.fetch(f);b.Ib=c;return c.O.then(function(g){var h=a.D.ef(),l=g.timeMs,m=g.data.byteLength;l&&m&&!d&&h.segmentDownloaded(l,m);b.Ib=null;return g.data})};
146
- jD=function(a,b,c,d){var e,f,g,h;return _.E(function(l){if(1==l.a)return e=gD(b),b.Mb=!1,b.Ee=!1,b.ae=0,b.hc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.D.Cb(),h=a.D.X.getDuration(),f=a.D.X.remove(b.type,g+d,h)):f=a.D.X.clear(b.type).then(function(){return!a.f&&c?a.D.X.flush(b.type):null}),_.x(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.Xb=null;b.va=null;b.hc=!1;b.endOfStream=!1;b.de=!1;YC(a,b,0);_.y(l)})};
147
- YC=function(a,b,c){a.g.debug(gD(b),"updating in "+c+" seconds");b.vb=(new _.sk(function(){var d;return _.E(function(e){if(1==e.a)return _.A(e,2),_.x(e,a.Hb(b),4);if(2!=e.a)return _.ah(e,0);d=_.C(e);if(a.D)a.D.onError(d);_.y(e)})})).aa(c)};$C=function(a){null!=a.vb&&(a.vb.stop(),a.vb=null)};QC=function(a){return a.j.adaptedPeriods||a.j.periods};aD=function(a){return _.E(function(b){return a.Ib?_.x(b,a.Ib.abort(),0):b.F(0)})};
148
- FD=function(a,b){var c;return _.E(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.D.Nh){d.F(2);break}_.A(d,3);return _.x(d,a.D.Nh(b),5);case 5:_.ah(d,2);break;case 3:c=_.C(d),c.cause=b,b=c;case 2:if(!b.f)a.D.onError(b);_.y(d)}})};gD=function(a){return"("+a.type+":"+a.stream.id+")"};hD=function(a){return!a.eb&&null==a.vb&&!a.Mb&&!a.hc};
149
- ND=function(a){_.Dl.call(this,cz);var b=this;this.G=LD;this.j=this.Yb=this.ha=null;this.Hf=0;this.Eh=2;this.wd=null;this.tf=!1;this.o=new _.Eh;this.Gc=this.oe=this.K=this.Kc=this.A=this.M=this.l=null;this.sd=!1;this.I=this.h=this.f=this.B=this.a=this.gc=this.H=null;this.Uh=1E9;this.qe=new Set;this.ea=!0;this.Da=null;this.Oh=!1;this.Kh=0;this.pa=null;this.V=new TB;this.Sh={width:Infinity,height:Infinity};this.J=null;this.qa=_.Ho;this.Ic=new $B(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
150
- this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio);this.md=this.configuration.preferredTextLanguage;this.da=this.Jc=null;this.Cc=new Map;this.Ma=null;this.ne=this.configuration.preferredTextRole;this.ld=this.configuration.preferForcedSubtitles;a&&a(this);this.Df=null;this.o.on(window,"online",function(){b.G===MD&&iD(b.a)});this.re=null};
151
- OD=function(a){return new _.Sz(function(b){if(void 0===b||null===b)return null;var c=a.getTrackManager(),d=[];if(c){c=_.u(c.getVideoTracks());for(var e=c.next();!e.done;e=c.next())d.push.apply(d,_.Og(e.value.renditions))}return d.find(function(f){return f.id==b})||null})};
152
- PD=function(a,b){if(a.qa!==b){var c=_.R.Nj;if(a.qa===_.So&&b!==_.Ho)c=c(b,_.Qo),a.log.info(_.Uy+c);else{var d=a.Hf;d=0===d?0:Date.now()-d;var e=a.qa;a.qa=b;a.Hf=Date.now();null!==a.K&&(a.K.A=b===_.Uo);a.J&&_.xo(a.J.a,a.qa);b===_.Mo&&(a.Eh=a.rf?1:2);var f=a.Eh,g={currentState:a.qa,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.Mo||e===_.Mo?f:void 0},h=c(e,_.Qo),l=c(b,_.Qo);c=b!==_.Mo?"":"["+c(f,_.Po)+"]";a.log.info(_.Kb+h+" -\x3e "+(l+c));a.trigger(new _.L(_.Tf,{detail:g}));(b===_.Oo||b===
153
- _.So)&&a.Gc&&a.Gc.stop();b===_.Mo?a.trigger(new _.L(_.jd,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.Mo&&a.trigger(new _.L(_.id,{detail:{bufferedTimeMS:d,reason:f}}))}}};
154
- VD=function(a){var b=!1;b=void 0===b?!0:b;var c,d;return _.E(function(e){switch(e.a){case 1:return a.G===QD?e["return"](Promise.reject(new _.P(_.Q,7,7E3))):_.x(e,RD(a),2);case 2:return _.x(e,SD(a),3);case 3:c=_.Dj(4)||_.Dj(5);if(!b&&!c){e.F(0);break}d=a.getSurface().getMedia();return _.x(e,TD(a,d),5);case 5:return _.x(e,UD(a,d),0)}})};
155
- bE=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g,h,l,m,n;return _.E(function(p){switch(p.a){case 1:if(a.G===QD)return p["return"](Promise.reject(new _.P(_.Q,7,7E3)));d=new _.wj;e=function(){return a.Yb!==d};f=function(){a.log.info("Aborting current load");throw new _.P(_.Q,7,7E3);};a.Yb=d;_.A(p,2);e()&&f();if(!a.ha){p.F(4);break}_.A(p,5);return _.x(p,a.ha,7);case 7:_.ah(p,6,2);break;case 5:_.C(p,2);case 6:e()&&f();case 4:return a.J=new _.Co,a.Df=Date.now()/1E3,PD(a,_.To),a.w=_.Zo(b),_.Cl(b)&&(a.configuration=
156
- _.Bl(a.fe,b)),a.log.info(_.vb,a.configuration),a.log.info(_.Ib,a.w),(g=a.getTrackManager())&&g.load(),h=a.getSurface().getMedia(),h.loop=!!a.configuration.loop,_.N.R(a.configuration.volume)||a.setVolume(a.configuration.volume),_.N.R(a.configuration.muted)||a.setMuted(a.configuration.muted),WD(a),a.I&&(a.I.release(),a.I=null),a.I=new _.Xs(a.getNetworkEngine()),Az(a.I,{enabled:a.configuration.abr.useCmsd}),l=a.w[a.getSourceIndex()],e()&&f(),_.x(p,TD(a,h),8);case 8:return e()&&f(),_.x(p,UD(a,h),9);case 9:return e()&&
157
- f(),_.x(p,XD(a,l),10);case 10:return _.rn(hz),e()&&f(),_.x(p,YD(a,l),11);case 11:return _.rn(gz),_.sn("Fetch and parse manifest",hz,gz),e()&&f(),_.x(p,ZD(a),12);case 12:_.rn("initDrm.end");_.sn("Init DRM",gz,"initDrm.end");if(!c){p.F(13);break}e()&&f();return _.x(p,$D(a),14);case 14:return e()&&f(),_.x(p,aE(a),13);case 13:e()&&f();d.resolve();_.ah(p,0);break;case 2:throw n=m=_.C(p),e()&&(n=new _.P(_.Q,7,7E3)),d.reject(n),a.onError(n),n;}})};
158
- TD=function(a,b){a.j||(a.o.on(b,_.ne,function(){if(a.j.error){var c=a.j.error.code;if(1==c)c=null;else{var d=a.j.error.msExtendedCode;d&&(0>d&&(d+=Math.pow(2,32)),d=d.toString(16));c=new _.P(_.Q,3,3016,{code:c,extendedError:d,message:a.j.error.message})}}else c=null;if(c)a.onError(c)}),a.j=b);return Promise.resolve()};SD=function(a){a.j&&(a.o.off(a.j,_.ne),a.j=null);return Promise.resolve()};
159
- RD=function(a){var b;return _.E(function(c){switch(c.a){case 1:a.G!==QD&&(a.G=LD);if(b=a.j)a.o.off(b,_.Ee),a.o.off(b,_.of),a.o.off(b,_.cf),a.o.off(b,_.me),a.o.off(b,_.Ef),a.o.off(b,_.Cf);a.Kc&&(a.Kc.release(),a.Kc=null);a.Gc&&(a.Gc.stop(),a.Gc=null);if(!a.B){c.F(2);break}return _.x(c,a.B.stop(),3);case 3:a.B=null;case 2:if(!a.h){c.F(4);break}return _.x(c,a.h.stop(),4);case 4:if(!a.a){c.F(6);break}return _.x(c,a.a.destroy(),7);case 7:a.a=null;case 6:a.A&&(a.A.release(),a.A=null);if(!a.M){c.F(8);break}return _.x(c,
160
- a.M.destroy(),9);case 9:a.M=null;case 8:a.oe&&(a.oe.release(),a.oe=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.l){c.F(10);break}return _.x(c,a.l.destroy(),11);case 11:a.l=null;case 10:a.I&&(a.I.release(),a.I=null),a.V.clear(),a.H=null,a.qe.clear(),a.f=null,a.J=null,a.ea=!0,a.Cc.clear(),a.sd=!1,cE(a),_.y(c)}})};
161
- UD=function(a,b){var c,d,e;return _.E(function(f){if(1==f.a)return c=window.muxjs?new JA:new _.KA,d=_.vo(a.configuration,[_.te,"single-native"]),a.P=d.create(a),a.wd=OD(a),a.wd.track(a),e=new _.MA(b,c,a.P,a.wd,a.configuration),_.x(f,e.I,2);a.M=e;_.y(f)})};XD=function(a,b){var c,d;return _.E(function(e){if(1==e.a)return c=a.getNetworkEngine(),d=a,_.x(e,_.Cs(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d.B=e.f;a.B.configure(a.configuration.manifest);_.y(e)})};
162
- YD=function(a,b){var c;return _.E(function(d){a.gc=new qA;rA(a.gc,function(e){dE(a,_.Ph,e)});c=new _.xj(Promise.resolve().then(function(){var e,f,g;return _.E(function(h){switch(h.a){case 1:if(a.f){h.F(3);break}_.A(h,4);e=a;return _.x(h,a.B.start(b.url,eE(a)),6);case 6:e.f=h.f;_.ah(h,1);break;case 4:f=_.C(h);if(!a.Hc)throw f;return _.x(h,a.Hc(b.url,f),8);case 8:if(g=h.f)b.url=g;else throw f;h.F(1);break;case 3:if(0==a.f.periods.length)throw new _.P(_.Q,4,4014);fE(a.f.periods);_.y(h)}})}),function(){a.log.info("Aborting parser step...");
163
- return a.B.stop()});return _.x(d,c.O,0)})};
164
- ZD=function(a){var b,c,d,e,f;return _.E(function(g){switch(g.a){case 1:a.l=new _.xn({Gb:a.getNetworkEngine(),onError:function(h){return a.onError(h)},yf:function(h){if(a.a){var l=gE(a),m=!1,n=Object.keys(h);0===n.length&&a.log.warn("Got a key status event without any key statuses, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");var p=1===n.length&&"00"===n[0];p&&a.log.warn("Got a synthetic key status event, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");if(n.length){n=
165
- a.getPeriods();for(var q=0;q<n.length;q++)for(var t=n[q],v=_.u(t.variants),z=v.next();!z.done;z=v.next()){z=z.value;var D=[];z.audio&&D.push(z.audio);z.video&&D.push(z.video);D=_.u(D);for(var G=D.next();!G.done;G=D.next()){G=G.value;var F=z.allowedByKeySystem;if(G.keyId){var B=h[p?"00":G.keyId];B=!!B&&!hE.includes(B);z.allowedByKeySystem=B}F!==z.allowedByKeySystem&&(B=G.type,G.type===_.sg&&(B="video "+G.width+"x"+G.height+"@"+_.R.Re(G.bandwidth)),a.log.warn("DRM Key not available for KID: '"+(G.keyId+
166
- "'. Applying restrictions to "+B)));t===l&&F!==z.allowedByKeySystem&&(m=!0)}}}if(h=RC(a.a))if(p=TC(a.a),n=UC(a.a),p=vB(p,n,h.variants),!p||p.allowedByKeySystem)a.log.info(Py),iE(a),jE(a,h.variants);m&&h!==l&&(a.log.info(Py),iE(a),jE(a,l.variants))}},onExpirationUpdated:function(h,l){if(a.B&&a.B.onExpirationUpdated)a.B.onExpirationUpdated(h,l);a.trigger(new _.L(_.ee,{expirationTime:l}))},onEvent:function(h){return a.Ye(h)},getConfiguration:function(){return a.getConfiguration()},Sc:function(){return a.Sc()}});
167
- kE(a);c=(b=a.configuration.drm)?b.offlineId||"":"";d=[];e=_.vs(a.f.periods);if(!c){g.F(2);break}f=_.Fl(_.df);if(!f){g.F(2);break}return _.x(g,f.l(a,e),4);case 4:return _.x(g,f.j(c),5);case 5:d=g.f;case 2:return _.x(g,_.Hn(a.l,e,d),6);case 6:a.f&&lE(a,a.f.periods),_.y(g)}})};
168
- $D=function(a){var b,c,d,e;return _.E(function(f){if(1==f.a)return b=a.j,c=function(g){a.j&&a.H&&(g.type===_.Mf&&a.se?(a.H.a=fC,cE(a)):g.type===_.Ag&&a.getState()===_.Vo&&.1>a.getBufferInfo().Na(a.getPosition())?(a.H.a=fC,cE(a)):a.H&&mE(a));nE(a)},d=function(){if(a.j){var g=a.j.playbackRate;0!=g&&a.K.set(g)}},a.o.on(b,_.of,c),a.o.on(b,_.cf,c),a.o.on(b,_.me,c),a.o.on(b,_.Mf,c),a.o.on(b,_.Lf,c),a.o.on(b,_.Cf,c),a.o.on(b,_.Ag,c),a.o.on(b,_.Ef,d),a.h||(a.h=new _.RB,a.h.configure(a.configuration.abr)),
169
- null!==a.I&&a.h.setCmsdManager(a.I),oE(a,a.f.periods),a.Ic=new $B(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio),a.md=a.configuration.preferredTextLanguage,a.ne=a.configuration.preferredTextRole,a.ld=a.configuration.preferForcedSubtitles,_.x(f,_.Un(a.l,b),2);if(!a.l)throw new _.P(_.Q,7,7001);a.h.init(function(g,h,l){!a.ea&&pE(a,g,h,l)});a.A=qE(a,a.configuration.startTime);a.Kc=rE(a);a.K=new lC({Qg:function(){return b.playbackRate},
170
- mm:function(g){b.playbackRate=g},Pk:function(g){b.currentTime+=g}});mC(a.K,a.configuration.trickPlay);a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.oe=new iC(a));e=Math.max(1E-4,a.configuration.streaming.rebufferingGoal);sE(a,e);kB(a.f,_.Th(a.configuration.preferredVideoCodec),_.Th(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);a.a=tE(a);a.a.h=a.configuration.streaming;a.G=MD;_.y(f)})};
171
- aE=function(a){var b,c,d,e,f,g,h;return _.E(function(l){if(1==l.a)return _.x(l,a.a.start(),2);if(!a.a)throw new _.P(_.Q,7,7001);a.configuration.streaming.startAtSegmentBoundary&&(b=JC(a.A),c=uE(a,b),CC(a.A.f,c));d=_.u(a.f.periods);for(e=d.next();!e.done;e=d.next())f=e.value,vE(a,f);iE(a);g=gE(a)||a.f.periods[0];h=g.variants.some(function(m){return m.primary});a.configuration.preferredAudioLanguage||h||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");jE(a,
172
- g.variants);a.o.one(a.j,_.Ee,function(){a.J.A=Date.now()/1E3-(null===a.Df?0:a.Df)});_.y(l)})};fE=function(a){function b(d){return d.video&&d.audio||d.video&&d.video.codecs.includes(",")}if(a.some(function(d){return d.variants.some(b)})){_.th("Found variant with audio and video content, so filtering out audio-only content in all periods.");a=_.u(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.variants=c.variants.filter(b)}};
173
- qE=function(a,b){return new HC(a.j,a.f,a.configuration.streaming,b,function(){a.Kc&&yA(a.Kc,!0);a.a&&fD(a.a)},function(c){return a.dispatchEvent(c)})};rE=function(a){var b=new jC(a.f);kC(b,function(){iE(a)});var c=new AA(a.gc);BA(c,function(e){e.we&&e.we();dE(a,_.Rh,e)},function(e){e.xf&&e.xf();dE(a,_.Sh,e)},function(e,f){f||(e.we&&e.we(),dE(a,_.Rh,e),e.xf&&e.xf(),dE(a,_.Sh,e))});var d=new zA(a.j);d.a.add(b);d.a.add(c);return d};
174
- sE=function(a,b){a.H=new gC(b,Math.min(.5,b/2));a.H.a=fC;cE(a);a.Gc=(new _.uk(function(){mE(a)})).jb(.25)};
175
- mE=function(a){switch(a.G){case MD:a:if(a.j.ended||SA(a.M))var b=!0;else{if(a.isLive()){b=lA(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.Fa(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.M){var d=UA(a.M);c=d.video;d=d.audio;var e=a.j.currentTime;c&&d?(c=c.Na(e),d=d.Na(e),c=Math.min(c,d)):c=c?c.Na(e):d?d.Na(e):0}else c=0;if(d=a.H){d=a.H;var f=b,g=d.f.get(d.a);e=d.a;c=f||c>=g?eC:fC;d.a=c;d=e!=c}c=d;d=wE(a);c||a.getState()===_.Mo&&!d?(a.log.debug("Buffering state changed. Is buffering",
176
- d,"buffered to end",b,"state",a.getState()),cE(a)):a.sd&&nE(a)};tE=function(a){var b={Cb:function(){return JC(a.A)},X:a.M,Gb:a.getNetworkEngine(),wf:a.dj.bind(a),vf:a.cj.bind(a),onError:a.onError.bind(a),nh:a.ll.bind(a),onEvent:a.Ye.bind(a),rh:a.ej.bind(a),xe:a.yl.bind(a),ef:function(){return a.h},Se:a.li.bind(a),Nh:a.tm.bind(a),vd:a.l};return new _.PC(a.f,b)};kE=function(a){var b=_.Xl(a.configuration.drm);a.l.h=b};
177
- WD=function(a){a.B&&a.B.configure(a.configuration.manifest);a.l&&kE(a);if(a.a){a.a.h=a.configuration.streaming;try{for(var b=_.u(a.f.periods),c=b.next();!c.done;c=b.next())vE(a,c.value)}catch(e){a.onError(e)}c=TC(a.a);var d=UC(a.a);b=gE(a)||a.f.periods[0];c=vB(c,d,b.variants);a.h&&c&&c.allowedByApplication&&c.allowedByKeySystem?jE(a,b.variants):(a.log.debug("Choosing new streams after changing configuration"),xE(a,b))}a.h&&(a.h.configure(a.configuration.abr),a.configuration.abr.enabled&&!a.ea?a.h.enable():
178
- a.h.disable());a.K&&a.configuration.trickPlay&&mC(a.K,a.configuration.trickPlay)};KB=function(a){if(a.f&&a.A){var b=yE(a),c=[];a=_.u(zE(a));for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=qB(d);e.active=d==b;c.push(e)}return c}return[]};IB=function(a,b){if(a.f&&a.a){var c=gE(a),d=c.textStreams.find(function(e){return e.id==b.id});d?(AE(a,c,d,!1),BE(a,d),a.md=d.language,a.ld=d.kind===_.oe):a.log.error(_.Ty,b.id)}};
179
- LB=function(a,b,c){var d=void 0===d?0:d;if(a.f&&a.a){var e=gE(a);if(a.configuration.abr.enabled&&b)a.log.info("Disable ABR and enable manual track selection to select "+(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable();else if(!a.configuration.abr.enabled&&!b){a.log.info("Enable ABR Selection");a.configuration.abr.enabled=!0;a.h.enable();a.da=null;c=jE(a,e.variants);null!=a.Ma&&(a.Ic=a.Ma,a.Ma=null);null==c||a.ea||pE(a,c);return}if(b){a.da=b.id;var f=e.variants.find(function(g){return g.id==
180
- b.id});f?(a.da=f.video.id,sB(f)?(CE(a,e,f,!1),DE(a,f,c,d),null==a.Ma&&(a.Ma=a.Ic),a.Ic=new aC(f),jE(a,e.variants)):a.log.error("Unable to switch to restricted track",b.id)):a.log.error("No variant with id",b.id)}else a.da=null,null!=a.Ma&&(a.Ic=a.Ma,a.Ma=null),c=jE(a,e.variants),null==c||a.ea||pE(a,c)}};
181
- JB=function(a,b){if(a.configuration.streaming.disableAudioTracks)Promise.reject(Error("Audio tracks are disabled by config."));else{if(a.a&&(a.f||a.A)){var c=UC(a.a),d=TC(a.a),e=Xz(a.f.periods,JC(a.A)),f=a.f.periods[e?a.f.periods.indexOf(e):0].variants.filter(function(m){return m.audio.id===b&&sB(m)});e=!1;var g=void 0;if(c){if(g=f.find(function(m){return m.video.id===c.id}),!g){a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId");e=!0;var h=a.getTrackManager().Ia();
182
- if(h){var l=h.renditions.map(function(m){return m.id});g=f.find(function(m){return l.find(function(n){return n===String(m.video.id)})})}}}else g=f[0];if(g){if(d.codecs.split(".")[0]===g.audio.codecs.split(".")[0]){d=g.audio;a.Jc=d.id;a.h.setVariants(f);f=gE(a);CE(a,f,g,!1);e||a.ea?DE(a,g,!0,0):_.cD(a.a,d,!0,0);Promise.resolve();return}a.log.warn("Target audio codecs not compatible with active audio codecs.")}}Promise.reject()}};
183
- MB=function(a){var b=a.tf;return a.f?a.M.getTextDisplayer().isTextVisible():b};HB=function(a,b){var c,d,e,f;return _.E(function(g){c=a.tf;d=b;if(c==d)return g["return"]();a.tf=d;if(a.G!==MD)return g.F(0);a.M.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.F(0);if(!b)return bD(a.a),g.F(0);e=gE(a);f=_.uB(e.textStreams,a.md,a.ne,a.ld);return 0<f.length?_.x(g,ZC(a.a,f[0]),0):g.F(0)})};
184
- CE=function(a,b,c,d){var e=a.getTrackManager();a.B.setCurrentVariant(c);if(e){var f=a.J.B;if(c.video){PB(e,c.video,d);var g=e.ka();f.j!==g&&(f.j=g,f.a.push({timestamp:Date.now()/1E3,id:g.id,trackId:g.track.id,type:g.track.type,fromAdaptation:d,width:g.width,height:g.height,bandwidth:g.bandwidth}))}c.audio&&(PB(e,c.audio,d),e=e.Qa(),f.f!==e&&(f.f=e,f.a.push({timestamp:Date.now()/1E3,id:e.id,trackId:e.track.id,type:e.track.type,fromAdaptation:d,width:null,height:null,bandwidth:e.bandwidth})))}VB(a.V,
185
- b).variant=c};AE=function(a,b,c,d){VB(a.V,b).text=c;if(b=a.getTrackManager())PB(b,c,d),c=b.Ha(),a=a.J.B,a.h!==c&&(a.h=c,a.a.push({timestamp:Date.now()/1E3,id:c.id,trackId:c.track.id,type:c.track.type,fromAdaptation:d,width:null,height:null,bandwidth:null}))};
186
- oE=function(a,b){for(var c=0;c<b.length;c++){for(var d=b[c],e=new Map,f=_.u(d.variants),g=f.next();!g.done;g=f.next())if(g=g.value,g.video&&g.video.closedCaptions){g=g.video;for(var h=_.u(g.closedCaptions.keys()),l=h.next();!l.done;l=h.next())if(l=l.value,!e.has(l)){var m={id:a.Uh++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,ya:0,mimeType:_.Sc,codecs:"",kind:_.md,encrypted:!1,
187
- keyId:null,language:g.closedCaptions.get(l),label:null,type:_.bg,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:g.roles,channelsCount:null,spatialAudio:!1,closedCaptions:null};e.set(l,m)}}e=_.u(e.values());for(f=e.next();!f.done;f=e.next())d.textStreams.push(f.value)}};
188
- lE=function(a,b){for(var c=a.a?TC(a.a):null,d=a.a?UC(a.a):null,e=_.u(b),f=e.next();!f.done;f=e.next())pB(a.l,c,d,f.value);c=Hz(b,function(h){return h.variants.some(sB)});if(a.configuration.streaming.disableAudioTracks)for(d=_.u(b),e=d.next();!e.done;e=d.next())for(f=_.u(e.value.variants),e=f.next();!e.done;e=f.next())delete e.value.audio;if(a.configuration.streaming.disableVideoTracks)for(d=_.u(b),e=d.next();!e.done;e=d.next())for(f=_.u(e.value.variants),e=f.next();!e.done;e=f.next()){e=e.value;var g=
189
- e.video;!g||1<Nz(g.type,_.rk(g.mimeType,g.codecs)).size||delete e.video}if(0===c)throw new _.P(_.Q,4,4032);if(c<b.length)throw new _.P(_.Q,4,4011);c=_.u(b);for(e=c.next();!e.done;e=c.next())d=e.value,mB(d.variants,a.configuration.restrictions,a.Sh)&&a.a&&gE(a)==d&&iE(a),EE(a,d.variants)};
190
- vE=function(a,b){var c=a.a?TC(a.a):null,d=a.a?UC(a.a):null;pB(a.l,c,d,b);d=b.variants;if(!d.some(sB))throw new _.P(_.Q,4,4011);EE(a,b.variants);mB(d,a.configuration.restrictions,a.Sh)&&a.a&&gE(a)==b&&iE(a);if(!_.Dj(2)&&(c=a.l?a.l.getDrmInfo():null)){d=_.u(d);for(var e=d.next();!e.done;e=d.next()){e=_.u(e.value.drmInfos);for(var f=e.next();!f.done;f=e.next())if(f=f.value,f.keySystem===c.keySystem){f=_.u(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.Xn(a.l,g.keyId,g.initData)||_.On(a.l,
191
- g.initDataType,g.initData,g.keyId)}}}};DE=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.ea?(a.Da=b,a.Oh=c,a.Kh=d):dD(a.a,b,c,d)};BE=function(a,b){a.ea?a.pa=b:_.cD(a.a,b,!0,0)};FE=function(a){if(a.a&&a.f){var b=RC(a.a),c=gE(a);null!=b&&b==c&&(TC(a.a),UC(a.a),_.SC(a.a,_.bg),VB(a.V,c),VB(a.V,c))}};
192
- uE=function(a,b){function c(g,h){if(!g)return null;var l=g.findSegmentPosition(h-f.startTime);return null==l?null:(l=g.getSegmentReference(l))?l.startTime+f.startTime:null}var d=TC(a.a),e=UC(a.a),f=gE(a);d=c(d,b);e=c(e,b);return null!=e&&null!=d?Math.max(e,d):null!=e?e:null!=d?d:b};wE=function(a){return a.l&&a.l.C?!0:a.H?a.H.getState()===fC:!1};cE=function(a){if(a.J&&a.H&&a.A){var b=GE(a)===_.Mo,c=a.K;c.l=b;pC(c,c.o?"seek":void 0);a.A.j.o=b;nE(a)}};nE=function(a){PD(a,GE(a))};
193
- GE=function(a){var b=a.getDuration(),c=a.getPosition();return a.j&&a.j.ended||(a.sd||a.qa===_.Oo)&&1>=Math.abs(b-c)?_.Oo:wE(a)||a.se?_.Mo:a.j&&a.j.paused?_.Uo:_.Vo};
194
- jE=function(a,b){try{EE(a,b)}catch(e){return a.onError(e),null}var c=b.filter(function(e){return sB(e)});c=zB(c,a.Jc);var d=a.Ic.create(c);d=Array.from(d.values());a.h.setVariants(d);if(null!==a.da&&null!==a.Jc&&(d=d.find(function(e){return e.video.id==a.da&&e.audio.id==a.Jc}),a.da=null,d))return d;if(a.configuration.abr.enabled||null===a.da)return a.h.chooseVariant();c=c.find(function(e){return null!==e.video&&e.video.id===a.da});return c?c:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
195
- a.h.chooseVariant())};HE=function(a,b){return _.uB(b,a.md,a.ne,a.ld)[0]||null};xE=function(a,b,c){c=void 0===c?!0:c;var d=jE(a,b.variants);a.Jc=d&&d.audio&&d.audio.id;d&&(CE(a,b,d,!0),DE(a,d,c));(c=HE(a,b.textStreams))&&(a.configuration.streaming.alwaysStreamText||MB(a))&&(AE(a,b,c,!0),BE(a,c))};
196
- KE=function(a,b){a.ea=!0;a.h.disable();a.log.debug("Choosing new streams after period changed");var c=jE(a,b.variants),d=HE(a,b.textStreams);a.Da&&(b.variants.includes(a.Da)&&(c=a.Da),a.Da=null);a.pa&&(b.textStreams.includes(a.pa)&&(d=a.pa),a.pa=null);c&&IE(a,b,function(){return CE(a,b,c,!0)});d&&(a.configuration.streaming.alwaysStreamText||MB(a))&&IE(a,b,function(){return AE(a,b,d,!0)});b===gE(a)&&JE(a);return a.configuration.streaming.alwaysStreamText||MB(a)?{variant:c,text:d}:{variant:c,text:null}};
197
- pE=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;if(a.configuration.abr.enabled){a.log.debug("switch_");var e=LE(a,b);IE(a,e,function(){return CE(a,e,b,!0)});e===gE(a)&&JE(a);a.a&&dD(a.a,b,c,d)}};iE=function(a){var b=a.getTrackManager();b&&a.G!==QD&&(b.m&&(OB(b),b.m.trigger(new _.L(_.cu))),JE(a))};JE=function(a){var b=gE(a);if(b){var c=a.Cc.get(b)||[];for(a.Cc["delete"](b);c.length;)c.shift()()}};IE=function(a,b,c){a.Cc.has(b)||a.Cc.set(b,[]);a.Cc.get(b).push(c)};
198
- dE=function(a,b,c){a.trigger(new _.L(b,{detail:pA(c)}))};
199
- EE=function(a,b){var c=a.l?_.N.Zf(a.l.pa):{},d=Object.keys(c);d=d.length&&"00"==d[0];for(var e=!1,f=!1,g=[],h=[],l=_.u(b),m=l.next();!m.done;m=l.next()){m=m.value;var n=[];m.audio&&n.push(m.audio);m.video&&n.push(m.video);n=_.u(n);for(var p=n.next();!p.done;p=n.next())if(p=p.value,p.keyId){var q=c[d?"00":p.keyId];q?hE.includes(q)&&(h.includes(q)||h.push(q)):g.includes(p.keyId)||g.push(p.keyId)}m.allowedByApplication?m.allowedByKeySystem&&(e=!0):f=!0}if(!e)throw new _.P(_.Q,4,4012,{hasAppRestrictions:f,
200
- missingKeys:g,restrictedKeyStatuses:h});};zE=function(a){var b=gE(a);if(null==b)return[];FE(a);return b.variants.filter(function(c){return sB(c)})};ME=function(a){var b=gE(a);if(null==b)return[];FE(a);return b.textStreams.filter(function(c){return!a.qe.has(c)})};gE=function(a){var b=JC(a.A),c=null;a=_.u(a.f.periods);for(var d=a.next();!d.done;d=a.next())d=d.value,d.startTime<=b&&(c=d);return c};yE=function(a){var b=gE(a);return b&&VB(a.V,b).variant};
201
- LE=function(a,b){for(var c=_.u(a.f.periods),d=c.next();!d.done;d=c.next())if(d=d.value,d.variants.includes(b))return d;return null};
202
- NE=function(a,b,c){var d,e,f,g,h,l,m,n,p,q,t,v,z,D,G,F,B,I,O;return _.E(function(M){switch(M.a){case 1:return d=_.fp,_.A(M,2),_.x(M,_.Cs(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:return e=M.f,e.configure(a.configuration.manifest),_.x(M,e.start(b.url,eE(a)),5);case 5:f=M.f;fE(f.periods);if(!f.periods.length)throw new _.P(_.Q,4,4014);return _.x(M,a.B.stop(),6);case 6:a.B=e;g=c.audio&&c.audio.id;h=c.video&&c.video.id;a.f.periods=f.periods;l=Xz(f.periods,
203
- JC(a.A))||f.periods[0];kB(a.f,_.Th(a.configuration.preferredVideoCodec),_.Th(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);m=AB(g,h,l.variants);n=HE(a,l.textStreams);jE(a,l.variants);p=m&&m.video;q=m&&m.audio;t=[];v=new Set;z=_.u(l.variants);for(D=z.next();!D.done;D=z.next())G=D.value,G.video&&v.add(G.video),G.audio&&v.add(G.audio);F=_.u(_.Og(v).concat(_.Og(l.textStreams)));for(B=F.next();!B.done;B=F.next())I=B.value,t.push(I.createSegmentIndex());return _.x(M,Promise.all(t),
204
- 7);case 7:lD(a.a,d.AUDIO,q);lD(a.a,d.VIDEO,p);lD(a.a,d.TEXT,n);m&&CE(a,l,m,!1);a.log.info("Switch CDN successful.");_.ah(M,0);break;case 2:O=_.C(M);if(!e){M.F(8);break}return _.x(M,e.stop(),8);case 8:throw O;}})};
205
- eE=function(a){return{networkingEngine:a.getNetworkEngine(),filterNewPeriod:function(b){return vE(a,b)},filterAllPeriods:function(b){return lE(a,b)},onTimelineCueAdded:function(b){var c=a.gc;a:{var d=_.u(c.a);for(var e=d.next();!e.done;e=d.next())if(e=e.value,e.schemeIdUri===b.schemeIdUri&&e.startTime===b.startTime&&e.endTime===b.endTime){d=e;break a}d=null}null==d&&(c.a.add(b),c.f(b))},onEvent:function(b){return a.Ye(b)},onError:function(b){return a.onError(b)}}};OE=function(){};
206
- PE=function(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(b){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];c=a.apply(this,c);c.abort=function(){};return c}};QE=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};RE=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"==b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};
207
- SE=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!=_.Pz(b)[0]&&a(b)}};
208
- TE=function(){var a=MediaSource.isTypeSupported,b=/^dv(?:h[e1]|a[v1])\./;MediaSource.isTypeSupported=function(c){var d=c.split(/ *; */),e=d.shift(),f={};d=_.u(d);for(var g=d.next();!g.done;g=d.next())g=g.value.split("\x3d"),f[g[0]]=g[1].replace(/"(.*)"/,"$1");d=f.codecs;if(!d)return a(c);var h=!1,l=!1;c=d.split(",").filter(function(n){b.test(n)&&(l=!0);/^(hev|hvc)1\.2/.test(n)&&(h=!0);return!0});l&&(h=!1);f.codecs=c.join(",");h&&(f.eotf="smpte2084");for(var m in f)e+="; "+m+'\x3d"'+f[m]+'"';return cast.__platform__.canDisplayType(e)}};
209
- UE=function(a){_.pt.call(this,a);a=a.getSurface().getMedia();this.a=null;for(var b=0;b<a.textTracks.length;++b){var c=a.textTracks[b];c.mode=_.Xd;c.label===Vy&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.oz,Vy));this.a.mode=_.se};VE=function(a,b){var c=a.mode;a.mode=c==_.Nf?_.Nf:_.se;for(var d=a.cues,e=d.length-1;0<=e;e--){var f=d[e];f&&b(f)&&a.removeCue(f)}a.mode=c};WE=function(){};_.Li.prototype.f=qz(0,function(){return this.keyInfo});var sz=[112,115,115,104,0,0,0,0];_.Dz.prototype.f=function(){return this.keyInfo};
210
- _.YE=function XE(a){var c,d,e,f,g,h;return _.ih(XE,function(l){1==l.a&&(c=-1,e=d=void 0,f=_.u(a),g=f.next());if(5!=l.a){if(g.done)return-1===c?l.F(0):_.x(l,{Vg:c,Yl:d,item:e,next:void 0},0);h=g.value;return 0<=c?_.x(l,{Vg:c,item:e,Yl:d,next:h},5):l.F(5)}c++;d=e;e=h;g=f.next();return l.F(2)})};Jz.prototype.destroy=function(){this.a&&(this.a.dispose(),this.a=null);return Promise.resolve()};
211
- Jz.prototype.A=function(a){this.h=a.captions;var b=new Uint8Array(a.data.byteLength+a.initSegment.byteLength);b.set(a.initSegment,0);b.set(a.data,a.initSegment.byteLength);a.type===_.sg?this.o.push(b):a.type===_.$c&&this.l.push(b)};Jz.prototype.w=function(){var a={video:_.jj.apply(_.cj,_.Og(this.o)),captions:this.h,audio:_.jj.apply(_.cj,_.Og(this.l))};this.f.resolve(a);this.j=!1};
212
- _.Sz.prototype.track=function(a){null!=this.player&&(this.player&&(this.player.off(_.Jf,this.a),this.f&&this.player.off(_.eg,this.a)),this.player=null);a&&(this.player=a,this.player.on(_.Jf,this.a,this))};
213
- _.Sz.prototype.append=function(a,b,c){var d=this.j?this.j(c):null;d||this.log.debug("Unable to resolve rendition for id",c);c={start:a,end:b,rendition:d,width:d?d.width:0,height:d?d.height:0,bandwidth:d?d.bandwidth:0};var e=this.S.find(function(f){return f.start>=a&&f.end<=b});if(e)e.rendition=d,e.width=c.width,e.height=c.height,e.bandwidth=c.bandwidth,e.start=c.start,e.end=c.end;else{d=_.u(this.S);for(e=d.next();!e.done;e=d.next())e=e.value,a>=e.start&&a<e.end?e.end=a:b>=e.start&&b<e.end&&(e.start=
214
- b);this.S.push(c);this.S.sort(Rz)}Vz(this);this.a();this.player&&this.player.trigger(new _.L(_.vg))};_.Sz.prototype.clear=function(){this.S=[];Vz(this);this.player&&(this.player.trigger(new _.L(_.vg)),this.player.trigger(new _.L(_.ed)))};
215
- _.Sz.prototype.a=function(){if(this.player){var a=this.player.getPosition();if(0<=a){a:{for(var b=this.S.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.S[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.S[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.S[0].rendition:null}if(a&&this.h!==a&&(this.h=a,this.player)){c=b=-1;if(a)b=a.width||-1,c=a.height||-1;else if(d=this.player.getSurface().getMedia())b=d.videoWidth,c=d.videoHeight;this.player.trigger(new _.L(_.gd,
216
- {detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};_.r=_.fA.prototype;_.r.Tc=function(){return this.H};_.r.getDuration=function(){return this.f};_.r.getPresentationStartTime=function(){return this.A};_.r.offset=function(a){null!=this.o&&(this.o+=a);null!=this.h&&(this.h+=a)};_.r.isLive=function(){return Infinity==this.f&&!this.j};qA.prototype.release=function(){this.f=function(){};this.a.clear()};qA.prototype.cues=function(){return this.a};
217
- sA.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.Sa().length&&this.f===a.a.length&&(this.a+=1,this.f=0)):(this.a+=1,this.f=0);a=tA(this);return{value:a,done:!a}};_.r=_.uA.prototype;_.r.destroy=function(){this.a=[];return Promise.resolve()};
218
- _.r.Mc=function(a){for(var b=this.a.length-1;0<=b;--b){var c=this.a[b];if(a>=c.startTime&&a<c.endTime)return c.position}if(this.a.length&&a<this.a[0].startTime)return this.a[0].position;this.g.warn("No Segment found for "+a+". We have "+this.a.length+" references");for(a=0;a<this.a.length;a++)b=this.a[a],this.g.debug("SegmentIndex Ref "+a+" start: "+b.startTime+" end: "+b.endTime+" pos: "+b.position);return null};
219
- _.r.get=function(a){if(0==this.a.length)return null;a-=this.a[0].position;return 0>a||a>=this.a.length?null:this.a[a]};_.r.offset=function(a){this.g.info("Apply offset"+a+" to segment index");for(var b=_.u(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.ya-=a};
220
- _.r.jd=function(a,b){var c=a-this.a[0].position;if(0<=c&&c<this.a.length)for(this.g.warn("Accounting for segment duration drift",b,"at",c),this.a[c].endTime+=b,c+=1;c<this.a.length;++c)this.a[c].startTime+=b,this.a[c].endTime+=b};_.r.getDuration=function(){return this.a[this.a.length-1].endTime-this.a[0].startTime};
221
- _.r.oa=function(a){for(var b=[],c=[],d=0,e=0;d<this.a.length&&e<a.length;){var f=this.a[d],g=a[e];f.startTime<g.startTime?(b.push(f),d++):(f.startTime>g.startTime?0===d?c.push(g):this.g.info("Refusing to rewrite original references on update!"):(.1<Math.abs(f.endTime-g.endTime)?(f=new _.Li(f.position,g.startTime,g.endTime,g.Sa,g.wa,g.ia,g.ya,g.keyInfo,g.Oc,g.timescale,g.horizontalTiles,g.verticalTiles,g.durationPerTile),b.push(f)):b.push(f),d++),e++)}for(;d<this.a.length;)b.push(this.a[d++]);if(b.length)for(d=
222
- b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.Li(d++,f.startTime,f.endTime,f.Sa,f.wa,f.ia,f.ya,f.keyInfo,f.Oc,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile),b.push(f);else b=a;a=b;if(c.length&&b.length){a=[];e=b[0].position;d=c.length;c=_.u(c);for(f=c.next();!f.done;f=c.next())f=f.value,a.push(new _.Li(e-d--,f.startTime,f.endTime,f.Sa,f.wa,f.ia,f.ya,f.keyInfo,f.Oc,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile));b=_.u(b);for(f=b.next();!f.done;f=b.next())a.push(f.value)}this.a=
223
- a};_.r.replace=function(a){this.a=a};zA.prototype.release=function(){this.h.stop();for(var a=_.u(this.a),b=a.next();!b.done;b=a.next())b.value.release();this.a.clear()};AA.prototype.release=function(){this.l=null;this.j.clear();this.a=function(){};this.f=function(){};this.h=function(){}};
224
- AA.prototype.o=function(a,b){for(var c={},d=_.u(this.l.cues()),e=d.next();!e.done;c={Le:c.Le,Rd:c.Rd},e=d.next()){e=e.value;c.Le=this.j.get(e)||null;c.Rd=a<e.startTime?1:a>e.endTime?3:2;this.j.set(e,c.Rd);var f=this.w.find(function(g){return function(h){return h.Bc===g.Le&&h.Ac===g.Rd}}(c));f&&f.oc(e,b)}};_.r=EA.prototype;_.r.destroy=function(){this.h=this.w=null;this.o.clear();return Promise.resolve()};
225
- _.r.remove=function(a,b){var c=this;return Promise.resolve().then(function(){!c.h||!c.h.remove(a,b)||null==c.a||b<=c.a||a>=c.f||(a<=c.a&&b>=c.f?c.a=c.f=null:a<=c.a&&b<c.f?c.a=b:a>c.a&&b>=c.f&&(c.f=a))})};_.r.wb=function(){return this.a};_.r.Fa=function(){return this.f};_.r.qc=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.r.Na=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};
226
- JA.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.Ui(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a);this.a.init()};JA.prototype.h=function(a,b){var c=_.Ui(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};JA.prototype.f=function(){this.a.resetCaptionStream()};_.KA.prototype.init=function(){};_.KA.prototype.h=function(){};_.KA.prototype.f=function(){};_.r=_.MA.prototype;
227
- _.r.destroy=function(){var a=this;this.J=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](Bz));for(e=1;e<d.length;++e)d[e].p["catch"](Bz),d[e].p.reject()}this.a&&b.push(this.a.destroy());this.B&&b.push(this.B.destroy());for(var f in this.A)b.push(this.A[f].destroy());return Promise.all(b).then(function(){a.l&&(a.l.release(),a.l=null);a.j&&(a.j.removeAttribute("src"),a.j.load(),a.j=null);a.w="";a.o=null;a.a=null;a.B=null;a.f={};a.A={};a.G={};a.H=null;
228
- a.M=!1;for(var g in a.h);a.h={}})};_.r.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.E(function(f){if(1==f.a)return e=_.fp,_.x(f,d.I,2);a.forEach(function(g,h){var l=_.rk(g.mimeType,g.codecs);if(h==e.TEXT)RA(d,l);else{var m=new Map;m.set(h,l);_.Iz(l)&&b&&!g.keyInfo||!Mz(l,h)||(d.A[h]=new Jz,l="aac"==l.toLowerCase().split(";")[0].split("/")[1]?l.replace(/aac/i,_.Pe):Lz(h,l),m=Nz(h,l),c&&m["delete"](e.AUDIO));PA(d,m)}});_.y(f)})};
229
- _.r.wb=function(a){return a===_.bg?this.a.wb():(a=TA(this,a))?a.wb():null};_.r.Fa=function(a){return a===_.bg?this.a.Fa():(a=TA(this,a))?a.Fa():null};_.r.qc=function(a,b,c){return a===_.bg?this.a.qc(b):(a=TA(this,a))?a.qc(b,!1,c):!1};_.r.Na=function(a,b){if(a===_.bg)return this.a.Na(b);var c=TA(this,a);return c?c.Na(b):0};
230
- _.r.remove=function(a,b,c){var d=this;return a===_.bg?this.a.remove(b,c):WA(this,a,this.Gh.bind(this,a,b,c)).then(function(){if(a===_.sg){var e=d.wb(a),f=d.Fa(a);null!==e&&null!==f&&Wz(d.C,e,f)}else a===_.$c&&(e=d.C,e.player&&e.player.trigger(new _.L(_.ed)))})};_.r.clear=function(a){if(a==_.bg){if(!this.a)return Promise.resolve();this.H.f();return this.a.remove(0,Infinity)}return WA(this,a,this.Gh.bind(this,a,0,this.o.duration))};
231
- _.r.flush=function(a){return a==_.bg?Promise.resolve():WA(this,a,this.Ig.bind(this,a))};_.r.endOfStream=function(a){var b=this;return bB(this,function(){SA(b)||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.r.getDuration=function(){return this.o.duration};_.r.Ze=function(a,b){this.g.debug("Appending data to "+a+Jy);try{this.f[a].appendBuffer(b)}catch(c){throw this.g.warn("Failed to append data for "+a,c),c;}this.g.debug("Done Appending data to "+a+Jy)};
232
- _.r.Gh=function(a,b,c){if(c<=b)this.$c(a);else{this.g.debug("Removing data from "+a+" range:",b,c);try{this.f[a].remove(b,c)}catch(d){throw this.g.warn("Failed to remove data from "+a+" buffer. Range:",b,c,d),d;}this.g.debug("Done Removing data from "+a+" range:",b,c)}};
233
- _.r.di=function(a){try{this.g.debug("Aborting operations for "+a+Jy);var b=this.f[a].appendWindowStart,c=this.f[a].appendWindowEnd;this.f[a].abort();this.f[a].appendWindowStart=b;this.f[a].appendWindowEnd=c}catch(d){throw this.g.warn("Failed to abort operations for "+a+Jy,d),d;}this.g.debug("Done Aborting operations for "+a+Jy);this.$c(a)};
234
- _.r.Ig=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug("Flushing buffer for "+a),this.j.currentTime-=.001):this.g.warn("Skip buffer flush for "+a+" with element state: "+this.j.readyState)}catch(b){throw this.g.warn("Failed to flush buffer for "+a,b),b;}this.g.debug("Done Flushing buffer for "+a);this.$c(a)};
235
- _.r.Lh=function(a,b){0>b&&(b+=.001);try{this.g.debug("Setting timestamp offset for "+a,b),this.f[a].timestampOffset=b}catch(c){throw this.g.warn("Failed to set timestamp offset for "+a,b,c),c;}this.g.debug("Done Setting timestamp offset for "+a,b);this.$c(a)};
236
- _.r.gm=function(a,b,c){try{this.g.debug("Setting append window for "+a,b,c),this.f[a].appendWindowStart=0,this.f[a].appendWindowEnd=c,this.f[a].appendWindowStart=b}catch(d){throw this.g.warn("Failed to set append window for "+a,b,c,d),d;}this.g.debug("Done Setting append window for "+a,b,c);this.$c(a)};_.r.U=function(a){this.h[a][0].p.reject(new _.P(_.Q,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
237
- _.r.$c=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug("Update-End received for "+a),eB(this,a))};_.r.getTextDisplayer=function(){return this.B};var OA=window.URL.createObjectURL;_.w(BB,_.U);_.r=BB.prototype;_.r.initialize=function(a){this.m=a};_.r.release=function(){this.h=[];this.a.clear();this.f.clear()};_.r.load=function(){};_.r.destroy=function(){this.release();this.m=null};_.r.getVideoTracks=function(){return CB(this,_.Qj)};_.r.getAudioTracks=function(){return CB(this,_.T)};_.r.fa=function(){return CB(this,_.S)};_.r.ka=function(){return this.a.get(_.Qj)||null};_.r.Qa=function(){return this.a.get(_.T)||null};_.r.Ha=function(){return this.a.get(_.S)||null};
238
- _.r.bb=function(){return this.f.get(_.Qj)||null};_.r.mb=function(){return this.f.get(_.T)||null};_.r.nb=function(){return this.f.get(_.S)||null};_.r.Ia=function(){return DB(this,_.Qj)};_.r.ja=function(){return DB(this,_.T)};_.r.ua=function(){return DB(this,_.S)};_.r.ib=function(a){FB(this,_.Qj,a)};_.r.za=function(a){FB(this,_.T,a)};_.r.La=function(a){FB(this,_.S,a)};_.r.Ya=function(a,b){EB(this,_.Qj,a,void 0===b?!1:b)};_.r.gb=function(a,b){EB(this,_.T,a,void 0===b?!1:b)};
239
- _.r.hb=function(a,b){b=void 0===b?!1:b;var c=a;if(!a){var d=this.Ha();if(d&&d.track.kind!==_.oe){var e=this.fa().find(function(g){return g.kind===_.oe&&g.language===d.track.language});if(!e){var f=this.ja();f&&(e=this.fa().find(function(g){return g.kind===_.oe&&g.language===f.language}))}e&&(c=e.renditions[0])}}EB(this,_.S,c,b)};_.r.addTextTrack=function(a){var b=this;return _.E(function(c){return b.m?_.x(c,b.m.addTextTrack(a.url,a.language,a.kind,a.mimeType,a.codec,a.label),0):c.F(0)})};
240
- _.r.ma=function(){return!!this.m&&this.m.ma()};BB.prototype.isAbrEnabled=BB.prototype.ma;BB.prototype.addTextTrack=BB.prototype.addTextTrack;BB.prototype.setTextRendition=BB.prototype.hb;BB.prototype.setAudioRendition=BB.prototype.gb;BB.prototype.setVideoRendition=BB.prototype.Ya;BB.prototype.setTextTrack=BB.prototype.La;BB.prototype.setAudioTrack=BB.prototype.za;BB.prototype.setVideoTrack=BB.prototype.ib;BB.prototype.getTextTrack=BB.prototype.ua;BB.prototype.getAudioTrack=BB.prototype.ja;
241
- BB.prototype.getVideoTrack=BB.prototype.Ia;BB.prototype.getLoadingTextRendition=BB.prototype.nb;BB.prototype.getLoadingAudioRendition=BB.prototype.mb;BB.prototype.getLoadingVideoRendition=BB.prototype.bb;BB.prototype.getTextRendition=BB.prototype.Ha;BB.prototype.getAudioRendition=BB.prototype.Qa;BB.prototype.getVideoRendition=BB.prototype.ka;BB.prototype.getTextTracks=BB.prototype.fa;BB.prototype.getAudioTracks=BB.prototype.getAudioTracks;BB.prototype.getVideoTracks=BB.prototype.getVideoTracks;_.r=_.RB.prototype;_.r.stop=function(){this.w=null;this.h=!1;this.l=[];this.j=1;this.f=null;this.C=!1};_.r.init=function(a){this.w=a};
242
- _.r.chooseVariant=function(){var a=SB(!this.C&&this.a.initialRestrictions?this.a.initialRestrictions:this.a.restrictions,this.l),b=this.getBandwidthEstimate();this.l.length&&!a.length&&(this.g.warn("No variants met the ABR restrictions. Choosing a variant by lowest bandwidth."),a=SB(null,this.l),a=[a[0]]);var c=a[0]||null;a=_.u(_.YE(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.item;var f=isNaN(this.j)||0===this.j?1:Math.abs(this.j),g=f*d.bandwidth,h=g/this.a.bandwidthDowngradeTarget;
243
- e=f*(e.next||{bandwidth:Infinity}).bandwidth/this.a.bandwidthUpgradeTarget;this.g.debug("Bandwidth ranges:",(g/1E6).toFixed(3),(h/1E6).toFixed(3),(e/1E6).toFixed(3));b>=h&&b<=e&&(c=d)}this.f=Date.now();this.C=!0;return c};_.r.enable=function(){this.h=!0};_.r.disable=function(){this.h=!1};
244
- _.r.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.f,"enabled\x3d"+this.h);var c=this.o;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;_.cA(c.f,e,d);_.cA(c.h,e,d)}if(null!=this.f&&this.h)a:{this.g.debug("Suggesting Streams...");if(!this.B){if(!(128E3<=this.o.a)){this.g.debug("Still waiting for a good estimate...");break a}this.B=!0;if(this.a.useSwitchIntervalForInitialSwitch&&Date.now()-this.f<1E3*this.a.switchInterval){this.g.debug("Skipping initial estimation switch due to switch interval...");
245
- break a}}else if(Date.now()-this.f<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}c=this.chooseVariant();d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.w(c)}};_.r.playbackRateChanged=function(a){this.j=a};_.r.getBandwidthEstimate=function(){var a=this.A&&this.A.Mg();a||(a=this.o,a=128E3>a.a?this.a.defaultBandwidthEstimate:Math.min(_.dA(a.f),_.dA(a.h)));return a};
246
- _.r.setVariants=function(a){this.l=a};_.r.setCmsdManager=function(a){this.A=a};_.r.configure=function(a){this.a=a};_.r.reset=function(){this.B=!1;this.o=new QB;var a=this.chooseVariant();a&&this.w(a)};TB.prototype.clear=function(){this.a.clear()};WB.prototype.add=function(a){if(ZB(this.f,a))return this.a.add(a),!0;_.J("Rejecting variant - not compatible with root.");return!1};WB.prototype.values=function(){return this.a.values()};aC.prototype.create=function(a){var b=this,c=a.filter(function(d){return ZB(b.a,d)});return c.length?new WB(c[0],c):this.f.create(a)};
247
- $B.prototype.create=function(a){var b=bC(a,this.h);0<b.length&&(a=b);b=!1;if(this.a){var c=cC(a,this.a);0<c.length?(a=c,b=!0):_.J("No exact match for preferred variant role could be found. Role: "+this.a)}b||(b=a.filter(function(d){return d.primary}),0<b.length&&(a=b));this.f&&(b=gB(a,this.f),b.length?a=b:_.J("No exact match for the channel count could be found."));b=dC(a,this.j);b.length?a=b:_.J("No exact match for spatial audio could be found.");b=new WB(a[0]);a=_.u(a);for(c=a.next();!c.done;c=
248
- a.next())c=c.value,ZB(b.f,c)&&b.add(c);return b};gC.prototype.getState=function(){return this.a};var fC=0,eC=1;iC.prototype.release=function(){this.f.release()};jC.prototype.release=function(){this.a=this.h=null;this.f=function(){}};jC.prototype.o=function(a){var b=this.a,c=this.h.periods;a=Xz(c,a)||c[0];b!=a&&this.f(a);this.a=a};lC.prototype.getConfiguration=function(){return this.j};lC.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};lC.prototype.set=function(a,b){this.h=a;pC(this,b)};rC.prototype.release=function(){this.h=null;this.f=function(){}};vC.prototype.release=function(){this.h&&(this.h.release(),this.h=null);null!=this.w&&(this.w.stop(),this.w=null);this.f&&(this.f.release(),this.f=null);this.a=this.G=this.C=null;this.o=!1};vC.prototype.xe=function(){this.A=!0;uC(this)};zC.prototype.release=function(){this.f&&(this.f.release(),this.f=null);null!=this.h&&(this.h.release(),this.h=null);this.j=function(){};this.a=null;this.o=function(){};this.w=!1};wC.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};HC.prototype.release=function(){this.f&&(this.f.release(),this.f=null);this.j&&(this.j.release(),this.j=null);this.o&&(this.o.stop(),this.o=null);this.h=this.f=this.a=this.l=null;this.A=function(){}};var NC=new _.Eo(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});var vD;_.r=_.PC.prototype;_.r.destroy=function(){var a=this,b,c,d,e;return _.E(function(f){if(1==f.a){b=[];c=_.u(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,$C(e),b.push(aD(e));return _.x(f,Promise.all(b),2)}a.a.clear();a.o.clear();a.D=null;a.j=null;a.G=null;a.l=null;a.h=null;a.f=!0;_.y(f)})};
249
- _.r.start=function(){var a=this,b,c,d;return _.E(function(e){if(1==e.a){b=a.D.Cb();c=WC(a,b);d=a.D.wf(QC(a)[c]);if(!d.variant&&!d.text)throw a.g.error("start(): No streams chosen"),new _.P(_.Q,5,5005);a.C=!d.variant&&!!d.text;return _.x(e,qD(a,d.variant?d.variant.audio:null,d.variant?d.variant.video:null,d.text,b),2)}if(a.f)return e["return"]();a.g.debug("init: completed initial Stream setup");a.D&&a.D.nl&&(a.g.debug("init: calling onInitialStreamsSetup()..."),a.D.nl());_.y(e)})};
250
- _.r.Hb=function(a){var b=this,c,d,e,f;return _.E(function(g){switch(g.a){case 1:if(b.f)return g["return"]();c=gD(a);if(a.eb||null==a.vb||a.hc)return g["return"]();a.vb=null;if(!a.Mb){g.F(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.x(g,jD(b,a,a.Ee,a.ae),3);case 3:return g["return"]();case 2:_.A(g,4);d=uD(b,a);null!=d&&(YC(b,a,d),a.Uc=!1);_.ah(g,5);break;case 4:return e=_.C(g),_.x(g,FD(b,e),6);case 6:return g["return"]();case 5:f=Array.from(b.a.values()),KD(b,a),b.B&&f.every(function(h){return h.endOfStream})&&
251
- (b.g.debug(c,"calling endOfStream()..."),b.D.X.endOfStream().then(function(){if(!b.f){var h=b.D.X.getDuration();h<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=h)}}).then(function(){b.D.nh()})),_.y(g)}})};
252
- _.r.Jl=function(a,b,c,d){var e=rz(d.reader),f=rz(d.reader),g=_.W(d.reader),h=_.W(d.reader),l=_.W(d.reader),m=_.W(d.reader);d=_.lm(d.reader,d.reader.Ga()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"==e)this.D.rh();else this.D.onEvent(new _.L("emsg",{detail:{startTime:a,endTime:a+l/g,schemeIdUri:e,value:f,timescale:g,presentationTimeDelta:h,eventDuration:l,id:m,messageData:d}}))};
253
- _.r.Am=function(a){var b=this,c=!1,d=0;(new _.mm).L(_.Oe,_.nm).L(_.fg,_.nm).L(_.Je,_.nm).L(_.Ne,_.nm).L(_.Vf,_.nm).Y(_.Xf,_.om).L("encv",function(e){e.reader.skip(78);_.nm(e)}).L("pasp",function(e){d=e.start+e.headerSize;var f=_.W(e.reader),g=_.W(e.reader);c=f!==g;b.g.debug("hSpacing\x3d"+f+", vSpacing\x3d"+g+", updatePASP\x3d"+c);e.parser.stop()}).parse(a.data);c&&(a=new _.am(new DataView(a.data)),a.seek(d),_.V(a,1),_.V(a,1))};vD="iterateSegmentReference";_.ZE={ITERATOR:vD,LOOKUP:_.ez};_.w(ND,_.Dl);_.r=ND.prototype;_.r.init=function(a,b){var c=a.getMedia();_.Dl.prototype.init.call(this,a,b);TD(this,c)};_.r.namespace=function(){return cz};_.r.yg=function(){return new BB};_.r.getState=function(){return this.qa};_.r.getDrmInfo=function(){return this.l?this.l.getDrmInfo():null};
254
- _.r.unload=function(){var a=this;HB(this,!1);this.sd=!1;if(this.w){var b=this.getTrackManager();b&&b.release();return this.G===QD?Promise.resolve():VD(this).then(function(){a.log.debug(_.Qb,a.w);a.w=null;a.Hf=0;a.Jc=null;a.da=null})}return Promise.resolve()};
255
- _.r.release=function(){var a=this;return _.E(function(b){if(a.ha)return b["return"](a.ha);a.ha=new Promise(function(c,d){try{var e=a.Yb;a.Yb=null;var f=e;e&&(f=e["catch"](function(){}));f?f=f.then(function(){return _.Dl.prototype.release.call(a)}):f=_.Dl.prototype.release.call(a);f=f.then(function(){return a.unload()});f.then(function(){PD(a,_.Ho);a.ha=null;c()})["catch"](function(g){a.ha=null;d(g)})}catch(g){a.ha=null,d(g)}});return b["return"](a.ha)})};
256
- _.r.getBufferInfo=function(a){if(this.M){var b=UA(this.M),c=new _.sl(void 0,a);switch(a){case _.Qj:return b.video?b.video:c;case _.T:return b.audio?b.audio:c;case _.S:return b.text?b.text:c}return b.total?b.total:c}return this.wd?(b=Tz(this.wd),Qz(b,a)):_.Dl.prototype.getBufferInfo.call(this,a)};_.r.getPosition=function(){return this.A?JC(this.A):_.Dl.prototype.getPosition.call(this)};_.r.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};
257
- _.r.getDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.r.destroy=function(){var a=this;return _.E(function(b){if(1==b.a)return _.x(b,_.Dl.prototype.destroy.call(a),2);if(3!=b.a){if(a.G===QD)return b["return"]();a.log.debug("Destroying player...");a.G=QD;return _.x(b,SD(a),3)}a.o&&(a.o.release(),a.o=null);a.h=null;a.I&&(a.I.release(),a.I=null);_.y(b)})};
258
- _.r.lg=function(){var a=this;return _.E(function(b){if(1==b.a){if(!a.re)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.re);a.re=null;return _.x(b,$D(a),2)}return _.x(b,aE(a),0)})};_.r.preload=function(a){var b=this;return _.E(function(c){if(1==c.a)return _.rn("preload.start"),b.log.info("Preloading asset",a),_.x(c,bE(b,a,!1),2);b.re=a;b.log.info("Preloaded asset",a);_.rn("preload.end");_.sn("preload","preload.start","preload.end");_.y(c)})};
259
- _.r.load=function(a){return bE(this,a)};_.r.detach=function(){var a=this;return _.E(function(b){return 1==b.a?_.x(b,RD(a),2):b["return"](SD(a))})};_.r.isLive=function(){var a;this.f?(a=this.f.presentationTimeline.isLive())||(a=this.f.presentationTimeline,a=Infinity!=a.f&&!a.j):a=!1;return a};_.r.wh=function(){this.log.debug("User seeking finished");this.H&&mE(this);nE(this)};_.r.getSeekRange=function(){if(this.f){var a=this.f.presentationTimeline;return{start:_.oA(a,0),end:nA(a)}}return{start:0,end:0}};
260
- _.r.Tc=function(){return this.f?this.f.presentationTimeline.Tc():null};_.r.getPlaybackRate=function(){if(this.K){var a=this.K;a=a.l?0:a.h}else a=0;return a};
261
- _.r.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G===MD){if(_.Dj()){this.log.warn("Pausing and unpausing to mitigate playbackRate platform issue.");var c=this.getSurface().getMedia();c.pause();this.K.set(a,b);c.play()}else this.K.set(a,b);if((c=this.K.getConfiguration())&&c.preferTrickPlayTracks){c=this.a;var d=1<Math.abs(a),e=c.a.get(_.sg);if(e){var f=e.stream;if(f)if(c.g.debug("setTrickPlay",d),d)(d=f.trickModeVideo)&&!e.ac&&(c.g.debug("Engaging trick mode stream",
262
- d),_.cD(c,d,!1,0),e.ac=f);else if(f=e.ac)c.g.debug("Restoring non-trick-mode stream",f),e.ac=null,_.cD(c,f,!0,0)}}this.h.playbackRateChanged(a)}};_.r.fa=function(){if(this.f&&this.A){var a=gE(this);if(null==a)a=null;else{if(!VB(this.V,a).text){var b=_.uB(a.textStreams,this.md,this.ne,this.ld);b.length&&(b=b[0],VB(this.V,a).text=b)}a=VB(this.V,a).text}b=[];for(var c=_.u(ME(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=rB(d);e.active=d==a;b.push(e)}return b}return[]};_.r.getPeriods=function(){return this.f.periods};
263
- _.r.getStats=function(){if(this.G!==MD)return _.Do();nE(this);var a=this.j;if(a.getVideoPlaybackQuality){a=a.getVideoPlaybackQuality();var b=this.J,c=Number(a.totalVideoFrames);b.l=Number(a.droppedVideoFrames);b.j=c}if(this.G===MD){if(a=yE(this))this.J.o=a.bandwidth;a&&a.video&&(b=this.J,c=a.video.height||NaN,b.w=a.video.width||NaN,b.h=c);a=this.h.getBandwidthEstimate();this.J.f=a}return this.J.getStats()};_.r.he=function(){return this.gc};
264
- _.r.getTimelineCues=function(){return this.gc?Array.from(this.gc.a.values()).map(pA):[]};_.r.resetAbr=function(){this.h&&this.h.reset()};
265
- _.r.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,t,v,z;return _.E(function(D){if(1==D.a){if(g.G!==MD)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=gE(g);l=_.fp;m=g.f.periods.indexOf(h);n=m+1;p=n>=g.f.periods.length?g.f.presentationTimeline.getDuration():g.f.periods[n].startTime;q=p-h.startTime;if(Infinity==q)throw new _.P(1,4,4040);t=new _.Li(1,0,q,function(){return[a]},0,null,0);v={id:g.Uh++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
266
- findSegmentPosition:function(){return 1},getSegmentReference:function(G){return 1==G?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.ez,initSegmentReference:null,mimeType:d,codecs:e||"",kind:c,encrypted:!1,keyId:null,language:b,originalLanguage:b,label:f||null,type:l.TEXT,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,closedCaptions:null};g.qe.add(v);h.textStreams.push(v);return _.x(D,ZC(g.a,v),
267
- 2)}if(z=_.SC(g.a,_.bg))VB(g.V,h).text=z;g.qe["delete"](v);g.log.debug("Choosing new streams after adding a text stream");xE(g,h);iE(g);return D["return"](rB(v))})};
268
- _.r.dj=function(a){this.log.debug(_.iz,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=KE(this,a);this.log.debug("onChooseStreams_, chose variant ",b.variant);this.log.debug("onChooseStreams_, chose text ",b.text);return b}catch(c){return this.onError(c),{variant:null,text:null}}};
269
- _.r.cj=function(){this.log.debug("canSwitch_");this.ea=!1;this.configuration.abr.enabled&&this.h.enable();this.Da&&(dD(this.a,this.Da,this.Oh,this.Kh),this.Da=null);this.pa&&(_.cD(this.a,this.pa,!0,0),this.pa=null)};_.r.ej=function(){this.B&&this.B.update&&this.B.update()};_.r.yl=function(){this.A&&this.A.j.xe()};
270
- _.r.li=function(a,b,c){if((void 0===c?"":c)===fz)return iE(this),this.ma()||(this.configuration.abr.enabled=!0,this.h.enable()),xE(this,b,!1),!0;if(c=b.variants.some(function(g){var h=!1,l=g[a.type];l&&(h=g.allowedByApplication&&l.id!==a.id,a.type===_.$c&&(h=h&&l.language===a.language));return h})&&this.ma()){for(var d=_.u(b.variants),e=d.next();!e.done;e=d.next()){e=e.value;var f=e[a.type];f&&f.id===a.id&&(e.allowedByApplication=!1)}iE(this);this.ma()||(this.configuration.abr.enabled=!0,this.h.enable());
271
- xE(this,b)}return c};_.r.ll=function(){this.log.debug("endOfStream called by streaming engine");this.sd=!0};_.r.onError=function(a){if(this.G!==QD&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.ne,{detail:a});a.severity===_.Q&&PD(this,_.So);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.r.Ye=function(a){a.type===_.he?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Bg?cE(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.fc,a.type)))};_.r.ma=function(){return this.configuration.abr.enabled};
272
- _.r.tm=function(a){var b=this,c,d,e,f,g,h,l,m;return _.E(function(n){switch(n.a){case 1:if(!b.Hc)return n["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.ma();return _.x(n,b.Hc(c.url,a),2);case 2:e=n.f;if(!e)return n["return"]();f=_.N.oa(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.x(n,kD(b.a),3);case 3:g=yE(b);case 4:return h=!1,_.A(n,7),b.log.info("Switching CDN to "+f.url+"."),_.x(n,NE(b,f,g),9);case 9:_.ah(n,6);break;case 7:return l=_.C(n),b.log.info("Switch failed"),
273
- _.x(n,b.Hc(f.url,a),10);case 10:if(m=n.f)f.url=m,h=!0;else throw l;case 6:h?n.F(4):(d&&b.h.enable(),iD(b.a,!0),b.w[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.L(_.pd,{newManifest:f.url})),_.y(n))}})};ND.prototype.detach=ND.prototype.detach;var QD=0,LD=1,MD=2,hE=[_.bf,_.ve];OE.prototype.a=function(){return cz};
274
- OE.prototype.canPlay=function(a,b){if(_.Ak())return 0;var c=a.type||"",d=(window.ManagedMediaSource?!0:!1)||(window.MediaSource&&MediaSource.isTypeSupported?!0:!1),e=window.ManagedMediaSource||window.MediaSource&&MediaSource.isTypeSupported?c in _.Ds||_.Es(a.url)in _.Fs?!0:!1:!1;if(d&&e){if(_.Dj(2))return 1;if(_.Bk()&&c===_.dl){if(b.streaming.preferNativeHlsOnSafari)return 1;_.J("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
275
- OE.prototype.create=function(){return new ND};_.zh(new OE);_.Kp(function(){_.th("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.sh("Patching Chromecast MSE bugs."),TE();else if(_.Bk()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;RE();10>=a?(_.sh("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.sh("Patching Safari 11 \x26 12 MSE bugs."),PE(),QE()):(_.sh("Patching Safari 13 MSE bugs."),PE())}else _.Dj(2)||_.Dj(3)||
276
- _.Dj(4)?SE():_.sh("Using native MSE as-is.");else _.sh("No MSE implementation available.")});_.w(UE,_.pt);_.r=UE.prototype;
277
- _.r.append=function(a){function b(e){if(e.startTime>=e.endTime)_.J("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.R.Pf(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.sd}catch(g){f.align="middle"}e.writingMode===_.qg?f.vertical="lr":e.writingMode===_.rg&&(f.vertical="rl");e=f}e&&c.push(e)}var c=[],d=_.u(a);for(a=d.next();!a.done;a=d.next())b(a.value);a=c.slice().sort(function(e,f){return e.startTime!==f.startTime?
278
- e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.u(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.r.remove=function(a,b){if(!this.a)return!1;VE(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.r.isTextVisible=function(){return this.a.mode==_.Nf};_.r.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.Nf:_.se)};_.r.destroy=function(){this.a&&VE(this.a,function(){return!0});this.a=null;return Promise.resolve()};WE.prototype.ba=function(){return!0};WE.prototype.create=function(a){return new UE(a)};_.uo("single-native",new WE);};
70
+ UC=function(a){return{id:a.id,active:!1,type:_.Ri,bandwidth:0,language:a.language,originalLanguage:a.originalLanguage,label:a.label,kind:a.kind||null,width:null,height:null,frameRate:null,trickPlay:!1,mimeType:a.mimeType,audioMimeType:null,codecs:a.codecs||null,audioCodec:null,videoCodec:null,primary:a.primary,roles:a.roles,audioRoles:null,videoId:null,audioId:null,channelsCount:null,spatialAudio:!1,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:a.originalId,
71
+ accessibility:a.accessibility,keyId:null}};VC=function(a){return a.allowedByApplication&&a.allowedByKeySystem};JC=function(a,b){var c=a.filter(function(g){return g.audio&&g.audio.channelsCount}),d=new Map;c=_.t(c);for(var e=c.next();!e.done;e=c.next()){e=e.value;var f=e.audio.channelsCount;d.has(f)||d.set(f,[]);d.get(f).push(e)}c=Array.from(d.keys());if(0===c.length)return a;e=c.filter(function(g){return g<=b});return e.length?d.get(Math.max.apply(null,e)):d.get(Math.min.apply(null,c))};
72
+ _.XC=function(a,b,c,d){b=_.gi(b);var e=a,f=a.filter(function(h){return h.primary});f.length&&(e=f);var g=e.length?e[0].language:"";e=e.filter(function(h){return h.language===g});b.some(function(h){var l=_.GA(_.dj(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.dj(m.language)===l}),!0):!1});e=e.filter(function(h){return d?h.kind===_.se:h.kind!==_.se});if(c){b=WC(e,c);if(b.length)return b;_.J("No exact match for the text role could be found.")}else if(b=e.filter(function(h){return 0===
73
+ h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.Ai,[]);return b.length?WC(e,b[0]):e};WC=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
74
+ QC=function(a){var b=JA(a);return a.type===_.bd?"type\x3daudio mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" channelsCount\x3d"+a.channelsCount:a.type===_.Fg?"type\x3dvideo mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" frameRate\x3d"+a.frameRate+" width\x3d"+a.width+" height\x3d"+a.height:"unexpected stream type"};
75
+ YC=function(a,b){var c=String(_.mk++);c=new _.gk(c,a);c.mimeType=_.hk(b.mimeType);if(a===_.T||a===_.ik)c.label=_.hk(b.label),c.language=_.hk(b.language),c.originalLanguage=_.hk(b.originalLanguage);a===_.jk?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.ik?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.hk(b.audioMimeType)):(c.kind=_.hk(b.kind),c.roles=b.roles);c.accessibility=a===_.jk||a===_.ik?(b.accessibility||[]).filter(function(d){return d.type===
76
+ a}):b.accessibility||[];return c};
77
+ ZC=function(a,b,c){var d=new _.pk(a===_.jk?""+b.videoId:a===_.ik?""+b.audioId:""+b.id,c);switch(a){case _.jk:d.codec=_.hk(b.videoCodec);d.bandwidth=b.videoBandwidth||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.originalVideoId;d.drm={keyId:b.keyId||void 0};break;case _.ik:d.codec=_.hk(b.audioCodec);d.bandwidth=b.audioBandwidth||b.bandwidth;d.originalId=b.originalAudioId;d.drm={keyId:b.keyId||void 0};break;default:d.codec=_.hk(b.codecs),d.originalId=b.originalTextId}(a=c.renditions.find(function(e){return _.O.ka(e,
78
+ d,null,["id","track"])}))||c.renditions.push(d);return a||d};$C=function(a,b){var c=a.reduce(function(d,e){b===_.jk?null===e.videoId||d[e.videoId]&&!e.active||(d[e.videoId]=e):b===_.ik&&(null===e.audioId||d[e.audioId]&&!e.active||(d[e.audioId]=e));return d},{});return Object.values(c)};aD=function(a,b){if(void 0!==b&&null!==b){var c=a.filter(function(d){return d.audio&&d.audio.id===b});if(0<c.length)return c}return a};
79
+ bD=function(a,b,c){function d(f,g){return null==f?null==g:g.id===f}for(var e=0;e<c.length;e++)if(d(a,c[e].audio)&&d(b,c[e].video))return c[e];return null};_.cD=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};dD=function(a){var b=a.periods[0].startTime;a=a.periods[a.periods.length-1].endTime;if(null==a)throw Error("Period end time must be known");return{start:b,end:a}};eD=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
80
+ gD=function(a,b){try{if(1===a.length)return a[0];if(!a.every(fD))throw new _.yi("Period durations must be finite");if(0===a.length)throw Error("Cannot concatenate 0 manifests");if(1===a.length)var c=a[0];else{for(var d=_.ah(a[0].periods).concat(),e=1;e<a.length;e++){var f=dD(a[e-1]).end;_.cD(a[e].periods,f);d.push.apply(d,_.ah(a[e].periods))}d={adaptedPeriods:d,periods:d,presentationTimeline:b,minBufferTime:0};var g=dD(d).end;_.cB(b.a,0,g);var h=a[0].presentationTimeline.nc();h&&_.fB(b,h.seekRangeStartDateTime);
81
+ c=d}return c}catch(l){throw new _.P(_.Q,7,7003,"Failed to join manifests into a continuous playlist!",l);}};hD=function(a,b){var c=b.periods[0].configurationId,d=_.ah(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={adaptedPeriods:d,periods:d,presentationTimeline:e,minBufferTime:0};_.gB(e,b.presentationTimeline.o);return gD([d,b],e)};fD=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
82
+ iD=function(){this.g=new _.K("cl.api.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};jD=function(a,b){return a.h.filter(function(c){return c.type===b})};kD=function(a,b){var c=a.a.get(b)||null;return c&&c.track};mD=function(a,b,c){if(!c||kD(a,c.type)!==c||a.m.pa())switch(b){case _.jk:a.Ya(c&&c.renditions[0]);break;case _.ik:a.hb(c&&c.renditions[0]);break;case _.T:a.ib(c&&c.renditions[0]);break;default:lD(a,b,c&&c.renditions[0])}};
83
+ nD=function(a,b){a.a.set(b.track.type,b);b===(a.f.get(b.track.type)||null)&&a.f.set(b.track.type,null)};
84
+ lD=function(a,b,c,d){d=void 0===d?!1:d;if(a.m&&((a.a.get(b)||null)!==c||a.m.pa())){var e=a.m;if(c){if(0>a.h.indexOf(c.track))throw Error("Unknown rendition with ID "+c.id);if(b!==c.track.type)throw Error("Types mismatch");a.g.debug("Activate rendition type\n "+b+" with ID: "+c.id);if(b===_.T){var f=e.ha().find(function(n){return n.id===parseInt(c.id,10)});f&&(a.f.set(b,c),nD(a,c),e.trigger(new _.L(_.Ol)),oD(e,!0).then(function(){pD(e,f)})["catch"](function(n){a.g.warn("Error while activating track",
85
+ n)}))}else if(b===_.ik)a.f.set(b,c),qD(e,parseInt(c.id,10));else if(b===_.jk){var g=a.a.get(_.ik)||null,h=null;if(g){var l=rD(e).filter(function(n){return n.videoId===parseInt(c.id,10)});h=l.find(function(n){return n.audioId===parseInt(g.id,10)})||null;if(!h){a.g.debug("Unable to find exact variant. Searching for equivalent");var m=g.track.renditions.map(function(n){return n.id}).filter(function(n){return n!==g.id});h=l.find(function(n){return m.find(function(p){return p===n.audioId})})||null}}else h=
86
+ rD(e).find(function(n){return n.videoId===parseInt(c.id,10)})||null;h?(a.f.set(b,c),sD(e,h,d)):a.g.warn("Cannot find matching variant")}}else a.g.debug(_.Ha+b),(h=kD(a,b))&&(b===_.T?oD(e,!1).then(function(){a.a.set(b,null);e.trigger(new _.L(_.Ol))})["catch"](function(n){a.g.warn("Error while de-activating text tracks",n)}):b===_.ik?a.g.info("Enabling ABR for audio is not supported"):b===_.jk&&h.trickPlay?a.g.info("Enabling ABR for trick play tracks is not supported"):sD(e,null,d))}};
87
+ vD=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.t(Object.values(_.Xu)),d=c.next();!d.done;d=c.next())d=d.value,a.a.set(d,null),a.f.set(d,null);c={};d=_.t(a.m.ha());for(var e=d.next();!e.done;c={ec:c.ec},e=d.next()){e=e.value;c.ec=YC(_.T,e);var f=b.find(function(h){return function(l){return h.ec.ka(l)}}(c));c.ec=f||c.ec;var g=ZC(_.T,e,c.ec);e.active&&a.a.set(_.T,g);f||b.push(c.ec)}tD(a.m)||a.a.set(_.T,null);c=rD(a.m);uD(a,b,c,_.jk);uD(a,b,c,_.ik);
88
+ a.h=b}};uD=function(a,b,c,d){var e=$C(c,d);c={};e=_.t(e);for(var f=e.next();!f.done;c={fc:c.fc},f=e.next()){f=f.value;c.fc=YC(d,f);var g=b.find(function(l){return function(m){return l.fc.ka(m)}}(c));c.fc=g||c.fc;var h=ZC(d,f,c.fc);f.active&&a.a.set(d,h);g||b.push(c.fc)}};
89
+ wD=function(a,b,c){if(b){a.h.length||vD(a);for(var d=b.type,e=a.a.get(d)||null,f,g=_.t(jD(a,d)),h=g.next();!h.done&&!(f=h.value.renditions.find(function(l){return parseInt(l.id,10)===b.id}));h=g.next());f&&e!==f&&(nD(a,f),d===_.ik?a.m.trigger(new _.L(_.Nl)):d===_.jk&&a.m.trigger(new _.L(_.Jg,{details:{width:f.width||0,height:f.height||0,bandwidth:f.bandwidth,track:f.track,abrSelection:c}})))}};xD=function(){this.f=new _.YA(2);this.h=new _.YA(5);this.a=0};
90
+ _.yD=function(){this.g=new _.K("clpp.abr");this.w=null;this.f=!1;this.o=new xD;this.l=[];this.j=1;this.D=this.B=!1;this.A=this.a=this.h=null};zD=function(a,b){a&&(b=b.filter(function(c){return c.video&&c.video.trickPlay?!1:OC(c,a,{width:Infinity,height:Infinity})}));return b.sort(function(c,d){return c.bandwidth-d.bandwidth})};AD=function(){this.a=null};CD=function(a,b){if(b&&(null==a.a||a.a!==b))throw BD(a);};
91
+ BD=function(a){return new _.P(_.Q,7,7E3,a.a?"Another load operation was started while a load operation was in progress.":"Player was released while a load operation was in progress.")};DD=function(){this.a=new Map};FD=function(a,b){a.a.has(b)||a.a.set(b,new ED);return a.a.get(b)};ED=function(){this.text=this.variant=null};GD=function(a,b){this.f=a;this.a=new Set([a]);b=b||[];for(var c=_.t(b),d=c.next();!d.done;d=c.next())this.add(d.value)};
92
+ JD=function(a,b){var c;if(!(c=!!a.audio!==!!b.audio||!!a.video!==!!b.video||a.language!==b.language)&&(c=a.audio&&b.audio)){c=a.audio;var d=b.audio;c=!(c.channelsCount===d.channelsCount&&HD(c,d)&&ID(c.roles,d.roles))}!c&&(c=a.video&&b.video)&&(c=a.video,d=b.video,c=!(HD(c,d)&&ID(c.roles,d.roles)));return c?!1:!0};
93
+ HD=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=a.codecs.split(",").map(function(f){return _.KA(f)[0]}),d=b.codecs.split(",").map(function(f){return _.KA(f)[0]});if(c.length!==d.length)return!1;c.sort();d.sort();for(var e=0;e<c.length;e++)if(c[e]!==d[e])return!1;return!0};ID=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.Me);d["delete"](_.Me);if(c.size!==d.size)return!1;c=_.t(c);for(var e=c.next();!e.done;e=c.next())if(!d.has(e.value))return!1;return!0};
94
+ LD=function(a){this.a=a;this.f=new KD(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1)};KD=function(a,b,c,d){this.h=_.gi(a);this.a=b;this.f=c;this.j=void 0===d?!1:d};MD=function(a,b){var c=null;b.some(function(d){c=_.GA(_.dj(d),a.map(function(e){return FA(e)}));return!!c});return c?a.filter(function(d){return c===FA(d)}):[]};ND=function(a,b){return a.filter(function(c){var d=c.audio;c=c.video;return d&&0<=d.roles.indexOf(b)||c&&0<=c.roles.indexOf(b)})};
95
+ OD=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};RD=function(a,b){this.a=PD;this.f=(new Map).set(PD,b).set(QD,a)};
96
+ TD=function(a){var b=this;this.C=a;this.a=a.getConfiguration().streaming;this.f=new _.Sh;this.g=new _.K("clpp.mse.media.LiveEdgeObserver");SD(this)&&(a=this.C.getSurface().getMedia(),this.f.on(a,_.rg,function(){var c=b.C.getPosition(),d=b.C.getSeekRange().end;c=d-c;var e=b.C.getPlaybackRate(),f=b.a.stopChasingAt;1<=e&&c>=b.a.chaseJumpDistance?(b.g.debug("Too far from edge, jump to beginning."),b.C.setPlaybackRate(1),b.C.seek(d)):1===e&&c>=b.a.startChasingAt?(b.g.debug("Not on live edge, increase playback rate."),
97
+ b.C.setPlaybackRate(b.a.chasingRate,_.Yd)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.C.setPlaybackRate(1))}))};
98
+ SD=function(a){return 1>=a.a.chasingRate?(a.g.warn("chasingRate must be greater than 1."),!1):a.a.chaseJumpDistance<=a.a.startChasingAt?(a.g.warn("chaseJumpDistance must be greater than startChasingAt."),!1):a.a.startChasingAt<=a.a.stopChasingAt?(a.g.warn("startChasingAt must be greater than stopChasingAt."),!1):0>a.a.stopChasingAt?(a.g.warn("stopChasingAt must be greater than or equal to 0."),!1):!0};UD=function(a){this.h=a;this.a=null;this.f=function(){}};VD=function(a,b){a.f=b};
99
+ WD=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.gh();this.w=_.Yd;this.j=null;this.a=new _.Vk(function(){b.A||b.f.ml(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};XD=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
100
+ $D=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.Yd||0===c||1===c)try{YD(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),ZD(a)}else ZD(a)};ZD=function(a){a.g.debug(Vz,a.h,' using "seek" mode.');YD(a,0);a.o=!0;a.a.kb(.25)};YD=function(a,b){if(a.f.gh()!==b){a.g.debug(Vz,b,' using native playbackRate "decoder" mode.');try{a.f.Jm(b)}catch(c){throw c;}}};
101
+ bE=function(a){function b(){d=!0}function c(m){f.push(m);_.Qm(m)}a=_.lj(a);var d=!1,e,f=[],g=[];(new _.Pm).M(_.Te,c).M(_.sg,c).M(_.Oe,c).M(_.Se,c).M(_.gg,c).Y(_.ig,function(m){e=m;f.push(m);_.Rm(m)}).Y("encv",b).Y("enca",b).Y("avc1",function(m){g.push({M:m,bd:1701733238})}).Y("avc3",function(m){g.push({M:m,bd:1701733238})}).Y("ac-3",function(m){g.push({M:m,bd:1701733217})}).Y(_.ne,function(m){g.push({M:m,bd:1701733217})}).Y("mp4a",function(m){g.push({M:m,bd:1701733217})}).parse(a);if(d)return _.Gh("Init segment already indicates encryption."),
102
+ a;if(0===g.length||!e)throw _.Ih("Failed to find boxes needed to fake encryption!"),_.Ih("Failed init segment (hex):",_.zj(a)),new _.P(_.Q,3,14E3);g.reverse();for(var h=_.t(g),l=h.next();!l.done;l=h.next())l=l.value,_.Gh('Inserting "'+_.Um(l.bd)+'" box into init segment.'),a=aE(a,e,l.M,f,l.bd);return a};
103
+ aE=function(a,b,c,d,e){var f=cE.value(),g=a.subarray(c.start,c.start+c.size),h=_.sj(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.sj(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);dE(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.Yk("Xbox One")||_.Xk()?c.start:c.start+c.size;f=a.subarray(c);e.set(a.subarray(0,c));e.set(l,c);e.set(f,c+l.byteLength);a=_.t(d);for(d=a.next();!d.done;d=a.next())d=d.value,dE(e,d.start,d.size+l.byteLength);l=_.sj(e,
104
+ b.start);b=_.Vm(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};dE=function(a,b,c){a=_.sj(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.eE=function(a,b){this.C=b;this.j=a;this.h=null;this.w=1;this.G=Promise.resolve();this.l=[];this.o=new Map;this.a=new Map;this.I=this.f=this.A=this.B=!1;this.H=0;this.g=new _.K("clpp.mse.Streaming");this.D=!1};gE=function(a){var b=a.a.get(_.Fg);return b?fE(a)[b.Gb]:(b=a.a.get(_.bd))?fE(a)[b.Gb]:null};
105
+ iE=function(a){return _.hE(a,_.bd)};jE=function(a){return _.hE(a,_.Fg)};
106
+ oE=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.E(function(q){switch(q.a){case 1:return c=_.Ip,_.x(q,a.C.W.clear(c.TEXT),2);case 2:return a.H++,a.I=!1,d=a.H,e=a.C.W,f=new Map,g=new Set,f.set(c.TEXT,b),g.add(b),_.x(q,e.init(f,!1,a.h.disableAudioTracks),3);case 3:return a.f?q["return"]():_.x(q,kE(a,g),4);case 4:if(a.f)return q["return"]();l=(h=e.getTextDisplayer().isTextVisible())||a.h.alwaysStreamText;a.H!==d||a.a.has(c.TEXT)||a.I||!l||(m=a.C.Db(),n=lE(a,m),p=mE(b,n,0),a.a.set(c.TEXT,p),nE(a,p,0));
107
+ _.y(q)}})};rE=function(a){a.I=!0;var b=a.a.get(_.Ri);b&&(pE(b),qE(b)["catch"](function(){}),a.a["delete"](_.Ri))};tE=function(a,b,c,d){b.video&&_.sE(a,b.video,c,d);b.audio&&_.sE(a,b.audio,c,d)};vE=function(a,b){a.j.adaptedPeriods=b.adaptedPeriods;a.j.periods=b.periods;uE(a)};
108
+ xE=function(a){function b(l){return a.C.W.qc(l,c,0)}var c=a.C.Db(),d=!1,e=lE(a,c);if(_.ij(a.a.values(),function(l){return l.Gb===e}))for(var f=_.t(a.a.keys()),g=f.next();!g.done;g=f.next()){g=g.value;var h=a.a.get(g);h.stream.segmentIterator=null;b(g)||(wE(a,h),d=!0)}else if(!_.ij(a.a.keys(),b)){a.g.debug("(all): seeked: unbuffered seek: clearing all buffers");d=_.t(a.a.values());for(f=d.next();!f.done;f=d.next())wE(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
109
+ c)};AE=function(a,b){b=void 0===b?!1:b;if(a.f)a.g.error("Unable to retry after StreamingEngine is destroyed!");else if(a.A)a.g.error("Unable to retry after StreamingEngine encountered a fatal error!");else for(var c=_.t(a.a.values()),d=c.next();!d.done;d=c.next()){d=d.value;var e=yE(d);if(d.Wc||b&&zE(d))a.g.info(e,"Retrying after failure..."),d.Wc=!1,nE(a,d,.1)}};BE=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.$a})};
110
+ CE=function(a){var b=Array.from(a.a.values());return a.B&&b.every(function(c){return c.endOfStream})};EE=function(a){var b,c,d,e;return _.E(function(f){b=[];c=_.t(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,pE(e),e.fb&&e.Ib&&(e.fb=!1,b.push(e.Ib.abort())),e.Mb&&b.push(DE(a,e,!0,0));return _.x(f,Promise.all(b),0)})};FE=function(a,b,c){(a=a.a.get(b))&&c&&(pE(a),a.stream=c,a.Yb=c,a.ua&&(a.ua=c.getSegmentReference(a.ua.position)),a.ua||(a.Yb=null))};
111
+ _.hE=function(a,b){var c=a.a.get(b);return c?c.ac||c.stream:null};
112
+ _.sE=function(a,b,c,d){var e=a.a.get(b.type);if(!e&&b.type===_.Ri&&a.h.ignoreTextStreamFailures)oE(a,b);else if(e){var f=VA(fE(a),b);if(c&&f!==e.Gb)for(a.g.debug("switch: switching to stream in another Period; clearing buffer and changing Periods"),b=_.t(a.a.values()),c=b.next();!c.done;c=b.next())wE(a,c.value);else{e.ac&&(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(e.ac=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(e.ac=null,a.g.debug("switch found no special trick play stream")));
113
+ var g=a.l[f];if(g&&g.ed&&(g=a.o.get(b.id))&&g.ed)if(e.stream!==b){g=a.j.presentationTimeline.getDuration();var h=a.C.Db();h=GE(a,e,h);!c&&(e.endOfStream||h>=g)?a.g.debug(mA+yE(e)+" already buffered to the end. Not switching."):(b.type===_.Ri&&tC(a.C.W,_.Rk(b.mimeType,b.codecs)),e.stream=b,e.stream.segmentIterator=null,e.Ud=!0,a.g.debug("switch: switching to Stream "+yE(e)),HE(a,e,f)&&(a.g.info("Aborting current segment request to switch."),e.Ib.abort()),c&&(e.hc?e.Ne=!0:e.fb?(e.Mb=!0,e.me=d,e.Ne=
114
+ !0):(pE(e),DE(a,e,!0,d)["catch"](function(l){if(a.C)a.C.onError(l)}))))}else a.g.debug(mA+yE(e)+" already active")}}};HE=function(a,b,c){if(!b.Ib)return!1;var d=a.C.Db(),e=a.C.W.Ea(b.type);c=(c=IE(a,b,d,e,c))?c.Ed():null;if(null==c)return!1;var f=b.stream.initSegmentReference;f&&(c+=f.Ed()||0);f=a.C.uf().getBandwidthEstimate();if(8*c/f<(null===e?0:e-d)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal))return!0;a=b.Ib;a=a.j?a.j.bytesRemaining:-1;return 0>a||a>c?!0:!1};
115
+ wE=function(a,b){var c=yE(b);b.hc?a.g.debug(c,"clear: already clearing the buffer"):b.Mb?a.g.debug(c,"clear: already waiting"):b.fb?(a.g.debug(c,"clear: currently updating"),b.Mb=!0,b.me=0):null==a.C.W.xb(b.type)?(a.g.debug(c,"clear: nothing buffered"),null==b.$a&&nE(a,b,0)):(a.g.debug(c,"clear: handling right now"),pE(b),DE(a,b,!1,0)["catch"](function(d){if(a.C)a.C.onError(d)}))};
116
+ JE=function(a,b,c,d,e){var f,g,h,l,m,n,p;return _.E(function(q){if(1==q.a)return f=a.C.Db(),g=lE(a,f),h=_.Ip,l=new Map,m=new Set,b&&(l.set(h.AUDIO,b),m.add(b)),c&&(l.set(h.VIDEO,c),m.add(c)),d&&(l.set(h.TEXT,d),m.add(d)),n=a.C.W,p=a.h.forceNativeTS,_.x(q,n.init(l,p,a.h.disableAudioTracks),2);if(3!=q.a){if(a.f)return q["return"]();uE(a);return _.x(q,kE(a,m),3)}if(a.f)return q["return"]();l.forEach(function(u,v){if(!a.a.has(v)){var z=mE(u,g,e);a.a.set(v,z);nE(a,z,0)}});_.y(q)})};
117
+ mE=function(a,b,c){return{stream:a,type:a.type,Yb:null,segmentIterator:null,ua:null,ac:null,Ud:!0,Gb:b,endOfStream:!1,fb:!1,$a:null,Mb:!1,me:0,Ne:!1,hc:!1,Tf:!1,Wc:!1,bi:c||0,Ib:null,pe:!1,xh:0}};
118
+ KE=function(a,b){var c=a.l[b];if(c)return a.g.debug("(all) Period "+b+Iz),c.P;a.g.debug("(all) setting up Period "+b);c={P:new _.Oj,ed:!1};a.l[b]=c;for(var d=new Set,e=_.t(fE(a)[b].variants),f=e.next();!f.done;f=e.next())f=f.value,f.video&&d.add(f.video),f.video&&f.video.trickModeVideo&&d.add(f.video.trickModeVideo),f.audio&&d.add(f.audio);e=_.t(fE(a)[b].textStreams);for(f=e.next();!f.done;f=e.next())d.add(f.value);a.G=a.G.then(function(){return a.f?null:kE(a,d)}).then(function(){a.f||(a.l[b].P.resolve(),
119
+ a.l[b].ed=!0,a.g.debug("(all) setup Period "+b))})["catch"](function(g){a.f||(a.l[b].P["catch"](function(){}),a.l[b].P.reject(),delete a.l[b],a.g.warn("(all) failed to setup Period "+b),a.C.onError(g))});return c.P};
120
+ kE=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u;return _.E(function(v){switch(v.a){case 1:c=[];d=_.t(b);for(e=d.next();!e.done;e=d.next())f=e.value,(g=a.o.get(f.id))?(a.g.debug("(all) Stream "+f.id+Iz),c.push(g.P)):(a.g.debug("(all) setting up Stream "+f.id),a.o.set(f.id,{P:new _.Oj,ed:!1}),h=a.C.tb,c.push(f.createSegmentIndex(h)));_.A(v,2);return _.x(v,Promise.all(c),4);case 4:if(a.f)return v["return"]();_.oh(v,3);break;case 2:l=_.C(v);if(a.f)return v["return"]();m=_.t(b);for(e=m.next();!e.done;e=m.next())n=
121
+ e.value,a.o.get(n.id).P["catch"](function(){}),a.o.get(n.id).P.reject(),a.o["delete"](n.id);throw l;case 3:p=_.t(b);for(e=p.next();!e.done;e=p.next())q=e.value,u=a.o.get(q.id),u.ed||(u.P.resolve(),u.ed=!0,a.g.debug("(all) setup Stream "+q.id));_.y(v)}})};uE=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?FC(a.C.W,b):FC(a.C.W,Math.pow(2,32))};
122
+ NE=function(a,b){function c(p){return p.type===_.Ri&&p.stream.mimeType===_.Tc}if(c(b))return AC(a.C.W,b.stream.originalId||""),null;b.type===_.Ri&&BC(a.C.W);if(!sC(a.C.W)&&b.type!==_.Ri)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=yE(b),e=a.C.Db(),f=GE(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=VA(fE(a),b.stream),h=lE(a,f),l=a.C.W.La(b.type,e);a.g.debug(d,"update_:",hA+e,"bufferedAhead\x3d"+l);var m=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*
123
+ a.w,n=hB(a.j.presentationTimeline);if(null!=n&&f>=n&&!b.pe)return LE(a,b),null;b.endOfStream=!1;b.Gb=h;if(h!==g)return a.g.debug(d,"need Period "+h,hA+e,"timeNeeded\x3d"+f,"currentPeriodIndex\x3d"+g),null;if(l>=m)return a.g.debug(d,"buffering goal met"),a.h.bufferLimitUpdateInterval||.5;h=a.C.W.Ea(b.type);h=IE(a,b,e,h,g);if(!h)return a.j.presentationTimeline.isLive()||b.type===_.Ri?a.h.bufferLimitUpdateInterval||1:(a.g.debug("Media state "+d+": no next segment found. Assuming EOS."),LE(a,b),null);
124
+ d=Infinity;l=_.t(a.a.values());for(m=l.next();!m.done;m=l.next())m=m.value,c(m)||(m=GE(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.bi=0;ME(a,b,e,g,h)["catch"](function(){});return null};LE=function(a,b){a.g.debug(yE(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.Fg){var c=a.a.get(_.Ri);c&&c.stream.mimeType===_.Tc&&(c.endOfStream=!0)}};
125
+ GE=function(a,b,c){if(!b.Yb||!b.ua)return Math.max(c,b.bi);c=VA(fE(a),b.Yb);return fE(a)[c].startTime+b.ua.endTime};
126
+ IE=function(a,b,c,d,e){if(b.stream.segmentLookupStrategy===OE)b.stream.segmentIterator?a=zB(b.stream.segmentIterator):b.ua||d?(c=b.ua?b.ua.endTime:d,a.g.info(Oz,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=DB(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(Oz,$z,"endTime:",c,b.ua)),a=e):(e=Math.max(c,0),a.g.info(Oz,"looking up segment","lookupTime:",e,gA,c),d=null,d||(b.stream.segmentIterator=DB(b.stream.segmentIndex,
127
+ c),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(Oz,$z,"lookupTime:",e,gA,c),a=d);else{var f=yE(b);if(b.ua&&b.stream===b.Yb)c=b.ua.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=PE(a,b,e,c);else{if(b.ua){a.g.debug(f,"next position unknown: another Stream buffered");f=VA(fE(a),b.Yb);var g=QE(a,b,fE(a)[f].startTime+b.ua.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=QE(a,b,d||c,e);if(null==g)a=null;else if(f=PE(a,b,e,g),null==f)a=null;else{var h=
128
+ null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.wa+d.startTime+2>c&&(a=PE(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};QE=function(a,b,c,d){var e=yE(b);d=fE(a)[d];var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",hA+c,"lookupTime\x3d"+f,bA+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",bA+d.startTime,"lookupTime\x3d"+f);return b};
129
+ PE=function(a,b,c,d){var e=yE(b);c=fE(a)[c];var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",bA+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.nB(g);g=mB(g);return!b.pe&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",bA+c.startTime,kA+f.startTime,iA+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
130
+ ME=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,u,v,z,B,I;return _.E(function(F){f=_.Ip;g=yE(b);h=fE(a)[d];a.g.debug(g,"fetchAndAppend_:",hA+c,bA+h.startTime,jA+e.position,kA+e.startTime,iA+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=fE(a)[d+1];q=Math.max(0,h.startTime-.1);u=p?p.startTime+.01:n;v=RE(a,b,d,q,u,e);b.fb=!0;b.Ud=!1;a.g.debug(g,"fetching segment");z=!1;B=function(D,G){if(a.f||a.A)return null;z=!0;return SE(a,b,c,h,l,e,D,G)};I=a.C.W.Ea(b.type)||
131
+ 0;v.then(function(){return a.f||a.A?null:TE(a,b,e,!1,function(D){return B(D.data,!0)})}).then(function(D){return a.f||a.A?null:z||null===D?(UE(a,b,I,e,l),null):B(D,!1)}).then(function(){if(!a.f&&!a.A){UE(a,b,I,e,l);b.fb=!1;b.Tf=!1;b.Mb||a.C.Ee();if(m){var D=m.next().value;D&&a.g.debug("New iterated segment",D)}nE(a,b,0);VE(a,b,l);a.g.debug(g,"finished fetch and append")}})["catch"](function(D){return _.E(function(G){if(a.f||a.A)return G["return"]();b.fb=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===
132
+ D.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),G.F(0);if(7001===D.code)return b.fb=!1,b.$a=null,nE(a,b,0),G.F(0);if(3017===D.code)return WE(a,b,D),G.F(0);if(1001===D.code&&D.data&&404===D.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",jA+e.position,kA+e.startTime,iA+e.endTime,"error\x3d"+D),b.fb=!1,b.$a=null,nE(a,b,1),G.F(0);if(b.type===f.TEXT)return D instanceof
133
+ _.P&&D.a(1),pE(b),a.C.onError(new _.P(1,2,2010,D)),G.F(0);if(1001<=D.code&&1003>=D.code)return _.x(G,XE(a,b,h,D),0);a.g.error(g,"failed fetch and append: code\x3d"+D.code);b.Wc=!0;D instanceof _.P&&D.a(_.Q);return _.x(G,YE(a,D),0)})});_.y(F)})};
134
+ WE=function(a,b,c){var d=yE(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.Tf}))a.g.debug(d,Qz,"waiting for another stream to recover...");else{var e=Math.round(100*a.w);if(20<e)a.w-=.2;else if(4<e)a.w-=.04;else{a.g.error(d,"MediaSource threw QuotaExceededError too many times");b.Wc=!0;a.A=!0;a.C.onError(c);return}a.g.warn(d,Qz,"reducing buffering goals by "+(100-Math.round(100*a.w))+"%");b.Tf=!0}nE(a,b,4)};
135
+ XE=function(a,b,c,d){var e,f;return _.E(function(g){e=1001===d.code&&500<=d.data.status;f=!0;e||(f=!a.C.ef(b.stream,c));if(!f)return g.F(0);b.Wc=!0;d.a(_.Q);return _.x(g,YE(a,d),0)})};
136
+ RE=function(a,b,c,d,e,f){c=fE(a)[c].startTime-f.wa;if(!b.Ud&&c===b.xh)return Promise.resolve();b.xh=c;var g=yE(b);a.g.debug(g,"setting timestamp offset to "+c);a.g.debug(g,"setting append window start to "+d);a.g.debug(g,"setting append window end to "+e);d=DC(a.C.W,b.type,c,d,e);if(!b.stream.initSegmentReference||!b.Ud)return d;a.g.debug(g,"fetching init segment");e=TE(a,b,b.stream.initSegmentReference,!0).then(function(h){if(a.f)return null;a.g.debug(g,"appending init segment");return ZE(a,h,b).then(function(){return zC(a.C.W,
137
+ b.type,h,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size)})})["catch"](function(h){b.Ud=!0;return Promise.reject(h)});return Promise.all([d,e])};ZE=function(a,b,c){var d;return _.E(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.Xk())return e.F(0);d=bE(b);return _.x(e,zC(a.C.W,c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
138
+ SE=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,u,v,z,B;return _.E(function(I){switch(I.a){case 1:l=yE(b);if(!(e&&e.keyId&&a.C.vd)){I.F(2);break}m=uA(a.C.vd,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);I.F(2);break}_.A(I,4);return _.x(I,m,6);case 6:_.oh(I,2);break;case 4:n=_.C(I),a.g.warn("DRM session load failed!",n);case 2:if(!(e.encrypted&&e.keyId&&a.C.vd&&wA(a.C.vd,e.keyId))){I.F(7);break}pE(b);p=VA(fE(a),e);q=$E(a,p);if(!q){I.F(8);break}return _.x(I,q,8);case 8:return u=
139
+ a.C.ef(e,d,dA),v=f.startTime+d.startTime,z=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+v+" - "+z+": "+u+". Stream with Key ID "+(e.keyId+" has restrictions.")),I["return"](Promise.resolve());case 7:return B=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.Pm).Y("emsg",a.gm.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),I["return"](aF(a,b,c).then(function(){if(a.f)return null;var F=f.startTime+d.startTime,D=f.endTime+d.startTime;a.g.debug(l,
140
+ "Appending segment with "+(F.toFixed(3)+" - "+D.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.R.df(e.bandwidth)+" Fragment: ")+h);return zC(a.C.W,b.type,g,F,D,B,e.id,h)}).then(function(){a.f||(a.g.debug(l,"appended media segment"),b.Yb=e,b.ua=f)}))}})};
141
+ UE=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.Ri){var f=yE(b),g=(a.C.W.Ea(b.type)||0)-c,h=d.endTime-d.startTime;c=g-h;if(Math.abs(c)>=Math.min(.01,h)&&Math.abs(c)<=Math.min(1,h))for(a.g.debug(f,"Adjusted segment",d.position,"with real duration",g,"and accounted for",c,"delta between segment duration and real duration"),b.pe=!0,a=fE(a),e.adjustSegmentDurations(d.position,c),d=VA(a,e),b=a[d],e=e.getDuration(),XA(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
142
+ bF=function(a,b,c){(new _.Pm).M(_.Te,_.Qm).M(_.sg,_.Qm).M(_.Oe,_.Qm).M(_.Se,_.Qm).M(_.gg,_.Qm).Y(_.ig,_.Rm).M("encv",function(d){d.reader.skip(78);_.Qm(d)}).M(_.bg,_.Qm).M("schi",_.Qm).M("tenc",function(d){d.reader.skip(6);if(_.Hm(d.reader)){d.reader.skip(1);var e=_.zj(_.Mm(d.reader,16));e!==b.stream.keyId&&(a.g.debug(yE(b),"Key id from tenc mismatches with key id from manifest. Switching from "+(b.stream.keyId+" to "+e+".")),b.stream.keyId=e)}d.parser.stop()}).parse(c)};
143
+ aF=function(a,b,c){if(a.f)return Promise.resolve();var d=yE(b);a.g.debug(d,"checking buffer length");var e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.h),f=a.C.W.xb(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",hA+c,Xz+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",hA+c,Yz+g,Xz+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",hA+c,Yz+g,Xz+e,"overflow\x3d"+h);return a.C.W.remove(b.type,
144
+ f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+" seconds")})};VE=function(a,b,c){if(!a.B){b=yE(b);var d=Array.from(a.a.values());1!==d.length||d[0].type!==_.Ri?a.B=d.every(function(e){return e.type===_.Ri||a.D?!0:!e.Mb&&!e.hc&&e.ua}):a.D&&(a.B=!0);a.B&&(a.g.debug(b,"startup complete"),c=VA(fE(a),c),$E(a,c))}};
145
+ $E=function(a,b){var c=null;a.l[b]||(c=KE(a,b).then(function(){a.f||(a.g.debug(Zz),a.C.Gf())})["catch"](BA));for(var d=0;d<fE(a).length;++d)KE(a,d)["catch"](BA);a.C.am&&(a.g.debug("calling onStartupComplete()..."),a.C.am());return c};
146
+ cF=function(a,b){var c=yE(b),d=VA(fE(a),b.stream);if(b.Gb!==d){var e=b.Gb,f=Array.from(a.a.values());f.every(function(g){return g.Gb===e})?f.every(zE)?(a.g.debug(c,"all need Period "+e),KE(a,e).then(function(){if(!a.f)if(qC(a.C.W),f.every(function(n){var p=zE(n),q=VA(fE(a),n.stream);return p&&n.Gb===e&&q!==e})){var g=fE(a)[e];a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.C.Hf(g);a.D=!h.variant&&!!h.text;var l=new Map;h.variant&&h.variant.video&&l.set(_.Fg,
147
+ h.variant.video);h.variant&&h.variant.audio&&l.set(_.bd,h.variant.audio);h.text&&l.set(_.Ri,h.text);var m=_.t(a.a.keys());for(h=m.next();!h.done;h=m.next())if(h=h.value,!l.has(h)&&h!==_.Ri){a.g.error(c,"invalid Streams chosen: missing "+h+" Stream");a.C.onError(new _.P(_.Q,5,5005));return}m=_.t(Array.from(l.keys()));for(h=m.next();!h.done;h=m.next())if(h=h.value,!a.a.has(h))if(h===_.Ri)JE(a,null,null,l.get(_.Ri),g.startTime),l["delete"](h);else{a.g.error(c,"invalid Streams chosen: unusable "+h+" Stream");
148
+ a.C.onError(new _.P(_.Q,5,5005));return}g=_.t(Array.from(a.a.keys()));for(h=g.next();!h.done;h=g.next())h=h.value,(m=l.get(h))?(_.sE(a,m,!1,0),nE(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,Zz);a.C.Gf()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"](BA)):a.g.debug(c,"all MediaStates need Period "+e+", but not all MediaStates are idle"):a.g.debug(c,"not all MediaStates need Period "+e)}};
149
+ lE=function(a,b){var c=TA(fE(a),b+_.Qu);return c?fE(a).indexOf(c):0};
150
+ TE=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=_.aB(c.Qa(),c.va,c.ja,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.Sc?null:e;f.disableFragmentSupport=c.Sc||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(g){bF(a,b,g.data)}),b.type===_.Fg&&a.h.overridePasp&&f.responseModifiers.push(a.$m.bind(a)));a.g.debug("fetching: reference\x3d",
151
+ c);c=a.C.tb.fetch(f);b.Ib=c;return c.P.then(function(g){var h=a.C.uf(),l=g.timeMs,m=g.data.byteLength;l&&m&&!d&&h.segmentDownloaded(l,m);b.Ib=null;return g.data})};
152
+ DE=function(a,b,c,d){var e,f,g,h;return _.E(function(l){if(1==l.a)return e=yE(b),b.Mb=!1,b.Ne=!1,b.me=0,b.hc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.C.Db(),h=a.C.W.getDuration(),f=a.C.W.remove(b.type,g+d,h)):f=a.C.W.clear(b.type).then(function(){return!a.f&&c?a.C.W.flush(b.type):null}),_.x(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.Yb=null;b.ua=null;b.hc=!1;b.endOfStream=!1;b.pe=!1;nE(a,b,0);_.y(l)})};
153
+ nE=function(a,b,c){a.g.debug(yE(b),"updating in "+c+" seconds");b.$a=(new _.Tk(function(){var d;return _.E(function(e){if(1==e.a)return _.A(e,2),_.x(e,a.Hb(b),4);if(2!=e.a)return _.oh(e,0);d=_.C(e);if(a.C)a.C.onError(d);_.y(e)})})).da(c)};pE=function(a){null!=a.$a&&(a.$a.stop(),a.$a=null)};fE=function(a){return a.j.adaptedPeriods||a.j.periods};qE=function(a){return _.E(function(b){return a.Ib?_.x(b,a.Ib.abort(),0):b.F(0)})};
154
+ YE=function(a,b){var c;return _.E(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.C.ei){d.F(2);break}_.A(d,3);return _.x(d,a.C.ei(b),5);case 5:_.oh(d,2);break;case 3:c=_.C(d),c.cause=b,b=c;case 2:if(!b.f)a.C.onError(b);_.y(d)}})};yE=function(a){return"("+a.type+":"+a.stream.id+")"};zE=function(a){return!a.fb&&null==a.$a&&!a.Mb&&!a.hc};dF=function(){this.a=null};
155
+ gF=function(){_.dm.call(this,aA);var a=this;this.G=eF;this.h=this.Ca=null;this.gg=0;this.ii=2;this.Rc=null;this.cg=!1;this.o=new _.Sh;this.Gc=this.ze=this.J=this.Lc=this.B=this.L=this.w=null;this.Kd=!1;this.V=this.l=this.f=this.A=this.a=this.I=this.K=null;this.mi=1E9;this.Be=new Set;this.fa=!0;this.Ka=null;this.ki=!1;this.ji=0;this.ia=null;this.T=new DD;this.li={width:Infinity,height:Infinity};this.H=null;this.gc=_.jp;this.Cc=new KD(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
156
+ this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio);this.Bd=this.configuration.preferredTextLanguage;this.j=new AD;this.$=this.Kc=null;this.Mc=new Map;this.Ob=null;this.xe=this.configuration.preferredTextRole;this.yd=this.configuration.preferForcedSubtitles;this.o.on(window,"online",function(){a.G===fF&&AE(a.a)});this.Fe=this.Jc=this.He=null;this.ea=_.pa;this.Nd=new dF;this.Gd=[]};
157
+ hF=function(a){return new _.NA(function(b){if(void 0===b||null===b)return null;var c=a.getTrackManager(),d=[];if(c){c=_.t(c.getVideoTracks());for(var e=c.next();!e.done;e=c.next())d.push.apply(d,_.ah(e.value.renditions))}return d.find(function(f){return f.id===b})||null})};
158
+ iF=function(a,b){if(a.gc!==b){var c=_.R.fk;if(a.gc===_.up&&b!==_.jp)c=c(b,_.sp),a.log.info(_.Sz+c);else{var d=a.gg;d=0===d?0:Date.now()-d;var e=a.gc;a.gc=b;a.gg=Date.now();null!==a.J&&(a.J.A=b===_.wp);a.H&&_.$o(a.H.a,a.gc);b===_.op&&(a.ii=a.Uf?1:2);var f=a.ii,g={currentState:a.gc,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.op||e===_.op?f:void 0},h=c(e,_.sp),l=c(b,_.sp);c=b!==_.op?"":"["+c(f,_.rp)+"]";a.log.info(_.Nb+h+" -\x3e "+(l+c));a.trigger(new _.L(_.eg,{detail:g}));(b===_.qp||b===
159
+ _.up)&&a.Gc&&a.Gc.stop();b===_.op?a.trigger(new _.L(_.md,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.op&&a.trigger(new _.L(_.ld,{detail:{bufferedTimeMS:d,reason:f}}))}}};jF=function(a){var b;return _.E(function(c){switch(c.a){case 1:b=a.j.a;a.j.a=null;if(!b){c.F(2);break}return _.x(c,b["catch"](function(){}),2);case 2:return _.x(c,_.dm.prototype.release.call(a),4);case 4:return _.x(c,a.unload(),5);case 5:iF(a,_.jp),_.y(c)}})};
160
+ kF=function(a){var b=new _.xt;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};mF=function(a,b){var c,d;return _.E(function(e){a.ea===_.Jb&&(a.f=hD(a.f,eD(b)),c=a.configuration.playlist.endTime,d=a.f.presentationTimeline.a.a,c&&d>c&&(a.log.info("Reached end of playlist. Turning timeline static."),a.A.requestStop(),a.A=null,_.gB(a.f.presentationTimeline,!0),a.trigger(new _.L(_.Ie))),lF(a,a.f));_.y(e)})};
161
+ nF=function(a){return _.E(function(b){a.A.requestStop();a.A=null;a.ea===_.Jb?a.trigger(new _.L(_.Vf)):a.trigger(new _.L(_.Ie));_.y(b)})};
162
+ lF=function(a,b){var c=a.getMediaPosition(),d=a.Jc,e=b.periods,f=d.a;d.a=[];var g=null,h=null;e=_.t(e);for(var l=e.next();!l.done;l=e.next()){l=l.value;var m=l.endTime-l.startTime;l.configurationId===g?h.a+=m:(g=l.configurationId||"",h=new _.wt(g||"",l.startTime,m,!1),d.a.push(h))}d.h&&(h=d.h,g=h.start,h=h.end,e=d.a[0],null!=g&&e&&g>=e.f&&g<=e.f+e.a&&(l=g-e.f,l<e.a&&(e.f=g,e.a-=l)),g=d.a[d.a.length-1],null!=h&&g&&h>=g.f&&h<=g.f+g.a&&(g.a=h-g.f));zA(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
163
+ 0;d<f.length;d++)if(!f[d].ka(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.L(_.Wf));xB(a.Fe);oF(a)};oF=function(a){if(a.I&&0<a.Gd.length){a.Gd.forEach(function(c){var d=yA(a.Jc,c.configurationId);c.offset=d?d.pb():0});var b=a.Gd.sort(function(c,d){return(c.offset||0)-(d.offset||0)});uB(a.I,b);a.Gd=[]}};uF=function(a){var b,c;return _.E(function(d){if(1==d.a)return pF(a),_.x(d,qF(a),2);rF(a);b=_.Vj(4)||_.Vj(5);if(!b)return d.F(0);c=a.getSurface().getMedia();sF(a,c);return _.x(d,tF(a,c),0)})};
164
+ BF=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g,h;return _.E(function(l){switch(l.a){case 1:return d=Date.now()/1E3,e=new _.Oj,a.j.a=e,_.A(l,2),pF(a),_.x(l,vF(a),4);case 4:return CD(a.j,e),a.Z=_.Bp(b),a.configuration=_.bm(a.Ic,b),a.log.info(_.wb,a.configuration),a.log.info(_.Mb,a.Z),_.x(l,wF(a,e),5);case 5:return CD(a.j,e),_.x(l,xF(a,b,a.getSourceIndex(),e,!1),6);case 6:return f=l.f,CD(a.j,e),a.A=f.parser,a.f=f.manifest,g=a,_.x(l,yF(a,a.f,a.configuration.drm),7);case 7:g.w=l.f;CD(a.j,e);if(!c){l.F(8);
165
+ break}return _.x(l,zF(a,e),9);case 9:CD(a.j,e),a.o.one(a.h,_.Je,function(){var m=Date.now()/1E3-d;a.H&&(a.H.A=m)});case 8:e.resolve();_.oh(l,0);break;case 2:h=_.C(l),AF(a,h,e),_.y(l)}})};AF=function(a,b,c){b=CF(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};CF=function(a,b,c){var d=a.j;return null!=d.a&&d.a===c||b instanceof _.P&&7E3===b.code?b instanceof _.P?b:new _.P(_.Q,7,7003,"Unexpected error.",b):BD(a.j)};vF=function(a){return a.Ca?a.Ca["catch"](function(){}):Promise.resolve()};
166
+ wF=function(a,b){var c;return _.E(function(d){if(1==d.a)return a.H=new _.ep,iF(a,_.vp),a.V=new _.au(a.getNetworkEngine()),AA(a.V,{enabled:a.configuration.abr.useCmsd}),c=DF(a,a.configuration),_.x(d,tF(a,c),2);CD(a.j,b);a.I=new rB;sB(a.I,function(e){EF(a,_.ci,e)});_.y(d)})};
167
+ xF=function(a,b,c,d,e){var f,g,h,l,m;return _.E(function(n){switch(n.a){case 1:return f=b,g=_.Bp(f),h=g[c],_.x(n,FF(a,h),2);case 2:return l=n.f,CD(a.j,d),_.Yn(eA),_.x(n,GF(a,l,h,f.id||""),3);case 3:m=n.f;CD(a.j,d);if(!e||!m.presentationTimeline.o){n.F(4);break}return _.x(n,l.stop(),5);case 5:CD(a.j,d);case 4:return _.Yn("manifest.end"),_.Zn("Fetch and parse manifest",eA,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
168
+ HF=function(a,b){var c,d,e;return _.E(function(f){if(1==f.a)return _.x(f,xF(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,eD(c.manifest)],e=gD(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.P(_.Q,7,7003,"Failed to append load manifest");}})};DF=function(a,b){var c=a.getSurface().getMedia();c.loop=!!b.loop;_.O.R(b.volume)||a.setVolume(b.volume);_.O.R(b.muted)||a.setMuted(b.muted);sF(a,c);return c};
169
+ sF=function(a,b){a.h||(a.o.on(b,_.re,function(){if(a.h.error){var c=a.h.error.code;if(1===c)c=null;else{var d=a.h.error.msExtendedCode;d&&(0>d&&(d+=Math.pow(2,32)),d=d.toString(16));c=new _.P(_.Q,3,3016,{code:c,extendedError:d,message:a.h.error.message})}}else c=null;if(c)a.onError(c)}),a.h=b)};rF=function(a){a.h&&(a.o.off(a.h,_.re),a.h=null)};
170
+ qF=function(a){var b;return _.E(function(c){switch(c.a){case 1:a.G!==IF&&(a.G=eF);if(b=a.h)a.o.off(b,_.Je),a.o.off(b,_.zf),a.o.off(b,_.gf),a.o.off(b,_.qe),a.o.off(b,_.Mf),a.o.off(b,_.Kf);a.I&&(a.I.release(),a.I=null);a.Lc&&(a.Lc.release(),a.Lc=null);a.Gc&&(a.Gc.stop(),a.Gc=null);if(!a.A){c.F(2);break}return _.x(c,a.A.stop(),3);case 3:a.A=null;case 2:a.l&&(a.l.stop(),a.l=null);if(!a.a){c.F(4);break}return _.x(c,a.a.destroy(),5);case 5:a.a=null;case 4:a.B&&(a.B.release(),a.B=null);a.J&&(a.J.release(),
171
+ a.J=null);if(!a.L){c.F(6);break}return _.x(c,a.L.destroy(),7);case 7:a.L=null;case 6:a.Rc&&(a.Rc.release(),a.Rc=null);a.ze&&(a.ze.release(),a.ze=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.w){c.F(8);break}return _.x(c,a.w.destroy(),9);case 9:a.w=null;case 8:a.V&&(a.V.release(),a.V=null),a.T.clear(),a.K=null,a.Be.clear(),a.f=null,a.H=null,a.fa=!0,a.Mc.clear(),a.Kd=!1,a.configuration=a.Ic,JF(a),_.y(c)}})};
172
+ tF=function(a,b){var c,d,e,f,g;return _.E(function(h){if(1==h.a)return c=window.muxjs?new kC:new _.lC,d=_.Yo(a.configuration,[_.xe,"single-native"]),e=d.create(a),f=hF(a),f.track(a),a.Rc=f,g=new _.nC(b,c,e,f,a.configuration),_.x(h,g.open(),2);a.L=g;_.y(h)})};FF=function(a,b){var c,d;return _.E(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.x(e,_.zt(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
173
+ GF=function(a,b,c,d){return(new _.Pj(Promise.resolve().then(function(){var e,f,g;return _.E(function(h){switch(h.a){case 1:e=null;case 2:if(e){h.F(3);break}_.A(h,4);var l=c.url;var m=KF(a,d);l=b.start(l,m);return _.x(h,l,6);case 6:e=h.f;_.oh(h,2);break;case 4:f=_.C(h);if(!a.Hc)throw f;return _.x(h,a.Hc(c.url,f),8);case 8:if(g=h.f)c.url=g;else throw f;h.F(2);break;case 3:if(0===e.periods.length)throw new _.P(_.Q,4,4014);LF(e.periods);return h["return"](e)}})}),function(){a.log.info("Aborting parser step...");
174
+ return b.stop()})).P};
175
+ yF=function(a,b,c){var d,e,f,g,h,l;return _.E(function(m){switch(m.a){case 1:_.Yn("initDrm.start");d=new _.eo({tb:a.getNetworkEngine(),onError:function(n){return a.onError(n)},Kf:function(n){if(a.a){var p=MF(a),q=!1,u=Object.keys(n);0===u.length&&a.log.warn("Got a key status event without any key statuses, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");var v=1===u.length&&"00"===u[0];v&&a.log.warn("Got a synthetic key status event, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");
176
+ if(u.length){u=a.getPeriods();for(var z=0;z<u.length;z++)for(var B=u[z],I=_.t(B.variants),F=I.next();!F.done;F=I.next()){F=F.value;var D=[];F.audio&&D.push(F.audio);F.video&&D.push(F.video);D=_.t(D);for(var G=D.next();!G.done;G=D.next()){G=G.value;var M=F.allowedByKeySystem;if(G.keyId){var N=n[v?"00":G.keyId];N=!!N&&!NF.includes(N);F.allowedByKeySystem=N}M!==F.allowedByKeySystem&&(N=G.type,G.type===_.Fg&&(N="video "+G.width+"x"+G.height+"@"+_.R.df(G.bandwidth)),a.log.warn("DRM Key not available for KID: '"+
177
+ (G.keyId+"'. Applying restrictions to "+N)));B===p&&M!==F.allowedByKeySystem&&(q=!0)}}}if(n=gE(a.a)){v=iE(a.a);u=jE(a.a);a:{z=n.variants;for(B=0;B<z.length;B++)if(z[B].audio===v&&z[B].video===u){v=z[B];break a}v=null}if(!v||v.allowedByKeySystem)a.log.info(Nz),OF(a),PF(a,n.variants)}q&&n!==p&&(a.log.info(Nz),OF(a),PF(a,p.variants))}},Jf:function(n,p){a.trigger(new _.L(_.he,{expirationTime:p}))},onEvent:function(n){return a.lf(n)},getConfiguration:function(){return a.getConfiguration()},Vc:function(){return a.Vc()}});
178
+ e=_.xm(c);d.h=e;f=c?c.offlineId||"":"";g=[];h=_.qt(b.periods);if(!f){m.F(2);break}l=_.fm(_.hf);if(!l){m.F(2);break}return _.x(m,l.l(a,h),4);case 4:return _.x(m,l.j(f),5);case 5:g=m.f;case 2:return _.x(m,_.jo(d,h,g),6);case 6:return a.w=d,QF(a,b.periods),_.Yn("initDrm.end"),_.Zn("Init DRM","initDrm.start","initDrm.end"),m["return"](d)}})};
179
+ zF=function(a,b){var c,d,e,f,g,h,l,m,n,p,q;return _.E(function(u){if(1==u.a)return c=a.h,RF(a,c),SF(a,a.f.periods),a.Cc=new KD(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio),a.Bd=a.configuration.preferredTextLanguage,a.xe=a.configuration.preferredTextRole,a.yd=a.configuration.preferForcedSubtitles,_.x(u,_.wo(a.w,c),2);if(3!=u.a)return CD(a.j,b),d=new _.yD,d.configure(a.configuration.abr),
180
+ a.l=d,null!==a.V&&d.setCmsdManager(a.V),d.init(function(v,z,B){!a.fa&&TF(a,v,z,B)}),a.B=UF(a,c,a.configuration.startTime),a.Lc=VF(a),a.J=new WD({gh:function(){return c.playbackRate},Jm:function(v){c.playbackRate=v},ml:function(v){c.currentTime+=v}}),XD(a.J,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.ze=new TD(a)),e=Math.max(1E-4,a.configuration.streaming.rebufferingGoal),WF(a,e),NC(a.f,_.gi(a.configuration.preferredVideoCodec),_.gi(a.configuration.preferredAudioCodec),
181
+ a.configuration.preferredAudioChannelCount),f=XF(a),f.h=a.configuration.streaming,a.a=f,a.G=fF,_.x(u,f.start(),3);CD(a.j,b);a.configuration.streaming.startAtSegmentBoundary&&(g=XB(a.B),h=YF(a,g),QB(a.B.f,h));l=_.t(a.f.periods);for(m=l.next();!m.done;m=l.next())n=m.value,ZF(a,n);OF(a);p=MF(a)||a.f.periods[0];q=p.variants.some(function(v){return v.primary});a.configuration.preferredAudioLanguage||q||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");PF(a,
182
+ p.variants);_.y(u)})};RF=function(a,b){function c(d){a.h&&a.K&&(d.type===_.Yf&&a.Od?(a.K.a=QD,JF(a)):d.type===_.Ng&&a.getState()===_.xp&&.1>a.getBufferInfo().La(a.getMediaPosition())?(a.K.a=QD,JF(a)):a.K&&$F(a));aG(a)}a.o.on(b,_.zf,c);a.o.on(b,_.gf,c);a.o.on(b,_.qe,c);a.o.on(b,_.Yf,c);a.o.on(b,_.Xf,c);a.o.on(b,_.Kf,c);a.o.on(b,_.Ng,c);a.o.on(b,_.Mf,function(){if(a.h){var d=a.h.playbackRate;0!==d&&a.J.set(d)}})};
183
+ LF=function(a){function b(d){return d.video&&d.audio||d.video&&d.video.codecs.includes(",")}if(a.some(function(d){return d.variants.some(b)})){_.Hh("Found variant with audio and video content, so filtering out audio-only content in all periods.");a=_.t(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.variants=c.variants.filter(b)}};UF=function(a,b,c){return new VB(b,a.f,a.configuration.streaming,c,function(d){a.Lc&&ZB(a.Lc,!0,d);a.a&&xE(a.a)},function(d){return a.dispatchEvent(d)},a.ea===_.Jb)};
184
+ VF=function(a){var b=new $B(a.h),c=new UD(a.f);VD(c,function(){OF(a)});b.a.add(c);a.I&&(c=new bC(a.I),cC(c,function(d){d.De&&d.De();EF(a,_.ei,d)},function(d){d.If&&d.If();EF(a,_.fi,d)},function(d,e){e||(d.De&&d.De(),EF(a,_.ei,d),d.If&&d.If(),EF(a,_.fi,d))}),b.a.add(c));a.ea===_.Jb&&(c=new wB(a.Jc,a.Nd,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.Fe=c);return b};WF=function(a,b){a.K=new RD(b,Math.min(.5,b/2));a.K.a=QD;JF(a);a.Gc=(new _.Vk(function(){$F(a)})).kb(.25)};
185
+ $F=function(a){switch(a.G){case fF:a:if(a.h.ended||uC(a.L))var b=!0;else{if(a.isLive()){b=mB(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.Ea(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.L){var d=wC(a.L);c=d.video;d=d.audio;var e=a.h.currentTime;c&&d?(c=c.La(e),d=d.La(e),c=Math.min(c,d)):c=c?c.La(e):d?d.La(e):0}else c=0;if(d=a.K){d=a.K;var f=b,g=d.f.get(d.a);e=d.a;c=f||c>=g?PD:QD;d.a=c;d=e!==c}c=d;d=bG(a);c||a.getState()===_.op&&!d?(a.log.debug("Buffering state changed. Is buffering",
186
+ d,"buffered to end",b,"state",a.getState()),JF(a)):a.Kd&&aG(a)};XF=function(a){var b={configuration:{bl:a.ea===_.Jb},Db:function(){return XB(a.B)},W:a.L,tb:a.getNetworkEngine(),Hf:a.xj.bind(a),Gf:a.wj.bind(a),onError:a.onError.bind(a),Fh:a.Jl.bind(a),onEvent:a.lf.bind(a),Jh:a.Zm.bind(a),Ee:a.Wl.bind(a),uf:function(){return a.l},ef:a.Ii.bind(a),ei:a.Qm.bind(a),vd:a.w};return new _.eE(a.f,b)};
187
+ rD=function(a){if(a.f&&a.B){var b=cG(a),c=[];a=_.t(dG(a));for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=TC(d);e.active=d===b;c.push(e)}return c}return[]};pD=function(a,b){if(a.f&&a.a){var c=MF(a),d=c.textStreams.find(function(e){return e.id===b.id});d?(eG(a,c,d,!1),fG(a,d),a.Bd=d.language,a.yd=d.kind===_.se):a.log.error(_.Rz,b.id)}};
188
+ sD=function(a,b,c){var d=void 0===d?0:d;if(a.f&&a.a){var e=MF(a);if(a.configuration.abr.enabled&&b)a.log.info("Disable ABR and enable manual track selection to select "+(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.l.disable();else if(!a.configuration.abr.enabled&&!b){a.log.info("Enable ABR Selection");a.configuration.abr.enabled=!0;a.l.enable();a.$=null;c=PF(a,e.variants);null!=a.Ob&&(a.Cc=a.Ob,a.Ob=null);null==c||a.fa||TF(a,c);return}if(b){a.$=b.id;var f=e.variants.find(function(g){return g.id===
189
+ b.id});f?(a.$=f.video.id,VC(f)?(gG(a,e,f,!1),hG(a,f,c,d),null==a.Ob&&(a.Ob=a.Cc),a.Cc=new LD(f),PF(a,e.variants)):a.log.error("Unable to switch to restricted track",b.id)):a.log.error("No variant with id",b.id)}else a.$=null,null!=a.Ob&&(a.Cc=a.Ob,a.Ob=null),c=PF(a,e.variants),null==c||a.fa||TF(a,c)}};
190
+ qD=function(a,b){if(a.configuration.streaming.disableAudioTracks)Promise.reject(Error("Audio tracks are disabled by config."));else{if(a.a&&(a.f||a.B)){var c=jE(a.a),d=iE(a.a),e=TA(a.f.periods,XB(a.B)),f=a.f.periods[e?a.f.periods.indexOf(e):0].variants.filter(function(m){return m.audio.id===b&&VC(m)});e=!1;var g=void 0;if(c){if(g=f.find(function(m){return m.video.id===c.id}),!g){a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId");e=!0;var h=a.getTrackManager().Ha();
191
+ if(h){var l=h.renditions.map(function(m){return m.id});g=f.find(function(m){return l.find(function(n){return n===String(m.video.id)})})}}}else g=f[0];if(g){if(d.codecs.split(".")[0]===g.audio.codecs.split(".")[0]){d=g.audio;a.Kc=d.id;a.l.setVariants(f);f=MF(a);gG(a,f,g,!1);e||a.fa?hG(a,g,!0,0):_.sE(a.a,d,!0,0);Promise.resolve();return}a.log.warn("Target audio codecs not compatible with active audio codecs.")}}Promise.reject()}};
192
+ tD=function(a){var b=a.cg;return a.f?a.L.getTextDisplayer().isTextVisible():b};oD=function(a,b){var c,d,e,f;return _.E(function(g){c=a.cg;d=b;if(c===d)return g["return"]();a.cg=d;if(a.G!==fF)return g.F(0);a.L.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.F(0);if(!b)return rE(a.a),g.F(0);e=MF(a);f=_.XC(e.textStreams,a.Bd,a.xe,a.yd);return 0<f.length?_.x(g,oE(a.a,f[0]),0):g.F(0)})};
193
+ gG=function(a,b,c,d){var e=a.getTrackManager();a.A&&a.A.setCurrentVariant(c);if(e){var f=a.H.B;if(c.video){wD(e,c.video,d);var g=e.ma();f.j!==g&&(f.j=g,f.a.push({timestamp:Date.now()/1E3,id:g.id,trackId:g.track.id,type:g.track.type,fromAdaptation:d,width:g.width,height:g.height,bandwidth:g.bandwidth}))}c.audio&&(wD(e,c.audio,d),e=e.Oa(),f.f!==e&&(f.f=e,f.a.push({timestamp:Date.now()/1E3,id:e.id,trackId:e.track.id,type:e.track.type,fromAdaptation:d,width:null,height:null,bandwidth:e.bandwidth})))}FD(a.T,
194
+ b).variant=c};eG=function(a,b,c,d){FD(a.T,b).text=c;if(b=a.getTrackManager())wD(b,c,d),c=b.Ga(),a=a.H.B,a.h!==c&&(a.h=c,a.a.push({timestamp:Date.now()/1E3,id:c.id,trackId:c.track.id,type:c.track.type,fromAdaptation:d,width:null,height:null,bandwidth:null}))};iG=function(a){return a.ea===_.Jb&&"flat"===a.configuration.playlist.timeline};
195
+ SF=function(a,b){for(var c=0;c<b.length;c++){for(var d=b[c],e=new Map,f=_.t(d.variants),g=f.next();!g.done;g=f.next())if(g=g.value,g.video&&g.video.closedCaptions){g=g.video;for(var h=_.t(g.closedCaptions.keys()),l=h.next();!l.done;l=h.next())if(l=l.value,!e.has(l)){var m={id:a.mi++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,wa:0,mimeType:_.Tc,codecs:"",kind:_.pd,encrypted:!1,
196
+ keyId:null,language:g.closedCaptions.get(l),label:null,type:_.Ri,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:g.roles,channelsCount:null,spatialAudio:!1,closedCaptions:null};e.set(l,m)}}e=_.t(e.values());for(f=e.next();!f.done;f=e.next())d.textStreams.push(f.value)}};
197
+ QF=function(a,b){for(var c=a.a?iE(a.a):null,d=a.a?jE(a.a):null,e=_.t(b),f=e.next();!f.done;f=e.next())SC(a.w,c,d,f.value);c=HA(b,function(h){return h.variants.some(VC)});if(a.configuration.streaming.disableAudioTracks)for(d=_.t(b),e=d.next();!e.done;e=d.next())for(f=_.t(e.value.variants),e=f.next();!e.done;e=f.next())delete e.value.audio;if(a.configuration.streaming.disableVideoTracks)for(d=_.t(b),e=d.next();!e.done;e=d.next())for(f=_.t(e.value.variants),e=f.next();!e.done;e=f.next()){e=e.value;var g=
198
+ e.video;g&&!IA(g.type,_.Rk(g.mimeType,g.codecs))&&delete e.video}if(0===c)throw new _.P(_.Q,4,4032);if(c<b.length)throw new _.P(_.Q,4,4011);c=_.t(b);for(e=c.next();!e.done;e=c.next())d=e.value,PC(d.variants,a.configuration.restrictions,a.li)&&a.a&&MF(a)===d&&OF(a),jG(a,d.variants)};
199
+ ZF=function(a,b){var c=a.a?iE(a.a):null,d=a.a?jE(a.a):null;SC(a.w,c,d,b);d=b.variants;if(!d.some(VC))throw new _.P(_.Q,4,4011);jG(a,b.variants);PC(d,a.configuration.restrictions,a.li)&&a.a&&MF(a)===b&&OF(a);if(!_.Vj(2)&&(c=a.w?a.w.getDrmInfo():null)){d=_.t(d);for(var e=d.next();!e.done;e=d.next()){e=_.t(e.value.drmInfos);for(var f=e.next();!f.done;f=e.next())if(f=f.value,f.keySystem===c.keySystem){f=_.t(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.zo(a.w,g.keyId,g.initData)||
200
+ _.qo(a.w,g.initDataType,g.initData,g.keyId)}}}};hG=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.fa?(a.Ka=b,a.ki=c,a.ji=d):tE(a.a,b,c,d)};fG=function(a,b){a.fa?a.ia=b:_.sE(a.a,b,!0,0)};kG=function(a){if(a.a&&a.f){var b=gE(a.a),c=MF(a);null!=b&&b===c&&(iE(a.a),jE(a.a),_.hE(a.a,_.Ri),FD(a.T,c),FD(a.T,c))}};
201
+ YF=function(a,b){function c(g,h){if(!g)return null;var l=g.findSegmentPosition(h-f.startTime);return null==l?null:(l=g.getSegmentReference(l))?l.startTime+f.startTime:null}var d=iE(a.a),e=jE(a.a),f=MF(a);d=c(d,b);e=c(e,b);return null!=e&&null!=d?Math.max(e,d):null!=e?e:null!=d?d:b};bG=function(a){return a.w&&a.w.D?!0:a.K?a.K.getState()===QD:!1};
202
+ JF=function(a){if(a.H&&a.K&&a.B){var b=lG(a)===_.op,c=a.J;c.l=b;$D(c,c.o?"seek":void 0);a.B.j.o=b;aG(a);a.Fe&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.Fe,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.L(_.Tf))))}};aG=function(a){iF(a,lG(a))};lG=function(a){if(a.Od)var b=!1;else if(a.h&&a.h.ended)b=!0;else{b=a.getMediaDuration();var c=a.getMediaPosition();b=a.Kd&&0<=c&&b<=c?!0:!1}return b?_.qp:bG(a)||a.Od?_.op:a.h&&a.h.paused?_.wp:_.xp};
203
+ PF=function(a,b){try{jG(a,b)}catch(e){return a.onError(e),null}var c=b.filter(function(e){return VC(e)});c=aD(c,a.Kc);var d=a.Cc.create(c);d=Array.from(d.values());a.l.setVariants(d);if(null!==a.$&&null!==a.Kc&&(d=d.find(function(e){return e.video.id===a.$&&e.audio.id===a.Kc}),a.$=null,d))return d;if(a.configuration.abr.enabled||null===a.$)return a.l.chooseVariant();c=c.find(function(e){return null!==e.video&&e.video.id===a.$});return c?c:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
204
+ a.l.chooseVariant())};mG=function(a,b){return _.XC(b,a.Bd,a.xe,a.yd)[0]||null};oG=function(a,b,c){c=void 0===c?!0:c;var d=PF(a,b.variants);a.Kc=d&&d.audio&&d.audio.id;d&&(gG(a,b,d,!0),hG(a,d,c));(c=mG(a,b.textStreams))&&(a.configuration.streaming.alwaysStreamText||tD(a))&&(eG(a,b,c,!0),fG(a,c))};
205
+ LG=function(a,b){a.fa=!0;a.l.disable();a.log.debug("Choosing new streams after period changed");var c=PF(a,b.variants),d=mG(a,b.textStreams);a.Ka&&(b.variants.includes(a.Ka)&&(c=a.Ka),a.Ka=null);a.ia&&(b.textStreams.includes(a.ia)&&(d=a.ia),a.ia=null);c&&pG(a,b,function(){return gG(a,b,c,!0)});d&&(a.configuration.streaming.alwaysStreamText||tD(a))&&pG(a,b,function(){return eG(a,b,d,!0)});b===MF(a)&&KG(a);return a.configuration.streaming.alwaysStreamText||tD(a)?{variant:c,text:d}:{variant:c,text:null}};
206
+ TF=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;if(a.configuration.abr.enabled){a.log.debug("switch_");var e=MG(a,b);pG(a,e,function(){return gG(a,e,b,!0)});e===MF(a)&&KG(a);a.a&&tE(a.a,b,c,d)}};OF=function(a){var b=a.getTrackManager();b&&a.G!==IF&&(b.m&&(vD(b),b.m.trigger(new _.L(_.Zu))),KG(a))};KG=function(a){var b=MF(a);if(b){var c=a.Mc.get(b)||[];for(a.Mc["delete"](b);c.length;)c.shift()()}};pG=function(a,b,c){a.Mc.has(b)||a.Mc.set(b,[]);a.Mc.get(b).push(c)};
207
+ EF=function(a,b,c){a.trigger(new _.L(b,{detail:qB(c,iG(a))}))};
208
+ jG=function(a,b){var c=a.w?_.O.ng(a.w.fa):{},d=Object.keys(c);d=d.length&&"00"===d[0];for(var e=!1,f=!1,g=[],h=[],l=_.t(b),m=l.next();!m.done;m=l.next()){m=m.value;var n=[];m.audio&&n.push(m.audio);m.video&&n.push(m.video);n=_.t(n);for(var p=n.next();!p.done;p=n.next())if(p=p.value,p.keyId){var q=c[d?"00":p.keyId];q?NF.includes(q)&&(h.includes(q)||h.push(q)):g.includes(p.keyId)||g.push(p.keyId)}m.allowedByApplication?m.allowedByKeySystem&&(e=!0):f=!0}if(!e)throw new _.P(_.Q,4,4012,{hasAppRestrictions:f,
209
+ missingKeys:g,restrictedKeyStatuses:h});};dG=function(a){var b=MF(a);if(null==b)return[];kG(a);return b.variants.filter(function(c){return VC(c)})};NG=function(a){var b=MF(a);if(null==b)return[];kG(a);return b.textStreams.filter(function(c){return!a.Be.has(c)})};MF=function(a){var b=XB(a.B),c=null;a=_.t(a.f.periods);for(var d=a.next();!d.done;d=a.next())d=d.value,d.startTime<=b&&(c=d);return c};cG=function(a){var b=MF(a);return b&&FD(a.T,b).variant};
210
+ MG=function(a,b){for(var c=_.t(a.f.periods),d=c.next();!d.done;d=c.next())if(d=d.value,d.variants.includes(b))return d;return null};pF=function(a){if(a.G===IF)throw new _.P(_.Q,7,7E3,"Player is destroyed.");};
211
+ OG=function(a,b,c){var d,e,f,g,h,l,m,n,p,q,u,v,z,B,I,F,D,G,M,N;return _.E(function(S){switch(S.a){case 1:return d=_.Ip,_.A(S,2),_.x(S,_.zt(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:e=S.f;e.configure(a.configuration.manifest);var oa=e;var Ba=b.url,$a=KF(a,a.configuration.id||"");oa=oa.start(Ba,$a);return _.x(S,oa,5);case 5:f=S.f;LF(f.periods);if(!f.periods.length)throw new _.P(_.Q,4,4014);return _.x(S,a.A.stop(),6);case 6:a.A=e;g=c.audio&&c.audio.id;
212
+ h=c.video&&c.video.id;a.f.periods=f.periods;l=TA(f.periods,XB(a.B))||f.periods[0];NC(a.f,_.gi(a.configuration.preferredVideoCodec),_.gi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);m=bD(g,h,l.variants);n=mG(a,l.textStreams);PF(a,l.variants);p=m&&m.video;q=m&&m.audio;u=[];v=new Set;z=_.t(l.variants);for(B=z.next();!B.done;B=z.next())I=B.value,I.video&&v.add(I.video),I.audio&&v.add(I.audio);F=a.getNetworkEngine();D=_.t(_.ah(v).concat(_.ah(l.textStreams)));for(G=D.next();!G.done;G=
213
+ D.next())M=G.value,u.push(M.createSegmentIndex(F));return _.x(S,Promise.all(u),7);case 7:FE(a.a,d.AUDIO,q);FE(a.a,d.VIDEO,p);FE(a.a,d.TEXT,n);m&&gG(a,l,m,!1);a.log.info("Switch CDN successful.");_.oh(S,0);break;case 2:N=_.C(S);if(!e){S.F(8);break}return _.x(S,e.stop(),8);case 8:throw N;}})};
214
+ KF=function(a,b){return{networkingEngine:a.getNetworkEngine(),configurationId:b,filterNewPeriod:function(c){return ZF(a,c)},filterAllPeriods:function(c){return QF(a,c)},onTimelineCueAdded:function(c){a.I&&(a.ea===_.Jb?a.Gd.push(c):tB(a.I,c))},onEvent:function(c){return a.lf(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return mF(a,c)},onTurnedStatic:function(){return nF(a)}}};PG=function(){};
215
+ QG=function(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(b){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];c=a.apply(this,c);c.abort=function(){};return c}};RG=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};SG=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};
216
+ TG=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.KA(b)[0]&&a(b)}};
217
+ UG=function(){var a=MediaSource.isTypeSupported,b=/^dv(?:h[e1]|a[v1])\./;MediaSource.isTypeSupported=function(c){var d=c.split(/ *; */),e=d.shift(),f={};d=_.t(d);for(var g=d.next();!g.done;g=d.next())g=g.value.split("\x3d"),f[g[0]]=g[1].replace(/"(.*)"/,"$1");d=f.codecs;if(!d)return a(c);var h=!1,l=!1;c=d.split(",").filter(function(n){b.test(n)&&(l=!0);/^(hev|hvc)1\.2/.test(n)&&(h=!0);return!0});l&&(h=!1);f.codecs=c.join(",");h&&(f.eotf="smpte2084");for(var m in f)e+="; "+m+'\x3d"'+f[m]+'"';return cast.__platform__.canDisplayType(e)}};
218
+ VG=function(a){_.Cu.call(this,a);a=a.getSurface().getMedia();this.a=null;for(var b=0;b<a.textTracks.length;++b){var c=a.textTracks[b];c.mode=_.$d;c.label===Tz&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.lA,Tz));this.a.mode=_.we};WG=function(a,b){var c=a.mode;a.mode=c===_.Zf?_.Zf:_.we;for(var d=a.cues,e=d.length-1;0<=e;e--){var f=d[e];f&&b(f)&&a.removeCue(f)}a.mode=c};XG=function(){};_.bj.prototype.f=nA(0,function(){return this.keyInfo});var qA=[112,115,115,104,0,0,0,0];
219
+ _.DA.prototype.Ed=function(){return this.ja?this.ja-this.va+1:null};_.DA.prototype.f=function(){return this.keyInfo};_.ZG=function YG(a){var c,d,e,f,g,h;return _.wh(YG,function(l){1==l.a&&(c=-1,e=d=void 0,f=_.t(a),g=f.next());if(5!=l.a){if(g.done)return-1===c?l.F(0):_.x(l,{lh:c,um:d,item:e,next:void 0},0);h=g.value;return 0<=c?_.x(l,{lh:c,item:e,um:d,next:h},5):l.F(5)}c++;d=e;e=h;g=f.next();return l.F(2)})};_.r=_.NA.prototype;
220
+ _.r.track=function(a){null!=this.player&&PA(this);a&&(this.player=a,this.player.on(_.Rf,this.Oc,this))};_.r.release=function(){PA(this);this.S=[];this.f=this.h=null};
221
+ _.r.append=function(a,b,c){var d=this.h?this.h(c):null;d||this.log.debug("Unable to resolve rendition for id",c);c={start:a,end:b,rendition:d,width:d?d.width:0,height:d?d.height:0,bandwidth:d?d.bandwidth:0};var e=this.S.find(function(f){return f.start>=a&&f.end<=b});if(e)e.rendition=d,e.width=c.width,e.height=c.height,e.bandwidth=c.bandwidth,e.start=c.start,e.end=c.end;else{d=_.t(this.S);for(e=d.next();!e.done;e=d.next())e=e.value,a>=e.start&&a<e.end?e.end=a:b>=e.start&&b<e.end&&(e.start=b);this.S.push(c);
222
+ this.S.sort(MA)}RA(this);this.Oc();this.player&&this.player.trigger(new _.L(_.Ig))};_.r.clear=function(){this.S=[];RA(this);this.player&&(this.player.trigger(new _.L(_.Ig)),this.player.trigger(new _.L(_.hd)))};
223
+ _.r.Oc=function(){if(this.player){var a=this.player.getMediaPosition();if(0<=a){a:{for(var b=this.S.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.S[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.S[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.S[0].rendition:null}if(a&&this.f!==a&&(this.f=a,this.player)){c=b=-1;if(a)b=a.width||-1,c=a.height||-1;else if(d=this.player.getSurface().getMedia())b=d.videoWidth,c=d.videoHeight;this.player.trigger(new _.L(_.jd,
224
+ {detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};bB.prototype.pb=function(){return this.h};bB.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.r=_.dB.prototype;_.r.nc=function(){return this.J};_.r.getDuration=function(){return 2===this.j.version?this.a.getDuration():this.f};_.r.getPresentationStartTime=function(){return this.D};_.r.offset=function(a){null!=this.w&&(this.w+=a);null!=this.l&&(this.l+=a)};
225
+ _.r.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.o};_.r.Md=function(){return!this.o};rB.prototype.release=function(){this.f=function(){};this.a.clear()};rB.prototype.cues=function(){return this.a};wB.prototype.release=function(){this.f=this.j=this.h=this.a=null};wB.prototype.l=function(a){zA(this.a,a);xB(this)};
226
+ yB.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.Qa().length&&this.f===a.a.length&&(this.a+=1,this.f=0)):(this.a+=1,this.f=0);a=zB(this);return{value:a,done:!a}};_.r=_.AB.prototype;_.r.destroy=function(){this.a=[];return Promise.resolve()};
227
+ _.r.Pc=function(a){for(var b=this.a.length-1;0<=b;--b){var c=this.a[b];if(a>=c.startTime&&a<c.endTime)return c.position}if(this.a.length&&a<this.a[0].startTime)return this.a[0].position;this.g.warn("No Segment found for "+a+". We have "+this.a.length+" references");for(a=0;a<this.a.length;a++)b=this.a[a],this.g.debug("SegmentIndex Ref "+a+" start: "+b.startTime+" end: "+b.endTime+" pos: "+b.position);return null};
228
+ _.r.get=function(a){if(0===this.a.length)return null;a-=this.a[0].position;return 0>a||a>=this.a.length?null:this.a[a]};_.r.offset=function(a){this.g.info("Apply offset"+a+" to segment index");for(var b=_.t(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.wa-=a};
229
+ _.r.md=function(a,b){var c=a-this.a[0].position;if(0<=c&&c<this.a.length)for(this.g.warn("Accounting for segment duration drift",b,"at",c),this.a[c].endTime+=b,c+=1;c<this.a.length;++c)this.a[c].startTime+=b,this.a[c].endTime+=b};_.r.getDuration=function(){return this.a[this.a.length-1].endTime-this.a[0].startTime};
230
+ _.r.na=function(a){for(var b=[],c=[],d=0,e=0;d<this.a.length&&e<a.length;){var f=this.a[d],g=a[e];f.startTime<g.startTime?(b.push(f),d++):(f.startTime>g.startTime?0===d?c.push(g):this.g.info("Refusing to rewrite original references on update!"):(.1<Math.abs(f.endTime-g.endTime)?(f=new _.bj(f.position,g.startTime,g.endTime,g.Qa,g.va,g.ja,g.wa,g.keyInfo,g.Sc,g.timescale,g.horizontalTiles,g.verticalTiles,g.durationPerTile),b.push(f)):b.push(f),d++),e++)}for(;d<this.a.length;)b.push(this.a[d++]);if(b.length)for(d=
231
+ b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.bj(d++,f.startTime,f.endTime,f.Qa,f.va,f.ja,f.wa,f.keyInfo,f.Sc,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile),b.push(f);else b=a;a=b;if(c.length&&b.length){a=[];e=b[0].position;d=c.length;c=_.t(c);for(f=c.next();!f.done;f=c.next())f=f.value,a.push(new _.bj(e-d--,f.startTime,f.endTime,f.Qa,f.va,f.ja,f.wa,f.keyInfo,f.Sc,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile));b=_.t(b);for(f=b.next();!f.done;f=b.next())a.push(f.value)}this.a=
232
+ a};_.r.replace=function(a){this.a=a};FB.prototype.release=function(){this.h=null;this.f=function(){}};JB.prototype.release=function(){this.h&&(this.h.release(),this.h=null);null!=this.w&&(this.w.stop(),this.w=null);this.f&&(this.f.release(),this.f=null);this.a=this.H=this.G=null;this.o=!1};JB.prototype.Ee=function(){this.A=!0;IB(this)};KB.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
233
+ OB.prototype.release=function(){this.f&&(this.f.release(),this.f=null);null!=this.h&&(this.h.release(),this.h=null);this.j=function(){};this.a=null;this.o=function(){};this.w=!1};VB.prototype.release=function(){this.f&&(this.f.release(),this.f=null);this.j&&(this.j.release(),this.j=null);this.o&&(this.o.stop(),this.o=null);this.h=this.f=this.a=this.l=null;this.A=function(){}};$B.prototype.release=function(){this.h.stop();for(var a=_.t(this.a),b=a.next();!b.done;b=a.next())b.value.release();this.a.clear()};
234
+ bC.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};bC.prototype.l=function(a,b,c){if(this.j)for(var d={},e=_.t(this.j.cues()),f=e.next();!f.done;d={We:d.We,ae:d.ae},f=e.next()){f=f.value;d.We=this.o.get(f)||null;d.ae=aC(f,a);this.o.set(f,d.ae);var g=this.w.find(function(h){return function(l){return l.Bc===h.We&&l.Ac===h.ae}}(d));g&&g.oc(f,b&&0===c)}};_.$G=0;_.r=fC.prototype;
235
+ _.r.destroy=function(){this.h=this.w=null;this.o.clear();return Promise.resolve()};_.r.remove=function(a,b){var c=this;return Promise.resolve().then(function(){!c.h||!c.h.remove(a,b)||null==c.a||b<=c.a||a>=c.f||(a<=c.a&&b>=c.f?c.a=c.f=null:a<=c.a&&b<c.f?c.a=b:a>c.a&&b>=c.f&&(c.f=a))})};_.r.xb=function(){return this.a};_.r.Ea=function(){return this.f};_.r.qc=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.r.La=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};
236
+ kC.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.lj(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a);this.a.init()};kC.prototype.h=function(a,b){var c=_.lj(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};kC.prototype.f=function(){this.a.resetCaptionStream()};_.lC.prototype.init=function(){};_.lC.prototype.h=function(){};_.lC.prototype.f=function(){};_.r=_.nC.prototype;
237
+ _.r.destroy=function(){var a=this;this.I=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](BA));for(e=1;e<d.length;++e)d[e].p["catch"](BA),d[e].p.reject()}this.a&&b.push(this.a.destroy());this.B&&b.push(this.B.destroy());for(var f in this.w)this.w[f].destroy(),delete this.w[f];return Promise.all(b).then(function(){a.l&&(a.l.release(),a.l=null);a.j&&(a.j.removeAttribute("src"),a.j.load(),a.j=null);a.A="";a.o=null;a.a=null;a.B=null;a.f={};a.w={};a.G=
238
+ {};a.H=null;a.L=!1;for(var g in a.h);a.h={}})};_.r.open=function(){return this.K};_.r.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.E(function(f){if(1==f.a)return e=_.Ip,_.x(f,d.K,2);a.forEach(function(g,h){var l=_.Rk(g.mimeType,g.codecs);if(h===e.TEXT)tC(d,l);else{var m=new Map;m.set(h,l);if((!_.vr(l)||!b||g.keyInfo)&&_.Qk(l,h)){var n=_.Qk(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}rC(d,m)}});_.y(f)})};
239
+ _.r.xb=function(a){return a===_.Ri?this.a.xb():(a=vC(this,a))?a.xb():null};_.r.Ea=function(a){return a===_.Ri?this.a.Ea():(a=vC(this,a))?a.Ea():null};_.r.qc=function(a,b,c){return a===_.Ri?this.a.qc(b):(a=vC(this,a))?a.qc(b,!1,c):!1};_.r.La=function(a,b){if(a===_.Ri)return this.a.La(b);var c=vC(this,a);return c?c.La(b):0};
240
+ _.r.remove=function(a,b,c){var d=this;return a===_.Ri?this.a.remove(b,c):yC(this,a,this.Zh.bind(this,a,b,c)).then(function(){if(a===_.Fg){var e=d.xb(a),f=d.Ea(a);null!==e&&null!==f&&SA(d.D,e,f)}else a===_.bd&&(e=d.D,e.player&&e.player.trigger(new _.L(_.hd)))})};_.r.clear=function(a){if(a===_.Ri){if(!this.a)return Promise.resolve();this.H.f();return this.a.remove(0,Infinity)}return yC(this,a,this.Zh.bind(this,a,0,this.o.duration))};
241
+ _.r.flush=function(a){return a===_.Ri?Promise.resolve():yC(this,a,this.Xg.bind(this,a))};_.r.endOfStream=function(a){var b=this;return EC(this,function(){uC(b)||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.r.getDuration=function(){return this.o.duration};_.r.mf=function(a,b){this.g.debug("Appending data to "+a+Hz);try{this.f[a].appendBuffer(b)}catch(c){throw this.g.warn("Failed to append data for "+a,c),c;}this.g.debug("Done Appending data to "+a+Hz)};
242
+ _.r.Zh=function(a,b,c){if(c<=b)this.cd(a);else{this.g.debug("Removing data from "+a+" range:",b,c);try{this.f[a].remove(b,c)}catch(d){throw this.g.warn("Failed to remove data from "+a+" buffer. Range:",b,c,d),d;}this.g.debug("Done Removing data from "+a+" range:",b,c)}};
243
+ _.r.zi=function(a){try{this.g.debug("Aborting operations for "+a+Hz);var b=this.f[a].appendWindowStart,c=this.f[a].appendWindowEnd;this.f[a].abort();this.f[a].appendWindowStart=b;this.f[a].appendWindowEnd=c}catch(d){throw this.g.warn("Failed to abort operations for "+a+Hz,d),d;}this.g.debug("Done Aborting operations for "+a+Hz);this.cd(a)};
244
+ _.r.Xg=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug("Flushing buffer for "+a),this.j.currentTime-=.001):this.g.warn("Skip buffer flush for "+a+" with element state: "+this.j.readyState)}catch(b){throw this.g.warn("Failed to flush buffer for "+a,b),b;}this.g.debug("Done Flushing buffer for "+a);this.cd(a)};
245
+ _.r.ci=function(a,b){0>b&&(b+=.001);try{this.g.debug("Setting timestamp offset for "+a,b),this.f[a].timestampOffset=b}catch(c){throw this.g.warn("Failed to set timestamp offset for "+a,b,c),c;}this.g.debug("Done Setting timestamp offset for "+a,b);this.cd(a)};
246
+ _.r.Dm=function(a,b,c){try{this.g.debug("Setting append window for "+a,b,c),this.f[a].appendWindowStart=0,this.f[a].appendWindowEnd=c,this.f[a].appendWindowStart=b}catch(d){throw this.g.warn("Failed to set append window for "+a,b,c,d),d;}this.g.debug("Done Setting append window for "+a,b,c);this.cd(a)};_.r.U=function(a){this.h[a][0].p.reject(new _.P(_.Q,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
247
+ _.r.cd=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug("Update-End received for "+a),HC(this,a))};_.r.getTextDisplayer=function(){return this.B};var pC=window.URL.createObjectURL;_.w(iD,_.U);_.r=iD.prototype;_.r.initialize=function(a){this.m=a};_.r.release=function(){this.h=[];this.a.clear();this.f.clear()};_.r.load=function(){};_.r.destroy=function(){this.release();this.m=null};_.r.getVideoTracks=function(){return jD(this,_.jk)};_.r.getAudioTracks=function(){return jD(this,_.ik)};_.r.ha=function(){return jD(this,_.T)};_.r.ma=function(){return this.a.get(_.jk)||null};_.r.Oa=function(){return this.a.get(_.ik)||null};_.r.Ga=function(){return this.a.get(_.T)||null};
248
+ _.r.cb=function(){return this.f.get(_.jk)||null};_.r.mb=function(){return this.f.get(_.ik)||null};_.r.nb=function(){return this.f.get(_.T)||null};_.r.Ha=function(){return kD(this,_.jk)};_.r.la=function(){return kD(this,_.ik)};_.r.ta=function(){return kD(this,_.T)};_.r.jb=function(a){mD(this,_.jk,a)};_.r.xa=function(a){mD(this,_.ik,a)};_.r.Ja=function(a){mD(this,_.T,a)};_.r.Ya=function(a,b){lD(this,_.jk,a,void 0===b?!1:b)};_.r.hb=function(a,b){lD(this,_.ik,a,void 0===b?!1:b)};
249
+ _.r.ib=function(a,b){b=void 0===b?!1:b;var c=a;if(!a){var d=this.Ga();if(d&&d.track.kind!==_.se){var e=this.ha().find(function(g){return g.kind===_.se&&g.language===d.track.language});if(!e){var f=this.la();f&&(e=this.ha().find(function(g){return g.kind===_.se&&g.language===f.language}))}e&&(c=e.renditions[0])}}lD(this,_.T,c,b)};_.r.addTextTrack=function(a){var b=this;return _.E(function(c){return b.m?_.x(c,b.m.addTextTrack(a.url,a.language,a.kind,a.mimeType,a.codec,a.label),0):c.F(0)})};
250
+ _.r.pa=function(){return!!this.m&&this.m.pa()};iD.prototype.isAbrEnabled=iD.prototype.pa;iD.prototype.addTextTrack=iD.prototype.addTextTrack;iD.prototype.setTextRendition=iD.prototype.ib;iD.prototype.setAudioRendition=iD.prototype.hb;iD.prototype.setVideoRendition=iD.prototype.Ya;iD.prototype.setTextTrack=iD.prototype.Ja;iD.prototype.setAudioTrack=iD.prototype.xa;iD.prototype.setVideoTrack=iD.prototype.jb;iD.prototype.getTextTrack=iD.prototype.ta;iD.prototype.getAudioTrack=iD.prototype.la;
251
+ iD.prototype.getVideoTrack=iD.prototype.Ha;iD.prototype.getLoadingTextRendition=iD.prototype.nb;iD.prototype.getLoadingAudioRendition=iD.prototype.mb;iD.prototype.getLoadingVideoRendition=iD.prototype.cb;iD.prototype.getTextRendition=iD.prototype.Ga;iD.prototype.getAudioRendition=iD.prototype.Oa;iD.prototype.getVideoRendition=iD.prototype.ma;iD.prototype.getTextTracks=iD.prototype.ha;iD.prototype.getAudioTracks=iD.prototype.getAudioTracks;iD.prototype.getVideoTracks=iD.prototype.getVideoTracks;_.r=_.yD.prototype;_.r.stop=function(){this.w=null;this.f=!1;this.l=[];this.j=1;this.h=null;this.D=!1};_.r.init=function(a){this.w=a};
252
+ _.r.chooseVariant=function(){var a=zD(!this.D&&this.a.initialRestrictions?this.a.initialRestrictions:this.a.restrictions,this.l),b=this.getBandwidthEstimate();this.l.length&&!a.length&&(this.g.warn("No variants met the ABR restrictions. Choosing a variant by lowest bandwidth."),a=zD(null,this.l),a=[a[0]]);var c=a[0]||null;a=_.t(_.ZG(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.item;var f=isNaN(this.j)||0===this.j?1:Math.abs(this.j),g=f*d.bandwidth,h=g/this.a.bandwidthDowngradeTarget;
253
+ e=f*(e.next||{bandwidth:Infinity}).bandwidth/this.a.bandwidthUpgradeTarget;this.g.debug("Bandwidth ranges:",(g/1E6).toFixed(3),(h/1E6).toFixed(3),(e/1E6).toFixed(3));b>=h&&b<=e&&(c=d)}this.h=Date.now();this.D=!0;return c};_.r.enable=function(){this.f=!0};_.r.disable=function(){this.f=!1};
254
+ _.r.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.f);var c=this.o;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;_.ZA(c.f,e,d);_.ZA(c.h,e,d)}if(null!=this.h&&this.f)a:{this.g.debug("Suggesting Streams...");if(!this.B){if(!(128E3<=this.o.a)){this.g.debug("Still waiting for a good estimate...");break a}this.B=!0;if(this.a.useSwitchIntervalForInitialSwitch&&Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Skipping initial estimation switch due to switch interval...");
255
+ break a}}else if(Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}c=this.chooseVariant();d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.w(c)}};_.r.playbackRateChanged=function(a){this.j=a};_.r.getBandwidthEstimate=function(){var a=this.A&&this.A.bh();a||(a=this.o,a=128E3>a.a?this.a.defaultBandwidthEstimate:Math.min(_.$A(a.f),_.$A(a.h)));return a};
256
+ _.r.setVariants=function(a){this.l=a};_.r.setCmsdManager=function(a){this.A=a};_.r.configure=function(a){this.a=a;this.f=a.enabled};_.r.reset=function(){this.B=!1;this.o=new xD;var a=this.chooseVariant();a&&this.w(a)};DD.prototype.clear=function(){this.a.clear()};GD.prototype.add=function(a){if(JD(this.f,a))return this.a.add(a),!0;_.J("Rejecting variant - not compatible with root.");return!1};GD.prototype.values=function(){return this.a.values()};LD.prototype.create=function(a){var b=this,c=a.filter(function(d){return JD(b.a,d)});return c.length?new GD(c[0],c):this.f.create(a)};
257
+ KD.prototype.create=function(a){var b=MD(a,this.h);0<b.length&&(a=b);b=!1;if(this.a){var c=ND(a,this.a);0<c.length?(a=c,b=!0):_.J("No exact match for preferred variant role could be found. Role: "+this.a)}b||(b=a.filter(function(d){return d.primary}),0<b.length&&(a=b));this.f&&(b=JC(a,this.f),b.length?a=b:_.J("No exact match for the channel count could be found."));b=OD(a,this.j);b.length?a=b:_.J("No exact match for spatial audio could be found.");b=new GD(a[0]);a=_.t(a);for(c=a.next();!c.done;c=
258
+ a.next())c=c.value,JD(b.f,c)&&b.add(c);return b};RD.prototype.getState=function(){return this.a};var QD=0,PD=1;TD.prototype.release=function(){this.f.release()};UD.prototype.release=function(){this.a=this.h=null;this.f=function(){}};UD.prototype.l=function(a){var b=this.a,c=this.h.periods;a=TA(c,a)||c[0];b!==a&&this.f(a);this.a=a};WD.prototype.getConfiguration=function(){return this.j};WD.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};WD.prototype.set=function(a,b){this.h=a;$D(this,b)};var cE=new _.gp(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});var OE;_.r=_.eE.prototype;_.r.destroy=function(){var a=this,b,c,d,e;return _.E(function(f){if(1==f.a){b=[];c=_.t(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,pE(e),b.push(qE(e));return _.x(f,Promise.all(b),2)}a.a.clear();a.o.clear();a.C=null;a.j=null;a.G=null;a.l=null;a.h=null;a.f=!0;_.y(f)})};
259
+ _.r.start=function(){var a=this,b,c,d;return _.E(function(e){if(1==e.a){b=a.C.Db();c=lE(a,b);d=a.C.Hf(fE(a)[c]);if(!d.variant&&!d.text)throw a.g.error("start(): No streams chosen"),new _.P(_.Q,5,5005,"No streams chosen.");a.D=!d.variant&&!!d.text;return _.x(e,JE(a,d.variant?d.variant.audio:null,d.variant?d.variant.video:null,d.text,b),2)}if(a.f)return e["return"]();a.g.debug("init: completed initial Stream setup");a.C&&a.C.Ll&&(a.g.debug("init: calling onInitialStreamsSetup()..."),a.C.Ll());_.y(e)})};
260
+ _.r.resume=function(){if(!BE(this))for(var a=_.t(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,nE(this,b,0)};
261
+ _.r.Hb=function(a){var b=this,c,d,e,f,g,h,l;return _.E(function(m){switch(m.a){case 1:if(b.f)return m["return"]();c=yE(a);if(a.fb||null==a.$a||a.hc)return m["return"]();a.$a=null;if(!a.Mb){m.F(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.x(m,DE(b,a,a.Ne,a.me),3);case 3:return m["return"]();case 2:_.A(m,4);d=NE(b,a);null!=d&&(nE(b,a,d),a.Wc=!1);_.oh(m,5);break;case 4:return e=_.C(m),_.x(m,YE(b,e),6);case 6:return m["return"]();case 5:cF(b,a);if(!CE(b)){m.F(0);break}if(b.C.configuration.bl){b.g.debug("End of stream reached, keeping MediaSource open.");
262
+ f=_.t(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.$a=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.x(m,b.C.W.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.C.W.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.C.Fh();_.y(m)}})};
263
+ _.r.gm=function(a,b,c,d){var e=pA(d.reader),f=pA(d.reader),g=_.W(d.reader),h=_.W(d.reader),l=_.W(d.reader),m=_.W(d.reader);d=_.Mm(d.reader,d.reader.Fa()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"===e)this.C.Jh();else this.C.onEvent(new _.L("emsg",{detail:{startTime:a,endTime:a+l/g,schemeIdUri:e,value:f,timescale:g,presentationTimeDelta:h,eventDuration:l,id:m,messageData:d}}))};
264
+ _.r.$m=function(a){var b=this,c=!1,d=0;(new _.Pm).M(_.Te,_.Qm).M(_.sg,_.Qm).M(_.Oe,_.Qm).M(_.Se,_.Qm).M(_.gg,_.Qm).Y(_.ig,_.Rm).M("encv",function(e){e.reader.skip(78);_.Qm(e)}).M("pasp",function(e){d=e.start+e.headerSize;var f=_.W(e.reader),g=_.W(e.reader);c=f!==g;b.g.debug("hSpacing\x3d"+f+", vSpacing\x3d"+g+", updatePASP\x3d"+c);e.parser.stop()}).parse(a.data);c&&(a=new _.Bm(new DataView(a.data)),a.seek(d),_.V(a,1),_.V(a,1))};OE="iterateSegmentReference";_.aH={ITERATOR:OE,LOOKUP:_.cA};_.w(gF,_.dm);_.r=gF.prototype;_.r.init=function(a,b){var c=a.getMedia();_.dm.prototype.init.call(this,a,b);sF(this,c)};_.r.namespace=function(){return aA};_.r.Ng=function(){return new iD};_.r.getState=function(){return this.gc};_.r.getDrmInfo=function(){return this.w?this.w.getDrmInfo():null};
265
+ _.r.unload=function(){var a=this,b;return _.E(function(c){if(1==c.a){oD(a,!1);a.Kd=!1;if(!a.Z)return c["return"]();a.log.debug("Unload player with source",a.Z);(b=a.getTrackManager())&&b.release();return a.G===IF?c["return"]():_.x(c,uF(a),2)}a.Z=null;a.gg=0;a.Kc=null;a.$=null;_.y(c)})};_.r.release=function(){var a=this;return _.E(function(b){if(a.Ca)return b["return"](a.Ca);a.Ca=jF(a);a.Ca["finally"](function(){a.Ca=null});return b["return"](a.Ca)})};
266
+ _.r.getBufferInfo=function(a){if(this.L){var b=wC(this.L),c=new _.Tl(void 0,a);switch(a){case _.jk:return b.video?b.video:c;case _.ik:return b.audio?b.audio:c;case _.T:return b.text?b.text:c}return b.total?b.total:c}return this.Rc?(b=OA(this.Rc),LA(b,a)):_.dm.prototype.getBufferInfo.call(this,a)};_.r.getPosition=function(){var a=this.Nd,b=this.getMediaPosition();a.a&&(a=a.a,b-=a.f,b=0>b?0:b>a.a?a.a:b);return b};_.r.getMediaPosition=function(){return this.B?XB(this.B):_.dm.prototype.getMediaPosition.call(this)};
267
+ _.r.seek=function(a){var b=this.Nd;b=b.a?a+b.a.pb():a;b!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(b+" s."));return _.dm.prototype.seek.call(this,b)};_.r.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.r.getDuration=function(){var a=this.Nd,b=this.getMediaDuration();return a.a?a.a.getDuration():b};_.r.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};
268
+ _.r.destroy=function(){var a=this;return _.E(function(b){if(1==b.a)return _.x(b,_.dm.prototype.destroy.call(a),2);if(a.G===IF)return b["return"]();a.log.debug("Destroying player...");a.G=IF;rF(a);a.o&&(a.o.release(),a.o=null);a.V&&(a.V.release(),a.V=null);a.Jc=null;_.y(b)})};_.r.getTimeline=function(){return this.Jc};
269
+ _.r.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,u,v;return _.E(function(z){switch(z.a){case 1:return c=new _.Oj,b.j.a=c,_.A(z,2),pF(b),b.ea=_.Jb,_.x(z,vF(b),4);case 4:return CD(b.j,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.Z=_.Bp(d),b.configuration=_.bm(b.Ic,d),b.log.info("Loading playlist configurations",a),b.Jc=kF(b.configuration),_.x(z,wF(b,c),5);case 5:return CD(b.j,c),e=a.map(function(B){return xF(b,B,0,null,!0)}),_.x(z,Promise.all(e),6);
270
+ case 6:f=z.f;g=f.filter(function(B){return B.manifest.presentationTimeline.isLive()});if(h=g[0])b.A=h.parser;if(1<g.length)throw new _.P(_.Q,7,7003,"Playlist of multiple live streams is not supported.");if(h){l=b.configuration.playlist.content;if(l===_.oc)throw new _.P(_.Q,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&h!==f[f.length-1])throw new _.P(_.Q,7,7003,"Wrong order of playlist assets.");}m=null==h;n=new _.dB({version:2},null,0,m);p=f.map(function(B){return eD(B.manifest)});
271
+ q=gD(p,n);b.f=q;u=b;return _.x(z,yF(b,q,b.configuration.drm),7);case 7:return u.w=z.f,CD(b.j,c),_.x(z,zF(b,c),8);case 8:CD(b.j,c);vE(b.a,q);lF(b,q);c.resolve();_.oh(z,0);break;case 2:v=_.C(z);if(!b.A){z.F(9);break}return _.x(z,b.A.stop(),10);case 10:b.A=null;case 9:AF(b,v,c),_.y(z)}})};
272
+ _.r.appendLoad=function(a){var b=this,c;return _.E(function(d){if(1==d.a){pF(b);if(b.ea!==_.Jb)throw new _.P(_.Q,7,7003,"Cannot append-load to non-playlist player.");return _.x(d,HF(b,a),2)}c=d.f;b.f=c.manifest;b.A=c.parser;vE(b.a,c.manifest);CE(b.a)&&b.a.resume();lF(b,c.manifest);_.y(d)})};_.r.seekWith=function(a){return this.seek(this.getPosition()+a)};
273
+ _.r.Ag=function(){var a=this;return _.E(function(b){pF(a);if(!a.He)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.He);a.He=null;return _.x(b,zF(a,null),0)})};_.r.preload=function(a){var b=this;return _.E(function(c){if(1==c.a)return pF(b),_.Yn("preload.start"),b.log.info("Preloading asset",a),_.x(c,BF(b,a,!1),2);b.He=a;b.log.info("Preloaded asset",a);_.Yn("preload.end");_.Zn("preload","preload.start","preload.end");_.y(c)})};
274
+ _.r.load=function(a){return BF(this,a)};_.r.detach=function(){var a=this;return _.E(function(b){if(1==b.a)return _.x(b,qF(a),2);rF(a);_.y(b)})};_.r.isLive=function(){var a;this.f?(a=this.f.presentationTimeline.isLive())||(a=this.f.presentationTimeline,a=Infinity!==a.f&&!a.o):a=!1;return a};_.r.Oh=function(){this.log.debug("User seeking finished");this.K&&$F(this);aG(this)};
275
+ _.r.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:eB(b),end:oB(b)}}b=this.Nd;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.r.nc=function(){return this.f?this.f.presentationTimeline.nc():null};_.r.getPlaybackRate=function(){if(this.J){var a=this.J;a=a.l?0:a.h}else a=0;return a};
276
+ _.r.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G===fF){if(_.Vj()){this.log.warn("Pausing and unpausing to mitigate playbackRate platform issue.");var c=this.getSurface().getMedia();c.pause();this.J.set(a,b);c.play()}else this.J.set(a,b);if((c=this.J.getConfiguration())&&c.preferTrickPlayTracks){c=this.a;var d=1<Math.abs(a),e=c.a.get(_.Fg);if(e){var f=e.stream;if(f)if(c.g.debug("setTrickPlay",d),d)(d=f.trickModeVideo)&&!e.ac&&(c.g.debug("Engaging trick mode stream",
277
+ d),_.sE(c,d,!1,0),e.ac=f);else if(f=e.ac)c.g.debug("Restoring non-trick-mode stream",f),e.ac=null,_.sE(c,f,!0,0)}}this.l.playbackRateChanged(a)}};_.r.ha=function(){if(this.f&&this.B){var a=MF(this);if(null==a)a=null;else{if(!FD(this.T,a).text){var b=_.XC(a.textStreams,this.Bd,this.xe,this.yd);b.length&&(b=b[0],FD(this.T,a).text=b)}a=FD(this.T,a).text}b=[];for(var c=_.t(NG(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=UC(d);e.active=d===a;b.push(e)}return b}return[]};_.r.getPeriods=function(){return this.f.periods};
278
+ _.r.getStats=function(){if(this.G!==fF)return _.fp();aG(this);var a=this.h;if(a.getVideoPlaybackQuality){a=a.getVideoPlaybackQuality();var b=this.H,c=Number(a.totalVideoFrames);b.l=Number(a.droppedVideoFrames);b.j=c}if(this.G===fF){if(a=cG(this))this.H.o=a.bandwidth;a&&a.video&&(b=this.H,c=a.video.height||NaN,b.w=a.video.width||NaN,b.h=c);a=this.l.getBandwidthEstimate();this.H.f=a}return this.H.getStats()};_.r.re=function(){return this.I};
279
+ _.r.getTimelineCues=function(){return this.I?vB(this.I,iG(this)):[]};_.r.resetAbr=function(){this.l&&this.l.reset()};
280
+ _.r.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,u,v,z;return _.E(function(B){if(1==B.a){if(g.G!==fF)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=MF(g);l=_.Ip;m=g.f.periods.indexOf(h);n=m+1;p=n>=g.f.periods.length?g.f.presentationTimeline.getDuration():g.f.periods[n].startTime;q=p-h.startTime;if(Infinity===q)throw new _.P(1,4,4040);u=new _.bj(1,0,q,function(){return[a]},0,null,0);v={id:g.mi++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
281
+ findSegmentPosition:function(){return 1},getSegmentReference:function(I){return 1===I?u:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.cA,initSegmentReference:null,mimeType:d,codecs:e||"",kind:c,encrypted:!1,keyId:null,language:b,originalLanguage:b,label:f||null,type:l.TEXT,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,closedCaptions:null};g.Be.add(v);h.textStreams.push(v);return _.x(B,oE(g.a,v),
282
+ 2)}if(z=_.hE(g.a,_.Ri))FD(g.T,h).text=z;g.Be["delete"](v);g.log.debug("Choosing new streams after adding a text stream");oG(g,h);OF(g);return B["return"](UC(v))})};
283
+ _.r.xj=function(a){this.log.debug(_.fA,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=LG(this,a);this.log.debug("onChooseStreams_, chose variant ",b.variant);this.log.debug("onChooseStreams_, chose text ",b.text);return b}catch(c){return this.onError(c),{variant:null,text:null}}};
284
+ _.r.wj=function(){this.log.debug("canSwitch_");this.fa=!1;this.configuration.abr.enabled&&this.l.enable();this.Ka&&(tE(this.a,this.Ka,this.ki,this.ji),this.Ka=null);this.ia&&(_.sE(this.a,this.ia,!0,0),this.ia=null)};_.r.Zm=function(){this.A&&this.A.update()};_.r.Wl=function(){this.B&&this.B.j.Ee()};
285
+ _.r.Ii=function(a,b,c){if((void 0===c?"":c)===dA)return OF(this),this.pa()||(this.configuration.abr.enabled=!0,this.l.enable()),oG(this,b,!1),!0;if(c=b.variants.some(function(g){var h=!1,l=g[a.type];l&&(h=g.allowedByApplication&&l.id!==a.id,a.type===_.bd&&(h=h&&l.language===a.language));return h})&&this.pa()){for(var d=_.t(b.variants),e=d.next();!e.done;e=d.next()){e=e.value;var f=e[a.type];f&&f.id===a.id&&(e.allowedByApplication=!1)}OF(this);this.pa()||(this.configuration.abr.enabled=!0,this.l.enable());
286
+ oG(this,b)}return c};_.r.Jl=function(){this.log.debug("endOfStream called by streaming engine");this.Kd=!0};_.r.onError=function(a){if(this.G!==IF&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.re,{detail:a});a.severity===_.Q&&iF(this,_.up);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.r.lf=function(a){a.type===_.ke?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Og?JF(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.hc,a.type)))};_.r.pa=function(){return this.configuration.abr.enabled};
287
+ _.r.Qm=function(a){var b=this,c,d,e,f,g,h,l,m;return _.E(function(n){switch(n.a){case 1:if(!b.Hc)return n["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.pa();return _.x(n,b.Hc(c.url,a),2);case 2:e=n.f;if(!e)return n["return"]();f=_.O.na(b.getLoadedSource(),{url:e});d&&b.l.disable();return _.x(n,EE(b.a),3);case 3:g=cG(b);case 4:return h=!1,_.A(n,7),b.log.info("Switching CDN to "+f.url+"."),_.x(n,OG(b,f,g),9);case 9:_.oh(n,6);break;case 7:return l=_.C(n),b.log.info("Switch failed"),
288
+ _.x(n,b.Hc(f.url,a),10);case 10:if(m=n.f)f.url=m,h=!0;else throw l;case 6:h?n.F(4):(d&&b.l.enable(),AE(b.a,!0),b.Z[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.L(_.sd,{newManifest:f.url})),_.y(n))}})};var IF=0,eF=1,fF=2,NF=[_.ff,_.ze];PG.prototype.a=function(){return aA};
289
+ PG.prototype.canPlay=function(a,b){if(_.al())return 0;var c=a.type||"",d=(window.ManagedMediaSource?!0:!1)||(window.MediaSource&&MediaSource.isTypeSupported?!0:!1),e=window.ManagedMediaSource||window.MediaSource&&MediaSource.isTypeSupported?c in _.At||_.Bt(a.url)in _.Ct?!0:!1:!1;if(d&&e){if(_.Vj(2))return 1;if(_.bl()&&c===_.El){if(b.streaming.preferNativeHlsOnSafari)return 1;_.J("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
290
+ PG.prototype.f=function(a){return a===_.pa||a===_.Jb};PG.prototype.create=function(){return new gF};_.Nh(new PG);_.nq(function(){_.Hh("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.Gh("Patching Chromecast MSE bugs."),UG();else if(_.bl()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;SG();10>=a?(_.Gh("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.Gh("Patching Safari 11 \x26 12 MSE bugs."),QG(),RG()):(_.Gh("Patching Safari 13 MSE bugs."),QG())}else _.Vj(2)||_.Vj(3)||
291
+ _.Vj(4)?TG():_.Gh("Using native MSE as-is.");else _.Gh("No MSE implementation available.")});_.w(VG,_.Cu);_.r=VG.prototype;
292
+ _.r.append=function(a){function b(e){if(e.startTime>=e.endTime)_.J("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.R.ag(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.ud}catch(g){f.align="middle"}e.writingMode===_.Dg?f.vertical="lr":e.writingMode===_.Eg&&(f.vertical="rl");e=f}e&&c.push(e)}var c=[],d=_.t(a);for(a=d.next();!a.done;a=d.next())b(a.value);a=c.slice().sort(function(e,f){return e.startTime!==f.startTime?
293
+ e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.t(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.r.remove=function(a,b){if(!this.a)return!1;WG(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.r.isTextVisible=function(){return this.a.mode===_.Zf};_.r.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.Zf:_.we)};_.r.destroy=function(){this.a&&WG(this.a,function(){return!0});this.a=null;return Promise.resolve()};XG.prototype.isSupported=function(){return!0};XG.prototype.create=function(a){return new VG(a)};_.Xo("single-native",new XG);};
279
294
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
280
295
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
281
296
  else{_=this.clpp._;(f.call(g,this));}