baiqiu-cms-decoration-dg 0.2.3 → 0.2.4
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.
@@ -27,4 +27,4 @@ class _n{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width
|
|
27
27
|
/*! @name @videojs/http-streaming @version 3.0.0 @license Apache-2.0 */
|
28
28
|
const xn=m["a"],kn=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,In=e=>bn.log.debug?bn.log.debug.bind(bn,"VHS:",e+" >"):function(){};function An(...e){const t=bn.obj||bn,i=t.merge||t.mergeOptions;return i.apply(t,e)}function Pn(...e){const t=bn.time||bn,i=t.createTimeRanges||t.createTimeRanges;return i.apply(t,e)}const On=1/30,Ln=3*On,Dn=function(e,t){const i=[];let r;if(e&&e.length)for(r=0;r<e.length;r++)t(e.start(r),e.end(r))&&i.push([e.start(r),e.end(r)]);return Pn(i)},Mn=function(e,t){return Dn(e,(function(e,i){return e-Ln<=t&&i+Ln>=t}))},Nn=function(e,t){return Dn(e,(function(e){return e-On>=t}))},Rn=function(e){if(e.length<2)return Pn();const t=[];for(let i=1;i<e.length;i++){const r=e.end(i-1),s=e.start(i);t.push([r,s])}return Pn(t)},Un=function(e,t){let i=null,r=null,s=0;const n=[],a=[];if(!e||!e.length||!t||!t.length)return Pn();let o=e.length;while(o--)n.push({time:e.start(o),type:"start"}),n.push({time:e.end(o),type:"end"});o=t.length;while(o--)n.push({time:t.start(o),type:"start"}),n.push({time:t.end(o),type:"end"});for(n.sort((function(e,t){return e.time-t.time})),o=0;o<n.length;o++)"start"===n[o].type?(s++,2===s&&(i=n[o].time)):"end"===n[o].type&&(s--,1===s&&(r=n[o].time)),null!==i&&null!==r&&(a.push([i,r]),i=null,r=null);return Pn(a)},Bn=e=>{const t=[];if(!e||!e.length)return"";for(let i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},jn=function(e,t,i=1){const r=e.length?e.end(e.length-1):0;return(r-t)/i},Fn=e=>{const t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},qn=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(let i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1},$n=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Hn=function(e,t){let i=0;if(!e||!e.length)return i;for(let r=0;r<e.length;r++){const s=e.start(r),n=e.end(r);t>n||(i+=t>s&&t<=n?n-t:n-s)}return i},zn=(e,t)=>{if(!t.preload)return t.duration;let i=0;return(t.parts||[]).forEach((function(e){i+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(i+=e.partTargetDuration)})),i},Vn=e=>(e.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach((function(r,s){e.push({duration:r.duration,segmentIndex:i,partIndex:s,part:r,segment:t})})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),Gn=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},Wn=({preloadSegment:e})=>{if(!e)return;const{parts:t,preloadHints:i}=e;let r=(i||[]).reduce((e,t)=>e+("PART"===t.type?1:0),0);return r+=t&&t.length?t.length:0,r},Xn=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;const i=Gn(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},Yn=function(e,t){let i=0,r=t-e.mediaSequence,s=e.segments[r];if(s){if("undefined"!==typeof s.start)return{result:s.start,precise:!0};if("undefined"!==typeof s.end)return{result:s.end-s.duration,precise:!0}}while(r--){if(s=e.segments[r],"undefined"!==typeof s.end)return{result:i+s.end,precise:!0};if(i+=zn(e,s),"undefined"!==typeof s.start)return{result:i+s.start,precise:!0}}return{result:i,precise:!1}},Kn=function(e,t){let i,r=0,s=t-e.mediaSequence;for(;s<e.segments.length;s++){if(i=e.segments[s],"undefined"!==typeof i.start)return{result:i.start-r,precise:!0};if(r+=zn(e,i),"undefined"!==typeof i.end)return{result:i.end-r,precise:!0}}return{result:-1,precise:!1}},Jn=function(e,t,i){if("undefined"===typeof t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;const r=Yn(e,t);if(r.precise)return r.result;const s=Kn(e,t);return s.precise?s.result:r.result+i},Qn=function(e,t,i){if(!e)return 0;if("number"!==typeof i&&(i=0),"undefined"===typeof t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return s.a.Infinity}return Jn(e,t,i)},Zn=function({defaultDuration:e,durationList:t,startIndex:i,endIndex:r}){let s=0;if(i>r&&([i,r]=[r,i]),i<0){for(let t=i;t<Math.min(0,r);t++)s+=e;i=0}for(let n=i;n<r;n++)s+=t[n].duration;return s},ea=function(e,t,i,r){if(!e||!e.segments)return null;if(e.endList)return Qn(e);if(null===t)return null;t=t||0;let s=Jn(e,e.mediaSequence+e.segments.length,t);return i&&(r="number"===typeof r?r:Xn(null,e),s-=r),Math.max(0,s)},ta=function(e,t,i){const r=!0,s=t||0,n=ea(e,t,r,i);return null===n?Pn():Pn(s,n)},ia=function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:r,startTime:s,exactManifestTimings:n}){let a=t-s;const o=Vn(e);let l=0;for(let d=0;d<o.length;d++){const e=o[d];if(i===e.segmentIndex&&("number"!==typeof r||"number"!==typeof e.partIndex||r===e.partIndex)){l=d;break}}if(a<0){if(l>0)for(let t=l-1;t>=0;t--){const i=o[t];if(a+=i.duration,n){if(a<0)continue}else if(a+On<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:s-Zn({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let i=l;i<0;i++)if(a-=e.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let d=l;d<o.length;d++){const t=o[d];if(a-=t.duration,n){if(a>0)continue}else if(a-On>=0)continue;return{partIndex:t.partIndex,segmentIndex:t.segmentIndex,startTime:s+Zn({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:d})}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},ra=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},sa=function(e){return e.excludeUntil&&e.excludeUntil===1/0},na=function(e){const t=ra(e);return!e.disabled&&!t},aa=function(e){return e.disabled},oa=function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},la=function(e,t){return t.attributes&&t.attributes[e]},da=function(e,t,i,r=0){if(!la("BANDWIDTH",i))return NaN;const s=e*i.attributes.BANDWIDTH;return(s-8*r)/t},ua=(e,t)=>{if(1===e.playlists.length)return!0;const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(e=>!!na(e)&&(e.attributes.BANDWIDTH||0)<i).length},ca=(e,t)=>!(!e&&!t||!e&&t||e&&!t)&&(e===t||(!(!e.id||!t.id||e.id!==t.id)||(!(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)||!(!e.uri||!t.uri||e.uri!==t.uri)))),ha=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let r=!1;for(const s in i){for(const e in i[s])if(r=t(i[s][e]),r)break;if(r)break}return!!r},pa=e=>{if(!e||!e.playlists||!e.playlists.length){const t=ha(e,e=>e.playlists&&e.playlists.length||e.uri);return t}for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t],r=i.attributes&&i.attributes.CODECS;if(r&&r.split(",").every(e=>Object(b["f"])(e)))continue;const s=ha(e,e=>ca(i,e));if(!s)return!1}return!0};var fa={liveEdgeDelay:Xn,duration:Qn,seekable:ta,getMediaInfoForTime:ia,isEnabled:na,isDisabled:aa,isExcluded:ra,isIncompatible:sa,playlistEnd:ea,isAes:oa,hasAttribute:la,estimateSegmentRequestTime:da,isLowestEnabledRendition:ua,isAudioOnly:pa,playlistMatch:ca,segmentDurationWithParts:zn};const{log:ma}=bn,ga=(e,t)=>`${e}-${t}`,ya=({onwarn:e,oninfo:t,manifestString:i,customTagParsers:r=[],customTagMappers:s=[],llhls:n})=>{const a=new v["a"];e&&a.on("warn",e),t&&a.on("info",t),r.forEach(e=>a.addParser(e)),s.forEach(e=>a.addTagMapper(e)),a.push(i),a.end();const o=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){o.hasOwnProperty(e)&&delete o[e]})),o.segments&&o.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!o.targetDuration){let t=10;o.segments&&o.segments.length&&(t=o.segments.reduce((e,t)=>Math.max(e,t.duration),0)),e&&e("manifest has no targetDuration defaulting to "+t),o.targetDuration=t}const l=Gn(o);if(l.length&&!o.partTargetDuration){const t=l.reduce((e,t)=>Math.max(e,t.duration),0);e&&(e("manifest has no partTargetDuration defaulting to "+t),ma.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=t}return o},va=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(i=>{if(e.mediaGroups[i])for(const r in e.mediaGroups[i])for(const s in e.mediaGroups[i][r]){const n=e.mediaGroups[i][r][s];t(n,i,r,s)}})},ba=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},_a=e=>{let t=e.playlists.length;while(t--){const i=e.playlists[t];ba({playlist:i,id:ga(t,i.uri)}),i.resolvedUri=xn(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||ma.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},Ta=e=>{va(e,t=>{t.uri&&(t.resolvedUri=xn(e.uri,t.uri))})},Sa=(e,t)=>{const i=ga(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:s.a.location.href,resolvedUri:s.a.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return r.playlists[i]=r.playlists[0],r.playlists[t]=r.playlists[0],r},wa=(e,t)=>{e.uri=t;for(let r=0;r<e.playlists.length;r++)if(!e.playlists[r].uri){const t="placeholder-uri-"+r;e.playlists[r].uri=t}const i=pa(e);va(e,(t,r,s,n)=>{const a=`placeholder-uri-${r}-${s}-${n}`;if(!t.playlists||!t.playlists.length){if(i&&"AUDIO"===r&&!t.uri)for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===s)return}t.playlists=[y()({},t)]}t.playlists.forEach((function(t,i){const r=ga(i,a);t.uri?t.resolvedUri=t.resolvedUri||xn(e.uri,t.uri):(t.uri=0===i?a:r,t.resolvedUri=t.uri),t.id=t.id||r,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))}),_a(e),Ta(e)},{EventTarget:Ea}=bn,Ca=(e,t)=>{if(t.endList||!t.serverControl)return e;const i={};if(t.serverControl.canBlockReload){const{preloadSegment:e}=t;let r=t.mediaSequence+t.segments.length;if(e){const s=e.parts||[],n=Wn(t)-1;n>-1&&n!==s.length-1&&(i._HLS_part=n),(n>-1||s.length)&&r--}i._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){const t=new s.a.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){i.hasOwnProperty(e)&&t.searchParams.set(e,i[e])})),e=t.toString()}return e},xa=(e,t)=>{if(!e)return t;const i=An(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(let r=0;r<t.parts.length;r++)e.parts&&e.parts[r]&&(i.parts[r]=An(e.parts[r],t.parts[r]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},ka=(e,t,i)=>{const r=e.slice(),s=t.slice();i=i||0;const n=[];let a;for(let o=0;o<s.length;o++){const e=r[o+i],t=s[o];e?(a=e.map||a,n.push(xa(e,t))):(a&&!t.map&&(t.map=a),n.push(t))}return n},Ia=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=xn(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=xn(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=xn(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=xn(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(e=>{e.resolvedUri||(e.resolvedUri=xn(t,e.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(e=>{e.resolvedUri||(e.resolvedUri=xn(t,e.uri))})},Aa=function(e){const t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(let e=0;e<i.preloadHints.length;e++)if("MAP"===i.preloadHints[e].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},Pa=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,Oa=(e,t,i=Pa)=>{const r=An(e,{}),s=r.playlists[t.id];if(!s)return null;if(i(s,t))return null;t.segments=Aa(t);const n=An(s,t);if(n.preloadSegment&&!t.preloadSegment&&delete n.preloadSegment,s.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}n.segments=ka(s.segments,t.segments,t.mediaSequence-s.mediaSequence)}n.segments.forEach(e=>{Ia(e,n.resolvedUri)});for(let a=0;a<r.playlists.length;a++)r.playlists[a].id===t.id&&(r.playlists[a]=n);return r.playlists[t.id]=n,r.playlists[t.uri]=n,va(e,(e,i,r,s)=>{if(e.playlists)for(let a=0;a<e.playlists.length;a++)t.id===e.playlists[a].id&&(e.playlists[a]=n)}),r},La=(e,t)=>{const i=e.segments||[],r=i[i.length-1],s=r&&r.parts&&r.parts[r.parts.length-1],n=s&&s.duration||r&&r.duration;return t&&n?1e3*n:500*(e.partTargetDuration||e.targetDuration||10)};class Da extends Ea{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=In("PlaylistLoader");const{withCredentials:r=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=r;const s=t.options_;this.customTagParsers=s&&s.customTagParsers||[],this.customTagMappers=s&&s.customTagMappers||[],this.llhls=s&&s.llhls,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;const e=this.media();let t=xn(this.main.uri,e.uri);this.llhls&&(t=Ca(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},(e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,i){const{uri:r,id:s}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[s],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")}parseManifest_({url:e,manifestString:t}){return ya({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:r}){this.request=null,this.state="HAVE_METADATA";const s=t||this.parseManifest_({url:i,manifestString:e});s.lastRequest=Date.now(),ba({playlist:s,uri:i,id:r});const n=Oa(this.main,s);this.targetDuration=s.partTargetDuration||s.targetDuration,this.pendingMedia_=null,n?(this.main=n,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(La(this.media(),!!n)),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),s.a.clearTimeout(this.mediaUpdateTimeout),s.a.clearTimeout(this.finalRenditionTimeout),this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"===typeof e){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(s.a.clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=s.a.setTimeout(this.media.bind(this,e,!1),t))}const i=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(r&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(La(e,!0)),r){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(t,r)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=kn(e.resolvedUri,r),t)return this.playlistRequestError(this.request,e,i);this.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}}pause(){this.mediaUpdateTimeout&&(s.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(s.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=s.a.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},e)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(s.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=s.a.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,"object"===typeof this.src)return this.src.uri||(this.src.uri=s.a.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(e,t)=>{if(!this.request)return;if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.src=kn(this.src,t);const i=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(i)})}srcUri(){return"string"===typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,wa(this.main,this.srcUri()),e.playlists.forEach(e=>{e.segments=Aa(e),e.segments.forEach(t=>{Ia(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||s.a.location.href;this.main=Sa(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}}const{xhr:Ma}=bn,Na=function(e,t,i,r){const s="arraybuffer"===e.responseType?e.response:e.responseText;!t&&s&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=s.byteLength||s.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(s||e.responseText)))),r(t,e)},Ra=function(){const e=function e(t,i){t=An({timeout:45e3},t);const r=e.beforeRequest||bn.Vhs.xhr.beforeRequest;if(r&&"function"===typeof r){const e=r(t);e&&(t=e)}const s=!0===bn.Vhs.xhr.original?Ma:bn.Vhs.xhr,n=s(t,(function(e,t){return Na(n,e,t,i)})),a=n.abort;return n.abort=function(){return n.aborted=!0,a.apply(n,arguments)},n.uri=t.uri,n.requestTime=Date.now(),n};return e.original=!0,e},Ua=function(e){let t;const i=e.offset;return t="bigint"===typeof e.offset||"bigint"===typeof e.length?s.a.BigInt(e.offset)+s.a.BigInt(e.length)-s.a.BigInt(1):e.offset+e.length-1,"bytes="+i+"-"+t},Ba=function(e){const t={};return e.byterange&&(t.Range=Ua(e.byterange)),t},ja=function(e,t){return e.start(t)+"-"+e.end(t)},Fa=function(e,t){const i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},qa=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},$a=function(e){const t={};return Object.keys(e).forEach(i=>{const r=e[i];Object(T["e"])(r)?t[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[i]=r}),t},Ha=function(e){const t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},za=function(e){return e.resolvedUri},Va=e=>{const t=Array.prototype.slice.call(e),i=16;let r,s,n="";for(let a=0;a<t.length/i;a++)r=t.slice(a*i,a*i+i).map(Fa).join(""),s=t.slice(a*i,a*i+i).map(qa).join(""),n+=r+" "+s+"\n";return n},Ga=({bytes:e})=>Va(e),Wa=e=>{let t,i="";for(t=0;t<e.length;t++)i+=ja(e,t)+" ";return i};var Xa=Object.freeze({__proto__:null,createTransferableMessage:$a,initSegmentId:Ha,segmentKeyId:za,hexDump:Va,tagDump:Ga,textRanges:Wa});const Ya=.25,Ka=(e,t)=>{if(!t.dateTimeObject)return null;const i=t.videoTimingInfo.transmuxerPrependedSeconds,r=t.videoTimingInfo.transmuxedPresentationStart,s=r+i,n=e-s;return new Date(t.dateTimeObject.getTime()+1e3*n)},Ja=e=>e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds,Qa=(e,t)=>{let i;try{i=new Date(e)}catch(l){return null}if(!t||!t.segments||0===t.segments.length)return null;let r=t.segments[0];if(i<r.dateTimeObject)return null;for(let d=0;d<t.segments.length-1;d++){r=t.segments[d];const e=t.segments[d+1].dateTimeObject;if(i<e)break}const s=t.segments[t.segments.length-1],n=s.dateTimeObject,a=s.videoTimingInfo?Ja(s.videoTimingInfo):s.duration+s.duration*Ya,o=new Date(n.getTime()+1e3*a);return i>o?null:(i>n&&(r=s),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:fa.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})},Za=(e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let i,r=0;for(let n=0;n<t.segments.length;n++)if(i=t.segments[n],r=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:r+i.duration,e<=r)break;const s=t.segments[t.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>r){if(e>r+s.duration*Ya)return null;i=s}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:r-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},eo=(e,t)=>{let i,r;try{i=new Date(e),r=new Date(t)}catch(a){}const s=i.getTime(),n=r.getTime();return(n-s)/1e3},to=e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++){const i=e.segments[t];if(!i.dateTimeObject)return!1}return!0},io=({playlist:e,time:t,callback:i})=>{if(!i)throw new Error("getProgramTime: callback must be provided");if(!e||void 0===t)return i({message:"getProgramTime: playlist and time must be provided"});const r=Za(t,e);if(!r)return i({message:"valid programTime was not found"});if("estimate"===r.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:r.estimatedStart});const s={mediaSeconds:t},n=Ka(t,r.segment);return n&&(s.programDateTime=n.toISOString()),i(null,s)},ro=({programTime:e,playlist:t,retryCount:i=2,seekTo:r,pauseAfterSeek:s=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if("undefined"===typeof e||!t||!r)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!to(t))return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});const o=Qa(e,t);if(!o)return a({message:e+" was not found in the stream"});const l=o.segment,d=eo(l.dateTimeObject,e);if("estimate"===o.type)return 0===i?a({message:e+" is not buffered yet. Try again"}):(r(o.estimatedStart+d),void n.one("seeked",()=>{ro({programTime:e,playlist:t,retryCount:i-1,seekTo:r,pauseAfterSeek:s,tech:n,callback:a})}));const u=l.start+d,c=()=>a(null,n.currentTime());n.one("seeked",c),s&&n.pause(),r(u)},so=(e,t)=>{if(4===e.readyState)return t()},no=(e,t,i)=>{let r,s=[],n=!1;const a=function(e,t,r,s){return t.abort(),n=!0,i(e,t,r,s)},o=function(e,t){if(n)return;if(e)return a(e,t,"",s);const i=t.responseText.substring(s&&s.byteLength||0,t.responseText.length);if(s=Object(T["d"])(s,Object(T["h"])(i,!0)),r=r||Object(C["a"])(s),s.length<10||r&&s.length<r+2)return so(t,()=>a(e,t,"",s));const o=Object(x["a"])(s);return"ts"===o&&s.length<188||!o&&s.length<376?so(t,()=>a(e,t,"",s)):a(null,t,o,s)},l={uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function({total:t,loaded:i}){return Na(e,null,{statusCode:e.status},o)}))}},d=t(l,(function(e,t){return Na(d,e,t,o)}));return d},{EventTarget:ao}=bn,oo=function(e,t){if(!Pa(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let i=0;i<e.segments.length;i++){const r=e.segments[i],s=t.segments[i];if(r.uri!==s.uri)return!1;if(!r.byterange&&!s.byterange)continue;const n=r.byterange,a=s.byterange;if(n&&!a||!n&&a)return!1;if(n.offset!==a.offset||n.length!==a.length)return!1}return!0},lo=({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:r,previousManifest:s})=>{const n=Object(S["c"])(e,{manifestUri:t,clientOffset:i,sidxMapping:r,previousManifest:s});return wa(n,t),n},uo=(e,t,i)=>{let r=!0,s=An(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let n=0;n<t.playlists.length;n++){const e=t.playlists[n];if(e.sidx){const t=Object(S["b"])(e.sidx);i&&i[t]&&i[t].sidx&&Object(S["a"])(e,i[t].sidx,e.sidx.resolvedUri)}const a=Oa(s,e,oo);a&&(s=a,r=!1)}return va(t,(e,t,i,n)=>{if(e.playlists&&e.playlists.length){const a=e.playlists[0].id,o=Oa(s,e.playlists[0],oo);o&&(s=o,s.mediaGroups[t][i][n].playlists[0]=s.playlists[a],r=!1)}}),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:s},co=(e,t)=>{const i=Boolean(!e.map&&!t.map),r=i||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length);return r&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},ho=(e,t)=>{const i={};for(const r in e){const s=e[r],n=s.sidx;if(n){const e=Object(S["b"])(n);if(!t[e])break;const r=t[e].sidxInfo;co(r,n)&&(i[e]=t[e])}}return i},po=(e,t)=>{const i=ho(e.playlists,t);let r=i;return va(e,(e,i,s,n)=>{if(e.playlists&&e.playlists.length){const i=e.playlists;r=An(r,ho(i,t))}}),r};class fo extends ao{constructor(e,t,i={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:s=!1}=i;if(this.vhs_=t,this.withCredentials=s,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=In("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!==typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){const r=e.sidx&&Object(S["b"])(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r])return void(this.mediaRequest_=s.a.setTimeout(()=>i(!1),0));const n=kn(e.sidx.resolvedUri),a=(s,n)=>{if(this.requestErrored_(s,n,t))return;const a=this.mainPlaylistLoader_.sidxMapping_;let o;try{o=E()(Object(T["k"])(n.response).subarray(8))}catch(l){return void this.requestErrored_(l,n,t)}return a[r]={sidxInfo:e.sidx,sidx:o},Object(S["a"])(e,o,e.sidx.resolvedUri),i(!0)};this.request=no(n,this.vhs_.xhr,(t,i,r,s)=>{if(t)return a(t,i);if(!r||"mp4"!==r)return a({status:i.status,message:`Unsupported ${r||"unknown"} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},i);const{offset:o,length:l}=e.sidx.byterange;if(s.length>=l+o)return a(t,{response:s.subarray(o,o+l),status:i.status,uri:i.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",headers:Ba({byterange:e.sidx.byterange})},a)})}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},s.a.clearTimeout(this.minimumUpdatePeriodTimeout_),s.a.clearTimeout(this.mediaRequest_),s.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if("string"===typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,i=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),s.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(s.a.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){s.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=s.a.setTimeout(()=>this.load(),e)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])}):this.mediaRequest_=s.a.setTimeout(()=>this.haveMain_(),0)}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(t,i)=>{if(this.requestErrored_(t,i))return void("HAVE_NOTHING"===this.state&&(this.started=!1));const r=i.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?this.mainLoaded_=Date.parse(i.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=kn(this.mainPlaylistLoader_.srcUrl,i),r?(this.handleMain_(),void this.syncClientServerClock_(()=>e(i,r))):e(i,r)})}syncClientServerClock_(e){const t=Object(S["d"])(this.mainPlaylistLoader_.mainXml_);return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:xn(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials},(i,r)=>{if(!this.request)return;if(i)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let s;s="HEAD"===t.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):this.mainLoaded_:Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=s-Date.now(),e()}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;let t=lo({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=uo(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;const i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return i&&i!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=i),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(t)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(s.a.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!==typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=s.a.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=po(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const e=()=>{this.media().endList||(this.mediaUpdateTimeout=s.a.setTimeout(()=>{this.trigger("mediaupdatetimeout"),e()},La(this.media(),Boolean(i))))};e()}this.trigger("loadedplaylist")}}var mo={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const go=e=>{const t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer},yo=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},vo=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){const i=new BlobBuilder;return i.append(e),URL.createObjectURL(i.getBlob())}},bo=function(e){return function(){const t=vo(e),i=yo(new Worker(t));i.objURL=t;const r=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},i}},_o=function(e){return`var browserWorkerPolyFill = ${yo.toString()};\nbrowserWorkerPolyFill(self);\n`+e},To=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},So=_o(To((function(){var t="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{},i=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var r;return!!e[t]&&(r=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(r,1),r>-1)},this.trigger=function(t){var i,r,s,n;if(i=e[t],i)if(2===arguments.length)for(s=i.length,r=0;r<s;++r)i[r].call(this,arguments[1]);else{for(n=[],r=arguments.length,r=1;r<arguments.length;++r)n.push(arguments[r]);for(s=i.length,r=0;r<s;++r)i[r].apply(this,n)}},this.dispose=function(){e={}}}};i.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),this.on("partialdone",(function(t){e.partialFlush(t)})),this.on("endedtimeline",(function(t){e.endTimeline(t)})),this.on("reset",(function(t){e.reset(t)})),e},i.prototype.push=function(e){this.trigger("data",e)},i.prototype.flush=function(e){this.trigger("done",e)},i.prototype.partialFlush=function(e){this.trigger("partialdone",e)},i.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},i.prototype.reset=function(e){this.trigger("reset",e)};var r,s,n,a,o,l,d,u,c,h,p,f,m,g,y,v,b,_,T,S,w,E,C,x,k,I,A,P,O,L,D,M,N,R,U,B,j=i,F=Math.pow(2,32),q=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0),t<Number.MAX_SAFE_INTEGER?Number(t):t):i.getUint32(0)*F+i.getUint32(4)},$={getUint64:q,MAX_UINT32:F},H=$.MAX_UINT32;(function(){var e;if(C={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!==typeof Uint8Array){for(e in C)C.hasOwnProperty(e)&&(C[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);x=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),I=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),k=new Uint8Array([0,0,0,1]),A=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),P=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),O={video:A,audio:P},M=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),D=new Uint8Array([0,0,0,0,0,0,0,0]),N=new Uint8Array([0,0,0,0,0,0,0,0]),R=N,U=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B=N,L=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),r=function(e){var t,i,r,s=[],n=0;for(t=1;t<arguments.length;t++)s.push(arguments[t]);t=s.length;while(t--)n+=s[t].byteLength;for(i=new Uint8Array(n+8),r=new DataView(i.buffer,i.byteOffset,i.byteLength),r.setUint32(0,i.byteLength),i.set(e,4),t=0,n=8;t<s.length;t++)i.set(s[t],n),n+=s[t].byteLength;return i},s=function(){return r(C.dinf,r(C.dref,M))},n=function(e){return r(C.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},a=function(){return r(C.ftyp,x,k,x,I)},v=function(e){return r(C.hdlr,O[e])},o=function(e){return r(C.mdat,e)},y=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),r(C.mdhd,t)},g=function(e){return r(C.mdia,y(e),v(e.type),d(e))},l=function(e){return r(C.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},d=function(e){return r(C.minf,"video"===e.type?r(C.vmhd,L):r(C.smhd,D),s(),_(e))},u=function(e,t){var i=[],s=t.length;while(s--)i[s]=S(t[s]);return r.apply(null,[C.moof,l(e)].concat(i))},c=function(e){var t=e.length,i=[];while(t--)i[t]=f(e[t]);return r.apply(null,[C.moov,p(4294967295)].concat(i).concat(h(e)))},h=function(e){var t=e.length,i=[];while(t--)i[t]=w(e[t]);return r.apply(null,[C.mvex].concat(i))},p=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return r(C.mvhd,t)},b=function(e){var t,i,s=e.samples||[],n=new Uint8Array(4+s.length);for(i=0;i<s.length;i++)t=s[i].flags,n[i+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return r(C.sdtp,n)},_=function(e){return r(C.stbl,T(e),r(C.stts,B),r(C.stsc,R),r(C.stsz,U),r(C.stco,N))},function(){var e,t;T=function(i){return r(C.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===i.type?e(i):t(i))},e=function(e){var t,i,s=e.sps||[],n=e.pps||[],a=[],o=[];for(t=0;t<s.length;t++)a.push((65280&s[t].byteLength)>>>8),a.push(255&s[t].byteLength),a=a.concat(Array.prototype.slice.call(s[t]));for(t=0;t<n.length;t++)o.push((65280&n[t].byteLength)>>>8),o.push(255&n[t].byteLength),o=o.concat(Array.prototype.slice.call(n[t]));if(i=[C.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r(C.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([s.length],a,[n.length],o))),r(C.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.sarRatio[0],d=e.sarRatio[1];i.push(r(C.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&d)>>24,(16711680&d)>>16,(65280&d)>>8,255&d])))}return r.apply(null,i)},t=function(e){return r(C.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))}}(),m=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return r(C.tkhd,t)},S=function(e){var t,i,s,n,a,o,l;return t=r(C.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),o=Math.floor(e.baseMediaDecodeTime/H),l=Math.floor(e.baseMediaDecodeTime%H),i=r(C.tfdt,new Uint8Array([1,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,255&o,l>>>24&255,l>>>16&255,l>>>8&255,255&l])),a=92,"audio"===e.type?(s=E(e,a),r(C.traf,t,i,s)):(n=b(e),s=E(e,n.length+a),r(C.traf,t,i,s,n))},f=function(e){return e.duration=e.duration||4294967295,r(C.trak,m(e),g(e))},w=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),r(C.trex,t)},function(){var e,t,i;i=function(e,t){var i=0,r=0,s=0,n=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(s=4),void 0!==e[0].compositionTimeOffset&&(n=8)),[0,0,i|r|s|n,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},t=function(e,t){var s,n,a,o,l,d;for(o=e.samples||[],t+=20+16*o.length,a=i(o,t),n=new Uint8Array(a.length+16*o.length),n.set(a),s=a.length,d=0;d<o.length;d++)l=o[d],n[s++]=(4278190080&l.duration)>>>24,n[s++]=(16711680&l.duration)>>>16,n[s++]=(65280&l.duration)>>>8,n[s++]=255&l.duration,n[s++]=(4278190080&l.size)>>>24,n[s++]=(16711680&l.size)>>>16,n[s++]=(65280&l.size)>>>8,n[s++]=255&l.size,n[s++]=l.flags.isLeading<<2|l.flags.dependsOn,n[s++]=l.flags.isDependedOn<<6|l.flags.hasRedundancy<<4|l.flags.paddingValue<<1|l.flags.isNonSyncSample,n[s++]=61440&l.flags.degradationPriority,n[s++]=15&l.flags.degradationPriority,n[s++]=(4278190080&l.compositionTimeOffset)>>>24,n[s++]=(16711680&l.compositionTimeOffset)>>>16,n[s++]=(65280&l.compositionTimeOffset)>>>8,n[s++]=255&l.compositionTimeOffset;return r(C.trun,n)},e=function(e,t){var s,n,a,o,l,d;for(o=e.samples||[],t+=20+8*o.length,a=i(o,t),s=new Uint8Array(a.length+8*o.length),s.set(a),n=a.length,d=0;d<o.length;d++)l=o[d],s[n++]=(4278190080&l.duration)>>>24,s[n++]=(16711680&l.duration)>>>16,s[n++]=(65280&l.duration)>>>8,s[n++]=255&l.duration,s[n++]=(4278190080&l.size)>>>24,s[n++]=(16711680&l.size)>>>16,s[n++]=(65280&l.size)>>>8,s[n++]=255&l.size;return r(C.trun,s)},E=function(i,r){return"audio"===i.type?e(i,r):t(i,r)}}();var z,V,G,W,X,Y,K,J,Q={ftyp:a,mdat:o,moof:u,moov:c,initSegment:function(e){var t,i=a(),r=c(e);return t=new Uint8Array(i.byteLength+r.byteLength),t.set(i),t.set(r,i.byteLength),t}},Z=function(e){var t,i,r=[],s=[];for(s.byteLength=0,s.nalCount=0,s.duration=0,r.byteLength=0,t=0;t<e.length;t++)i=e[t],"access_unit_delimiter_rbsp"===i.nalUnitType?(r.length&&(r.duration=i.dts-r.dts,s.byteLength+=r.byteLength,s.nalCount+=r.length,s.duration+=r.duration,s.push(r)),r=[i],r.byteLength=i.data.byteLength,r.pts=i.pts,r.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(r.keyFrame=!0),r.duration=i.dts-r.dts,r.byteLength+=i.data.byteLength,r.push(i));return s.length&&(!r.duration||r.duration<=0)&&(r.duration=s[s.length-1].duration),s.byteLength+=r.byteLength,s.nalCount+=r.length,s.duration+=r.duration,s.push(r),s},ee=function(e){var t,i,r=[],s=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,s.byteLength=0,s.nalCount=0,s.duration=0,s.pts=e[0].pts,s.dts=e[0].dts,t=0;t<e.length;t++)i=e[t],i.keyFrame?(r.length&&(s.push(r),s.byteLength+=r.byteLength,s.nalCount+=r.nalCount,s.duration+=r.duration),r=[i],r.nalCount=i.length,r.byteLength=i.byteLength,r.pts=i.pts,r.dts=i.dts,r.duration=i.duration):(r.duration+=i.duration,r.nalCount+=i.length,r.byteLength+=i.byteLength,r.push(i));return s.length&&r.duration<=0&&(r.duration=s[s.length-1].duration),s.byteLength+=r.byteLength,s.nalCount+=r.nalCount,s.duration+=r.duration,s.push(r),s},te=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},ie=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},re=function(e,t){var i=ie();return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},se=function(e,t){var i,r,s,n,a,o=t||0,l=[];for(i=0;i<e.length;i++)for(n=e[i],r=0;r<n.length;r++)a=n[r],s=re(a,o),o+=s.size,l.push(s);return l},ne=function(e){var t,i,r,s,n,a,o=0,l=e.byteLength,d=e.nalCount,u=l+4*d,c=new Uint8Array(u),h=new DataView(c.buffer);for(t=0;t<e.length;t++)for(s=e[t],i=0;i<s.length;i++)for(n=s[i],r=0;r<n.length;r++)a=n[r],h.setUint32(o,a.data.byteLength),o+=4,c.set(a.data,o),o+=a.data.byteLength;return c},ae=function(e,t){var i,r=t||0,s=[];return i=re(e,r),s.push(i),s},oe=function(e){var t,i,r=0,s=e.byteLength,n=e.length,a=s+4*n,o=new Uint8Array(a),l=new DataView(o.buffer);for(t=0;t<e.length;t++)i=e[t],l.setUint32(r,i.data.byteLength),r+=4,o.set(i.data,r),r+=i.data.byteLength;return o},le={groupNalsIntoFrames:Z,groupFramesIntoGops:ee,extendFirstKeyFrame:te,generateSampleTable:se,concatenateNalData:ne,generateSampleTableForFrame:ae,concatenateNalDataForFrame:oe},de=[33,16,5,32,164,27],ue=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ce=function(e){var t=[];while(e--)t.push(0);return t},he=function(e){return Object.keys(e).reduce((function(t,i){return t[i]=new Uint8Array(e[i].reduce((function(e,t){return e.concat(t)}),[])),t}),{})},pe=function(){if(!z){var e={96e3:[de,[227,64],ce(154),[56]],88200:[de,[231],ce(170),[56]],64e3:[de,[248,192],ce(240),[56]],48e3:[de,[255,192],ce(268),[55,148,128],ce(54),[112]],44100:[de,[255,192],ce(268),[55,163,128],ce(84),[112]],32e3:[de,[255,192],ce(268),[55,234],ce(226),[112]],24e3:[de,[255,192],ce(268),[55,255,128],ce(268),[111,112],ce(126),[224]],16e3:[de,[255,192],ce(268),[55,255,128],ce(268),[111,255],ce(269),[223,108],ce(195),[1,192]],12e3:[ue,ce(268),[3,127,248],ce(268),[6,255,240],ce(268),[13,255,224],ce(268),[27,253,128],ce(259),[56]],11025:[ue,ce(268),[3,127,248],ce(268),[6,255,240],ce(268),[13,255,224],ce(268),[27,255,192],ce(268),[55,175,128],ce(108),[112]],8e3:[ue,ce(268),[3,121,16],ce(47),[7]]};z=he(e)}return z},fe=9e4;V=function(e){return e*fe},G=function(e,t){return e*t},W=function(e){return e/fe},X=function(e,t){return e/t},Y=function(e,t){return V(X(e,t))},K=function(e,t){return G(W(e),t)},J=function(e,t,i){return W(i?e:e-t)};var me={ONE_SECOND_IN_TS:fe,secondsToVideoTs:V,secondsToAudioTs:G,videoTsToSeconds:W,audioTsToSeconds:X,audioTsToVideoTs:Y,videoTsToAudioTs:K,metadataTsToSeconds:J},ge=pe,ye=me,ve=function(e){var t,i,r=0;for(t=0;t<e.length;t++)i=e[t],r+=i.data.byteLength;return r},be=function(e,t,i,r){var s,n,a,o,l=0,d=0,u=0,c=0;if(t.length&&(s=ye.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),l=Math.ceil(ye.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&r&&(d=s-Math.max(i,r),u=Math.floor(d/l),c=u*l),!(u<1||c>ye.ONE_SECOND_IN_TS/2))){for(n=ge()[e.samplerate],n||(n=t[0].data),a=0;a<u;a++)o=t[0],t.splice(0,0,{data:n,dts:o.dts-l,pts:o.pts-l});return e.baseMediaDecodeTime-=Math.floor(ye.videoTsToAudioTs(c,e.samplerate)),c}},_e=function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},Te=function(e){var t,i,r=[];for(t=0;t<e.length;t++)i=e[t],r.push({size:i.data.byteLength,duration:1024});return r},Se=function(e){var t,i,r=0,s=new Uint8Array(ve(e));for(t=0;t<e.length;t++)i=e[t],s.set(i.data,r),r+=i.data.byteLength;return s},we={prefixWithSilence:be,trimAdtsFramesByEarliestDts:_e,generateSampleTable:Te,concatenateFrameData:Se},Ee=me.ONE_SECOND_IN_TS,Ce=function(e,t){"number"===typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"===typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},xe=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},ke=function(e,t){var i,r,s=e.minSegmentDts;return t||(s-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=s,i=Math.max(0,i),"audio"===e.type&&(r=e.samplerate/Ee,i*=r,i=Math.floor(i)),i},Ie={clearDtsInfo:xe,calculateTrackBaseMediaDecodeTime:ke,collectDtsInfo:Ce},Ae=4,Pe=128,Oe=function(e){var t=0,i={payloadType:-1,payloadSize:0},r=0,s=0;while(t<e.byteLength){if(e[t]===Pe)break;while(255===e[t])r+=255,t++;r+=e[t++];while(255===e[t])s+=255,t++;if(s+=e[t++],!i.payload&&r===Ae){var n=String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6]);if("GA94"===n){i.payloadType=r,i.payloadSize=s,i.payload=e.subarray(t,t+s);break}i.payload=void 0}t+=s,r=0,s=0}return i},Le=function(e){return 181!==e.payload[0]||49!==(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},De=function(e,t){var i,r,s,n,a=[];if(!(64&t[0]))return a;for(r=31&t[0],i=0;i<r;i++)s=3*i,n={type:3&t[s+2],pts:e},4&t[s+2]&&(n.ccData=t[s+3]<<8|t[s+4],a.push(n));return a},Me=function(e){var t,i,r=e.byteLength,s=[],n=1;while(n<r-2)0===e[n]&&0===e[n+1]&&3===e[n+2]?(s.push(n+2),n+=2):n++;if(0===s.length)return e;t=r-s.length,i=new Uint8Array(t);var a=0;for(n=0;n<t;a++,n++)a===s[0]&&(a++,s.shift()),i[n]=e[a];return i},Ne={parseSei:Oe,parseUserData:Le,parseCaptionPackets:De,discardEmulationPreventionBytes:Me,USER_DATA_REGISTERED_ITU_T_T35:Ae},Re=j,Ue=Ne,Be=function(e){e=e||{},Be.prototype.init.call(this),this.parse708captions_="boolean"!==typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Ke(0,0),new Ke(0,1),new Ke(1,0),new Ke(1,1)],this.parse708captions_&&(this.cc708Stream_=new ze({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))}),this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};Be.prototype=new Re,Be.prototype.push=function(e){var t,i,r;if("sei_rbsp"===e.nalUnitType&&(t=Ue.parseSei(e.escapedRBSP),t.payload&&t.payloadType===Ue.USER_DATA_REGISTERED_ITU_T_T35&&(i=Ue.parseUserData(t),i)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));r=Ue.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(r),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},Be.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},Be.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)}),this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},Be.prototype.flush=function(){return this.flushStream("flush")},Be.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Be.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},Be.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},Be.prototype.setsChannel1Active=function(e){return 4096===(30720&e.ccData)},Be.prototype.setsChannel2Active=function(e){return 6144===(30720&e.ccData)},Be.prototype.setsTextOrXDSActive=function(e){return 256===(28928&e.ccData)||4138===(30974&e.ccData)||6186===(30974&e.ccData)},Be.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var je={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},Fe=function(e){var t=je[e]||e;return 4096&e&&e===t?"":String.fromCharCode(t)},qe=function(e){return 32<=e&&e<=127||160<=e&&e<=255},$e=function(e){this.windowNum=e,this.reset()};$e.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},$e.prototype.getText=function(){return this.rows.join("\n")},$e.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},$e.prototype.newLine=function(e){this.rows.length>=this.virtualRowCount&&"function"===typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);while(this.rows.length>this.virtualRowCount)this.rows.shift(),this.rowIdx--},$e.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},$e.prototype.addText=function(e){this.rows[this.rowIdx]+=e},$e.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var He=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new $e(-1),this.windows=[],this.stream=i,"string"===typeof t&&this.createTextDecoder(t)};He.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new $e(i),"function"===typeof t&&(this.windows[i].beforeRowOverflow=t)},He.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},He.prototype.createTextDecoder=function(e){if("undefined"===typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var ze=function(e){e=e||{},ze.prototype.init.call(this);var t,i=this,r=e.captionServices||{},s={};Object.keys(r).forEach(e=>{t=r[e],/^SERVICE/.test(e)&&(s[e]=t.encoding)}),this.serviceEncodings=s,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e))}};ze.prototype=new Re,ze.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ze.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,r=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(r)},ze.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,r=null,s=0,n=t[s++];for(e.seq=n>>6,e.sizeCode=63&n;s<t.length;s++)n=t[s++],i=n>>5,r=31&n,7===i&&r>0&&(n=t[s++],i=n),this.pushServiceBlock(i,s,r),r>0&&(s+=r-1)},ze.prototype.pushServiceBlock=function(e,t,i){var r,s=t,n=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,s));s<t+i&&s<n.length;s++)r=n[s],qe(r)?s=this.handleText(s,a):24===r?s=this.multiByteCharacter(s,a):16===r?s=this.extendedCommands(s,a):128<=r&&r<=135?s=this.setCurrentWindow(s,a):152<=r&&r<=159?s=this.defineWindow(s,a):136===r?s=this.clearWindows(s,a):140===r?s=this.deleteWindows(s,a):137===r?s=this.displayWindows(s,a):138===r?s=this.hideWindows(s,a):139===r?s=this.toggleWindows(s,a):151===r?s=this.setWindowAttributes(s,a):144===r?s=this.setPenAttributes(s,a):145===r?s=this.setPenColor(s,a):146===r?s=this.setPenLocation(s,a):143===r?a=this.reset(s,a):8===r?a.currentWindow.backspace():12===r?a.currentWindow.clearText():13===r?a.currentWindow.pendingNewLine=!0:14===r?a.currentWindow.clearText():141===r&&s++},ze.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data,r=i[++e];return qe(r)&&(e=this.handleText(e,t,{isExtended:!0})),e},ze.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},ze.prototype.initService=function(e,t){var i,r="SERVICE"+e,s=this;return r in this.serviceEncodings&&(i=this.serviceEncodings[r]),this.services[e]=new He(e,i,s),this.services[e].init(this.getPts(t),(function(t){s.flushDisplayed(t,s.services[e])})),this.services[e]},ze.prototype.handleText=function(e,t,i){var r,s,n=i&&i.isExtended,a=i&&i.isMultiByte,o=this.current708Packet.data,l=n?4096:0,d=o[e],u=o[e+1],c=t.currentWindow;return t.textDecoder_&&!n?(a?(s=[d,u],e++):s=[d],r=t.textDecoder_.decode(new Uint8Array(s))):r=Fe(l|d),c.pendingNewLine&&!c.isEmpty()&&c.newLine(this.getPts(e)),c.pendingNewLine=!1,c.addText(r),e},ze.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,r=i[e+1],s=i[e+2];return qe(r)&&qe(s)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},ze.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data,r=i[e],s=7&r;return t.setCurrentWindow(s),e},ze.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,r=i[e],s=7&r;t.setCurrentWindow(s);var n=t.currentWindow;return r=i[++e],n.visible=(32&r)>>5,n.rowLock=(16&r)>>4,n.columnLock=(8&r)>>3,n.priority=7&r,r=i[++e],n.relativePositioning=(128&r)>>7,n.anchorVertical=127&r,r=i[++e],n.anchorHorizontal=r,r=i[++e],n.anchorPoint=(240&r)>>4,n.rowCount=15&r,r=i[++e],n.columnCount=63&r,r=i[++e],n.windowStyle=(56&r)>>3,n.penStyle=7&r,n.virtualRowCount=n.rowCount+1,e},ze.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,r=i[e],s=t.currentWindow.winAttr;return r=i[++e],s.fillOpacity=(192&r)>>6,s.fillRed=(48&r)>>4,s.fillGreen=(12&r)>>2,s.fillBlue=3&r,r=i[++e],s.borderType=(192&r)>>6,s.borderRed=(48&r)>>4,s.borderGreen=(12&r)>>2,s.borderBlue=3&r,r=i[++e],s.borderType+=(128&r)>>5,s.wordWrap=(64&r)>>6,s.printDirection=(48&r)>>4,s.scrollDirection=(12&r)>>2,s.justify=3&r,r=i[++e],s.effectSpeed=(240&r)>>4,s.effectDirection=(12&r)>>2,s.displayEffect=3&r,e},ze.prototype.flushDisplayed=function(e,t){for(var i=[],r=0;r<8;r++)t.windows[r].visible&&!t.windows[r].isEmpty()&&i.push(t.windows[r].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},ze.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},ze.prototype.displayWindows=function(e,t){var i=this.current708Packet.data,r=i[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)r&1<<n&&(t.windows[n].visible=1);return e},ze.prototype.hideWindows=function(e,t){var i=this.current708Packet.data,r=i[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)r&1<<n&&(t.windows[n].visible=0);return e},ze.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data,r=i[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)r&1<<n&&(t.windows[n].visible^=1);return e},ze.prototype.clearWindows=function(e,t){var i=this.current708Packet.data,r=i[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)r&1<<n&&t.windows[n].clearText();return e},ze.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data,r=i[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)r&1<<n&&t.windows[n].reset();return e},ze.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,r=i[e],s=t.currentWindow.penAttr;return r=i[++e],s.textTag=(240&r)>>4,s.offset=(12&r)>>2,s.penSize=3&r,r=i[++e],s.italics=(128&r)>>7,s.underline=(64&r)>>6,s.edgeType=(56&r)>>3,s.fontStyle=7&r,e},ze.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,r=i[e],s=t.currentWindow.penColor;return r=i[++e],s.fgOpacity=(192&r)>>6,s.fgRed=(48&r)>>4,s.fgGreen=(12&r)>>2,s.fgBlue=3&r,r=i[++e],s.bgOpacity=(192&r)>>6,s.bgRed=(48&r)>>4,s.bgGreen=(12&r)>>2,s.bgBlue=3&r,r=i[++e],s.edgeRed=(48&r)>>4,s.edgeGreen=(12&r)>>2,s.edgeBlue=3&r,e},ze.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,r=i[e],s=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,r=i[++e],s.row=15&r,r=i[++e],s.column=63&r,e},ze.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var Ve={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ge=function(e){return null===e?"":(e=Ve[e]||e,String.fromCharCode(e))},We=14,Xe=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ye=function(){var e=[],t=We+1;while(t--)e.push("");return e},Ke=function(e,t){Ke.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,r,s,n;if(t=32639&e.ccData,t!==this.lastControlCode_){if(4096===(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),r=t>>>8,s=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Ye();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ye();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Ye()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(r,s))r=(3&r)<<8,n=Ge(r|s),this[this.mode_](e.pts,n),this.column_++;else if(this.isExtCharacter(r,s))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),r=(3&r)<<8,n=Ge(r|s),this[this.mode_](e.pts,n),this.column_++;else if(this.isMidRowCode(r,s))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14===(14&s)&&this.addFormatting(e.pts,["i"]),1===(1&s)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(r,s))this.column_+=3&s;else if(this.isPAC(r,s)){var a=Xe.indexOf(7968&t);"rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&(this.clearFormatting(e.pts),this.row_=a),1&s&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16===(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(s)&&14===(14&s)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(r)&&(0===s&&(s=null),n=Ge(r),n+=Ge(s),this[this.mode_](e.pts,n),this.column_+=n.length)}else this.lastControlCode_=null}};Ke.prototype=new Re,Ke.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e,t){try{return e.trim()}catch(i){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}}),this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Ke.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ye(),this.nonDisplayed_=Ye(),this.lastControlCode_=null,this.column_=0,this.row_=We,this.rollUpRows_=2,this.formatting_=[]},Ke.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ke.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Ke.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Ke.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Ke.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Ke.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Ke.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Ke.prototype.isNormalChar=function(e){return e>=32&&e<=127},Ke.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=We,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Ye(),this.displayed_=Ye()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Ke.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},Ke.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},Ke.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},Ke.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},Ke.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<We+1;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},Ke.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i};var Je={CaptionStream:Be,Cea608Stream:Ke,Cea708Stream:ze},Qe={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ze=j,et=8589934592,tt=4294967296,it="shared",rt=function(e,t){var i=1;e>t&&(i=-1);while(Math.abs(t-e)>tt)e+=i*et;return e},st=function(e){var t,i;st.prototype.init.call(this),this.type_=e||it,this.push=function(e){this.type_!==it&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=rt(e.dts,i),e.pts=rt(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};st.prototype=new Ze;var nt,at={TimestampRolloverStream:st,handleRollover:rt},ot=(e,t,i)=>{if(!e)return-1;for(var r=i;r<e.length;r++)if(e[r]===t)return r;return-1},lt={typedArrayIndexOf:ot},dt=j,ut=Qe,ct=lt.typedArrayIndexOf,ht={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},pt=function(e,t,i){var r,s="";for(r=t;r<i;r++)s+="%"+("00"+e[r].toString(16)).slice(-2);return s},ft=function(e,t,i){return decodeURIComponent(pt(e,t,i))},mt=function(e,t,i){return unescape(pt(e,t,i))},gt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},yt={APIC:function(e){var t,i,r=1,s="--\x3e";e.data[0]===ht.Utf8&&(t=ct(e.data,0,r),t<0||(e.mimeType=mt(e.data,r,t),r=t+1,e.pictureType=e.data[r],r++,i=ct(e.data,0,r),i<0||(e.description=ft(e.data,r,i),r=i+1,e.mimeType===s?e.url=mt(e.data,r,e.data.length):e.pictureData=e.data.subarray(r,e.data.length))))},"T*":function(e){e.data[0]===ht.Utf8&&(e.value=ft(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;e.data[0]===ht.Utf8&&(t=ct(e.data,0,1),-1!==t&&(e.description=ft(e.data,1,t),e.value=ft(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value))},"W*":function(e){e.url=mt(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;e.data[0]===ht.Utf8&&(t=ct(e.data,0,1),-1!==t&&(e.description=ft(e.data,1,t),e.url=mt(e.data,t+1,e.data.length).replace(/\0.*$/,"")))},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=mt(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};nt=function(e){var t,i={descriptor:e&&e.descriptor},r=0,s=[],n=0;if(nt.prototype.init.call(this),this.dispatchType=ut.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,a,o,l,d;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(n=0,s.length=0),0===s.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(s.push(e),n+=e.data.byteLength,1===s.length&&(r=gt(e.data.subarray(6,10)),r+=10),!(n<r)){for(t={data:new Uint8Array(r),frames:[],pts:s[0].pts,dts:s[0].dts},l=0;l<r;)t.data.set(s[0].data.subarray(0,r-l),l),l+=s[0].data.byteLength,n-=s[0].data.byteLength,s.shift();i=10,64&t.data[5]&&(i+=4,i+=gt(t.data.subarray(10,14)),r-=gt(t.data.subarray(16,20)));do{if(a=gt(t.data.subarray(i+4,i+8)),a<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(d=String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),o={id:d,data:t.data.subarray(i+10,i+a+10)},o.key=o.id,yt[o.id]?yt[o.id](o):"T"===o.id[0]?yt["T*"](o):"W"===o.id[0]&&yt["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var u=o.data,c=(1&u[3])<<30|u[4]<<22|u[5]<<14|u[6]<<6|u[7]>>>2;c*=4,c+=3&u[7],o.timeStamp=c,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=a}while(i<r);this.trigger("data",t)}}},nt.prototype=new dt;var vt,bt,_t,Tt=nt,St=j,wt=Je,Et=Qe,Ct=at.TimestampRolloverStream,xt=188,kt=71;vt=function(){var e=new Uint8Array(xt),t=0;vt.prototype.init.call(this),this.push=function(i){var r,s=0,n=xt;t?(r=new Uint8Array(i.byteLength+t),r.set(e.subarray(0,t)),r.set(i,t),t=0):r=i;while(n<r.byteLength)r[s]!==kt||r[n]!==kt?(s++,n++):(this.trigger("data",r.subarray(s,n)),s+=xt,n+=xt);s<r.byteLength&&(e.set(r.subarray(s),0),t=r.byteLength-s)},this.flush=function(){t===xt&&e[0]===kt&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}},vt.prototype=new St,bt=function(){var e,t,i,r;bt.prototype.init.call(this),r=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,r){var s=0;r.payloadUnitStartIndicator&&(s+=e[s]+1),"pat"===r.type?t(e.subarray(s),r):i(e.subarray(s),r)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],r.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=r.pmtPid},i=function(e,t){var i,s,n,a;if(1&e[5]){r.programMapTable={video:null,audio:null,"timed-metadata":{}},i=(15&e[1])<<8|e[2],s=3+i-4,n=(15&e[10])<<8|e[11],a=12+n;while(a<s){var o=e[a],l=(31&e[a+1])<<8|e[a+2];o===Et.H264_STREAM_TYPE&&null===r.programMapTable.video?r.programMapTable.video=l:o===Et.ADTS_STREAM_TYPE&&null===r.programMapTable.audio?r.programMapTable.audio=l:o===Et.METADATA_STREAM_TYPE&&(r.programMapTable["timed-metadata"][l]=o),a+=5+((15&e[a+3])<<8|e[a+4])}t.programMapTable=r.programMapTable}},this.push=function(t){var i={},r=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(r+=t[r]+1),0===i.pid)i.type="pat",e(t.subarray(r),i),this.trigger("data",i);else if(i.pid===this.pmtPid){i.type="pmt",e(t.subarray(r),i),this.trigger("data",i);while(this.packetsWaitingForPmt.length)this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,i]):this.processPes_(t,r,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Et.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Et.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},bt.prototype=new St,bt.STREAM_TYPES={h264:27,adts:15},_t=function(){var e,t=this,i=!1,r={data:[],size:0},s={data:[],size:0},n={data:[],size:0},a=function(e,t){var i;const r=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===r&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!==(4&e[6]),i=e[7],192&i&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))},o=function(e,i,r){var s,n=new Uint8Array(e.size),o={type:i},l=0,d=0,u=!1;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,l=0;l<e.data.length;l++)s=e.data[l],n.set(s.data,d),d+=s.data.byteLength;a(n,o),u="video"===i||o.packetLength<=e.size,(r||u)&&(e.size=0,e.data.length=0),u&&t.trigger("data",o)}};_t.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,t;switch(a.streamType){case Et.H264_STREAM_TYPE:e=r,t="video";break;case Et.ADTS_STREAM_TYPE:e=s,t="audio";break;case Et.METADATA_STREAM_TYPE:e=n,t="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&o(e,t,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var r={type:"metadata",tracks:[]};e=a.programMapTable,null!==e.video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",r)}})[a.type]()},this.reset=function(){r.size=0,r.data.length=0,s.size=0,s.data.length=0,this.trigger("reset")},this.flushStreams_=function(){o(r,"video"),o(s,"audio"),o(n,"timed-metadata")},this.flush=function(){if(!i&&e){var r={type:"metadata",tracks:[]};null!==e.video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",r)}i=!1,this.flushStreams_(),this.trigger("done")}},_t.prototype=new St;var It={PAT_PID:0,MP2T_PACKET_LENGTH:xt,TransportPacketStream:vt,TransportParseStream:bt,ElementaryStream:_t,TimestampRolloverStream:Ct,CaptionStream:wt.CaptionStream,Cea608Stream:wt.Cea608Stream,Cea708Stream:wt.Cea708Stream,MetadataStream:Tt};for(var At in Et)Et.hasOwnProperty(At)&&(It[At]=Et[At]);var Pt,Ot=It,Lt=j,Dt=me.ONE_SECOND_IN_TS,Mt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Pt=function(e){var t,i=0;Pt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${i} outside syncword`})},this.push=function(r){var s,n,a,o,l,d=0;if(e||(i=0),"audio"===r.type){var u;t&&t.length?(a=t,t=new Uint8Array(a.byteLength+r.data.byteLength),t.set(a),t.set(r.data,a.byteLength)):t=r.data;while(d+7<t.length)if(255===t[d]&&240===(246&t[d+1])){if("number"===typeof u&&(this.skipWarn_(u,d),u=null),n=2*(1&~t[d+1]),s=(3&t[d+3])<<11|t[d+4]<<3|(224&t[d+5])>>5,o=1024*(1+(3&t[d+6])),l=o*Dt/Mt[(60&t[d+2])>>>2],t.byteLength-d<s)break;this.trigger("data",{pts:r.pts+i*l,dts:r.dts+i*l,sampleCount:o,audioobjecttype:1+(t[d+2]>>>6&3),channelcount:(1&t[d+2])<<2|(192&t[d+3])>>>6,samplerate:Mt[(60&t[d+2])>>>2],samplingfrequencyindex:(60&t[d+2])>>>2,samplesize:16,data:t.subarray(d+7+n,d+s)}),i++,d+=s}else"number"!==typeof u&&(u=d),d++;"number"===typeof u&&(this.skipWarn_(u,d),u=null),t=t.subarray(d)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}},Pt.prototype=new Lt;var Nt,Rt=Pt;Nt=function(e){var t=e.byteLength,i=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var s=e.byteLength-t,n=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");n.set(e.subarray(s,s+a)),i=new DataView(n.buffer).getUint32(0),r=8*a,t-=a},this.skipBits=function(e){var s;r>e?(i<<=e,r-=e):(e-=r,s=Math.floor(e/8),e-=8*s,t-=s,this.loadWord(),i<<=e,r-=e)},this.readBits=function(e){var s=Math.min(r,e),n=i>>>32-s;return r-=s,r>0?i<<=s:t>0&&this.loadWord(),s=e-s,s>0?n<<s|this.readBits(s):n},this.skipLeadingZeros=function(){var e;for(e=0;e<r;++e)if(0!==(i&2147483648>>>e))return i<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Ut,Bt,jt,Ft=Nt,qt=j,$t=Ft;Bt=function(){var e,t,i=0;Bt.prototype.init.call(this),this.push=function(r){var s;t?(s=new Uint8Array(t.byteLength+r.data.byteLength),s.set(t),s.set(r.data,t.byteLength),t=s):t=r.data;for(var n=t.byteLength;i<n-3;i++)if(1===t[i+2]){e=i+5;break}while(e<n)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<n);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3;break}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Bt.prototype=new qt,jt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Ut=function(){var e,t,i,r,s,n,a,o=new Bt;Ut.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,r=e.dts,o.push(e))},o.on("data",(function(a){var o={trackId:t,pts:i,dts:r,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=s(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=s(a.subarray(1)),o.config=n(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp";break}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),o.on("partialdone",(function(){e.trigger("partialdone")})),o.on("reset",(function(){e.trigger("reset")})),o.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},a=function(e,t){var i,r,s=8,n=8;for(i=0;i<e;i++)0!==n&&(r=t.readExpGolomb(),n=(s+r+256)%256),s=0===n?s:n},s=function(e){var t,i,r=e.byteLength,s=[],n=1;while(n<r-2)0===e[n]&&0===e[n+1]&&3===e[n+2]?(s.push(n+2),n+=2):n++;if(0===s.length)return e;t=r-s.length,i=new Uint8Array(t);var a=0;for(n=0;n<t;a++,n++)a===s[0]&&(a++,s.shift()),i[n]=e[a];return i},n=function(e){var t,i,r,s,n,o,l,d,u,c,h,p,f,m=0,g=0,y=0,v=0,b=[1,1];if(t=new $t(e),i=t.readUnsignedByte(),s=t.readUnsignedByte(),r=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),jt[i]&&(n=t.readUnsignedExpGolomb(),3===n&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==n?8:12,f=0;f<h;f++)t.readBoolean()&&a(f<6?16:64,t);if(t.skipUnsignedExpGolomb(),o=t.readUnsignedExpGolomb(),0===o)t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),f=0;f<l;f++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),d=t.readUnsignedExpGolomb(),u=t.readUnsignedExpGolomb(),c=t.readBits(1),0===c&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb(),v=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(p=t.readUnsignedByte(),p){case 1:b=[1,1];break;case 2:b=[12,11];break;case 3:b=[10,11];break;case 4:b=[16,11];break;case 5:b=[40,33];break;case 6:b=[24,11];break;case 7:b=[20,11];break;case 8:b=[32,11];break;case 9:b=[80,33];break;case 10:b=[18,11];break;case 11:b=[15,11];break;case 12:b=[64,33];break;case 13:b=[160,99];break;case 14:b=[4,3];break;case 15:b=[3,2];break;case 16:b=[2,1];break;case 255:b=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()];break}b&&(b[0],b[1])}return{profileIdc:i,levelIdc:r,profileCompatibility:s,width:16*(d+1)-2*m-2*g,height:(2-c)*(u+1)*16-2*y-2*v,sarRatio:b}}},Ut.prototype=new qt;var Ht,zt={H264Stream:Ut,NalByteStream:Bt},Vt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Gt=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],r=e[t+5],s=(16&r)>>4;return i=i>=0?i:0,s?i+20:i+10},Wt=function(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:(t+=Gt(e,t),Wt(e,t))},Xt=function(e){var t=Wt(e,0);return e.length>=t+2&&255===(255&e[t])&&240===(240&e[t+1])&&16===(22&e[t+1])},Yt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Kt=function(e,t,i){var r,s="";for(r=t;r<i;r++)s+="%"+("00"+e[r].toString(16)).slice(-2);return s},Jt=function(e,t,i){return unescape(Kt(e,t,i))},Qt=function(e,t){var i=(224&e[t+5])>>5,r=e[t+4]<<3,s=6144&e[t+3];return s|r|i},Zt=function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240===(240&e[t+1])?"audio":null},ei=function(e){var t=0;while(t+5<e.length){if(255===e[t]&&240===(246&e[t+1]))return Vt[(60&e[t+2])>>>2];t++}return null},ti=function(e){var t,i,r,s;t=10,64&e[5]&&(t+=4,t+=Yt(e.subarray(10,14)));do{if(i=Yt(e.subarray(t+4,t+8)),i<1)return null;if(s=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]),"PRIV"===s){r=e.subarray(t+10,t+i+10);for(var n=0;n<r.byteLength;n++)if(0===r[n]){var a=Jt(r,0,n);if("com.apple.streaming.transportStreamTimestamp"===a){var o=r.subarray(n+1),l=(1&o[3])<<30|o[4]<<22|o[5]<<14|o[6]<<6|o[7]>>>2;return l*=4,l+=3&o[7],l}break}}t+=10,t+=i}while(t<e.byteLength);return null},ii={isLikelyAacData:Xt,parseId3TagSize:Gt,parseAdtsSize:Qt,parseType:Zt,parseSampleRate:ei,parseAacTimestamp:ti},ri=j,si=ii;Ht=function(){var e=new Uint8Array,t=0;Ht.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var r,s,n,a,o=0,l=0;e.length?(a=e.length,e=new Uint8Array(i.byteLength+a),e.set(e.subarray(0,a)),e.set(i,a)):e=i;while(e.length-l>=3)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255!==(255&e[l])||240!==(240&e[l+1]))l++;else{if(e.length-l<7)break;if(o=si.parseAdtsSize(e,l),l+o>e.length)break;n={type:"audio",data:e.subarray(l,l+o),pts:t,dts:t},this.trigger("data",n),l+=o}else{if(e.length-l<10)break;if(o=si.parseId3TagSize(e,l),l+o>e.length)break;s={type:"timed-metadata",data:e.subarray(l,l+o)},this.trigger("data",s),l+=o}r=e.length-l,e=r>0?e.subarray(l):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}},Ht.prototype=new ri;var ni,ai,oi,li,di=Ht,ui=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],ci=ui,hi=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],pi=hi,fi=j,mi=Q,gi=le,yi=we,vi=Ie,bi=Ot,_i=me,Ti=Rt,Si=zt.H264Stream,wi=di,Ei=ii.isLikelyAacData,Ci=me.ONE_SECOND_IN_TS,xi=ci,ki=pi,Ii=function(e,t){t.stream=e,this.trigger("log",t)},Ai=function(e,t){for(var i=Object.keys(t),r=0;r<i.length;r++){var s=i[r];"headOfPipeline"!==s&&t[s].on&&t[s].on("log",Ii.bind(e,s))}},Pi=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},Oi=function(e,t,i,r,s,n){var a=i-t,o=r-t,l=s-i;return{start:{dts:e,pts:e+a},end:{dts:e+o,pts:e+l},prependedContentDuration:n,baseMediaDecodeTime:e}};ai=function(e,t){var i,r=[],s=0,n=0,a=1/0;t=t||{},i=t.firstSequenceNumber||0,ai.prototype.init.call(this),this.push=function(t){vi.collectDtsInfo(e,t),e&&xi.forEach((function(i){e[i]=t[i]})),r.push(t)},this.setEarliestDts=function(e){s=e},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){n=e},this.flush=function(){var o,l,d,u,c,h,p;0!==r.length?(o=yi.trimAdtsFramesByEarliestDts(r,e,s),e.baseMediaDecodeTime=vi.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=yi.prefixWithSilence(e,o,n,a),e.samples=yi.generateSampleTable(o),d=mi.mdat(yi.concatenateFrameData(o)),r=[],l=mi.moof(i,[e]),u=new Uint8Array(l.byteLength+d.byteLength),i++,u.set(l),u.set(d,l.byteLength),vi.clearDtsInfo(e),c=Math.ceil(1024*Ci/e.samplerate),o.length&&(h=o.length*c,this.trigger("segmentTimingInfo",Oi(_i.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+h,o[0].pts+h,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+h})),this.trigger("data",{track:e,boxes:u}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){vi.clearDtsInfo(e),r=[],this.trigger("reset")}},ai.prototype=new fi,ni=function(e,t){var i,r,s,n=[],a=[];t=t||{},i=t.firstSequenceNumber||0,ni.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){vi.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.config,e.sps=[t.data],ki.forEach((function(t){e[t]=r[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||s||(s=t.data,e.pps=[t.data]),n.push(t)},this.flush=function(){var r,s,o,l,d,u,c,h,p=0;while(n.length){if("access_unit_delimiter_rbsp"===n[0].nalUnitType)break;n.shift()}if(0===n.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(r=gi.groupNalsIntoFrames(n),o=gi.groupFramesIntoGops(r),o[0][0].keyFrame||(s=this.getGopForFusion_(n[0],e),s?(p=s.duration,o.unshift(s),o.byteLength+=s.byteLength,o.nalCount+=s.nalCount,o.pts=s.pts,o.dts=s.dts,o.duration+=s.duration):o=gi.extendFirstKeyFrame(o)),a.length){var f;if(f=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o),!f)return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),n=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");vi.clearDtsInfo(e),o=f}vi.collectDtsInfo(e,o),e.samples=gi.generateSampleTable(o),d=mi.mdat(gi.concatenateNalData(o)),e.baseMediaDecodeTime=vi.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),c=o[0],h=o[o.length-1],this.trigger("segmentTimingInfo",Oi(e.baseMediaDecodeTime,c.dts,c.pts,h.dts+h.duration,h.pts+h.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),n=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),l=mi.moof(i,[e]),u=new Uint8Array(l.byteLength+d.byteLength),i++,u.set(l),u.set(d,l.byteLength),this.trigger("data",{track:e,boxes:u}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),n=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){vi.clearDtsInfo(e),r=void 0,s=void 0},this.getGopForFusion_=function(t){var i,r,s,n,a,o=45e3,l=1e4,d=1/0;for(a=0;a<this.gopCache_.length;a++)n=this.gopCache_[a],s=n.gop,e.pps&&Pi(e.pps[0],n.pps[0])&&e.sps&&Pi(e.sps[0],n.sps[0])&&(s.dts<e.timelineStartInfo.dts||(i=t.dts-s.dts-s.duration,i>=-l&&i<=o&&(!r||d>i)&&(r=n,d=i)));return r?r.gop:null},this.alignGopsAtStart_=function(e){var t,i,r,s,n,o,l,d;n=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;while(t<a.length&&i<e.length){if(r=a[t],s=e[i],r.pts===s.pts)break;s.pts>r.pts?t++:(i++,n-=s.byteLength,o-=s.nalCount,l-=s.duration)}return 0===i?e:i===e.length?null:(d=e.slice(i),d.byteLength=n,d.duration=l,d.nalCount=o,d.pts=d[0].pts,d.dts=d[0].dts,d)},this.alignGopsAtEnd_=function(e){var t,i,r,s,n,o,l;t=a.length-1,i=e.length-1,n=null,o=!1;while(t>=0&&i>=0){if(r=a[t],s=e[i],r.pts===s.pts){o=!0;break}r.pts>s.pts?t--:(t===a.length-1&&(n=i),i--)}if(!o&&null===n)return null;if(l=o?i:n,0===l)return e;var d=e.slice(l),u=d.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return d.byteLength=u.byteLength,d.duration=u.duration,d.nalCount=u.nalCount,d.pts=d[0].pts,d.dts=d[0].dts,d},this.alignGopsWith=function(e){a=e}},ni.prototype=new fi,li=function(e,t){this.numberOfTracks=0,this.metadataStream=t,e=e||{},"undefined"!==typeof e.remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"===typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,li.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},li.prototype=new fi,li.prototype.flush=function(e){var t,i,r,s,n=0,a={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,ki.forEach((function(e){a.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,xi.forEach((function(e){a.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,r=mi.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(r.byteLength),a.initSegment.set(r),a.data=new Uint8Array(this.pendingBytes),s=0;s<this.pendingBoxes.length;s++)a.data.set(this.pendingBoxes[s],n),n+=this.pendingBoxes[s].byteLength;for(s=0;s<this.pendingCaptions.length;s++)t=this.pendingCaptions[s],t.startTime=_i.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=_i.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),a.captionStreams[t.stream]=!0,a.captions.push(t);for(s=0;s<this.pendingMetadata.length;s++)i=this.pendingMetadata[s],i.cueTime=_i.metadataTsToSeconds(i.pts,o,this.keepOriginalTimestamps),a.metadata.push(i);for(a.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",a),s=0;s<a.captions.length;s++)t=a.captions[s],this.trigger("caption",t);for(s=0;s<a.metadata.length;s++)i=a.metadata[s],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},li.prototype.setRemux=function(e){this.remuxTracks=e},oi=function(e){var t,i,r=this,s=!0;oi.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="aac",s.metadataStream=new bi.MetadataStream,s.aacStream=new wi,s.audioTimestampRolloverStream=new bi.TimestampRolloverStream("audio"),s.timedMetadataTimestampRolloverStream=new bi.TimestampRolloverStream("timed-metadata"),s.adtsStream=new Ti,s.coalesceStream=new li(e,s.metadataStream),s.headOfPipeline=s.aacStream,s.aacStream.pipe(s.audioTimestampRolloverStream).pipe(s.adtsStream),s.aacStream.pipe(s.timedMetadataTimestampRolloverStream).pipe(s.metadataStream).pipe(s.coalesceStream),s.metadataStream.on("timestamp",(function(e){s.aacStream.setTimestamp(e.timeStamp)})),s.aacStream.on("data",(function(n){"timed-metadata"!==n.type&&"audio"!==n.type||s.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:r.baseMediaDecodeTime},codec:"adts",type:"audio"},s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new ai(i,e),s.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream),r.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))})),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),Ai(this,s)},this.setupTsPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="ts",s.metadataStream=new bi.MetadataStream,s.packetStream=new bi.TransportPacketStream,s.parseStream=new bi.TransportParseStream,s.elementaryStream=new bi.ElementaryStream,s.timestampRolloverStream=new bi.TimestampRolloverStream,s.adtsStream=new Ti,s.h264Stream=new Si,s.captionStream=new bi.CaptionStream(e),s.coalesceStream=new li(e,s.metadataStream),s.headOfPipeline=s.packetStream,s.packetStream.pipe(s.parseStream).pipe(s.elementaryStream).pipe(s.timestampRolloverStream),s.timestampRolloverStream.pipe(s.h264Stream),s.timestampRolloverStream.pipe(s.adtsStream),s.timestampRolloverStream.pipe(s.metadataStream).pipe(s.coalesceStream),s.h264Stream.pipe(s.captionStream).pipe(s.coalesceStream),s.elementaryStream.on("data",(function(n){var a;if("metadata"===n.type){a=n.tracks.length;while(a--)t||"video"!==n.tracks[a].type?i||"audio"!==n.tracks[a].type||(i=n.tracks[a],i.timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime):(t=n.tracks[a],t.timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime);t&&!s.videoSegmentStream&&(s.coalesceStream.numberOfTracks++,s.videoSegmentStream=new ni(t,e),s.videoSegmentStream.on("log",r.getLogTrigger_("videoSegmentStream")),s.videoSegmentStream.on("timelineStartInfo",(function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,s.audioSegmentStream.setEarliestDts(t.dts-r.baseMediaDecodeTime))})),s.videoSegmentStream.on("processedGopsInfo",r.trigger.bind(r,"gopInfo")),s.videoSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"videoSegmentTimingInfo")),s.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&s.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),s.videoSegmentStream.on("timingInfo",r.trigger.bind(r,"videoTimingInfo")),s.h264Stream.pipe(s.videoSegmentStream).pipe(s.coalesceStream)),i&&!s.audioSegmentStream&&(s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new ai(i,e),s.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),s.audioSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"audioSegmentTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream)),r.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}})),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("id3Frame",(function(e){e.dispatchType=s.metadataStream.dispatchType,r.trigger("id3Frame",e)})),s.coalesceStream.on("caption",this.trigger.bind(this,"caption")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),Ai(this,s)},this.setBaseMediaDecodeTime=function(r){var s=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=r),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,vi.clearDtsInfo(i),s.audioTimestampRolloverStream&&s.audioTimestampRolloverStream.discontinuity()),t&&(s.videoSegmentStream&&(s.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,vi.clearDtsInfo(t),s.captionStream.reset()),s.timestampRolloverStream&&s.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(s){var t=Ei(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),s=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){s=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},oi.prototype=new fi;var Li,Di={Transmuxer:oi,VideoSegmentStream:ni,AudioSegmentStream:ai,AUDIO_PROPERTIES:xi,VIDEO_PROPERTIES:ki,generateSegmentTimingInfo:Oi},Mi=function(e){return e>>>0},Ni=function(e){return("00"+e.toString(16)).slice(-2)},Ri={toUnsigned:Mi,toHexString:Ni},Ui=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3]),t},Bi=Ui,ji=Ri.toUnsigned,Fi=Bi,qi=function(e,t){var i,r,s,n,a,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)r=ji(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),s=Fi(e.subarray(i+4,i+8)),n=r>1?i+r:e.byteLength,s===t[0]&&(1===t.length?o.push(e.subarray(i+8,n)):(a=qi(e.subarray(i+8,n),t.slice(1)),a.length&&(o=o.concat(a)))),i=n;return o},$i=qi,Hi=Ri.toUnsigned,zi=$.getUint64,Vi=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=zi(e.subarray(4)):t.baseMediaDecodeTime=Hi(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},Gi=Vi,Wi=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},Xi=Wi,Yi=Xi,Ki=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},r=new DataView(e.buffer,e.byteOffset,e.byteLength),s=1&i.flags[2],n=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],d=8&i.flags[1],u=r.getUint32(4),c=8;s&&(i.dataOffset=r.getInt32(c),c+=4),n&&u&&(t={flags:Yi(e.subarray(c,c+4))},c+=4,a&&(t.duration=r.getUint32(c),c+=4),o&&(t.size=r.getUint32(c),c+=4),d&&(1===i.version?t.compositionTimeOffset=r.getInt32(c):t.compositionTimeOffset=r.getUint32(c),c+=4),i.samples.push(t),u--);while(u--)t={},a&&(t.duration=r.getUint32(c),c+=4),o&&(t.size=r.getUint32(c),c+=4),l&&(t.flags=Yi(e.subarray(c,c+4)),c+=4),d&&(1===i.version?t.compositionTimeOffset=r.getInt32(c):t.compositionTimeOffset=r.getUint32(c),c+=4),i.samples.push(t);return i},Ji=Ki,Qi=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},s=1&r.flags[2],n=2&r.flags[2],a=8&r.flags[2],o=16&r.flags[2],l=32&r.flags[2],d=65536&r.flags[0],u=131072&r.flags[0];return t=8,s&&(t+=4,r.baseDataOffset=i.getUint32(12),t+=4),n&&(r.sampleDescriptionIndex=i.getUint32(t),t+=4),a&&(r.defaultSampleDuration=i.getUint32(t),t+=4),o&&(r.defaultSampleSize=i.getUint32(t),t+=4),l&&(r.defaultSampleFlags=i.getUint32(t)),d&&(r.durationIsEmpty=!0),!s&&u&&(r.baseDataOffsetIsMoof=!0),r},Zi=Qi;Li="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{};var er,tr,ir,rr,sr,nr,ar=Li,or=Ne.discardEmulationPreventionBytes,lr=Je.CaptionStream,dr=$i,ur=Gi,cr=Ji,hr=Zi,pr=ar,fr=function(e,t){for(var i=e,r=0;r<t.length;r++){var s=t[r];if(i<s.size)return s;i-=s.size}return null},mr=function(e,t,i){var r,s,n,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(s=0;s+4<e.length;s+=n)if(n=o.getUint32(s),s+=4,!(n<=0))switch(31&e[s]){case 6:var d=e.subarray(s+1,s+1+n),u=fr(s,t);if(r={nalUnitType:"sei_rbsp",size:n,data:d,escapedRBSP:or(d),trackId:i},u)r.pts=u.pts,r.dts=u.dts,a=u;else{if(!a){l.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+s+" for trackId "+i+". See mux.js#223."});break}r.pts=a.pts,r.dts=a.dts}l.seiNals.push(r);break}return l},gr=function(e,t,i){var r=t,s=i.defaultSampleDuration||0,n=i.defaultSampleSize||0,a=i.trackId,o=[];return e.forEach((function(e){var t=cr(e),i=t.samples;i.forEach((function(e){void 0===e.duration&&(e.duration=s),void 0===e.size&&(e.size=n),e.trackId=a,e.dts=r,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"===typeof r?(e.pts=r+pr.BigInt(e.compositionTimeOffset),r+=pr.BigInt(e.duration)):(e.pts=r+e.compositionTimeOffset,r+=e.duration)})),o=o.concat(i)})),o},yr=function(e,t){var i=dr(e,["moof","traf"]),r=dr(e,["mdat"]),s={},n=[];return r.forEach((function(e,t){var r=i[t];n.push({mdat:e,traf:r})})),n.forEach((function(e){var i,r,n=e.mdat,a=e.traf,o=dr(a,["tfhd"]),l=hr(o[0]),d=l.trackId,u=dr(a,["tfdt"]),c=u.length>0?ur(u[0]).baseMediaDecodeTime:0,h=dr(a,["trun"]);t===d&&h.length>0&&(i=gr(h,c,l),r=mr(n,i,d),s[d]||(s[d]={seiNals:[],logs:[]}),s[d].seiNals=s[d].seiNals.concat(r.seiNals),s[d].logs=s[d].logs.concat(r.logs))})),s},vr=function(e,t,i){var r;if(null===t)return null;r=yr(e,t);var s=r[t]||{};return{seiNals:s.seiNals,logs:s.logs,timescale:i}},br=function(){var e,t,i,r,s,n,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new lr,a=!0,n=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/r,e.endTime=e.endPts/r,s.captions.push(e),s.captionStreams[e.stream]=!0})),e.on("log",(function(e){s.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"===typeof t&&0===Object.keys(t).length)&&(i!==e[0]||r!==t[i])},this.parse=function(e,n,a){var o;if(!this.isInitialized())return null;if(!n||!a)return null;if(this.isNewInit(n,a))i=n[0],r=a[i];else if(null===i||!r)return t.push(e),null;while(t.length>0){var l=t.shift();this.parse(l,n,a)}return o=vr(e,i,r),o&&o.logs&&(s.logs=s.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),s):s.logs.length?{logs:s.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;n?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){s.captions=[],s.captionStreams={},s.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,r=null,s?this.clearParsedCaptions():s={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},_r=br,Tr=Ri.toUnsigned,Sr=Ri.toHexString,wr=$i,Er=Bi,Cr=Zi,xr=Ji,kr=Gi,Ir=$.getUint64,Ar=ar;er=function(e){var t={},i=wr(e,["moov","trak"]);return i.reduce((function(e,t){var i,r,s,n,a;return i=wr(t,["tkhd"])[0],i?(r=i[0],s=0===r?12:20,n=Tr(i[s]<<24|i[s+1]<<16|i[s+2]<<8|i[s+3]),a=wr(t,["mdia","mdhd"])[0],a?(r=a[0],s=0===r?12:20,e[n]=Tr(a[s]<<24|a[s+1]<<16|a[s+2]<<8|a[s+3]),e):null):null}),t)},tr=function(e,t){var i;i=wr(t,["moof","traf"]);var r=i.reduce((function(t,i){var r,s=wr(i,["tfhd"])[0],n=Tr(s[4]<<24|s[5]<<16|s[6]<<8|s[7]),a=e[n]||9e4,o=wr(i,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);let d;return r=1===o[0]?Ir(o.subarray(4,12)):l.getUint32(4),"bigint"===typeof r?d=r/Ar.BigInt(a):"number"!==typeof r||isNaN(r)||(d=r/a),d<Number.MAX_SAFE_INTEGER&&(d=Number(d)),d<t&&(t=d),t}),1/0);return"bigint"===typeof r||isFinite(r)?r:0},ir=function(e,t){var i,r=wr(t,["moof","traf"]),s=0,n=0;if(r&&r.length){var a=wr(r[0],["tfhd"])[0],o=wr(r[0],["trun"])[0],l=wr(r[0],["tfdt"])[0];if(a){var d=Cr(a);i=d.trackId}if(l){var u=kr(l);s=u.baseMediaDecodeTime}if(o){var c=xr(o);c.samples&&c.samples.length&&(n=c.samples[0].compositionTimeOffset||0)}}var h=e[i]||9e4;"bigint"===typeof s&&(n=Ar.BigInt(n),h=Ar.BigInt(h));var p=(s+n)/h;return"bigint"===typeof p&&p<Number.MAX_SAFE_INTEGER&&(p=Number(p)),p},rr=function(e){var t=wr(e,["moov","trak"]),i=[];return t.forEach((function(e){var t=wr(e,["mdia","hdlr"]),r=wr(e,["tkhd"]);t.forEach((function(e,t){var s,n,a,o=Er(e.subarray(8,12)),l=r[t];"vide"===o&&(s=new DataView(l.buffer,l.byteOffset,l.byteLength),n=s.getUint8(0),a=0===n?s.getUint32(12):s.getUint32(20),i.push(a))}))})),i},nr=function(e){var t=e[0],i=0===t?12:20;return Tr(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])},sr=function(e){var t=wr(e,["moov","trak"]),i=[];return t.forEach((function(e){var t,r,s={},n=wr(e,["tkhd"])[0];n&&(t=new DataView(n.buffer,n.byteOffset,n.byteLength),r=t.getUint8(0),s.id=0===r?t.getUint32(12):t.getUint32(20));var a=wr(e,["mdia","hdlr"])[0];if(a){var o=Er(a.subarray(8,12));s.type="vide"===o?"video":"soun"===o?"audio":o}var l=wr(e,["mdia","minf","stbl","stsd"])[0];if(l){var d=l.subarray(8);s.codec=Er(d.subarray(4,8));var u,c,h=wr(d,[s.codec])[0];h&&(/^[asm]vc[1-9]$/i.test(s.codec)?(u=h.subarray(78),c=Er(u.subarray(4,8)),"avcC"===c&&u.length>11?(s.codec+=".",s.codec+=Sr(u[9]),s.codec+=Sr(u[10]),s.codec+=Sr(u[11])):s.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(s.codec)?(u=h.subarray(28),c=Er(u.subarray(4,8)),"esds"===c&&u.length>20&&0!==u[19]?(s.codec+="."+Sr(u[19]),s.codec+="."+Sr(u[20]>>>2&63).replace(/^0/,"")):s.codec="mp4a.40.2"):s.codec=s.codec.toLowerCase())}var p=wr(e,["mdia","mdhd"])[0];p&&(s.timescale=nr(p)),i.push(s)})),i};var Pr={findBox:wr,parseType:Er,timescale:er,startTime:tr,compositionStartTime:ir,videoTrackIds:rr,tracks:sr,getTimescaleFromMediaHeader:nr},Or=Qe,Lr=function(e){var t=31&e[1];return t<<=8,t|=e[2],t},Dr=function(e){return!!(64&e[1])},Mr=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},Nr=function(e,t){var i=Lr(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},Rr=function(e){var t=Dr(e),i=4+Mr(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},Ur=function(e){var t={},i=Dr(e),r=4+Mr(e);if(i&&(r+=e[r]+1),1&e[r+5]){var s,n,a;s=(15&e[r+1])<<8|e[r+2],n=3+s-4,a=(15&e[r+10])<<8|e[r+11];var o=12+a;while(o<n){var l=r+o;t[(31&e[l+1])<<8|e[l+2]]=e[l],o+=5+((15&e[l+3])<<8|e[l+4])}return t}},Br=function(e,t){var i=Lr(e),r=t[i];switch(r){case Or.H264_STREAM_TYPE:return"video";case Or.ADTS_STREAM_TYPE:return"audio";case Or.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},jr=function(e){var t=Dr(e);if(!t)return null;var i=4+Mr(e);if(i>=e.byteLength)return null;var r,s=null;return r=e[i+7],192&r&&(s={},s.pts=(14&e[i+9])<<27|(255&e[i+10])<<20|(254&e[i+11])<<12|(255&e[i+12])<<5|(254&e[i+13])>>>3,s.pts*=4,s.pts+=(6&e[i+13])>>>1,s.dts=s.pts,64&r&&(s.dts=(14&e[i+14])<<27|(255&e[i+15])<<20|(254&e[i+16])<<12|(255&e[i+17])<<5|(254&e[i+18])>>>3,s.dts*=4,s.dts+=(6&e[i+18])>>>1)),s},Fr=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},qr=function(e){for(var t,i=4+Mr(e),r=e.subarray(i),s=0,n=0,a=!1;n<r.byteLength-3;n++)if(1===r[n+2]){s=n+5;break}while(s<r.byteLength)switch(r[s]){case 0:if(0!==r[s-1]){s+=2;break}if(0!==r[s-2]){s++;break}n+3!==s-2&&(t=Fr(31&r[n+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(a=!0));do{s++}while(1!==r[s]&&s<r.length);n=s-2,s+=3;break;case 1:if(0!==r[s-1]||0!==r[s-2]){s+=3;break}t=Fr(31&r[n+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(a=!0),n=s-2,s+=3;break;default:s+=3;break}return r=r.subarray(n),s-=n,n=0,r&&r.byteLength>3&&(t=Fr(31&r[n+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(a=!0)),a},$r={parseType:Nr,parsePat:Rr,parsePmt:Ur,parsePayloadUnitStartIndicator:Dr,parsePesType:Br,parsePesTime:jr,videoPacketContainsKeyFrame:qr},Hr=Qe,zr=at.handleRollover,Vr={};Vr.ts=$r,Vr.aac=ii;var Gr=me.ONE_SECOND_IN_TS,Wr=188,Xr=71,Yr=function(e,t){var i,r,s=0,n=Wr;while(n<e.byteLength)if(e[s]!==Xr||e[n]!==Xr)s++,n++;else{switch(i=e.subarray(s,n),r=Vr.ts.parseType(i,t.pid),r){case"pat":t.pid=Vr.ts.parsePat(i);break;case"pmt":var a=Vr.ts.parsePmt(i);t.table=t.table||{},Object.keys(a).forEach((function(e){t.table[e]=a[e]}));break}s+=Wr,n+=Wr}},Kr=function(e,t,i){var r,s,n,a,o,l=0,d=Wr,u=!1;while(d<=e.byteLength)if(e[l]!==Xr||e[d]!==Xr&&d!==e.byteLength)l++,d++;else{switch(r=e.subarray(l,d),s=Vr.ts.parseType(r,t.pid),s){case"pes":n=Vr.ts.parsePesType(r,t.table),a=Vr.ts.parsePayloadUnitStartIndicator(r),"audio"===n&&a&&(o=Vr.ts.parsePesTime(r),o&&(o.type="audio",i.audio.push(o),u=!0));break}if(u)break;l+=Wr,d+=Wr}d=e.byteLength,l=d-Wr,u=!1;while(l>=0)if(e[l]!==Xr||e[d]!==Xr&&d!==e.byteLength)l--,d--;else{switch(r=e.subarray(l,d),s=Vr.ts.parseType(r,t.pid),s){case"pes":n=Vr.ts.parsePesType(r,t.table),a=Vr.ts.parsePayloadUnitStartIndicator(r),"audio"===n&&a&&(o=Vr.ts.parsePesTime(r),o&&(o.type="audio",i.audio.push(o),u=!0));break}if(u)break;l-=Wr,d-=Wr}},Jr=function(e,t,i){var r,s,n,a,o,l,d,u,c=0,h=Wr,p=!1,f={data:[],size:0};while(h<e.byteLength)if(e[c]!==Xr||e[h]!==Xr)c++,h++;else{switch(r=e.subarray(c,h),s=Vr.ts.parseType(r,t.pid),s){case"pes":if(n=Vr.ts.parsePesType(r,t.table),a=Vr.ts.parsePayloadUnitStartIndicator(r),"video"===n&&(a&&!p&&(o=Vr.ts.parsePesTime(r),o&&(o.type="video",i.video.push(o),p=!0)),!i.firstKeyFrame)){if(a&&0!==f.size){l=new Uint8Array(f.size),d=0;while(f.data.length)u=f.data.shift(),l.set(u,d),d+=u.byteLength;if(Vr.ts.videoPacketContainsKeyFrame(l)){var m=Vr.ts.parsePesTime(l);m?(i.firstKeyFrame=m,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}f.size=0}f.data.push(r),f.size+=r.byteLength}break}if(p&&i.firstKeyFrame)break;c+=Wr,h+=Wr}h=e.byteLength,c=h-Wr,p=!1;while(c>=0)if(e[c]!==Xr||e[h]!==Xr)c--,h--;else{switch(r=e.subarray(c,h),s=Vr.ts.parseType(r,t.pid),s){case"pes":n=Vr.ts.parsePesType(r,t.table),a=Vr.ts.parsePayloadUnitStartIndicator(r),"video"===n&&a&&(o=Vr.ts.parsePesTime(r),o&&(o.type="video",i.video.push(o),p=!0));break}if(p)break;c-=Wr,h-=Wr}},Qr=function(e,t){if(e.audio&&e.audio.length){var i=t;("undefined"===typeof i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=zr(e.dts,i),e.pts=zr(e.pts,i),e.dtsTime=e.dts/Gr,e.ptsTime=e.pts/Gr}))}if(e.video&&e.video.length){var r=t;if(("undefined"===typeof r||isNaN(r))&&(r=e.video[0].dts),e.video.forEach((function(e){e.dts=zr(e.dts,r),e.pts=zr(e.pts,r),e.dtsTime=e.dts/Gr,e.ptsTime=e.pts/Gr})),e.firstKeyFrame){var s=e.firstKeyFrame;s.dts=zr(s.dts,r),s.pts=zr(s.pts,r),s.dtsTime=s.dts/Gr,s.ptsTime=s.pts/Gr}}},Zr=function(e){var t,i=!1,r=0,s=null,n=null,a=0,o=0;while(e.length-o>=3){var l=Vr.aac.parseType(e,o);switch(l){case"timed-metadata":if(e.length-o<10){i=!0;break}if(a=Vr.aac.parseId3TagSize(e,o),a>e.length){i=!0;break}null===n&&(t=e.subarray(o,o+a),n=Vr.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if(a=Vr.aac.parseAdtsSize(e,o),a>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=Vr.aac.parseSampleRate(t)),r++,o+=a;break;default:o++;break}if(i)return null}if(null===s||null===n)return null;var d=Gr/s,u={audio:[{type:"audio",dts:n,pts:n},{type:"audio",dts:n+1024*r*d,pts:n+1024*r*d}]};return u},es=function(e){var t={pid:null,table:null},i={};for(var r in Yr(e,t),t.table)if(t.table.hasOwnProperty(r)){var s=t.table[r];switch(s){case Hr.H264_STREAM_TYPE:i.video=[],Jr(e,t,i),0===i.video.length&&delete i.video;break;case Hr.ADTS_STREAM_TYPE:i.audio=[],Kr(e,t,i),0===i.audio.length&&delete i.audio;break}}return i},ts=function(e,t){var i,r=Vr.aac.isLikelyAacData(e);return i=r?Zr(e):es(e),i&&(i.audio||i.video)?(Qr(i,t),i):null},is={inspect:ts,parseAudioPes_:Kr};const rs=function(e,t){t.on("data",(function(t){const i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};const r=t.data;t.data=r.buffer,e.postMessage({action:"data",segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){const i={start:{decode:me.videoTsToSeconds(t.start.dts),presentation:me.videoTsToSeconds(t.start.pts)},end:{decode:me.videoTsToSeconds(t.end.dts),presentation:me.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:me.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=me.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})})),t.on("audioSegmentTimingInfo",(function(t){const i={start:{decode:me.videoTsToSeconds(t.start.dts),presentation:me.videoTsToSeconds(t.start.pts)},end:{decode:me.videoTsToSeconds(t.end.dts),presentation:me.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:me.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=me.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:me.videoTsToSeconds(t.start),end:me.videoTsToSeconds(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:me.videoTsToSeconds(t.start),end:me.videoTsToSeconds(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))};class ss{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Di.Transmuxer(this.options),rs(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new _r,this.captionParser.init());const t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const i=Pr.startTime(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=Pr.tracks(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const i="number"!==typeof t||isNaN(t)?void 0:t*me.ONE_SECOND_IN_TS,r=is.inspect(e,i);let s=null;r&&(s={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1},s.hasVideo&&(s.videoStart=r.video[0].ptsTime),s.hasAudio&&(s.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:s,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(me.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(me.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new ss(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new ss(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})));var wo=bo(So);const Eo=(e,t,i)=>{const{type:r,initSegment:s,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:d}=e.data.segment;t.buffer.push({captions:n,captionStreams:a,metadata:o});const u=e.data.segment.boxes||{data:e.data.segment.data},c={type:r,data:new Uint8Array(u.data,u.data.byteOffset,u.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};"undefined"!==typeof l&&(c.videoFrameDtsTime=l),"undefined"!==typeof d&&(c.videoFramePtsTime=d),i(c)},Co=({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)},xo=(e,t)=>{t.gopInfo=e.data.gopInfo},ko=e=>{const{transmuxer:t,bytes:i,audioAppendStart:r,gopsToAlignWith:s,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:d,onVideoSegmentTimingInfo:u,onAudioSegmentTimingInfo:c,onId3:h,onCaptions:p,onDone:f,onEndedTimeline:m,onTransmuxerLog:g,isEndOfTimeline:y}=e,v={buffer:[]};let b=y;const _=i=>{t.currentTransmux===e&&("data"===i.data.action&&Eo(i,v,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&xo(i,v),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&d(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&u(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&c(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&h([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(b=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(b||(t.onmessage=null,Co({transmuxedData:v,callback:f}),Io(t))))};if(t.onmessage=_,r&&t.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(s)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:s}),"undefined"!==typeof n&&t.postMessage({action:"setRemux",remux:n}),i.byteLength){const e=i instanceof ArrayBuffer?i:i.buffer,r=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:e,byteOffset:r,byteLength:i.byteLength},[e])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Io=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"===typeof e.currentTransmux?e.currentTransmux():ko(e.currentTransmux))},Ao=(e,t)=>{e.postMessage({action:t}),Io(e)},Po=(e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void Ao(t,e);t.transmuxQueue.push(Ao.bind(null,t,e))},Oo=e=>{Po("reset",e)},Lo=e=>{Po("endTimeline",e)},Do=e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void ko(e);e.transmuxer.transmuxQueue.push(e)},Mo=e=>{const t=new wo;t.currentTransmux=null,t.transmuxQueue=[];const i=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t};var No={reset:Oo,endTimeline:Lo,transmux:Do,createTransmuxer:Mo};const Ro=function(e){const t=e.transmuxer,i=e.endAction||e.action,r=e.callback,s=y()({},e,{endAction:null,transmuxer:null,callback:null}),n=s=>{s.data.action===i&&(t.removeEventListener("message",n),s.data.data&&(s.data.data=new Uint8Array(s.data.data,e.byteOffset||0,e.byteLength||s.data.data.byteLength),e.data&&(e.data=s.data.data)),r(s.data))};if(t.addEventListener("message",n),e.data){const i=e.data instanceof ArrayBuffer;s.byteOffset=i?0:e.data.byteOffset,s.byteLength=e.data.byteLength;const r=[i?e.data:e.data.buffer];t.postMessage(s,r)}else t.postMessage(s)},Uo={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Bo=e=>{e.forEach(e=>{e.abort()})},jo=e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}),Fo=e=>{const t=e.target,i=Date.now()-t.requestTime,r={bandwidth:1/0,bytesReceived:0,roundTripTime:i||0};return r.bytesReceived=e.loaded,r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3),r},qo=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Uo.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Uo.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Uo.FAILURE,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Uo.FAILURE,xhr:t}:null,$o=(e,t,i)=>(r,s)=>{const n=s.response,a=qo(r,s);if(a)return i(a,e);if(16!==n.byteLength)return i({status:s.status,message:"Invalid HLS key at URL: "+s.uri,code:Uo.FAILURE,xhr:s},e);const o=new DataView(n),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=l;return i(null,e)},Ho=(e,t)=>{const i=Object(x["a"])(e.map.bytes);if("mp4"!==i){const r=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:`Found unsupported ${i||"unknown"} container for initialization segment at URL: ${r}`,code:Uo.FAILURE})}Ro({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:r})=>(e.map.bytes=r,i.forEach((function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"===typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))})),t(null))})},zo=({segment:e,finishProcessingFn:t})=>(i,r)=>{const s=qo(i,r);if(s)return t(s,e);const n=new Uint8Array(r.response);if(e.map.key)return e.map.encryptedBytes=n,t(null,e);e.map.bytes=n,Ho(e,(function(i){if(i)return i.xhr=r,i.status=r.status,t(i,e);t(null,e)}))},Vo=({segment:e,finishProcessingFn:t,responseType:i})=>(r,s)=>{const n=qo(r,s);if(n)return t(n,e);const a="arraybuffer"!==i&&s.responseText?go(s.responseText.substring(e.lastReachedChar||0)):s.response;return e.stats=jo(s),e.key?e.encryptedBytes=new Uint8Array(a):e.bytes=new Uint8Array(a),t(null,e)},Go=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u,doneFn:c,onTransmuxerLog:h})=>{const p=e.map&&e.map.tracks||{},f=Boolean(p.audio&&p.video);let m=r.bind(null,e,"audio","start");const g=r.bind(null,e,"audio","end");let y=r.bind(null,e,"video","start");const v=r.bind(null,e,"video","end"),b=()=>Do({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:f,onData:t=>{t.type="combined"===t.type?"video":t.type,u(e,t)},onTrackInfo:t=>{i&&(f&&(t.isMuxed=!0),i(e,t))},onAudioTimingInfo:e=>{m&&"undefined"!==typeof e.start&&(m(e.start),m=null),g&&"undefined"!==typeof e.end&&g(e.end)},onVideoTimingInfo:e=>{y&&"undefined"!==typeof e.start&&(y(e.start),y=null),v&&"undefined"!==typeof e.end&&v(e.end)},onVideoSegmentTimingInfo:e=>{s(e)},onAudioSegmentTimingInfo:e=>{n(e)},onId3:(t,i)=>{a(e,t,i)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:l,onEndedTimeline:()=>{d()},onTransmuxerLog:h,onDone:t=>{c&&(t.type="combined"===t.type?"video":t.type,c(null,e,t))}});Ro({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:r=>{e.bytes=t=r.data;const s=r.result;s&&(i(e,{hasAudio:s.hasAudio,hasVideo:s.hasVideo,isMuxed:f}),i=null,s.hasAudio&&!f&&m(s.audioStart),s.hasVideo&&y(s.videoStart),m=null,y=null),b()}})},Wo=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u,doneFn:c,onTransmuxerLog:h})=>{let p=new Uint8Array(t);if(Object(x["b"])(p)){e.isFmp4=!0;const{tracks:s}=e.map,n={isFmp4:!0,hasVideo:!!s.video,hasAudio:!!s.audio};s.audio&&s.audio.codec&&"enca"!==s.audio.codec&&(n.audioCodec=s.audio.codec),s.video&&s.video.codec&&"encv"!==s.video.codec&&(n.videoCodec=s.video.codec),s.video&&s.audio&&(n.isMuxed=!0),i(e,n);const a=t=>{u(e,{data:p,type:n.hasAudio&&!n.isMuxed?"audio":"video"}),t&&t.length&&o(e,t),c(null,e,{})};Ro({action:"probeMp4StartTime",timescales:e.map.timescales,data:p,transmuxer:e.transmuxer,callback:({data:i,startTime:o})=>{t=i.buffer,e.bytes=p=i,n.hasAudio&&!n.isMuxed&&r(e,"audio","start",o),n.hasVideo&&r(e,"video","start",o),s.video&&i.byteLength&&e.transmuxer?Ro({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:p,timescales:e.map.timescales,trackIds:[s.video.id],callback:i=>{t=i.data.buffer,e.bytes=p=i.data,i.logs.forEach((function(e){h(An(e,{stream:"mp4CaptionParser"}))})),a(i.captions)}}):a()}})}else if(e.transmuxer){if("undefined"===typeof e.container&&(e.container=Object(x["a"])(p)),"ts"!==e.container&&"aac"!==e.container)return i(e,{hasAudio:!1,hasVideo:!1}),void c(null,e,{});Go({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u,doneFn:c,onTransmuxerLog:h})}else c(null,e,{})},Xo=function({id:e,key:t,encryptedBytes:i,decryptionWorker:r},s){const n=t=>{if(t.data.source===e){r.removeEventListener("message",n);const e=t.data.decrypted;s(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};let a;r.addEventListener("message",n),a=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),r.postMessage($a({source:e,encrypted:i,key:a,iv:t.iv}),[i.buffer,a.buffer])},Yo=({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u,doneFn:c,onTransmuxerLog:h})=>{Xo({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},e=>{t.bytes=e,Wo({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u,doneFn:c,onTransmuxerLog:h})})},Ko=({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u,doneFn:c,onTransmuxerLog:h})=>{let p=0,f=!1;return(m,g)=>{if(!f){if(m)return f=!0,Bo(e),c(m,g);if(p+=1,p===e.length){const p=function(){if(g.encryptedBytes)return Yo({decryptionWorker:t,segment:g,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u,doneFn:c,onTransmuxerLog:h});Wo({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u,doneFn:c,onTransmuxerLog:h})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return Xo({decryptionWorker:t,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},t=>{g.map.bytes=t,Ho(g,t=>{if(t)return Bo(e),c(t,g);p()})});p()}}}},Jo=({loadendState:e,abortFn:t})=>i=>{const r=i.target;r.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)},Qo=({segment:e,progressFn:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u})=>i=>{const r=i.target;if(!r.aborted)return e.stats=An(e.stats,Fo(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)},Zo=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:r,abortFn:s,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:u,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:f,doneFn:m,onTransmuxerLog:g})=>{const y=[],v=Ko({activeXhrs:y,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:u,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:f,doneFn:m,onTransmuxerLog:g});if(r.key&&!r.key.bytes){const i=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&i.push(r.map.key);const s=An(t,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),n=$o(r,i,v),a=e(s,n);y.push(a)}if(r.map&&!r.map.bytes){const i=r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri);if(i){const i=An(t,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),s=$o(r,[r.map.key],v),n=e(i,s);y.push(n)}const s=An(t,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Ba(r.map)}),n=zo({segment:r,finishProcessingFn:v}),a=e(s,n);y.push(a)}const b=An(t,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:Ba(r)}),_=Vo({segment:r,finishProcessingFn:v,responseType:b.responseType}),T=e(b,_);T.addEventListener("progress",Qo({segment:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:u,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:p,dataFn:f})),y.push(T);const S={};return y.forEach(e=>{e.addEventListener("loadend",Jo({loadendState:S,abortFn:s}))}),()=>Bo(y)},el=In("CodecUtils"),tl=function(e){const t=e.attributes||{};if(t.CODECS)return Object(b["h"])(t.CODECS)},il=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},rl=(e,t)=>{if(!il(e,t))return!0;const i=t.attributes||{},r=e.mediaGroups.AUDIO[i.AUDIO];for(const s in r)if(!r[s].uri&&!r[s].playlists)return!0;return!1},sl=function(e){const t={};return e.forEach(({mediaType:e,type:i,details:r})=>{t[e]=t[e]||[],t[e].push(Object(b["i"])(`${i}${r}`))}),Object.keys(t).forEach((function(e){if(t[e].length>1)return el(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(t[e]=null);t[e]=t[e][0]})),t},nl=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},al=function(e,t){const i=t.attributes||{},r=sl(tl(t)||[]);if(il(e,t)&&!r.audio&&!rl(e,t)){const t=sl(Object(b["d"])(e,i.AUDIO)||[]);t.audio&&(r.audio=t.audio)}return r},ol=In("PlaylistSelector"),ll=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},dl=function(e,t){if(!e)return"";const i=s.a.getComputedStyle(e);return i?i[t]:""},ul=function(e,t){const i=e.slice();e.sort((function(e,r){const s=t(e,r);return 0===s?i.indexOf(e)-i.indexOf(r):s}))},cl=function(e,t){let i,r;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||s.a.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),r=r||s.a.Number.MAX_VALUE,i-r},hl=function(e,t){let i,r;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||s.a.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),r=r||s.a.Number.MAX_VALUE,i===r&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-r};let pl=function(e,t,i,r,n,a){if(!e)return;const o={bandwidth:t,width:i,height:r,limitRenditionByPlayerDimensions:n};let l=e.playlists;fa.isAudioOnly(e)&&(l=a.getAudioTrackPlaylists_(),o.audioOnly=!0);let d=l.map(e=>{let t;const i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,r=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||s.a.Number.MAX_VALUE,{bandwidth:t,width:i,height:r,playlist:e}});ul(d,(e,t)=>e.bandwidth-t.bandwidth),d=d.filter(e=>!fa.isIncompatible(e.playlist));let u=d.filter(e=>fa.isEnabled(e.playlist));u.length||(u=d.filter(e=>!fa.isDisabled(e.playlist)));const c=u.filter(e=>e.bandwidth*mo.BANDWIDTH_VARIANCE<t);let h=c[c.length-1];const p=c.filter(e=>e.bandwidth===h.bandwidth)[0];if(!1===n){const e=p||u[0]||d[0];if(e&&e.playlist){let t="sortedPlaylistReps";return p&&(t="bandwidthBestRep"),u[0]&&(t="enabledPlaylistReps"),ol(`choosing ${ll(e)} using ${t} with options`,o),e.playlist}return ol("could not choose a playlist with options",o),null}const f=c.filter(e=>e.width&&e.height);ul(f,(e,t)=>e.width-t.width);const m=f.filter(e=>e.width===i&&e.height===r);h=m[m.length-1];const g=m.filter(e=>e.bandwidth===h.bandwidth)[0];let y,v,b,_;if(g||(y=f.filter(e=>e.width>i||e.height>r),v=y.filter(e=>e.width===y[0].width&&e.height===y[0].height),h=v[v.length-1],b=v.filter(e=>e.bandwidth===h.bandwidth)[0]),a.leastPixelDiffSelector){const e=f.map(e=>(e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-r),e));ul(e,(e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff),_=e[0]}const T=_||b||g||p||u[0]||d[0];if(T&&T.playlist){let e="sortedPlaylistReps";return _?e="leastPixelDiffRep":b?e="resolutionPlusOneRep":g?e="resolutionBestRep":p?e="bandwidthBestRep":u[0]&&(e="enabledPlaylistReps"),ol(`choosing ${ll(T)} using ${e} with options`,o),T.playlist}return ol("could not choose a playlist with options",o),null};const fl=function(){const e=this.useDevicePixelRatio&&s.a.devicePixelRatio||1;return pl(this.playlists.main,this.systemBandwidth,parseInt(dl(this.tech_.el(),"width"),10)*e,parseInt(dl(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)},ml=function(e){let t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){const r=this.useDevicePixelRatio&&s.a.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),pl(this.playlists.main,t,parseInt(dl(this.tech_.el(),"width"),10)*r,parseInt(dl(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.playlistController_)}},gl=function(e){const{main:t,currentTime:i,bandwidth:r,duration:s,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,d=t.playlists.filter(e=>!fa.isIncompatible(e));let u=d.filter(fa.isEnabled);u.length||(u=d.filter(e=>!fa.isDisabled(e)));const c=u.filter(fa.hasAttribute.bind(null,"BANDWIDTH")),h=c.map(e=>{const t=l.getSyncPoint(e,s,o,i),d=t?1:2,u=fa.estimateSegmentRequestTime(n,r,e),c=u*d-a;return{playlist:e,rebufferingImpact:c}}),p=h.filter(e=>e.rebufferingImpact<=0);return ul(p,(e,t)=>cl(t.playlist,e.playlist)),p.length?p[0]:(ul(h,(e,t)=>e.rebufferingImpact-t.rebufferingImpact),h[0]||null)},yl=function(){const e=this.playlists.main.playlists.filter(fa.isEnabled);ul(e,(e,t)=>cl(e,t));const t=e.filter(e=>!!al(this.playlists.main,e).video);return t[0]||null},vl=e=>{let t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach(e=>{t.set(e,i),i+=e.byteLength})),t},bl=function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let r=i;/^cc708_/.test(i)&&(r="SERVICE"+i.split("_")[1]);const s=t.textTracks().getTrackById(r);if(s)e[i]=s;else{const s=t.options_.vhs&&t.options_.vhs.captionServices||{};let n=i,a=i,o=!1;const l=s[r];l&&(n=l.label,a=l.language,o=l.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:r,default:o,label:n,language:a},!1).track}}},_l=function({inbandTextTracks:e,captionArray:t,timestampOffset:i}){if(!t)return;const r=s.a.WebKitDataCue||s.a.VTTCue;t.forEach(t=>{const s=t.stream;e[s].addCue(new r(t.startTime+i,t.endTime+i,t.text))})},Tl=function(e){Object.defineProperties(e.frame,{id:{get(){return bn.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get(){return bn.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get(){return bn.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},Sl=({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:r})=>{if(!t)return;const n=s.a.WebKitDataCue||s.a.VTTCue,a=e.metadataTrack_;if(!a)return;if(t.forEach(e=>{const t=e.cueTime+i;!("number"!==typeof t||s.a.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach(e=>{const i=new n(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,Tl(i),a.addCue(i)})}),!a.cues||!a.cues.length)return;const o=a.cues,l=[];for(let s=0;s<o.length;s++)o[s]&&l.push(o[s]);const d=l.reduce((e,t)=>{const i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e},{}),u=Object.keys(d).sort((e,t)=>Number(e)-Number(t));u.forEach((e,t)=>{const i=d[e],s=Number(u[t+1])||r;i.forEach(e=>{e.endTime=s})})},wl=(e,t,i)=>{e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)},El=function(e,t,i){let r,s;if(i&&i.cues){r=i.cues.length;while(r--)s=i.cues[r],s.startTime>=e&&s.endTime<=t&&i.removeCue(s)}},Cl=function(e){const t=e.cues;if(t)for(let i=0;i<t.length;i++){const r=[];let s=0;for(let e=0;e<t.length;e++)t[i].startTime===t[e].startTime&&t[i].endTime===t[e].endTime&&t[i].text===t[e].text&&(s++,s>1&&r.push(t[e]));r.length&&r.forEach(t=>e.removeCue(t))}},xl=(e,t,i)=>{if("undefined"===typeof t||null===t||!e.length)return[];const r=Math.ceil((t-i+3)*k["ONE_SECOND_IN_TS"]);let s;for(s=0;s<e.length;s++)if(e[s].pts>r)break;return e.slice(s)},kl=(e,t,i)=>{if(!t.length)return e;if(i)return t.slice();const r=t[0].pts;let s=0;for(s;s<e.length;s++)if(e[s].pts>=r)break;return e.slice(0,s).concat(t)},Il=(e,t,i,r)=>{const s=Math.ceil((t-r)*k["ONE_SECOND_IN_TS"]),n=Math.ceil((i-r)*k["ONE_SECOND_IN_TS"]),a=e.slice();let o=e.length;while(o--)if(e[o].pts<=n)break;if(-1===o)return a;let l=o+1;while(l--)if(e[l].pts<=s)break;return l=Math.max(l,0),a.splice(l,o-l+1),a},Al=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;const i=Object.keys(e).sort(),r=Object.keys(t).sort();if(i.length!==r.length)return!1;for(let s=0;s<i.length;s++){const n=i[s];if(n!==r[s])return!1;if(e[n]!==t[n])return!1}return!0},Pl=22,Ol=function(e,t,i){t=t||[];const r=[];let s=0;for(let n=0;n<t.length;n++){const a=t[n];if(e===a.timeline&&(r.push(n),s+=a.duration,s>i))return n}return 0===r.length?0:r[r.length-1]},Ll=1,Dl=500,Ml=e=>"number"===typeof e&&isFinite(e),Nl=1/60,Rl=(e,t,i)=>"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null,Ul=(e,t,i)=>{let r=t-mo.BACK_BUFFER_LENGTH;e.length&&(r=Math.max(r,e.start(0)));const s=t-i;return Math.min(s,r)},Bl=e=>{const{startOfSegment:t,duration:i,segment:r,part:s,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:d,timeline:u}=e,c=o.length-1;let h="mediaIndex/partIndex increment";e.getMediaInfoForTime?h=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(h="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(h+=" with independent "+e.independent);const p="number"===typeof d,f=e.segment.uri?"segment":"pre-segment",m=p?Wn({preloadSegment:r})-1:0;return`${f} [${n+l}/${n+c}]`+(p?` part [${d}/${m}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(p?` part start/end [${s.start} => ${s.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${u}]`+` selected by [${h}]`+` playlist [${a}]`},jl=e=>e+"TimingInfo",Fl=({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:r,overrideCheck:s})=>s||e!==t?e<t?i:r.length?r.end(r.length-1):i:null,ql=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:r,audioDisabled:s})=>{if(t===i)return!1;if("audio"===r){const t=e.lastTimelineChange({type:"main"});return!t||t.to!==i}if("main"===r&&s){const t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==i}return!1},$l=e=>{let t=0;return["video","audio"].forEach((function(i){const r=e[i+"TimingInfo"];if(!r)return;const{start:n,end:a}=r;let o;"bigint"===typeof n||"bigint"===typeof a?o=s.a.BigInt(a)-s.a.BigInt(n):"number"===typeof n&&"number"===typeof a&&(o=a-n),"undefined"!==typeof o&&o>t&&(t=o)})),"bigint"===typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t},Hl=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+On,zl=(e,t)=>{if("hls"!==t)return null;const i=$l({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;const r=e.playlist.targetDuration,s=Hl({segmentDuration:i,maxDuration:2*r}),n=Hl({segmentDuration:i,maxDuration:r}),a=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${i} when the reported duration is ${e.duration} and the target duration is ${r}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return s||n?{severity:s?"warn":"info",message:a}:null};class Vl extends bn.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if("function"!==typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=bn.browser.IE_VERSION>=11,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=In(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})}createTransmuxer_(){return No.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&s.a.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,s.a.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return"undefined"!==typeof e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&No.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Pn();if("main"===this.loaderType_){const{hasAudio:t,hasVideo:i,isMuxed:r}=e;if(i&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=Ha(e);let r=this.initSegments_[i];return t&&!r&&e.bytes&&(this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const i=za(e);let r=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[i]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const s={resolvedUri:(r||e).resolvedUri};return r&&(s.bytes=r.bytes),s}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const i=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let s=null;if(i&&(i.id?s=i.id:i.uri&&(s=i.uri)),this.logger_(`playlist update [${s} => ${e.id||e.uri}]`),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");const n=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${n}]`),null!==this.mediaIndex)if(this.mediaIndex-=n,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){const e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}r&&(r.mediaIndex-=n,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(s.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.resyncLoader()}resyncLoader(){this.transmuxer_&&No.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=(()=>{}),r=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let s=1;const n=()=>{s--,0===s&&i()};!r&&this.audioDisabled_||(s++,this.sourceUpdater_.removeAudio(e,t,n)),(r||"main"===this.loaderType_)&&(this.gopBuffer_=Il(this.gopBuffer_,e,t,this.timeMapping_),s++,this.sourceUpdater_.removeVideo(e,t,n));for(const a in this.inbandTextTracks_)El(e,t,this.inbandTextTracks_[a]);El(e,t,this.segmentMetadataTrack_),n()}monitorBuffer_(){this.checkBufferTimeout_&&s.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=s.a.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&s.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=s.a.setTimeout(this.monitorBufferTick_.bind(this),Dl)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();e&&("number"===typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const r="number"===typeof e&&t.segments[e],s=e+1===t.segments.length,n=!r||!r.parts||i+1===r.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&s&&n}chooseNextRequest_(){const e=this.buffered_(),t=$n(e)||0,i=Hn(e,this.currentTime_()),r=!this.hasPlayed_()&&i>=1,s=i>=this.goalBufferLength_(),n=this.playlist_.segments;if(!n.length||r||s)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest)a.mediaIndex=Ol(this.currentTimeline_,n,t);else if(null!==this.mediaIndex){const e=n[this.mediaIndex],i="number"===typeof this.partIndex?this.partIndex:-1;a.startOfSegment=e.end?e.end:t,e.parts&&e.parts[i+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=i+1):a.mediaIndex=this.mediaIndex+1}else{const{segmentIndex:e,startTime:i,partIndex:r}=fa.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});a.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),a.mediaIndex=e,a.startOfSegment=i,a.partIndex=r}const o=n[a.mediaIndex];let l=o&&"number"===typeof a.partIndex&&o.parts&&o.parts[a.partIndex];if(!o||"number"===typeof a.partIndex&&!l)return null;if("number"!==typeof a.partIndex&&o.parts&&(a.partIndex=0,l=o.parts[0]),!i&&l&&!l.independent)if(0===a.partIndex){const e=n[a.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(a.mediaIndex-=1,a.partIndex=e.parts.length-1,a.independent="previous segment")}else o.parts[a.partIndex-1].independent&&(a.partIndex-=1,a.independent="previous part");const d=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=n.length-1&&d&&!this.seeking_()?null:this.generateSegmentInfo_(a)}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:r,startOfSegment:s,isSyncRequest:n,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e,d=i.segments[r],u="number"===typeof a&&d.parts[a],c={requestId:"segment-loader-"+Math.random(),uri:u&&u.resolvedUri||d.resolvedUri,mediaIndex:r,partIndex:u?a:null,isSyncRequest:n,startOfSegment:s,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:d.timeline,duration:u&&u.duration||d.duration,segment:d,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},h="undefined"!==typeof o?o:this.isPendingTimestampOffset_;c.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:d.timeline,currentTimeline:this.currentTimeline_,startOfSegment:s,buffered:this.buffered_(),overrideCheck:h});const p=$n(this.sourceUpdater_.audioBuffered());return"number"===typeof p&&(c.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(c.gopsToAlignWith=xl(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),c}timestampOffsetForSegment_(e){return Fl(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,r=this.pendingSegment_.duration,s=fa.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),n=jn(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(s<=n)return;const a=gl({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:n,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a)return;const o=s-n,l=o-a.rebufferingImpact;let d=.5;n<=On&&(d=1),!a.playlist||a.playlist.uri===this.playlist_.uri||l<d||(this.bandwidth=a.playlist.attributes.BANDWIDTH*mo.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_("Aborting "+Bl(e)),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},Al(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))}handleTimingInfo_(e,t,i,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const s=this.pendingSegment_,n=jl(t);s[n]=s[n]||{},s[n][i]=r,this.logger_(`timinginfo: ${t} - ${i} - ${r}`),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");const i=this.pendingSegment_;if(!i.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));const r=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),s={};t.forEach(e=>{s[e.stream]=s[e.stream]||{startTime:1/0,captions:[],endTime:0};const t=s[e.stream];t.startTime=Math.min(t.startTime,e.startTime+r),t.endTime=Math.max(t.endTime,e.endTime+r),t.captions.push(e)}),Object.keys(s).forEach(e=>{const{startTime:t,endTime:i,captions:n}=s[e],a=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${i} for ${e}`),bl(a,this.vhs_.tech_,e),El(t,i,a[e]),_l({captionArray:n,inbandTextTracks:a,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const r=this.pendingSegment_;if(!r.hasAppendedData_)return void this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));const s=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();wl(this.inbandTextTracks_,i,this.vhs_.tech_),Sl({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:s,videoDuration:this.duration_()})}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(e=>e())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;const e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!ql({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:r,isMuxed:s}=t;return!(r&&!e.videoTimingInfo)&&(!(i&&!this.audioDisabled_&&!s&&!e.audioTimingInfo)&&!ql({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return void this.callQueue_.push(this.handleData_.bind(this,e,t));const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[jl(t.type)].start;else{const e=this.getCurrentMediaInfo_(),t="main"===this.loaderType_&&e&&e.hasVideo;let r;t&&(r=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:r,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});const e=this.chooseNextRequest_();if(e.mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!==typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:r}){if(i){const e=Ha(i);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Fn(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Fn(a).join(", "));const o=n.length?n.start(0):0,l=n.length?n.end(n.length-1):0,d=a.length?a.start(0):0,u=a.length?a.end(a.length-1):0;if(l-o<=Ll&&u-d<=Ll)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Fn(n).join(", ")}, video buffer: ${Fn(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const c=this.currentTime_(),h=c-Ll;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+h),this.remove(0,h,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Ll}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=s.a.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3*Ll)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){r&&(r.code!==Pl?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error(`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:r,bytes:s}){if(!s){const e=[r];let t=r.byteLength;i&&(e.unshift(i),t+=i.byteLength),s=vl({bytes:t,segments:e})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:s},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:s}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,s=e+"TimingInfo";r[s]||(r[s]={}),r[s].transmuxerPrependedSeconds=i.prependedContentDuration||0,r[s].transmuxedPresentationStart=i.start.presentation,r[s].transmuxedDecodeStart=i.start.decode,r[s].transmuxedPresentationEnd=i.end.presentation,r[s].transmuxedDecodeEnd=i.end.decode,r[s].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:r}=t;if(!r||!r.byteLength)return;if("audio"===i&&this.audioDisabled_)return;const s=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:s,data:r})}loadSegment_(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"===typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(()=>{const t=y()({},e,{forceTimestampOffset:!0});y()(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)})}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,s=e.timeline!==this.currentTimeline_&&e.timeline>0,n=i||r&&s;this.logger_("Requesting "+Bl(e)),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Zo({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:n,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:r})=>{this.logger_(`${Bl(e)} logged from transmuxer stream ${r} as a ${i}: ${t}`)}})}trimBackBuffer_(e){const t=Ul(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,r={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},s=e.playlist.segments[e.mediaIndex-1];if(s&&s.timeline===t.timeline&&(s.videoTimingInfo?r.baseStartTime=s.videoTimingInfo.transmuxedDecodeEnd:s.audioTimingInfo&&(r.baseStartTime=s.audioTimingInfo.transmuxedDecodeEnd)),t.key){const i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);r.key=this.segmentKey(t.key),r.key.iv=i}return t.map&&(r.map=this.initSegmentForMap(t.map)),r}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<Nl?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+Nl):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return;if(t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Uo.ABORTED)return;return this.pause(),e.code===Uo.TIMEOUT?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=kl(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"===typeof e.start&&"number"===typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:s,useVideoTimingInfo:n,videoTimingInfo:a,audioTimingInfo:o}){if("undefined"!==typeof e)return e;if(!n)return o.start;const l=t.segments[i-1];return 0!==i&&l&&"undefined"!==typeof l.start&&l.end===r+s?a.start:r}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),void this.trigger("error");const{hasAudio:i,hasVideo:r,isMuxed:s}=t,n="main"===this.loaderType_&&r,a=!this.audioDisabled_&&i&&!s;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!==typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);n&&e.waitingOnAppends++,a&&e.waitingOnAppends++,n&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),a&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=Rl(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!==typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&"number"===typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"===typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo,r=i&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end="number"===typeof r.end?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());const e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});const t=zl(e,this.sourceType_);if(t&&("warn"===t.severity?bn.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_("Throwing away un-appended sync request "+Bl(e));this.logger_("Appended "+Bl(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,r=e.part,s=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,n=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(s||n)return this.logger_(`bad ${s?"segment":"part"} ${Bl(e)}`),void this.resetEverything();const a=null!==this.mediaIndex;a&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<Nl)return void this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+Nl);const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,r=t.end;if(!Ml(i)||!Ml(r))return;El(i,r,this.segmentMetadataTrack_);const n=s.a.WebKitDataCue||s.a.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:r},o=JSON.stringify(a),l=new n(i,r,o);l.value=a,this.segmentMetadataTrack_.addCue(l)}}function Gl(){}const Wl=function(e){return"string"!==typeof e?e:e.replace(/./,e=>e.toUpperCase())},Xl=["video","audio"],Yl=(e,t)=>{const i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e]},Kl=(e,t)=>{for(let i=0;i<t.length;i++){const r=t[i];if("mediaSource"===r.type)return null;if(r.type===e)return i}return null},Jl=(e,t)=>{if(0===t.queue.length)return;let i=0,r=t.queue[i];if("mediaSource"!==r.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!Yl(e,t)){if(r.type!==e){if(i=Kl(e,t.queue),null===i)return;r=t.queue[i]}return t.queue.splice(i,1),t.queuePending[e]=r,r.action(e,t),r.doneFn?void 0:(t.queuePending[e]=null,void Jl(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),r.action(t),r.doneFn&&r.doneFn(),Jl("audio",t),Jl("video",t))},Ql=(e,t)=>{const i=t[e+"Buffer"],r=Wl(e);i&&(i.removeEventListener("updateend",t[`on${r}UpdateEnd_`]),i.removeEventListener("error",t[`on${r}Error_`]),t.codecs[e]=null,t[e+"Buffer"]=null)},Zl=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),ed={appendBuffer:(e,t,i)=>(r,s)=>{const n=s[r+"Buffer"];if(Zl(s.mediaSource,n)){s.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${r}Buffer`);try{n.appendBuffer(e)}catch(a){s.logger_(`Error with code ${a.code} `+(a.code===Pl?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${r}Buffer`),s.queuePending[r]=null,i(a)}}},remove:(e,t)=>(i,r)=>{const s=r[i+"Buffer"];if(Zl(r.mediaSource,s)){r.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{s.remove(e,t)}catch(n){r.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},timestampOffset:e=>(t,i)=>{const r=i[t+"Buffer"];Zl(i.mediaSource,r)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),r.timestampOffset=e)},callback:e=>(t,i)=>{e()},endOfStream:e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(i){bn.log.warn("Failed to call media source endOfStream",i)}}},duration:e=>t=>{t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(i){bn.log.warn("Failed to set media source duration",i)}},abort:()=>(e,t)=>{if("open"!==t.mediaSource.readyState)return;const i=t[e+"Buffer"];if(Zl(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(r){bn.log.warn(`Failed to abort on ${e}Buffer`,r)}}},addSourceBuffer:(e,t)=>i=>{const r=Wl(e),s=Object(b["e"])(t);i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const n=i.mediaSource.addSourceBuffer(s);n.addEventListener("updateend",i[`on${r}UpdateEnd_`]),n.addEventListener("error",i[`on${r}Error_`]),i.codecs[e]=t,i[e+"Buffer"]=n},removeSourceBuffer:e=>t=>{const i=t[e+"Buffer"];if(Ql(e,t),Zl(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(r){bn.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,r)}}},changeType:e=>(t,i)=>{const r=i[t+"Buffer"],s=Object(b["e"])(e);Zl(i.mediaSource,r)&&i.codecs[t]!==e&&(i.logger_(`changing ${t}Buffer codec from ${i.codecs[t]} to ${e}`),r.changeType(s),i.codecs[t]=e)}},td=({type:e,sourceUpdater:t,action:i,doneFn:r,name:s})=>{t.queue.push({type:e,action:i,doneFn:r,name:s}),Jl(e,t)},id=(e,t)=>i=>{if(t.queuePending[e]){const i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[e+"Error_"])}Jl(e,t)};class rd extends bn.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Jl("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=In("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=id("video",this),this.onAudioUpdateEnd_=id("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){td({type:"mediaSource",sourceUpdater:this,action:ed.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){td({type:e,sourceUpdater:this,action:ed.abort(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?td({type:"mediaSource",sourceUpdater:this,action:ed.removeSourceBuffer(e),name:"removeSourceBuffer"}):bn.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!bn.browser.IE_VERSION&&!bn.browser.IS_FIREFOX&&s.a.MediaSource&&s.a.MediaSource.prototype&&"function"===typeof s.a.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return s.a.SourceBuffer&&s.a.SourceBuffer.prototype&&"function"===typeof s.a.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?td({type:e,sourceUpdater:this,action:ed.changeType(t),name:"changeType"}):bn.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!==typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:r,bytes:s}=e;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${s.length} until video append`);const n=t;if(td({type:r,sourceUpdater:this,action:ed.appendBuffer(s,i||{mediaIndex:-1},n),doneFn:t,name:"appendBuffer"}),"video"===r){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){return Zl(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Pn()}videoBuffered(){return Zl(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Pn()}buffered(){const e=Zl(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Zl(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():Un(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Gl){td({type:"mediaSource",sourceUpdater:this,action:ed.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Gl){"string"!==typeof e&&(e=void 0),td({type:"mediaSource",sourceUpdater:this,action:ed.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=Gl){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?td({type:"audio",sourceUpdater:this,action:ed.remove(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=Gl){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?td({type:"video",sourceUpdater:this,action:ed.remove(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!Yl("audio",this)&&!Yl("video",this))}audioTimestampOffset(e){return"undefined"!==typeof e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(td({type:"audio",sourceUpdater:this,action:ed.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return"undefined"!==typeof e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(td({type:"video",sourceUpdater:this,action:ed.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&td({type:"audio",sourceUpdater:this,action:ed.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&td({type:"video",sourceUpdater:this,action:ed.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),Xl.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[e+"QueueCallback"](()=>Ql(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const sd=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),nd=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class ad extends Vl{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.loaderType_="subtitle",this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Pn();const e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return Pn([[t,i]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=Ha(e);let r=this.initSegments_[i];if(t&&!r&&e.bytes){const t=nd.byteLength+e.bytes.byteLength,s=new Uint8Array(t);s.set(e.bytes),s.set(nd,e.bytes.byteLength),this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:s}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return"undefined"===typeof e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){El(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){const e=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",e),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){while(e&&e.segment.empty){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Uo.TIMEOUT&&this.handleTimeout_(),e.code===Uo.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!==typeof s.a.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){let r;const s=()=>{this.subtitlesTrack_.tech_.off("vttjsloaded",r),this.stopForError({message:"Error loading vtt.js"})};return r=()=>{this.subtitlesTrack_.tech_.off("vttjserror",s),this.segmentRequestFinished_(e,t,i)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",r),void this.subtitlesTrack_.tech_.one("vttjserror",s)}n.requested=!0;try{this.parseVTTCues_(r)}catch(a){return void this.stopForError({message:a.message})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new s.a.VTTCue(e.startTime,e.endTime,e.text):e)}),Cl(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,i=!1;"function"===typeof s.a.TextDecoder?t=new s.a.TextDecoder("utf8"):(t=s.a.WebVTT.StringDecoder(),i=!0);const r=new s.a.WebVTT.Parser(s.a,s.a.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=t=>{e.timestampmap=t},r.onparsingerror=e=>{bn.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=sd(t)),r.parse(t)}let n=e.bytes;i&&(n=sd(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,i){const r=e.segment;if(!t)return;if(!e.cues.length)return void(r.empty=!0);const s=e.timestampmap,n=s.MPEGTS/k["ONE_SECOND_IN_TS"]-s.LOCAL+t.mapping;if(e.cues.forEach(e=>{e.startTime+=n,e.endTime+=n}),!i.syncInfo){const t=e.cues[0].startTime,s=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,s-r.duration)}}}}const od=function(e,t){const i=e.cues;for(let r=0;r<i.length;r++){const e=i[r];if(t>=e.adStartTime&&t<=e.adEndTime)return e}return null},ld=function(e,t,i=0){if(!e.segments)return;let r,n=i;for(let a=0;a<e.segments.length;a++){const i=e.segments[a];if(r||(r=od(t,n+i.duration/2)),r){if("cueIn"in i){r.endTime=n,r.adEndTime=n,n+=i.duration,r=null;continue}if(n<r.endTime){n+=i.duration;continue}r.endTime+=i.duration}else if("cueOut"in i&&(r=new s.a.VTTCue(n,n+i.duration,i.cueOut),r.adStartTime=n,r.adEndTime=n+parseFloat(i.cueOut),t.addCue(r)),"cueOutCont"in i){const[e,a]=i.cueOutCont.split("/").map(parseFloat);r=new s.a.VTTCue(n,n+i.duration,""),r.adStartTime=n-e,r.adEndTime=r.adStartTime+a,t.addCue(r)}n+=i.duration}},dd=86400,ud=[{name:"VOD",run:(e,t,i,r,s)=>{if(i!==1/0){const e={time:0,segmentIndex:0,partIndex:null};return e}return null}},{name:"ProgramDateTime",run:(e,t,i,r,s)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let n=null,a=null;const o=Vn(t);s=s||0;for(let l=0;l<o.length;l++){const i=t.endList||0===s?l:o.length-(l+1),r=o[i],d=r.segment,u=e.timelineToDatetimeMappings[d.timeline];if(!u||!d.dateTimeObject)continue;const c=d.dateTimeObject.getTime()/1e3;let h=c+u;if(d.parts&&"number"===typeof r.partIndex)for(let e=0;e<r.partIndex;e++)h+=d.parts[e].duration;const p=Math.abs(s-h);if(null!==a&&(0===p||a<p))break;a=p,n={time:h,segmentIndex:r.segmentIndex,partIndex:r.partIndex}}return n}},{name:"Segment",run:(e,t,i,r,s)=>{let n=null,a=null;s=s||0;const o=Vn(t);for(let l=0;l<o.length;l++){const e=t.endList||0===s?l:o.length-(l+1),i=o[e],d=i.segment,u=i.part&&i.part.start||d&&d.start;if(d.timeline===r&&"undefined"!==typeof u){const e=Math.abs(s-u);if(null!==a&&a<e)break;(!n||null===a||a>=e)&&(a=e,n={time:u,segmentIndex:i.segmentIndex,partIndex:i.partIndex})}}return n}},{name:"Discontinuity",run:(e,t,i,r,s)=>{let n=null;if(s=s||0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let r=0;r<t.discontinuityStarts.length;r++){const a=t.discontinuityStarts[r],o=t.discontinuitySequence+r+1,l=e.discontinuities[o];if(l){const e=Math.abs(s-l.time);if(null!==i&&i<e)break;(!n||null===i||i>=e)&&(i=e,n={time:l.time,segmentIndex:a,partIndex:null})}}}return n}},{name:"Playlist",run:(e,t,i,r,s)=>{if(t.syncInfo){const e={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return e}return null}}];class cd extends bn.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.logger_=In("SyncController")}getSyncPoint(e,t,i,r){const s=this.runStrategies_(e,t,i,r);return s.length?this.selectSyncPoint_(s,{key:"time",value:r}):null}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const r=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Zn({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r){const s=[];for(let n=0;n<ud.length;n++){const a=ud[n],o=a.run(this,e,t,i,r);o&&(o.strategy=a.name,s.push({strategy:a.name,syncPoint:o}))}return s}selectSyncPoint_(e,t){let i=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),s=e[0].strategy;for(let n=1;n<e.length;n++){const a=Math.abs(e[n].syncPoint[t.key]-t.value);a<r&&(r=a,i=e[n].syncPoint,s=e[n].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${s}]: [time:${i.time}, segmentIndex:`+i.segmentIndex+("number"===typeof i.partIndex?",partIndex:"+i.partIndex:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>dd)bn.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let r=i-1;r>=0;r--){const i=e.segments[r];if(i&&"undefined"!==typeof i.start){t.syncInfo={mediaSequence:e.mediaSequence+r,time:i.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const s=r.dateTimeObject;r.discontinuity&&t&&s&&(this.timelineToDatetimeMappings[r.timeline]=-s.getTime()/1e3)}timestampOffsetForTimeline(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const r=e.segment,s=e.part;let n,a,o=this.timelines[e.timeline];if("number"===typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),n=e.startOfSegment,a=t.end+o.mapping;else{if(!o)return!1;n=t.start+o.mapping,a=t.end+o.mapping}return s&&(s.start=n,s.end=a),(!r.start||n<r.start)&&(r.start=n),r.end=a,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){const s=t.discontinuityStarts[r],n=t.discontinuitySequence+r+1,a=s-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[n]||this.discontinuities[n].accuracy>o){let r;r=a<0?i.start-Zn({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:s}):i.end+Zn({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:s}),this.discontinuities[n]={time:r,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class hd extends bn.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return"number"===typeof t&&"number"===typeof i&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){return"number"===typeof t&&"number"===typeof i&&(this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const pd=_o(To((function(){var t=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,r=0;r<i;++r)t[r].call(this,arguments[1]);else for(var s=Array.prototype.slice.call(arguments,1),n=t.length,a=0;a<n;++a)t[a].apply(this,s)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();
|
29
29
|
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function i(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}
|
30
|
-
/*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */const r=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],r=t[4],s=i[4];let n,a,o;const l=[],d=[];let u,c,h,p,f,m;for(n=0;n<256;n++)d[(l[n]=n<<1^283*(n>>7))^n]=n;for(a=o=0;!r[a];a^=u||1,o=d[o]||1)for(p=o^o<<1^o<<2^o<<3^o<<4,p=p>>8^255&p^99,r[a]=p,s[p]=a,h=l[c=l[u=l[a]]],m=16843009*h^65537*c^257*u^16843008*a,f=257*l[p]^16843008*p,n=0;n<4;n++)t[n][a]=f=f<<24^f>>>8,i[n][p]=m=m<<24^m>>>8;for(n=0;n<5;n++)t[n]=t[n].slice(0),i[n]=i[n].slice(0);return e};let s=null;class n{constructor(e){let t,i,n;s||(s=r()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];const a=this._tables[0][4],o=this._tables[1],l=e.length;let d=1;if(4!==l&&6!==l&&8!==l)throw new Error("Invalid aes key size");const u=e.slice(0),c=[];for(this._key=[u,c],t=l;t<4*l+28;t++)n=u[t-1],(t%l===0||8===l&&t%l===4)&&(n=a[n>>>24]<<24^a[n>>16&255]<<16^a[n>>8&255]<<8^a[255&n],t%l===0&&(n=n<<8^n>>>24^d<<24,d=d<<1^283*(d>>7))),u[t]=u[t-l]^n;for(i=0;t;i++,t--)n=u[3&i?t:t-4],c[i]=t<=4||i<4?n:o[0][a[n>>>24]]^o[1][a[n>>16&255]]^o[2][a[n>>8&255]]^o[3][a[255&n]]}decrypt(e,t,i,r,s,n){const a=this._key[1];let o,l,d,u=e^a[0],c=r^a[1],h=i^a[2],p=t^a[3];const f=a.length/4-2;let m,g=4;const y=this._tables[1],v=y[0],b=y[1],_=y[2],T=y[3],S=y[4];for(m=0;m<f;m++)o=v[u>>>24]^b[c>>16&255]^_[h>>8&255]^T[255&p]^a[g],l=v[c>>>24]^b[h>>16&255]^_[p>>8&255]^T[255&u]^a[g+1],d=v[h>>>24]^b[p>>16&255]^_[u>>8&255]^T[255&c]^a[g+2],p=v[p>>>24]^b[u>>16&255]^_[c>>8&255]^T[255&h]^a[g+3],g+=4,u=o,c=l,h=d;for(m=0;m<4;m++)s[(3&-m)+n]=S[u>>>24]<<24^S[c>>16&255]<<16^S[h>>8&255]<<8^S[255&p]^a[g++],o=u,u=c,c=h,h=p,p=o}}class a extends t{constructor(){super(t),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const o=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},l=function(e,t,i){const r=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),s=new n(Array.prototype.slice.call(t)),a=new Uint8Array(e.byteLength),l=new Int32Array(a.buffer);let d,u,c,h,p,f,m,g,y;for(d=i[0],u=i[1],c=i[2],h=i[3],y=0;y<r.length;y+=4)p=o(r[y]),f=o(r[y+1]),m=o(r[y+2]),g=o(r[y+3]),s.decrypt(p,f,m,g,l,y),l[y]=o(l[y]^d),l[y+1]=o(l[y+1]^u),l[y+2]=o(l[y+2]^c),l[y+3]=o(l[y+3]^h),d=p,u=f,c=m,h=g;return a};class d{constructor(e,t,r,s){const n=d.STEP,l=new Int32Array(e.buffer),u=new Uint8Array(e.byteLength);let c=0;for(this.asyncStream_=new a,this.asyncStream_.push(this.decryptChunk_(l.subarray(c,c+n),t,r,u)),c=n;c<l.length;c+=n)r=new Uint32Array([o(l[c-4]),o(l[c-3]),o(l[c-2]),o(l[c-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(c,c+n),t,r,u));this.asyncStream_.push((function(){s(null,i(u))}))}static get STEP(){return 32e3}decryptChunk_(e,t,i,r){return function(){const s=l(e,t,i);r.set(s,e.byteOffset)}}}var u,c="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{};u="undefined"!==typeof window?window:"undefined"!==typeof c?c:"undefined"!==typeof self?self:{};var h=u,p=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},f=h.BigInt||Number;f("0x1"),f("0x100"),f("0x10000"),f("0x1000000"),f("0x100000000"),f("0x10000000000"),f("0x1000000000000"),f("0x100000000000000"),f("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();const m=function(e){const t={};return Object.keys(e).forEach(i=>{const r=e[i];p(r)?t[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[i]=r}),t};self.onmessage=function(e){const t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),r=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),s=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new d(i,r,s,(function(e,i){self.postMessage(m({source:t.source,decrypted:i}),[i.buffer])}))}})));var fd=bo(pd);const md=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},gd=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},yd=(e,t)=>{t.activePlaylistLoader=e,e.load()},vd=(e,t)=>()=>{const{segmentLoaders:{[e]:i,main:r},mediaTypes:{[e]:s}}=t,n=s.activeTrack(),a=s.getActiveGroup(),o=s.activePlaylistLoader,l=s.lastGroup_;a&&l&&a.id===l.id||(s.lastGroup_=a,s.lastTrack_=n,gd(i,s),a&&!a.isMainPlaylist&&(a.playlistLoader?(i.resyncLoader(),yd(a.playlistLoader,s)):o&&r.resetEverything()))},bd=(e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:r}}=t;r.lastGroup_=null,i.abort(),i.pause()},_d=(e,t)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[e]:r,main:s},mediaTypes:{[e]:n}}=t,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,d=n.lastTrack_;if((!d||!a||d.id!==a.id)&&(n.lastGroup_=o,n.lastTrack_=a,gd(r,n),o)){if(o.isMainPlaylist){if(!a||!d||a.id===d.id)return;const e=t.vhs.playlistController_,r=e.selectPlaylist();if(e.media()===r)return;return n.logger_(`track change. Switching main audio from ${d.id} to ${a.id}`),i.pause(),s.resetEverything(),void e.fastQualityChange_(r)}if("AUDIO"===e){if(!o.playlistLoader)return s.setAudio(!0),void s.resetEverything();r.setAudio(!0),s.setAudio(!1)}l!==o.playlistLoader?(r.track&&r.track(a),r.resetEverything(),yd(o.playlistLoader,n)):yd(o.playlistLoader,n)}},Td={AUDIO:(e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:r},excludePlaylist:s}=t;gd(i,r);const n=r.activeTrack(),a=r.activeGroup(),o=(a.filter(e=>e.default)[0]||a[0]).id,l=r.tracks[o];if(n!==l){bn.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in r.tracks)r.tracks[e].enabled=r.tracks[e]===l;r.onTrackChanged()}else s({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:r}}=t;bn.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),gd(i,r);const s=r.activeTrack();s&&(s.mode="disabled"),r.onTrackChanged()}},Sd={AUDIO:(e,t,i)=>{if(!t)return;const{tech:r,requestOptions:s,segmentLoaders:{[e]:n}}=i;t.on("loadedmetadata",()=>{const e=t.media();n.playlist(e,s),(!r.paused()||e.endList&&"none"!==r.preload())&&n.load()}),t.on("loadedplaylist",()=>{n.playlist(t.media(),s),r.paused()||n.load()}),t.on("error",Td[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:r,requestOptions:s,segmentLoaders:{[e]:n},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{const e=t.media();n.playlist(e,s),n.track(a.activeTrack()),(!r.paused()||e.endList&&"none"!==r.preload())&&n.load()}),t.on("loadedplaylist",()=>{n.playlist(t.media(),s),r.paused()||n.load()}),t.on("error",Td[e](e,i))}},wd={AUDIO:(e,t)=>{const{vhs:i,sourceType:r,segmentLoaders:{[e]:s},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:d}},mainPlaylistLoader:u}=t,c=pa(u.main);a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}},c&&(a[e].main.default.playlists=u.main.playlists));for(const h in a[e]){o[h]||(o[h]=[]);for(const s in a[e][h]){let p,f=a[e][h][s];if(c?(d(`AUDIO group '${h}' label '${s}' is a main playlist`),f.isMainPlaylist=!0,p=null):p="vhs-json"===r&&f.playlists?new Da(f.playlists[0],i,n):f.resolvedUri?new Da(f.resolvedUri,i,n):f.playlists&&"dash"===r?new fo(f.playlists[0],i,n,u):null,f=An({id:s,playlistLoader:p},f),Sd[e](e,f.playlistLoader,t),o[h].push(f),"undefined"===typeof l[s]){const e=new bn.AudioTrack({id:s,kind:md(f),enabled:!1,language:f.language,default:f.default,label:s});l[s]=e}}}s.on("error",Td[e](e,t))},SUBTITLES:(e,t)=>{const{tech:i,vhs:r,sourceType:s,segmentLoaders:{[e]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:d}},mainPlaylistLoader:u}=t;for(const c in o[e]){l[c]||(l[c]=[]);for(const n in o[e][c]){if(o[e][c][n].forced)continue;let h,p=o[e][c][n];if("hls"===s)h=new Da(p.resolvedUri,r,a);else if("dash"===s){const e=p.playlists.filter(e=>e.excludeUntil!==1/0);if(!e.length)return;h=new fo(p.playlists[0],r,a,u)}else"vhs-json"===s&&(h=new Da(p.playlists?p.playlists[0]:p.resolvedUri,r,a));if(p=An({id:n,playlistLoader:h},p),Sd[e](e,p.playlistLoader,t),l[c].push(p),"undefined"===typeof d[n]){const e=i.addRemoteTextTrack({id:n,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:n},!1).track;d[n]=e}}}n.on("error",Td[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:i,main:{mediaGroups:r},mediaTypes:{[e]:{groups:s,tracks:n}}}=t;for(const a in r[e]){s[a]||(s[a]=[]);for(const t in r[e][a]){const o=r[e][a][t];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;const l=i.options_.vhs&&i.options_.vhs.captionServices||{};let d={label:t,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[d.instreamId]&&(d=An(d,l[d.instreamId])),void 0===d.default&&delete d.default,s[a].push(An({id:t},o)),"undefined"===typeof n[t]){const e=i.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;n[t]=e}}}}},Ed=(e,t)=>{for(let i=0;i<e.length;i++){if(ca(t,e[i]))return!0;if(e[i].playlists&&Ed(e[i].playlists,t))return!0}return!1},Cd=(e,t)=>i=>{const{mainPlaylistLoader:r,mediaTypes:{[e]:{groups:s}}}=t,n=r.media();if(!n)return null;let a=null;n.attributes[e]&&(a=s[n.attributes[e]]);const o=Object.keys(s);if(!a)if("AUDIO"===e&&o.length>1&&pa(t.main))for(let e=0;e<o.length;e++){const t=s[o[e]];if(Ed(t,n)){a=t;break}}else s.main?a=s.main:1===o.length&&(a=s[o[0]]);return"undefined"===typeof i?a:null!==i&&a&&a.filter(e=>e.id===i.id)[0]||null},xd={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}},kd=(e,{mediaTypes:t})=>()=>{const i=t[e].activeTrack();return i?t[e].activeGroup(i):null},Id=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{wd[t](t,e)});const{mediaTypes:t,mainPlaylistLoader:i,tech:r,vhs:s,segmentLoaders:{["AUDIO"]:n,main:a}}=e;["AUDIO","SUBTITLES"].forEach(i=>{t[i].activeGroup=Cd(i,e),t[i].activeTrack=xd[i](i,e),t[i].onGroupChanged=vd(i,e),t[i].onGroupChanging=bd(i,e),t[i].onTrackChanged=_d(i,e),t[i].getActiveGroup=kd(i,e)});const o=t.AUDIO.activeGroup();if(o){const e=(o.filter(e=>e.default)[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();const i=t.AUDIO.getActiveGroup();i.playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanging())});const l=()=>{t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",l),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),s.on("dispose",()=>{r.audioTracks().removeEventListener("change",l),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(const d in t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[d])},Ad=()=>{const e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Gl,activeTrack:Gl,getActiveGroup:Gl,onGroupChanged:Gl,onTrackChanged:Gl,lastTrack_:null,logger_:In(`MediaGroups[${t}]`)}}),e},Pd=120;let Od;const Ld=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Dd=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},Md=function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:r,bufferLowWaterLine:s,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!r)return bn.log.warn("We received no playlist to switch to. Please check your stream."),!1;const d=`allowing switch ${e&&e.id||"null"} -> ${r.id}`;if(!e)return l(d+" as current playlist is not set"),!0;if(r.id===e.id)return!1;const u=Boolean(Mn(t,i).length);if(!e.endList)return u||"number"!==typeof e.partTargetDuration?(l(d+" as current playlist is live"),!0):(l(`not ${d} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const c=Hn(t,i),h=o?mo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:mo.MAX_BUFFER_LOW_WATER_LINE;if(a<h)return l(`${d} as duration < max low water line (${a} < ${h})`),!0;const p=r.attributes.BANDWIDTH,f=e.attributes.BANDWIDTH;if(p<f&&(!o||c<n)){let e=`${d} as next bandwidth < current bandwidth (${p} < ${f})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${c} < ${n})`),l(e),!0}if((!o||p>f)&&c>=s){let e=`${d} as forwardBuffer >= bufferLowWaterLine (${c} >= ${s})`;return o&&(e+=` and next bandwidth > current bandwidth (${p} > ${f})`),l(e),!0}return l(`not ${d} as no switching criteria met`),!1};class Nd extends bn.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:r,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:d,sourceType:u,cacheEncryptionKeys:c,bufferBasedABR:h,leastPixelDiffSelector:p,captionServices:f}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:m}=e;null!==m&&"undefined"!==typeof m||(m=1/0),Od=a,this.bufferBasedABR=Boolean(h),this.leastPixelDiffSelector=Boolean(p),this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.sourceType_=u,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=m,this.enableLowInitialPlaylist=d,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:m,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=Ad(),this.mediaSource=new s.a.MediaSource,this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=Pn(),this.hasPlayed_=!1,this.syncController_=new cd(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new fd,this.sourceUpdater_=new rd(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new hd;const g={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:f,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:c,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings};this.mainPlaylistLoader_="dash"===this.sourceType_?new fo(t,this.vhs_,this.requestOptions_):new Da(t,this.vhs_,this.requestOptions_),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Vl(An(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Vl(An(g,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new ad(An(g,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks}),e),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),Ld.forEach(e=>{this[e+"_"]=Dd.bind(this,e)}),this.logger_=In("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const y="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(y,()=>{const e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const r=this.media(),s=r&&(r.id||r.uri),n=e.id||e.uri;s&&s!==n&&(this.logger_(`switch media ${s} -> ${n} from ${t}`),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.mainPlaylistLoader_.media(e,i)}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=s.a.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(s.a.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,r=Object.keys(i);let s;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)s=this.mediaTypes_.AUDIO.activeTrack();else{const e=i.main||r.length&&i[r[0]];for(const t in e)if(e[t].default){s={label:t};break}}if(!s)return t;const n=[];for(const a in i)if(i[a][s.label]){const t=i[a][s.label];if(t.playlists&&t.playlists.length)n.push.apply(n,t.playlists);else if(t.uri)n.push(t);else if(e.playlists.length)for(let i=0;i<e.playlists.length;i++){const t=e.playlists[i];t.attributes&&t.attributes.AUDIO&&t.attributes.AUDIO===a&&n.push(t)}}return n.length?n:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;ua(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),Id({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t))return;this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial");const i="vhs-json"===this.sourceType_&&this.initialMedia_.segments;if(!i)return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;ua(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if("playlist-unchanged"===e.lastExcludeReason_)return;const t=this.stuckAtPlaylistEnd_(e);t&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let r=!0;const s=Object.keys(i.AUDIO);for(const n in i.AUDIO)for(const e in i.AUDIO[n]){const t=i.AUDIO[n][e];t.uri||(r=!1)}r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Od.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),s.length&&Object.keys(i.AUDIO[s[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),s=this.bufferHighWaterLine(),n=this.tech_.buffered();return Md({buffered:n,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:Pd}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){e!==this.mainPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(()=>{bn.browser.IE_VERSION||bn.browser.IS_EDGE?this.tech_.setCurrentTime(this.tech_.currentTime()+.04):this.tech_.setCurrentTime(this.tech_.currentTime())})):this.logger_("skipping fastQualityChange because new media is same as old")}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList){const e=this.seekable();if(!e.length)return!1;if(bn.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",()=>{this.trigger("firstplay"),this.tech_.setCurrentTime(e.end(0)),this.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(e.end(0))}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();"undefined"!==typeof e&&"function"===typeof e.then&&e.then(null,e=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){const t=this.seekable();if(!t.length)return!1;const i=this.syncController_.getExpiredTime(e,this.duration());if(null===i)return!1;const r=Od.Playlist.playlistEnd(e,i),s=this.tech_.currentTime(),n=this.tech_.buffered();if(!n.length)return r-s<=Ln;const a=n.end(n.length-1);return a-s<=Ln&&r-a<=Ln}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,s=r.filter(na),n=1===s.length&&s[0]===e;if(1===r.length&&i!==1/0)return bn.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(n);if(n){let t=!1;r.forEach(i=>{if(i===e)return;const r=i.excludeUntil;"undefined"!==typeof r&&r!==1/0&&(t=!0,delete i.excludeUntil)}),t&&(bn.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let a;a=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=a,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const l=t.internal?this.logger_:bn.log.warn,d=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${d} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const u=o.targetDuration/2*1e3||5e3,c="number"===typeof o.lastRequest&&Date.now()-o.lastRequest<=u;return this.switchMedia_(o,"exclude",n||c)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],r="all"===e;(r||"main"===e)&&i.push(this.mainPlaylistLoader_);const s=[];(r||"audio"===e)&&s.push("AUDIO"),(r||"subtitle"===e)&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach(e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)}),["main","audio","subtitle"].forEach(t=>{const r=this[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||i.push(r)}),i.forEach(e=>t.forEach(t=>{"function"===typeof e[t]&&e[t]()}))}setCurrentTime(e){const t=Mn(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Od.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let i=this.syncController_.getExpiredTime(t,this.duration());if(null===i)return;const r=this.mainPlaylistLoader_.main,s=Od.Playlist.seekable(t,i,Od.Playlist.liveEdgeDelay(r,t));if(0===s.length)return;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),null===i)return;if(e=Od.Playlist.seekable(t,i,Od.Playlist.liveEdgeDelay(r,t)),0===e.length)return}let n,a;this.seekable_&&this.seekable_.length&&(n=this.seekable_.end(0),a=this.seekable_.start(0)),e?e.start(0)>s.end(0)||s.start(0)>e.end(0)?this.seekable_=s:this.seekable_=Pn([[e.start(0)>s.start(0)?e.start(0):s.start(0),e.end(0)<s.end(0)?e.end(0):s.end(0)]]):this.seekable_=s,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===n&&this.seekable_.start(0)===a||(this.logger_(`seekable updated [${Bn(this.seekable_)}]`),this.tech_.trigger("seekablechanged"))}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){const e=this.seekable();if(!e.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1)))}const t=this.tech_.buffered();let i=Od.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t)t[i].forEach(e=>{e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};e.video=e.main;const t=al(this.main(),this.media()),i={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(i.video=t.video||e.main.videoCodec||b["b"]),e.main.isMuxed&&(i.video+=","+(t.audio||e.main.audioCodec||b["a"])),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||r)&&(i.audio=t.audio||e.main.audioCodec||e.audio.audioCodec||b["a"],e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!i.audio&&!i.video)return void this.excludePlaylist({playlistToExclude:this.media(),error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const s=(e,t)=>e?Object(b["c"])(t):Object(b["g"])(t),n={};let a;if(["video","audio"].forEach((function(t){if(i.hasOwnProperty(t)&&!s(e[t].isFmp4,i[t])){const r=e[t].isFmp4?"browser":"muxer";n[r]=n[r]||[],n[r].push(i[t]),"audio"===t&&(a=r)}})),r&&a&&this.media().attributes.AUDIO){const e=this.media().attributes.AUDIO;this.main().playlists.forEach(t=>{const i=t.attributes&&t.attributes.AUDIO;i===e&&t!==this.media()&&(t.excludeUntil=1/0)}),this.logger_(`excluding audio group ${e} as ${a} does not support codec(s): "${i.audio}"`)}if(!Object.keys(n).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach(t=>{const r=(Object(b["h"])(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,s=(Object(b["h"])(i[t]||"")[0]||{}).type;r&&s&&r.toLowerCase()!==s.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${i[t]}"`)}),e.length)return void this.excludePlaylist({playlistToExclude:this.media(),error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return i}{const e=Object.keys(n).reduce((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${n[t].join(",")}"`,e),"")+".";this.excludePlaylist({playlistToExclude:this.media(),error:{internal:!0,message:e},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const r=e[i];if(-1!==t.indexOf(r.id))return;t.push(r.id);const s=al(this.main,r),n=[];!s.audio||Object(b["g"])(s.audio)||Object(b["c"])(s.audio)||n.push("audio codec "+s.audio),!s.video||Object(b["g"])(s.video)||Object(b["c"])(s.video)||n.push("video codec "+s.video),s.text&&"stpp.ttml.im1t"===s.text&&n.push("text codec "+s.text),n.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${n.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,r=sl(Object(b["h"])(e)),s=nl(r),n=r.video&&Object(b["h"])(r.video)[0]||null,a=r.audio&&Object(b["h"])(r.audio)[0]||null;Object.keys(i).forEach(e=>{const r=i[e];if(-1!==t.indexOf(r.id)||r.excludeUntil===1/0)return;t.push(r.id);const o=[],l=al(this.mainPlaylistLoader_.main,r),d=nl(l);if(l.audio||l.video){if(d!==s&&o.push(`codec count "${d}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){const e=l.video&&Object(b["h"])(l.video)[0]||null,t=l.audio&&Object(b["h"])(l.audio)[0]||null;e&&n&&e.type.toLowerCase()!==n.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${n.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${a.type}"`)}o.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id}: ${o.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),ld(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=mo.GOAL_BUFFER_LENGTH,i=mo.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,mo.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=mo.BUFFER_LOW_WATER_LINE,i=mo.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,mo.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(t,mo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?s:r)}bufferHighWaterLine(){return mo.BUFFER_HIGH_WATER_LINE}}const Rd=(e,t,i)=>r=>{const s=e.main.playlists[t],n=sa(s),a=na(s);return"undefined"===typeof r?a:(r?delete s.disabled:s.disabled=!0,r===a||n||(i(),r?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),r)};class Ud{constructor(e,t,i){const{playlistController_:r}=e,s=r.fastQualityChange_.bind(r);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=al(r.main(),t),this.playlist=t,this.id=i,this.enabled=Rd(e.playlists,t.id,s)}}const Bd=function(e){e.representations=()=>{const t=e.playlistController_.main(),i=pa(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(e=>!sa(e)).map((t,i)=>new Ud(e,t,t.id)):[]}},jd=["seeking","seeked","pause","playing","error"];class Fd{constructor(e){this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=In("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(e=>{l[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},a[e+"SegmentLoader_"].on("appendsdone",l[e].updateend),a[e+"SegmentLoader_"].on("playlistupdate",l[e].reset),this.tech_.on(["seeked","seeking"],l[e].reset)});const d=e=>{["main","audio"].forEach(t=>{a[t+"SegmentLoader_"][e]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),d("off"))},this.clearSeekingAppendCheck_=()=>d("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),d("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(jd,n),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(jd,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(e=>{a[e+"SegmentLoader_"].off("appendsdone",l[e].updateend),a[e+"SegmentLoader_"].off("playlistupdate",l[e].reset),this.tech_.off(["seeked","seeking"],l[e].reset)}),this.checkCurrentTimeTimeout_&&s.a.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&s.a.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=s.a.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[e+"SegmentLoader_"];this[e+"StalledDownloads_"]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[e+"SegmentLoader_"],r=i.buffered_(),s=qn(this[e+"Buffered_"],r);this[e+"Buffered_"]=r,s?this.resetSegmentDownloads_(e):(this[e+"StalledDownloads_"]++,this.logger_(`found #${this[e+"StalledDownloads_"]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Fn(r)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0})))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Ln>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){const e=this.tech_.seeking();if(!e)return!1;const t=this.seekable(),i=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let s;if(r){const e=t.end(t.length-1);s=e}if(this.beforeSeekableWindow_(t,i)){const e=t.start(0);s=e+(e===t.end(0)?0:Ln)}if("undefined"!==typeof s)return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${Bn(t)}. Seeking to `+s+"."),this.tech_.setCurrentTime(s),!0;const n=this.playlistController_.sourceUpdater_,a=this.tech_.buffered(),o=n.audioBuffer?n.audioBuffered():null,l=n.videoBuffer?n.videoBuffered():null,d=this.media(),u=d.partTargetDuration?d.partTargetDuration:2*(d.targetDuration-On),c=[o,l];for(let p=0;p<c.length;p++){if(!c[p])continue;const e=Hn(c[p],i);if(e<u)return!1}const h=Nn(a,i);return 0!==h.length&&(s=h.start(0)+Ln,this.logger_(`Buffered region starts (${h.start(0)}) just beyond seek point (${i}). Seeking to ${s}.`),this.tech_.setCurrentTime(s),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Mn(t,e);return i.length&&e+3<=i.end(0)?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const i=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) `+i),this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered(),s=this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t});if(s)return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const n=Nn(r,t);return n.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${n.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,r=!1){if(!e.length)return!1;let s=e.end(e.length-1)+Ln;const n=!i.endList;return n&&r&&(s=e.end(e.length-1)+3*i.targetDuration),t>s}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let r;if(e.length&&t.length){const s=Mn(e,i-3),n=Mn(e,i),a=Mn(t,i);a.length&&!n.length&&s.length&&(r={start:s.end(0),end:a.end(0)})}else{const t=Nn(e,i);t.length||(r=this.gapFromVideoUnderflow_(e,i))}return!!r&&(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time `+i),!0)}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),r=Nn(t,i);this.resetTimeUpdate_(),0!==r.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+On),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}))}gapFromVideoUnderflow_(e,t){const i=Rn(e);for(let r=0;r<i.length;r++){const e=i.start(r),s=i.end(r);if(t-e<4&&t-e>2)return{start:e,end:s}}return null}}const qd={errorInterval:30,getSource(e){const t=this.tech({IWillNotUseThisInPlugins:!0}),i=t.currentSource_||this.currentSource();return e(i)}},$d=function(e,t){let i=0,r=0;const s=An(qd,t);e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){r&&e.currentTime(r)},a=function(t){null!==t&&void 0!==t&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",n),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){if(Date.now()-i<1e3*s.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(s.getSource&&"function"===typeof s.getSource)return i=Date.now(),s.getSource.call(e,a);bn.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function(){e.off("loadedmetadata",n),e.off("error",o),e.off("dispose",l)},d=function(t){l(),$d(e,t)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=d},Hd=function(e){$d(this,e)};var zd="3.0.0",Vd="6.2.0",Gd="1.0.1",Wd="6.0.0",Xd="4.0.1";const Yd={PlaylistLoader:Da,Playlist:fa,utils:Xa,STANDARD_PLAYLIST_SELECTOR:fl,INITIAL_PLAYLIST_SELECTOR:yl,lastBandwidthSelector:fl,movingAverageBandwidthSelector:ml,comparePlaylistBandwidth:cl,comparePlaylistResolution:hl,xhr:Ra()};Object.keys(mo).forEach(e=>{Object.defineProperty(Yd,e,{get(){return bn.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),mo[e]},set(t){bn.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!==typeof t||t<0?bn.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):mo[e]=t}})});const Kd="videojs-vhs",Jd=function(e,t){const i=t.media();let r=-1;for(let s=0;s<e.length;s++)if(e[s].id===i.id){r=s;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})},Qd=function(e,t){t.representations().forEach(t=>{e.addQualityLevel(t)}),Jd(e,t.playlists)};Yd.canPlaySource=function(){return bn.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Zd=(e,t,i)=>{if(!e)return e;let r={};t&&t.attributes&&t.attributes.CODECS&&(r=sl(Object(b["h"])(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(r.audio=i.attributes.CODECS);const s=Object(b["e"])(r.video),n=Object(b["e"])(r.audio),a={};for(const o in e)a[o]={},n&&(a[o].audioContentType=n),s&&(a[o].videoContentType=s),t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh&&(a[o].pssh=t.contentProtection[o].pssh),"string"===typeof e[o]&&(a[o].url=e[o]);return An(e,a)},eu=(e,t)=>e.reduce((e,i)=>{if(!i.contentProtection)return e;const r=t.reduce((e,t)=>{const r=i.contentProtection[t];return r&&r.pssh&&(e[t]={pssh:r.pssh}),e},{});return Object.keys(r).length&&e.push(r),e},[]),tu=({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:r})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const s=i?r.concat([i]):r,n=eu(s,Object.keys(t)),a=[],o=[];return n.forEach(t=>{o.push(new Promise((t,i)=>{e.tech_.one("keysessioncreated",t)})),a.push(new Promise((i,r)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{e?r(e):i()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},iu=({player:e,sourceKeySystems:t,media:i,audioMedia:r})=>{const s=Zd(t,i,r);return!!s&&(e.currentSource().keySystems=s,!(s&&!e.eme)||(bn.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},ru=()=>{if(!s.a.localStorage)return null;const e=s.a.localStorage.getItem(Kd);if(!e)return null;try{return JSON.parse(e)}catch(t){return null}},su=e=>{if(!s.a.localStorage)return!1;let t=ru();t=t?An(t,e):e;try{s.a.localStorage.setItem(Kd,JSON.stringify(t))}catch(i){return!1}return t},nu=e=>0===e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(e.substring(e.indexOf(",")+1)):e;Yd.supportsNativeHls=function(){if(!a.a||!a.a.createElement)return!1;const e=a.a.createElement("video");if(!bn.getTech("Html5").isSupported())return!1;const t=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return t.some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),Yd.supportsNativeDash=function(){return!!(a.a&&a.a.createElement&&bn.getTech("Html5").isSupported())&&/maybe|probably/i.test(a.a.createElement("video").canPlayType("application/dash+xml"))}(),Yd.supportsTypeNatively=e=>"hls"===e?Yd.supportsNativeHls:"dash"===e&&Yd.supportsNativeDash,Yd.isSupported=function(){return bn.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const au=bn.getComponent("Component");class ou extends au{constructor(e,t,i){if(super(t,i.vhs),"number"===typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=In("VhsHandler"),t.options_&&t.options_.playerId){const e=bn.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(a.a,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{const t=a.a.fullscreenElement||a.a.webkitFullscreenElement||a.a.mozFullScreenElement||a.a.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),this.on(this.tech_,"error",(function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()})),this.on(this.tech_,"play",this.play)}setOptions_(){if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage="undefined"!==typeof this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!==typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=300),"number"!==typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=ru();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!==typeof this.options_.bandwidth&&(this.options_.bandwidth=mo.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===mo.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{"undefined"!==typeof this.source_[e]&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=nu(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Yd,this.options_.sourceType=Object(_["a"])(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.playlistController_=new Nd(this.options_);const i=An({liveRangeSafeTimeDelta:Ln},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Fd(i),this.playlistController_.on("error",()=>{const e=bn.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!==typeof t||t.code?"string"===typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});const r=this.options_.bufferBasedABR?Yd.movingAverageBandwidthSelector(.55):Yd.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Yd.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=s.a.navigator.connection||s.a.navigator.mozConnection||s.a.navigator.webkitConnection,i=1e7;if(this.options_.useNetworkInformationApi&&t){const r=1e3*t.downlink*1e3;e=r>=i&&e>=i?Math.max(e,r):r}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;t=this.throughput>0?1/this.throughput:0;const i=Math.floor(1/(e+t));return i},set(){bn.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Fn(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Fn(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&su({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{Bd(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.playlistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=s.a.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),tu({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=iu({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",e=>{if("output-restricted"!==e.status)return;const t=this.playlistController_.main();if(!t||!t.playlists)return;const i=[];t.playlists.forEach(e=>{e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height>=720&&(!e.excludeUntil||e.excludeUntil<1/0)&&(e.excludeUntil=1/0,i.push(e))}),i.length&&(bn.log.warn('DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.',...i),this.playlistController_.fastQualityChange_())}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==bn.browser.IE_VERSION&&t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=bn.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{Qd(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Jd(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":zd,"mux.js":Vd,"mpd-parser":Gd,"m3u8-parser":Wd,"aes-decrypter":Xd}}version(){return this.constructor.version()}canChangeType(){return rd.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&s.a.URL.revokeObjectURL&&(s.a.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return io({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return ro({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}}const lu={name:"videojs-http-streaming",VERSION:zd,canHandleSource(e,t={}){const i=An(bn.options,t);return lu.canPlayType(e.type,i)},handleSource(e,t,i={}){const r=An(bn.options,i);return t.vhs=new ou(e,t,r),t.vhs.xhr=Ra(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t={}){const{vhs:{overrideNative:i=!bn.browser.IS_ANY_SAFARI}={}}=An(bn.options,t),r=Object(_["a"])(e),s=r&&(!Yd.supportsTypeNatively(r)||i);return s?"maybe":""}},du=()=>Object(b["c"])("avc1.4d400d,mp4a.40.2");du()&&bn.getTech("Html5").registerSourceHandler(lu,0),bn.VhsHandler=ou,bn.VhsSourceHandler=lu,bn.Vhs=Yd,bn.use||bn.registerComponent("Vhs",Yd),bn.options.vhs=bn.options.vhs||{},bn.getPlugin&&bn.getPlugin("reloadSourceOnError")||bn.registerPlugin("reloadSourceOnError",Hd)}).call(this,i("24aa"))},f6b4:function(e,t,i){"use strict";var r=i("c532");function s(){this.handlers=[]}s.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},s.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},s.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=s},f772:function(e,t,i){"use strict";var r=i("5692"),s=i("90e3"),n=r("keys");e.exports=function(e){return n[e]||(n[e]=s(e))}},f8a8:function(e,t,i){"use strict";i.d(t,"a",(function(){return A})),i.d(t,"b",(function(){return P}));var r,s=i("de66"),n=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"===typeof e?Object(s["h"])(e):e}),a=function(e){return Array.isArray(e)?e.map((function(e){return n(e)})):[n(e)]},o=function(e){e=Object(s["k"])(e);var t=[],i=0;while(e.length>i){var n=e[i],a=0,o=0;o++;var l=e[o];o++;while(128&l)a=(127&l)<<7,l=e[o],o++;a+=127&l;for(var d=0;d<r.length;d++){var u=r[d],c=u.id,h=u.parser;if(n===c){t.push(h(e.subarray(o,o+a)));break}}i+=a+o}return t};r=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var i=e[t.size];t.url=Object(s["c"])(e.subarray(t.size+1,t.size+1+i)),t.size+=i}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=o(e.subarray(t.size))||[],t}},{id:4,parser:function(e){var t={tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:o(e.subarray(13))};return t}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var l=function e(t,i,r){void 0===r&&(r=!1),i=a(i),t=Object(s["k"])(t);var n=[];if(!i.length)return n;var o=0;while(o<t.length){var l=(t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3])>>>0,d=t.subarray(o+4,o+8);if(0===l)break;var u=o+l;if(u>t.length){if(r)break;u=t.length}var c=t.subarray(o+8,u);Object(s["a"])(d,i[0])&&(1===i.length?n.push(c):n.push.apply(n,e(c,i.slice(1),r))),o=u}return n},d={EBML:Object(s["k"])([26,69,223,163]),DocType:Object(s["k"])([66,130]),Segment:Object(s["k"])([24,83,128,103]),SegmentInfo:Object(s["k"])([21,73,169,102]),Tracks:Object(s["k"])([22,84,174,107]),Track:Object(s["k"])([174]),TrackNumber:Object(s["k"])([215]),DefaultDuration:Object(s["k"])([35,227,131]),TrackEntry:Object(s["k"])([174]),TrackType:Object(s["k"])([131]),FlagDefault:Object(s["k"])([136]),CodecID:Object(s["k"])([134]),CodecPrivate:Object(s["k"])([99,162]),VideoTrack:Object(s["k"])([224]),AudioTrack:Object(s["k"])([225]),Cluster:Object(s["k"])([31,67,182,117]),Timestamp:Object(s["k"])([231]),TimestampScale:Object(s["k"])([42,215,177]),BlockGroup:Object(s["k"])([160]),BlockDuration:Object(s["k"])([155]),Block:Object(s["k"])([161]),SimpleBlock:Object(s["k"])([163])},u=[128,64,32,16,8,4,2,1],c=function(e){for(var t=1,i=0;i<u.length;i++){if(e&u[i])break;t++}return t},h=function(e,t,i,r){void 0===i&&(i=!0),void 0===r&&(r=!1);var n=c(e[t]),a=e.subarray(t,t+n);return i&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=u[n-1]),{length:n,value:Object(s["b"])(a,{signed:r}),bytes:a}},p=function e(t){return"string"===typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"===typeof t?Object(s["f"])(t):t},f=function(e){return Array.isArray(e)?e.map((function(e){return p(e)})):[p(e)]},m=function e(t,i,r){if(r>=i.length)return i.length;var n=h(i,r,!1);if(Object(s["a"])(t.bytes,n.bytes))return r;var a=h(i,r+n.length);return e(t,i,r+a.length+a.value+n.length)},g=function e(t,i){i=f(i),t=Object(s["k"])(t);var r=[];if(!i.length)return r;var n=0;while(n<t.length){var a=h(t,n,!1),o=h(t,n+a.length),l=n+a.length+o.length;127===o.value&&(o.value=m(a,t,l),o.value!==t.length&&(o.value-=l));var d=l+o.value>t.length?t.length:l+o.value,u=t.subarray(l,d);Object(s["a"])(i[0],a.bytes)&&(1===i.length?r.push(u):r=r.concat(e(u,i.slice(1))));var c=a.length+o.length+u.length;n+=c}return r},y=i("321f"),v=Object(s["k"])([0,0,0,1]),b=Object(s["k"])([0,0,1]),_=Object(s["k"])([0,0,3]),T=function(e){var t=[],i=1;while(i<e.length-2)Object(s["a"])(e.subarray(i,i+3),_)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var r=e.length-t.length,n=new Uint8Array(r),a=0;for(i=0;i<r;a++,i++)a===t[0]&&(a++,t.shift()),n[i]=e[a];return n},S=function(e,t,i,r){void 0===r&&(r=1/0),e=Object(s["k"])(e),i=[].concat(i);var n,a=0,o=0;while(a<e.length&&(o<r||n)){var l=void 0;if(Object(s["a"])(e.subarray(a),v)?l=4:Object(s["a"])(e.subarray(a),b)&&(l=3),l){if(o++,n)return T(e.subarray(n,a));var d=void 0;"h264"===t?d=31&e[a+l]:"h265"===t&&(d=e[a+l]>>1&63),-1!==i.indexOf(d)&&(n=a+l),a+=l+("h264"===t?1:2)}else a++}return e.subarray(0,0)},w=function(e,t,i){return S(e,"h264",t,i)},E=function(e,t,i){return S(e,"h265",t,i)},C={webm:Object(s["k"])([119,101,98,109]),matroska:Object(s["k"])([109,97,116,114,111,115,107,97]),flac:Object(s["k"])([102,76,97,67]),ogg:Object(s["k"])([79,103,103,83]),ac3:Object(s["k"])([11,119]),riff:Object(s["k"])([82,73,70,70]),avi:Object(s["k"])([65,86,73]),wav:Object(s["k"])([87,65,86,69]),"3gp":Object(s["k"])([102,116,121,112,51,103]),mp4:Object(s["k"])([102,116,121,112]),fmp4:Object(s["k"])([115,116,121,112]),mov:Object(s["k"])([102,116,121,112,113,116]),moov:Object(s["k"])([109,111,111,118]),moof:Object(s["k"])([109,111,111,102])},x={aac:function(e){var t=Object(y["a"])(e);return Object(s["a"])(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Object(y["a"])(e);return Object(s["a"])(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=g(e,[d.EBML,d.DocType])[0];return Object(s["a"])(t,C.webm)},mkv:function(e){var t=g(e,[d.EBML,d.DocType])[0];return Object(s["a"])(t,C.matroska)},mp4:function(e){return!x["3gp"](e)&&!x.mov(e)&&(!(!Object(s["a"])(e,C.mp4,{offset:4})&&!Object(s["a"])(e,C.fmp4,{offset:4}))||(!(!Object(s["a"])(e,C.moof,{offset:4})&&!Object(s["a"])(e,C.moov,{offset:4}))||void 0))},mov:function(e){return Object(s["a"])(e,C.mov,{offset:4})},"3gp":function(e){return Object(s["a"])(e,C["3gp"],{offset:4})},ac3:function(e){var t=Object(y["a"])(e);return Object(s["a"])(e,C.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];var t=0;while(t+188<e.length&&t<188){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=Object(y["a"])(e);return Object(s["a"])(e,C.flac,{offset:t})},ogg:function(e){return Object(s["a"])(e,C.ogg)},avi:function(e){return Object(s["a"])(e,C.riff)&&Object(s["a"])(e,C.avi,{offset:8})},wav:function(e){return Object(s["a"])(e,C.riff)&&Object(s["a"])(e,C.wav,{offset:8})},h264:function(e){return w(e,7,3).length},h265:function(e){return E(e,[32,33],3).length}},k=Object.keys(x).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);k.forEach((function(e){var t=x[e];x[e]=function(e){return t(Object(s["k"])(e))}}));var I=x,A=function(e){e=Object(s["k"])(e);for(var t=0;t<k.length;t++){var i=k[t];if(I[i](e))return i}return""},P=function(e){return l(e,["moof"]).length>0}},f97d:function(e,t){var i={"":!0,up:!0};function r(e){if("string"!==typeof e)return!1;var t=i[e.toLowerCase()];return!!t&&e.toLowerCase()}function s(e){return"number"===typeof e&&e>=0&&e<=100}function n(){var e=100,t=3,i=0,n=100,a=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!s(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!==typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!s(e))throw new Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!s(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!s(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return a},set:function(e){if(!s(e))throw new Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var t=r(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):l=t}}})}e.exports=n},fb15:function(e,t,i){"use strict";if(i.r(t),i.d(t,"cms",(function(){return Vt})),"undefined"!==typeof window){var r=window.document.currentScript,s=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);s&&(i.p=s[1])}var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cms"},[i("div",{class:["lay-wrap",{mobile:"mobile"==e.mode}]},e._l(e.cmsList,(function(t){return i("div",{key:t.sort,staticClass:"lay-item"},[i("div",{staticClass:"layout-set",style:{width:t.attributeJson.layoutStyle&&2===t.attributeJson.layoutStyle.widthStyle.type?t.attributeJson.layoutStyle.widthStyle.width+"%":"100%",height:t.attributeJson.layoutStyle?Math.round(t.attributeJson.layoutStyle.height*e.ratio)+"px":"auto"}},[i(e.layOutObj[t.layoutType],e._g(e._b({ref:"layModule",refInFor:!0,tag:"component",attrs:{layOutData:t.attributeJson,sort:t.attributeJson.sort,ratio:e.ratio,mode:e.mode,recordId:t.originalId,envUrl:e.envUrl,path:e.path,isClient:e.isClient},scopedSlots:e._u([{key:"customComponent",fn:function(i){return 3==t.layoutType?[e._t("customComponent",null,{attributeJson:i.attributeJson})]:void 0}},{key:"dgCustomComponent",fn:function(t){return[e._t("dgCustomComponent",null,{data:t.attributeJson})]}}],null,!0)},"component",e.$attrs,!1),e.$listeners))],1)])})),0)])},a=[],o=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"single-layout",style:e.layoutStyle},[i("div",{staticStyle:{width:"100%",height:"100%"}},[e._l(e.layOutData.componentList.filter((function(e){return e.type<=100})),(function(t,r){return i("div",{key:r},[1==t.displayType?i(t.component,e._g(e._b({key:t.sort,ref:"singleComponent",refInFor:!0,tag:"component",style:{zIndex:r+1},attrs:{ratio:e.ratio,attributeJson:t.attributeJson,sortId:t.sort}},"component",e.$attrs,!1),e.$listeners)):e._e()],1)})),i("div",[e._t("dgCustomComponent",null,{attributeJson:e.getCustom()})],2)],2)])},l=[],d=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"text-wrap entrance-con",style:[e.conStyle,e.animationInStyle],attrs:{id:[e.recordId+"_"+e.sortId,"entrance-con"],name:[e.recordId+"_"+e.sortId,"entrance-con"],"data-sensors-click":"","data-sensorsClick":"true"},on:{click:e.pageClick}},[i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData,envUrl:e.envUrl},expression:"{data:tipReportData, envUrl}"}],class:["text-con","text-con-"+e.sortId,e.animationInObj.type?e.enterClass:""],domProps:{innerHTML:e._s(e.attributeJson.label)}})])},u=[],c=(i("be35"),i("a7a3"),i("77ed"),i("1e09"),i("fda2"),i("14d9"),i("bc3a")),h=i.n(c);const p={json:"application/json;",form:"application/x-www-form-urlencoded;",html:"text/html;",file:"multipart/form-data",excel:"msexcel",xml:"application/xml",javascript:"application/x-javascript;charset=utf-8"},f={lang:"Accept-Language",contentType:"Content-Type"};function m(e){if(200===e.status){let t=e.data;return"0"===t.errorCode?t.data:e.data}}h.a.interceptors.response.use(m,e=>Promise.reject(e));class g{static async call(e,{method:t="get",headers:i={},body:r=null,responseType:s=null}={}){let n=e,a={method:t,url:n,responseType:s||"json",headers:i};"get"===t?a.params=r:a.data=r;const o=await h()(a).catch(e=>{e.response?console.error(e.response.status,e.response.data):e.request?console.error(e.request):console.error("Error",e.message?e.message:"")});return o}static get(e,{mask:t=!0,external:i=!1,headers:r={}}={}){return g.call(e,{headers:r,external:i,mask:t})}static postBody(e,{body:t={},language:i="zh-CN",module:r="",method:s="post",mask:n=!0,postData:a=!0,external:o=!1,headers:l={},compat:d}){return g.call(e,{module:r,method:s,headers:Object.assign(l,{[f.contentType]:p.json,common:{languageCode:i}}),body:t,postData:a,external:o,mask:n,compat:d})}}class y{getProductInfo(e,t,i){return g.postBody(e+"service-zuul/manage/search/plp/standard",{body:t,language:i})}getSortProductInfo(e,t,i){return g.postBody(e+"service-zuul/manage/search/cms/sort",{body:t,language:i})}dataSaveDecorationPageComponentEvent(e,t){return g.postBody(e+"service-zuul/data/collect/acquisition",{body:t})}acquisitionBatch(e,t){return g.postBody(e+"/service-zuul/data/collect/acquisitionBatch",{body:t})}}const v=new y;class b{constructor(){this.intersectionObserver=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(_(e,this.intersectionObserver),this.intersectionObserver.unobserve(e.target))})}),this.interval=T()}observe(e,t){e.setAttribute("report-data",JSON.stringify(t.value?t.value.data:null)),this.intersectionObserver.observe(e)}disconnect(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),sessionStorage.setItem("reportData","[]"),this.interval&&(clearInterval(this.interval),this.interval=null))}static getInstance(e){return this.instance||(this.instance=new b),e&&(this.instance.envUrl=e.value?e.value.envUrl:this.instance.envUrl),this.instance}}const _=function(e,t){const i=e.target,r=i.getAttribute("report-data");let s=JSON.parse(sessionStorage.getItem("reportData")||null)||[];"null"!=r&&"undefined"!=r?(s.push(r),sessionStorage.setItem("reportData",JSON.stringify(s))):t.unobserve(i)},T=function(){let e=setInterval(()=>{let e=JSON.parse(sessionStorage.getItem("reportData")||null)||[];e.length>0&&(sessionStorage.setItem("reportData","[]"),S(e))},1500);return e},S=function(e){let t=e.map(e=>w(e)),i=b.getInstance().envUrl;i&&v.acquisitionBatch(i,t)},w=function(e){let t=JSON.parse(e);const i={source:"",medium:"",commodity_id:t.popData&&t.popData.productCode||"",commodity_name:t.popData&&t.popData.selectDataShow||"",commodity_sku_id:"",component_name:t.uniqueName,component_id:t.uniqueId,component_type:t.componentType,hot_zone_id:t.popData&&t.popData.uniqueId||"",hot_zone_name:t.popData&&t.popData.uniqueName||"",material_id:t.materialId,material_name:t.materialName,url_path:t.path||"/",refer_info:t.refererPagePath,position:t.position,trigger_Method_Type:t.componentMethodType};let r="";return localStorage.getItem(t.brand+"Cookie")?r=localStorage.getItem(t.brand+"Cookie"):(r=`${parseInt((new Date).getTime())}${Math.floor(1e4*Math.random())}`,localStorage.setItem(t.brand+"Cookie",r)),{eventProperty:JSON.stringify({...i}),event:t.event,distinctId:r}};var E={bind(e,t){"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype&&b.getInstance(t).observe(e,t)},unbind(){b.getInstance().disconnect()}};function C(e,t,i){const r=new y,s={source:"",medium:"",commodity_id:e.popData.productCode||"",commodity_name:e.popData.selectDataShow||"",commodity_sku_id:"",component_name:e.uniqueName,component_id:e.uniqueId,component_type:e.componentType,hot_zone_id:e.popData.uniqueId||"",hot_zone_name:e.popData.uniqueName||"",material_id:e.materialId,material_name:e.materialName,url_path:e.path,refer_info:e.refererPagePath,position:e.position,trigger_Method_Type:e.componentMethodType};let n="";localStorage.getItem(e.brand+"Cookie")?n=localStorage.getItem(e.brand+"Cookie"):(n=`${parseInt((new Date).getTime())}${Math.floor(1e4*Math.random())}`,localStorage.setItem(e.brand+"Cookie",n));let a={eventProperty:JSON.stringify({...s}),event:e.event,distinctId:n};if("click"==i)return a;r.dataSaveDecorationPageComponentEvent(t,a)}function x(e,t){var i=null,r=Date.now();return function(){var s=Date.now(),n=t-(s-r),a=this,o=arguments;clearTimeout(i),n<=0?(e.apply(a,o),r=Date.now()):i=setTimeout(e,n)}}const k={inheritAttrs:!1,props:{attributeJson:{type:Object,default:function(){}},item:{type:Object,default:()=>{}},ratio:{type:Number,default:1},envUrl:{type:String,default:""},fontRatio:{type:Number,default:1},mode:{type:String,default:"pc"},language:{type:String,default:"zh-CN"},sortId:{type:Number,default:0},sort:{type:[String,Number],default:0},recordId:{type:[String,Number],default:0},refererPagePath:{type:String},brand:{type:String},path:{type:String},isClient:{type:Boolean,default:!0}},data(){return{scrollHandle:x(this.scrollThrottle,200),hoverStyle:{},hoverStyleShow:!1,hoverImage:"",hoverDirection:"",finishAnimation:!1,animationInStyle:{},entranceAnimate:{fade:"fadeIn",scale:"zoomIn"}}},computed:{animationInObj:function(){return this.attributeJson.animationInObj},animationHoverObj:function(){return this.attributeJson.animationHoverObj},baseStyle(){return this.attributeJson.baseStyle},styleType(){return this.attributeJson.styleType},conStyle(){let{attributeJson:e,ratio:t}=this;return{width:Math.round(e.baseStyle.w*t)+"px",height:Math.round(e.baseStyle.h*t)+"px",left:Math.round(e.baseStyle.l*t)+"px",top:Math.round(e.baseStyle.t*t)+"px"}}},watch:{animationHoverObj:{handler(e){this.disposeHoverAnimate(e)},immediate:!0,deep:!0},animationInObj:{handler(){let{type:e,direction:t,delay:i,duration:r}=this.attributeJson.animationInObj;e&&(this.enterClass="",this.enterClass=this.entranceAnimate[e],this.animationInStyle={animationDuration:r+"s",amimationDelay:i+"s",animationName:"slide"!=e?this.entranceAnimate[e]:t,animationPlayState:"paused"})},immediate:!0}},mounted(){this.isInCurrentScreenArea()?(this.$el.style.animationPlayState="running",this.finishAnimation=!0):this.animationInStyle.animationName&&(this.$el.style.animationPlayState="paused",this.startObserver())},methods:{isInCurrentScreenArea(){const{top:e}=this.$el.getBoundingClientRect();return e<=window.innerHeight-100},scrollThrottle(){this.isInCurrentScreenArea()&&!this.finishAnimation&&(this.animationInStyle.animationName&&(this.$el.style.animationPlayState="running"),this.finishAnimation=!0,this.endObserver())},startObserver(){window.addEventListener("scroll",this.scrollHandle,!0)},endObserver(){window.removeEventListener("scroll",this.scrollHandle,!0)},disposeHoverAnimate(e){let t={};if(2===e.type){let i=e.borderStyle;if(1==i.type&&(t={border:i.borderColor?"2px solid "+i.borderColor:"none"}),2==i.type){let{borderTop:e,borderRight:r,borderBottom:s,borderLeft:n}=i;t={borderTop:e?"2px solid "+e:"none",borderRight:r?"2px solid "+r:"none",borderBottom:s?"2px solid "+s:"none",borderLeft:n?"2px solid "+n:"none"}}}if(3===e.type&&(t={transform:"scale(1.2)",transformOrigin:"center center"}),4===e.type&&(this.hoverDirection=e.bgStyle.direction),5===e.type){let{hoverImgList:t}=e;this.hoverImage=t[0]?t[0].resourcePath:""}this.hoverStyle=t},onDrag:function(e,t){let i=this.ratio;this.attributeJson.baseStyle.l=e/i,this.attributeJson.baseStyle.t=t/i,this.$set(this.attributeJson,"baseStyle",this.attributeJson.baseStyle)},onResize:function(e,t,i,r){let s=this.ratio,n=this.attributeJson.baseStyle;n={w:i/s,h:r/s,l:e/s,t:t/s,isLocked:n.isLocked},this.$set(this.attributeJson,"baseStyle",n)},getRefLineParams(e){this.$emit("getRefLineParams",e)}},directives:{hoverAnimate:{inserted:function(e,t,i){e.onmouseover=function(){i.context.hoverStyleShow=!0,t.value&&(i.context[t.value.key]=t.value.value)},e.onmouseleave=function(){i.context.hoverStyleShow=!1,t.value&&(i.context[t.value.key]=-1)}}},treport:E}};var I={name:"textItem",mixins:[k],components:{},props:{},data(){return{}},computed:{tipReportData(){return{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:12,popData:{},refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,position:1,event:"bannerShow"}}},methods:{pageClick(){if(this.attributeJson.linkObj.jumpLinkType)try{let e=JSON.parse(JSON.stringify(this.tipReportData));e.event="bannerClick";let t=C(e,this.envUrl,"click"),i=new Blob([JSON.stringify(t)],{type:"application/json"});navigator.sendBeacon(this.envUrl+"service-zuul/data/collect/acquisition",i)}catch(e){console.log(e)}this.$emit("jumpLink",this.attributeJson.linkObj)}}},A=I,P=A;i("4e30");function O(e,t,i,r,s,n,a,o){var l,d="function"===typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=i,d._compiled=!0),r&&(d.functional=!0),n&&(d._scopeId="data-v-"+n),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},d._ssrRegister=l):s&&(l=o?function(){s.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(d.functional){d._injectStyles=l;var u=d.render;d.render=function(e,t){return l.call(t),u(e,t)}}else{var c=d.beforeCreate;d.beforeCreate=c?[].concat(c,l):[l]}return{exports:e,options:d}}var L=O(P,d,u,!1,null,"1e5d96ce",null),D=L.exports,M=D,N=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{key:e.attributeJson.sort,staticClass:"image-list entrance-con",style:Object.assign({},{width:Math.ceil(e.attributeJson.baseStyle.w*e.ratio)+"px",height:Math.round(e.attributeJson.baseStyle.h*e.ratio)+"px",left:Math.round(e.attributeJson.baseStyle.l*e.ratio)+"px",top:Math.round(e.attributeJson.baseStyle.t*e.ratio)+"px"},e.animationInStyle)},[e.hasConfig?[i("div",{ref:"img"+e.attributeJson.sort,class:["image-warp","image-warp-"+e.sortId],style:{animationDuration:e.animationInObj.duration+"s"}},[e.isSwiper?i("div",{directives:[{name:"hoverAnimate",rawName:"v-hoverAnimate"}],style:[e.picStyle,3===e.animationHoverObj.type&&e.hoverStyleShow?e.hoverStyle:""]},[i("div",{class:["swiper-container swiper-container-"+e.sortId]},[i("div",{staticClass:"swiper-wrapper",style:{height:(e.baseStyle.h-(e.hasScrollBar?30:0))*e.ratio+"px!important"}},e._l(e.attributeJson.list,(function(t,r){return i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData(r),envUrl:e.envUrl},expression:"{data:tipReportData(index), envUrl}"}],key:t.id,staticClass:"swiper-slide",style:{width:e.baseStyle.w/4*e.ratio+"px"}},[i("div",{staticClass:"slide-con",style:{height:(e.baseStyle.h-(e.hasScrollBar?30:0))*e.ratio+"px"}},[i("img",{attrs:{src:t.picList[0].resourcePath,alt:t.picList[0].resourceName.split(".")[0]}}),0!=t.picList.length&&0!=t.popList.length?[i("hotspot",e._g(e._b({ref:"hotspot"+e.sortId+r,refInFor:!0,attrs:{componentType:2,item:t,ratio:e.ratio,path:e.path,envUrl:e.envUrl,sortId:e.sortId,recordId:e.recordId,laySort:e.sort,brand:e.brand,uniqueName:e.attributeJson.uniqueName,language:e.language}},"hotspot",e.$attrs,!1),e.$listeners))]:e._e()],2)])})),0),e.hasSwiperButton?i("div",{class:"swiper-button-prev swiper-button-prev-"+e.sortId},[e._t("swiper-button-prev",(function(){return[2==e.indicatorType||3==e.indicatorType?i("div",[i("span",{staticClass:"cms2iconfont iconleft"})]):e._e()]}))],2):e._e(),e.hasSwiperButton?i("div",{class:"swiper-button-next swiper-button-next-"+e.sortId},[e._t("swiper-button-next",(function(){return[2==e.indicatorType||3==e.indicatorType?i("div",[i("span",{staticClass:"cms2iconfont iconright"})]):e._e()]}))],2):e._e(),e.hasScrollBar?i("div",{class:"swiper-scrollbar swiper-scrollbar-"+e.sortId}):e._e()]),2===e.animationHoverObj.type?i("div",{staticClass:"hover-con",style:[e.hoverStyle,{opacity:e.hoverStyleShow?1:0}]}):e._e()]):i("div",{class:["image-warp",3==e.styleType&&"pc"!=e.mode?"image-type3":""],style:[e.picStyle,3===e.animationHoverObj.type&&e.hoverStyleShow?e.hoverStyle:""]},e._l(e.attributeJson.list,(function(t,r){return i("div",{directives:[{name:"hoverAnimate",rawName:"v-hoverAnimate"},{name:"treport",rawName:"v-treport",value:{data:e.tipReportData(r),envUrl:e.envUrl},expression:"{data:tipReportData(index), envUrl}"}],key:r,staticClass:"image-item",style:[e.picItemStyle]},[i("img",{class:{contain:1!=e.styleType},attrs:{src:t.picList[0].resourcePath,alt:t.picList[0].resourceName.split(".")[0]}}),2===e.animationHoverObj.type?i("div",{staticClass:"hover-con",style:[e.hoverStyle,{opacity:e.hoverStyleShow?1:0}]}):e._e(),5===e.animationHoverObj.type&&e.hoverImage&&e.hoverStyleShow?i("img",{staticClass:"hover-image",attrs:{src:e.hoverImage,alt:""}}):e._e(),0!=t.picList.length&&0!=t.popList.length?i("div",[i("hotspot",e._g(e._b({ref:"hotspot"+e.sortId+r,refInFor:!0,attrs:{item:t,ratio:e.ratio,path:e.path,brand:e.brand,envUrl:e.envUrl,sortId:e.sortId,recordId:e.recordId,componentType:2,uniqueName:e.attributeJson.uniqueName,language:e.language}},"hotspot",e.$attrs,!1),e.$listeners))],1):e._e()])})),0)])]:e._e()],2)},R=[],U=(i("13d5"),i("02a3")),B=i.n(U),j=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"pop-wrap",style:{left:e.item.left,top:e.item.top,width:e.item.realWidth*e.ratio+"px"||!1,height:e.item.realHeight*e.ratio+"px"||!1}},e._l(e.item.popList,(function(t,r){return i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData(r),envUrl:e.envUrl},expression:"{data:tipReportData(index), envUrl}"}],key:r,ref:""+e.sortId+r,refInFor:!0,class:"pop-item",style:{width:t.width/750*100+"%",height:t.height/(e.item.height/e.proportion)*100+"%",left:t.left/750*100+"%",top:t.top/(e.item.height/e.proportion)*100+"%"},attrs:{id:[e.recordId+"_"+e.sortId+"_"+t.uniqueId.split("_")[2],"pop-item"],"data-sensors-click":"","data-sensorsClick":"true",name:[e.recordId+"_"+e.sortId+"_"+t.uniqueId.split("_")[2],"pop-item"]},on:{click:function(i){return e.pageClick(t,r)}}},[t.product.openHot?i("div",{staticClass:"product-hover",on:{mouseover:function(t){return e.mouseover(r)},mouseleave:e.mouseLeave}},[0!=t.product.initImage.length?i("div",{staticStyle:{"{ fontsize":"0"}},[i("img",{attrs:{src:e.hoverIndex==r?t.product.hoverImage[0].resourcePath:t.product.initImage[0].resourcePath,alt:""}})]):e._e(),e.hoverIndex==r?i("div",{staticClass:"product-image"},[i("img",{attrs:{src:1==t.product.imageType?e.productImage[t.productCode]:t.product.productImage[0].resourcePath,alt:""}})]):e._e()]):e._e()])})),0)},F=[],q={name:"hotspot",props:{item:{type:Object,default:()=>{}},width:{type:Number,default:0},height:{type:Number,default:0},ratio:{type:Number,default:1},envUrl:{type:String,default:""},sortId:{type:Number,default:0},recordId:{type:Number,default:0},brand:{type:String},componentType:{type:Number},refererPagePath:{type:String},path:{type:String},pathType:{type:Number},uniqueName:{type:String},language:{type:String,default:"zh-CN"},prePosition:{type:Number}},data(){return{hotList:[],proportion:1,hoverIndex:1,needReport:!0,preTotal:0,productImage:{},service:new y}},watch:{"item.width":{handler(e){this.proportion=e/750},deep:!0,immediate:!0},itemCodeList:{handler(e){this.getProductList(e)},immediate:!0,deep:!0}},computed:{itemCodeList(){let e=this.item.popList.filter(e=>1==e.jumpLinkType&&1==e.product.imageType&&e.product.openHot);return e.map(e=>e.productCode)},tipReportData(){let e=JSON.parse(JSON.stringify(this.item.popList));return function(t){let i=e[t];return{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.uniqueName,componentMethodType:0,popData:{productCode:i.productCode,selectDataShow:i.selectDataShow,uniqueName:i.uniqueName,uniqueId:this.recordId+"_"+this.sortId+"_"+i.uniqueId.split("_")[2],brand:1===this.pathType?"defaultPath":this.brand},materialId:this.item.sort?this.recordId+"_"+this.item.sort:this.recordId+"_"+this.sortId,materialName:this.item.uniqueName?this.item.uniqueName:this.uniqueName,refererPagePath:this.refererPagePath,path:this.path,componentType:this.componentType,brand:this.brand,position:this.preTotal+t+1,event:"bannerShow"}}}},mounted(){this.hotList=JSON.parse(JSON.stringify(this.item.popList))},methods:{pageClick(e,t){if(e.jumpLinkType)try{this.dataSend(e,t,1)}catch(i){console.log(i)}this.$emit("jumpLink",e)},dataSend(e,t,i){let r={uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.uniqueName,componentMethodType:i,popData:{...e,uniqueId:this.recordId+"_"+this.sortId+"_"+e.uniqueId.split("_")[2],brand:1===this.pathType?"defaultPath":this.brand},materialId:this.item.sort?this.recordId+"_"+this.item.sort:this.recordId+"_"+this.sortId,materialName:this.item.uniqueName?this.item.uniqueName:this.uniqueName,refererPagePath:this.refererPagePath,path:this.path,componentType:this.componentType,brand:this.brand,position:this.prePosition?this.prePosition+t+1:1*this.preTotal+t+1,event:0==i?"bannerShow":"bannerClick"};if(0==i)C(r,this.envUrl);else{let e=C(r,this.envUrl,"click"),t=new Blob([JSON.stringify(e)],{type:"application/json"});navigator.sendBeacon(this.envUrl+"service-zuul/data/collect/acquisition",t)}},getProductList(e){if(0==e.length)return;let t={itemCodeList:e,pageNum:1,pageSize:e.length},i={};this.service.getProductInfo(this.envUrl,t,this.language).then(e=>{e&&e.list&&(this.productList=e.list,e.list.forEach(e=>{i[e.code]=e.mainPicUrl}),this.productImage=i)})},mouseover(e){this.hoverIndex=e},mouseLeave(){this.hoverIndex=-1}},directives:{treport:E}},$=q,H=$,z=(i("55f9"),O(H,j,F,!1,null,"4c0eac42",null)),V=z.exports,G=V,W={name:"imgNav",mixins:[k],components:{hotspot:G},props:{},data(){return{swiper:"",imageList:[],popList:[],positionList:[],positionTotal:[],hasInitSwiper:!1}},computed:{indicatorType(){return this.attributeJson.indicatorType},picStyle(){let{attributeJson:e,ratio:t,animationInObj:i}=this;return{animationDuration:i.duration+"s",padding:`0 ${e.paddingSpacing*t}px`,width:Math.ceil(e.baseStyle.w*t)+"px"}},picItemStyle(){let{attributeJson:e,ratio:t}=this,{oneLineCount:i}=e;return{width:Math.ceil((e.baseStyle.w*t-2*e.paddingSpacing*t)/i)+"px",height:Math.ceil(e.baseStyle.h*t)+"px",padding:"0 "+e.itemSpacing*t+"px"}},list(){return this.attributeJson.list},isSwiper(){return 3==this.styleType&&2==this.indicatorType&&"pc"==this.mode||2==this.styleType&&2==this.indicatorType&&"mobile"==this.mode},hasConfig(){return this.attributeJson.list.some(e=>0!=e.picList.length)},hasSwiperButton(){return 3==this.styleType&&2==this.indicatorType&&"pc"==this.mode},hasScrollBar(){return 2==this.styleType&&2==this.indicatorType&&"mobile"==this.mode},tipReportData(){let{list:e}=this,t=[],i=[];return e.forEach(e=>{0!=e.popList.length?t.push(e.popList.length):t.push(1)}),t.forEach((e,r)=>{let s=t.slice(0,r),n=s.reduce((e,t)=>e+t,0);i.push(n)}),this.positionList=t,this.positionTotal=i,function(t){let i=e[t];return 0!=i.popList.length?void 0:{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:2,materialId:this.recordId+"_"+this.sortId+"_"+i.sort,materialName:i.uniqueName,refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,position:this.positionTotal[t]+1,event:"bannerShow"}}}},watch:{isSwiper:{handler(e){e&&this.initSwiper()},immediate:!0}},mounted(){},methods:{initSwiper(){this.hasConfig&&this.isSwiper&&this.$nextTick(()=>{this.swiper&&(this.swiper.destroy(!0,!0),this.swiper=null);let{attributeJson:e}=this;this.options={effect:"slide",autoplay:!1,slidesPerView:this.attributeJson.oneLineCount,spaceBetween:e.itemSpacing},this.hasSwiperButton&&(this.options.navigation={nextEl:".swiper-button-next-"+this.sortId,prevEl:".swiper-button-prev-"+this.sortId}),this.hasScrollBar&&(this.options.scrollbar={el:".swiper-scrollbar-"+this.sortId,draggable:!0},this.options.freeMode=!0),this.swiper=new B.a(".swiper-container-"+this.sortId,this.options),console.log("[32m%s[0m","初始化轮播图",this.swiper)})}}},X=W,Y=X,K=(i("dc72"),O(Y,N,R,!1,null,"5e573198",null)),J=K.exports,Q=J,Z=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"video-wrap entrance-con",style:[e.conStyle,e.animationInStyle]},[0!==e.videoItem.length?i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData,envUrl:e.envUrl},expression:"{data: tipReportData, envUrl}"}],class:["video-con","video-con-"+e.sortId,e.animationInObj.type?e.enterClass:""],style:{width:Math.round(e.attributeJson.baseStyle.w*e.ratio)+"px",height:Math.round(e.attributeJson.baseStyle.h*e.ratio)+"px"}},[i("myVideoPlayer",{attrs:{sort:(new Date).getTime(),videoInfo:e.videoInfo,autoPlay:e.autoPlay,recordId:e.recordId,sortId:e.sortId}}),1===e.attributeJson.isVideoHasHot&&0!=e.videoHotPic.length?i("div",{staticClass:"hot-image"},[i("img",{attrs:{src:e.videoHotPic[0].resourcePath,alt:""}}),i("hotspot",e._g(e._b({ref:"hotspot",attrs:{componentType:3,item:e.hotData,ratio:e.ratio,envUrl:e.envUrl,language:e.language,recordId:e.recordId,sortId:e.sortId,path:e.path,brand:e.brand,uniqueName:e.attributeJson.uniqueName}},"hotspot",e.$attrs,!1),e.$listeners))],1):e._e()],1):e._e()])},ee=[],te=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticStyle:{height:"100%",position:"relative"}},[i("video",{ref:"myVideo-"+e.sort,staticClass:"video-js vjs-default-skin vjs-big-play-centered vjs-16-9 video-item",attrs:{preload:"auto","data-setup":"{}","x5-playsinline":"","x5-video-orientation":"landscape|portrait","x5-video-player-type":"h5","webkit-playsinline":"true",playsinline:"true",controls:e.videoInfo.checkedAttr.indexOf("controls")>-1,autoplay:e.autoPlay,loop:e.videoInfo.checkedAttr.indexOf("loop")>-1,muted:"",poster:0!=e.videoInfo.list.length?e.videoInfo.list[0].imgUrl:""},domProps:{muted:!0}},[i("source",{attrs:{src:0!=e.videoInfo.list.length?e.videoInfo.list[0].resourcePath:""}})]),e.videoInfo.checkedAttr.indexOf("controls")<0?i("div",{staticClass:"video-cover",attrs:{id:[e.recordId+"_"+e.sortId,"video-cover"],"data-sensors-click":"","data-sensorsClick":"true",name:[e.recordId+"_"+e.sortId,"video-cover"]},on:{click:e.clickVideo}}):e._e()])},ie=[],re=i("f0e2"),se={name:"videoPlayer",props:{videoInfo:{type:Object,default:()=>{}},autoPlay:{type:Boolean,default:!1},sort:{type:Number,default:0},recordId:{type:Number,default:0},sortId:{type:Number,default:0}},data(){return{isPlay:!1}},watch:{autoPlay:{handler(e){this.player&&(e?this.player.play():this.player.pause())},immediate:!0}},mounted(){let e=this;setTimeout(()=>{this.player=Object(re["a"])(this.$refs["myVideo-"+this.sort],{},(function(){this.on("play",()=>{e.isPlay=!0}),this.on("pause",()=>{e.isPlay=!1})})),this.$nextTick(()=>{this.play()})},50)},methods:{play(){0!=this.videoInfo.list.length&&this.autoPlay&&this.player.play()},clickVideo(){this.isPlay?this.player.pause():this.player.play()}}},ne=se,ae=ne,oe=(i("eab8"),O(ae,te,ie,!1,null,"ebbd756a",null)),le=oe.exports,de=le,ue={name:"videoItem",mixins:[k],components:{hotspot:G,myVideoPlayer:de},props:{attributeJson:{type:Object,default:function(){}},ratio:{type:Number,default:1,positionList:[]}},data(){return{autoPlay:!1}},watch:{"videoInfo.checkedAttr":{handler(e){this.autoPlay=e.indexOf("autoPlay")>-1},immediate:!0,deep:!0}},computed:{videoItem(){return this.attributeJson.videoInfo.list},videoHotPic(){return this.attributeJson.videoHotInfo.picList},videoHotPop(){return this.attributeJson.videoHotInfo.popList},videoInfo(){return this.attributeJson.videoInfo},hotData(){let{attributeJson:e}=this;return{popList:e.videoHotInfo.popList,width:e.videoHotInfo.picList[0].width,height:e.videoHotInfo.picList[0].height,realWidth:e.baseStyle.w,realHeight:e.baseStyle.h,top:0,left:0}},tipReportData(){return 1==this.attributeJson.isVideoHasHot?void 0:{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:3,popData:{},refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,event:"bannerShow",position:1}}},methods:{}},ce=ue,he=ce,pe=(i("1abf"),O(he,Z,ee,!1,null,"27d3e021",null)),fe=pe.exports,me=fe,ge=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"swiper-wrap",style:[e.conStyle,e.animationInStyle]},[e.hasSwiperItem||1===e.bgStyle.status&&0!=e.bgStyle.picList.length?i("div",{directives:[{name:"hoverAnimate",rawName:"v-hoverAnimate"}],class:["swiper-con","swiper-con-"+e.mode],style:{backgroundImage:0!=e.bgStyle.picList.length?"url("+e.bgStyle.picList[0].resourcePath+")":""}},[i("div",{staticClass:"entrance-con",style:{"--hoverColor":e.paginationStyle.hoverColor||e.paginationStyle.color,"--activeColor":e.paginationStyle.activeColor,"--color":e.paginationStyle.color,width:e.baseStyle.w*e.ratio+"px",height:e.baseStyle.h*e.ratio+"px"}},[i("div",{key:e.indicatorType,ref:"swiper"+e.attributeJson.sort,class:["swiper-container swiper-container-"+e.sortId+" swiper-container-"+e.indicatorType,e.animationInObj.type?e.enterClass:""],style:{animationDuration:e.animationInObj.duration+"s"},attrs:{id:"mySwiper-"+e.sortId}},[i("div",{staticClass:"swiper-wrapper"},e._l(e.swiperList,(function(t,r){return i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData(r),envUrl:e.envUrl},expression:"{data:tipReportData(index), envUrl}"}],key:t.sort+r,class:["swiper-slide",{"slide-auto":e.isSpaceSwiper}]},[i("div",{staticClass:"swiper-width",style:{width:(e.baseStyle.w-(2==e.styleType?100:0))*e.ratio+"px!important",height:e.baseStyle.h*e.ratio+"px"}},[1===t.type?i("img",{attrs:{src:t.picList[0].resourcePath,alt:t.picList[0].resourceName.split(".")[0]}}):e._e(),2===t.type?i("div",{staticClass:"video-player-con"},[i("myVideoPlayer",{attrs:{recordId:e.recordId,sortId:e.sortId,sort:(new Date).getTime(),videoInfo:t.videoInfo,autoPlay:t.videoInfo.checkedAttr.indexOf("autoPlay")>-1&&e.activeIndex==r}}),2==t.type&&1==t.isVideoHasHot&&0!=t.videoHotInfo.picList.length?i("div",{staticClass:"video-hot-image"},[i("img",{attrs:{src:t.videoHotInfo.picList[0].resourcePath,alt:t.videoHotInfo.picList[0].resourceName.split(".")[0]}}),0!=t.videoHotInfo.picList.length?i("div",{staticClass:"swiper-hot"},[i("hotspot",e._g(e._b({ref:"hotspot"+e.sortId+r,refInFor:!0,attrs:{item:{realWidth:t.realWidth,realHeight:t.realHeight,popList:t.videoHotInfo.popList,width:t.videoHotInfo.picList[0].width,height:t.videoHotInfo.picList[0].height},componentType:1,ratio:e.ratio,uniqueName:e.attributeJson.uniqueName,envUrl:e.envUrl,sortId:e.sortId,laySort:e.sort,path:e.path,brand:e.brand,prePosition:e.positionTotal[t.i],recordId:e.recordId}},"hotspot",e.$attrs,!1),e.$listeners))],1):e._e()]):e._e()],1):e._e(),1==t.type&&0!=t.picList.length?[i("hotspot",e._g(e._b({ref:"hotspot"+e.sortId+r,refInFor:!0,attrs:{item:t,ratio:e.ratio,componentType:1,uniqueName:e.attributeJson.uniqueName,path:e.path,envUrl:e.envUrl,sortId:e.sortId,brand:e.brand,prePosition:e.positionTotal[t.i],recordId:e.recordId}},"hotspot",e.$attrs,!1),e.$listeners))]:e._e()],2)])})),0),e.hasScrollBar?i("div",{staticClass:"swiper-scrollbar-own"},[i("div",{staticClass:"swiper-scrollbar-drag",style:{width:100/e.list.length+"%",left:(e.activeIndex>e.list.length?0:100/e.list.length*(e.activeIndex-1))+"%"}})]):e._e(),e.hasSwiperPagination?i("div",{staticClass:"swiper-pagination-custom"},e._l(e.list,(function(t,r){return i("span",{key:r,class:["pagination-custom-bullt",{"bullt-active":e.slideIndex==r}],attrs:{id:[e.recordId+"_"+e.sortId+"_"+Number(r+1),"pagination-custom-bullt"],name:[e.recordId+"_"+e.sortId+"_"+Number(r+1),"pagination-custom-bullt"],"data-sensors-click":"","data-sensorsClick":"true"},on:{click:function(t){return e.swiperSlide(r)}}})})),0):e._e(),e.hasSwiperButton?[i("div",{class:["swiper-button-prev","swiper-button-prev-"+e.sortId]},[e._t("swiper-button-prev",(function(){return[2==e.indicatorType||3==e.indicatorType?i("div",[i("span",{staticClass:"cms2iconfont iconleft",style:e.pageStyle})]):e._e(),4==e.indicatorType?i("div",{staticClass:"arrow"},[i("span",{staticClass:"cms2iconfont iconarrow-left",style:e.pageStyle})]):e._e()]}))],2),i("div",{class:["swiper-button-next","swiper-button-next-"+e.sortId]},[e._t("swiper-button-next",(function(){return[2==e.indicatorType||3==e.indicatorType?i("div",[i("span",{staticClass:"cms2iconfont iconright",style:e.pageStyle})]):e._e(),4==e.indicatorType?i("div",{staticClass:"arrow"},[i("span",{staticClass:"cms2iconfont iconarrow-right",style:e.pageStyle})]):e._e()]}))],2)]:e._e()],2)]),2===e.animationHoverObj.type?i("div",{staticClass:"hover-con",style:[e.hoverStyle,{opacity:e.hoverStyleShow?1:0}]}):e._e()]):e._e()])},ye=[];let ve=16.7;var be={name:"swiperItem",mixins:[k],components:{hotspot:G,myVideoPlayer:de},props:{sortId:{type:Number}},data(){return{hasSwiperItem:!1,swiper:"",activeIndex:0,slideIndex:0,hasInitSwiper:!1,positionList:[],positionTotal:[]}},computed:{bgStyle(){return this.attributeJson.bgStyle},list(){return this.attributeJson.list},styleType(){return this.attributeJson.styleType},indicatorType(){return this.attributeJson.indicatorType},paginationStyle(){return this.attributeJson.paginationStyle},pageStyle(){return{color:this.attributeJson.paginationStyle.color}},hasSwiperPagination(){return 3==this.indicatorType},hasSwiperButton(){return 1!=this.indicatorType},hasScrollBar(){return"pc"==this.mode&&2==this.indicatorType},isSpaceSwiper(){return"mobile"==this.mode&&2==this.styleType},tipReportData(){let e=[],t=[];return this.list.forEach(t=>{1==t.type&&0!=t.popList.length||0!=t.videoHotInfo.popList.length?e.push(1==t.type?t.popList.length:t.videoHotInfo.popList.length):e.push(1)}),e.forEach((i,r)=>{let s=e.slice(0,r),n=s.reduce((e,t)=>e+t,0);t.push(n)}),this.positionList=e,this.positionTotal=t,function(e){let t=this.swiperList[e];return{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:1,popData:{},materialId:this.recordId+"_"+this.sortId+"_"+t.sort,materialName:t.uniqueName,refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,position:this.positionTotal[e]+1,event:"bannerShow"}}}},mounted(){this.$nextTick(()=>{this.judgeSwiper()})},methods:{judgeSwiper(){let e=this.attributeJson.list,t=e.findIndex(e=>0!=e.picList.length||0!=e.videoInfo.list.length);if(this.hasSwiperItem=t>-1,this.hasSwiperItem){e.forEach((e,t)=>{e.i=t});let t=JSON.parse(JSON.stringify(e));this.swiperList=e.concat(JSON.parse(JSON.stringify(t))),this.swiperList=t.concat(this.swiperList),this.initSwiper(!0)}},initSwiper:function(e){(this.hasSwiperItem||1===this.bgStyle.status&&0!=this.bgStyle.picList.length)&&this.$nextTick(()=>{this.swiper&&(this.swiper.destroy(!0,!0),this.swiper=null);let{attributeJson:e}=this;this.options={effect:"slide",observer:!0,observeParents:!0,preventInteractionOnTransition:!0,autoplay:!!e.autoPlay&&{delay:1e3*e.interval,disableOnInteraction:!1,stopOnLastSlide:!1}},"mobile"==this.mode&&2==this.styleType&&(this.options.spaceBetween=10,this.options.loop=!1,this.options.slidesPerView="auto",this.options.centeredSlides=!0),this.hasSwiperButton&&(this.options.navigation={nextEl:".swiper-button-next-"+this.sortId,prevEl:".swiper-button-prev-"+this.sortId});let t=this,i=this.list.length;this.options.on={slideChangeTransitionEnd:function(){t.activeIndex=this.activeIndex,t.slideIndex=t.swiperList[this.activeIndex].i},slideNextTransitionEnd:function(){this.activeIndex==2*i&&this.slideTo(i,ve)},slidePrevTransitionEnd:function(){this.activeIndex==i-1&&this.slideTo(2*i-1,ve)}},this.swiper=new B.a(".swiper-container-"+this.sortId,this.options),this.swiper instanceof Array?this.swiper.forEach(e=>{e.slideTo(i,ve)}):this.swiper.slideTo(i,ve)})},swiperSlide(e){this.swiper.slideTo(e),this.slideIndex=e}}},_e=be,Te=_e,Se=(i("6e0e"),O(Te,ge,ye,!1,null,"5b4a67cf",null)),we=Se.exports,Ee=we,Ce=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"button-wrap",style:[e.conStyle,e.animationInStyle]},[i("div",{ref:"button"+e.attributeJson.sort,class:["button-cl","button-cl-"+e.sortId],attrs:{id:[e.recordId+"_"+e.sortId,"button-cl"],name:[e.recordId+"_"+e.sortId,"button-cl"],"data-sensors-click":"","data-sensorsClick":"true"},on:{click:e.pageClick}},[i("div",{directives:[{name:"hoverAnimate",rawName:"v-hoverAnimate"},{name:"treport",rawName:"v-treport",value:{data:e.tipReportData,envUrl:e.envUrl},expression:"{data:tipReportData, envUrl}"}],staticClass:"button-content",class:[{flexCenterBetween:e.iconImage},4===e.animationHoverObj.type?e.hoverDirection:""],style:[e.buttonStyle,{"--width":e.hoverStyleShow?"100%":"0","--height":e.hoverStyleShow?"100%":"0","--bgColor":e.animationHoverObj.bgStyle.backgroundColor}]},[e.iconStyle&&1===e.iconStyle.type&&1===e.iconStyle.position&&e.iconImage?i("img",{attrs:{src:e.iconImage,alt:""}}):e._e(),i("div",{staticClass:"label",style:e.buttonTextStyle},[e._v(e._s(e.attributeJson.label||"按钮"))]),e.iconStyle&&1===e.iconStyle.type&&2===e.iconStyle.position&&e.iconImage?i("img",{attrs:{src:e.iconImage,alt:""}}):e._e(),5===e.animationHoverObj.type&&e.hoverImage&&e.hoverStyleShow?i("img",{staticClass:"hover-image",attrs:{src:e.hoverImage,alt:""}}):e._e()]),2===e.animationHoverObj.type?i("div",{staticClass:"hover-con",style:[e.hoverStyle,{opacity:e.hoverStyleShow?1:0,borderRadius:e.attributeJson.borderStyle.borderRadius+"px"}]}):e._e()])])},xe=[],ke={name:"buttonItem",mixins:[k],components:{},props:{},data(){return{iconImage:"",backgroundImage:"",hoverButtonStyle:{}}},watch:{bgStyle:{handler(e){0!=e.picList.length&&(this.backgroundImage=2===e.type?e.picList[0].resourcePath:"")},immediate:!0,deep:!0},iconStyle:{handler(e){e&&0!=e.picList.length&&(this.iconImage=1===e.type?e.picList[0].resourcePath:"")},immediate:!0,deep:!0}},computed:{iconStyle(){return this.attributeJson.iconStyle},bgStyle(){return this.attributeJson.bgStyle},buttonStyle(){let{bgStyle:e,fontStyle:t,borderStyle:i,space:r}=this.attributeJson,{borderTop:s,borderRight:n,borderBottom:a,borderLeft:o,borderColor:l}=i,d="mobile"==this.mode?2*this.ratio:this.ratio,u={fontSize:parseFloat(t.fontSize)*d+"px",color:t.color,backgroundColor:1===e.type?e.backgroundColor:"",fontWeight:t.fontWeight?"bold":"",textDecoration:t.textDecoration?"underline":"",fontStyle:t.fontItalic?"italic":"",borderRadius:i.borderRadius+"px",backgroundImage:`url('${this.backgroundImage}')`,paddingLeft:r.left+"px",paddingRight:r.right+"px"};return 1===i.type&&l&&(u.border="1px solid "+l),2===i.type&&(u.borderTop=s?"1px solid "+s:"none",u.borderRight=n?"1px solid "+n:"none",u.borderBottom=a?"1px solid "+a:"none",u.borderLeft=o?"1px solid "+o:"none"),u},buttonTextStyle(){return{color:this.attributeJson.fontStyle.color,"--hoverColor":this.attributeJson.fontStyle.hoverObj.color||this.attributeJson.fontStyle.color}},tipReportData(){return{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:17,popData:{},refererPagePath:this.refererPagePath,path:this.path,brand:this.brand,position:1,event:"bannerShow"}}},methods:{pageClick(){if(this.attributeJson.linkObj.jumpLinkType)try{let e=JSON.parse(JSON.stringify(this.tipReportData));e.event="bannerClick";let t=C(e,this.envUrl,"click"),i=new Blob([JSON.stringify(t)],{type:"application/json"});navigator.sendBeacon(this.envUrl+"service-zuul/data/collect/acquisition",i)}catch(e){}this.$emit("jumpLink",this.attributeJson.linkObj)}}},Ie=ke,Ae=Ie,Pe=(i("866e"),O(Ae,Ce,xe,!1,null,"136e477e",null)),Oe=Pe.exports,Le=Oe,De=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"product-wrap entrance-con",style:[e.conStyle,e.paginationShow,e.animationInStyle]},[i("div",{class:["product-con",e.animationInObj.type?e.enterClass:""],style:[{width:e.baseStyle.w*e.ratio+"px",height:e.baseStyle.h*e.ratio+"px",padding:"0 "+e.attributeJson.goodsPaddingSpacing+"px",animationDuration:e.animationInObj.duration+"s"}]},[e.isSwiper?e._e():i("div",{ref:"slide"+e.sortId,class:"slide-con slide-con-"+e.styleType+"-"+e.mode,style:{width:e.attributeJson.baseStyle.w*e.ratio+e.attributeJson.goodsSpacing+"px",margin:"0px -"+e.attributeJson.goodsSpacing/2+"px"}},e._l(e.productList,(function(t,r){return i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData(r),envUrl:e.envUrl},expression:"{data:tipReportData(index), envUrl}"},{name:"hoverAnimate",rawName:"v-hoverAnimate",value:{key:"productIndex",value:r},expression:"{ key: 'productIndex', value: index }"}],key:t.id,ref:"product"+t.code+r,refInFor:!0,class:["product-item","product"+t.code+r],style:[e.productStyle],attrs:{id:[e.recordId+"_"+e.sortId+"_"+t.code,"product-item"],name:[e.recordId+"_"+e.sortId+"_"+t.code,"product-item"],"data-sensors-click":"","data-sensorsClick":"true"},on:{click:function(i){return e.gotoPDP(t.code,t.colorCode,t.name,r)}}},[i("div",{staticClass:"product-image"},[i("img",{style:[3===e.animationHoverObj.type&&e.productIndex==r?e.hoverStyle:""],attrs:{src:2==e.attributeJson.goodsImgType&&t.customImage?t.customImage:t.mainPicUrl,alt:t.name}})]),0!=e.attributeJson.showInfo.length?i("div",{class:["product-info","position"+e.attributeJson.infoPoisition,{transparent:2==e.attributeJson.isHover&&e.productIndex!=r}]},[e._t("productInfo",(function(){return[e.attributeJson.showInfo.indexOf(1)>-1?i("div",{staticClass:"product-name"},[e._v(e._s(t.name))]):e._e(),i("div",{staticClass:"price-con"},[e.attributeJson.showInfo.indexOf(2)>-1?i("div",[e._v("¥"+e._s(t.salesPrice||0))]):e._e(),t.salesPrice!=t.standardPrice&&e.attributeJson.showInfo.indexOf(3)>-1?i("div",{staticClass:"standardPrice"},[e._v(" ¥"+e._s(t.standardPrice||0)+" ")]):e._e()])]}))],2):e._e(),2===e.animationHoverObj.type?i("div",{staticClass:"hover-con",style:[e.hoverStyle,{opacity:e.productIndex===r?1:0,margin:"0 "+e.goodsSpacing/2+"px"}]}):e._e()])})),0),e.isSwiper?i("div",{key:e.styleType+e.indicatorType,ref:"slide"+e.sortId,class:"swiper-container swiper-container-"+e.sortId,attrs:{id:"mySwiper-"+e.sortId}},[i("div",{staticClass:"swiper-wrapper",style:[{width:e.baseStyle.w*e.ratio+"px"}]},e._l(e.productList,(function(t,r){return i("div",{directives:[{name:"hoverAnimate",rawName:"v-hoverAnimate",value:{key:"productIndex",value:r},expression:"{ key: 'productIndex', value: index }"},{name:"treport",rawName:"v-treport",value:{data:e.tipReportData(r),envUrl:e.envUrl},expression:"{data:tipReportData(index), envUrl}"}],key:t.id,class:"swiper-slide swiper-slide-"+e.styleType+"-"+e.mode,style:[e.productStyle]},[i("div",{ref:"product"+t.code+r,refInFor:!0,style:{height:e.attributeJson.baseStyle.h*e.ratio+"px"},attrs:{id:[e.recordId+"_"+e.sortId+"_"+t.code,"product-item"],"data-sensors-click":"","data-sensorsClick":"true",name:[e.recordId+"_"+e.sortId+"_"+t.code,"product-item"]},on:{click:function(i){return e.gotoPDP(t.code,t.colorCode,t.name,r)}}},[i("div",{staticClass:"product-image"},[i("img",{style:[3===e.animationHoverObj.type&&e.productIndex==r?e.hoverStyle:""],attrs:{src:2==e.attributeJson.goodsImgType&&t.customImage?t.customImage:t.mainPicUrl,alt:""}})]),0!=e.attributeJson.showInfo.length?i("div",{class:["product-info","position"+e.attributeJson.infoPoisition,{transparent:2==e.attributeJson.isHover&&e.productIndex!=r}]},[e._t("productInfo",(function(){return[e.attributeJson.showInfo.indexOf(1)>-1?i("div",{staticClass:"product-name"},[e._v(" "+e._s(t.name)+" ")]):e._e(),i("div",{staticClass:"price-con"},[e.attributeJson.showInfo.indexOf(2)>-1?i("div",[e._v("¥"+e._s(t.salesPrice||0))]):e._e(),t.salesPrice!=t.standardPrice&&e.attributeJson.showInfo.indexOf(3)>-1?i("div",{staticClass:"standardPrice"},[e._v(" ¥"+e._s(t.standardPrice||0)+" ")]):e._e()])]}))],2):e._e(),2===e.animationHoverObj.type?i("div",{staticClass:"hover-con",style:[e.hoverStyle,{opacity:e.productIndex===r?1:0}]}):e._e()])])})),0),e.hasScrollBar?i("div",{class:"swiper-scrollbar swiper-scrollbar-"+e.sortId}):e._e(),e.hasSwiperButton?i("div",{class:"swiper-button-prev swiper-button-prev-"+e.sortId},[e._t("swiper-button-prev",(function(){return[2==e.indicatorType?i("div",[i("span",{staticClass:"cms2iconfont iconleft",style:e.pageStyle})]):e._e()]}))],2):e._e(),e.hasSwiperButton?i("div",{class:"swiper-button-next swiper-button-next-"+e.sortId},[e._t("swiper-button-next",(function(){return[2==e.indicatorType?i("div",[i("span",{staticClass:"cms2iconfont iconright",style:e.pageStyle})]):e._e()]}))],2):e._e()]):e._e()])])},Me=[],Ne={name:"productItem",mixins:[k],components:{},props:{sortId:{type:Number}},data(){return{productList:[],swiper:"",productStyle:{},service:new y,productIndex:"",windowHeight:0}},watch:{addProduct:{handler(e){this.isClient&&(1==e.type&&0==e.itemCodeList.length||(2!=e.type||e.categoryGroupCode)&&(3!=e.type||e.cmsSortCode)&&this.getProductList())},immediate:!0,deep:!0},ratio:{handler(){!this.isSwiper&&this.productStyle.width&&(this.productStyle.width=(this.attributeJson.baseStyle.w*this.ratio-2*this.attributeJson.goodsPaddingSpacing+this.goodsSpacing)/this.showNum+"px")}}},computed:{addProduct(){return this.attributeJson.addProduct},goodsPaddingSpacing(){return this.attributeJson.goodsPaddingSpacing},goodsSpacing(){return this.attributeJson.goodsSpacing},itemsPerLine(){return this.attributeJson.itemsPerLine},indicatorType(){return this.attributeJson.indicatorType},isSwiper(){return"pc"==this.mode&&1==this.styleType||"mobile"==this.mode&&2==this.styleType&&(2==this.indicatorType||3==this.indicatorType)},hasSwiperButton(){return"pc"==this.mode&&1==this.styleType&&2==this.indicatorType||"mobile"==this.mode&&2==this.styleType&&2==this.indicatorType},hasScrollBar(){return"mobile"==this.mode&&2==this.styleType&&3==this.indicatorType},paginationShow(){let{paginationStyle:e}=this.attributeJson;return{"--hoverColor":e.hoverColor||e.color,"--activeColor":e.activeColor,"--color":e.color}},pageStyle(){return{color:this.attributeJson.paginationStyle.color}},showNum(){let e=1;return"pc"==this.mode?e=this.attributeJson.itemsPerLine:1==this.attributeJson.styleType?e=2.5:2==this.attributeJson.styleType&&(e=this.attributeJson.itemsPerLine),e},tipReportData(){return function(e){let t=this.productList[e];return{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:4,popData:{productCode:t.code,selectDataShow:t.name},materialId:this.recordId+"_"+this.sortId,materialName:this.attributeJson.uniqueName,refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,position:e+1,event:"bannerShow"}}}},mounted(){this.productList=this.attributeJson.productList,this.initProduct()},methods:{getProductList:function(){let e={};switch(this.addProduct.type){case 1:e={itemCodeList:this.addProduct.itemCodeList,pageNum:1,pageSize:this.addProduct.itemCodeList.length};break;case 2:e={categoryParam:{categoryCodeList:this.addProduct.categoryCodeList,categoryGroupCode:this.addProduct.categoryGroupCode},pageNum:1,pageSize:this.addProduct.max,sortRuleId:this.addProduct.sortId};break;case 3:e={pageNum:1,pageSize:this.addProduct.max,sortField:this.addProduct.cmsSortCode};break}3==this.addProduct.type?this.service.getSortProductInfo(this.envUrl,e,this.language).then(e=>{if(e&&e.list){let t=document.querySelector(".entrance-con"+this.sortId),i=t&&t.classList.contains("entrance-demonstrate");i&&t.firstChild.style&&(t.firstChild.style.display="block"),this.productList=e.list,this.initProduct()}else this.productList=[]}):this.service.getProductInfo(this.envUrl,e,this.language).then(e=>{if(e&&e.list){let t=document.querySelector(".entrance-con"+this.sortId),i=t&&t.classList.contains("entrance-demonstrate");i&&t.firstChild.style&&(t.firstChild.style.display="block"),this.productList=e.list,this.initProduct()}else this.productList=[]})},initProduct:function(){let{attributeJson:e,addProduct:t}=this;2==e.goodsImgType&&0!=t.customImageList.length&&this.productList.forEach((e,i)=>{0!=t.customImageList[i].picList.length&&this.$set(e,"customImage",t.customImageList[i].picList[0].resourcePath)}),this.productList&&this.productList.length>0&&(this.isSwiper?this.initSwiper():this.initSlide())},initSwiper:function(){let{attributeJson:e,indicatorType:t,styleType:i}=this;this.$nextTick(()=>{this.swiper&&(this.swiper.destroy(!0,!0),this.swiper=null),this.options={effect:"slide",autoplay:!1,slidesPerView:this.showNum,spaceBetween:e.goodsSpacing},2==i&&2==t&&(this.options.pagination={el:".swiper-pagination-"+this.sortId,clickable:!0}),this.hasSwiperButton&&(this.options.navigation={nextEl:".swiper-button-next-"+this.sortId,prevEl:".swiper-button-prev-"+this.sortId}),this.hasScrollBar&&(this.options.scrollbar={el:".swiper-scrollbar-"+this.sortId,draggable:!0},this.options.freeMode=!0),this.swiper=new B.a(".swiper-container-"+this.sortId,this.options)})},initSlide(){this.productStyle={padding:`0 ${this.goodsSpacing/2}px`,width:(this.attributeJson.baseStyle.w*this.ratio-2*this.attributeJson.goodsPaddingSpacing+this.goodsSpacing)/this.showNum+"px",marginBottom:this.goodsSpacing+"px"}},gotoPDP(e,t,i,r){try{let e=JSON.parse(JSON.stringify(this.tipReportData(r)));e.event="bannerClick";let t=C(e,this.envUrl,"click"),i=new Blob([JSON.stringify(t)],{type:"application/json"});navigator.sendBeacon(this.envUrl+"service-zuul/data/collect/acquisition",i)}catch(s){}this.$emit("gotoPDP",{code:e,colorCode:t})}}},Re=Ne,Ue=Re,Be=(i("8ee5"),O(Ue,De,Me,!1,null,"5f1e1175",null)),je=Be.exports,Fe=je,qe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"simplyText-wrap entrance-con",style:[e.conStyle,e.animationInStyle],on:{click:e.pageClick}},[i("div",{directives:[{name:"hoverAnimate",rawName:"v-hoverAnimate"},{name:"cursor",rawName:"v-cursor"}],staticClass:"text-con"},[i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData,envUrl:e.envUrl},expression:"{data:tipReportData, envUrl}"}],staticClass:"text-show",style:[e.textStyle,e.hoverStyleShow?e.hoverStyle:""]},[e._v(e._s(e.attributeJson.label))])])])},$e=[],He={name:"simplyText",inheritAttrs:!1,mixins:[k],computed:{textStyle(){let{fontStyle:{fontSize:e,color:t,fontWeight:i,textDecoration:r,lineHeight:s,fontItalic:n,letterSpacing:a,fontBackColor:o,fontFamily:l},textAlign:d}=this.attributeJson,u="mobile"==this.mode?2*this.ratio:this.ratio,c={fontSize:parseFloat(e)*u+"px",color:t,fontWeight:i?"bold":"",textDecoration:r?"underline":"",fontStyle:n?"italic":"",lineHeight:s,letterSpacing:(a||0)+"px",backgroundColor:o||"",fontFamily:l,textAlign:d};return c},tipReportData(){return{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:24,popData:{},refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,position:1,event:"bannerShow"}}},methods:{pageClick(){if(this.attributeJson.linkObj.jumpLinkType)try{let e=JSON.parse(JSON.stringify(this.tipReportData));e.event="bannerClick";let t=C(e,this.envUrl,"click"),i=new Blob([JSON.stringify(t)],{type:"application/json"});navigator.sendBeacon(this.envUrl+"service-zuul/data/collect/acquisition",i)}catch(e){console.log(e)}this.$emit("jumpLink",this.attributeJson.linkObj)}}},ze=He,Ve=ze,Ge=(i("2e43"),O(Ve,qe,$e,!1,null,"1d184ad9",null)),We=Ge.exports,Xe=We,Ye={name:"singleLayout",inheritAttrs:!1,components:{textItem:M,imgNav:Q,videoItem:me,swiperItem:Ee,buttonItem:Le,productItem:Fe,simplyText:Xe},props:{layOutData:{type:Object,default:()=>{}},ratio:{type:Number,default:1},canDragInc:{type:Boolean,default:!0}},data(){return{vLine:[],hLine:[],componentName:""}},computed:{layoutStyle:function(){return this.layOutData.layoutStyle?{backgroundImage:2===this.layOutData.layoutStyle.bgStyle.type&&0!=this.layOutData.layoutStyle.bgStyle.picList.length&&`url(${this.layOutData.layoutStyle.bgStyle.picList[0].resourcePath})`,backgroundColor:1===this.layOutData.layoutStyle.bgStyle.type&&this.layOutData.layoutStyle.bgStyle.backgroundColor}:{}}},methods:{getCustom(){let e=this.layOutData.componentList.filter(e=>e.type>100);return e}}},Ke=Ye,Je=Ke,Qe=(i("6013"),O(Je,o,l,!1,null,"916fe080",null)),Ze=Qe.exports,et=Ze,tt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{key:e.layOutData.layoutStyle.height,staticClass:"multiple-layout",style:{height:Math.round(e.layOutData.layoutStyle.height*e.ratio)+"px"}},[e._l(e.layOutData.list,(function(t,r){return[i("div",{key:r,staticClass:"multiple-item",style:{width:Math.round(t.baseStyle.w*e.ratio)+"px",height:Math.round(e.layOutData.layoutStyle.height*e.ratio)+"px",zIndex:e.currentIndex==r?1:"auto"}},[i("singleLayout",e._g(e._b({ref:"multipleSingle",refInFor:!0,attrs:{layOutData:t,componentList:t.componentList,"parent-l":t.baseStyle.l,ratio:e.ratio,recordId:e.recordId,mode:e.mode}},"singleLayout",e.$attrs,!1),e.$listeners))],1)]}))],2)},it=[],rt={name:"multipleLayout",components:{singleLayout:et},props:{layOutData:{type:Object,default:()=>{}},ratio:{type:Number,default:1},mode:{type:String,default:"pc"},recordId:{type:Number,default:0}},inheritAttrs:!1,data(){return{w:200,currentItem:null,currentIndex:""}},watch:{},mounted(){},methods:{}},st=rt,nt=st,at=(i("8b28"),O(nt,tt,it,!1,null,"62f273ef",null)),ot=at.exports,lt=ot,dt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData,envUrl:e.envUrl,isClient:e.isClient},expression:"{data:tipReportData, envUrl, isClient}"}],ref:"custom"+e.layOutData.sort,staticClass:"custom-layout"},[i("div",{staticClass:"add-con"}),e._t("customComponent",null,{attributeJson:e.layOutData})],2)},ut=[],ct={name:"customLayout",props:{layOutData:{type:Object,default:()=>{}},envUrl:{type:String,default:""},path:{type:String},isClient:{type:Boolean,default:!0}},inheritAttrs:!1,computed:{tipReportData(){return{uniqueId:this.layOutData.sort,uniqueName:this.uniqueName,componentType:7,popData:{},refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,position:1}}},methods:{},directives:{treport:E}},ht=ct,pt=ht,ft=(i("3de5"),O(pt,dt,ut,!1,null,"2e732634",null)),mt=ft.exports,gt=mt,yt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"tab-layout"},[e.hasTab?i("div",{staticClass:"tab-detail tab-con"},[i("div",[2==e.tabHeadInfo.showTitle?i("div",{ref:"tabHeadTitleDom",style:e.titleStyle},[i("span",[e._v(e._s(1==e.tabHeadInfo.customTitle?e.tabHeadInfo.title:e.list[e.tabIndex].title))])]):e._e(),i("div",{staticClass:"tab-list"},[i("div",{staticClass:"tab-line"},e._l(e.list,(function(t,r){return i("navItem",{key:r,attrs:{id:[e.recordId+"_"+e.sort+"_"+Number(r+1),"nav-item"],name:[e.recordId+"_"+e.sort+"_"+Number(r+1),"nav-item"],item:t,ratio:e.ratio,mode:e.mode,spacing:e.layOutData.fontStyle.spacing*e.ratio,active:e.tabIndex==r,navStyle:e.navStyle(r),"data-sensors-click":"","data-sensorsClick":"true"},nativeOn:{click:function(i){return e.chooseTab(t,r)}}})})),1)]),i("div",{staticClass:"tab-content",style:{height:e.list[e.tabIndex].height*e.ratio+"px",transform:"translateX("+100*-e.tabIndex+"%)"}},e._l(e.list,(function(t,r){return i("div",{key:r,staticClass:"tab-single"},[i("singleLayout",e._g(e._b({ref:"tabSingle"+r,refInFor:!0,attrs:{layOutData:t,componentList:t.componentList,ratio:e.ratio,recordId:e.recordId,mode:e.mode}},"singleLayout",e.$attrs,!1),e.$listeners))],1)})),0)])]):e._e()])},vt=[],bt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"nav-item",style:[e.navStyle,e.backStyle]},[i("span",{style:{marginLeft:e.spacing+"px"}},[e._v(e._s(e.item.title))])])},_t=[],Tt={name:"navItem",props:{item:{type:Object,default:()=>{}},active:{type:Boolean,default:!1},navStyle:{type:Object,default:()=>{}},spacing:{type:[String,Number],default:0}},data(){return{}},watch:{},computed:{backStyle(){let{item:e,active:t}=this;return{backgroundColor:1==e.navStyle.type?t?e.navStyle.activeColor:e.navStyle.backgroundColor:"",backgroundImage:2==e.navStyle.type?t?`url('${e.navStyle.activeBackImage}')`:`url('${e.navStyle.backImage}')`:""}}},methods:{}},St=Tt,wt=St,Et=(i("ae5c"),O(wt,bt,_t,!1,null,"45583ab2",null)),Ct=Et.exports,xt=Ct,kt={name:"tabLayout",components:{navItem:xt,singleLayout:et},props:{sort:{type:Number,default:0},layOutData:{type:Object,default:()=>{}},ratio:{type:Number,default:1},mode:{type:String,default:"pc"},recordId:{type:Number,default:0}},data(){return{tabIndex:0,activeSort:"",tabHeadTitleH:0}},computed:{hasTab(){return this.layOutData.list.some(e=>e.title)},list(){return this.layOutData.list},tabHeadInfo(){return this.layOutData.tabHeadInfo},navStyle(){let{tabHeadInfo:{width:e,height:t},borderStyle:i,fontStyle:{fontSize:r,color:s,fontWeight:n,textDecoration:a,fontItalic:o,hoverObj:{color:l}}}=this.layOutData,{borderTop:d,borderRight:u,borderBottom:c,borderLeft:h,borderColor:p,hoverObj:f}=i;return function(){return{width:e*this.ratio+"px",height:t*this.ratio+"px",color:s,fontSize:r,fontWeight:n?"bold":"",textDecoration:a?"underline":"",fontStyle:o?"italic":"",borderTop:2===i.type&&d?"1px solid "+d:1===i.type&&p?"1px solid "+p:"none",borderRight:2===i.type&&u?"1px solid "+u:1===i.type&&p?"1px solid "+p:"none",borderBottom:2===i.type&&c?"1px solid "+c:1===i.type&&p?"1px solid "+p:"none",borderLeft:2===i.type&&h?"1px solid "+h:1===i.type&&p?"1px solid "+p:"none","--hoverColor":l,"--hoverBorderTop":2===f.type&&f.borderTop?"1px solid "+f.borderTop:1===f.type&&f.borderColor?"1px solid "+f.borderColor:"none","--hoverBorderRight":2===f.type&&f.borderRight?"1px solid "+f.borderRight:1===f.type&&f.borderColor?"1px solid "+f.borderColor:"none","--hoverBorderBottom":2===f.type&&f.borderBottom?"1px solid "+f.borderBottom:1===f.type&&f.borderColor?"1px solid "+f.borderColor:"none","--hoverBorderLeft":2===f.type&&f.borderLeft?"1px solid "+f.borderLeft:1===f.type&&f.borderColor?"1px solid "+f.borderColor:"none"}}},titleStyle(){let{tabHeadInfo:{titleStyle:{fontSize:e,color:t,fontWeight:i,textDecoration:r,fontItalic:s}}}=this.layOutData;return{color:t,fontSize:e,fontWeight:i?"bold":"",textDecoration:r?"underline":"",fontStyle:s?"italic":"",paddingLeft:("pc"==this.mode?30:60)*this.ratio+"px",paddingBottom:("pc"==this.mode?40:80)*this.ratio+"px"}}},watch:{"layOutData.tabHeadInfo":{handler:function(){this.$nextTick(()=>{this.tabHeadTitleH=2==this.layOutData.tabHeadInfo.showTitle&&this.$refs["tabHeadTitleDom"]?this.$refs["tabHeadTitleDom"].clientHeight:0,this.setLayoutH()})},immediate:!0,deep:!0},"list.length":{handler:function(){let e=this.list.findIndex(e=>e.sort==this.activeSort);e>-1?this.tabIndex=e:(this.tabIndex=this.tabIndex>0?this.tabIndex-1:0,this.activeSort=this.list[this.tabIndex].sort)},deep:!0},hasTab:{handler:function(e){e&&(this.activeSort=this.list[0].sort,this.tabIndex=0)}}},methods:{chooseTab(e,t){this.activeSort=e.sort,this.tabIndex=t,this.setLayoutH(),this.$emit("updateLayOut",{sort:this.layOutData.sort})},setLayoutH:function(){this.$set(this.layOutData.layoutStyle,"height",1*this.layOutData.list[this.tabIndex].height+1*this.layOutData.tabHeadInfo.height+1*this.tabHeadTitleH/this.ratio)}}},It=kt,At=It,Pt=(i("266b"),O(At,yt,vt,!1,null,"6ab7fd00",null)),Ot=Pt.exports,Lt=Ot,Dt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"slide-wrap",style:{"--hoverColor":e.paginationStyle.hoverColor||e.paginationStyle.color,"--activeColor":e.paginationStyle.activeColor,"--color":e.paginationStyle.color}},[i("div",{key:e.indicatorType,class:["swiper-container swiper-container-"+e.recordId+" swiper-container-"+e.indicatorType],attrs:{id:"mySwiper-"+e.recordId}},[i("div",{staticClass:"swiper-wrapper"},e._l(e.slideList,(function(t,r){return i("div",{key:r,class:["swiper-slide",{"slide-auto":1==e.widthStyle.type||e.centeredSlides}],style:[e.backStyle(t.i),{width:1==e.widthStyle.type?t.slideWidth*e.ratio+"px":e.backStyle(t.i).width}]},[i("singleLayout",e._g(e._b({ref:t.isCopy?"":"slideSingle",refInFor:!0,attrs:{layOutData:t,ratio:e.ratio,recordId:e.recordId,mode:e.mode}},"singleLayout",e.$attrs,!1),e.$listeners))],1)})),0),e.hasSwiperButton?i("div",{class:["swiper-button-prev","swiper-button-prev-"+e.recordId]},[e._t("swiper-button-prev",(function(){return[i("div",{staticClass:"arrow"},[i("span",{staticClass:"cms2iconfont iconarrow-left",style:e.pageStyle})])]}))],2):e._e(),e.hasSwiperButton?i("div",{class:["swiper-button-next","swiper-button-next-"+e.recordId]},[e._t("swiper-button-next",(function(){return[i("div",{staticClass:"arrow"},[i("span",{staticClass:"cms2iconfont iconarrow-right",style:e.pageStyle})])]}))],2):e._e()])])},Mt=[],Nt={name:"slideLayout",components:{singleLayout:et},props:{layOutData:{type:Object,default:()=>{}},ratio:{type:Number,default:1},mode:{type:String,default:"pc"},recordId:{type:Number,default:0}},data(){return{swiper:"",slideIndex:0,layWidth:1920,isInit:!1,slideList:[]}},watch:{layoutStyle:{handler(e){this.layWidth=("pc"==this.mode?1920:750)*(e.widthStyle.width/100)},deep:!0,immediate:!0},slideLen:{handler(){this.calculateWidth()},immediate:!0}},computed:{layoutStyle(){return this.layOutData.layoutStyle},paginationStyle(){return this.layOutData.paginationStyle},bgStyle(){return this.layOutData.bgStyle},list(){return this.layOutData.list},styleType(){return this.layOutData.styleType},indicatorType(){return this.layOutData.indicatorType},widthStyle(){return this.layOutData.widthStyle},hasSwiperButton(){return 2==this.indicatorType},pageStyle(){return{color:this.layOutData.paginationStyle.color}},backStyle(){let{bgStyle:e,layoutStyle:t,styleType:i,mode:r}=this;return function(s){let n=this.list[s],a="",o="";1==e.status?1==e.type?a=e.backgroundColor||"":o=0!=e.picList.length?`url(${e.picList[0].resourcePath})`:"":1==n.bgStyle.type?a=n.bgStyle.backgroundColor||"":o=0!=n.bgStyle.picList.length?`url(${n.bgStyle.picList[0].resourcePath})`:"";let l="mobile"==r||"pc"==r&&2==i,d=l?this.layWidth-0*(this.layOutData.lineSlideNum+1)-("mobile"==r?20:556):this.layWidth;return{width:d/this.layOutData.lineSlideNum*this.ratio+"px",height:Math.ceil(t.height*this.ratio)+"px",backgroundColor:a,backgroundImage:o}}},slideLen(){return this.layOutData.list.length},centeredSlides(){return"mobile"==this.mode||"pc"==this.mode&&2==this.styleType}},methods:{calculateWidth:function(){let{list:e}=this;e.forEach((e,t)=>{e.i=t});let t=JSON.parse(JSON.stringify(e));t.forEach(e=>{e.isCopy=!0}),this.slideList=e.concat(JSON.parse(JSON.stringify(t))),this.slideList=t.concat(this.slideList),this.$nextTick(()=>{if(2==this.layOutData.widthStyle.type)return void this.initSwiper();let{layWidth:e}=this;this.slideList.forEach(t=>{let i=t.componentList[0],r=0;if(i){let t=i.attributeJson;if(2==i.type){let i=t.list.some(e=>0!=e.picList.length);r=i?t.baseStyle.w+t.baseStyle.l:e}else if(3==i.type){let i=0!=t.videoInfo.list.length;r=i?t.baseStyle.w+t.baseStyle.l:e}else r=t.baseStyle.w+t.baseStyle.l}else r=e;this.$set(t,"slideWidth",r)}),this.$nextTick(()=>{this.initSwiper()})})},initSwiper(){this.$nextTick(()=>{this.swiper&&(this.swiper.destroy(!0,!0),this.swiper=null);let{layOutData:e,widthStyle:t,ratio:i,slideLen:r}=this;this.options={effect:"slide",observer:!0,observeParents:!0,slidesPerView:this.centeredSlides||1==t.type?"auto":e.lineSlideNum,preventInteractionOnTransition:!0,slidesPerGroup:1,slidesPerGroupAuto:!0,centeredSlides:this.centeredSlides||1==t.type,spaceBetween:this.centeredSlides?0*i:0,autoplay:!!(e.autoPlay&&this.list.length>1)&&{delay:1e3*e.interval,disableOnInteraction:!1,stopOnLastSlide:!1}},1==t.type&&(this.options.loopedSlides=4,this.options.loopAdditionalSlides=2);let s=this;this.options.on={slideNextTransitionEnd:function(){this.activeIndex==2*r&&this.slideTo(r,0),s.slideIndex=this.activeIndex},slidePrevTransitionEnd:function(){this.activeIndex==r-1&&this.slideTo(2*r-1,0)}},this.hasSwiperButton&&(this.options.navigation={nextEl:".swiper-button-next-"+this.recordId,prevEl:".swiper-button-prev-"+this.recordId}),this.swiper=new B.a(".swiper-container-"+this.recordId,this.options),this.swiper.slideTo(r,0)})}}},Rt=Nt,Ut=Rt,Bt=(i("1cfd"),O(Ut,Dt,Mt,!1,null,"407dcfa9",null)),jt=Bt.exports,Ft=jt,qt={name:"cms",inheritAttrs:!1,components:{singleLayout:et,multipleLayout:lt,customLayout:gt,tabLayout:Lt,slideLayout:Ft},props:{cmsList:{type:Array,default:()=>[]},canDrag:{type:Boolean,default:!0},mode:{type:String,default:"pc"},ratio:{type:Number,default:1},envUrl:{type:String,default:""},path:{type:String},isClient:{type:Boolean,default:!0}},data(){return{chooseSort:"",activeIndex:-1,layOutObj:{1:"singleLayout",2:"multipleLayout",3:"customLayout",4:"tabLayout",5:"slideLayout"}}},computed:{},mounted(){},methods:{chooseLayout(e,t){this.chooseSort=t,this.$emit("updateLayOut",{layoutType:e,sort:t})},updateSort(e){this.chooseSort=e},deleteModule(e,t){t===this.chooseSort?this.$emit("deleteModule",e):(this.cmsList.splice(e,1),this.$emit("saveVersionId"))},showOrHide(e){let t=this.cmsList[e];this.$set(t,"displayType",t.displayType?0:1),this.$emit("componentChange",t.sort)}}},$t=qt,Ht=$t,zt=(i("4664"),O(Ht,n,a,!1,null,"443f8186",null)),Vt=zt.exports;const Gt=[Vt],Wt=function(e){Wt.installed||Gt.map(t=>e.component(t.name,t))};var Xt={install:Wt};t["default"]=Xt},fc6a:function(e,t,i){"use strict";var r=i("44ad"),s=i("1d80");e.exports=function(e){return r(s(e))}},fda2:function(e,t,i){},fdbf:function(e,t,i){"use strict";var r=i("04f8");e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fdcb:function(e,t,i){},fe0f:function(e,t,i){},fe1c:function(e,t,i){}});
|
30
|
+
/*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */const r=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],r=t[4],s=i[4];let n,a,o;const l=[],d=[];let u,c,h,p,f,m;for(n=0;n<256;n++)d[(l[n]=n<<1^283*(n>>7))^n]=n;for(a=o=0;!r[a];a^=u||1,o=d[o]||1)for(p=o^o<<1^o<<2^o<<3^o<<4,p=p>>8^255&p^99,r[a]=p,s[p]=a,h=l[c=l[u=l[a]]],m=16843009*h^65537*c^257*u^16843008*a,f=257*l[p]^16843008*p,n=0;n<4;n++)t[n][a]=f=f<<24^f>>>8,i[n][p]=m=m<<24^m>>>8;for(n=0;n<5;n++)t[n]=t[n].slice(0),i[n]=i[n].slice(0);return e};let s=null;class n{constructor(e){let t,i,n;s||(s=r()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];const a=this._tables[0][4],o=this._tables[1],l=e.length;let d=1;if(4!==l&&6!==l&&8!==l)throw new Error("Invalid aes key size");const u=e.slice(0),c=[];for(this._key=[u,c],t=l;t<4*l+28;t++)n=u[t-1],(t%l===0||8===l&&t%l===4)&&(n=a[n>>>24]<<24^a[n>>16&255]<<16^a[n>>8&255]<<8^a[255&n],t%l===0&&(n=n<<8^n>>>24^d<<24,d=d<<1^283*(d>>7))),u[t]=u[t-l]^n;for(i=0;t;i++,t--)n=u[3&i?t:t-4],c[i]=t<=4||i<4?n:o[0][a[n>>>24]]^o[1][a[n>>16&255]]^o[2][a[n>>8&255]]^o[3][a[255&n]]}decrypt(e,t,i,r,s,n){const a=this._key[1];let o,l,d,u=e^a[0],c=r^a[1],h=i^a[2],p=t^a[3];const f=a.length/4-2;let m,g=4;const y=this._tables[1],v=y[0],b=y[1],_=y[2],T=y[3],S=y[4];for(m=0;m<f;m++)o=v[u>>>24]^b[c>>16&255]^_[h>>8&255]^T[255&p]^a[g],l=v[c>>>24]^b[h>>16&255]^_[p>>8&255]^T[255&u]^a[g+1],d=v[h>>>24]^b[p>>16&255]^_[u>>8&255]^T[255&c]^a[g+2],p=v[p>>>24]^b[u>>16&255]^_[c>>8&255]^T[255&h]^a[g+3],g+=4,u=o,c=l,h=d;for(m=0;m<4;m++)s[(3&-m)+n]=S[u>>>24]<<24^S[c>>16&255]<<16^S[h>>8&255]<<8^S[255&p]^a[g++],o=u,u=c,c=h,h=p,p=o}}class a extends t{constructor(){super(t),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const o=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},l=function(e,t,i){const r=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),s=new n(Array.prototype.slice.call(t)),a=new Uint8Array(e.byteLength),l=new Int32Array(a.buffer);let d,u,c,h,p,f,m,g,y;for(d=i[0],u=i[1],c=i[2],h=i[3],y=0;y<r.length;y+=4)p=o(r[y]),f=o(r[y+1]),m=o(r[y+2]),g=o(r[y+3]),s.decrypt(p,f,m,g,l,y),l[y]=o(l[y]^d),l[y+1]=o(l[y+1]^u),l[y+2]=o(l[y+2]^c),l[y+3]=o(l[y+3]^h),d=p,u=f,c=m,h=g;return a};class d{constructor(e,t,r,s){const n=d.STEP,l=new Int32Array(e.buffer),u=new Uint8Array(e.byteLength);let c=0;for(this.asyncStream_=new a,this.asyncStream_.push(this.decryptChunk_(l.subarray(c,c+n),t,r,u)),c=n;c<l.length;c+=n)r=new Uint32Array([o(l[c-4]),o(l[c-3]),o(l[c-2]),o(l[c-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(c,c+n),t,r,u));this.asyncStream_.push((function(){s(null,i(u))}))}static get STEP(){return 32e3}decryptChunk_(e,t,i,r){return function(){const s=l(e,t,i);r.set(s,e.byteOffset)}}}var u,c="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{};u="undefined"!==typeof window?window:"undefined"!==typeof c?c:"undefined"!==typeof self?self:{};var h=u,p=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},f=h.BigInt||Number;f("0x1"),f("0x100"),f("0x10000"),f("0x1000000"),f("0x100000000"),f("0x10000000000"),f("0x1000000000000"),f("0x100000000000000"),f("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();const m=function(e){const t={};return Object.keys(e).forEach(i=>{const r=e[i];p(r)?t[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[i]=r}),t};self.onmessage=function(e){const t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),r=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),s=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new d(i,r,s,(function(e,i){self.postMessage(m({source:t.source,decrypted:i}),[i.buffer])}))}})));var fd=bo(pd);const md=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},gd=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},yd=(e,t)=>{t.activePlaylistLoader=e,e.load()},vd=(e,t)=>()=>{const{segmentLoaders:{[e]:i,main:r},mediaTypes:{[e]:s}}=t,n=s.activeTrack(),a=s.getActiveGroup(),o=s.activePlaylistLoader,l=s.lastGroup_;a&&l&&a.id===l.id||(s.lastGroup_=a,s.lastTrack_=n,gd(i,s),a&&!a.isMainPlaylist&&(a.playlistLoader?(i.resyncLoader(),yd(a.playlistLoader,s)):o&&r.resetEverything()))},bd=(e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:r}}=t;r.lastGroup_=null,i.abort(),i.pause()},_d=(e,t)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[e]:r,main:s},mediaTypes:{[e]:n}}=t,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,d=n.lastTrack_;if((!d||!a||d.id!==a.id)&&(n.lastGroup_=o,n.lastTrack_=a,gd(r,n),o)){if(o.isMainPlaylist){if(!a||!d||a.id===d.id)return;const e=t.vhs.playlistController_,r=e.selectPlaylist();if(e.media()===r)return;return n.logger_(`track change. Switching main audio from ${d.id} to ${a.id}`),i.pause(),s.resetEverything(),void e.fastQualityChange_(r)}if("AUDIO"===e){if(!o.playlistLoader)return s.setAudio(!0),void s.resetEverything();r.setAudio(!0),s.setAudio(!1)}l!==o.playlistLoader?(r.track&&r.track(a),r.resetEverything(),yd(o.playlistLoader,n)):yd(o.playlistLoader,n)}},Td={AUDIO:(e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:r},excludePlaylist:s}=t;gd(i,r);const n=r.activeTrack(),a=r.activeGroup(),o=(a.filter(e=>e.default)[0]||a[0]).id,l=r.tracks[o];if(n!==l){bn.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in r.tracks)r.tracks[e].enabled=r.tracks[e]===l;r.onTrackChanged()}else s({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:r}}=t;bn.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),gd(i,r);const s=r.activeTrack();s&&(s.mode="disabled"),r.onTrackChanged()}},Sd={AUDIO:(e,t,i)=>{if(!t)return;const{tech:r,requestOptions:s,segmentLoaders:{[e]:n}}=i;t.on("loadedmetadata",()=>{const e=t.media();n.playlist(e,s),(!r.paused()||e.endList&&"none"!==r.preload())&&n.load()}),t.on("loadedplaylist",()=>{n.playlist(t.media(),s),r.paused()||n.load()}),t.on("error",Td[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:r,requestOptions:s,segmentLoaders:{[e]:n},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{const e=t.media();n.playlist(e,s),n.track(a.activeTrack()),(!r.paused()||e.endList&&"none"!==r.preload())&&n.load()}),t.on("loadedplaylist",()=>{n.playlist(t.media(),s),r.paused()||n.load()}),t.on("error",Td[e](e,i))}},wd={AUDIO:(e,t)=>{const{vhs:i,sourceType:r,segmentLoaders:{[e]:s},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:d}},mainPlaylistLoader:u}=t,c=pa(u.main);a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}},c&&(a[e].main.default.playlists=u.main.playlists));for(const h in a[e]){o[h]||(o[h]=[]);for(const s in a[e][h]){let p,f=a[e][h][s];if(c?(d(`AUDIO group '${h}' label '${s}' is a main playlist`),f.isMainPlaylist=!0,p=null):p="vhs-json"===r&&f.playlists?new Da(f.playlists[0],i,n):f.resolvedUri?new Da(f.resolvedUri,i,n):f.playlists&&"dash"===r?new fo(f.playlists[0],i,n,u):null,f=An({id:s,playlistLoader:p},f),Sd[e](e,f.playlistLoader,t),o[h].push(f),"undefined"===typeof l[s]){const e=new bn.AudioTrack({id:s,kind:md(f),enabled:!1,language:f.language,default:f.default,label:s});l[s]=e}}}s.on("error",Td[e](e,t))},SUBTITLES:(e,t)=>{const{tech:i,vhs:r,sourceType:s,segmentLoaders:{[e]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:d}},mainPlaylistLoader:u}=t;for(const c in o[e]){l[c]||(l[c]=[]);for(const n in o[e][c]){if(o[e][c][n].forced)continue;let h,p=o[e][c][n];if("hls"===s)h=new Da(p.resolvedUri,r,a);else if("dash"===s){const e=p.playlists.filter(e=>e.excludeUntil!==1/0);if(!e.length)return;h=new fo(p.playlists[0],r,a,u)}else"vhs-json"===s&&(h=new Da(p.playlists?p.playlists[0]:p.resolvedUri,r,a));if(p=An({id:n,playlistLoader:h},p),Sd[e](e,p.playlistLoader,t),l[c].push(p),"undefined"===typeof d[n]){const e=i.addRemoteTextTrack({id:n,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:n},!1).track;d[n]=e}}}n.on("error",Td[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:i,main:{mediaGroups:r},mediaTypes:{[e]:{groups:s,tracks:n}}}=t;for(const a in r[e]){s[a]||(s[a]=[]);for(const t in r[e][a]){const o=r[e][a][t];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;const l=i.options_.vhs&&i.options_.vhs.captionServices||{};let d={label:t,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[d.instreamId]&&(d=An(d,l[d.instreamId])),void 0===d.default&&delete d.default,s[a].push(An({id:t},o)),"undefined"===typeof n[t]){const e=i.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;n[t]=e}}}}},Ed=(e,t)=>{for(let i=0;i<e.length;i++){if(ca(t,e[i]))return!0;if(e[i].playlists&&Ed(e[i].playlists,t))return!0}return!1},Cd=(e,t)=>i=>{const{mainPlaylistLoader:r,mediaTypes:{[e]:{groups:s}}}=t,n=r.media();if(!n)return null;let a=null;n.attributes[e]&&(a=s[n.attributes[e]]);const o=Object.keys(s);if(!a)if("AUDIO"===e&&o.length>1&&pa(t.main))for(let e=0;e<o.length;e++){const t=s[o[e]];if(Ed(t,n)){a=t;break}}else s.main?a=s.main:1===o.length&&(a=s[o[0]]);return"undefined"===typeof i?a:null!==i&&a&&a.filter(e=>e.id===i.id)[0]||null},xd={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}},kd=(e,{mediaTypes:t})=>()=>{const i=t[e].activeTrack();return i?t[e].activeGroup(i):null},Id=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{wd[t](t,e)});const{mediaTypes:t,mainPlaylistLoader:i,tech:r,vhs:s,segmentLoaders:{["AUDIO"]:n,main:a}}=e;["AUDIO","SUBTITLES"].forEach(i=>{t[i].activeGroup=Cd(i,e),t[i].activeTrack=xd[i](i,e),t[i].onGroupChanged=vd(i,e),t[i].onGroupChanging=bd(i,e),t[i].onTrackChanged=_d(i,e),t[i].getActiveGroup=kd(i,e)});const o=t.AUDIO.activeGroup();if(o){const e=(o.filter(e=>e.default)[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();const i=t.AUDIO.getActiveGroup();i.playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanging())});const l=()=>{t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",l),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),s.on("dispose",()=>{r.audioTracks().removeEventListener("change",l),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(const d in t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[d])},Ad=()=>{const e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Gl,activeTrack:Gl,getActiveGroup:Gl,onGroupChanged:Gl,onTrackChanged:Gl,lastTrack_:null,logger_:In(`MediaGroups[${t}]`)}}),e},Pd=120;let Od;const Ld=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Dd=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},Md=function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:r,bufferLowWaterLine:s,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!r)return bn.log.warn("We received no playlist to switch to. Please check your stream."),!1;const d=`allowing switch ${e&&e.id||"null"} -> ${r.id}`;if(!e)return l(d+" as current playlist is not set"),!0;if(r.id===e.id)return!1;const u=Boolean(Mn(t,i).length);if(!e.endList)return u||"number"!==typeof e.partTargetDuration?(l(d+" as current playlist is live"),!0):(l(`not ${d} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const c=Hn(t,i),h=o?mo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:mo.MAX_BUFFER_LOW_WATER_LINE;if(a<h)return l(`${d} as duration < max low water line (${a} < ${h})`),!0;const p=r.attributes.BANDWIDTH,f=e.attributes.BANDWIDTH;if(p<f&&(!o||c<n)){let e=`${d} as next bandwidth < current bandwidth (${p} < ${f})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${c} < ${n})`),l(e),!0}if((!o||p>f)&&c>=s){let e=`${d} as forwardBuffer >= bufferLowWaterLine (${c} >= ${s})`;return o&&(e+=` and next bandwidth > current bandwidth (${p} > ${f})`),l(e),!0}return l(`not ${d} as no switching criteria met`),!1};class Nd extends bn.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:r,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:d,sourceType:u,cacheEncryptionKeys:c,bufferBasedABR:h,leastPixelDiffSelector:p,captionServices:f}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:m}=e;null!==m&&"undefined"!==typeof m||(m=1/0),Od=a,this.bufferBasedABR=Boolean(h),this.leastPixelDiffSelector=Boolean(p),this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.sourceType_=u,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=m,this.enableLowInitialPlaylist=d,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:m,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=Ad(),this.mediaSource=new s.a.MediaSource,this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=Pn(),this.hasPlayed_=!1,this.syncController_=new cd(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new fd,this.sourceUpdater_=new rd(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new hd;const g={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:f,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:c,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings};this.mainPlaylistLoader_="dash"===this.sourceType_?new fo(t,this.vhs_,this.requestOptions_):new Da(t,this.vhs_,this.requestOptions_),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Vl(An(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Vl(An(g,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new ad(An(g,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks}),e),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),Ld.forEach(e=>{this[e+"_"]=Dd.bind(this,e)}),this.logger_=In("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const y="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(y,()=>{const e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const r=this.media(),s=r&&(r.id||r.uri),n=e.id||e.uri;s&&s!==n&&(this.logger_(`switch media ${s} -> ${n} from ${t}`),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.mainPlaylistLoader_.media(e,i)}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=s.a.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(s.a.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,r=Object.keys(i);let s;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)s=this.mediaTypes_.AUDIO.activeTrack();else{const e=i.main||r.length&&i[r[0]];for(const t in e)if(e[t].default){s={label:t};break}}if(!s)return t;const n=[];for(const a in i)if(i[a][s.label]){const t=i[a][s.label];if(t.playlists&&t.playlists.length)n.push.apply(n,t.playlists);else if(t.uri)n.push(t);else if(e.playlists.length)for(let i=0;i<e.playlists.length;i++){const t=e.playlists[i];t.attributes&&t.attributes.AUDIO&&t.attributes.AUDIO===a&&n.push(t)}}return n.length?n:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;ua(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),Id({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t))return;this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial");const i="vhs-json"===this.sourceType_&&this.initialMedia_.segments;if(!i)return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;ua(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if("playlist-unchanged"===e.lastExcludeReason_)return;const t=this.stuckAtPlaylistEnd_(e);t&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let r=!0;const s=Object.keys(i.AUDIO);for(const n in i.AUDIO)for(const e in i.AUDIO[n]){const t=i.AUDIO[n][e];t.uri||(r=!1)}r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Od.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),s.length&&Object.keys(i.AUDIO[s[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),s=this.bufferHighWaterLine(),n=this.tech_.buffered();return Md({buffered:n,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:Pd}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){e!==this.mainPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(()=>{bn.browser.IE_VERSION||bn.browser.IS_EDGE?this.tech_.setCurrentTime(this.tech_.currentTime()+.04):this.tech_.setCurrentTime(this.tech_.currentTime())})):this.logger_("skipping fastQualityChange because new media is same as old")}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList){const e=this.seekable();if(!e.length)return!1;if(bn.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",()=>{this.trigger("firstplay"),this.tech_.setCurrentTime(e.end(0)),this.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(e.end(0))}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();"undefined"!==typeof e&&"function"===typeof e.then&&e.then(null,e=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){const t=this.seekable();if(!t.length)return!1;const i=this.syncController_.getExpiredTime(e,this.duration());if(null===i)return!1;const r=Od.Playlist.playlistEnd(e,i),s=this.tech_.currentTime(),n=this.tech_.buffered();if(!n.length)return r-s<=Ln;const a=n.end(n.length-1);return a-s<=Ln&&r-a<=Ln}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,s=r.filter(na),n=1===s.length&&s[0]===e;if(1===r.length&&i!==1/0)return bn.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(n);if(n){let t=!1;r.forEach(i=>{if(i===e)return;const r=i.excludeUntil;"undefined"!==typeof r&&r!==1/0&&(t=!0,delete i.excludeUntil)}),t&&(bn.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let a;a=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=a,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const l=t.internal?this.logger_:bn.log.warn,d=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${d} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const u=o.targetDuration/2*1e3||5e3,c="number"===typeof o.lastRequest&&Date.now()-o.lastRequest<=u;return this.switchMedia_(o,"exclude",n||c)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],r="all"===e;(r||"main"===e)&&i.push(this.mainPlaylistLoader_);const s=[];(r||"audio"===e)&&s.push("AUDIO"),(r||"subtitle"===e)&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach(e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)}),["main","audio","subtitle"].forEach(t=>{const r=this[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||i.push(r)}),i.forEach(e=>t.forEach(t=>{"function"===typeof e[t]&&e[t]()}))}setCurrentTime(e){const t=Mn(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Od.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let i=this.syncController_.getExpiredTime(t,this.duration());if(null===i)return;const r=this.mainPlaylistLoader_.main,s=Od.Playlist.seekable(t,i,Od.Playlist.liveEdgeDelay(r,t));if(0===s.length)return;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),null===i)return;if(e=Od.Playlist.seekable(t,i,Od.Playlist.liveEdgeDelay(r,t)),0===e.length)return}let n,a;this.seekable_&&this.seekable_.length&&(n=this.seekable_.end(0),a=this.seekable_.start(0)),e?e.start(0)>s.end(0)||s.start(0)>e.end(0)?this.seekable_=s:this.seekable_=Pn([[e.start(0)>s.start(0)?e.start(0):s.start(0),e.end(0)<s.end(0)?e.end(0):s.end(0)]]):this.seekable_=s,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===n&&this.seekable_.start(0)===a||(this.logger_(`seekable updated [${Bn(this.seekable_)}]`),this.tech_.trigger("seekablechanged"))}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){const e=this.seekable();if(!e.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1)))}const t=this.tech_.buffered();let i=Od.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t)t[i].forEach(e=>{e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};e.video=e.main;const t=al(this.main(),this.media()),i={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(i.video=t.video||e.main.videoCodec||b["b"]),e.main.isMuxed&&(i.video+=","+(t.audio||e.main.audioCodec||b["a"])),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||r)&&(i.audio=t.audio||e.main.audioCodec||e.audio.audioCodec||b["a"],e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!i.audio&&!i.video)return void this.excludePlaylist({playlistToExclude:this.media(),error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const s=(e,t)=>e?Object(b["c"])(t):Object(b["g"])(t),n={};let a;if(["video","audio"].forEach((function(t){if(i.hasOwnProperty(t)&&!s(e[t].isFmp4,i[t])){const r=e[t].isFmp4?"browser":"muxer";n[r]=n[r]||[],n[r].push(i[t]),"audio"===t&&(a=r)}})),r&&a&&this.media().attributes.AUDIO){const e=this.media().attributes.AUDIO;this.main().playlists.forEach(t=>{const i=t.attributes&&t.attributes.AUDIO;i===e&&t!==this.media()&&(t.excludeUntil=1/0)}),this.logger_(`excluding audio group ${e} as ${a} does not support codec(s): "${i.audio}"`)}if(!Object.keys(n).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach(t=>{const r=(Object(b["h"])(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,s=(Object(b["h"])(i[t]||"")[0]||{}).type;r&&s&&r.toLowerCase()!==s.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${i[t]}"`)}),e.length)return void this.excludePlaylist({playlistToExclude:this.media(),error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return i}{const e=Object.keys(n).reduce((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${n[t].join(",")}"`,e),"")+".";this.excludePlaylist({playlistToExclude:this.media(),error:{internal:!0,message:e},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const r=e[i];if(-1!==t.indexOf(r.id))return;t.push(r.id);const s=al(this.main,r),n=[];!s.audio||Object(b["g"])(s.audio)||Object(b["c"])(s.audio)||n.push("audio codec "+s.audio),!s.video||Object(b["g"])(s.video)||Object(b["c"])(s.video)||n.push("video codec "+s.video),s.text&&"stpp.ttml.im1t"===s.text&&n.push("text codec "+s.text),n.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${n.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,r=sl(Object(b["h"])(e)),s=nl(r),n=r.video&&Object(b["h"])(r.video)[0]||null,a=r.audio&&Object(b["h"])(r.audio)[0]||null;Object.keys(i).forEach(e=>{const r=i[e];if(-1!==t.indexOf(r.id)||r.excludeUntil===1/0)return;t.push(r.id);const o=[],l=al(this.mainPlaylistLoader_.main,r),d=nl(l);if(l.audio||l.video){if(d!==s&&o.push(`codec count "${d}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){const e=l.video&&Object(b["h"])(l.video)[0]||null,t=l.audio&&Object(b["h"])(l.audio)[0]||null;e&&n&&e.type.toLowerCase()!==n.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${n.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${a.type}"`)}o.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id}: ${o.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),ld(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=mo.GOAL_BUFFER_LENGTH,i=mo.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,mo.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=mo.BUFFER_LOW_WATER_LINE,i=mo.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,mo.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(t,mo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?s:r)}bufferHighWaterLine(){return mo.BUFFER_HIGH_WATER_LINE}}const Rd=(e,t,i)=>r=>{const s=e.main.playlists[t],n=sa(s),a=na(s);return"undefined"===typeof r?a:(r?delete s.disabled:s.disabled=!0,r===a||n||(i(),r?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),r)};class Ud{constructor(e,t,i){const{playlistController_:r}=e,s=r.fastQualityChange_.bind(r);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=al(r.main(),t),this.playlist=t,this.id=i,this.enabled=Rd(e.playlists,t.id,s)}}const Bd=function(e){e.representations=()=>{const t=e.playlistController_.main(),i=pa(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(e=>!sa(e)).map((t,i)=>new Ud(e,t,t.id)):[]}},jd=["seeking","seeked","pause","playing","error"];class Fd{constructor(e){this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=In("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(e=>{l[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},a[e+"SegmentLoader_"].on("appendsdone",l[e].updateend),a[e+"SegmentLoader_"].on("playlistupdate",l[e].reset),this.tech_.on(["seeked","seeking"],l[e].reset)});const d=e=>{["main","audio"].forEach(t=>{a[t+"SegmentLoader_"][e]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),d("off"))},this.clearSeekingAppendCheck_=()=>d("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),d("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(jd,n),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(jd,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(e=>{a[e+"SegmentLoader_"].off("appendsdone",l[e].updateend),a[e+"SegmentLoader_"].off("playlistupdate",l[e].reset),this.tech_.off(["seeked","seeking"],l[e].reset)}),this.checkCurrentTimeTimeout_&&s.a.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&s.a.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=s.a.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[e+"SegmentLoader_"];this[e+"StalledDownloads_"]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[e+"SegmentLoader_"],r=i.buffered_(),s=qn(this[e+"Buffered_"],r);this[e+"Buffered_"]=r,s?this.resetSegmentDownloads_(e):(this[e+"StalledDownloads_"]++,this.logger_(`found #${this[e+"StalledDownloads_"]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Fn(r)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0})))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Ln>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){const e=this.tech_.seeking();if(!e)return!1;const t=this.seekable(),i=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let s;if(r){const e=t.end(t.length-1);s=e}if(this.beforeSeekableWindow_(t,i)){const e=t.start(0);s=e+(e===t.end(0)?0:Ln)}if("undefined"!==typeof s)return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${Bn(t)}. Seeking to `+s+"."),this.tech_.setCurrentTime(s),!0;const n=this.playlistController_.sourceUpdater_,a=this.tech_.buffered(),o=n.audioBuffer?n.audioBuffered():null,l=n.videoBuffer?n.videoBuffered():null,d=this.media(),u=d.partTargetDuration?d.partTargetDuration:2*(d.targetDuration-On),c=[o,l];for(let p=0;p<c.length;p++){if(!c[p])continue;const e=Hn(c[p],i);if(e<u)return!1}const h=Nn(a,i);return 0!==h.length&&(s=h.start(0)+Ln,this.logger_(`Buffered region starts (${h.start(0)}) just beyond seek point (${i}). Seeking to ${s}.`),this.tech_.setCurrentTime(s),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Mn(t,e);return i.length&&e+3<=i.end(0)?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const i=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) `+i),this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered(),s=this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t});if(s)return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const n=Nn(r,t);return n.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${n.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,r=!1){if(!e.length)return!1;let s=e.end(e.length-1)+Ln;const n=!i.endList;return n&&r&&(s=e.end(e.length-1)+3*i.targetDuration),t>s}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let r;if(e.length&&t.length){const s=Mn(e,i-3),n=Mn(e,i),a=Mn(t,i);a.length&&!n.length&&s.length&&(r={start:s.end(0),end:a.end(0)})}else{const t=Nn(e,i);t.length||(r=this.gapFromVideoUnderflow_(e,i))}return!!r&&(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time `+i),!0)}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),r=Nn(t,i);this.resetTimeUpdate_(),0!==r.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+On),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}))}gapFromVideoUnderflow_(e,t){const i=Rn(e);for(let r=0;r<i.length;r++){const e=i.start(r),s=i.end(r);if(t-e<4&&t-e>2)return{start:e,end:s}}return null}}const qd={errorInterval:30,getSource(e){const t=this.tech({IWillNotUseThisInPlugins:!0}),i=t.currentSource_||this.currentSource();return e(i)}},$d=function(e,t){let i=0,r=0;const s=An(qd,t);e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){r&&e.currentTime(r)},a=function(t){null!==t&&void 0!==t&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",n),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){if(Date.now()-i<1e3*s.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(s.getSource&&"function"===typeof s.getSource)return i=Date.now(),s.getSource.call(e,a);bn.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function(){e.off("loadedmetadata",n),e.off("error",o),e.off("dispose",l)},d=function(t){l(),$d(e,t)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=d},Hd=function(e){$d(this,e)};var zd="3.0.0",Vd="6.2.0",Gd="1.0.1",Wd="6.0.0",Xd="4.0.1";const Yd={PlaylistLoader:Da,Playlist:fa,utils:Xa,STANDARD_PLAYLIST_SELECTOR:fl,INITIAL_PLAYLIST_SELECTOR:yl,lastBandwidthSelector:fl,movingAverageBandwidthSelector:ml,comparePlaylistBandwidth:cl,comparePlaylistResolution:hl,xhr:Ra()};Object.keys(mo).forEach(e=>{Object.defineProperty(Yd,e,{get(){return bn.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),mo[e]},set(t){bn.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!==typeof t||t<0?bn.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):mo[e]=t}})});const Kd="videojs-vhs",Jd=function(e,t){const i=t.media();let r=-1;for(let s=0;s<e.length;s++)if(e[s].id===i.id){r=s;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})},Qd=function(e,t){t.representations().forEach(t=>{e.addQualityLevel(t)}),Jd(e,t.playlists)};Yd.canPlaySource=function(){return bn.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Zd=(e,t,i)=>{if(!e)return e;let r={};t&&t.attributes&&t.attributes.CODECS&&(r=sl(Object(b["h"])(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(r.audio=i.attributes.CODECS);const s=Object(b["e"])(r.video),n=Object(b["e"])(r.audio),a={};for(const o in e)a[o]={},n&&(a[o].audioContentType=n),s&&(a[o].videoContentType=s),t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh&&(a[o].pssh=t.contentProtection[o].pssh),"string"===typeof e[o]&&(a[o].url=e[o]);return An(e,a)},eu=(e,t)=>e.reduce((e,i)=>{if(!i.contentProtection)return e;const r=t.reduce((e,t)=>{const r=i.contentProtection[t];return r&&r.pssh&&(e[t]={pssh:r.pssh}),e},{});return Object.keys(r).length&&e.push(r),e},[]),tu=({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:r})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const s=i?r.concat([i]):r,n=eu(s,Object.keys(t)),a=[],o=[];return n.forEach(t=>{o.push(new Promise((t,i)=>{e.tech_.one("keysessioncreated",t)})),a.push(new Promise((i,r)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{e?r(e):i()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},iu=({player:e,sourceKeySystems:t,media:i,audioMedia:r})=>{const s=Zd(t,i,r);return!!s&&(e.currentSource().keySystems=s,!(s&&!e.eme)||(bn.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},ru=()=>{if(!s.a.localStorage)return null;const e=s.a.localStorage.getItem(Kd);if(!e)return null;try{return JSON.parse(e)}catch(t){return null}},su=e=>{if(!s.a.localStorage)return!1;let t=ru();t=t?An(t,e):e;try{s.a.localStorage.setItem(Kd,JSON.stringify(t))}catch(i){return!1}return t},nu=e=>0===e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(e.substring(e.indexOf(",")+1)):e;Yd.supportsNativeHls=function(){if(!a.a||!a.a.createElement)return!1;const e=a.a.createElement("video");if(!bn.getTech("Html5").isSupported())return!1;const t=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return t.some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),Yd.supportsNativeDash=function(){return!!(a.a&&a.a.createElement&&bn.getTech("Html5").isSupported())&&/maybe|probably/i.test(a.a.createElement("video").canPlayType("application/dash+xml"))}(),Yd.supportsTypeNatively=e=>"hls"===e?Yd.supportsNativeHls:"dash"===e&&Yd.supportsNativeDash,Yd.isSupported=function(){return bn.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const au=bn.getComponent("Component");class ou extends au{constructor(e,t,i){if(super(t,i.vhs),"number"===typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=In("VhsHandler"),t.options_&&t.options_.playerId){const e=bn.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(a.a,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{const t=a.a.fullscreenElement||a.a.webkitFullscreenElement||a.a.mozFullScreenElement||a.a.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),this.on(this.tech_,"error",(function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()})),this.on(this.tech_,"play",this.play)}setOptions_(){if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage="undefined"!==typeof this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!==typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=300),"number"!==typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=ru();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!==typeof this.options_.bandwidth&&(this.options_.bandwidth=mo.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===mo.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{"undefined"!==typeof this.source_[e]&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=nu(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Yd,this.options_.sourceType=Object(_["a"])(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.playlistController_=new Nd(this.options_);const i=An({liveRangeSafeTimeDelta:Ln},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Fd(i),this.playlistController_.on("error",()=>{const e=bn.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!==typeof t||t.code?"string"===typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});const r=this.options_.bufferBasedABR?Yd.movingAverageBandwidthSelector(.55):Yd.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Yd.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=s.a.navigator.connection||s.a.navigator.mozConnection||s.a.navigator.webkitConnection,i=1e7;if(this.options_.useNetworkInformationApi&&t){const r=1e3*t.downlink*1e3;e=r>=i&&e>=i?Math.max(e,r):r}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;t=this.throughput>0?1/this.throughput:0;const i=Math.floor(1/(e+t));return i},set(){bn.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Fn(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Fn(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&su({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{Bd(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.playlistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=s.a.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),tu({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=iu({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",e=>{if("output-restricted"!==e.status)return;const t=this.playlistController_.main();if(!t||!t.playlists)return;const i=[];t.playlists.forEach(e=>{e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height>=720&&(!e.excludeUntil||e.excludeUntil<1/0)&&(e.excludeUntil=1/0,i.push(e))}),i.length&&(bn.log.warn('DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.',...i),this.playlistController_.fastQualityChange_())}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==bn.browser.IE_VERSION&&t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=bn.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{Qd(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Jd(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":zd,"mux.js":Vd,"mpd-parser":Gd,"m3u8-parser":Wd,"aes-decrypter":Xd}}version(){return this.constructor.version()}canChangeType(){return rd.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&s.a.URL.revokeObjectURL&&(s.a.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return io({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return ro({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}}const lu={name:"videojs-http-streaming",VERSION:zd,canHandleSource(e,t={}){const i=An(bn.options,t);return lu.canPlayType(e.type,i)},handleSource(e,t,i={}){const r=An(bn.options,i);return t.vhs=new ou(e,t,r),t.vhs.xhr=Ra(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t={}){const{vhs:{overrideNative:i=!bn.browser.IS_ANY_SAFARI}={}}=An(bn.options,t),r=Object(_["a"])(e),s=r&&(!Yd.supportsTypeNatively(r)||i);return s?"maybe":""}},du=()=>Object(b["c"])("avc1.4d400d,mp4a.40.2");du()&&bn.getTech("Html5").registerSourceHandler(lu,0),bn.VhsHandler=ou,bn.VhsSourceHandler=lu,bn.Vhs=Yd,bn.use||bn.registerComponent("Vhs",Yd),bn.options.vhs=bn.options.vhs||{},bn.getPlugin&&bn.getPlugin("reloadSourceOnError")||bn.registerPlugin("reloadSourceOnError",Hd)}).call(this,i("24aa"))},f6b4:function(e,t,i){"use strict";var r=i("c532");function s(){this.handlers=[]}s.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},s.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},s.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=s},f772:function(e,t,i){"use strict";var r=i("5692"),s=i("90e3"),n=r("keys");e.exports=function(e){return n[e]||(n[e]=s(e))}},f8a8:function(e,t,i){"use strict";i.d(t,"a",(function(){return A})),i.d(t,"b",(function(){return P}));var r,s=i("de66"),n=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"===typeof e?Object(s["h"])(e):e}),a=function(e){return Array.isArray(e)?e.map((function(e){return n(e)})):[n(e)]},o=function(e){e=Object(s["k"])(e);var t=[],i=0;while(e.length>i){var n=e[i],a=0,o=0;o++;var l=e[o];o++;while(128&l)a=(127&l)<<7,l=e[o],o++;a+=127&l;for(var d=0;d<r.length;d++){var u=r[d],c=u.id,h=u.parser;if(n===c){t.push(h(e.subarray(o,o+a)));break}}i+=a+o}return t};r=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var i=e[t.size];t.url=Object(s["c"])(e.subarray(t.size+1,t.size+1+i)),t.size+=i}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=o(e.subarray(t.size))||[],t}},{id:4,parser:function(e){var t={tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:o(e.subarray(13))};return t}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var l=function e(t,i,r){void 0===r&&(r=!1),i=a(i),t=Object(s["k"])(t);var n=[];if(!i.length)return n;var o=0;while(o<t.length){var l=(t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3])>>>0,d=t.subarray(o+4,o+8);if(0===l)break;var u=o+l;if(u>t.length){if(r)break;u=t.length}var c=t.subarray(o+8,u);Object(s["a"])(d,i[0])&&(1===i.length?n.push(c):n.push.apply(n,e(c,i.slice(1),r))),o=u}return n},d={EBML:Object(s["k"])([26,69,223,163]),DocType:Object(s["k"])([66,130]),Segment:Object(s["k"])([24,83,128,103]),SegmentInfo:Object(s["k"])([21,73,169,102]),Tracks:Object(s["k"])([22,84,174,107]),Track:Object(s["k"])([174]),TrackNumber:Object(s["k"])([215]),DefaultDuration:Object(s["k"])([35,227,131]),TrackEntry:Object(s["k"])([174]),TrackType:Object(s["k"])([131]),FlagDefault:Object(s["k"])([136]),CodecID:Object(s["k"])([134]),CodecPrivate:Object(s["k"])([99,162]),VideoTrack:Object(s["k"])([224]),AudioTrack:Object(s["k"])([225]),Cluster:Object(s["k"])([31,67,182,117]),Timestamp:Object(s["k"])([231]),TimestampScale:Object(s["k"])([42,215,177]),BlockGroup:Object(s["k"])([160]),BlockDuration:Object(s["k"])([155]),Block:Object(s["k"])([161]),SimpleBlock:Object(s["k"])([163])},u=[128,64,32,16,8,4,2,1],c=function(e){for(var t=1,i=0;i<u.length;i++){if(e&u[i])break;t++}return t},h=function(e,t,i,r){void 0===i&&(i=!0),void 0===r&&(r=!1);var n=c(e[t]),a=e.subarray(t,t+n);return i&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=u[n-1]),{length:n,value:Object(s["b"])(a,{signed:r}),bytes:a}},p=function e(t){return"string"===typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"===typeof t?Object(s["f"])(t):t},f=function(e){return Array.isArray(e)?e.map((function(e){return p(e)})):[p(e)]},m=function e(t,i,r){if(r>=i.length)return i.length;var n=h(i,r,!1);if(Object(s["a"])(t.bytes,n.bytes))return r;var a=h(i,r+n.length);return e(t,i,r+a.length+a.value+n.length)},g=function e(t,i){i=f(i),t=Object(s["k"])(t);var r=[];if(!i.length)return r;var n=0;while(n<t.length){var a=h(t,n,!1),o=h(t,n+a.length),l=n+a.length+o.length;127===o.value&&(o.value=m(a,t,l),o.value!==t.length&&(o.value-=l));var d=l+o.value>t.length?t.length:l+o.value,u=t.subarray(l,d);Object(s["a"])(i[0],a.bytes)&&(1===i.length?r.push(u):r=r.concat(e(u,i.slice(1))));var c=a.length+o.length+u.length;n+=c}return r},y=i("321f"),v=Object(s["k"])([0,0,0,1]),b=Object(s["k"])([0,0,1]),_=Object(s["k"])([0,0,3]),T=function(e){var t=[],i=1;while(i<e.length-2)Object(s["a"])(e.subarray(i,i+3),_)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var r=e.length-t.length,n=new Uint8Array(r),a=0;for(i=0;i<r;a++,i++)a===t[0]&&(a++,t.shift()),n[i]=e[a];return n},S=function(e,t,i,r){void 0===r&&(r=1/0),e=Object(s["k"])(e),i=[].concat(i);var n,a=0,o=0;while(a<e.length&&(o<r||n)){var l=void 0;if(Object(s["a"])(e.subarray(a),v)?l=4:Object(s["a"])(e.subarray(a),b)&&(l=3),l){if(o++,n)return T(e.subarray(n,a));var d=void 0;"h264"===t?d=31&e[a+l]:"h265"===t&&(d=e[a+l]>>1&63),-1!==i.indexOf(d)&&(n=a+l),a+=l+("h264"===t?1:2)}else a++}return e.subarray(0,0)},w=function(e,t,i){return S(e,"h264",t,i)},E=function(e,t,i){return S(e,"h265",t,i)},C={webm:Object(s["k"])([119,101,98,109]),matroska:Object(s["k"])([109,97,116,114,111,115,107,97]),flac:Object(s["k"])([102,76,97,67]),ogg:Object(s["k"])([79,103,103,83]),ac3:Object(s["k"])([11,119]),riff:Object(s["k"])([82,73,70,70]),avi:Object(s["k"])([65,86,73]),wav:Object(s["k"])([87,65,86,69]),"3gp":Object(s["k"])([102,116,121,112,51,103]),mp4:Object(s["k"])([102,116,121,112]),fmp4:Object(s["k"])([115,116,121,112]),mov:Object(s["k"])([102,116,121,112,113,116]),moov:Object(s["k"])([109,111,111,118]),moof:Object(s["k"])([109,111,111,102])},x={aac:function(e){var t=Object(y["a"])(e);return Object(s["a"])(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Object(y["a"])(e);return Object(s["a"])(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=g(e,[d.EBML,d.DocType])[0];return Object(s["a"])(t,C.webm)},mkv:function(e){var t=g(e,[d.EBML,d.DocType])[0];return Object(s["a"])(t,C.matroska)},mp4:function(e){return!x["3gp"](e)&&!x.mov(e)&&(!(!Object(s["a"])(e,C.mp4,{offset:4})&&!Object(s["a"])(e,C.fmp4,{offset:4}))||(!(!Object(s["a"])(e,C.moof,{offset:4})&&!Object(s["a"])(e,C.moov,{offset:4}))||void 0))},mov:function(e){return Object(s["a"])(e,C.mov,{offset:4})},"3gp":function(e){return Object(s["a"])(e,C["3gp"],{offset:4})},ac3:function(e){var t=Object(y["a"])(e);return Object(s["a"])(e,C.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];var t=0;while(t+188<e.length&&t<188){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=Object(y["a"])(e);return Object(s["a"])(e,C.flac,{offset:t})},ogg:function(e){return Object(s["a"])(e,C.ogg)},avi:function(e){return Object(s["a"])(e,C.riff)&&Object(s["a"])(e,C.avi,{offset:8})},wav:function(e){return Object(s["a"])(e,C.riff)&&Object(s["a"])(e,C.wav,{offset:8})},h264:function(e){return w(e,7,3).length},h265:function(e){return E(e,[32,33],3).length}},k=Object.keys(x).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);k.forEach((function(e){var t=x[e];x[e]=function(e){return t(Object(s["k"])(e))}}));var I=x,A=function(e){e=Object(s["k"])(e);for(var t=0;t<k.length;t++){var i=k[t];if(I[i](e))return i}return""},P=function(e){return l(e,["moof"]).length>0}},f97d:function(e,t){var i={"":!0,up:!0};function r(e){if("string"!==typeof e)return!1;var t=i[e.toLowerCase()];return!!t&&e.toLowerCase()}function s(e){return"number"===typeof e&&e>=0&&e<=100}function n(){var e=100,t=3,i=0,n=100,a=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!s(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!==typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!s(e))throw new Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!s(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!s(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return a},set:function(e){if(!s(e))throw new Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var t=r(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):l=t}}})}e.exports=n},fb15:function(e,t,i){"use strict";if(i.r(t),i.d(t,"cms",(function(){return Vt})),"undefined"!==typeof window){var r=window.document.currentScript,s=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);s&&(i.p=s[1])}var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cms"},[i("div",{class:["lay-wrap",{mobile:"mobile"==e.mode}]},e._l(e.cmsList,(function(t){return i("div",{key:t.sort,staticClass:"lay-item"},[i("div",{staticClass:"layout-set",style:{width:t.attributeJson.layoutStyle&&2===t.attributeJson.layoutStyle.widthStyle.type?t.attributeJson.layoutStyle.widthStyle.width+"%":"100%",height:t.attributeJson.layoutStyle?Math.round(t.attributeJson.layoutStyle.height*e.ratio)+"px":"auto"}},[i(e.layOutObj[t.layoutType],e._g(e._b({ref:"layModule",refInFor:!0,tag:"component",attrs:{layOutData:t.attributeJson,sort:t.attributeJson.sort,ratio:e.ratio,mode:e.mode,recordId:t.originalId,envUrl:e.envUrl,path:e.path,isClient:e.isClient},scopedSlots:e._u([{key:"customComponent",fn:function(i){return 3==t.layoutType?[e._t("customComponent",null,{attributeJson:i.attributeJson})]:void 0}},{key:"dgCustomComponent",fn:function(t){return[e._t("dgCustomComponent",null,{data:t.attributeJson})]}}],null,!0)},"component",e.$attrs,!1),e.$listeners))],1)])})),0)])},a=[],o=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"single-layout",style:e.layoutStyle},[i("div",{staticStyle:{width:"100%",height:"100%"}},[e._l(e.layOutData.componentList.filter((function(e){return e.type<=100})),(function(t,r){return i("div",{key:r},[1==t.displayType?i(t.component,e._g(e._b({key:t.sort,ref:"singleComponent",refInFor:!0,tag:"component",style:{zIndex:r+1},attrs:{ratio:e.ratio,attributeJson:t.attributeJson,sortId:t.sort}},"component",e.$attrs,!1),e.$listeners)):e._e()],1)})),i("div",[e._t("dgCustomComponent",null,{attributeJson:e.getCustom()})],2)],2)])},l=[],d=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"text-wrap entrance-con",style:[e.conStyle,e.animationInStyle],attrs:{id:[e.recordId+"_"+e.sortId,"entrance-con"],name:[e.recordId+"_"+e.sortId,"entrance-con"],"data-sensors-click":"","data-sensorsClick":"true"},on:{click:e.pageClick}},[i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData,envUrl:e.envUrl},expression:"{data:tipReportData, envUrl}"}],class:["text-con","text-con-"+e.sortId,e.animationInObj.type?e.enterClass:""],domProps:{innerHTML:e._s(e.attributeJson.label)}})])},u=[],c=(i("be35"),i("a7a3"),i("77ed"),i("1e09"),i("fda2"),i("14d9"),i("bc3a")),h=i.n(c);const p={json:"application/json;",form:"application/x-www-form-urlencoded;",html:"text/html;",file:"multipart/form-data",excel:"msexcel",xml:"application/xml",javascript:"application/x-javascript;charset=utf-8"},f={lang:"Accept-Language",contentType:"Content-Type"};function m(e){if(200===e.status){let t=e.data;return"0"===t.errorCode?t.data:e.data}}h.a.interceptors.response.use(m,e=>Promise.reject(e));class g{static async call(e,{method:t="get",headers:i={},body:r=null,responseType:s=null}={}){let n=e,a={method:t,url:n,responseType:s||"json",headers:i};"get"===t?a.params=r:a.data=r;const o=await h()(a).catch(e=>{e.response?console.error(e.response.status,e.response.data):e.request?console.error(e.request):console.error("Error",e.message?e.message:"")});return o}static get(e,{mask:t=!0,external:i=!1,headers:r={}}={}){return g.call(e,{headers:r,external:i,mask:t})}static postBody(e,{body:t={},language:i="zh-CN",module:r="",method:s="post",mask:n=!0,postData:a=!0,external:o=!1,headers:l={},compat:d}){return g.call(e,{module:r,method:s,headers:Object.assign(l,{[f.contentType]:p.json,common:{languageCode:i}}),body:t,postData:a,external:o,mask:n,compat:d})}}class y{getProductInfo(e,t,i){return g.postBody(e+"service-zuul/manage/search/plp/standard",{body:t,language:i})}getSortProductInfo(e,t,i){return g.postBody(e+"service-zuul/manage/search/cms/sort",{body:t,language:i})}dataSaveDecorationPageComponentEvent(e,t){return g.postBody(e+"service-zuul/data/collect/acquisition",{body:t})}acquisitionBatch(e,t){return g.postBody(e+"/service-zuul/data/collect/acquisitionBatch",{body:t})}}const v=new y;class b{constructor(){this.intersectionObserver=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(_(e,this.intersectionObserver),this.intersectionObserver.unobserve(e.target))})}),this.interval=T()}observe(e,t){e.setAttribute("report-data",JSON.stringify(t.value?t.value.data:null)),this.intersectionObserver.observe(e)}disconnect(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),sessionStorage.setItem("reportData","[]"),this.interval&&(clearInterval(this.interval),this.interval=null))}static getInstance(e){return this.instance||(this.instance=new b),e&&(this.instance.envUrl=e.value?e.value.envUrl:this.instance.envUrl),this.instance}}const _=function(e,t){const i=e.target,r=i.getAttribute("report-data");let s=JSON.parse(sessionStorage.getItem("reportData")||null)||[];"null"!=r&&"undefined"!=r?(s.push(r),sessionStorage.setItem("reportData",JSON.stringify(s))):t.unobserve(i)},T=function(){let e=setInterval(()=>{let e=JSON.parse(sessionStorage.getItem("reportData")||null)||[];e.length>0&&(sessionStorage.setItem("reportData","[]"),S(e))},1500);return e},S=function(e){let t=e.map(e=>w(e)),i=b.getInstance().envUrl;i&&v.acquisitionBatch(i,t)},w=function(e){let t=JSON.parse(e);const i={source:"",medium:"",commodity_id:t.popData&&t.popData.productCode||"",commodity_name:t.popData&&t.popData.selectDataShow||"",commodity_sku_id:"",component_name:t.uniqueName,component_id:t.uniqueId,component_type:t.componentType,hot_zone_id:t.popData&&t.popData.uniqueId||"",hot_zone_name:t.popData&&t.popData.uniqueName||"",material_id:t.materialId,material_name:t.materialName,url_path:t.path||"/",refer_info:t.refererPagePath,position:t.position,trigger_Method_Type:t.componentMethodType};let r="";return localStorage.getItem(t.brand+"Cookie")?r=localStorage.getItem(t.brand+"Cookie"):(r=`${parseInt((new Date).getTime())}${Math.floor(1e4*Math.random())}`,localStorage.setItem(t.brand+"Cookie",r)),{eventProperty:JSON.stringify({...i}),event:t.event,distinctId:r}};var E={bind(e,t){"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype&&b.getInstance(t).observe(e,t)},unbind(){b.getInstance().disconnect()}};function C(e,t,i){const r=new y,s={source:"",medium:"",commodity_id:e.popData.productCode||"",commodity_name:e.popData.selectDataShow||"",commodity_sku_id:"",component_name:e.uniqueName,component_id:e.uniqueId,component_type:e.componentType,hot_zone_id:e.popData.uniqueId||"",hot_zone_name:e.popData.uniqueName||"",material_id:e.materialId,material_name:e.materialName,url_path:e.path,refer_info:e.refererPagePath,position:e.position,trigger_Method_Type:e.componentMethodType};let n="";localStorage.getItem(e.brand+"Cookie")?n=localStorage.getItem(e.brand+"Cookie"):(n=`${parseInt((new Date).getTime())}${Math.floor(1e4*Math.random())}`,localStorage.setItem(e.brand+"Cookie",n));let a={eventProperty:JSON.stringify({...s}),event:e.event,distinctId:n};if("click"==i)return a;r.dataSaveDecorationPageComponentEvent(t,a)}function x(e,t){var i=null,r=Date.now();return function(){var s=Date.now(),n=t-(s-r),a=this,o=arguments;clearTimeout(i),n<=0?(e.apply(a,o),r=Date.now()):i=setTimeout(e,n)}}const k={inheritAttrs:!1,props:{attributeJson:{type:Object,default:function(){}},item:{type:Object,default:()=>{}},ratio:{type:Number,default:1},envUrl:{type:String,default:""},fontRatio:{type:Number,default:1},mode:{type:String,default:"pc"},language:{type:String,default:"zh-CN"},sortId:{type:Number,default:0},sort:{type:[String,Number],default:0},recordId:{type:[String,Number],default:0},refererPagePath:{type:String},brand:{type:String},path:{type:String},isClient:{type:Boolean,default:!0}},data(){return{scrollHandle:x(this.scrollThrottle,200),hoverStyle:{},hoverStyleShow:!1,hoverImage:"",hoverDirection:"",finishAnimation:!1,animationInStyle:{},entranceAnimate:{fade:"fadeIn",scale:"zoomIn"}}},computed:{animationInObj:function(){return this.attributeJson.animationInObj},animationHoverObj:function(){return this.attributeJson.animationHoverObj},baseStyle(){return this.attributeJson.baseStyle},styleType(){return this.attributeJson.styleType},conStyle(){let{attributeJson:e,ratio:t}=this;return{width:Math.round(e.baseStyle.w*t)+"px",height:Math.round(e.baseStyle.h*t)+"px",left:Math.round(e.baseStyle.l*t)+"px",top:Math.round(e.baseStyle.t*t)+"px"}}},watch:{animationHoverObj:{handler(e){this.disposeHoverAnimate(e)},immediate:!0,deep:!0},animationInObj:{handler(){let{type:e,direction:t,delay:i,duration:r}=this.attributeJson.animationInObj;e&&(this.enterClass="",this.enterClass=this.entranceAnimate[e],this.animationInStyle={animationDuration:r+"s",amimationDelay:i+"s",animationName:"slide"!=e?this.entranceAnimate[e]:t,animationPlayState:"paused"})},immediate:!0}},mounted(){this.isInCurrentScreenArea()?this.$nextTick(()=>{this.$el.style.animationPlayState="running",this.finishAnimation=!0}):this.animationInStyle.animationName&&(this.$el.style.animationPlayState="paused",this.startObserver())},methods:{isInCurrentScreenArea(){const{top:e}=this.$el.getBoundingClientRect();return e<=window.innerHeight-100},scrollThrottle(){this.isInCurrentScreenArea()&&!this.finishAnimation&&(this.animationInStyle.animationName&&(this.$el.style.animationPlayState="running"),this.finishAnimation=!0,this.endObserver())},startObserver(){window.addEventListener("scroll",this.scrollHandle,!0)},endObserver(){window.removeEventListener("scroll",this.scrollHandle,!0)},disposeHoverAnimate(e){let t={};if(2===e.type){let i=e.borderStyle;if(1==i.type&&(t={border:i.borderColor?"2px solid "+i.borderColor:"none"}),2==i.type){let{borderTop:e,borderRight:r,borderBottom:s,borderLeft:n}=i;t={borderTop:e?"2px solid "+e:"none",borderRight:r?"2px solid "+r:"none",borderBottom:s?"2px solid "+s:"none",borderLeft:n?"2px solid "+n:"none"}}}if(3===e.type&&(t={transform:"scale(1.2)",transformOrigin:"center center"}),4===e.type&&(this.hoverDirection=e.bgStyle.direction),5===e.type){let{hoverImgList:t}=e;this.hoverImage=t[0]?t[0].resourcePath:""}this.hoverStyle=t},onDrag:function(e,t){let i=this.ratio;this.attributeJson.baseStyle.l=e/i,this.attributeJson.baseStyle.t=t/i,this.$set(this.attributeJson,"baseStyle",this.attributeJson.baseStyle)},onResize:function(e,t,i,r){let s=this.ratio,n=this.attributeJson.baseStyle;n={w:i/s,h:r/s,l:e/s,t:t/s,isLocked:n.isLocked},this.$set(this.attributeJson,"baseStyle",n)},getRefLineParams(e){this.$emit("getRefLineParams",e)}},directives:{hoverAnimate:{inserted:function(e,t,i){e.onmouseover=function(){i.context.hoverStyleShow=!0,t.value&&(i.context[t.value.key]=t.value.value)},e.onmouseleave=function(){i.context.hoverStyleShow=!1,t.value&&(i.context[t.value.key]=-1)}}},treport:E}};var I={name:"textItem",mixins:[k],components:{},props:{},data(){return{}},computed:{tipReportData(){return{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:12,popData:{},refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,position:1,event:"bannerShow"}}},methods:{pageClick(){if(this.attributeJson.linkObj.jumpLinkType)try{let e=JSON.parse(JSON.stringify(this.tipReportData));e.event="bannerClick";let t=C(e,this.envUrl,"click"),i=new Blob([JSON.stringify(t)],{type:"application/json"});navigator.sendBeacon(this.envUrl+"service-zuul/data/collect/acquisition",i)}catch(e){console.log(e)}this.$emit("jumpLink",this.attributeJson.linkObj)}}},A=I,P=A;i("4e30");function O(e,t,i,r,s,n,a,o){var l,d="function"===typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=i,d._compiled=!0),r&&(d.functional=!0),n&&(d._scopeId="data-v-"+n),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},d._ssrRegister=l):s&&(l=o?function(){s.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(d.functional){d._injectStyles=l;var u=d.render;d.render=function(e,t){return l.call(t),u(e,t)}}else{var c=d.beforeCreate;d.beforeCreate=c?[].concat(c,l):[l]}return{exports:e,options:d}}var L=O(P,d,u,!1,null,"1e5d96ce",null),D=L.exports,M=D,N=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{key:e.attributeJson.sort,staticClass:"image-list entrance-con",style:Object.assign({},{width:Math.ceil(e.attributeJson.baseStyle.w*e.ratio)+"px",height:Math.round(e.attributeJson.baseStyle.h*e.ratio)+"px",left:Math.round(e.attributeJson.baseStyle.l*e.ratio)+"px",top:Math.round(e.attributeJson.baseStyle.t*e.ratio)+"px"},e.animationInStyle)},[e.hasConfig?[i("div",{ref:"img"+e.attributeJson.sort,class:["image-warp","image-warp-"+e.sortId],style:{animationDuration:e.animationInObj.duration+"s"}},[e.isSwiper?i("div",{directives:[{name:"hoverAnimate",rawName:"v-hoverAnimate"}],style:[e.picStyle,3===e.animationHoverObj.type&&e.hoverStyleShow?e.hoverStyle:""]},[i("div",{class:["swiper-container swiper-container-"+e.sortId]},[i("div",{staticClass:"swiper-wrapper",style:{height:(e.baseStyle.h-(e.hasScrollBar?30:0))*e.ratio+"px!important"}},e._l(e.attributeJson.list,(function(t,r){return i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData(r),envUrl:e.envUrl},expression:"{data:tipReportData(index), envUrl}"}],key:t.id,staticClass:"swiper-slide",style:{width:e.baseStyle.w/4*e.ratio+"px"}},[i("div",{staticClass:"slide-con",style:{height:(e.baseStyle.h-(e.hasScrollBar?30:0))*e.ratio+"px"}},[i("img",{attrs:{src:t.picList[0].resourcePath,alt:t.picList[0].resourceName.split(".")[0]}}),0!=t.picList.length&&0!=t.popList.length?[i("hotspot",e._g(e._b({ref:"hotspot"+e.sortId+r,refInFor:!0,attrs:{componentType:2,item:t,ratio:e.ratio,path:e.path,envUrl:e.envUrl,sortId:e.sortId,recordId:e.recordId,laySort:e.sort,brand:e.brand,uniqueName:e.attributeJson.uniqueName,language:e.language}},"hotspot",e.$attrs,!1),e.$listeners))]:e._e()],2)])})),0),e.hasSwiperButton?i("div",{class:"swiper-button-prev swiper-button-prev-"+e.sortId},[e._t("swiper-button-prev",(function(){return[2==e.indicatorType||3==e.indicatorType?i("div",[i("span",{staticClass:"cms2iconfont iconleft"})]):e._e()]}))],2):e._e(),e.hasSwiperButton?i("div",{class:"swiper-button-next swiper-button-next-"+e.sortId},[e._t("swiper-button-next",(function(){return[2==e.indicatorType||3==e.indicatorType?i("div",[i("span",{staticClass:"cms2iconfont iconright"})]):e._e()]}))],2):e._e(),e.hasScrollBar?i("div",{class:"swiper-scrollbar swiper-scrollbar-"+e.sortId}):e._e()]),2===e.animationHoverObj.type?i("div",{staticClass:"hover-con",style:[e.hoverStyle,{opacity:e.hoverStyleShow?1:0}]}):e._e()]):i("div",{class:["image-warp",3==e.styleType&&"pc"!=e.mode?"image-type3":""],style:[e.picStyle,3===e.animationHoverObj.type&&e.hoverStyleShow?e.hoverStyle:""]},e._l(e.attributeJson.list,(function(t,r){return i("div",{directives:[{name:"hoverAnimate",rawName:"v-hoverAnimate"},{name:"treport",rawName:"v-treport",value:{data:e.tipReportData(r),envUrl:e.envUrl},expression:"{data:tipReportData(index), envUrl}"}],key:r,staticClass:"image-item",style:[e.picItemStyle]},[i("img",{class:{contain:1!=e.styleType},attrs:{src:t.picList[0].resourcePath,alt:t.picList[0].resourceName.split(".")[0]}}),2===e.animationHoverObj.type?i("div",{staticClass:"hover-con",style:[e.hoverStyle,{opacity:e.hoverStyleShow?1:0}]}):e._e(),5===e.animationHoverObj.type&&e.hoverImage&&e.hoverStyleShow?i("img",{staticClass:"hover-image",attrs:{src:e.hoverImage,alt:""}}):e._e(),0!=t.picList.length&&0!=t.popList.length?i("div",[i("hotspot",e._g(e._b({ref:"hotspot"+e.sortId+r,refInFor:!0,attrs:{item:t,ratio:e.ratio,path:e.path,brand:e.brand,envUrl:e.envUrl,sortId:e.sortId,recordId:e.recordId,componentType:2,uniqueName:e.attributeJson.uniqueName,language:e.language}},"hotspot",e.$attrs,!1),e.$listeners))],1):e._e()])})),0)])]:e._e()],2)},R=[],U=(i("13d5"),i("02a3")),B=i.n(U),j=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"pop-wrap",style:{left:e.item.left,top:e.item.top,width:e.item.realWidth*e.ratio+"px"||!1,height:e.item.realHeight*e.ratio+"px"||!1}},e._l(e.item.popList,(function(t,r){return i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData(r),envUrl:e.envUrl},expression:"{data:tipReportData(index), envUrl}"}],key:r,ref:""+e.sortId+r,refInFor:!0,class:"pop-item",style:{width:t.width/750*100+"%",height:t.height/(e.item.height/e.proportion)*100+"%",left:t.left/750*100+"%",top:t.top/(e.item.height/e.proportion)*100+"%"},attrs:{id:[e.recordId+"_"+e.sortId+"_"+t.uniqueId.split("_")[2],"pop-item"],"data-sensors-click":"","data-sensorsClick":"true",name:[e.recordId+"_"+e.sortId+"_"+t.uniqueId.split("_")[2],"pop-item"]},on:{click:function(i){return e.pageClick(t,r)}}},[t.product.openHot?i("div",{staticClass:"product-hover",on:{mouseover:function(t){return e.mouseover(r)},mouseleave:e.mouseLeave}},[0!=t.product.initImage.length?i("div",{staticStyle:{"{ fontsize":"0"}},[i("img",{attrs:{src:e.hoverIndex==r?t.product.hoverImage[0].resourcePath:t.product.initImage[0].resourcePath,alt:""}})]):e._e(),e.hoverIndex==r?i("div",{staticClass:"product-image"},[i("img",{attrs:{src:1==t.product.imageType?e.productImage[t.productCode]:t.product.productImage[0].resourcePath,alt:""}})]):e._e()]):e._e()])})),0)},F=[],q={name:"hotspot",props:{item:{type:Object,default:()=>{}},width:{type:Number,default:0},height:{type:Number,default:0},ratio:{type:Number,default:1},envUrl:{type:String,default:""},sortId:{type:Number,default:0},recordId:{type:Number,default:0},brand:{type:String},componentType:{type:Number},refererPagePath:{type:String},path:{type:String},pathType:{type:Number},uniqueName:{type:String},language:{type:String,default:"zh-CN"},prePosition:{type:Number}},data(){return{hotList:[],proportion:1,hoverIndex:1,needReport:!0,preTotal:0,productImage:{},service:new y}},watch:{"item.width":{handler(e){this.proportion=e/750},deep:!0,immediate:!0},itemCodeList:{handler(e){this.getProductList(e)},immediate:!0,deep:!0}},computed:{itemCodeList(){let e=this.item.popList.filter(e=>1==e.jumpLinkType&&1==e.product.imageType&&e.product.openHot);return e.map(e=>e.productCode)},tipReportData(){let e=JSON.parse(JSON.stringify(this.item.popList));return function(t){let i=e[t];return{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.uniqueName,componentMethodType:0,popData:{productCode:i.productCode,selectDataShow:i.selectDataShow,uniqueName:i.uniqueName,uniqueId:this.recordId+"_"+this.sortId+"_"+i.uniqueId.split("_")[2],brand:1===this.pathType?"defaultPath":this.brand},materialId:this.item.sort?this.recordId+"_"+this.item.sort:this.recordId+"_"+this.sortId,materialName:this.item.uniqueName?this.item.uniqueName:this.uniqueName,refererPagePath:this.refererPagePath,path:this.path,componentType:this.componentType,brand:this.brand,position:this.preTotal+t+1,event:"bannerShow"}}}},mounted(){this.hotList=JSON.parse(JSON.stringify(this.item.popList))},methods:{pageClick(e,t){if(e.jumpLinkType)try{this.dataSend(e,t,1)}catch(i){console.log(i)}this.$emit("jumpLink",e)},dataSend(e,t,i){let r={uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.uniqueName,componentMethodType:i,popData:{...e,uniqueId:this.recordId+"_"+this.sortId+"_"+e.uniqueId.split("_")[2],brand:1===this.pathType?"defaultPath":this.brand},materialId:this.item.sort?this.recordId+"_"+this.item.sort:this.recordId+"_"+this.sortId,materialName:this.item.uniqueName?this.item.uniqueName:this.uniqueName,refererPagePath:this.refererPagePath,path:this.path,componentType:this.componentType,brand:this.brand,position:this.prePosition?this.prePosition+t+1:1*this.preTotal+t+1,event:0==i?"bannerShow":"bannerClick"};if(0==i)C(r,this.envUrl);else{let e=C(r,this.envUrl,"click"),t=new Blob([JSON.stringify(e)],{type:"application/json"});navigator.sendBeacon(this.envUrl+"service-zuul/data/collect/acquisition",t)}},getProductList(e){if(0==e.length)return;let t={itemCodeList:e,pageNum:1,pageSize:e.length},i={};this.service.getProductInfo(this.envUrl,t,this.language).then(e=>{e&&e.list&&(this.productList=e.list,e.list.forEach(e=>{i[e.code]=e.mainPicUrl}),this.productImage=i)})},mouseover(e){this.hoverIndex=e},mouseLeave(){this.hoverIndex=-1}},directives:{treport:E}},$=q,H=$,z=(i("55f9"),O(H,j,F,!1,null,"4c0eac42",null)),V=z.exports,G=V,W={name:"imgNav",mixins:[k],components:{hotspot:G},props:{},data(){return{swiper:"",imageList:[],popList:[],positionList:[],positionTotal:[],hasInitSwiper:!1}},computed:{indicatorType(){return this.attributeJson.indicatorType},picStyle(){let{attributeJson:e,ratio:t,animationInObj:i}=this;return{animationDuration:i.duration+"s",padding:`0 ${e.paddingSpacing*t}px`,width:Math.ceil(e.baseStyle.w*t)+"px"}},picItemStyle(){let{attributeJson:e,ratio:t}=this,{oneLineCount:i}=e;return{width:Math.ceil((e.baseStyle.w*t-2*e.paddingSpacing*t)/i)+"px",height:Math.ceil(e.baseStyle.h*t)+"px",padding:"0 "+e.itemSpacing*t+"px"}},list(){return this.attributeJson.list},isSwiper(){return 3==this.styleType&&2==this.indicatorType&&"pc"==this.mode||2==this.styleType&&2==this.indicatorType&&"mobile"==this.mode},hasConfig(){return this.attributeJson.list.some(e=>0!=e.picList.length)},hasSwiperButton(){return 3==this.styleType&&2==this.indicatorType&&"pc"==this.mode},hasScrollBar(){return 2==this.styleType&&2==this.indicatorType&&"mobile"==this.mode},tipReportData(){let{list:e}=this,t=[],i=[];return e.forEach(e=>{0!=e.popList.length?t.push(e.popList.length):t.push(1)}),t.forEach((e,r)=>{let s=t.slice(0,r),n=s.reduce((e,t)=>e+t,0);i.push(n)}),this.positionList=t,this.positionTotal=i,function(t){let i=e[t];return 0!=i.popList.length?void 0:{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:2,materialId:this.recordId+"_"+this.sortId+"_"+i.sort,materialName:i.uniqueName,refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,position:this.positionTotal[t]+1,event:"bannerShow"}}}},watch:{isSwiper:{handler(e){e&&this.initSwiper()},immediate:!0}},mounted(){},methods:{initSwiper(){this.hasConfig&&this.isSwiper&&this.$nextTick(()=>{this.swiper&&(this.swiper.destroy(!0,!0),this.swiper=null);let{attributeJson:e}=this;this.options={effect:"slide",autoplay:!1,slidesPerView:this.attributeJson.oneLineCount,spaceBetween:e.itemSpacing},this.hasSwiperButton&&(this.options.navigation={nextEl:".swiper-button-next-"+this.sortId,prevEl:".swiper-button-prev-"+this.sortId}),this.hasScrollBar&&(this.options.scrollbar={el:".swiper-scrollbar-"+this.sortId,draggable:!0},this.options.freeMode=!0),this.swiper=new B.a(".swiper-container-"+this.sortId,this.options),console.log("[32m%s[0m","初始化轮播图",this.swiper)})}}},X=W,Y=X,K=(i("dc72"),O(Y,N,R,!1,null,"5e573198",null)),J=K.exports,Q=J,Z=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"video-wrap entrance-con",style:[e.conStyle,e.animationInStyle]},[0!==e.videoItem.length?i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData,envUrl:e.envUrl},expression:"{data: tipReportData, envUrl}"}],class:["video-con","video-con-"+e.sortId,e.animationInObj.type?e.enterClass:""],style:{width:Math.round(e.attributeJson.baseStyle.w*e.ratio)+"px",height:Math.round(e.attributeJson.baseStyle.h*e.ratio)+"px"}},[i("myVideoPlayer",{attrs:{sort:(new Date).getTime(),videoInfo:e.videoInfo,autoPlay:e.autoPlay,recordId:e.recordId,sortId:e.sortId}}),1===e.attributeJson.isVideoHasHot&&0!=e.videoHotPic.length?i("div",{staticClass:"hot-image"},[i("img",{attrs:{src:e.videoHotPic[0].resourcePath,alt:""}}),i("hotspot",e._g(e._b({ref:"hotspot",attrs:{componentType:3,item:e.hotData,ratio:e.ratio,envUrl:e.envUrl,language:e.language,recordId:e.recordId,sortId:e.sortId,path:e.path,brand:e.brand,uniqueName:e.attributeJson.uniqueName}},"hotspot",e.$attrs,!1),e.$listeners))],1):e._e()],1):e._e()])},ee=[],te=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticStyle:{height:"100%",position:"relative"}},[i("video",{ref:"myVideo-"+e.sort,staticClass:"video-js vjs-default-skin vjs-big-play-centered vjs-16-9 video-item",attrs:{preload:"auto","data-setup":"{}","x5-playsinline":"","x5-video-orientation":"landscape|portrait","x5-video-player-type":"h5","webkit-playsinline":"true",playsinline:"true",controls:e.videoInfo.checkedAttr.indexOf("controls")>-1,autoplay:e.autoPlay,loop:e.videoInfo.checkedAttr.indexOf("loop")>-1,muted:"",poster:0!=e.videoInfo.list.length?e.videoInfo.list[0].imgUrl:""},domProps:{muted:!0}},[i("source",{attrs:{src:0!=e.videoInfo.list.length?e.videoInfo.list[0].resourcePath:""}})]),e.videoInfo.checkedAttr.indexOf("controls")<0?i("div",{staticClass:"video-cover",attrs:{id:[e.recordId+"_"+e.sortId,"video-cover"],"data-sensors-click":"","data-sensorsClick":"true",name:[e.recordId+"_"+e.sortId,"video-cover"]},on:{click:e.clickVideo}}):e._e()])},ie=[],re=i("f0e2"),se={name:"videoPlayer",props:{videoInfo:{type:Object,default:()=>{}},autoPlay:{type:Boolean,default:!1},sort:{type:Number,default:0},recordId:{type:Number,default:0},sortId:{type:Number,default:0}},data(){return{isPlay:!1}},watch:{autoPlay:{handler(e){this.player&&(e?this.player.play():this.player.pause())},immediate:!0}},mounted(){let e=this;setTimeout(()=>{this.player=Object(re["a"])(this.$refs["myVideo-"+this.sort],{},(function(){this.on("play",()=>{e.isPlay=!0}),this.on("pause",()=>{e.isPlay=!1})})),this.$nextTick(()=>{this.play()})},50)},methods:{play(){0!=this.videoInfo.list.length&&this.autoPlay&&this.player.play()},clickVideo(){this.isPlay?this.player.pause():this.player.play()}}},ne=se,ae=ne,oe=(i("eab8"),O(ae,te,ie,!1,null,"ebbd756a",null)),le=oe.exports,de=le,ue={name:"videoItem",mixins:[k],components:{hotspot:G,myVideoPlayer:de},props:{attributeJson:{type:Object,default:function(){}},ratio:{type:Number,default:1,positionList:[]}},data(){return{autoPlay:!1}},watch:{"videoInfo.checkedAttr":{handler(e){this.autoPlay=e.indexOf("autoPlay")>-1},immediate:!0,deep:!0}},computed:{videoItem(){return this.attributeJson.videoInfo.list},videoHotPic(){return this.attributeJson.videoHotInfo.picList},videoHotPop(){return this.attributeJson.videoHotInfo.popList},videoInfo(){return this.attributeJson.videoInfo},hotData(){let{attributeJson:e}=this;return{popList:e.videoHotInfo.popList,width:e.videoHotInfo.picList[0].width,height:e.videoHotInfo.picList[0].height,realWidth:e.baseStyle.w,realHeight:e.baseStyle.h,top:0,left:0}},tipReportData(){return 1==this.attributeJson.isVideoHasHot?void 0:{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:3,popData:{},refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,event:"bannerShow",position:1}}},methods:{}},ce=ue,he=ce,pe=(i("1abf"),O(he,Z,ee,!1,null,"27d3e021",null)),fe=pe.exports,me=fe,ge=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"swiper-wrap",style:[e.conStyle,e.animationInStyle]},[e.hasSwiperItem||1===e.bgStyle.status&&0!=e.bgStyle.picList.length?i("div",{directives:[{name:"hoverAnimate",rawName:"v-hoverAnimate"}],class:["swiper-con","swiper-con-"+e.mode],style:{backgroundImage:0!=e.bgStyle.picList.length?"url("+e.bgStyle.picList[0].resourcePath+")":""}},[i("div",{staticClass:"entrance-con",style:{"--hoverColor":e.paginationStyle.hoverColor||e.paginationStyle.color,"--activeColor":e.paginationStyle.activeColor,"--color":e.paginationStyle.color,width:e.baseStyle.w*e.ratio+"px",height:e.baseStyle.h*e.ratio+"px"}},[i("div",{key:e.indicatorType,ref:"swiper"+e.attributeJson.sort,class:["swiper-container swiper-container-"+e.sortId+" swiper-container-"+e.indicatorType,e.animationInObj.type?e.enterClass:""],style:{animationDuration:e.animationInObj.duration+"s"},attrs:{id:"mySwiper-"+e.sortId}},[i("div",{staticClass:"swiper-wrapper"},e._l(e.swiperList,(function(t,r){return i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData(r),envUrl:e.envUrl},expression:"{data:tipReportData(index), envUrl}"}],key:t.sort+r,class:["swiper-slide",{"slide-auto":e.isSpaceSwiper}]},[i("div",{staticClass:"swiper-width",style:{width:(e.baseStyle.w-(2==e.styleType?100:0))*e.ratio+"px!important",height:e.baseStyle.h*e.ratio+"px"}},[1===t.type?i("img",{attrs:{src:t.picList[0].resourcePath,alt:t.picList[0].resourceName.split(".")[0]}}):e._e(),2===t.type?i("div",{staticClass:"video-player-con"},[i("myVideoPlayer",{attrs:{recordId:e.recordId,sortId:e.sortId,sort:(new Date).getTime(),videoInfo:t.videoInfo,autoPlay:t.videoInfo.checkedAttr.indexOf("autoPlay")>-1&&e.activeIndex==r}}),2==t.type&&1==t.isVideoHasHot&&0!=t.videoHotInfo.picList.length?i("div",{staticClass:"video-hot-image"},[i("img",{attrs:{src:t.videoHotInfo.picList[0].resourcePath,alt:t.videoHotInfo.picList[0].resourceName.split(".")[0]}}),0!=t.videoHotInfo.picList.length?i("div",{staticClass:"swiper-hot"},[i("hotspot",e._g(e._b({ref:"hotspot"+e.sortId+r,refInFor:!0,attrs:{item:{realWidth:t.realWidth,realHeight:t.realHeight,popList:t.videoHotInfo.popList,width:t.videoHotInfo.picList[0].width,height:t.videoHotInfo.picList[0].height},componentType:1,ratio:e.ratio,uniqueName:e.attributeJson.uniqueName,envUrl:e.envUrl,sortId:e.sortId,laySort:e.sort,path:e.path,brand:e.brand,prePosition:e.positionTotal[t.i],recordId:e.recordId}},"hotspot",e.$attrs,!1),e.$listeners))],1):e._e()]):e._e()],1):e._e(),1==t.type&&0!=t.picList.length?[i("hotspot",e._g(e._b({ref:"hotspot"+e.sortId+r,refInFor:!0,attrs:{item:t,ratio:e.ratio,componentType:1,uniqueName:e.attributeJson.uniqueName,path:e.path,envUrl:e.envUrl,sortId:e.sortId,brand:e.brand,prePosition:e.positionTotal[t.i],recordId:e.recordId}},"hotspot",e.$attrs,!1),e.$listeners))]:e._e()],2)])})),0),e.hasScrollBar?i("div",{staticClass:"swiper-scrollbar-own"},[i("div",{staticClass:"swiper-scrollbar-drag",style:{width:100/e.list.length+"%",left:(e.activeIndex>e.list.length?0:100/e.list.length*(e.activeIndex-1))+"%"}})]):e._e(),e.hasSwiperPagination?i("div",{staticClass:"swiper-pagination-custom"},e._l(e.list,(function(t,r){return i("span",{key:r,class:["pagination-custom-bullt",{"bullt-active":e.slideIndex==r}],attrs:{id:[e.recordId+"_"+e.sortId+"_"+Number(r+1),"pagination-custom-bullt"],name:[e.recordId+"_"+e.sortId+"_"+Number(r+1),"pagination-custom-bullt"],"data-sensors-click":"","data-sensorsClick":"true"},on:{click:function(t){return e.swiperSlide(r)}}})})),0):e._e(),e.hasSwiperButton?[i("div",{class:["swiper-button-prev","swiper-button-prev-"+e.sortId]},[e._t("swiper-button-prev",(function(){return[2==e.indicatorType||3==e.indicatorType?i("div",[i("span",{staticClass:"cms2iconfont iconleft",style:e.pageStyle})]):e._e(),4==e.indicatorType?i("div",{staticClass:"arrow"},[i("span",{staticClass:"cms2iconfont iconarrow-left",style:e.pageStyle})]):e._e()]}))],2),i("div",{class:["swiper-button-next","swiper-button-next-"+e.sortId]},[e._t("swiper-button-next",(function(){return[2==e.indicatorType||3==e.indicatorType?i("div",[i("span",{staticClass:"cms2iconfont iconright",style:e.pageStyle})]):e._e(),4==e.indicatorType?i("div",{staticClass:"arrow"},[i("span",{staticClass:"cms2iconfont iconarrow-right",style:e.pageStyle})]):e._e()]}))],2)]:e._e()],2)]),2===e.animationHoverObj.type?i("div",{staticClass:"hover-con",style:[e.hoverStyle,{opacity:e.hoverStyleShow?1:0}]}):e._e()]):e._e()])},ye=[];let ve=16.7;var be={name:"swiperItem",mixins:[k],components:{hotspot:G,myVideoPlayer:de},props:{sortId:{type:Number}},data(){return{hasSwiperItem:!1,swiper:"",activeIndex:0,slideIndex:0,hasInitSwiper:!1,positionList:[],positionTotal:[]}},computed:{bgStyle(){return this.attributeJson.bgStyle},list(){return this.attributeJson.list},styleType(){return this.attributeJson.styleType},indicatorType(){return this.attributeJson.indicatorType},paginationStyle(){return this.attributeJson.paginationStyle},pageStyle(){return{color:this.attributeJson.paginationStyle.color}},hasSwiperPagination(){return 3==this.indicatorType},hasSwiperButton(){return 1!=this.indicatorType},hasScrollBar(){return"pc"==this.mode&&2==this.indicatorType},isSpaceSwiper(){return"mobile"==this.mode&&2==this.styleType},tipReportData(){let e=[],t=[];return this.list.forEach(t=>{1==t.type&&0!=t.popList.length||0!=t.videoHotInfo.popList.length?e.push(1==t.type?t.popList.length:t.videoHotInfo.popList.length):e.push(1)}),e.forEach((i,r)=>{let s=e.slice(0,r),n=s.reduce((e,t)=>e+t,0);t.push(n)}),this.positionList=e,this.positionTotal=t,function(e){let t=this.swiperList[e];return{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:1,popData:{},materialId:this.recordId+"_"+this.sortId+"_"+t.sort,materialName:t.uniqueName,refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,position:this.positionTotal[e]+1,event:"bannerShow"}}}},mounted(){this.$nextTick(()=>{this.judgeSwiper()})},methods:{judgeSwiper(){let e=this.attributeJson.list,t=e.findIndex(e=>0!=e.picList.length||0!=e.videoInfo.list.length);if(this.hasSwiperItem=t>-1,this.hasSwiperItem){e.forEach((e,t)=>{e.i=t});let t=JSON.parse(JSON.stringify(e));this.swiperList=e.concat(JSON.parse(JSON.stringify(t))),this.swiperList=t.concat(this.swiperList),this.initSwiper(!0)}},initSwiper:function(e){(this.hasSwiperItem||1===this.bgStyle.status&&0!=this.bgStyle.picList.length)&&this.$nextTick(()=>{this.swiper&&(this.swiper.destroy(!0,!0),this.swiper=null);let{attributeJson:e}=this;this.options={effect:"slide",observer:!0,observeParents:!0,preventInteractionOnTransition:!0,autoplay:!!e.autoPlay&&{delay:1e3*e.interval,disableOnInteraction:!1,stopOnLastSlide:!1}},"mobile"==this.mode&&2==this.styleType&&(this.options.spaceBetween=10,this.options.loop=!1,this.options.slidesPerView="auto",this.options.centeredSlides=!0),this.hasSwiperButton&&(this.options.navigation={nextEl:".swiper-button-next-"+this.sortId,prevEl:".swiper-button-prev-"+this.sortId});let t=this,i=this.list.length;this.options.on={slideChangeTransitionEnd:function(){t.activeIndex=this.activeIndex,t.slideIndex=t.swiperList[this.activeIndex].i},slideNextTransitionEnd:function(){this.activeIndex==2*i&&this.slideTo(i,ve)},slidePrevTransitionEnd:function(){this.activeIndex==i-1&&this.slideTo(2*i-1,ve)}},this.swiper=new B.a(".swiper-container-"+this.sortId,this.options),this.swiper instanceof Array?this.swiper.forEach(e=>{e.slideTo(i,ve)}):this.swiper.slideTo(i,ve)})},swiperSlide(e){this.swiper.slideTo(e),this.slideIndex=e}}},_e=be,Te=_e,Se=(i("6e0e"),O(Te,ge,ye,!1,null,"5b4a67cf",null)),we=Se.exports,Ee=we,Ce=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"button-wrap",style:[e.conStyle,e.animationInStyle]},[i("div",{ref:"button"+e.attributeJson.sort,class:["button-cl","button-cl-"+e.sortId],attrs:{id:[e.recordId+"_"+e.sortId,"button-cl"],name:[e.recordId+"_"+e.sortId,"button-cl"],"data-sensors-click":"","data-sensorsClick":"true"},on:{click:e.pageClick}},[i("div",{directives:[{name:"hoverAnimate",rawName:"v-hoverAnimate"},{name:"treport",rawName:"v-treport",value:{data:e.tipReportData,envUrl:e.envUrl},expression:"{data:tipReportData, envUrl}"}],staticClass:"button-content",class:[{flexCenterBetween:e.iconImage},4===e.animationHoverObj.type?e.hoverDirection:""],style:[e.buttonStyle,{"--width":e.hoverStyleShow?"100%":"0","--height":e.hoverStyleShow?"100%":"0","--bgColor":e.animationHoverObj.bgStyle.backgroundColor}]},[e.iconStyle&&1===e.iconStyle.type&&1===e.iconStyle.position&&e.iconImage?i("img",{attrs:{src:e.iconImage,alt:""}}):e._e(),i("div",{staticClass:"label",style:e.buttonTextStyle},[e._v(e._s(e.attributeJson.label||"按钮"))]),e.iconStyle&&1===e.iconStyle.type&&2===e.iconStyle.position&&e.iconImage?i("img",{attrs:{src:e.iconImage,alt:""}}):e._e(),5===e.animationHoverObj.type&&e.hoverImage&&e.hoverStyleShow?i("img",{staticClass:"hover-image",attrs:{src:e.hoverImage,alt:""}}):e._e()]),2===e.animationHoverObj.type?i("div",{staticClass:"hover-con",style:[e.hoverStyle,{opacity:e.hoverStyleShow?1:0,borderRadius:e.attributeJson.borderStyle.borderRadius+"px"}]}):e._e()])])},xe=[],ke={name:"buttonItem",mixins:[k],components:{},props:{},data(){return{iconImage:"",backgroundImage:"",hoverButtonStyle:{}}},watch:{bgStyle:{handler(e){0!=e.picList.length&&(this.backgroundImage=2===e.type?e.picList[0].resourcePath:"")},immediate:!0,deep:!0},iconStyle:{handler(e){e&&0!=e.picList.length&&(this.iconImage=1===e.type?e.picList[0].resourcePath:"")},immediate:!0,deep:!0}},computed:{iconStyle(){return this.attributeJson.iconStyle},bgStyle(){return this.attributeJson.bgStyle},buttonStyle(){let{bgStyle:e,fontStyle:t,borderStyle:i,space:r}=this.attributeJson,{borderTop:s,borderRight:n,borderBottom:a,borderLeft:o,borderColor:l}=i,d="mobile"==this.mode?2*this.ratio:this.ratio,u={fontSize:parseFloat(t.fontSize)*d+"px",color:t.color,backgroundColor:1===e.type?e.backgroundColor:"",fontWeight:t.fontWeight?"bold":"",textDecoration:t.textDecoration?"underline":"",fontStyle:t.fontItalic?"italic":"",borderRadius:i.borderRadius+"px",backgroundImage:`url('${this.backgroundImage}')`,paddingLeft:r.left+"px",paddingRight:r.right+"px"};return 1===i.type&&l&&(u.border="1px solid "+l),2===i.type&&(u.borderTop=s?"1px solid "+s:"none",u.borderRight=n?"1px solid "+n:"none",u.borderBottom=a?"1px solid "+a:"none",u.borderLeft=o?"1px solid "+o:"none"),u},buttonTextStyle(){return{color:this.attributeJson.fontStyle.color,"--hoverColor":this.attributeJson.fontStyle.hoverObj.color||this.attributeJson.fontStyle.color}},tipReportData(){return{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:17,popData:{},refererPagePath:this.refererPagePath,path:this.path,brand:this.brand,position:1,event:"bannerShow"}}},methods:{pageClick(){if(this.attributeJson.linkObj.jumpLinkType)try{let e=JSON.parse(JSON.stringify(this.tipReportData));e.event="bannerClick";let t=C(e,this.envUrl,"click"),i=new Blob([JSON.stringify(t)],{type:"application/json"});navigator.sendBeacon(this.envUrl+"service-zuul/data/collect/acquisition",i)}catch(e){}this.$emit("jumpLink",this.attributeJson.linkObj)}}},Ie=ke,Ae=Ie,Pe=(i("866e"),O(Ae,Ce,xe,!1,null,"136e477e",null)),Oe=Pe.exports,Le=Oe,De=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"product-wrap entrance-con",style:[e.conStyle,e.paginationShow,e.animationInStyle]},[i("div",{class:["product-con",e.animationInObj.type?e.enterClass:""],style:[{width:e.baseStyle.w*e.ratio+"px",height:e.baseStyle.h*e.ratio+"px",padding:"0 "+e.attributeJson.goodsPaddingSpacing+"px",animationDuration:e.animationInObj.duration+"s"}]},[e.isSwiper?e._e():i("div",{ref:"slide"+e.sortId,class:"slide-con slide-con-"+e.styleType+"-"+e.mode,style:{width:e.attributeJson.baseStyle.w*e.ratio+e.attributeJson.goodsSpacing+"px",margin:"0px -"+e.attributeJson.goodsSpacing/2+"px"}},e._l(e.productList,(function(t,r){return i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData(r),envUrl:e.envUrl},expression:"{data:tipReportData(index), envUrl}"},{name:"hoverAnimate",rawName:"v-hoverAnimate",value:{key:"productIndex",value:r},expression:"{ key: 'productIndex', value: index }"}],key:t.id,ref:"product"+t.code+r,refInFor:!0,class:["product-item","product"+t.code+r],style:[e.productStyle],attrs:{id:[e.recordId+"_"+e.sortId+"_"+t.code,"product-item"],name:[e.recordId+"_"+e.sortId+"_"+t.code,"product-item"],"data-sensors-click":"","data-sensorsClick":"true"},on:{click:function(i){return e.gotoPDP(t.code,t.colorCode,t.name,r)}}},[i("div",{staticClass:"product-image"},[i("img",{style:[3===e.animationHoverObj.type&&e.productIndex==r?e.hoverStyle:""],attrs:{src:2==e.attributeJson.goodsImgType&&t.customImage?t.customImage:t.mainPicUrl,alt:t.name}})]),0!=e.attributeJson.showInfo.length?i("div",{class:["product-info","position"+e.attributeJson.infoPoisition,{transparent:2==e.attributeJson.isHover&&e.productIndex!=r}]},[e._t("productInfo",(function(){return[e.attributeJson.showInfo.indexOf(1)>-1?i("div",{staticClass:"product-name"},[e._v(e._s(t.name))]):e._e(),i("div",{staticClass:"price-con"},[e.attributeJson.showInfo.indexOf(2)>-1?i("div",[e._v("¥"+e._s(t.salesPrice||0))]):e._e(),t.salesPrice!=t.standardPrice&&e.attributeJson.showInfo.indexOf(3)>-1?i("div",{staticClass:"standardPrice"},[e._v(" ¥"+e._s(t.standardPrice||0)+" ")]):e._e()])]}))],2):e._e(),2===e.animationHoverObj.type?i("div",{staticClass:"hover-con",style:[e.hoverStyle,{opacity:e.productIndex===r?1:0,margin:"0 "+e.goodsSpacing/2+"px"}]}):e._e()])})),0),e.isSwiper?i("div",{key:e.styleType+e.indicatorType,ref:"slide"+e.sortId,class:"swiper-container swiper-container-"+e.sortId,attrs:{id:"mySwiper-"+e.sortId}},[i("div",{staticClass:"swiper-wrapper",style:[{width:e.baseStyle.w*e.ratio+"px"}]},e._l(e.productList,(function(t,r){return i("div",{directives:[{name:"hoverAnimate",rawName:"v-hoverAnimate",value:{key:"productIndex",value:r},expression:"{ key: 'productIndex', value: index }"},{name:"treport",rawName:"v-treport",value:{data:e.tipReportData(r),envUrl:e.envUrl},expression:"{data:tipReportData(index), envUrl}"}],key:t.id,class:"swiper-slide swiper-slide-"+e.styleType+"-"+e.mode,style:[e.productStyle]},[i("div",{ref:"product"+t.code+r,refInFor:!0,style:{height:e.attributeJson.baseStyle.h*e.ratio+"px"},attrs:{id:[e.recordId+"_"+e.sortId+"_"+t.code,"product-item"],"data-sensors-click":"","data-sensorsClick":"true",name:[e.recordId+"_"+e.sortId+"_"+t.code,"product-item"]},on:{click:function(i){return e.gotoPDP(t.code,t.colorCode,t.name,r)}}},[i("div",{staticClass:"product-image"},[i("img",{style:[3===e.animationHoverObj.type&&e.productIndex==r?e.hoverStyle:""],attrs:{src:2==e.attributeJson.goodsImgType&&t.customImage?t.customImage:t.mainPicUrl,alt:""}})]),0!=e.attributeJson.showInfo.length?i("div",{class:["product-info","position"+e.attributeJson.infoPoisition,{transparent:2==e.attributeJson.isHover&&e.productIndex!=r}]},[e._t("productInfo",(function(){return[e.attributeJson.showInfo.indexOf(1)>-1?i("div",{staticClass:"product-name"},[e._v(" "+e._s(t.name)+" ")]):e._e(),i("div",{staticClass:"price-con"},[e.attributeJson.showInfo.indexOf(2)>-1?i("div",[e._v("¥"+e._s(t.salesPrice||0))]):e._e(),t.salesPrice!=t.standardPrice&&e.attributeJson.showInfo.indexOf(3)>-1?i("div",{staticClass:"standardPrice"},[e._v(" ¥"+e._s(t.standardPrice||0)+" ")]):e._e()])]}))],2):e._e(),2===e.animationHoverObj.type?i("div",{staticClass:"hover-con",style:[e.hoverStyle,{opacity:e.productIndex===r?1:0}]}):e._e()])])})),0),e.hasScrollBar?i("div",{class:"swiper-scrollbar swiper-scrollbar-"+e.sortId}):e._e(),e.hasSwiperButton?i("div",{class:"swiper-button-prev swiper-button-prev-"+e.sortId},[e._t("swiper-button-prev",(function(){return[2==e.indicatorType?i("div",[i("span",{staticClass:"cms2iconfont iconleft",style:e.pageStyle})]):e._e()]}))],2):e._e(),e.hasSwiperButton?i("div",{class:"swiper-button-next swiper-button-next-"+e.sortId},[e._t("swiper-button-next",(function(){return[2==e.indicatorType?i("div",[i("span",{staticClass:"cms2iconfont iconright",style:e.pageStyle})]):e._e()]}))],2):e._e()]):e._e()])])},Me=[],Ne={name:"productItem",mixins:[k],components:{},props:{sortId:{type:Number}},data(){return{productList:[],swiper:"",productStyle:{},service:new y,productIndex:"",windowHeight:0}},watch:{addProduct:{handler(e){this.isClient&&(1==e.type&&0==e.itemCodeList.length||(2!=e.type||e.categoryGroupCode)&&(3!=e.type||e.cmsSortCode)&&this.getProductList())},immediate:!0,deep:!0},ratio:{handler(){!this.isSwiper&&this.productStyle.width&&(this.productStyle.width=(this.attributeJson.baseStyle.w*this.ratio-2*this.attributeJson.goodsPaddingSpacing+this.goodsSpacing)/this.showNum+"px")}}},computed:{addProduct(){return this.attributeJson.addProduct},goodsPaddingSpacing(){return this.attributeJson.goodsPaddingSpacing},goodsSpacing(){return this.attributeJson.goodsSpacing},itemsPerLine(){return this.attributeJson.itemsPerLine},indicatorType(){return this.attributeJson.indicatorType},isSwiper(){return"pc"==this.mode&&1==this.styleType||"mobile"==this.mode&&2==this.styleType&&(2==this.indicatorType||3==this.indicatorType)},hasSwiperButton(){return"pc"==this.mode&&1==this.styleType&&2==this.indicatorType||"mobile"==this.mode&&2==this.styleType&&2==this.indicatorType},hasScrollBar(){return"mobile"==this.mode&&2==this.styleType&&3==this.indicatorType},paginationShow(){let{paginationStyle:e}=this.attributeJson;return{"--hoverColor":e.hoverColor||e.color,"--activeColor":e.activeColor,"--color":e.color}},pageStyle(){return{color:this.attributeJson.paginationStyle.color}},showNum(){let e=1;return"pc"==this.mode?e=this.attributeJson.itemsPerLine:1==this.attributeJson.styleType?e=2.5:2==this.attributeJson.styleType&&(e=this.attributeJson.itemsPerLine),e},tipReportData(){return function(e){let t=this.productList[e];return{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:4,popData:{productCode:t.code,selectDataShow:t.name},materialId:this.recordId+"_"+this.sortId,materialName:this.attributeJson.uniqueName,refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,position:e+1,event:"bannerShow"}}}},mounted(){this.productList=this.attributeJson.productList,this.initProduct()},methods:{getProductList:function(){let e={};switch(this.addProduct.type){case 1:e={itemCodeList:this.addProduct.itemCodeList,pageNum:1,pageSize:this.addProduct.itemCodeList.length};break;case 2:e={categoryParam:{categoryCodeList:this.addProduct.categoryCodeList,categoryGroupCode:this.addProduct.categoryGroupCode},pageNum:1,pageSize:this.addProduct.max,sortRuleId:this.addProduct.sortId};break;case 3:e={pageNum:1,pageSize:this.addProduct.max,sortField:this.addProduct.cmsSortCode};break}3==this.addProduct.type?this.service.getSortProductInfo(this.envUrl,e,this.language).then(e=>{if(e&&e.list){let t=document.querySelector(".entrance-con"+this.sortId),i=t&&t.classList.contains("entrance-demonstrate");i&&t.firstChild.style&&(t.firstChild.style.display="block"),this.productList=e.list,this.initProduct()}else this.productList=[]}):this.service.getProductInfo(this.envUrl,e,this.language).then(e=>{if(e&&e.list){let t=document.querySelector(".entrance-con"+this.sortId),i=t&&t.classList.contains("entrance-demonstrate");i&&t.firstChild.style&&(t.firstChild.style.display="block"),this.productList=e.list,this.initProduct()}else this.productList=[]})},initProduct:function(){let{attributeJson:e,addProduct:t}=this;2==e.goodsImgType&&0!=t.customImageList.length&&this.productList.forEach((e,i)=>{0!=t.customImageList[i].picList.length&&this.$set(e,"customImage",t.customImageList[i].picList[0].resourcePath)}),this.productList&&this.productList.length>0&&(this.isSwiper?this.initSwiper():this.initSlide())},initSwiper:function(){let{attributeJson:e,indicatorType:t,styleType:i}=this;this.$nextTick(()=>{this.swiper&&(this.swiper.destroy(!0,!0),this.swiper=null),this.options={effect:"slide",autoplay:!1,slidesPerView:this.showNum,spaceBetween:e.goodsSpacing},2==i&&2==t&&(this.options.pagination={el:".swiper-pagination-"+this.sortId,clickable:!0}),this.hasSwiperButton&&(this.options.navigation={nextEl:".swiper-button-next-"+this.sortId,prevEl:".swiper-button-prev-"+this.sortId}),this.hasScrollBar&&(this.options.scrollbar={el:".swiper-scrollbar-"+this.sortId,draggable:!0},this.options.freeMode=!0),this.swiper=new B.a(".swiper-container-"+this.sortId,this.options)})},initSlide(){this.productStyle={padding:`0 ${this.goodsSpacing/2}px`,width:(this.attributeJson.baseStyle.w*this.ratio-2*this.attributeJson.goodsPaddingSpacing+this.goodsSpacing)/this.showNum+"px",marginBottom:this.goodsSpacing+"px"}},gotoPDP(e,t,i,r){try{let e=JSON.parse(JSON.stringify(this.tipReportData(r)));e.event="bannerClick";let t=C(e,this.envUrl,"click"),i=new Blob([JSON.stringify(t)],{type:"application/json"});navigator.sendBeacon(this.envUrl+"service-zuul/data/collect/acquisition",i)}catch(s){}this.$emit("gotoPDP",{code:e,colorCode:t})}}},Re=Ne,Ue=Re,Be=(i("8ee5"),O(Ue,De,Me,!1,null,"5f1e1175",null)),je=Be.exports,Fe=je,qe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"simplyText-wrap entrance-con",style:[e.conStyle,e.animationInStyle],on:{click:e.pageClick}},[i("div",{directives:[{name:"hoverAnimate",rawName:"v-hoverAnimate"},{name:"cursor",rawName:"v-cursor"}],staticClass:"text-con"},[i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData,envUrl:e.envUrl},expression:"{data:tipReportData, envUrl}"}],staticClass:"text-show",style:[e.textStyle,e.hoverStyleShow?e.hoverStyle:""]},[e._v(e._s(e.attributeJson.label))])])])},$e=[],He={name:"simplyText",inheritAttrs:!1,mixins:[k],computed:{textStyle(){let{fontStyle:{fontSize:e,color:t,fontWeight:i,textDecoration:r,lineHeight:s,fontItalic:n,letterSpacing:a,fontBackColor:o,fontFamily:l},textAlign:d}=this.attributeJson,u="mobile"==this.mode?2*this.ratio:this.ratio,c={fontSize:parseFloat(e)*u+"px",color:t,fontWeight:i?"bold":"",textDecoration:r?"underline":"",fontStyle:n?"italic":"",lineHeight:s,letterSpacing:(a||0)+"px",backgroundColor:o||"",fontFamily:l,textAlign:d};return c},tipReportData(){return{uniqueId:this.recordId+"_"+this.sortId,uniqueName:this.attributeJson.uniqueName,componentType:24,popData:{},refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,position:1,event:"bannerShow"}}},methods:{pageClick(){if(this.attributeJson.linkObj.jumpLinkType)try{let e=JSON.parse(JSON.stringify(this.tipReportData));e.event="bannerClick";let t=C(e,this.envUrl,"click"),i=new Blob([JSON.stringify(t)],{type:"application/json"});navigator.sendBeacon(this.envUrl+"service-zuul/data/collect/acquisition",i)}catch(e){console.log(e)}this.$emit("jumpLink",this.attributeJson.linkObj)}}},ze=He,Ve=ze,Ge=(i("2e43"),O(Ve,qe,$e,!1,null,"1d184ad9",null)),We=Ge.exports,Xe=We,Ye={name:"singleLayout",inheritAttrs:!1,components:{textItem:M,imgNav:Q,videoItem:me,swiperItem:Ee,buttonItem:Le,productItem:Fe,simplyText:Xe},props:{layOutData:{type:Object,default:()=>{}},ratio:{type:Number,default:1},canDragInc:{type:Boolean,default:!0}},data(){return{vLine:[],hLine:[],componentName:""}},computed:{layoutStyle:function(){return this.layOutData.layoutStyle?{backgroundImage:2===this.layOutData.layoutStyle.bgStyle.type&&0!=this.layOutData.layoutStyle.bgStyle.picList.length&&`url(${this.layOutData.layoutStyle.bgStyle.picList[0].resourcePath})`,backgroundColor:1===this.layOutData.layoutStyle.bgStyle.type&&this.layOutData.layoutStyle.bgStyle.backgroundColor}:{}}},methods:{getCustom(){let e=this.layOutData.componentList.filter(e=>e.type>100);return e}}},Ke=Ye,Je=Ke,Qe=(i("6013"),O(Je,o,l,!1,null,"916fe080",null)),Ze=Qe.exports,et=Ze,tt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{key:e.layOutData.layoutStyle.height,staticClass:"multiple-layout",style:{height:Math.round(e.layOutData.layoutStyle.height*e.ratio)+"px"}},[e._l(e.layOutData.list,(function(t,r){return[i("div",{key:r,staticClass:"multiple-item",style:{width:Math.round(t.baseStyle.w*e.ratio)+"px",height:Math.round(e.layOutData.layoutStyle.height*e.ratio)+"px",zIndex:e.currentIndex==r?1:"auto"}},[i("singleLayout",e._g(e._b({ref:"multipleSingle",refInFor:!0,attrs:{layOutData:t,componentList:t.componentList,"parent-l":t.baseStyle.l,ratio:e.ratio,recordId:e.recordId,mode:e.mode}},"singleLayout",e.$attrs,!1),e.$listeners))],1)]}))],2)},it=[],rt={name:"multipleLayout",components:{singleLayout:et},props:{layOutData:{type:Object,default:()=>{}},ratio:{type:Number,default:1},mode:{type:String,default:"pc"},recordId:{type:Number,default:0}},inheritAttrs:!1,data(){return{w:200,currentItem:null,currentIndex:""}},watch:{},mounted(){},methods:{}},st=rt,nt=st,at=(i("8b28"),O(nt,tt,it,!1,null,"62f273ef",null)),ot=at.exports,lt=ot,dt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"treport",rawName:"v-treport",value:{data:e.tipReportData,envUrl:e.envUrl,isClient:e.isClient},expression:"{data:tipReportData, envUrl, isClient}"}],ref:"custom"+e.layOutData.sort,staticClass:"custom-layout"},[i("div",{staticClass:"add-con"}),e._t("customComponent",null,{attributeJson:e.layOutData})],2)},ut=[],ct={name:"customLayout",props:{layOutData:{type:Object,default:()=>{}},envUrl:{type:String,default:""},path:{type:String},isClient:{type:Boolean,default:!0}},inheritAttrs:!1,computed:{tipReportData(){return{uniqueId:this.layOutData.sort,uniqueName:this.uniqueName,componentType:7,popData:{},refererPagePath:this.refererPagePath,brand:this.brand,path:this.path,position:1}}},methods:{},directives:{treport:E}},ht=ct,pt=ht,ft=(i("3de5"),O(pt,dt,ut,!1,null,"2e732634",null)),mt=ft.exports,gt=mt,yt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"tab-layout"},[e.hasTab?i("div",{staticClass:"tab-detail tab-con"},[i("div",[2==e.tabHeadInfo.showTitle?i("div",{ref:"tabHeadTitleDom",style:e.titleStyle},[i("span",[e._v(e._s(1==e.tabHeadInfo.customTitle?e.tabHeadInfo.title:e.list[e.tabIndex].title))])]):e._e(),i("div",{staticClass:"tab-list"},[i("div",{staticClass:"tab-line"},e._l(e.list,(function(t,r){return i("navItem",{key:r,attrs:{id:[e.recordId+"_"+e.sort+"_"+Number(r+1),"nav-item"],name:[e.recordId+"_"+e.sort+"_"+Number(r+1),"nav-item"],item:t,ratio:e.ratio,mode:e.mode,spacing:e.layOutData.fontStyle.spacing*e.ratio,active:e.tabIndex==r,navStyle:e.navStyle(r),"data-sensors-click":"","data-sensorsClick":"true"},nativeOn:{click:function(i){return e.chooseTab(t,r)}}})})),1)]),i("div",{staticClass:"tab-content",style:{height:e.list[e.tabIndex].height*e.ratio+"px",transform:"translateX("+100*-e.tabIndex+"%)"}},e._l(e.list,(function(t,r){return i("div",{key:r,staticClass:"tab-single"},[i("singleLayout",e._g(e._b({ref:"tabSingle"+r,refInFor:!0,attrs:{layOutData:t,componentList:t.componentList,ratio:e.ratio,recordId:e.recordId,mode:e.mode}},"singleLayout",e.$attrs,!1),e.$listeners))],1)})),0)])]):e._e()])},vt=[],bt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"nav-item",style:[e.navStyle,e.backStyle]},[i("span",{style:{marginLeft:e.spacing+"px"}},[e._v(e._s(e.item.title))])])},_t=[],Tt={name:"navItem",props:{item:{type:Object,default:()=>{}},active:{type:Boolean,default:!1},navStyle:{type:Object,default:()=>{}},spacing:{type:[String,Number],default:0}},data(){return{}},watch:{},computed:{backStyle(){let{item:e,active:t}=this;return{backgroundColor:1==e.navStyle.type?t?e.navStyle.activeColor:e.navStyle.backgroundColor:"",backgroundImage:2==e.navStyle.type?t?`url('${e.navStyle.activeBackImage}')`:`url('${e.navStyle.backImage}')`:""}}},methods:{}},St=Tt,wt=St,Et=(i("ae5c"),O(wt,bt,_t,!1,null,"45583ab2",null)),Ct=Et.exports,xt=Ct,kt={name:"tabLayout",components:{navItem:xt,singleLayout:et},props:{sort:{type:Number,default:0},layOutData:{type:Object,default:()=>{}},ratio:{type:Number,default:1},mode:{type:String,default:"pc"},recordId:{type:Number,default:0}},data(){return{tabIndex:0,activeSort:"",tabHeadTitleH:0}},computed:{hasTab(){return this.layOutData.list.some(e=>e.title)},list(){return this.layOutData.list},tabHeadInfo(){return this.layOutData.tabHeadInfo},navStyle(){let{tabHeadInfo:{width:e,height:t},borderStyle:i,fontStyle:{fontSize:r,color:s,fontWeight:n,textDecoration:a,fontItalic:o,hoverObj:{color:l}}}=this.layOutData,{borderTop:d,borderRight:u,borderBottom:c,borderLeft:h,borderColor:p,hoverObj:f}=i;return function(){return{width:e*this.ratio+"px",height:t*this.ratio+"px",color:s,fontSize:r,fontWeight:n?"bold":"",textDecoration:a?"underline":"",fontStyle:o?"italic":"",borderTop:2===i.type&&d?"1px solid "+d:1===i.type&&p?"1px solid "+p:"none",borderRight:2===i.type&&u?"1px solid "+u:1===i.type&&p?"1px solid "+p:"none",borderBottom:2===i.type&&c?"1px solid "+c:1===i.type&&p?"1px solid "+p:"none",borderLeft:2===i.type&&h?"1px solid "+h:1===i.type&&p?"1px solid "+p:"none","--hoverColor":l,"--hoverBorderTop":2===f.type&&f.borderTop?"1px solid "+f.borderTop:1===f.type&&f.borderColor?"1px solid "+f.borderColor:"none","--hoverBorderRight":2===f.type&&f.borderRight?"1px solid "+f.borderRight:1===f.type&&f.borderColor?"1px solid "+f.borderColor:"none","--hoverBorderBottom":2===f.type&&f.borderBottom?"1px solid "+f.borderBottom:1===f.type&&f.borderColor?"1px solid "+f.borderColor:"none","--hoverBorderLeft":2===f.type&&f.borderLeft?"1px solid "+f.borderLeft:1===f.type&&f.borderColor?"1px solid "+f.borderColor:"none"}}},titleStyle(){let{tabHeadInfo:{titleStyle:{fontSize:e,color:t,fontWeight:i,textDecoration:r,fontItalic:s}}}=this.layOutData;return{color:t,fontSize:e,fontWeight:i?"bold":"",textDecoration:r?"underline":"",fontStyle:s?"italic":"",paddingLeft:("pc"==this.mode?30:60)*this.ratio+"px",paddingBottom:("pc"==this.mode?40:80)*this.ratio+"px"}}},watch:{"layOutData.tabHeadInfo":{handler:function(){this.$nextTick(()=>{this.tabHeadTitleH=2==this.layOutData.tabHeadInfo.showTitle&&this.$refs["tabHeadTitleDom"]?this.$refs["tabHeadTitleDom"].clientHeight:0,this.setLayoutH()})},immediate:!0,deep:!0},"list.length":{handler:function(){let e=this.list.findIndex(e=>e.sort==this.activeSort);e>-1?this.tabIndex=e:(this.tabIndex=this.tabIndex>0?this.tabIndex-1:0,this.activeSort=this.list[this.tabIndex].sort)},deep:!0},hasTab:{handler:function(e){e&&(this.activeSort=this.list[0].sort,this.tabIndex=0)}}},methods:{chooseTab(e,t){this.activeSort=e.sort,this.tabIndex=t,this.setLayoutH(),this.$emit("updateLayOut",{sort:this.layOutData.sort})},setLayoutH:function(){this.$set(this.layOutData.layoutStyle,"height",1*this.layOutData.list[this.tabIndex].height+1*this.layOutData.tabHeadInfo.height+1*this.tabHeadTitleH/this.ratio)}}},It=kt,At=It,Pt=(i("266b"),O(At,yt,vt,!1,null,"6ab7fd00",null)),Ot=Pt.exports,Lt=Ot,Dt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"slide-wrap",style:{"--hoverColor":e.paginationStyle.hoverColor||e.paginationStyle.color,"--activeColor":e.paginationStyle.activeColor,"--color":e.paginationStyle.color}},[i("div",{key:e.indicatorType,class:["swiper-container swiper-container-"+e.recordId+" swiper-container-"+e.indicatorType],attrs:{id:"mySwiper-"+e.recordId}},[i("div",{staticClass:"swiper-wrapper"},e._l(e.slideList,(function(t,r){return i("div",{key:r,class:["swiper-slide",{"slide-auto":1==e.widthStyle.type||e.centeredSlides}],style:[e.backStyle(t.i),{width:1==e.widthStyle.type?t.slideWidth*e.ratio+"px":e.backStyle(t.i).width}]},[i("singleLayout",e._g(e._b({ref:t.isCopy?"":"slideSingle",refInFor:!0,attrs:{layOutData:t,ratio:e.ratio,recordId:e.recordId,mode:e.mode}},"singleLayout",e.$attrs,!1),e.$listeners))],1)})),0),e.hasSwiperButton?i("div",{class:["swiper-button-prev","swiper-button-prev-"+e.recordId]},[e._t("swiper-button-prev",(function(){return[i("div",{staticClass:"arrow"},[i("span",{staticClass:"cms2iconfont iconarrow-left",style:e.pageStyle})])]}))],2):e._e(),e.hasSwiperButton?i("div",{class:["swiper-button-next","swiper-button-next-"+e.recordId]},[e._t("swiper-button-next",(function(){return[i("div",{staticClass:"arrow"},[i("span",{staticClass:"cms2iconfont iconarrow-right",style:e.pageStyle})])]}))],2):e._e()])])},Mt=[],Nt={name:"slideLayout",components:{singleLayout:et},props:{layOutData:{type:Object,default:()=>{}},ratio:{type:Number,default:1},mode:{type:String,default:"pc"},recordId:{type:Number,default:0}},data(){return{swiper:"",slideIndex:0,layWidth:1920,isInit:!1,slideList:[]}},watch:{layoutStyle:{handler(e){this.layWidth=("pc"==this.mode?1920:750)*(e.widthStyle.width/100)},deep:!0,immediate:!0},slideLen:{handler(){this.calculateWidth()},immediate:!0}},computed:{layoutStyle(){return this.layOutData.layoutStyle},paginationStyle(){return this.layOutData.paginationStyle},bgStyle(){return this.layOutData.bgStyle},list(){return this.layOutData.list},styleType(){return this.layOutData.styleType},indicatorType(){return this.layOutData.indicatorType},widthStyle(){return this.layOutData.widthStyle},hasSwiperButton(){return 2==this.indicatorType},pageStyle(){return{color:this.layOutData.paginationStyle.color}},backStyle(){let{bgStyle:e,layoutStyle:t,styleType:i,mode:r}=this;return function(s){let n=this.list[s],a="",o="";1==e.status?1==e.type?a=e.backgroundColor||"":o=0!=e.picList.length?`url(${e.picList[0].resourcePath})`:"":1==n.bgStyle.type?a=n.bgStyle.backgroundColor||"":o=0!=n.bgStyle.picList.length?`url(${n.bgStyle.picList[0].resourcePath})`:"";let l="mobile"==r||"pc"==r&&2==i,d=l?this.layWidth-0*(this.layOutData.lineSlideNum+1)-("mobile"==r?20:556):this.layWidth;return{width:d/this.layOutData.lineSlideNum*this.ratio+"px",height:Math.ceil(t.height*this.ratio)+"px",backgroundColor:a,backgroundImage:o}}},slideLen(){return this.layOutData.list.length},centeredSlides(){return"mobile"==this.mode||"pc"==this.mode&&2==this.styleType}},methods:{calculateWidth:function(){let{list:e}=this;e.forEach((e,t)=>{e.i=t});let t=JSON.parse(JSON.stringify(e));t.forEach(e=>{e.isCopy=!0}),this.slideList=e.concat(JSON.parse(JSON.stringify(t))),this.slideList=t.concat(this.slideList),this.$nextTick(()=>{if(2==this.layOutData.widthStyle.type)return void this.initSwiper();let{layWidth:e}=this;this.slideList.forEach(t=>{let i=t.componentList[0],r=0;if(i){let t=i.attributeJson;if(2==i.type){let i=t.list.some(e=>0!=e.picList.length);r=i?t.baseStyle.w+t.baseStyle.l:e}else if(3==i.type){let i=0!=t.videoInfo.list.length;r=i?t.baseStyle.w+t.baseStyle.l:e}else r=t.baseStyle.w+t.baseStyle.l}else r=e;this.$set(t,"slideWidth",r)}),this.$nextTick(()=>{this.initSwiper()})})},initSwiper(){this.$nextTick(()=>{this.swiper&&(this.swiper.destroy(!0,!0),this.swiper=null);let{layOutData:e,widthStyle:t,ratio:i,slideLen:r}=this;this.options={effect:"slide",observer:!0,observeParents:!0,slidesPerView:this.centeredSlides||1==t.type?"auto":e.lineSlideNum,preventInteractionOnTransition:!0,slidesPerGroup:1,slidesPerGroupAuto:!0,centeredSlides:this.centeredSlides||1==t.type,spaceBetween:this.centeredSlides?0*i:0,autoplay:!!(e.autoPlay&&this.list.length>1)&&{delay:1e3*e.interval,disableOnInteraction:!1,stopOnLastSlide:!1}},1==t.type&&(this.options.loopedSlides=4,this.options.loopAdditionalSlides=2);let s=this;this.options.on={slideNextTransitionEnd:function(){this.activeIndex==2*r&&this.slideTo(r,0),s.slideIndex=this.activeIndex},slidePrevTransitionEnd:function(){this.activeIndex==r-1&&this.slideTo(2*r-1,0)}},this.hasSwiperButton&&(this.options.navigation={nextEl:".swiper-button-next-"+this.recordId,prevEl:".swiper-button-prev-"+this.recordId}),this.swiper=new B.a(".swiper-container-"+this.recordId,this.options),this.swiper.slideTo(r,0)})}}},Rt=Nt,Ut=Rt,Bt=(i("1cfd"),O(Ut,Dt,Mt,!1,null,"407dcfa9",null)),jt=Bt.exports,Ft=jt,qt={name:"cms",inheritAttrs:!1,components:{singleLayout:et,multipleLayout:lt,customLayout:gt,tabLayout:Lt,slideLayout:Ft},props:{cmsList:{type:Array,default:()=>[]},canDrag:{type:Boolean,default:!0},mode:{type:String,default:"pc"},ratio:{type:Number,default:1},envUrl:{type:String,default:""},path:{type:String},isClient:{type:Boolean,default:!0}},data(){return{chooseSort:"",activeIndex:-1,layOutObj:{1:"singleLayout",2:"multipleLayout",3:"customLayout",4:"tabLayout",5:"slideLayout"}}},computed:{},mounted(){},methods:{chooseLayout(e,t){this.chooseSort=t,this.$emit("updateLayOut",{layoutType:e,sort:t})},updateSort(e){this.chooseSort=e},deleteModule(e,t){t===this.chooseSort?this.$emit("deleteModule",e):(this.cmsList.splice(e,1),this.$emit("saveVersionId"))},showOrHide(e){let t=this.cmsList[e];this.$set(t,"displayType",t.displayType?0:1),this.$emit("componentChange",t.sort)}}},$t=qt,Ht=$t,zt=(i("4664"),O(Ht,n,a,!1,null,"443f8186",null)),Vt=zt.exports;const Gt=[Vt],Wt=function(e){Wt.installed||Gt.map(t=>e.component(t.name,t))};var Xt={install:Wt};t["default"]=Xt},fc6a:function(e,t,i){"use strict";var r=i("44ad"),s=i("1d80");e.exports=function(e){return r(s(e))}},fda2:function(e,t,i){},fdbf:function(e,t,i){"use strict";var r=i("04f8");e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fdcb:function(e,t,i){},fe0f:function(e,t,i){},fe1c:function(e,t,i){}});
|